@ibiz-template-plugin/ai-chat 0.0.12 → 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 +1648 -1384
- package/dist/index.legacy.js +1 -1
- package/dist/polyfills.legacy.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/chat-back-bottom/chat-back-bottom.d.ts +28 -0
- package/dist/types/components/chat-container/chat-container.d.ts +59 -2
- package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +43 -1
- package/dist/types/controller/chat/chat.controller.d.ts +11 -4
- package/dist/types/entity/chat-message/chat-message.d.ts +1 -0
- package/dist/types/icons/arrow-down-outline-svg.d.ts +3 -0
- package/dist/types/icons/index.d.ts +2 -0
- package/dist/types/icons/send-svg.d.ts +3 -1
- package/dist/types/icons/stop-circle-svg.d.ts +3 -0
- package/dist/types/interface/i-chat-container/i-chat-container.d.ts +8 -0
- package/dist/types/interface/i-chat-message/i-chat-message.d.ts +8 -0
- package/dist/types/interface/i-chat-options/i-chat-options.d.ts +19 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,319 +1,319 @@
|
|
|
1
1
|
import './style.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var w = (
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
var $e,
|
|
8
|
-
function
|
|
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
|
-
|
|
11
|
-
return
|
|
10
|
+
i[t] = e[t];
|
|
11
|
+
return i;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
var e =
|
|
15
|
-
e && e.removeChild(
|
|
13
|
+
function Wt(i) {
|
|
14
|
+
var e = i.parentNode;
|
|
15
|
+
e && e.removeChild(i);
|
|
16
16
|
}
|
|
17
|
-
function I(
|
|
18
|
-
var
|
|
17
|
+
function I(i, e, t) {
|
|
18
|
+
var n, s, o, r = {};
|
|
19
19
|
for (o in e)
|
|
20
|
-
o == "key" ?
|
|
21
|
-
if (arguments.length > 2 && (r.children = arguments.length > 3 ? $e.call(arguments, 2) : t), typeof
|
|
22
|
-
for (o in
|
|
23
|
-
r[o] === void 0 && (r[o] =
|
|
24
|
-
return
|
|
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
|
|
27
|
-
var o = { type:
|
|
28
|
-
return s == null &&
|
|
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
|
|
30
|
+
function Le() {
|
|
31
31
|
return { current: null };
|
|
32
32
|
}
|
|
33
|
-
function se(
|
|
34
|
-
return
|
|
33
|
+
function se(i) {
|
|
34
|
+
return i.children;
|
|
35
35
|
}
|
|
36
|
-
function H(
|
|
37
|
-
this.props =
|
|
36
|
+
function H(i, e) {
|
|
37
|
+
this.props = i, this.context = e;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function pe(i, e) {
|
|
40
40
|
if (e == null)
|
|
41
|
-
return
|
|
42
|
-
for (var t; e <
|
|
43
|
-
if ((t =
|
|
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
|
|
45
|
+
return typeof i.type == "function" ? pe(i) : null;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Vt(i) {
|
|
48
48
|
var e, t;
|
|
49
|
-
if ((
|
|
50
|
-
for (
|
|
51
|
-
if ((t =
|
|
52
|
-
|
|
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
|
|
55
|
+
return Vt(i);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
(!
|
|
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
|
|
62
|
-
var
|
|
63
|
-
for (
|
|
64
|
-
|
|
65
|
-
|
|
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
|
|
68
|
-
var
|
|
69
|
-
for (t.__k = [],
|
|
70
|
-
(
|
|
71
|
-
for (t.__e =
|
|
72
|
-
|
|
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
|
|
75
|
-
for (var
|
|
76
|
-
(
|
|
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
|
|
80
|
-
return e = e || [],
|
|
81
|
-
|
|
82
|
-
}) : e.push(
|
|
79
|
+
function Se(i, e) {
|
|
80
|
+
return e = e || [], i == null || typeof i == "boolean" || (Me(i) ? i.some(function(t) {
|
|
81
|
+
Se(t, e);
|
|
82
|
+
}) : e.push(i)), e;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
return t == null || t.parentNode !==
|
|
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
|
|
88
|
-
var s =
|
|
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 (
|
|
92
|
-
for (; r >= 0 ||
|
|
91
|
+
if (n > (u != null ? 1 : 0))
|
|
92
|
+
for (; r >= 0 || a < e.length; ) {
|
|
93
93
|
if (r >= 0) {
|
|
94
94
|
if ((u = e[r]) && s == u.key && o === u.type)
|
|
95
95
|
return r;
|
|
96
96
|
r--;
|
|
97
97
|
}
|
|
98
|
-
if (
|
|
99
|
-
if ((u = e[
|
|
100
|
-
return
|
|
101
|
-
|
|
98
|
+
if (a < e.length) {
|
|
99
|
+
if ((u = e[a]) && s == u.key && o === u.type)
|
|
100
|
+
return a;
|
|
101
|
+
a++;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
return -1;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
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 ||
|
|
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] ||
|
|
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
|
|
114
|
-
e[0] === "-" ?
|
|
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
|
|
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
|
-
|
|
121
|
+
i.style.cssText = t;
|
|
122
122
|
else {
|
|
123
|
-
if (typeof
|
|
124
|
-
for (e in
|
|
125
|
-
t && e in t ||
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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] !== "-" ?
|
|
141
|
+
typeof t == "function" || (t == null || t === !1 && e[4] !== "-" ? i.removeAttribute(e) : i.setAttribute(e, t));
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
var e = this.l[
|
|
146
|
-
if (
|
|
147
|
-
if (
|
|
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
|
-
|
|
151
|
-
return e(
|
|
150
|
+
i.t = Date.now();
|
|
151
|
+
return e(g.event ? g.event(i) : i);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
return this.l[
|
|
153
|
+
function rt(i) {
|
|
154
|
+
return this.l[i.type + !0](g.event ? g.event(i) : i);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
var d,
|
|
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,
|
|
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 (
|
|
165
|
-
z.getDerivedStateFromProps == null &&
|
|
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
|
+
z.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), c.componentDidMount != null && c.__h.push(c.componentDidMount);
|
|
166
166
|
else {
|
|
167
|
-
if (z.getDerivedStateFromProps == null &&
|
|
168
|
-
for (e.__v !== t.__v && (
|
|
169
|
-
|
|
170
|
-
}), T = 0; T <
|
|
171
|
-
|
|
172
|
-
|
|
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
|
+
}), T = 0; T < c._sb.length; T++)
|
|
171
|
+
c.__h.push(c._sb[T]);
|
|
172
|
+
c._sb = [], c.__h.length && r.push(c);
|
|
173
173
|
break e;
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
|
|
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 (
|
|
180
|
-
for (
|
|
181
|
-
|
|
182
|
-
|
|
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
|
+
c.__h.push(c._sb[D]);
|
|
182
|
+
c._sb = [];
|
|
183
183
|
} else
|
|
184
184
|
do
|
|
185
|
-
|
|
186
|
-
while (
|
|
187
|
-
|
|
188
|
-
} catch (
|
|
189
|
-
e.__v = null, (u || o != null) && (e.__e =
|
|
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 =
|
|
193
|
-
(d =
|
|
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
|
|
196
|
-
for (var
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
200
|
+
i = s.__h, s.__h = [], i.some(function(o) {
|
|
201
201
|
o.call(s);
|
|
202
202
|
});
|
|
203
203
|
} catch (o) {
|
|
204
|
-
|
|
204
|
+
g.__e(o, s.__v);
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
var
|
|
210
|
-
if (
|
|
211
|
-
for (;
|
|
212
|
-
if ((
|
|
213
|
-
|
|
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 (
|
|
218
|
-
if (
|
|
219
|
-
return document.createTextNode(
|
|
220
|
-
|
|
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 (
|
|
223
|
-
|
|
222
|
+
if (f === null)
|
|
223
|
+
p === m || a && i.data === m || (i.data = m);
|
|
224
224
|
else {
|
|
225
|
-
if (o = o && $e.call(
|
|
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 (
|
|
228
|
-
|
|
229
|
-
(
|
|
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 (
|
|
231
|
+
if (wi(i, m, p, s, a), c)
|
|
232
232
|
e.__k = [];
|
|
233
|
-
else if (
|
|
234
|
-
for (
|
|
235
|
-
o[
|
|
236
|
-
|
|
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
|
|
238
|
+
return i;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function Ke(i, e, t) {
|
|
241
241
|
try {
|
|
242
|
-
typeof
|
|
243
|
-
} catch (
|
|
244
|
-
|
|
242
|
+
typeof i == "function" ? i(e) : i.current = e;
|
|
243
|
+
} catch (n) {
|
|
244
|
+
g.__e(n, t);
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
var
|
|
249
|
-
if (
|
|
250
|
-
if (
|
|
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
|
-
|
|
252
|
+
n.componentWillUnmount();
|
|
253
253
|
} catch (o) {
|
|
254
|
-
|
|
254
|
+
g.__e(o, e);
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
n.base = n.__P = null, i.__c = void 0;
|
|
257
257
|
}
|
|
258
|
-
if (
|
|
259
|
-
for (s = 0; s <
|
|
260
|
-
|
|
261
|
-
t ||
|
|
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
|
|
264
|
-
return this.constructor(
|
|
263
|
+
function Ti(i, e, t) {
|
|
264
|
+
return this.constructor(i, t);
|
|
265
265
|
}
|
|
266
|
-
function te(
|
|
267
|
-
var
|
|
268
|
-
|
|
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
|
|
271
|
-
var t = { __c: e = "__cC" +
|
|
272
|
-
return
|
|
273
|
-
}, Provider: function(
|
|
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
|
-
this.props.value !== r.value && s.some(function(
|
|
279
|
-
|
|
278
|
+
this.props.value !== r.value && s.some(function(a) {
|
|
279
|
+
a.__e = !0, je(a);
|
|
280
280
|
});
|
|
281
281
|
}, this.sub = function(r) {
|
|
282
282
|
s.push(r);
|
|
283
|
-
var
|
|
283
|
+
var a = r.componentWillUnmount;
|
|
284
284
|
r.componentWillUnmount = function() {
|
|
285
|
-
s.splice(s.indexOf(r), 1),
|
|
285
|
+
s.splice(s.indexOf(r), 1), a && a.call(r);
|
|
286
286
|
};
|
|
287
|
-
}),
|
|
287
|
+
}), n.children;
|
|
288
288
|
} };
|
|
289
289
|
return t.Provider.__ = t.Consumer.contextType = t;
|
|
290
290
|
}
|
|
291
|
-
$e =
|
|
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(
|
|
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
|
-
} catch (
|
|
298
|
-
|
|
297
|
+
} catch (a) {
|
|
298
|
+
i = a;
|
|
299
299
|
}
|
|
300
|
-
throw
|
|
301
|
-
} },
|
|
302
|
-
return
|
|
303
|
-
}, H.prototype.setState = function(
|
|
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 =
|
|
306
|
-
}, H.prototype.forceUpdate = function(
|
|
307
|
-
this.__v && (this.__e = !0,
|
|
308
|
-
}, H.prototype.render = se,
|
|
309
|
-
return
|
|
310
|
-
},
|
|
311
|
-
const
|
|
312
|
-
function
|
|
313
|
-
let o = "".concat(
|
|
314
|
-
return t && (o += "-".concat(t)),
|
|
315
|
-
}
|
|
316
|
-
class
|
|
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 ||
|
|
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
|
|
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 ?
|
|
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 ?
|
|
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 ?
|
|
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 ?
|
|
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 ?
|
|
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,
|
|
417
|
-
return e && t &&
|
|
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(
|
|
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
|
|
445
|
-
e[
|
|
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
|
|
459
|
-
e[
|
|
458
|
+
for (const n in e)
|
|
459
|
+
e[n] && (t[this.cssVarBlockName(n)] = e[n]);
|
|
460
460
|
return t;
|
|
461
461
|
}
|
|
462
462
|
/**
|
|
@@ -482,61 +482,61 @@ class M {
|
|
|
482
482
|
return "--".concat(this.namespace, "-").concat(this.block, "-").concat(e);
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
function L(
|
|
486
|
-
if (typeof
|
|
487
|
-
throw new TypeError("Path must be a string. Received " + JSON.stringify(
|
|
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
|
|
490
|
-
for (var t = "",
|
|
491
|
-
if (
|
|
492
|
-
r =
|
|
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;
|
|
496
496
|
r = 47;
|
|
497
497
|
}
|
|
498
498
|
if (r === 47) {
|
|
499
|
-
if (!(s ===
|
|
500
|
-
if (s !==
|
|
501
|
-
if (t.length < 2 ||
|
|
499
|
+
if (!(s === a - 1 || o === 1))
|
|
500
|
+
if (s !== a - 1 && o === 2) {
|
|
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 = "",
|
|
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 = "",
|
|
509
|
+
t = "", n = 0, s = a, o = 0;
|
|
510
510
|
continue;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
e && (t.length > 0 ? t += "/.." : t = "..",
|
|
513
|
+
e && (t.length > 0 ? t += "/.." : t = "..", n = 2);
|
|
514
514
|
} else
|
|
515
|
-
t.length > 0 ? t += "/" +
|
|
516
|
-
s =
|
|
515
|
+
t.length > 0 ? t += "/" + i.slice(s + 1, a) : t = i.slice(s + 1, a), n = a - s - 1;
|
|
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
|
|
523
|
-
var t = e.dir || e.root,
|
|
524
|
-
return t ? t === e.root ? t +
|
|
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
|
|
526
|
+
var he = {
|
|
527
527
|
// path.resolve([from ...], to)
|
|
528
528
|
resolve: function() {
|
|
529
|
-
for (var e = "", t = !1,
|
|
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] : (
|
|
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 =
|
|
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,
|
|
539
|
-
return 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
|
|
549
|
-
L(
|
|
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 ? "." :
|
|
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 =
|
|
554
|
+
if (L(e), L(t), e === t || (e = he.resolve(e), t = he.resolve(t), e === t))
|
|
555
555
|
return "";
|
|
556
|
-
for (var
|
|
556
|
+
for (var n = 1; n < e.length && e.charCodeAt(n) === 47; ++n)
|
|
557
557
|
;
|
|
558
|
-
for (var s = e.length, o = s -
|
|
558
|
+
for (var s = e.length, o = s - n, r = 1; r < t.length && t.charCodeAt(r) === 47; ++r)
|
|
559
559
|
;
|
|
560
|
-
for (var
|
|
561
|
-
if (
|
|
562
|
-
if (u >
|
|
563
|
-
if (t.charCodeAt(r +
|
|
564
|
-
return t.slice(r +
|
|
565
|
-
if (
|
|
566
|
-
return t.slice(r +
|
|
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
|
+
if (t.charCodeAt(r + c) === 47)
|
|
564
|
+
return t.slice(r + c + 1);
|
|
565
|
+
if (c === 0)
|
|
566
|
+
return t.slice(r + c);
|
|
567
567
|
} else
|
|
568
|
-
o >
|
|
568
|
+
o > h && (e.charCodeAt(n + c) === 47 ? d = c : c === 0 && (d = 0));
|
|
569
569
|
break;
|
|
570
570
|
}
|
|
571
|
-
var
|
|
572
|
-
if (
|
|
571
|
+
var p = e.charCodeAt(n + c), m = t.charCodeAt(r + c);
|
|
572
|
+
if (p !== m)
|
|
573
573
|
break;
|
|
574
|
-
|
|
574
|
+
p === 47 && (d = c);
|
|
575
575
|
}
|
|
576
|
-
var
|
|
577
|
-
for (
|
|
578
|
-
(
|
|
579
|
-
return
|
|
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),
|
|
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,96 +592,96 @@ var ue = {
|
|
|
592
592
|
}
|
|
593
593
|
} else
|
|
594
594
|
o = !1;
|
|
595
|
-
return s === -1 ?
|
|
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
|
|
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
|
-
var
|
|
605
|
+
var a = t.length - 1, u = -1;
|
|
606
606
|
for (r = e.length - 1; r >= 0; --r) {
|
|
607
|
-
var
|
|
608
|
-
if (
|
|
607
|
+
var h = e.charCodeAt(r);
|
|
608
|
+
if (h === 47) {
|
|
609
609
|
if (!o) {
|
|
610
|
-
|
|
610
|
+
n = r + 1;
|
|
611
611
|
break;
|
|
612
612
|
}
|
|
613
613
|
} else
|
|
614
|
-
u === -1 && (o = !1, u = r + 1),
|
|
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
|
|
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
|
-
|
|
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(
|
|
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,
|
|
632
|
-
var u = e.charCodeAt(
|
|
631
|
+
for (var t = -1, n = 0, s = -1, o = !0, r = 0, a = e.length - 1; a >= 0; --a) {
|
|
632
|
+
var u = e.charCodeAt(a);
|
|
633
633
|
if (u === 47) {
|
|
634
634
|
if (!o) {
|
|
635
|
-
|
|
635
|
+
n = a + 1;
|
|
636
636
|
break;
|
|
637
637
|
}
|
|
638
638
|
continue;
|
|
639
639
|
}
|
|
640
|
-
s === -1 && (o = !1, s =
|
|
640
|
+
s === -1 && (o = !1, s = a + 1), u === 46 ? t === -1 ? t = a : r !== 1 && (r = 1) : t !== -1 && (r = -1);
|
|
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 ===
|
|
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
|
|
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
|
|
656
|
+
var n = e.charCodeAt(0), s = n === 47, o;
|
|
657
657
|
s ? (t.root = "/", o = 1) : o = 0;
|
|
658
|
-
for (var r = -1,
|
|
659
|
-
if (
|
|
660
|
-
if (!
|
|
661
|
-
|
|
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
|
+
a = d + 1;
|
|
662
662
|
break;
|
|
663
663
|
}
|
|
664
664
|
continue;
|
|
665
665
|
}
|
|
666
|
-
u === -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
|
-
|
|
670
|
-
|
|
669
|
+
c === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
670
|
+
c === 1 && r === u - 1 && r === a + 1 ? u !== -1 && (a === 0 && s ? t.base = t.name = e.slice(1, u) : t.base = t.name = e.slice(a, u)) : (a === 0 && s ? (t.name = e.slice(1, r), t.base = e.slice(1, u)) : (t.name = e.slice(a, r), t.base = e.slice(a, u)), t.ext = e.slice(r, u)), a > 0 ? t.dir = e.slice(0, a - 1) : s && (t.dir = "/"), t;
|
|
671
671
|
},
|
|
672
672
|
sep: "/",
|
|
673
673
|
delimiter: ":",
|
|
674
674
|
win32: null,
|
|
675
675
|
posix: null
|
|
676
676
|
};
|
|
677
|
-
|
|
678
|
-
function
|
|
677
|
+
he.posix = he;
|
|
678
|
+
function W() {
|
|
679
679
|
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
680
680
|
}
|
|
681
|
-
function
|
|
682
|
-
return "".concat(
|
|
681
|
+
function Zt() {
|
|
682
|
+
return "".concat(W() + W(), "-").concat(W(), "-").concat(W(), "-").concat(W(), "-").concat(W()).concat(W()).concat(W());
|
|
683
683
|
}
|
|
684
|
-
class
|
|
684
|
+
class Gt {
|
|
685
685
|
/**
|
|
686
686
|
* 拷贝文本
|
|
687
687
|
*
|
|
@@ -702,8 +702,8 @@ class qt {
|
|
|
702
702
|
* @private
|
|
703
703
|
* @type {(HTMLInputElement | null)}
|
|
704
704
|
*/
|
|
705
|
-
w(
|
|
706
|
-
const
|
|
705
|
+
w(Gt, "inputElement", null);
|
|
706
|
+
const b = class b {
|
|
707
707
|
/**
|
|
708
708
|
* 检查数据库是否存在
|
|
709
709
|
*
|
|
@@ -713,7 +713,7 @@ const y = class y {
|
|
|
713
713
|
*/
|
|
714
714
|
static async checkDataBaseExists(e) {
|
|
715
715
|
try {
|
|
716
|
-
return (await indexedDB.databases()).some((
|
|
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 y = class y {
|
|
|
725
725
|
* @memberof IndexedDBUtil
|
|
726
726
|
*/
|
|
727
727
|
static async deleteDatabase(e) {
|
|
728
|
-
var t,
|
|
729
|
-
return
|
|
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,16 +746,16 @@ const y = class y {
|
|
|
746
746
|
* @memberof IndexedDBUtil
|
|
747
747
|
*/
|
|
748
748
|
static async checkTableExists(e, t) {
|
|
749
|
-
return await
|
|
749
|
+
return await b.checkDataBaseExists(e) ? new Promise((s, o) => {
|
|
750
750
|
const r = indexedDB.open(e);
|
|
751
|
-
r.onupgradeneeded = (
|
|
752
|
-
|
|
753
|
-
}, r.onsuccess = (
|
|
754
|
-
|
|
755
|
-
const u =
|
|
751
|
+
r.onupgradeneeded = (a) => {
|
|
752
|
+
b.db = a.target.result, b.version = b.db.version;
|
|
753
|
+
}, r.onsuccess = (a) => {
|
|
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
|
-
}, r.onerror = (
|
|
758
|
-
o(
|
|
757
|
+
}, r.onerror = (a) => {
|
|
758
|
+
o(a.target.error);
|
|
759
759
|
};
|
|
760
760
|
}) : !1;
|
|
761
761
|
}
|
|
@@ -768,18 +768,18 @@ const y = class y {
|
|
|
768
768
|
* @return {*} {Promise<void>}
|
|
769
769
|
* @memberof IndexedDBUtil
|
|
770
770
|
*/
|
|
771
|
-
static async createTable(e, t,
|
|
771
|
+
static async createTable(e, t, n, s = !1) {
|
|
772
772
|
return new Promise((o) => {
|
|
773
|
-
var
|
|
774
|
-
|
|
775
|
-
const r = indexedDB.open(e,
|
|
776
|
-
r.onupgradeneeded = (
|
|
777
|
-
if (
|
|
773
|
+
var a, u;
|
|
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
|
-
|
|
779
|
+
n ? d.keyPath = n : s && (d.autoIncrement = !0), b.db.createObjectStore(t, d);
|
|
780
780
|
}
|
|
781
781
|
}, r.onsuccess = () => {
|
|
782
|
-
|
|
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 y = class y {
|
|
|
793
793
|
* @memberof IndexedDBUtil
|
|
794
794
|
*/
|
|
795
795
|
static async deleteTable(e, t) {
|
|
796
|
-
return new Promise((
|
|
796
|
+
return new Promise((n) => {
|
|
797
797
|
var o, r;
|
|
798
|
-
|
|
799
|
-
const s = indexedDB.open(e,
|
|
800
|
-
s.onupgradeneeded = (
|
|
801
|
-
|
|
802
|
-
}, s.onsuccess = (
|
|
803
|
-
|
|
798
|
+
b.version += 1, b.lastLink && ((r = (o = b.lastLink).close) == null || r.call(o));
|
|
799
|
+
const s = indexedDB.open(e, b.version);
|
|
800
|
+
s.onupgradeneeded = (a) => {
|
|
801
|
+
b.db = a.target.result, b.lastLink = s.result, b.db.objectStoreNames.contains(t) && b.db.deleteObjectStore(t);
|
|
802
|
+
}, s.onsuccess = (a) => {
|
|
803
|
+
b.db = a.target.result, b.lastLink = s.result, s.result.close(), n(!0);
|
|
804
804
|
}, s.onerror = () => {
|
|
805
|
-
s.result.close(),
|
|
805
|
+
s.result.close(), n(!1);
|
|
806
806
|
};
|
|
807
807
|
});
|
|
808
808
|
}
|
|
@@ -814,14 +814,14 @@ const y = class y {
|
|
|
814
814
|
* @return {*} {Promise<void>}
|
|
815
815
|
* @memberof IndexedDBUtil
|
|
816
816
|
*/
|
|
817
|
-
static async addData(e, t,
|
|
817
|
+
static async addData(e, t, n) {
|
|
818
818
|
return new Promise((s, o) => {
|
|
819
819
|
const r = indexedDB.open(e);
|
|
820
|
-
r.onsuccess = (
|
|
821
|
-
if (
|
|
822
|
-
const d =
|
|
823
|
-
d.onsuccess = (
|
|
824
|
-
s(
|
|
820
|
+
r.onsuccess = (a) => {
|
|
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
|
+
d.onsuccess = (c) => {
|
|
824
|
+
s(n);
|
|
825
825
|
}, d.onerror = () => {
|
|
826
826
|
s(null);
|
|
827
827
|
};
|
|
@@ -840,13 +840,13 @@ const y = class y {
|
|
|
840
840
|
* @return {*} {Promise<void>}
|
|
841
841
|
* @memberof IndexedDBUtil
|
|
842
842
|
*/
|
|
843
|
-
static async deleteData(e, t,
|
|
843
|
+
static async deleteData(e, t, n) {
|
|
844
844
|
return new Promise((s, o) => {
|
|
845
845
|
const r = indexedDB.open(e);
|
|
846
|
-
r.onsuccess = (
|
|
847
|
-
if (
|
|
848
|
-
const d =
|
|
849
|
-
d.onsuccess = (
|
|
846
|
+
r.onsuccess = (a) => {
|
|
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
|
+
d.onsuccess = (c) => {
|
|
850
850
|
s(!0);
|
|
851
851
|
}, d.onerror = () => {
|
|
852
852
|
s(!1);
|
|
@@ -866,16 +866,16 @@ const y = class y {
|
|
|
866
866
|
* @return {*} {Promise<void>}
|
|
867
867
|
* @memberof IndexedDBUtil
|
|
868
868
|
*/
|
|
869
|
-
static async updateData(e, t,
|
|
869
|
+
static async updateData(e, t, n) {
|
|
870
870
|
return new Promise((s, o) => {
|
|
871
871
|
const r = indexedDB.open(e);
|
|
872
|
-
r.onsuccess = (
|
|
873
|
-
if (
|
|
874
|
-
const d =
|
|
875
|
-
d.onsuccess = (
|
|
876
|
-
s(
|
|
872
|
+
r.onsuccess = (a) => {
|
|
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
|
+
d.onsuccess = (c) => {
|
|
876
|
+
s(n);
|
|
877
877
|
}, d.onerror = () => {
|
|
878
|
-
s(
|
|
878
|
+
s(n);
|
|
879
879
|
};
|
|
880
880
|
}
|
|
881
881
|
r.result.close();
|
|
@@ -892,16 +892,16 @@ const y = class y {
|
|
|
892
892
|
* @return {*} {Promise<any>}
|
|
893
893
|
* @memberof IndexedDBUtil
|
|
894
894
|
*/
|
|
895
|
-
static async getData(e, t,
|
|
895
|
+
static async getData(e, t, n) {
|
|
896
896
|
return new Promise((s, o) => {
|
|
897
897
|
const r = indexedDB.open(e);
|
|
898
|
-
r.onsuccess = (
|
|
899
|
-
if (
|
|
900
|
-
const d =
|
|
901
|
-
d.onsuccess = (
|
|
898
|
+
r.onsuccess = (a) => {
|
|
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
|
+
d.onsuccess = (c) => {
|
|
902
902
|
s(d.result);
|
|
903
903
|
}, d.onerror = () => {
|
|
904
|
-
o(new Error("未找到数据".concat(
|
|
904
|
+
o(new Error("未找到数据".concat(n)));
|
|
905
905
|
};
|
|
906
906
|
}
|
|
907
907
|
r.result.close();
|
|
@@ -918,15 +918,15 @@ const y = class y {
|
|
|
918
918
|
* @memberof IndexedDBUtil
|
|
919
919
|
*/
|
|
920
920
|
static async getAllData(e, t) {
|
|
921
|
-
return new Promise((
|
|
921
|
+
return new Promise((n, s) => {
|
|
922
922
|
const o = indexedDB.open(e);
|
|
923
923
|
o.onsuccess = (r) => {
|
|
924
|
-
if (
|
|
925
|
-
const
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
},
|
|
929
|
-
|
|
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 y = class y {
|
|
|
937
937
|
}
|
|
938
938
|
};
|
|
939
939
|
// 数据库版本
|
|
940
|
-
w(
|
|
941
|
-
w(
|
|
942
|
-
w(
|
|
943
|
-
let
|
|
944
|
-
class
|
|
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,36 +963,36 @@ class xn {
|
|
|
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
|
|
967
|
-
this.handleFiles(
|
|
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
|
|
974
|
+
var n, s;
|
|
975
975
|
if (e.length === 0)
|
|
976
976
|
return;
|
|
977
977
|
const t = e.filter((o) => {
|
|
978
|
-
var r,
|
|
979
|
-
return this.options.maxSize && o.size > this.options.maxSize ? ((
|
|
978
|
+
var r, a;
|
|
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 = (
|
|
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,
|
|
987
|
+
var t, n, s, o, r, a;
|
|
988
988
|
try {
|
|
989
989
|
const u = (d) => {
|
|
990
|
-
var
|
|
991
|
-
(
|
|
992
|
-
},
|
|
993
|
-
(
|
|
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
|
}
|
|
997
997
|
}
|
|
998
998
|
/**
|
|
@@ -1001,11 +1001,11 @@ class xn {
|
|
|
1001
1001
|
formatSize(e) {
|
|
1002
1002
|
if (e === 0)
|
|
1003
1003
|
return "0 B";
|
|
1004
|
-
const t = ["B", "KB", "MB", "GB"],
|
|
1005
|
-
return "".concat((e / 1024 **
|
|
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
|
|
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((
|
|
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
|
|
1036
|
-
return Array.from(
|
|
1037
|
-
const r = o.getAttribute("type") || "",
|
|
1035
|
+
const n = new DOMParser().parseFromString(e, "text/xml");
|
|
1036
|
+
return Array.from(n.querySelectorAll("resource")).map((o) => {
|
|
1037
|
+
const r = o.getAttribute("type") || "", a = o.querySelector("data"), u = o.querySelector("metadata");
|
|
1038
1038
|
try {
|
|
1039
|
-
const
|
|
1039
|
+
const h = this.getCdataContent(a), d = this.getCdataContent(u), c = h ? JSON.parse(h) : {}, p = d ? JSON.parse(d) : {};
|
|
1040
1040
|
return {
|
|
1041
|
-
id:
|
|
1041
|
+
id: c.id,
|
|
1042
1042
|
type: r,
|
|
1043
|
-
data:
|
|
1044
|
-
metadata:
|
|
1043
|
+
data: c,
|
|
1044
|
+
metadata: p
|
|
1045
1045
|
};
|
|
1046
|
-
} catch (
|
|
1047
|
-
throw new Error("XML 解析错误: ".concat(
|
|
1046
|
+
} catch (h) {
|
|
1047
|
+
throw new Error("XML 解析错误: ".concat(h.message));
|
|
1048
1048
|
}
|
|
1049
1049
|
});
|
|
1050
1050
|
}
|
|
@@ -1063,24 +1063,24 @@ class jt {
|
|
|
1063
1063
|
* }}
|
|
1064
1064
|
*/
|
|
1065
1065
|
static parseMixedContent(e) {
|
|
1066
|
-
const
|
|
1067
|
-
if (!
|
|
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] =
|
|
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),
|
|
1077
|
-
remainingText:
|
|
1077
|
+
remainingText: a,
|
|
1078
1078
|
hasResources: !0
|
|
1079
1079
|
};
|
|
1080
1080
|
} catch (u) {
|
|
1081
1081
|
return {
|
|
1082
1082
|
resources: [],
|
|
1083
|
-
remainingText:
|
|
1083
|
+
remainingText: a,
|
|
1084
1084
|
hasResources: !0,
|
|
1085
1085
|
error: "资源解析失败: ".concat(u.message)
|
|
1086
1086
|
};
|
|
@@ -1096,219 +1096,219 @@ class jt {
|
|
|
1096
1096
|
* @return {*} {string}
|
|
1097
1097
|
*/
|
|
1098
1098
|
static stringify(e) {
|
|
1099
|
-
const t = document.implementation.createDocument(null, null, null),
|
|
1100
|
-
|
|
1099
|
+
const t = document.implementation.createDocument(null, null, null), n = t.createElement("resources");
|
|
1100
|
+
n.setAttribute("version", "1.0");
|
|
1101
1101
|
const s = (r) => "\n".concat(" ".repeat(r)), o = 1;
|
|
1102
1102
|
return e.forEach((r) => {
|
|
1103
|
-
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
-
const u = (
|
|
1107
|
-
const
|
|
1108
|
-
|
|
1109
|
-
const
|
|
1110
|
-
return
|
|
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;
|
|
1111
1111
|
};
|
|
1112
|
-
|
|
1113
|
-
}),
|
|
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
1114
|
}
|
|
1115
1115
|
}
|
|
1116
|
-
var oe, x,
|
|
1117
|
-
function
|
|
1118
|
-
|
|
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
1119
|
var t = x.__H || (x.__H = { __: [], __h: [] });
|
|
1120
|
-
return
|
|
1121
|
-
}
|
|
1122
|
-
function
|
|
1123
|
-
return
|
|
1124
|
-
}
|
|
1125
|
-
function
|
|
1126
|
-
var
|
|
1127
|
-
if (
|
|
1128
|
-
var u =
|
|
1129
|
-
u !==
|
|
1130
|
-
}],
|
|
1131
|
-
var s = function(
|
|
1132
|
-
if (!
|
|
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)
|
|
1133
1133
|
return !0;
|
|
1134
|
-
var d =
|
|
1135
|
-
return
|
|
1134
|
+
var d = n.__c.__H.__.filter(function(p) {
|
|
1135
|
+
return p.__c;
|
|
1136
1136
|
});
|
|
1137
|
-
if (d.every(function(
|
|
1138
|
-
return !
|
|
1137
|
+
if (d.every(function(p) {
|
|
1138
|
+
return !p.__N;
|
|
1139
1139
|
}))
|
|
1140
|
-
return !o || o.call(this,
|
|
1141
|
-
var
|
|
1142
|
-
return d.forEach(function(
|
|
1143
|
-
if (
|
|
1144
|
-
var
|
|
1145
|
-
|
|
1140
|
+
return !o || o.call(this, a, u, h);
|
|
1141
|
+
var c = !1;
|
|
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);
|
|
1146
1146
|
}
|
|
1147
|
-
}), !(!
|
|
1147
|
+
}), !(!c && n.__c.props === a) && (!o || o.call(this, a, u, h));
|
|
1148
1148
|
};
|
|
1149
1149
|
x.u = !0;
|
|
1150
1150
|
var o = x.shouldComponentUpdate, r = x.componentWillUpdate;
|
|
1151
|
-
x.componentWillUpdate = function(
|
|
1151
|
+
x.componentWillUpdate = function(a, u, h) {
|
|
1152
1152
|
if (this.__e) {
|
|
1153
1153
|
var d = o;
|
|
1154
|
-
o = void 0, s(
|
|
1154
|
+
o = void 0, s(a, u, h), o = d;
|
|
1155
1155
|
}
|
|
1156
|
-
r && r.call(this,
|
|
1156
|
+
r && r.call(this, a, u, h);
|
|
1157
1157
|
}, x.shouldComponentUpdate = s;
|
|
1158
1158
|
}
|
|
1159
|
-
return
|
|
1159
|
+
return n.__N || n.__;
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1162
|
-
var t =
|
|
1163
|
-
!
|
|
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));
|
|
1164
1164
|
}
|
|
1165
|
-
function K(
|
|
1166
|
-
return
|
|
1167
|
-
return { current:
|
|
1165
|
+
function K(i) {
|
|
1166
|
+
return _e = 5, P(function() {
|
|
1167
|
+
return { current: i };
|
|
1168
1168
|
}, []);
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1171
|
-
var t =
|
|
1172
|
-
return
|
|
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.__;
|
|
1173
1173
|
}
|
|
1174
|
-
function
|
|
1175
|
-
return
|
|
1176
|
-
return
|
|
1174
|
+
function Be(i, e) {
|
|
1175
|
+
return _e = 8, P(function() {
|
|
1176
|
+
return i;
|
|
1177
1177
|
}, e);
|
|
1178
1178
|
}
|
|
1179
|
-
function
|
|
1180
|
-
var e = x.context[
|
|
1181
|
-
return t.c =
|
|
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.__;
|
|
1182
1182
|
}
|
|
1183
|
-
function
|
|
1184
|
-
for (var
|
|
1185
|
-
if (
|
|
1183
|
+
function Mi() {
|
|
1184
|
+
for (var i; i = Kt.shift(); )
|
|
1185
|
+
if (i.__P && i.__H)
|
|
1186
1186
|
try {
|
|
1187
|
-
|
|
1187
|
+
i.__H.__h.forEach(Te), i.__H.__h.forEach(Xe), i.__H.__h = [];
|
|
1188
1188
|
} catch (e) {
|
|
1189
|
-
|
|
1189
|
+
i.__H.__h = [], g.__e(e, i.__v);
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
|
-
|
|
1193
|
-
x = null,
|
|
1194
|
-
},
|
|
1195
|
-
|
|
1196
|
-
var e = (x =
|
|
1197
|
-
e && (
|
|
1198
|
-
t.__N && (t.__ = t.__N), t.__V =
|
|
1199
|
-
})) : (e.__h.forEach(
|
|
1200
|
-
},
|
|
1201
|
-
|
|
1202
|
-
var e =
|
|
1203
|
-
e && e.__H && (e.__H.__h.length && (
|
|
1204
|
-
t.i && (t.__H = t.i), t.__V !==
|
|
1205
|
-
})),
|
|
1206
|
-
},
|
|
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) {
|
|
1207
1207
|
e.some(function(t) {
|
|
1208
1208
|
try {
|
|
1209
|
-
t.__h.forEach(
|
|
1210
|
-
return !
|
|
1209
|
+
t.__h.forEach(Te), t.__h = t.__h.filter(function(n) {
|
|
1210
|
+
return !n.__ || Xe(n);
|
|
1211
1211
|
});
|
|
1212
|
-
} catch (
|
|
1212
|
+
} catch (n) {
|
|
1213
1213
|
e.some(function(s) {
|
|
1214
1214
|
s.__h && (s.__h = []);
|
|
1215
|
-
}), e = [],
|
|
1215
|
+
}), e = [], g.__e(n, t.__v);
|
|
1216
1216
|
}
|
|
1217
|
-
}),
|
|
1218
|
-
},
|
|
1219
|
-
|
|
1220
|
-
var e, t =
|
|
1221
|
-
t && t.__H && (t.__H.__.forEach(function(
|
|
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) {
|
|
1222
1222
|
try {
|
|
1223
|
-
|
|
1223
|
+
Te(n);
|
|
1224
1224
|
} catch (s) {
|
|
1225
1225
|
e = s;
|
|
1226
1226
|
}
|
|
1227
|
-
}), t.__H = void 0, e &&
|
|
1227
|
+
}), t.__H = void 0, e && g.__e(e, t.__v));
|
|
1228
1228
|
};
|
|
1229
|
-
var
|
|
1230
|
-
function
|
|
1229
|
+
var pt = typeof requestAnimationFrame == "function";
|
|
1230
|
+
function Ai(i) {
|
|
1231
1231
|
var e, t = function() {
|
|
1232
|
-
clearTimeout(
|
|
1233
|
-
},
|
|
1234
|
-
|
|
1232
|
+
clearTimeout(n), pt && cancelAnimationFrame(e), setTimeout(i);
|
|
1233
|
+
}, n = setTimeout(t, 100);
|
|
1234
|
+
pt && (e = requestAnimationFrame(t));
|
|
1235
1235
|
}
|
|
1236
|
-
function
|
|
1237
|
-
var e = x, t =
|
|
1238
|
-
typeof t == "function" && (
|
|
1236
|
+
function Te(i) {
|
|
1237
|
+
var e = x, t = i.__c;
|
|
1238
|
+
typeof t == "function" && (i.__c = void 0, t()), x = e;
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1240
|
+
function Xe(i) {
|
|
1241
1241
|
var e = x;
|
|
1242
|
-
|
|
1242
|
+
i.__c = i.__(), x = e;
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1245
|
-
return !
|
|
1246
|
-
return t !== n
|
|
1244
|
+
function ei(i, e) {
|
|
1245
|
+
return !i || i.length !== e.length || e.some(function(t, n) {
|
|
1246
|
+
return t !== i[n];
|
|
1247
1247
|
});
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1250
|
-
return typeof e == "function" ? e(
|
|
1249
|
+
function ti(i, e) {
|
|
1250
|
+
return typeof e == "function" ? e(i) : e;
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1252
|
+
function Ie() {
|
|
1253
1253
|
throw new Error("Cycle detected");
|
|
1254
1254
|
}
|
|
1255
|
-
var
|
|
1256
|
-
function
|
|
1257
|
-
if (
|
|
1258
|
-
|
|
1255
|
+
var Ii = Symbol.for("preact-signals");
|
|
1256
|
+
function et() {
|
|
1257
|
+
if (ne > 1)
|
|
1258
|
+
ne--;
|
|
1259
1259
|
else {
|
|
1260
|
-
for (var
|
|
1260
|
+
for (var i, e = !1; de !== void 0; ) {
|
|
1261
1261
|
var t = de;
|
|
1262
|
-
for (de = void 0,
|
|
1263
|
-
var
|
|
1264
|
-
if (t.o = void 0, t.f &= -3, !(8 & t.f) &&
|
|
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))
|
|
1265
1265
|
try {
|
|
1266
1266
|
t.c();
|
|
1267
1267
|
} catch (s) {
|
|
1268
|
-
e || (
|
|
1268
|
+
e || (i = s, e = !0);
|
|
1269
1269
|
}
|
|
1270
|
-
t =
|
|
1270
|
+
t = n;
|
|
1271
1271
|
}
|
|
1272
1272
|
}
|
|
1273
|
-
if (
|
|
1274
|
-
throw
|
|
1273
|
+
if (Ze = 0, ne--, e)
|
|
1274
|
+
throw i;
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
|
-
var S = void 0, de = void 0,
|
|
1278
|
-
function
|
|
1277
|
+
var S = void 0, de = void 0, ne = 0, Ze = 0, Ee = 0;
|
|
1278
|
+
function ii(i) {
|
|
1279
1279
|
if (S !== void 0) {
|
|
1280
|
-
var e =
|
|
1280
|
+
var e = i.n;
|
|
1281
1281
|
if (e === void 0 || e.t !== S)
|
|
1282
|
-
return e = { i: 0, 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;
|
|
1283
1283
|
if (e.i === -1)
|
|
1284
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;
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
|
-
function A(
|
|
1288
|
-
this.v =
|
|
1287
|
+
function A(i) {
|
|
1288
|
+
this.v = i, this.i = 0, this.n = void 0, this.t = void 0;
|
|
1289
1289
|
}
|
|
1290
|
-
A.prototype.brand =
|
|
1290
|
+
A.prototype.brand = Ii;
|
|
1291
1291
|
A.prototype.h = function() {
|
|
1292
1292
|
return !0;
|
|
1293
1293
|
};
|
|
1294
|
-
A.prototype.S = function(
|
|
1295
|
-
this.t !==
|
|
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);
|
|
1296
1296
|
};
|
|
1297
|
-
A.prototype.U = function(
|
|
1297
|
+
A.prototype.U = function(i) {
|
|
1298
1298
|
if (this.t !== void 0) {
|
|
1299
|
-
var e =
|
|
1300
|
-
e !== void 0 && (e.x = 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);
|
|
1301
1301
|
}
|
|
1302
1302
|
};
|
|
1303
|
-
A.prototype.subscribe = function(
|
|
1303
|
+
A.prototype.subscribe = function(i) {
|
|
1304
1304
|
var e = this;
|
|
1305
|
-
return
|
|
1306
|
-
var t = e.value,
|
|
1305
|
+
return De(function() {
|
|
1306
|
+
var t = e.value, n = 32 & this.f;
|
|
1307
1307
|
this.f &= -33;
|
|
1308
1308
|
try {
|
|
1309
|
-
|
|
1309
|
+
i(t);
|
|
1310
1310
|
} finally {
|
|
1311
|
-
this.f |=
|
|
1311
|
+
this.f |= n;
|
|
1312
1312
|
}
|
|
1313
1313
|
});
|
|
1314
1314
|
};
|
|
@@ -1325,155 +1325,155 @@ A.prototype.peek = function() {
|
|
|
1325
1325
|
return this.v;
|
|
1326
1326
|
};
|
|
1327
1327
|
Object.defineProperty(A.prototype, "value", { get: function() {
|
|
1328
|
-
var
|
|
1329
|
-
return
|
|
1330
|
-
}, set: function(
|
|
1331
|
-
if (S instanceof
|
|
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() {
|
|
1332
1332
|
throw new Error("Computed cannot have side-effects");
|
|
1333
|
-
}(),
|
|
1334
|
-
|
|
1333
|
+
}(), i !== this.v) {
|
|
1334
|
+
Ze > 100 && Ie(), this.v = i, this.i++, Ee++, ne++;
|
|
1335
1335
|
try {
|
|
1336
1336
|
for (var e = this.t; e !== void 0; e = e.x)
|
|
1337
1337
|
e.t.N();
|
|
1338
1338
|
} finally {
|
|
1339
|
-
|
|
1339
|
+
et();
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
1342
|
} });
|
|
1343
|
-
function
|
|
1344
|
-
return new A(
|
|
1343
|
+
function j(i) {
|
|
1344
|
+
return new A(i);
|
|
1345
1345
|
}
|
|
1346
|
-
function
|
|
1347
|
-
for (var e =
|
|
1346
|
+
function ni(i) {
|
|
1347
|
+
for (var e = i.s; e !== void 0; e = e.n)
|
|
1348
1348
|
if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i)
|
|
1349
1349
|
return !0;
|
|
1350
1350
|
return !1;
|
|
1351
1351
|
}
|
|
1352
|
-
function
|
|
1353
|
-
for (var e =
|
|
1352
|
+
function si(i) {
|
|
1353
|
+
for (var e = i.s; e !== void 0; e = e.n) {
|
|
1354
1354
|
var t = e.S.n;
|
|
1355
1355
|
if (t !== void 0 && (e.r = t), e.S.n = e, e.i = -1, e.n === void 0) {
|
|
1356
|
-
|
|
1356
|
+
i.s = e;
|
|
1357
1357
|
break;
|
|
1358
1358
|
}
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
|
-
function
|
|
1362
|
-
for (var e =
|
|
1363
|
-
var
|
|
1364
|
-
e.i === -1 ? (e.S.U(e),
|
|
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;
|
|
1365
1365
|
}
|
|
1366
|
-
|
|
1366
|
+
i.s = t;
|
|
1367
1367
|
}
|
|
1368
|
-
function
|
|
1369
|
-
A.call(this, void 0), this.x =
|
|
1368
|
+
function X(i) {
|
|
1369
|
+
A.call(this, void 0), this.x = i, this.s = void 0, this.g = Ee - 1, this.f = 4;
|
|
1370
1370
|
}
|
|
1371
|
-
(
|
|
1371
|
+
(X.prototype = new A()).h = function() {
|
|
1372
1372
|
if (this.f &= -3, 1 & this.f)
|
|
1373
1373
|
return !1;
|
|
1374
1374
|
if ((36 & this.f) == 32 || (this.f &= -5, this.g === Ee))
|
|
1375
1375
|
return !0;
|
|
1376
|
-
if (this.g = Ee, this.f |= 1, this.i > 0 && !
|
|
1376
|
+
if (this.g = Ee, this.f |= 1, this.i > 0 && !ni(this))
|
|
1377
1377
|
return this.f &= -2, !0;
|
|
1378
|
-
var
|
|
1378
|
+
var i = S;
|
|
1379
1379
|
try {
|
|
1380
|
-
|
|
1380
|
+
si(this), S = this;
|
|
1381
1381
|
var e = this.x();
|
|
1382
1382
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
1383
1383
|
} catch (t) {
|
|
1384
1384
|
this.v = t, this.f |= 16, this.i++;
|
|
1385
1385
|
}
|
|
1386
|
-
return S =
|
|
1386
|
+
return S = i, oi(this), this.f &= -2, !0;
|
|
1387
1387
|
};
|
|
1388
|
-
|
|
1388
|
+
X.prototype.S = function(i) {
|
|
1389
1389
|
if (this.t === void 0) {
|
|
1390
1390
|
this.f |= 36;
|
|
1391
1391
|
for (var e = this.s; e !== void 0; e = e.n)
|
|
1392
1392
|
e.S.S(e);
|
|
1393
1393
|
}
|
|
1394
|
-
A.prototype.S.call(this,
|
|
1394
|
+
A.prototype.S.call(this, i);
|
|
1395
1395
|
};
|
|
1396
|
-
|
|
1397
|
-
if (this.t !== void 0 && (A.prototype.U.call(this,
|
|
1396
|
+
X.prototype.U = function(i) {
|
|
1397
|
+
if (this.t !== void 0 && (A.prototype.U.call(this, i), this.t === void 0)) {
|
|
1398
1398
|
this.f &= -33;
|
|
1399
1399
|
for (var e = this.s; e !== void 0; e = e.n)
|
|
1400
1400
|
e.S.U(e);
|
|
1401
1401
|
}
|
|
1402
1402
|
};
|
|
1403
|
-
|
|
1403
|
+
X.prototype.N = function() {
|
|
1404
1404
|
if (!(2 & this.f)) {
|
|
1405
1405
|
this.f |= 6;
|
|
1406
|
-
for (var
|
|
1407
|
-
|
|
1406
|
+
for (var i = this.t; i !== void 0; i = i.x)
|
|
1407
|
+
i.t.N();
|
|
1408
1408
|
}
|
|
1409
1409
|
};
|
|
1410
|
-
|
|
1411
|
-
if (this.h() ||
|
|
1410
|
+
X.prototype.peek = function() {
|
|
1411
|
+
if (this.h() || Ie(), 16 & this.f)
|
|
1412
1412
|
throw this.v;
|
|
1413
1413
|
return this.v;
|
|
1414
1414
|
};
|
|
1415
|
-
Object.defineProperty(
|
|
1416
|
-
1 & this.f &&
|
|
1417
|
-
var
|
|
1418
|
-
if (this.h(),
|
|
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)
|
|
1419
1419
|
throw this.v;
|
|
1420
1420
|
return this.v;
|
|
1421
1421
|
} });
|
|
1422
|
-
function
|
|
1423
|
-
return new
|
|
1422
|
+
function ri(i) {
|
|
1423
|
+
return new X(i);
|
|
1424
1424
|
}
|
|
1425
|
-
function
|
|
1426
|
-
var e =
|
|
1427
|
-
if (
|
|
1428
|
-
|
|
1425
|
+
function ai(i) {
|
|
1426
|
+
var e = i.u;
|
|
1427
|
+
if (i.u = void 0, typeof e == "function") {
|
|
1428
|
+
ne++;
|
|
1429
1429
|
var t = S;
|
|
1430
1430
|
S = void 0;
|
|
1431
1431
|
try {
|
|
1432
1432
|
e();
|
|
1433
|
-
} catch (
|
|
1434
|
-
throw
|
|
1433
|
+
} catch (n) {
|
|
1434
|
+
throw i.f &= -2, i.f |= 8, tt(i), n;
|
|
1435
1435
|
} finally {
|
|
1436
|
-
S = t,
|
|
1436
|
+
S = t, et();
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
1439
|
}
|
|
1440
|
-
function
|
|
1441
|
-
for (var e =
|
|
1440
|
+
function tt(i) {
|
|
1441
|
+
for (var e = i.s; e !== void 0; e = e.n)
|
|
1442
1442
|
e.S.U(e);
|
|
1443
|
-
|
|
1443
|
+
i.x = void 0, i.s = void 0, ai(i);
|
|
1444
1444
|
}
|
|
1445
|
-
function
|
|
1445
|
+
function Di(i) {
|
|
1446
1446
|
if (S !== this)
|
|
1447
1447
|
throw new Error("Out-of-order effect");
|
|
1448
|
-
|
|
1448
|
+
oi(this), S = i, this.f &= -2, 8 & this.f && tt(this), et();
|
|
1449
1449
|
}
|
|
1450
|
-
function
|
|
1451
|
-
this.x =
|
|
1450
|
+
function ve(i) {
|
|
1451
|
+
this.x = i, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32;
|
|
1452
1452
|
}
|
|
1453
|
-
|
|
1454
|
-
var
|
|
1453
|
+
ve.prototype.c = function() {
|
|
1454
|
+
var i = this.S();
|
|
1455
1455
|
try {
|
|
1456
1456
|
if (8 & this.f || this.x === void 0)
|
|
1457
1457
|
return;
|
|
1458
1458
|
var e = this.x();
|
|
1459
1459
|
typeof e == "function" && (this.u = e);
|
|
1460
1460
|
} finally {
|
|
1461
|
-
|
|
1461
|
+
i();
|
|
1462
1462
|
}
|
|
1463
1463
|
};
|
|
1464
|
-
|
|
1465
|
-
1 & this.f &&
|
|
1466
|
-
var
|
|
1467
|
-
return S = this,
|
|
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);
|
|
1468
1468
|
};
|
|
1469
|
-
|
|
1469
|
+
ve.prototype.N = function() {
|
|
1470
1470
|
2 & this.f || (this.f |= 2, this.o = de, de = this);
|
|
1471
1471
|
};
|
|
1472
|
-
|
|
1473
|
-
this.f |= 8, 1 & this.f ||
|
|
1472
|
+
ve.prototype.d = function() {
|
|
1473
|
+
this.f |= 8, 1 & this.f || tt(this);
|
|
1474
1474
|
};
|
|
1475
|
-
function
|
|
1476
|
-
var e = new
|
|
1475
|
+
function De(i) {
|
|
1476
|
+
var e = new ve(i);
|
|
1477
1477
|
try {
|
|
1478
1478
|
e.c();
|
|
1479
1479
|
} catch (t) {
|
|
@@ -1481,18 +1481,18 @@ function Ie(n) {
|
|
|
1481
1481
|
}
|
|
1482
1482
|
return e.d.bind(e);
|
|
1483
1483
|
}
|
|
1484
|
-
var
|
|
1485
|
-
function re(
|
|
1486
|
-
|
|
1484
|
+
var ze, Re;
|
|
1485
|
+
function re(i, e) {
|
|
1486
|
+
g[i] = e.bind(null, g[i] || function() {
|
|
1487
1487
|
});
|
|
1488
1488
|
}
|
|
1489
|
-
function Ne(
|
|
1490
|
-
|
|
1489
|
+
function Ne(i) {
|
|
1490
|
+
Re && Re(), Re = i && i.S();
|
|
1491
1491
|
}
|
|
1492
|
-
function
|
|
1493
|
-
var e = this, t =
|
|
1494
|
-
|
|
1495
|
-
var s =
|
|
1492
|
+
function ci(i) {
|
|
1493
|
+
var e = this, t = i.data, n = B(t);
|
|
1494
|
+
n.value = t;
|
|
1495
|
+
var s = P(function() {
|
|
1496
1496
|
for (var o = e.__v; o = o.__; )
|
|
1497
1497
|
if (o.__c) {
|
|
1498
1498
|
o.__c.__$f |= 4;
|
|
@@ -1500,84 +1500,84 @@ function nn(n) {
|
|
|
1500
1500
|
}
|
|
1501
1501
|
return e.__$u.c = function() {
|
|
1502
1502
|
var r;
|
|
1503
|
-
!
|
|
1504
|
-
},
|
|
1505
|
-
var r =
|
|
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;
|
|
1506
1506
|
return r === 0 ? 0 : r === !0 ? "" : r || "";
|
|
1507
1507
|
});
|
|
1508
1508
|
}, []);
|
|
1509
1509
|
return s.value;
|
|
1510
1510
|
}
|
|
1511
|
-
|
|
1512
|
-
Object.defineProperties(A.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value:
|
|
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() {
|
|
1513
1513
|
return { data: this };
|
|
1514
1514
|
} }, __b: { configurable: !0, value: 1 } });
|
|
1515
|
-
re("__b", function(
|
|
1515
|
+
re("__b", function(i, e) {
|
|
1516
1516
|
if (typeof e.type == "string") {
|
|
1517
|
-
var t,
|
|
1518
|
-
for (var s in
|
|
1517
|
+
var t, n = e.props;
|
|
1518
|
+
for (var s in n)
|
|
1519
1519
|
if (s !== "children") {
|
|
1520
|
-
var o =
|
|
1521
|
-
o instanceof A && (t || (e.__np = t = {}), t[s] = o,
|
|
1520
|
+
var o = n[s];
|
|
1521
|
+
o instanceof A && (t || (e.__np = t = {}), t[s] = o, n[s] = o.peek());
|
|
1522
1522
|
}
|
|
1523
1523
|
}
|
|
1524
|
-
|
|
1524
|
+
i(e);
|
|
1525
1525
|
});
|
|
1526
|
-
re("__r", function(
|
|
1526
|
+
re("__r", function(i, e) {
|
|
1527
1527
|
Ne();
|
|
1528
|
-
var t,
|
|
1529
|
-
|
|
1528
|
+
var t, n = e.__c;
|
|
1529
|
+
n && (n.__$f &= -2, (t = n.__$u) === void 0 && (n.__$u = t = function(s) {
|
|
1530
1530
|
var o;
|
|
1531
|
-
return
|
|
1531
|
+
return De(function() {
|
|
1532
1532
|
o = this;
|
|
1533
1533
|
}), o.c = function() {
|
|
1534
|
-
|
|
1534
|
+
n.__$f |= 1, n.setState({});
|
|
1535
1535
|
}, o;
|
|
1536
|
-
}())),
|
|
1536
|
+
}())), ze = n, Ne(t), i(e);
|
|
1537
1537
|
});
|
|
1538
|
-
re("__e", function(
|
|
1539
|
-
Ne(),
|
|
1538
|
+
re("__e", function(i, e, t, n) {
|
|
1539
|
+
Ne(), ze = void 0, i(e, t, n);
|
|
1540
1540
|
});
|
|
1541
|
-
re("diffed", function(
|
|
1542
|
-
Ne(),
|
|
1541
|
+
re("diffed", function(i, e) {
|
|
1542
|
+
Ne(), ze = void 0;
|
|
1543
1543
|
var t;
|
|
1544
1544
|
if (typeof e.type == "string" && (t = e.__e)) {
|
|
1545
|
-
var
|
|
1546
|
-
if (
|
|
1545
|
+
var n = e.__np, s = e.props;
|
|
1546
|
+
if (n) {
|
|
1547
1547
|
var o = t.U;
|
|
1548
1548
|
if (o)
|
|
1549
1549
|
for (var r in o) {
|
|
1550
|
-
var
|
|
1551
|
-
|
|
1550
|
+
var a = o[r];
|
|
1551
|
+
a !== void 0 && !(r in n) && (a.d(), o[r] = void 0);
|
|
1552
1552
|
}
|
|
1553
1553
|
else
|
|
1554
1554
|
t.U = o = {};
|
|
1555
|
-
for (var u in
|
|
1556
|
-
var
|
|
1557
|
-
|
|
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);
|
|
1558
1558
|
}
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
|
-
|
|
1561
|
+
i(e);
|
|
1562
1562
|
});
|
|
1563
|
-
function
|
|
1564
|
-
var s = e in
|
|
1565
|
-
return { o: function(r,
|
|
1566
|
-
o.value = r,
|
|
1567
|
-
}, d:
|
|
1563
|
+
function zi(i, e, t, n) {
|
|
1564
|
+
var s = e in i && i.ownerSVGElement === void 0, o = j(t);
|
|
1565
|
+
return { o: function(r, a) {
|
|
1566
|
+
o.value = r, n = a;
|
|
1567
|
+
}, d: De(function() {
|
|
1568
1568
|
var r = o.value.value;
|
|
1569
|
-
|
|
1569
|
+
n[e] !== r && (n[e] = r, s ? i[e] = r : r ? i.setAttribute(e, r) : i.removeAttribute(e));
|
|
1570
1570
|
}) };
|
|
1571
1571
|
}
|
|
1572
|
-
re("unmount", function(
|
|
1572
|
+
re("unmount", function(i, e) {
|
|
1573
1573
|
if (typeof e.type == "string") {
|
|
1574
1574
|
var t = e.__e;
|
|
1575
1575
|
if (t) {
|
|
1576
|
-
var
|
|
1577
|
-
if (
|
|
1576
|
+
var n = t.U;
|
|
1577
|
+
if (n) {
|
|
1578
1578
|
t.U = void 0;
|
|
1579
|
-
for (var s in
|
|
1580
|
-
var o =
|
|
1579
|
+
for (var s in n) {
|
|
1580
|
+
var o = n[s];
|
|
1581
1581
|
o && o.d();
|
|
1582
1582
|
}
|
|
1583
1583
|
}
|
|
@@ -1585,69 +1585,69 @@ re("unmount", function(n, e) {
|
|
|
1585
1585
|
} else {
|
|
1586
1586
|
var r = e.__c;
|
|
1587
1587
|
if (r) {
|
|
1588
|
-
var
|
|
1589
|
-
|
|
1588
|
+
var a = r.__$u;
|
|
1589
|
+
a && (r.__$u = void 0, a.d());
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
1592
|
-
|
|
1592
|
+
i(e);
|
|
1593
1593
|
});
|
|
1594
|
-
re("__h", function(
|
|
1595
|
-
(
|
|
1594
|
+
re("__h", function(i, e, t, n) {
|
|
1595
|
+
(n < 3 || n === 9) && (e.__$f |= 2), i(e, t, n);
|
|
1596
1596
|
});
|
|
1597
|
-
H.prototype.shouldComponentUpdate = function(
|
|
1597
|
+
H.prototype.shouldComponentUpdate = function(i, e) {
|
|
1598
1598
|
var t = this.__$u;
|
|
1599
1599
|
if (!(t && t.s !== void 0 || 4 & this.__$f) || 3 & this.__$f)
|
|
1600
1600
|
return !0;
|
|
1601
|
-
for (var
|
|
1601
|
+
for (var n in e)
|
|
1602
1602
|
return !0;
|
|
1603
|
-
for (var s in
|
|
1604
|
-
if (s !== "__source" &&
|
|
1603
|
+
for (var s in i)
|
|
1604
|
+
if (s !== "__source" && i[s] !== this.props[s])
|
|
1605
1605
|
return !0;
|
|
1606
1606
|
for (var o in this.props)
|
|
1607
|
-
if (!(o in
|
|
1607
|
+
if (!(o in i))
|
|
1608
1608
|
return !0;
|
|
1609
1609
|
return !1;
|
|
1610
1610
|
};
|
|
1611
|
-
function
|
|
1612
|
-
return
|
|
1613
|
-
return
|
|
1611
|
+
function B(i) {
|
|
1612
|
+
return P(function() {
|
|
1613
|
+
return j(i);
|
|
1614
1614
|
}, []);
|
|
1615
1615
|
}
|
|
1616
|
-
function O(
|
|
1617
|
-
var e = K(
|
|
1618
|
-
return e.current =
|
|
1619
|
-
return
|
|
1616
|
+
function O(i) {
|
|
1617
|
+
var e = K(i);
|
|
1618
|
+
return e.current = i, ze.__$f |= 4, P(function() {
|
|
1619
|
+
return ri(function() {
|
|
1620
1620
|
return e.current();
|
|
1621
1621
|
});
|
|
1622
1622
|
}, []);
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1625
|
-
var e = K(
|
|
1626
|
-
e.current =
|
|
1627
|
-
return
|
|
1624
|
+
function Hi(i) {
|
|
1625
|
+
var e = K(i);
|
|
1626
|
+
e.current = i, R(function() {
|
|
1627
|
+
return De(function() {
|
|
1628
1628
|
return e.current();
|
|
1629
1629
|
});
|
|
1630
1630
|
}, []);
|
|
1631
1631
|
}
|
|
1632
|
-
var
|
|
1633
|
-
function l(
|
|
1634
|
-
var r,
|
|
1635
|
-
for (
|
|
1636
|
-
|
|
1637
|
-
var
|
|
1638
|
-
if (typeof
|
|
1639
|
-
for (
|
|
1640
|
-
u[
|
|
1641
|
-
return
|
|
1642
|
-
}
|
|
1643
|
-
const
|
|
1632
|
+
var Li = 0;
|
|
1633
|
+
function l(i, e, t, n, s, o) {
|
|
1634
|
+
var r, a, u = {};
|
|
1635
|
+
for (a in e)
|
|
1636
|
+
a == "ref" ? r = e[a] : u[a] = e[a];
|
|
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))
|
|
1639
|
+
for (a in r)
|
|
1640
|
+
u[a] === void 0 && (u[a] = r[a]);
|
|
1641
|
+
return g.vnode && g.vnode(h), h;
|
|
1642
|
+
}
|
|
1643
|
+
const Oi = () => l("svg", {
|
|
1644
1644
|
viewBox: "0 0 1024 1024",
|
|
1645
1645
|
version: "1.1",
|
|
1646
1646
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1647
1647
|
children: l("path", {
|
|
1648
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"
|
|
1649
1649
|
})
|
|
1650
|
-
}),
|
|
1650
|
+
}), Bi = () => l("svg", {
|
|
1651
1651
|
className: "icon",
|
|
1652
1652
|
viewBox: "0 0 1024 1024",
|
|
1653
1653
|
version: "1.1",
|
|
@@ -1655,56 +1655,58 @@ const zn = () => l("svg", {
|
|
|
1655
1655
|
children: l("path", {
|
|
1656
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"
|
|
1657
1657
|
})
|
|
1658
|
-
}),
|
|
1658
|
+
}), Ri = (i) => l("svg", {
|
|
1659
1659
|
viewBox: "0 0 1024 1024",
|
|
1660
|
+
id: "send",
|
|
1661
|
+
className: i.className,
|
|
1660
1662
|
version: "1.1",
|
|
1661
1663
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1662
1664
|
children: l("path", {
|
|
1663
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"
|
|
1664
1666
|
})
|
|
1665
|
-
}),
|
|
1667
|
+
}), Pi = () => l("svg", {
|
|
1666
1668
|
viewBox: "0 0 1024 1024",
|
|
1667
1669
|
version: "1.1",
|
|
1668
1670
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1669
1671
|
children: l("path", {
|
|
1670
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"
|
|
1671
1673
|
})
|
|
1672
|
-
}),
|
|
1674
|
+
}), _t = () => l("svg", {
|
|
1673
1675
|
viewBox: "0 0 1024 1024",
|
|
1674
1676
|
version: "1.1",
|
|
1675
1677
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1676
1678
|
children: l("path", {
|
|
1677
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"
|
|
1678
1680
|
})
|
|
1679
|
-
}),
|
|
1681
|
+
}), Fi = () => l("svg", {
|
|
1680
1682
|
viewBox: "0 0 1024 1024",
|
|
1681
1683
|
version: "1.1",
|
|
1682
1684
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1683
1685
|
children: l("path", {
|
|
1684
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"
|
|
1685
1687
|
})
|
|
1686
|
-
}),
|
|
1688
|
+
}), Ui = () => l("svg", {
|
|
1687
1689
|
viewBox: "0 0 1024 1024",
|
|
1688
1690
|
version: "1.1",
|
|
1689
1691
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1690
1692
|
children: l("path", {
|
|
1691
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"
|
|
1692
1694
|
})
|
|
1693
|
-
}),
|
|
1695
|
+
}), Wi = () => l("svg", {
|
|
1694
1696
|
viewBox: "0 0 1024 1024",
|
|
1695
1697
|
version: "1.1",
|
|
1696
1698
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1697
1699
|
children: l("path", {
|
|
1698
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"
|
|
1699
1701
|
})
|
|
1700
|
-
}),
|
|
1702
|
+
}), Vi = () => l("svg", {
|
|
1701
1703
|
viewBox: "0 0 1024 1024",
|
|
1702
1704
|
version: "1.1",
|
|
1703
1705
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1704
1706
|
children: l("path", {
|
|
1705
1707
|
d: "M960 544H64a32 32 0 1 1 0-64h896a32 32 0 1 1 0 64"
|
|
1706
1708
|
})
|
|
1707
|
-
}),
|
|
1709
|
+
}), qi = () => l("svg", {
|
|
1708
1710
|
viewBox: "0 0 1024 1024",
|
|
1709
1711
|
version: "1.1",
|
|
1710
1712
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1721,7 +1723,7 @@ const zn = () => l("svg", {
|
|
|
1721
1723
|
}), l("path", {
|
|
1722
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"
|
|
1723
1725
|
})]
|
|
1724
|
-
}),
|
|
1726
|
+
}), ji = () => l("svg", {
|
|
1725
1727
|
viewBox: "0 0 18 18",
|
|
1726
1728
|
fill: "none",
|
|
1727
1729
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1735,7 +1737,7 @@ const zn = () => l("svg", {
|
|
|
1735
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",
|
|
1736
1738
|
fill: "currentColor"
|
|
1737
1739
|
})]
|
|
1738
|
-
}),
|
|
1740
|
+
}), Yi = () => l("svg", {
|
|
1739
1741
|
viewBox: "64 64 896 896",
|
|
1740
1742
|
focusable: "false",
|
|
1741
1743
|
width: "1em",
|
|
@@ -1745,15 +1747,15 @@ const zn = () => l("svg", {
|
|
|
1745
1747
|
children: l("path", {
|
|
1746
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"
|
|
1747
1749
|
})
|
|
1748
|
-
}),
|
|
1750
|
+
}), Xi = () => l("svg", {
|
|
1749
1751
|
fill: "currentColor",
|
|
1750
1752
|
viewBox: "0 0 1000 1000",
|
|
1751
1753
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1752
1754
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1753
1755
|
children: Array.from({
|
|
1754
1756
|
length: 4
|
|
1755
|
-
}).map((
|
|
1756
|
-
const d = u * (146.66666666666666 + 140),
|
|
1757
|
+
}).map((a, u) => {
|
|
1758
|
+
const d = u * (146.66666666666666 + 140), c = 1e3 / 2 - 250 / 2, p = 1e3 / 2 - 500 / 2;
|
|
1757
1759
|
return l("rect", {
|
|
1758
1760
|
fill: "currentColor",
|
|
1759
1761
|
rx: 70,
|
|
@@ -1761,7 +1763,7 @@ const zn = () => l("svg", {
|
|
|
1761
1763
|
height: 250,
|
|
1762
1764
|
width: 140,
|
|
1763
1765
|
x: d,
|
|
1764
|
-
y:
|
|
1766
|
+
y: c,
|
|
1765
1767
|
children: [l("animate", {
|
|
1766
1768
|
attributeName: "height",
|
|
1767
1769
|
values: "250; 500; 250",
|
|
@@ -1771,7 +1773,7 @@ const zn = () => l("svg", {
|
|
|
1771
1773
|
repeatCount: "indefinite"
|
|
1772
1774
|
}), l("animate", {
|
|
1773
1775
|
attributeName: "y",
|
|
1774
|
-
values: "".concat(
|
|
1776
|
+
values: "".concat(c, "; ").concat(p, "; ").concat(c),
|
|
1775
1777
|
keyTimes: "0; 0.5; 1",
|
|
1776
1778
|
dur: "".concat(0.8, "s"),
|
|
1777
1779
|
begin: "".concat(0.8 / 4 * u, "s"),
|
|
@@ -1779,26 +1781,26 @@ const zn = () => l("svg", {
|
|
|
1779
1781
|
})]
|
|
1780
1782
|
}, u);
|
|
1781
1783
|
})
|
|
1782
|
-
}),
|
|
1783
|
-
className:
|
|
1784
|
-
onClick:
|
|
1784
|
+
}), Zi = (i) => l("svg", {
|
|
1785
|
+
className: i.className,
|
|
1786
|
+
onClick: i.onClick,
|
|
1785
1787
|
viewBox: "0 0 1024 1024",
|
|
1786
1788
|
version: "1.1",
|
|
1787
1789
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1788
1790
|
children: l("path", {
|
|
1789
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"
|
|
1790
1792
|
})
|
|
1791
|
-
}),
|
|
1792
|
-
className:
|
|
1793
|
+
}), Gi = (i) => l("svg", {
|
|
1794
|
+
className: i.className,
|
|
1793
1795
|
viewBox: "0 0 1024 1024",
|
|
1794
1796
|
version: "1.1",
|
|
1795
1797
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1796
1798
|
children: l("path", {
|
|
1797
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"
|
|
1798
1800
|
})
|
|
1799
|
-
}),
|
|
1801
|
+
}), Ji = (i) => l("svg", {
|
|
1800
1802
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1801
|
-
className:
|
|
1803
|
+
className: i.className,
|
|
1802
1804
|
viewBox: "0 0 512 512",
|
|
1803
1805
|
children: l("path", {
|
|
1804
1806
|
fill: "none",
|
|
@@ -1808,15 +1810,15 @@ const zn = () => l("svg", {
|
|
|
1808
1810
|
strokeWidth: "48",
|
|
1809
1811
|
d: "M112 184l144 144 144-144"
|
|
1810
1812
|
})
|
|
1811
|
-
}),
|
|
1813
|
+
}), Pe = (i) => l("svg", {
|
|
1812
1814
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1813
|
-
className: "".concat(
|
|
1815
|
+
className: "".concat(i.className, " icon"),
|
|
1814
1816
|
viewBox: "0 0 512 512",
|
|
1815
1817
|
children: l("path", {
|
|
1816
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"
|
|
1817
1819
|
})
|
|
1818
|
-
}),
|
|
1819
|
-
className:
|
|
1820
|
+
}), Fe = (i) => l("svg", {
|
|
1821
|
+
className: i.className,
|
|
1820
1822
|
width: "16",
|
|
1821
1823
|
height: "16",
|
|
1822
1824
|
viewBox: "0 0 50 50",
|
|
@@ -1839,7 +1841,7 @@ const zn = () => l("svg", {
|
|
|
1839
1841
|
repeatCount: "indefinite"
|
|
1840
1842
|
})
|
|
1841
1843
|
})
|
|
1842
|
-
}),
|
|
1844
|
+
}), Ki = () => l("svg", {
|
|
1843
1845
|
className: "icon",
|
|
1844
1846
|
viewBox: "0 0 1024 1024",
|
|
1845
1847
|
version: "1.1",
|
|
@@ -1849,7 +1851,7 @@ const zn = () => l("svg", {
|
|
|
1849
1851
|
children: l("path", {
|
|
1850
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"
|
|
1851
1853
|
})
|
|
1852
|
-
}),
|
|
1854
|
+
}), li = () => l("svg", {
|
|
1853
1855
|
className: "icon",
|
|
1854
1856
|
viewBox: "0 0 1024 1024",
|
|
1855
1857
|
version: "1.1",
|
|
@@ -1863,7 +1865,7 @@ const zn = () => l("svg", {
|
|
|
1863
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",
|
|
1864
1866
|
fill: "currentColor"
|
|
1865
1867
|
})]
|
|
1866
|
-
}),
|
|
1868
|
+
}), Qi = () => l("svg", {
|
|
1867
1869
|
className: "icon",
|
|
1868
1870
|
viewBox: "0 0 1024 1024",
|
|
1869
1871
|
version: "1.1",
|
|
@@ -1874,7 +1876,7 @@ const zn = () => l("svg", {
|
|
|
1874
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",
|
|
1875
1877
|
fill: "currentColor"
|
|
1876
1878
|
})
|
|
1877
|
-
}),
|
|
1879
|
+
}), en = () => l("svg", {
|
|
1878
1880
|
className: "icon",
|
|
1879
1881
|
viewBox: "0 0 1024 1024",
|
|
1880
1882
|
version: "1.1",
|
|
@@ -1884,127 +1886,154 @@ const zn = () => l("svg", {
|
|
|
1884
1886
|
children: l("path", {
|
|
1885
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"
|
|
1886
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
|
+
})
|
|
1887
1916
|
});
|
|
1888
|
-
const
|
|
1917
|
+
const sn = (i) => {
|
|
1889
1918
|
const {
|
|
1890
1919
|
items: e
|
|
1891
|
-
} =
|
|
1892
|
-
|
|
1893
|
-
s.value = e.filter((r) => r.description), s.value.length > 0 && s.value.forEach((r,
|
|
1894
|
-
r.done && (t.value = [...t.value,
|
|
1920
|
+
} = i, t = B([]), n = new $("chat-thought-chain"), s = B([]);
|
|
1921
|
+
R(() => {
|
|
1922
|
+
s.value = e.filter((r) => r.description), s.value.length > 0 && s.value.forEach((r, a) => {
|
|
1923
|
+
r.done && (t.value = [...t.value, a]);
|
|
1895
1924
|
});
|
|
1896
1925
|
}, [e]);
|
|
1897
1926
|
const o = (r) => {
|
|
1898
|
-
t.value.includes(r) ? t.value = t.value.filter((
|
|
1927
|
+
t.value.includes(r) ? t.value = t.value.filter((a) => a !== r) : t.value = [...t.value, r];
|
|
1899
1928
|
};
|
|
1900
1929
|
return s.value.length === 0 ? null : l("div", {
|
|
1901
|
-
className: "".concat(
|
|
1902
|
-
children: s.value.map((r,
|
|
1930
|
+
className: "".concat(n.b(), " ").concat(n.is("single", s.value.length === 1)),
|
|
1931
|
+
children: s.value.map((r, a) => {
|
|
1903
1932
|
if (!r.description)
|
|
1904
1933
|
return;
|
|
1905
|
-
const u = t.value.includes(
|
|
1934
|
+
const u = t.value.includes(a);
|
|
1906
1935
|
return l("div", {
|
|
1907
|
-
className: "".concat(
|
|
1936
|
+
className: "".concat(n.e("item"), " ").concat(n.is("collapsed", u)),
|
|
1908
1937
|
children: [l("div", {
|
|
1909
|
-
className:
|
|
1938
|
+
className: n.e("item-icon"),
|
|
1910
1939
|
children: r.icon || l("span", {
|
|
1911
|
-
children:
|
|
1940
|
+
children: a
|
|
1912
1941
|
})
|
|
1913
1942
|
}), l("div", {
|
|
1914
|
-
className:
|
|
1943
|
+
className: n.e("item-content"),
|
|
1915
1944
|
children: [l("div", {
|
|
1916
|
-
className:
|
|
1917
|
-
onClick: () => o(
|
|
1918
|
-
children: [r.title, l(
|
|
1919
|
-
className:
|
|
1945
|
+
className: n.e("item-title"),
|
|
1946
|
+
onClick: () => o(a),
|
|
1947
|
+
children: [r.title, l(Ji, {
|
|
1948
|
+
className: n.e("icon")
|
|
1920
1949
|
})]
|
|
1921
1950
|
}), l("div", {
|
|
1922
|
-
className:
|
|
1951
|
+
className: n.e("item-description"),
|
|
1923
1952
|
children: r.description
|
|
1924
1953
|
})]
|
|
1925
1954
|
})]
|
|
1926
|
-
},
|
|
1955
|
+
}, a);
|
|
1927
1956
|
})
|
|
1928
1957
|
});
|
|
1929
|
-
},
|
|
1958
|
+
}, G = new $("markdown-message"), on = (i) => {
|
|
1930
1959
|
const {
|
|
1931
1960
|
message: e,
|
|
1932
1961
|
size: t
|
|
1933
|
-
} =
|
|
1934
|
-
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: "",
|
|
1935
1964
|
description: "",
|
|
1936
|
-
icon: l(
|
|
1937
|
-
}), u = (
|
|
1938
|
-
const d =
|
|
1939
|
-
let
|
|
1940
|
-
return
|
|
1941
|
-
isThoughtCompleted:
|
|
1942
|
-
thoughtContent:
|
|
1943
|
-
answerContent:
|
|
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
|
|
1944
1973
|
};
|
|
1945
1974
|
};
|
|
1946
|
-
return
|
|
1975
|
+
return R(() => {
|
|
1947
1976
|
if (t >= 0 && s.value)
|
|
1948
1977
|
if (e.content.indexOf("<think>") !== -1) {
|
|
1949
1978
|
const {
|
|
1950
|
-
isThoughtCompleted:
|
|
1979
|
+
isThoughtCompleted: h,
|
|
1951
1980
|
thoughtContent: d,
|
|
1952
|
-
answerContent:
|
|
1981
|
+
answerContent: c
|
|
1953
1982
|
} = u(e.content);
|
|
1954
|
-
|
|
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);
|
|
1955
1984
|
} else
|
|
1956
1985
|
s.value.setMarkdown(e.content);
|
|
1957
|
-
}, [e, t]),
|
|
1958
|
-
let
|
|
1986
|
+
}, [e, t]), R(() => {
|
|
1987
|
+
let h = "";
|
|
1959
1988
|
if (e.content.indexOf("<think>") !== -1) {
|
|
1960
1989
|
const {
|
|
1961
1990
|
isThoughtCompleted: d,
|
|
1962
|
-
thoughtContent:
|
|
1963
|
-
answerContent:
|
|
1991
|
+
thoughtContent: c,
|
|
1992
|
+
answerContent: p
|
|
1964
1993
|
} = u(e.content);
|
|
1965
|
-
|
|
1966
|
-
title: "
|
|
1967
|
-
description:
|
|
1968
|
-
icon: d ? l(
|
|
1969
|
-
},
|
|
1994
|
+
a.value = {
|
|
1995
|
+
title: d ? "思考完成" : e.completed === !0 ? "思考已停止" : "思考中...",
|
|
1996
|
+
description: c || "",
|
|
1997
|
+
icon: d || e.completed === !0 ? l(Pe, {}) : l(Fe, {})
|
|
1998
|
+
}, p && (h = p);
|
|
1970
1999
|
} else
|
|
1971
|
-
|
|
1972
|
-
s.value = new
|
|
1973
|
-
id:
|
|
1974
|
-
value:
|
|
2000
|
+
h = e.content;
|
|
2001
|
+
s.value = new gi({
|
|
2002
|
+
id: n,
|
|
2003
|
+
value: h || "",
|
|
1975
2004
|
editor: {
|
|
1976
2005
|
defaultModel: "previewOnly"
|
|
1977
2006
|
}
|
|
1978
2007
|
});
|
|
1979
2008
|
}, []), l("div", {
|
|
1980
|
-
className: "".concat(
|
|
2009
|
+
className: "".concat(G.b(), " ").concat(G.is("loading", o)),
|
|
1981
2010
|
children: [l("div", {
|
|
1982
|
-
className:
|
|
2011
|
+
className: G.b("header"),
|
|
1983
2012
|
children: [l("div", {
|
|
1984
|
-
className:
|
|
2013
|
+
className: G.be("header", "caption"),
|
|
1985
2014
|
children: "AI "
|
|
1986
|
-
}),
|
|
1987
|
-
className:
|
|
2015
|
+
}), i.children, r ? l("div", {
|
|
2016
|
+
className: G.be("header", "timeout"),
|
|
1988
2017
|
children: "请求超时"
|
|
1989
2018
|
}) : null]
|
|
1990
2019
|
}), l("div", {
|
|
1991
|
-
className: "".concat(
|
|
1992
|
-
children: [l(
|
|
1993
|
-
items: [
|
|
2020
|
+
className: "".concat(G.b("content"), " pre-wrap-container"),
|
|
2021
|
+
children: [l(sn, {
|
|
2022
|
+
items: [a.value]
|
|
1994
2023
|
}), l("div", {
|
|
1995
|
-
id:
|
|
2024
|
+
id: n
|
|
1996
2025
|
})]
|
|
1997
2026
|
}), l("div", {
|
|
1998
|
-
className:
|
|
2027
|
+
className: G.b("footer")
|
|
1999
2028
|
})]
|
|
2000
2029
|
});
|
|
2001
2030
|
};
|
|
2002
|
-
const ae = new
|
|
2003
|
-
const e = O(() =>
|
|
2004
|
-
const o =
|
|
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;
|
|
2005
2034
|
return o === "successed" ? "上传成功" : o === "uploading" ? "上传中" : o === "failed" ? "上传失败" : "未知状态";
|
|
2006
2035
|
}), s = O(() => {
|
|
2007
|
-
switch (
|
|
2036
|
+
switch (i.material.metadata.state) {
|
|
2008
2037
|
case "successed":
|
|
2009
2038
|
return "#1890ff";
|
|
2010
2039
|
case "uploading":
|
|
@@ -2019,7 +2048,7 @@ const ae = new M("ossfile-material"), ei = (n) => {
|
|
|
2019
2048
|
className: ae.b(),
|
|
2020
2049
|
children: [l("div", {
|
|
2021
2050
|
className: ae.b("left"),
|
|
2022
|
-
children: l(
|
|
2051
|
+
children: l(li, {})
|
|
2023
2052
|
}), l("div", {
|
|
2024
2053
|
className: ae.b("right"),
|
|
2025
2054
|
children: [l("div", {
|
|
@@ -2034,20 +2063,20 @@ const ae = new M("ossfile-material"), ei = (n) => {
|
|
|
2034
2063
|
style: {
|
|
2035
2064
|
color: s.value
|
|
2036
2065
|
},
|
|
2037
|
-
children:
|
|
2066
|
+
children: n
|
|
2038
2067
|
})]
|
|
2039
2068
|
})]
|
|
2040
2069
|
})]
|
|
2041
2070
|
});
|
|
2042
2071
|
};
|
|
2043
|
-
const ce = new
|
|
2044
|
-
var
|
|
2045
|
-
const e = (
|
|
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);
|
|
2046
2075
|
return l("div", {
|
|
2047
2076
|
className: ce.b(),
|
|
2048
2077
|
children: [l("div", {
|
|
2049
2078
|
className: ce.b("left"),
|
|
2050
|
-
children: e && e.icon ? typeof e.icon == "function" ? e.icon(I) : e.icon : l(
|
|
2079
|
+
children: e && e.icon ? typeof e.icon == "function" ? e.icon(I) : e.icon : l(en, {})
|
|
2051
2080
|
}), l("div", {
|
|
2052
2081
|
className: ce.b("right"),
|
|
2053
2082
|
children: [l("div", {
|
|
@@ -2063,39 +2092,39 @@ const ce = new M("common-material"), ti = (n) => {
|
|
|
2063
2092
|
})]
|
|
2064
2093
|
});
|
|
2065
2094
|
};
|
|
2066
|
-
const
|
|
2095
|
+
const Ue = new $("chat-input-material-item"), ui = (i) => {
|
|
2067
2096
|
const {
|
|
2068
2097
|
material: e
|
|
2069
|
-
} =
|
|
2098
|
+
} = i;
|
|
2070
2099
|
let t = null;
|
|
2071
2100
|
switch (e.type) {
|
|
2072
2101
|
case "ossfile":
|
|
2073
|
-
t =
|
|
2102
|
+
t = rn;
|
|
2074
2103
|
break;
|
|
2075
2104
|
default:
|
|
2076
|
-
t =
|
|
2105
|
+
t = an;
|
|
2077
2106
|
}
|
|
2078
|
-
const
|
|
2079
|
-
|
|
2107
|
+
const n = () => {
|
|
2108
|
+
i.controller.deleteMaterial(e);
|
|
2080
2109
|
};
|
|
2081
2110
|
return l("div", {
|
|
2082
|
-
className: "".concat(
|
|
2111
|
+
className: "".concat(Ue.b(), " ").concat(Ue.is("disabled", i.disabled)),
|
|
2083
2112
|
children: [l("div", {
|
|
2084
|
-
className:
|
|
2085
|
-
onClick:
|
|
2086
|
-
children: l(
|
|
2113
|
+
className: Ue.e("icon"),
|
|
2114
|
+
onClick: n,
|
|
2115
|
+
children: l(Qi, {})
|
|
2087
2116
|
}), I(t, {
|
|
2088
2117
|
material: e,
|
|
2089
|
-
controller:
|
|
2118
|
+
controller: i.controller
|
|
2090
2119
|
})]
|
|
2091
2120
|
});
|
|
2092
|
-
}, Q = new
|
|
2093
|
-
const e = O(() =>
|
|
2121
|
+
}, Q = new $("user-message-question"), cn = (i) => {
|
|
2122
|
+
const e = O(() => i.message.content), t = O(() => Jt.parseMixedContent(e.value));
|
|
2094
2123
|
return l("div", {
|
|
2095
2124
|
className: Q.b(),
|
|
2096
2125
|
children: [l("div", {
|
|
2097
2126
|
className: Q.e("user-header"),
|
|
2098
|
-
children: [
|
|
2127
|
+
children: [i.children, l("div", {
|
|
2099
2128
|
className: Q.e("user"),
|
|
2100
2129
|
children: "我"
|
|
2101
2130
|
})]
|
|
@@ -2107,11 +2136,11 @@ const Pe = new M("chat-input-material-item"), on = (n) => {
|
|
|
2107
2136
|
children: [l("p", {
|
|
2108
2137
|
dir: "auto",
|
|
2109
2138
|
className: Q.em("content", "material"),
|
|
2110
|
-
children: t.value.hasResources && t.value.resources.map((
|
|
2111
|
-
material:
|
|
2139
|
+
children: t.value.hasResources && t.value.resources.map((n) => l(ui, {
|
|
2140
|
+
material: n,
|
|
2112
2141
|
disabled: !0,
|
|
2113
|
-
controller:
|
|
2114
|
-
},
|
|
2142
|
+
controller: i.controller
|
|
2143
|
+
}, n.id))
|
|
2115
2144
|
}), l("p", {
|
|
2116
2145
|
dir: "auto",
|
|
2117
2146
|
className: "pre-wrap-container",
|
|
@@ -2121,419 +2150,471 @@ const Pe = new M("chat-input-material-item"), on = (n) => {
|
|
|
2121
2150
|
})]
|
|
2122
2151
|
});
|
|
2123
2152
|
};
|
|
2124
|
-
const
|
|
2125
|
-
const e = O(() =>
|
|
2153
|
+
const ge = new $("error-message"), ln = (i) => {
|
|
2154
|
+
const e = O(() => i.message.content);
|
|
2126
2155
|
return l("div", {
|
|
2127
|
-
className:
|
|
2156
|
+
className: ge.b(),
|
|
2128
2157
|
children: [l("div", {
|
|
2129
|
-
className:
|
|
2158
|
+
className: ge.b("header"),
|
|
2130
2159
|
children: [l("div", {
|
|
2131
|
-
className:
|
|
2160
|
+
className: ge.be("header", "caption"),
|
|
2132
2161
|
children: "AI "
|
|
2133
|
-
}),
|
|
2162
|
+
}), i.children]
|
|
2134
2163
|
}), l("div", {
|
|
2135
|
-
className: "".concat(
|
|
2164
|
+
className: "".concat(ge.e("content"), " pre-wrap-container"),
|
|
2136
2165
|
children: l("span", {
|
|
2137
2166
|
children: e
|
|
2138
2167
|
})
|
|
2139
2168
|
})]
|
|
2140
2169
|
});
|
|
2141
2170
|
};
|
|
2142
|
-
const
|
|
2143
|
-
className:
|
|
2171
|
+
const vt = new $("unknown-message"), un = (i) => l("div", {
|
|
2172
|
+
className: vt.b(),
|
|
2144
2173
|
children: l("span", {
|
|
2145
|
-
className: "".concat(
|
|
2146
|
-
children: ["暂未支持的消息类型: ",
|
|
2174
|
+
className: "".concat(vt.e("content"), " pre-wrap-container"),
|
|
2175
|
+
children: ["暂未支持的消息类型: ", i.message.type]
|
|
2147
2176
|
})
|
|
2148
2177
|
});
|
|
2149
|
-
const
|
|
2178
|
+
const hn = new $("chat-message-item"), dn = (i) => {
|
|
2150
2179
|
const {
|
|
2151
2180
|
message: e,
|
|
2152
2181
|
size: t
|
|
2153
|
-
} =
|
|
2154
|
-
let
|
|
2182
|
+
} = i;
|
|
2183
|
+
let n = null;
|
|
2155
2184
|
switch (e.type) {
|
|
2156
2185
|
case "DEFAULT":
|
|
2157
|
-
|
|
2186
|
+
n = e.role === "ASSISTANT" ? on : cn;
|
|
2158
2187
|
break;
|
|
2159
2188
|
case "ERROR":
|
|
2160
|
-
|
|
2189
|
+
n = ln;
|
|
2161
2190
|
break;
|
|
2162
2191
|
default:
|
|
2163
|
-
|
|
2192
|
+
n = un;
|
|
2164
2193
|
}
|
|
2165
2194
|
return l("div", {
|
|
2166
|
-
className:
|
|
2167
|
-
children: I(
|
|
2195
|
+
className: hn.b(),
|
|
2196
|
+
children: I(n, {
|
|
2168
2197
|
size: t,
|
|
2169
2198
|
message: e,
|
|
2170
|
-
controller:
|
|
2171
|
-
children:
|
|
2199
|
+
controller: i.controller,
|
|
2200
|
+
children: i.children
|
|
2172
2201
|
})
|
|
2173
2202
|
});
|
|
2174
2203
|
};
|
|
2175
|
-
const ee = new
|
|
2204
|
+
const ee = new $("chat-toolbar"), Ge = (i) => {
|
|
2176
2205
|
const {
|
|
2177
2206
|
controller: e,
|
|
2178
2207
|
items: t = [],
|
|
2179
|
-
data:
|
|
2208
|
+
data: n,
|
|
2180
2209
|
type: s,
|
|
2181
2210
|
className: o
|
|
2182
|
-
} =
|
|
2183
|
-
let r = [],
|
|
2211
|
+
} = i;
|
|
2212
|
+
let r = [], a = "default";
|
|
2184
2213
|
const u = [{
|
|
2185
2214
|
label: "新建对话",
|
|
2186
2215
|
title: "新建对话",
|
|
2187
|
-
icon: l(
|
|
2216
|
+
icon: l(ji, {}),
|
|
2188
2217
|
onClick: () => {
|
|
2189
2218
|
e.newDialogue();
|
|
2190
2219
|
}
|
|
2191
|
-
}],
|
|
2192
|
-
label: "回填",
|
|
2193
|
-
title: "回填",
|
|
2194
|
-
icon: l(Hn, {}),
|
|
2195
|
-
onClick: () => {
|
|
2196
|
-
e.backfill(i);
|
|
2197
|
-
}
|
|
2198
|
-
}, {
|
|
2220
|
+
}], h = [{
|
|
2199
2221
|
label: "刷新",
|
|
2200
2222
|
title: "刷新",
|
|
2201
|
-
icon: l(
|
|
2223
|
+
icon: l(_t, {}),
|
|
2202
2224
|
onClick: () => {
|
|
2203
|
-
e.refreshMessage(
|
|
2225
|
+
e.refreshMessage(n);
|
|
2204
2226
|
}
|
|
2205
2227
|
}, {
|
|
2206
2228
|
label: "删除",
|
|
2207
2229
|
title: "删除",
|
|
2208
|
-
icon: l(
|
|
2230
|
+
icon: l(Pi, {}),
|
|
2209
2231
|
onClick: () => {
|
|
2210
|
-
e.deleteMessage(
|
|
2232
|
+
e.deleteMessage(n);
|
|
2211
2233
|
}
|
|
2212
2234
|
}, {
|
|
2213
2235
|
label: "复制",
|
|
2214
2236
|
title: "复制",
|
|
2215
|
-
icon: l(
|
|
2237
|
+
icon: l(Fi, {}),
|
|
2238
|
+
onClick: () => {
|
|
2239
|
+
e.copyMessage(n);
|
|
2240
|
+
}
|
|
2241
|
+
}];
|
|
2242
|
+
Qt(it).enableBackFill && h.unshift({
|
|
2243
|
+
label: "回填",
|
|
2244
|
+
title: "回填",
|
|
2245
|
+
icon: l(Bi, {}),
|
|
2216
2246
|
onClick: () => {
|
|
2217
|
-
e.
|
|
2247
|
+
e.backfill(n);
|
|
2218
2248
|
}
|
|
2219
|
-
}
|
|
2249
|
+
});
|
|
2250
|
+
const c = [{
|
|
2220
2251
|
label: "刷新",
|
|
2221
2252
|
title: "刷新",
|
|
2222
|
-
icon: l(
|
|
2253
|
+
icon: l(_t, {}),
|
|
2223
2254
|
onClick: () => {
|
|
2224
|
-
e.refreshMessage(
|
|
2255
|
+
e.refreshMessage(n, !0);
|
|
2225
2256
|
}
|
|
2226
2257
|
}];
|
|
2227
2258
|
if (s === "content")
|
|
2228
|
-
switch (
|
|
2259
|
+
switch (a = "circle", n.type) {
|
|
2229
2260
|
case "DEFAULT":
|
|
2230
|
-
|
|
2261
|
+
n.role === "ASSISTANT" ? r = [...h, ...t] : r = [...c];
|
|
2231
2262
|
break;
|
|
2232
2263
|
case "ERROR":
|
|
2233
|
-
r = [...
|
|
2264
|
+
r = [...h, ...t];
|
|
2234
2265
|
break;
|
|
2235
2266
|
}
|
|
2236
2267
|
else
|
|
2237
2268
|
r = [...u, ...t];
|
|
2238
|
-
const
|
|
2239
|
-
var
|
|
2240
|
-
|
|
2241
|
-
|
|
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]);
|
|
2242
2279
|
return l("div", {
|
|
2243
|
-
className: "".concat(ee.b(), " ").concat(ee.e(
|
|
2244
|
-
children: r.map((
|
|
2245
|
-
if (!
|
|
2280
|
+
className: "".concat(ee.b(), " ").concat(ee.e(a), " ").concat(o || ""),
|
|
2281
|
+
children: r.map((_, y) => {
|
|
2282
|
+
if (!p(_))
|
|
2246
2283
|
return l("div", {
|
|
2247
|
-
className: "".concat(ee.e("item"), " ").concat(ee.is("disabled", _
|
|
2248
|
-
title:
|
|
2249
|
-
onClick: (
|
|
2284
|
+
className: "".concat(ee.e("item"), " ").concat(ee.is("disabled", m(_) || v), " ").concat(o || ""),
|
|
2285
|
+
title: _.title,
|
|
2286
|
+
onClick: (C) => f(C, _),
|
|
2250
2287
|
children: [l("div", {
|
|
2251
2288
|
className: "".concat(ee.em("item", "icon")),
|
|
2252
|
-
children: typeof
|
|
2289
|
+
children: typeof _.icon == "function" ? _.icon(I) : _.icon
|
|
2253
2290
|
}), l("div", {
|
|
2254
2291
|
className: "".concat(ee.em("item", "label")),
|
|
2255
|
-
children: typeof
|
|
2292
|
+
children: typeof _.label == "function" ? _.label(I) : _.label
|
|
2256
2293
|
})]
|
|
2257
|
-
},
|
|
2294
|
+
}, y);
|
|
2295
|
+
})
|
|
2296
|
+
});
|
|
2297
|
+
};
|
|
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")
|
|
2258
2335
|
})
|
|
2259
2336
|
});
|
|
2260
2337
|
};
|
|
2261
|
-
const
|
|
2262
|
-
const e = K(null), t =
|
|
2263
|
-
return
|
|
2338
|
+
const mt = new $("chat-messages"), gt = (i) => {
|
|
2339
|
+
const e = K(null), t = i.controller.messages;
|
|
2340
|
+
return Hi(() => {
|
|
2264
2341
|
e.current && t.value.length > 0 && (e.current.scrollTop = e.current.scrollHeight);
|
|
2265
2342
|
}), l("div", {
|
|
2266
2343
|
ref: e,
|
|
2267
|
-
className:
|
|
2268
|
-
children: t.value.map((
|
|
2344
|
+
className: mt.b(),
|
|
2345
|
+
children: [t.value.map((n) => {
|
|
2269
2346
|
var o;
|
|
2270
|
-
const s = ((o =
|
|
2271
|
-
return l(
|
|
2347
|
+
const s = ((o = n.content) == null ? void 0 : o.length) || 0;
|
|
2348
|
+
return l(dn, {
|
|
2272
2349
|
size: s,
|
|
2273
|
-
message:
|
|
2274
|
-
controller:
|
|
2275
|
-
children: l(
|
|
2276
|
-
data:
|
|
2350
|
+
message: n,
|
|
2351
|
+
controller: i.controller,
|
|
2352
|
+
children: l(Ge, {
|
|
2353
|
+
data: n,
|
|
2277
2354
|
type: "content",
|
|
2278
|
-
items:
|
|
2279
|
-
controller:
|
|
2355
|
+
items: i.toolbarItems,
|
|
2356
|
+
controller: i.controller
|
|
2280
2357
|
})
|
|
2281
|
-
},
|
|
2282
|
-
})
|
|
2358
|
+
}, n.messageid);
|
|
2359
|
+
}), l(pn, {
|
|
2360
|
+
right: 20,
|
|
2361
|
+
bottom: 14,
|
|
2362
|
+
target: ".".concat(mt.b())
|
|
2363
|
+
})]
|
|
2283
2364
|
});
|
|
2284
2365
|
};
|
|
2285
|
-
function
|
|
2366
|
+
function _n(i, e) {
|
|
2286
2367
|
for (var t in e)
|
|
2287
|
-
|
|
2288
|
-
return
|
|
2368
|
+
i[t] = e[t];
|
|
2369
|
+
return i;
|
|
2289
2370
|
}
|
|
2290
|
-
function
|
|
2291
|
-
for (var t in
|
|
2371
|
+
function bt(i, e) {
|
|
2372
|
+
for (var t in i)
|
|
2292
2373
|
if (t !== "__source" && !(t in e))
|
|
2293
2374
|
return !0;
|
|
2294
|
-
for (var
|
|
2295
|
-
if (
|
|
2375
|
+
for (var n in e)
|
|
2376
|
+
if (n !== "__source" && i[n] !== e[n])
|
|
2296
2377
|
return !0;
|
|
2297
2378
|
return !1;
|
|
2298
2379
|
}
|
|
2299
|
-
function
|
|
2300
|
-
this.props =
|
|
2380
|
+
function yt(i) {
|
|
2381
|
+
this.props = i;
|
|
2301
2382
|
}
|
|
2302
|
-
(
|
|
2303
|
-
return
|
|
2383
|
+
(yt.prototype = new H()).isPureReactComponent = !0, yt.prototype.shouldComponentUpdate = function(i, e) {
|
|
2384
|
+
return bt(this.props, i) || bt(this.state, e);
|
|
2304
2385
|
};
|
|
2305
|
-
var
|
|
2306
|
-
|
|
2307
|
-
|
|
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);
|
|
2308
2389
|
};
|
|
2309
|
-
var
|
|
2310
|
-
|
|
2311
|
-
if (
|
|
2390
|
+
var vn = g.__e;
|
|
2391
|
+
g.__e = function(i, e, t, n) {
|
|
2392
|
+
if (i.then) {
|
|
2312
2393
|
for (var s, o = e; o = o.__; )
|
|
2313
2394
|
if ((s = o.__c) && s.__c)
|
|
2314
|
-
return e.__e == null && (e.__e = t.__e, e.__k = t.__k), s.__c(
|
|
2395
|
+
return e.__e == null && (e.__e = t.__e, e.__k = t.__k), s.__c(i, e);
|
|
2315
2396
|
}
|
|
2316
|
-
|
|
2397
|
+
vn(i, e, t, n);
|
|
2317
2398
|
};
|
|
2318
|
-
var
|
|
2319
|
-
function
|
|
2320
|
-
return
|
|
2321
|
-
typeof
|
|
2322
|
-
}),
|
|
2323
|
-
return
|
|
2324
|
-
})),
|
|
2325
|
-
}
|
|
2326
|
-
function
|
|
2327
|
-
return
|
|
2328
|
-
return
|
|
2329
|
-
}),
|
|
2330
|
-
}
|
|
2331
|
-
function
|
|
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() {
|
|
2332
2413
|
this.__u = 0, this.t = null, this.__b = null;
|
|
2333
2414
|
}
|
|
2334
|
-
function
|
|
2335
|
-
var e =
|
|
2336
|
-
return e && e.__a && e.__a(
|
|
2415
|
+
function fi(i) {
|
|
2416
|
+
var e = i.__.__c;
|
|
2417
|
+
return e && e.__a && e.__a(i);
|
|
2337
2418
|
}
|
|
2338
|
-
function
|
|
2419
|
+
function be() {
|
|
2339
2420
|
this.u = null, this.o = null;
|
|
2340
2421
|
}
|
|
2341
|
-
|
|
2342
|
-
var e =
|
|
2343
|
-
e && e.__R && e.__R(), e &&
|
|
2344
|
-
}, (
|
|
2345
|
-
var t = e.__c,
|
|
2346
|
-
|
|
2347
|
-
var s =
|
|
2348
|
-
o || (o = !0, t.__R = null, s ? s(
|
|
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() {
|
|
2429
|
+
o || (o = !0, t.__R = null, s ? s(a) : a());
|
|
2349
2430
|
};
|
|
2350
2431
|
t.__R = r;
|
|
2351
|
-
var
|
|
2352
|
-
if (!--
|
|
2353
|
-
if (
|
|
2354
|
-
var
|
|
2355
|
-
|
|
2432
|
+
var a = function() {
|
|
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);
|
|
2356
2437
|
}
|
|
2357
2438
|
var d;
|
|
2358
|
-
for (
|
|
2439
|
+
for (n.setState({ __a: n.__b = null }); d = n.t.pop(); )
|
|
2359
2440
|
d.forceUpdate();
|
|
2360
2441
|
}
|
|
2361
2442
|
}, u = e.__h === !0;
|
|
2362
|
-
|
|
2363
|
-
},
|
|
2443
|
+
n.__u++ || u || n.setState({ __a: n.__b = n.__v.__k[0] }), i.then(r, r);
|
|
2444
|
+
}, We.prototype.componentWillUnmount = function() {
|
|
2364
2445
|
this.t = [];
|
|
2365
|
-
},
|
|
2446
|
+
}, We.prototype.render = function(i, e) {
|
|
2366
2447
|
if (this.__b) {
|
|
2367
2448
|
if (this.__v.__k) {
|
|
2368
|
-
var t = document.createElement("div"),
|
|
2369
|
-
this.__v.__k[0] =
|
|
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);
|
|
2370
2451
|
}
|
|
2371
2452
|
this.__b = null;
|
|
2372
2453
|
}
|
|
2373
|
-
var s = e.__a && I(se, null,
|
|
2374
|
-
return s && (s.__h = null), [I(se, null, e.__a ? null :
|
|
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];
|
|
2375
2456
|
};
|
|
2376
|
-
var
|
|
2377
|
-
if (++t[1] === t[0] &&
|
|
2378
|
-
for (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; ) {
|
|
2379
2460
|
for (; t.length > 3; )
|
|
2380
2461
|
t.pop()();
|
|
2381
2462
|
if (t[1] < t[0])
|
|
2382
2463
|
break;
|
|
2383
|
-
|
|
2464
|
+
i.u = t = t[2];
|
|
2384
2465
|
}
|
|
2385
2466
|
};
|
|
2386
|
-
function
|
|
2467
|
+
function mn(i) {
|
|
2387
2468
|
return this.getChildContext = function() {
|
|
2388
|
-
return
|
|
2389
|
-
},
|
|
2469
|
+
return i.context;
|
|
2470
|
+
}, i.children;
|
|
2390
2471
|
}
|
|
2391
|
-
function
|
|
2392
|
-
var e = this, t =
|
|
2472
|
+
function gn(i) {
|
|
2473
|
+
var e = this, t = i.i;
|
|
2393
2474
|
e.componentWillUnmount = function() {
|
|
2394
2475
|
te(null, e.l), e.l = null, e.i = null;
|
|
2395
|
-
}, e.i && e.i !== t && e.componentWillUnmount(), e.l || (e.i = t, e.l = { nodeType: 1, parentNode: t, childNodes: [], appendChild: function(
|
|
2396
|
-
this.childNodes.push(
|
|
2397
|
-
}, insertBefore: function(
|
|
2398
|
-
this.childNodes.push(
|
|
2399
|
-
}, removeChild: function(
|
|
2400
|
-
this.childNodes.splice(this.childNodes.indexOf(
|
|
2401
|
-
} }), te(I(
|
|
2402
|
-
}
|
|
2403
|
-
function
|
|
2404
|
-
var t = I(
|
|
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 });
|
|
2405
2486
|
return t.containerInfo = e, t;
|
|
2406
2487
|
}
|
|
2407
|
-
(
|
|
2408
|
-
var e = this, t =
|
|
2409
|
-
return
|
|
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) {
|
|
2410
2491
|
var o = function() {
|
|
2411
|
-
e.props.revealOrder ? (
|
|
2492
|
+
e.props.revealOrder ? (n.push(s), Tt(e, i, n)) : s();
|
|
2412
2493
|
};
|
|
2413
2494
|
t ? t(o) : o();
|
|
2414
2495
|
};
|
|
2415
|
-
},
|
|
2496
|
+
}, be.prototype.render = function(i) {
|
|
2416
2497
|
this.u = null, this.o = /* @__PURE__ */ new Map();
|
|
2417
|
-
var e =
|
|
2418
|
-
|
|
2498
|
+
var e = Se(i.children);
|
|
2499
|
+
i.revealOrder && i.revealOrder[0] === "b" && e.reverse();
|
|
2419
2500
|
for (var t = e.length; t--; )
|
|
2420
2501
|
this.o.set(e[t], this.u = [1, 0, this.u]);
|
|
2421
|
-
return
|
|
2422
|
-
},
|
|
2423
|
-
var
|
|
2502
|
+
return i.children;
|
|
2503
|
+
}, be.prototype.componentDidUpdate = be.prototype.componentDidMount = function() {
|
|
2504
|
+
var i = this;
|
|
2424
2505
|
this.o.forEach(function(e, t) {
|
|
2425
|
-
|
|
2506
|
+
Tt(i, t, e);
|
|
2426
2507
|
});
|
|
2427
2508
|
};
|
|
2428
|
-
var
|
|
2429
|
-
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(
|
|
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);
|
|
2430
2511
|
};
|
|
2431
|
-
H.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(
|
|
2432
|
-
Object.defineProperty(H.prototype,
|
|
2433
|
-
return this["UNSAFE_" +
|
|
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];
|
|
2434
2515
|
}, set: function(e) {
|
|
2435
|
-
Object.defineProperty(this,
|
|
2516
|
+
Object.defineProperty(this, i, { configurable: !0, writable: !0, value: e });
|
|
2436
2517
|
} });
|
|
2437
2518
|
});
|
|
2438
|
-
var
|
|
2439
|
-
function
|
|
2519
|
+
var xt = g.event;
|
|
2520
|
+
function kn() {
|
|
2440
2521
|
}
|
|
2441
|
-
function
|
|
2522
|
+
function En() {
|
|
2442
2523
|
return this.cancelBubble;
|
|
2443
2524
|
}
|
|
2444
|
-
function
|
|
2525
|
+
function Nn() {
|
|
2445
2526
|
return this.defaultPrevented;
|
|
2446
2527
|
}
|
|
2447
|
-
|
|
2448
|
-
return
|
|
2528
|
+
g.event = function(i) {
|
|
2529
|
+
return xt && (i = xt(i)), i.persist = kn, i.isPropagationStopped = En, i.isDefaultPrevented = Nn, i.nativeEvent = i;
|
|
2449
2530
|
};
|
|
2450
|
-
var
|
|
2531
|
+
var $n = { enumerable: !1, configurable: !0, get: function() {
|
|
2451
2532
|
return this.class;
|
|
2452
|
-
} },
|
|
2453
|
-
|
|
2454
|
-
typeof
|
|
2455
|
-
var t = e.props,
|
|
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 = {};
|
|
2456
2537
|
for (var o in t) {
|
|
2457
2538
|
var r = t[o];
|
|
2458
|
-
if (!(o === "value" && "defaultValue" in t && r == null ||
|
|
2459
|
-
var
|
|
2460
|
-
o === "defaultValue" && "value" in t && t.value == null ? o = "value" : o === "download" && r === !0 ? r = "" :
|
|
2539
|
+
if (!(o === "value" && "defaultValue" in t && r == null || xn && o === "children" && n === "noscript" || o === "class" || o === "className")) {
|
|
2540
|
+
var a = o.toLowerCase();
|
|
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;
|
|
2461
2542
|
}
|
|
2462
2543
|
}
|
|
2463
|
-
|
|
2544
|
+
n == "select" && s.multiple && Array.isArray(s.value) && (s.value = Se(t.children).forEach(function(u) {
|
|
2464
2545
|
u.props.selected = s.value.indexOf(u.props.value) != -1;
|
|
2465
|
-
})),
|
|
2546
|
+
})), n == "select" && s.defaultValue != null && (s.value = Se(t.children).forEach(function(u) {
|
|
2466
2547
|
u.props.selected = s.multiple ? s.defaultValue.indexOf(u.props.value) != -1 : s.defaultValue == u.props.value;
|
|
2467
|
-
})), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className",
|
|
2468
|
-
}(
|
|
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);
|
|
2469
2550
|
};
|
|
2470
|
-
var
|
|
2471
|
-
|
|
2472
|
-
|
|
2551
|
+
var kt = g.__r;
|
|
2552
|
+
g.__r = function(i) {
|
|
2553
|
+
kt && kt(i), i.__c;
|
|
2473
2554
|
};
|
|
2474
|
-
var
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
var e =
|
|
2478
|
-
t != null &&
|
|
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);
|
|
2479
2560
|
};
|
|
2480
|
-
var
|
|
2481
|
-
function
|
|
2482
|
-
var e =
|
|
2561
|
+
var fe = /* @__PURE__ */ new Map();
|
|
2562
|
+
function Mn(i) {
|
|
2563
|
+
var e = fe.get(i);
|
|
2483
2564
|
e && e.destroy();
|
|
2484
2565
|
}
|
|
2485
|
-
function
|
|
2486
|
-
var e =
|
|
2566
|
+
function An(i) {
|
|
2567
|
+
var e = fe.get(i);
|
|
2487
2568
|
e && e.update();
|
|
2488
2569
|
}
|
|
2489
|
-
var
|
|
2490
|
-
typeof window > "u" ? ((
|
|
2491
|
-
return
|
|
2492
|
-
}).destroy = function(
|
|
2493
|
-
return
|
|
2494
|
-
},
|
|
2495
|
-
return
|
|
2496
|
-
}) : ((
|
|
2497
|
-
return
|
|
2498
|
-
return function(
|
|
2499
|
-
if (
|
|
2500
|
-
var s, o = null, r = window.getComputedStyle(
|
|
2501
|
-
|
|
2502
|
-
}), u = (function(
|
|
2503
|
-
|
|
2504
|
-
return
|
|
2505
|
-
}),
|
|
2506
|
-
}).bind(
|
|
2507
|
-
|
|
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;
|
|
2583
|
+
}), u = (function(c) {
|
|
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();
|
|
2508
2589
|
}
|
|
2509
|
-
function
|
|
2510
|
-
var
|
|
2511
|
-
if (
|
|
2512
|
-
for (var
|
|
2513
|
-
T.parentNode.scrollTop &&
|
|
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;
|
|
2514
2595
|
return function() {
|
|
2515
|
-
return
|
|
2516
|
-
var D =
|
|
2517
|
-
D.style.scrollBehavior = "auto", D.scrollTop =
|
|
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;
|
|
2518
2599
|
});
|
|
2519
2600
|
};
|
|
2520
|
-
}(
|
|
2521
|
-
var
|
|
2522
|
-
r.overflow === "hidden" && (
|
|
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 });
|
|
2523
2604
|
}
|
|
2524
2605
|
}
|
|
2525
2606
|
function d() {
|
|
2526
|
-
|
|
2607
|
+
h({ testForHeightReduction: !0, restoreTextAlign: null });
|
|
2527
2608
|
}
|
|
2528
2609
|
}(t);
|
|
2529
|
-
}),
|
|
2530
|
-
}).destroy = function(
|
|
2531
|
-
return
|
|
2532
|
-
},
|
|
2533
|
-
return
|
|
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;
|
|
2534
2615
|
});
|
|
2535
|
-
var
|
|
2536
|
-
class
|
|
2616
|
+
var Nt = ue;
|
|
2617
|
+
class le {
|
|
2537
2618
|
constructor(e) {
|
|
2538
2619
|
this.msg = e;
|
|
2539
2620
|
}
|
|
@@ -2549,6 +2630,14 @@ class Ue {
|
|
|
2549
2630
|
get type() {
|
|
2550
2631
|
return this.msg.type;
|
|
2551
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
|
+
}
|
|
2552
2641
|
get content() {
|
|
2553
2642
|
return this.msg.content;
|
|
2554
2643
|
}
|
|
@@ -2602,7 +2691,7 @@ class ye {
|
|
|
2602
2691
|
return this.data.aiChat;
|
|
2603
2692
|
}
|
|
2604
2693
|
}
|
|
2605
|
-
class
|
|
2694
|
+
class Ve {
|
|
2606
2695
|
constructor(e) {
|
|
2607
2696
|
this.material = e;
|
|
2608
2697
|
}
|
|
@@ -2619,9 +2708,19 @@ class Fe {
|
|
|
2619
2708
|
return this.material.data;
|
|
2620
2709
|
}
|
|
2621
2710
|
}
|
|
2622
|
-
var N = /* @__PURE__ */ ((
|
|
2623
|
-
class
|
|
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 || {});
|
|
2712
|
+
class $t {
|
|
2624
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
|
+
/**
|
|
2625
2724
|
* Creates an instance of AiChatController.
|
|
2626
2725
|
*
|
|
2627
2726
|
* @author chitanda
|
|
@@ -2636,7 +2735,7 @@ class Nt {
|
|
|
2636
2735
|
* @date 2023-10-16 16:10:29
|
|
2637
2736
|
* @type {Signal<ChatMessage[]>}
|
|
2638
2737
|
*/
|
|
2639
|
-
w(this, "messages",
|
|
2738
|
+
w(this, "messages", j([]));
|
|
2640
2739
|
/**
|
|
2641
2740
|
* 素材列表
|
|
2642
2741
|
*
|
|
@@ -2644,7 +2743,7 @@ class Nt {
|
|
|
2644
2743
|
* @date 2025-02-27 18:02:46
|
|
2645
2744
|
* @type {Signal<IMaterial[]>}
|
|
2646
2745
|
*/
|
|
2647
|
-
w(this, "materials",
|
|
2746
|
+
w(this, "materials", j([]));
|
|
2648
2747
|
/**
|
|
2649
2748
|
* 聊天框输入值
|
|
2650
2749
|
*
|
|
@@ -2652,7 +2751,15 @@ class Nt {
|
|
|
2652
2751
|
* @date 2023-10-16 15:10:43
|
|
2653
2752
|
* @type {Signal<string>}
|
|
2654
2753
|
*/
|
|
2655
|
-
w(this, "input",
|
|
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));
|
|
2656
2763
|
/**
|
|
2657
2764
|
* 视图参数
|
|
2658
2765
|
*
|
|
@@ -2685,7 +2792,15 @@ class Nt {
|
|
|
2685
2792
|
* @type {(string | undefined)}
|
|
2686
2793
|
*/
|
|
2687
2794
|
w(this, "topicId");
|
|
2688
|
-
|
|
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();
|
|
2689
2804
|
}
|
|
2690
2805
|
/**
|
|
2691
2806
|
* 获取历史记录
|
|
@@ -2696,10 +2811,10 @@ class Nt {
|
|
|
2696
2811
|
*/
|
|
2697
2812
|
async fecthHistory() {
|
|
2698
2813
|
if (this.topicId) {
|
|
2699
|
-
const e = await
|
|
2814
|
+
const e = await Y.getData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, this.topicId);
|
|
2700
2815
|
if (e && e.data && e.data.length > 0)
|
|
2701
2816
|
return e.data.forEach((t) => {
|
|
2702
|
-
const
|
|
2817
|
+
const n = {
|
|
2703
2818
|
messageid: t.messageid,
|
|
2704
2819
|
state: t.state,
|
|
2705
2820
|
type: t.type,
|
|
@@ -2707,7 +2822,7 @@ class Nt {
|
|
|
2707
2822
|
content: t.content,
|
|
2708
2823
|
completed: !0
|
|
2709
2824
|
};
|
|
2710
|
-
this.addMessage(
|
|
2825
|
+
this.addMessage(n);
|
|
2711
2826
|
}), !0;
|
|
2712
2827
|
}
|
|
2713
2828
|
return this.opts.history(this.context, this.params, {
|
|
@@ -2729,7 +2844,7 @@ class Nt {
|
|
|
2729
2844
|
data: this.messages.value.map((t) => t._origin),
|
|
2730
2845
|
timestamp: (/* @__PURE__ */ new Date()).getTime()
|
|
2731
2846
|
};
|
|
2732
|
-
await
|
|
2847
|
+
await Y.updateData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, e);
|
|
2733
2848
|
}
|
|
2734
2849
|
/**
|
|
2735
2850
|
* 设置聊天框值
|
|
@@ -2749,8 +2864,8 @@ class Nt {
|
|
|
2749
2864
|
* @param {IMessage} data
|
|
2750
2865
|
*/
|
|
2751
2866
|
addMessage(e) {
|
|
2752
|
-
const t = this.messages.value.find((
|
|
2753
|
-
t ? (t.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new
|
|
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();
|
|
2754
2869
|
}
|
|
2755
2870
|
/**
|
|
2756
2871
|
* 更新消息完成状态
|
|
@@ -2761,8 +2876,8 @@ class Nt {
|
|
|
2761
2876
|
* @param {boolean} completed
|
|
2762
2877
|
*/
|
|
2763
2878
|
completeMessage(e, t) {
|
|
2764
|
-
const
|
|
2765
|
-
|
|
2879
|
+
const n = this.messages.value.find((s) => s.messageid === e);
|
|
2880
|
+
n && (n.updateCompleted(t), this.messages.value = [...this.messages.value], this.asyncToIndexDB());
|
|
2766
2881
|
}
|
|
2767
2882
|
/**
|
|
2768
2883
|
* 替换已经存在的聊天消息
|
|
@@ -2772,8 +2887,24 @@ class Nt {
|
|
|
2772
2887
|
* @param {IChatMessage} data
|
|
2773
2888
|
*/
|
|
2774
2889
|
replaceMessage(e) {
|
|
2775
|
-
const t = this.messages.value.findIndex((
|
|
2776
|
-
t !== -1 ? (this.messages.value[t] = new
|
|
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();
|
|
2777
2908
|
}
|
|
2778
2909
|
/**
|
|
2779
2910
|
* 数据对象转 XML 字符串
|
|
@@ -2785,13 +2916,13 @@ class Nt {
|
|
|
2785
2916
|
stringlyMaterialResource() {
|
|
2786
2917
|
let e = "";
|
|
2787
2918
|
const t = [];
|
|
2788
|
-
return this.materials.value && this.materials.value.length > 0 && (this.materials.value.forEach((
|
|
2789
|
-
if (
|
|
2790
|
-
const s =
|
|
2791
|
-
s.state && s.state === "successed" && t.push(
|
|
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);
|
|
2792
2923
|
} else
|
|
2793
|
-
t.push(
|
|
2794
|
-
}), this.materials.value = []), t && t.length > 0 && (e =
|
|
2924
|
+
t.push(n);
|
|
2925
|
+
}), this.materials.value = []), t && t.length > 0 && (e = Jt.stringify(t)), e;
|
|
2795
2926
|
}
|
|
2796
2927
|
/**
|
|
2797
2928
|
* 提问
|
|
@@ -2801,16 +2932,34 @@ class Nt {
|
|
|
2801
2932
|
* @return {*} {Promise<void>}
|
|
2802
2933
|
*/
|
|
2803
2934
|
async question(e) {
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
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
|
+
}
|
|
2814
2963
|
}
|
|
2815
2964
|
/**
|
|
2816
2965
|
* 回填选中的消息
|
|
@@ -2830,7 +2979,7 @@ class Nt {
|
|
|
2830
2979
|
* @memberof AiChatController
|
|
2831
2980
|
*/
|
|
2832
2981
|
deleteMessage(e) {
|
|
2833
|
-
const t = this.messages.value.findIndex((
|
|
2982
|
+
const t = this.messages.value.findIndex((n) => n.messageid === e.messageid);
|
|
2834
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);
|
|
2835
2984
|
}
|
|
2836
2985
|
/**
|
|
@@ -2839,20 +2988,25 @@ class Nt {
|
|
|
2839
2988
|
* @memberof AiChatController
|
|
2840
2989
|
*/
|
|
2841
2990
|
async refreshMessage(e, t = !1) {
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
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;
|
|
2854
3009
|
}
|
|
2855
|
-
this.asyncToIndexDB(), this.opts.action && this.opts.action("refreshmsg", e);
|
|
2856
3010
|
}
|
|
2857
3011
|
/**
|
|
2858
3012
|
* 复制消息
|
|
@@ -2861,8 +3015,8 @@ class Nt {
|
|
|
2861
3015
|
* @memberof AiChatController
|
|
2862
3016
|
*/
|
|
2863
3017
|
copyMessage(e) {
|
|
2864
|
-
const t = e.
|
|
2865
|
-
|
|
3018
|
+
const t = e.realcontent;
|
|
3019
|
+
Gt.copy(t), this.opts.action && this.opts.action("copymsg", e);
|
|
2866
3020
|
}
|
|
2867
3021
|
/**
|
|
2868
3022
|
* 新建对话
|
|
@@ -2870,7 +3024,7 @@ class Nt {
|
|
|
2870
3024
|
* @memberof AiChatController
|
|
2871
3025
|
*/
|
|
2872
3026
|
async newDialogue() {
|
|
2873
|
-
this.messages.value.length = 0, this.topicId && await
|
|
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, {
|
|
2874
3028
|
appDataEntityId: this.appDataEntityId
|
|
2875
3029
|
});
|
|
2876
3030
|
}
|
|
@@ -2882,7 +3036,7 @@ class Nt {
|
|
|
2882
3036
|
* @param {IMaterial} data
|
|
2883
3037
|
*/
|
|
2884
3038
|
addMaterial(e) {
|
|
2885
|
-
this.materials.value.find((
|
|
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)];
|
|
2886
3040
|
}
|
|
2887
3041
|
/**
|
|
2888
3042
|
* 替换素材资源
|
|
@@ -2893,8 +3047,8 @@ class Nt {
|
|
|
2893
3047
|
* @param {IMaterial} data
|
|
2894
3048
|
*/
|
|
2895
3049
|
replaceMaterial(e, t) {
|
|
2896
|
-
const
|
|
2897
|
-
|
|
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)];
|
|
2898
3052
|
}
|
|
2899
3053
|
/**
|
|
2900
3054
|
* 删除指定素材资源
|
|
@@ -2904,11 +3058,11 @@ class Nt {
|
|
|
2904
3058
|
* @param {IMaterial} data
|
|
2905
3059
|
*/
|
|
2906
3060
|
deleteMaterial(e) {
|
|
2907
|
-
const t = this.materials.value.findIndex((
|
|
3061
|
+
const t = this.materials.value.findIndex((n) => n.id === e.id);
|
|
2908
3062
|
t !== -1 && (this.materials.value.splice(t, 1), this.materials.value = [...this.materials.value]);
|
|
2909
3063
|
}
|
|
2910
3064
|
}
|
|
2911
|
-
class
|
|
3065
|
+
class In {
|
|
2912
3066
|
/**
|
|
2913
3067
|
* Creates an instance of AiTopicController.
|
|
2914
3068
|
* @author tony001
|
|
@@ -2923,7 +3077,7 @@ class Si {
|
|
|
2923
3077
|
* @date 2025-02-20 16:02:38
|
|
2924
3078
|
* @type {Signal<ChatTopic[]>}
|
|
2925
3079
|
*/
|
|
2926
|
-
w(this, "topics",
|
|
3080
|
+
w(this, "topics", j([]));
|
|
2927
3081
|
/**
|
|
2928
3082
|
* 激活话题
|
|
2929
3083
|
*
|
|
@@ -2931,7 +3085,7 @@ class Si {
|
|
|
2931
3085
|
* @date 2025-02-24 16:02:44
|
|
2932
3086
|
* @type {(Signal<ITopic | null>)}
|
|
2933
3087
|
*/
|
|
2934
|
-
w(this, "activedTopic",
|
|
3088
|
+
w(this, "activedTopic", j(null));
|
|
2935
3089
|
/**
|
|
2936
3090
|
* 当前话题配置备份
|
|
2937
3091
|
*
|
|
@@ -2951,8 +3105,8 @@ class Si {
|
|
|
2951
3105
|
* @return {*} {Promise<void>}
|
|
2952
3106
|
*/
|
|
2953
3107
|
async fetchHistory(e) {
|
|
2954
|
-
const
|
|
2955
|
-
|
|
3108
|
+
const n = await e.configService(e.appid, "aitopics", e.type).load();
|
|
3109
|
+
n && n.length > 0 && n.forEach((s) => {
|
|
2956
3110
|
this.topics.value = [...this.topics.value, new ye(s)];
|
|
2957
3111
|
});
|
|
2958
3112
|
}
|
|
@@ -2966,7 +3120,7 @@ class Si {
|
|
|
2966
3120
|
*/
|
|
2967
3121
|
async updateCurrentTopic(e) {
|
|
2968
3122
|
this.currentTopicOptions = e;
|
|
2969
|
-
const t = this.topics.value.findIndex((r) => r.id === e.id),
|
|
3123
|
+
const t = this.topics.value.findIndex((r) => r.id === e.id), n = new ye(e);
|
|
2970
3124
|
t !== -1 ? this.topics.value.splice(t, 1, new ye(e)) : this.topics.value = [...this.topics.value, new ye(e)];
|
|
2971
3125
|
const s = this.topics.value.map((r) => ({
|
|
2972
3126
|
appid: r.appid,
|
|
@@ -2976,7 +3130,7 @@ class Si {
|
|
|
2976
3130
|
url: r.url,
|
|
2977
3131
|
aiChat: r.aiChat
|
|
2978
3132
|
})), o = e.configService(e.appid, "aitopics", e.type);
|
|
2979
|
-
await (o == null ? void 0 : o.save(s)), this.activedTopic.value =
|
|
3133
|
+
await (o == null ? void 0 : o.save(s)), this.activedTopic.value = n;
|
|
2980
3134
|
}
|
|
2981
3135
|
/**
|
|
2982
3136
|
* 删除话题
|
|
@@ -2990,22 +3144,22 @@ class Si {
|
|
|
2990
3144
|
* @param {MouseEvent} event
|
|
2991
3145
|
* @return {*} {Promise<void>}
|
|
2992
3146
|
*/
|
|
2993
|
-
async removeTopic(e, t,
|
|
3147
|
+
async removeTopic(e, t, n, s, o) {
|
|
2994
3148
|
var d;
|
|
2995
3149
|
let r = !0;
|
|
2996
|
-
if (e.beforeDelete && (r = await e.beforeDelete(t,
|
|
3150
|
+
if (e.beforeDelete && (r = await e.beforeDelete(t, n, s, o)), !r)
|
|
2997
3151
|
return;
|
|
2998
|
-
const
|
|
2999
|
-
|
|
3000
|
-
const u = this.topics.value.map((
|
|
3001
|
-
appid:
|
|
3002
|
-
id:
|
|
3003
|
-
type:
|
|
3004
|
-
caption:
|
|
3005
|
-
url:
|
|
3006
|
-
aiChat:
|
|
3007
|
-
})),
|
|
3008
|
-
await (
|
|
3152
|
+
const a = this.topics.value.findIndex((c) => c.id === s.id);
|
|
3153
|
+
a !== -1 && (this.topics.value.splice(a, 1), this.topics.value = [...this.topics.value]);
|
|
3154
|
+
const u = this.topics.value.map((c) => ({
|
|
3155
|
+
appid: c.appid,
|
|
3156
|
+
id: c.id,
|
|
3157
|
+
type: c.type,
|
|
3158
|
+
caption: c.caption,
|
|
3159
|
+
url: c.url,
|
|
3160
|
+
aiChat: c.aiChat
|
|
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]);
|
|
3009
3163
|
}
|
|
3010
3164
|
/**
|
|
3011
3165
|
* 处理选中变化
|
|
@@ -3028,24 +3182,24 @@ class Si {
|
|
|
3028
3182
|
* @param {MouseEvent} event
|
|
3029
3183
|
* @return {*} {Promise<void>}
|
|
3030
3184
|
*/
|
|
3031
|
-
async handleTopicAction(e, t,
|
|
3185
|
+
async handleTopicAction(e, t, n) {
|
|
3032
3186
|
var o, r;
|
|
3033
|
-
const s = this.topics.value.find((
|
|
3187
|
+
const s = this.topics.value.find((a) => a.id === t.id);
|
|
3034
3188
|
if (this.currentTopicOptions && s && s.aiChat) {
|
|
3035
3189
|
const {
|
|
3036
|
-
context:
|
|
3190
|
+
context: a,
|
|
3037
3191
|
params: u
|
|
3038
3192
|
} = s.aiChat;
|
|
3039
|
-
e === "DELETE" && await this.removeTopic(this.currentTopicOptions,
|
|
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);
|
|
3040
3194
|
}
|
|
3041
3195
|
}
|
|
3042
3196
|
}
|
|
3043
|
-
class
|
|
3197
|
+
class pi {
|
|
3044
3198
|
constructor(e) {
|
|
3045
3199
|
this.aiChat = e;
|
|
3046
3200
|
}
|
|
3047
3201
|
}
|
|
3048
|
-
class
|
|
3202
|
+
class Dn extends pi {
|
|
3049
3203
|
/**
|
|
3050
3204
|
* 执行操作
|
|
3051
3205
|
*
|
|
@@ -3055,9 +3209,9 @@ class Ei extends ln {
|
|
|
3055
3209
|
*/
|
|
3056
3210
|
async excuteAction(e, t) {
|
|
3057
3211
|
if (t && t.onClick) {
|
|
3058
|
-
const
|
|
3059
|
-
if (
|
|
3060
|
-
const s =
|
|
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 = {
|
|
3061
3215
|
id: s.id,
|
|
3062
3216
|
type: s.type,
|
|
3063
3217
|
data: s.data || {},
|
|
@@ -3070,7 +3224,7 @@ class Ei extends ln {
|
|
|
3070
3224
|
}
|
|
3071
3225
|
}
|
|
3072
3226
|
}
|
|
3073
|
-
class
|
|
3227
|
+
class zn extends pi {
|
|
3074
3228
|
/**
|
|
3075
3229
|
* 执行操作
|
|
3076
3230
|
*
|
|
@@ -3079,63 +3233,63 @@ class Ni extends ln {
|
|
|
3079
3233
|
* @return {*} {Promise<void>}
|
|
3080
3234
|
*/
|
|
3081
3235
|
async excuteAction(e, t) {
|
|
3082
|
-
const
|
|
3236
|
+
const n = this.aiChat.opts.uploader, {
|
|
3083
3237
|
multiple: s,
|
|
3084
3238
|
accept: o,
|
|
3085
3239
|
maxSize: r,
|
|
3086
|
-
onSelect:
|
|
3240
|
+
onSelect: a,
|
|
3087
3241
|
onUpload: u,
|
|
3088
|
-
onSuccess:
|
|
3242
|
+
onSuccess: h,
|
|
3089
3243
|
onError: d,
|
|
3090
|
-
onProgress:
|
|
3091
|
-
} =
|
|
3244
|
+
onProgress: c
|
|
3245
|
+
} = n, p = {
|
|
3092
3246
|
multiple: s || !0,
|
|
3093
3247
|
accept: o || "*/*",
|
|
3094
3248
|
maxSize: r || 5 * 1024 * 1024,
|
|
3095
|
-
onSelect: (
|
|
3096
|
-
|
|
3097
|
-
const
|
|
3098
|
-
Object.assign(
|
|
3249
|
+
onSelect: (f) => {
|
|
3250
|
+
a == null || a(f), f.length > 0 && f.forEach((v) => {
|
|
3251
|
+
const _ = this.buildMaterialObject(v);
|
|
3252
|
+
Object.assign(_.metadata, {
|
|
3099
3253
|
state: "uploading"
|
|
3100
|
-
}), this.aiChat.addMaterial(
|
|
3254
|
+
}), this.aiChat.addMaterial(_);
|
|
3101
3255
|
});
|
|
3102
3256
|
},
|
|
3103
|
-
onUpload: async (
|
|
3257
|
+
onUpload: async (f, v) => u(f, v, {
|
|
3104
3258
|
context: this.aiChat.context,
|
|
3105
3259
|
params: this.aiChat.params
|
|
3106
3260
|
}),
|
|
3107
3261
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3108
|
-
onSuccess: (
|
|
3109
|
-
const
|
|
3110
|
-
id:
|
|
3262
|
+
onSuccess: (f, v) => {
|
|
3263
|
+
const _ = {
|
|
3264
|
+
id: f.id,
|
|
3111
3265
|
type: "ossfile",
|
|
3112
3266
|
data: {
|
|
3113
|
-
id:
|
|
3114
|
-
name:
|
|
3267
|
+
id: f.id,
|
|
3268
|
+
name: f.name
|
|
3115
3269
|
},
|
|
3116
3270
|
metadata: {
|
|
3117
|
-
ext:
|
|
3118
|
-
fileext:
|
|
3119
|
-
fileid:
|
|
3120
|
-
filename:
|
|
3121
|
-
size:
|
|
3122
|
-
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,
|
|
3123
3277
|
state: "successed"
|
|
3124
3278
|
}
|
|
3125
3279
|
};
|
|
3126
|
-
this.aiChat.replaceMaterial(
|
|
3280
|
+
this.aiChat.replaceMaterial(v.name, _), h == null || h(f, v);
|
|
3127
3281
|
},
|
|
3128
|
-
onError: (
|
|
3129
|
-
const
|
|
3130
|
-
Object.assign(
|
|
3282
|
+
onError: (f, v) => {
|
|
3283
|
+
const _ = this.buildMaterialObject(v);
|
|
3284
|
+
Object.assign(_.metadata, {
|
|
3131
3285
|
state: "failed"
|
|
3132
|
-
}), this.aiChat.replaceMaterial(
|
|
3286
|
+
}), this.aiChat.replaceMaterial(v.name, _), d == null || d(f, v);
|
|
3133
3287
|
},
|
|
3134
|
-
onProgress: (
|
|
3135
|
-
|
|
3288
|
+
onProgress: (f, v) => {
|
|
3289
|
+
c == null || c(f, v);
|
|
3136
3290
|
}
|
|
3137
3291
|
};
|
|
3138
|
-
new
|
|
3292
|
+
new Ni(p).openFilePicker();
|
|
3139
3293
|
}
|
|
3140
3294
|
/**
|
|
3141
3295
|
* 构建素材对象
|
|
@@ -3161,17 +3315,17 @@ class Ni extends ln {
|
|
|
3161
3315
|
};
|
|
3162
3316
|
}
|
|
3163
3317
|
}
|
|
3164
|
-
class
|
|
3318
|
+
class Mt {
|
|
3165
3319
|
static getMaterialHelper(e, t) {
|
|
3166
3320
|
switch (e) {
|
|
3167
3321
|
case "ossfile":
|
|
3168
|
-
return new
|
|
3322
|
+
return new zn(t);
|
|
3169
3323
|
default:
|
|
3170
|
-
return new
|
|
3324
|
+
return new Dn(t);
|
|
3171
3325
|
}
|
|
3172
3326
|
}
|
|
3173
3327
|
}
|
|
3174
|
-
class
|
|
3328
|
+
class Hn {
|
|
3175
3329
|
/**
|
|
3176
3330
|
* Creates an instance of ChatController.
|
|
3177
3331
|
* @author tony001
|
|
@@ -3224,15 +3378,25 @@ class $i {
|
|
|
3224
3378
|
*/
|
|
3225
3379
|
w(this, "aiTopic");
|
|
3226
3380
|
/**
|
|
3227
|
-
*
|
|
3381
|
+
* 话题map
|
|
3228
3382
|
*
|
|
3229
|
-
* @
|
|
3230
|
-
* @
|
|
3231
|
-
* @
|
|
3232
|
-
* @type {(AiChatController | undefined)}
|
|
3383
|
+
* @private
|
|
3384
|
+
* @type {Map<string, AiChatController>}
|
|
3385
|
+
* @memberof ChatController
|
|
3233
3386
|
*/
|
|
3234
|
-
w(this, "
|
|
3235
|
-
this.aiTopic = new
|
|
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));
|
|
3236
3400
|
}
|
|
3237
3401
|
/**
|
|
3238
3402
|
* 初始化IndexDB
|
|
@@ -3242,7 +3406,7 @@ class $i {
|
|
|
3242
3406
|
* @return {*} {Promise<void>}
|
|
3243
3407
|
*/
|
|
3244
3408
|
async initIndexDB() {
|
|
3245
|
-
await
|
|
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);
|
|
3246
3410
|
}
|
|
3247
3411
|
/**
|
|
3248
3412
|
* 创建聊天窗口(会同时显示出来)
|
|
@@ -3253,10 +3417,11 @@ class $i {
|
|
|
3253
3417
|
* @return {*} {Promise<AiChatController>}
|
|
3254
3418
|
*/
|
|
3255
3419
|
async create(e) {
|
|
3420
|
+
var o;
|
|
3256
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);
|
|
3257
3422
|
const t = e.chatOptions;
|
|
3258
|
-
let
|
|
3259
|
-
|
|
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, {
|
|
3260
3425
|
aiChat: {
|
|
3261
3426
|
caption: t.caption,
|
|
3262
3427
|
context: t.context,
|
|
@@ -3266,27 +3431,31 @@ class $i {
|
|
|
3266
3431
|
footerToolbarItems: t.footerToolbarItems,
|
|
3267
3432
|
questionToolbarItems: t.questionToolbarItems
|
|
3268
3433
|
}
|
|
3269
|
-
}), await this.aiTopic.updateCurrentTopic(
|
|
3270
|
-
topicId:
|
|
3271
|
-
|
|
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,
|
|
3272
3441
|
aiTopic: this.aiTopic,
|
|
3273
|
-
aiChat: this.aiChat,
|
|
3274
3442
|
mode: e.mode ? e.mode : "DEFAULT",
|
|
3275
3443
|
containerOptions: e.containerOptions,
|
|
3276
3444
|
caption: e.mode && e.mode === "TOPIC" ? "AI助手" : t.caption,
|
|
3445
|
+
enableBackFill: (o = e.containerOptions) == null ? void 0 : o.enableBackFill,
|
|
3277
3446
|
contentToolbarItems: t.contentToolbarItems,
|
|
3278
3447
|
footerToolbarItems: t.footerToolbarItems,
|
|
3279
3448
|
questionToolbarItems: t.questionToolbarItems,
|
|
3280
3449
|
close: () => {
|
|
3281
3450
|
this.close(), t.closed && t.closed(t.context, t.params);
|
|
3282
3451
|
},
|
|
3283
|
-
fullscreen: (
|
|
3284
|
-
t.fullscreen && t.fullscreen(
|
|
3452
|
+
fullscreen: (r) => {
|
|
3453
|
+
t.fullscreen && t.fullscreen(r, t.context, t.params);
|
|
3285
3454
|
},
|
|
3286
|
-
minimize: (
|
|
3287
|
-
t.minimize && t.minimize(
|
|
3455
|
+
minimize: (r) => {
|
|
3456
|
+
t.minimize && t.minimize(r, t.context, t.params);
|
|
3288
3457
|
}
|
|
3289
|
-
}), this.container),
|
|
3458
|
+
}), this.container), s;
|
|
3290
3459
|
}
|
|
3291
3460
|
/**
|
|
3292
3461
|
* 切换聊天控制器
|
|
@@ -3296,7 +3465,7 @@ class $i {
|
|
|
3296
3465
|
* @param {ChatTopic} topic
|
|
3297
3466
|
*/
|
|
3298
3467
|
switchAiChatController(e) {
|
|
3299
|
-
var
|
|
3468
|
+
var s, o, r, a, u;
|
|
3300
3469
|
const t = {
|
|
3301
3470
|
...this.backupChatOptions.chatOptions
|
|
3302
3471
|
};
|
|
@@ -3308,24 +3477,28 @@ class $i {
|
|
|
3308
3477
|
footerToolbarItems: e.aiChat.footerToolbarItems,
|
|
3309
3478
|
questionToolbarItems: e.aiChat.questionToolbarItems,
|
|
3310
3479
|
appDataEntityId: e.aiChat.appDataEntityId,
|
|
3311
|
-
topicId: e.id
|
|
3312
|
-
|
|
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,
|
|
3313
3486
|
aiTopic: this.aiTopic,
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
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,
|
|
3318
3491
|
contentToolbarItems: t.contentToolbarItems,
|
|
3319
3492
|
footerToolbarItems: t.footerToolbarItems,
|
|
3320
3493
|
questionToolbarItems: t.questionToolbarItems,
|
|
3321
3494
|
close: () => {
|
|
3322
3495
|
this.close(), t.closed && t.closed(t.context, t.params);
|
|
3323
3496
|
},
|
|
3324
|
-
fullscreen: (
|
|
3325
|
-
t.fullscreen && t.fullscreen(
|
|
3497
|
+
fullscreen: (h) => {
|
|
3498
|
+
t.fullscreen && t.fullscreen(h, t.context, t.params);
|
|
3326
3499
|
},
|
|
3327
|
-
minimize: (
|
|
3328
|
-
t.minimize && t.minimize(
|
|
3500
|
+
minimize: (h) => {
|
|
3501
|
+
t.minimize && t.minimize(h, t.context, t.params);
|
|
3329
3502
|
}
|
|
3330
3503
|
}), this.container));
|
|
3331
3504
|
}
|
|
@@ -3357,305 +3530,315 @@ class $i {
|
|
|
3357
3530
|
this.container && (te(null, this.container), this.container.remove(), this.container = void 0);
|
|
3358
3531
|
}
|
|
3359
3532
|
}
|
|
3360
|
-
const
|
|
3361
|
-
const
|
|
3362
|
-
const e =
|
|
3533
|
+
const Vn = new Hn();
|
|
3534
|
+
const Ln = new $("chat-input-material"), On = (i) => {
|
|
3535
|
+
const e = i.controller.materials;
|
|
3363
3536
|
return l("div", {
|
|
3364
|
-
className:
|
|
3365
|
-
children: e.value.map((t) => l(
|
|
3537
|
+
className: Ln.b(),
|
|
3538
|
+
children: e.value.map((t) => l(ui, {
|
|
3366
3539
|
material: t,
|
|
3367
3540
|
disabled: !1,
|
|
3368
|
-
controller:
|
|
3541
|
+
controller: i.controller
|
|
3369
3542
|
}, t.id))
|
|
3370
3543
|
});
|
|
3371
3544
|
};
|
|
3372
|
-
const
|
|
3373
|
-
children:
|
|
3545
|
+
const _i = ({
|
|
3546
|
+
children: i,
|
|
3374
3547
|
actions: e,
|
|
3375
3548
|
// 接收行为数据
|
|
3376
3549
|
content: t,
|
|
3377
|
-
position:
|
|
3550
|
+
position: n = "bottom",
|
|
3378
3551
|
isOpen: s,
|
|
3379
3552
|
onToggleOpen: o,
|
|
3380
3553
|
onAction: r
|
|
3381
3554
|
// 接收行为事件回调
|
|
3382
3555
|
}) => {
|
|
3383
|
-
const
|
|
3384
|
-
|
|
3556
|
+
const a = new $("pop"), u = Qt(it), [h, d] = Qe(s || !1), c = K(null), p = K(null);
|
|
3557
|
+
R(() => {
|
|
3385
3558
|
s !== void 0 && d(s);
|
|
3386
|
-
}, [s]),
|
|
3387
|
-
|
|
3388
|
-
}), []),
|
|
3389
|
-
const
|
|
3390
|
-
|
|
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));
|
|
3391
3564
|
};
|
|
3392
|
-
return
|
|
3393
|
-
document.removeEventListener("mousedown",
|
|
3565
|
+
return h && document.addEventListener("mousedown", f), () => {
|
|
3566
|
+
document.removeEventListener("mousedown", f);
|
|
3394
3567
|
};
|
|
3395
|
-
}, [
|
|
3396
|
-
const
|
|
3397
|
-
if (!
|
|
3568
|
+
}, [h, o]);
|
|
3569
|
+
const m = () => {
|
|
3570
|
+
if (!c.current)
|
|
3398
3571
|
return {};
|
|
3399
|
-
const
|
|
3572
|
+
const f = c.current.getBoundingClientRect(), v = {
|
|
3400
3573
|
position: "absolute",
|
|
3401
3574
|
zIndex: u.zIndex + 1
|
|
3402
|
-
},
|
|
3575
|
+
}, _ = {
|
|
3403
3576
|
bottom: {
|
|
3404
|
-
top:
|
|
3405
|
-
left:
|
|
3577
|
+
top: f.bottom + window.scrollY,
|
|
3578
|
+
left: f.left + window.scrollX
|
|
3406
3579
|
},
|
|
3407
3580
|
top: {
|
|
3408
|
-
bottom: window.innerHeight -
|
|
3409
|
-
left:
|
|
3581
|
+
bottom: window.innerHeight - f.top + window.scrollY,
|
|
3582
|
+
left: f.left + window.scrollX
|
|
3410
3583
|
},
|
|
3411
3584
|
left: {
|
|
3412
|
-
top:
|
|
3413
|
-
right: window.innerWidth -
|
|
3585
|
+
top: f.top + window.scrollY,
|
|
3586
|
+
right: window.innerWidth - f.left + window.scrollX
|
|
3414
3587
|
},
|
|
3415
3588
|
right: {
|
|
3416
|
-
top:
|
|
3417
|
-
left:
|
|
3589
|
+
top: f.top + window.scrollY,
|
|
3590
|
+
left: f.right + window.scrollX
|
|
3418
3591
|
},
|
|
3419
3592
|
"top-left": {
|
|
3420
|
-
bottom: window.innerHeight -
|
|
3421
|
-
right: window.innerWidth -
|
|
3593
|
+
bottom: window.innerHeight - f.top + window.scrollY,
|
|
3594
|
+
right: window.innerWidth - f.left + window.scrollX
|
|
3422
3595
|
}
|
|
3423
3596
|
};
|
|
3424
3597
|
return {
|
|
3425
|
-
...
|
|
3426
|
-
...
|
|
3598
|
+
...v,
|
|
3599
|
+
..._[n]
|
|
3427
3600
|
};
|
|
3428
3601
|
};
|
|
3429
3602
|
return l("span", {
|
|
3430
|
-
className: "".concat(
|
|
3603
|
+
className: "".concat(a.b("trigger-container")),
|
|
3431
3604
|
children: [l("span", {
|
|
3432
|
-
className: "".concat(
|
|
3433
|
-
ref:
|
|
3434
|
-
onClick: (
|
|
3435
|
-
|
|
3436
|
-
const
|
|
3437
|
-
d(
|
|
3605
|
+
className: "".concat(a.b("trigger-element")),
|
|
3606
|
+
ref: c,
|
|
3607
|
+
onClick: (f) => {
|
|
3608
|
+
f.stopPropagation();
|
|
3609
|
+
const v = !h;
|
|
3610
|
+
d(v), o == null || o(v);
|
|
3438
3611
|
},
|
|
3439
|
-
children:
|
|
3440
|
-
}),
|
|
3441
|
-
className: "".concat(
|
|
3442
|
-
style:
|
|
3443
|
-
children: t || (e == null ? void 0 : e.map((
|
|
3444
|
-
className:
|
|
3445
|
-
onMouseDown: (
|
|
3446
|
-
|
|
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", {
|
|
3617
|
+
className: a.b("content-item"),
|
|
3618
|
+
onMouseDown: (v) => {
|
|
3619
|
+
v.stopPropagation(), r == null || r(f.id, v);
|
|
3447
3620
|
},
|
|
3448
|
-
children: [
|
|
3449
|
-
className:
|
|
3450
|
-
src:
|
|
3451
|
-
alt:
|
|
3621
|
+
children: [f.icon && l("img", {
|
|
3622
|
+
className: a.b("content-item__icon"),
|
|
3623
|
+
src: f.icon,
|
|
3624
|
+
alt: f.caption
|
|
3452
3625
|
}), l("div", {
|
|
3453
|
-
className:
|
|
3454
|
-
children:
|
|
3626
|
+
className: a.b("content-item__caption"),
|
|
3627
|
+
children: f.caption
|
|
3455
3628
|
})]
|
|
3456
|
-
},
|
|
3457
|
-
}),
|
|
3458
|
-
});
|
|
3459
|
-
}, k = new M("chat-input"), kt = window.SpeechRecognition || window.webkitSpeechRecognition, Mt = (n) => {
|
|
3460
|
-
var p;
|
|
3461
|
-
const [e, t] = Je(!1), i = K(null), s = n.controller.input, o = q(!1), r = q(!1), c = K();
|
|
3462
|
-
kt && !c.current && (c.current = new kt(), c.current.onstart = () => {
|
|
3463
|
-
r.value = !0;
|
|
3464
|
-
}, c.current.onend = () => {
|
|
3465
|
-
r.value = !1;
|
|
3466
|
-
}, c.current.onresult = (g) => {
|
|
3467
|
-
var C, $, T;
|
|
3468
|
-
const b = (T = ($ = (C = g.results) == null ? void 0 : C[0]) == null ? void 0 : $[0]) == null ? void 0 : T.transcript;
|
|
3469
|
-
b && (s.value = "".concat(s.value).concat(b));
|
|
3629
|
+
}, f.id)))
|
|
3630
|
+
}), p.current)]
|
|
3470
3631
|
});
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
}, [s]), d = O(() => s.value.length <= 0 || o.value === !0);
|
|
3476
|
-
V(() => (i.current && Et(i.current), () => {
|
|
3477
|
-
i.current && Et.destroy(i.current);
|
|
3478
|
-
}), [i]);
|
|
3479
|
-
const a = 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 = () => {
|
|
3480
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 () => {
|
|
3481
3653
|
try {
|
|
3482
|
-
const
|
|
3483
|
-
s.value = "", await
|
|
3484
|
-
} catch (
|
|
3485
|
-
console.error(
|
|
3486
|
-
}
|
|
3487
|
-
|
|
3654
|
+
const _ = s.value;
|
|
3655
|
+
s.value = "", await i.controller.question(_);
|
|
3656
|
+
} catch (_) {
|
|
3657
|
+
console.error(_);
|
|
3658
|
+
}
|
|
3659
|
+
}, [s]), c = Be(async () => {
|
|
3660
|
+
try {
|
|
3661
|
+
i.controller.abortQuestion();
|
|
3662
|
+
} catch (_) {
|
|
3663
|
+
console.error(_);
|
|
3488
3664
|
}
|
|
3489
|
-
}, [s
|
|
3490
|
-
|
|
3491
|
-
},
|
|
3492
|
-
await
|
|
3493
|
-
},
|
|
3494
|
-
await
|
|
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);
|
|
3495
3671
|
};
|
|
3496
3672
|
return l("div", {
|
|
3497
|
-
className:
|
|
3673
|
+
className: M.b("wrapper"),
|
|
3498
3674
|
children: [l("div", {
|
|
3499
|
-
className:
|
|
3500
|
-
children: l(
|
|
3501
|
-
controller:
|
|
3675
|
+
className: M.b("material-wrapper"),
|
|
3676
|
+
children: l(On, {
|
|
3677
|
+
controller: i.controller
|
|
3502
3678
|
})
|
|
3503
3679
|
}), l("div", {
|
|
3504
|
-
className:
|
|
3680
|
+
className: M.b("main-wrapper"),
|
|
3505
3681
|
children: [l("textarea", {
|
|
3506
|
-
className:
|
|
3682
|
+
className: M.e("textarea"),
|
|
3507
3683
|
type: "text",
|
|
3508
3684
|
rows: 6,
|
|
3509
3685
|
autoCorrect: "off",
|
|
3510
3686
|
autoCapitalize: "off",
|
|
3511
3687
|
autoComplete: "off",
|
|
3512
3688
|
value: s,
|
|
3513
|
-
onInput:
|
|
3514
|
-
onKeyDown:
|
|
3515
|
-
ref:
|
|
3516
|
-
disabled:
|
|
3689
|
+
onInput: u,
|
|
3690
|
+
onKeyDown: p,
|
|
3691
|
+
ref: n,
|
|
3692
|
+
disabled: i.controller.isLoading.value
|
|
3517
3693
|
}), l("div", {
|
|
3518
|
-
className:
|
|
3694
|
+
className: M.b("action-wrapper"),
|
|
3519
3695
|
children: [l("div", {
|
|
3520
|
-
className: "".concat(
|
|
3521
|
-
children: l(
|
|
3696
|
+
className: "".concat(M.be("action-wrapper", "action-item")),
|
|
3697
|
+
children: l(_i, {
|
|
3522
3698
|
content: l("div", {
|
|
3523
|
-
className:
|
|
3699
|
+
className: M.b("pop-actions"),
|
|
3524
3700
|
children: [l("div", {
|
|
3525
|
-
className:
|
|
3526
|
-
onClick: (
|
|
3527
|
-
|
|
3701
|
+
className: M.b("pop-action-item"),
|
|
3702
|
+
onClick: (_) => {
|
|
3703
|
+
m(_);
|
|
3528
3704
|
},
|
|
3529
3705
|
children: [l("span", {
|
|
3530
|
-
className:
|
|
3531
|
-
children: l(
|
|
3706
|
+
className: M.b("pop-action-item-icon"),
|
|
3707
|
+
children: l(li, {})
|
|
3532
3708
|
}), l("span", {
|
|
3533
|
-
className:
|
|
3709
|
+
className: M.b("pop-action-item-title"),
|
|
3534
3710
|
children: "文件资料"
|
|
3535
3711
|
})]
|
|
3536
|
-
}), (
|
|
3537
|
-
className:
|
|
3538
|
-
onClick: (
|
|
3539
|
-
|
|
3712
|
+
}), (v = i.questionToolbarItems) == null ? void 0 : v.map((_) => l("div", {
|
|
3713
|
+
className: M.b("pop-action-item"),
|
|
3714
|
+
onClick: (y) => {
|
|
3715
|
+
f(y, _);
|
|
3540
3716
|
},
|
|
3541
3717
|
children: [l("span", {
|
|
3542
|
-
className:
|
|
3543
|
-
children: typeof
|
|
3718
|
+
className: M.b("pop-action-item-icon"),
|
|
3719
|
+
children: typeof _.icon == "function" ? _.icon(I) : _.icon
|
|
3544
3720
|
}), l("span", {
|
|
3545
|
-
className:
|
|
3546
|
-
children: typeof
|
|
3721
|
+
className: M.b("pop-action-item-title"),
|
|
3722
|
+
children: typeof _.label == "function" ? _.label(I) : _.label
|
|
3547
3723
|
})]
|
|
3548
|
-
},
|
|
3724
|
+
}, _.id))]
|
|
3549
3725
|
}),
|
|
3550
3726
|
position: "top-left",
|
|
3551
3727
|
isOpen: e,
|
|
3552
3728
|
onToggleOpen: t,
|
|
3553
|
-
children: l(
|
|
3729
|
+
children: l(Ki, {})
|
|
3554
3730
|
})
|
|
3555
3731
|
}), l("div", {
|
|
3556
|
-
title:
|
|
3557
|
-
className: "".concat(
|
|
3558
|
-
onClick: u,
|
|
3559
|
-
children: r.value ? l(qn, {}) : l(Vn, {})
|
|
3560
|
-
}), l("div", {
|
|
3561
|
-
title: o.value ? "思考中..." : "发送消息",
|
|
3562
|
-
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")),
|
|
3563
3734
|
onClick: a,
|
|
3564
|
-
|
|
3565
|
-
|
|
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")),
|
|
3739
|
+
onClick: c,
|
|
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
|
+
})
|
|
3566
3748
|
})]
|
|
3567
3749
|
})]
|
|
3568
3750
|
})]
|
|
3569
3751
|
});
|
|
3570
3752
|
};
|
|
3571
|
-
const
|
|
3753
|
+
const V = new $("chat-topic-item"), Bn = (i) => {
|
|
3572
3754
|
const {
|
|
3573
3755
|
controller: e,
|
|
3574
3756
|
topic: t,
|
|
3575
|
-
onClick:
|
|
3757
|
+
onClick: n,
|
|
3576
3758
|
onAction: s
|
|
3577
|
-
} =
|
|
3578
|
-
var
|
|
3579
|
-
return ((
|
|
3580
|
-
}), [r,
|
|
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) => {
|
|
3581
3763
|
d.stopPropagation(), s("LINK", d);
|
|
3582
|
-
},
|
|
3583
|
-
d === "DELETE" && s("DELETE",
|
|
3764
|
+
}, h = (d, c) => {
|
|
3765
|
+
d === "DELETE" && s("DELETE", c), a(!1);
|
|
3584
3766
|
};
|
|
3585
3767
|
return l("div", {
|
|
3586
|
-
className: "".concat(
|
|
3587
|
-
onClick:
|
|
3768
|
+
className: "".concat(V.b(), " ").concat(V.is("active", o.value)),
|
|
3769
|
+
onClick: n.bind(void 0),
|
|
3588
3770
|
children: [l("div", {
|
|
3589
|
-
className:
|
|
3771
|
+
className: V.b("caption"),
|
|
3590
3772
|
title: t.caption,
|
|
3591
3773
|
children: t.caption
|
|
3592
3774
|
}), l("div", {
|
|
3593
|
-
className:
|
|
3775
|
+
className: V.b("icon"),
|
|
3594
3776
|
children: [l("span", {
|
|
3595
|
-
className:
|
|
3777
|
+
className: V.be("icon", "item"),
|
|
3596
3778
|
title: "跳转主视图",
|
|
3597
3779
|
onClick: u.bind(void 0),
|
|
3598
|
-
children: l(
|
|
3599
|
-
className:
|
|
3780
|
+
children: l(Gi, {
|
|
3781
|
+
className: V.b("link-icon")
|
|
3600
3782
|
})
|
|
3601
|
-
}), o.value ? null : l(
|
|
3783
|
+
}), o.value ? null : l(_i, {
|
|
3602
3784
|
actions: [{
|
|
3603
3785
|
id: "DELETE",
|
|
3604
3786
|
caption: "删除话题"
|
|
3605
3787
|
}],
|
|
3606
3788
|
position: "bottom",
|
|
3607
3789
|
isOpen: r,
|
|
3608
|
-
onToggleOpen:
|
|
3609
|
-
onAction:
|
|
3790
|
+
onToggleOpen: a,
|
|
3791
|
+
onAction: h.bind(void 0),
|
|
3610
3792
|
children: l("span", {
|
|
3611
|
-
className:
|
|
3793
|
+
className: V.be("icon", "item"),
|
|
3612
3794
|
title: "更多",
|
|
3613
|
-
children: l(
|
|
3614
|
-
className:
|
|
3795
|
+
children: l(Zi, {
|
|
3796
|
+
className: V.b("more-icon")
|
|
3615
3797
|
})
|
|
3616
3798
|
})
|
|
3617
3799
|
})]
|
|
3618
3800
|
})]
|
|
3619
3801
|
});
|
|
3620
3802
|
};
|
|
3621
|
-
const
|
|
3622
|
-
const e =
|
|
3623
|
-
|
|
3624
|
-
},
|
|
3625
|
-
|
|
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);
|
|
3626
3808
|
};
|
|
3627
3809
|
return l("div", {
|
|
3628
|
-
className:
|
|
3629
|
-
children: e.value.map((s) => l(
|
|
3810
|
+
className: Rn.b(),
|
|
3811
|
+
children: e.value.map((s) => l(Bn, {
|
|
3630
3812
|
topic: s,
|
|
3631
|
-
controller:
|
|
3813
|
+
controller: i.controller,
|
|
3632
3814
|
onClick: () => t(s),
|
|
3633
|
-
onAction: (o, r) =>
|
|
3815
|
+
onAction: (o, r) => n(o, s, r)
|
|
3634
3816
|
}, s.id))
|
|
3635
3817
|
});
|
|
3636
3818
|
};
|
|
3637
|
-
const
|
|
3638
|
-
zIndex: 10
|
|
3819
|
+
const it = xi({
|
|
3820
|
+
zIndex: 10,
|
|
3821
|
+
enableBackFill: !0
|
|
3639
3822
|
});
|
|
3640
|
-
var
|
|
3641
|
-
class
|
|
3823
|
+
var zt, Ht, Lt, Ot;
|
|
3824
|
+
class Dt extends H {
|
|
3642
3825
|
constructor(t) {
|
|
3643
3826
|
super(t);
|
|
3644
|
-
w(this, "ns", new
|
|
3645
|
-
w(this, "containerRef",
|
|
3646
|
-
w(this, "dragHandle",
|
|
3647
|
-
w(this, "minimizeRef",
|
|
3827
|
+
w(this, "ns", new $("chat-container"));
|
|
3828
|
+
w(this, "containerRef", Le());
|
|
3829
|
+
w(this, "dragHandle", Le());
|
|
3830
|
+
w(this, "minimizeRef", Le());
|
|
3648
3831
|
w(this, "data", {
|
|
3649
|
-
x: window.innerWidth - 600,
|
|
3650
3832
|
y: 0,
|
|
3651
|
-
|
|
3652
|
-
|
|
3833
|
+
height: 1,
|
|
3834
|
+
width: 600 / window.innerWidth,
|
|
3835
|
+
x: (window.innerWidth - 600) / window.innerWidth,
|
|
3653
3836
|
minWidth: 500,
|
|
3654
3837
|
minHeight: 300
|
|
3655
3838
|
});
|
|
3656
3839
|
w(this, "minimizeData", {
|
|
3657
|
-
x: window.innerWidth - 86,
|
|
3658
|
-
y: window.innerHeight - 86
|
|
3840
|
+
x: (window.innerWidth - 86) / window.innerWidth,
|
|
3841
|
+
y: (window.innerHeight - 86) / window.innerHeight
|
|
3659
3842
|
});
|
|
3660
3843
|
/**
|
|
3661
3844
|
* 是否禁止拖动
|
|
@@ -3679,7 +3862,8 @@ class At extends H {
|
|
|
3679
3862
|
* @type {ContainerContext}
|
|
3680
3863
|
*/
|
|
3681
3864
|
w(this, "containerContext", {
|
|
3682
|
-
zIndex: ((
|
|
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
|
|
3683
3867
|
});
|
|
3684
3868
|
this.state = {
|
|
3685
3869
|
isFullScreen: !1,
|
|
@@ -3687,53 +3871,120 @@ class At extends H {
|
|
|
3687
3871
|
};
|
|
3688
3872
|
}
|
|
3689
3873
|
calcWindowStyle() {
|
|
3690
|
-
var t,
|
|
3874
|
+
var t, n;
|
|
3691
3875
|
return {
|
|
3692
|
-
left: "".concat(this.data.x
|
|
3693
|
-
top: "".concat(this.data.y
|
|
3694
|
-
width: "".concat(this.data.width
|
|
3695
|
-
height: "".concat(this.data.height
|
|
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, "%"),
|
|
3696
3880
|
minWidth: "".concat(this.data.minWidth, "px"),
|
|
3697
3881
|
minHeight: "".concat(this.data.minHeight, "px"),
|
|
3698
|
-
"z-index": ((
|
|
3882
|
+
"z-index": ((n = (t = this.props.containerOptions) == null ? void 0 : t.zIndex) == null ? void 0 : n.toString()) || "10"
|
|
3699
3883
|
};
|
|
3700
3884
|
}
|
|
3701
3885
|
calcMinimizeStyle() {
|
|
3702
3886
|
return {
|
|
3703
|
-
left: "".concat(this.minimizeData.x
|
|
3704
|
-
top: "".concat(this.minimizeData.y
|
|
3887
|
+
left: "".concat(this.minimizeData.x * 100, "%"),
|
|
3888
|
+
top: "".concat(this.minimizeData.y * 100, "%"),
|
|
3705
3889
|
"z-index": "99999"
|
|
3706
3890
|
};
|
|
3707
3891
|
}
|
|
3708
3892
|
setStyle() {
|
|
3709
3893
|
Object.assign(this.containerRef.current.style, this.calcWindowStyle()), Object.assign(this.minimizeRef.current.style, this.calcMinimizeStyle());
|
|
3710
3894
|
}
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
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) => {
|
|
3718
3937
|
document.body.style.userSelect = "none";
|
|
3719
|
-
const
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
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);
|
|
3724
3950
|
};
|
|
3725
|
-
document.addEventListener("mousemove",
|
|
3726
|
-
}
|
|
3727
|
-
|
|
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)
|
|
3728
3962
|
return;
|
|
3729
3963
|
document.body.style.userSelect = "none";
|
|
3730
|
-
const
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
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();
|
|
3734
3977
|
};
|
|
3735
|
-
document.addEventListener("mousemove",
|
|
3736
|
-
}
|
|
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({
|
|
3737
3988
|
// 可拖拽的边缘
|
|
3738
3989
|
edges: {
|
|
3739
3990
|
top: !0,
|
|
@@ -3744,21 +3995,21 @@ class At extends H {
|
|
|
3744
3995
|
margin: 6,
|
|
3745
3996
|
modifiers: [
|
|
3746
3997
|
// 保持在父对象内部
|
|
3747
|
-
|
|
3998
|
+
He.modifiers.restrictEdges({
|
|
3748
3999
|
outer: document.body
|
|
3749
4000
|
}),
|
|
3750
4001
|
// 缩放最小宽度
|
|
3751
|
-
|
|
4002
|
+
He.modifiers.restrictSize({
|
|
3752
4003
|
min: {
|
|
3753
|
-
width:
|
|
3754
|
-
height:
|
|
4004
|
+
width: this.data.minWidth,
|
|
4005
|
+
height: this.data.minHeight
|
|
3755
4006
|
}
|
|
3756
4007
|
})
|
|
3757
4008
|
],
|
|
3758
4009
|
inertia: !0,
|
|
3759
4010
|
listeners: {
|
|
3760
|
-
move: (
|
|
3761
|
-
this.state.isFullScreen || (
|
|
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());
|
|
3762
4013
|
},
|
|
3763
4014
|
start: () => {
|
|
3764
4015
|
this.disabled = !0, document.body.style.userSelect = "none";
|
|
@@ -3769,6 +4020,19 @@ class At extends H {
|
|
|
3769
4020
|
}
|
|
3770
4021
|
});
|
|
3771
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
|
+
}
|
|
3772
4036
|
componentWillUnmount() {
|
|
3773
4037
|
localStorage.setItem(N.STYLE_CACHE, JSON.stringify(this.data)), localStorage.setItem(N.MINIMIZE_STYLY_CHCHE, JSON.stringify(this.minimizeData));
|
|
3774
4038
|
}
|
|
@@ -3834,7 +4098,7 @@ class At extends H {
|
|
|
3834
4098
|
t.stopPropagation();
|
|
3835
4099
|
}
|
|
3836
4100
|
render() {
|
|
3837
|
-
return l(
|
|
4101
|
+
return l(it.Provider, {
|
|
3838
4102
|
value: this.containerContext,
|
|
3839
4103
|
children: l("div", {
|
|
3840
4104
|
className: "".concat(this.ns.b()),
|
|
@@ -3854,43 +4118,43 @@ class At extends H {
|
|
|
3854
4118
|
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "minimize")),
|
|
3855
4119
|
onMouseDown: this.stopPropagation.bind(this),
|
|
3856
4120
|
onClick: this.minimize.bind(this),
|
|
3857
|
-
children: l(
|
|
4121
|
+
children: l(Vi, {})
|
|
3858
4122
|
}), this.state.isFullScreen ? l("div", {
|
|
3859
4123
|
title: "退出全屏",
|
|
3860
4124
|
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "close-full-screen")),
|
|
3861
4125
|
onMouseDown: this.stopPropagation.bind(this),
|
|
3862
4126
|
onClick: this.closeFullScreen.bind(this),
|
|
3863
|
-
children: l(
|
|
4127
|
+
children: l(Wi, {})
|
|
3864
4128
|
}) : l("div", {
|
|
3865
4129
|
title: "全屏",
|
|
3866
4130
|
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "full-screen")),
|
|
3867
4131
|
onMouseDown: this.stopPropagation.bind(this),
|
|
3868
4132
|
onClick: this.fullScreen.bind(this),
|
|
3869
|
-
children: l(
|
|
4133
|
+
children: l(Ui, {})
|
|
3870
4134
|
}), l("div", {
|
|
3871
4135
|
title: "关闭",
|
|
3872
4136
|
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "action-close")),
|
|
3873
4137
|
onMouseDown: this.stopPropagation.bind(this),
|
|
3874
4138
|
onClick: this.close.bind(this),
|
|
3875
|
-
children: l(
|
|
4139
|
+
children: l(Oi, {})
|
|
3876
4140
|
})]
|
|
3877
4141
|
})]
|
|
3878
4142
|
}), this.props.mode === "TOPIC" ? l("div", {
|
|
3879
4143
|
className: "".concat(this.ns.b("main")),
|
|
3880
4144
|
children: [l("div", {
|
|
3881
4145
|
className: "".concat(this.ns.be("main", "left")),
|
|
3882
|
-
children: l(
|
|
4146
|
+
children: l(Pn, {
|
|
3883
4147
|
controller: this.props.aiTopic
|
|
3884
4148
|
})
|
|
3885
4149
|
}), l("div", {
|
|
3886
4150
|
className: "".concat(this.ns.be("main", "right")),
|
|
3887
4151
|
children: [l("div", {
|
|
3888
4152
|
className: this.ns.b("content"),
|
|
3889
|
-
children: l(
|
|
4153
|
+
children: l(gt, {
|
|
3890
4154
|
controller: this.props.aiChat,
|
|
3891
4155
|
toolbarItems: this.props.contentToolbarItems
|
|
3892
4156
|
})
|
|
3893
|
-
}), l(
|
|
4157
|
+
}), l(Ge, {
|
|
3894
4158
|
data: this.props.aiTopic.activedTopic.value,
|
|
3895
4159
|
type: "footer",
|
|
3896
4160
|
className: this.ns.e("toolbar"),
|
|
@@ -3898,7 +4162,7 @@ class At extends H {
|
|
|
3898
4162
|
items: this.props.footerToolbarItems
|
|
3899
4163
|
}), l("div", {
|
|
3900
4164
|
className: this.ns.b("footer"),
|
|
3901
|
-
children: l(
|
|
4165
|
+
children: l(It, {
|
|
3902
4166
|
controller: this.props.aiChat,
|
|
3903
4167
|
questionToolbarItems: this.props.questionToolbarItems
|
|
3904
4168
|
})
|
|
@@ -3908,11 +4172,11 @@ class At extends H {
|
|
|
3908
4172
|
className: "".concat(this.ns.be("main", "default")),
|
|
3909
4173
|
children: [l("div", {
|
|
3910
4174
|
className: this.ns.b("content"),
|
|
3911
|
-
children: l(
|
|
4175
|
+
children: l(gt, {
|
|
3912
4176
|
controller: this.props.aiChat,
|
|
3913
4177
|
toolbarItems: this.props.contentToolbarItems
|
|
3914
4178
|
})
|
|
3915
|
-
}), l(
|
|
4179
|
+
}), l(Ge, {
|
|
3916
4180
|
data: this.props.aiTopic.activedTopic.value,
|
|
3917
4181
|
type: "footer",
|
|
3918
4182
|
className: this.ns.e("toolbar"),
|
|
@@ -3920,7 +4184,7 @@ class At extends H {
|
|
|
3920
4184
|
items: this.props.footerToolbarItems
|
|
3921
4185
|
}), l("div", {
|
|
3922
4186
|
className: this.ns.b("footer"),
|
|
3923
|
-
children: l(
|
|
4187
|
+
children: l(It, {
|
|
3924
4188
|
controller: this.props.aiChat,
|
|
3925
4189
|
questionToolbarItems: this.props.questionToolbarItems
|
|
3926
4190
|
})
|
|
@@ -3931,13 +4195,13 @@ class At extends H {
|
|
|
3931
4195
|
ref: this.minimizeRef,
|
|
3932
4196
|
className: "".concat(this.ns.e("minimize"), " ").concat(this.ns.is("hidden", !this.state.isMinimize)),
|
|
3933
4197
|
onClick: this.exitMinimize.bind(this),
|
|
3934
|
-
children: l(
|
|
4198
|
+
children: l(qi, {})
|
|
3935
4199
|
})]
|
|
3936
4200
|
})
|
|
3937
4201
|
});
|
|
3938
4202
|
}
|
|
3939
4203
|
}
|
|
3940
4204
|
export {
|
|
3941
|
-
|
|
3942
|
-
|
|
4205
|
+
Dt as ChatContainer,
|
|
4206
|
+
Vn as chat
|
|
3943
4207
|
};
|