@ibiz-template-plugin/ai-chat 0.0.6 → 0.0.9
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 +2313 -1081
- package/dist/index.legacy.js +1 -1
- package/dist/polyfills.legacy.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -3
- package/dist/types/app.d.ts +0 -1
- package/dist/types/components/chat-container/chat-container.d.ts +0 -98
- package/dist/types/components/chat-input/chat-input.d.ts +0 -12
- package/dist/types/components/chat-message-item/chat-message-item.d.ts +0 -23
- package/dist/types/components/chat-message-item/error-message/error-message.d.ts +0 -22
- package/dist/types/components/chat-message-item/markdown-message/markdown-message.d.ts +0 -22
- package/dist/types/components/chat-message-item/unknown-message/unknown-message.d.ts +0 -13
- package/dist/types/components/chat-message-item/user-message/user-message.d.ts +0 -15
- package/dist/types/components/chat-messages/chat-messages.d.ts +0 -12
- package/dist/types/components/index.d.ts +0 -1
- package/dist/types/constants/index.d.ts +0 -6
- package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +0 -99
- package/dist/types/controller/chat/chat.controller.d.ts +0 -51
- package/dist/types/controller/index.d.ts +0 -2
- package/dist/types/entity/chat-message/chat-message.d.ts +0 -28
- package/dist/types/entity/index.d.ts +0 -1
- package/dist/types/global.d.ts +0 -2
- package/dist/types/icons/close-full-screen-svg.d.ts +0 -1
- package/dist/types/icons/close-svg.d.ts +0 -1
- package/dist/types/icons/copy-svg.d.ts +0 -1
- package/dist/types/icons/delete-svg.d.ts +0 -1
- package/dist/types/icons/fill-svg.d.ts +0 -1
- package/dist/types/icons/full-screen-svg.d.ts +0 -1
- package/dist/types/icons/index.d.ts +0 -8
- package/dist/types/icons/refresh-svg.d.ts +0 -1
- package/dist/types/icons/send-svg.d.ts +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/interface/i-chat-container/i-chat-container.d.ts +0 -58
- package/dist/types/interface/i-chat-message/i-chat-message.d.ts +0 -83
- package/dist/types/interface/i-chat-options/i-chat-options.d.ts +0 -60
- package/dist/types/interface/i-message-item-provider/i-message-item-provider.d.ts +0 -18
- package/dist/types/interface/i-portal-async-action/i-portal-async-action.d.ts +0 -90
- package/dist/types/interface/index.d.ts +0 -4
- package/dist/types/main.d.ts +0 -1
- package/dist/types/utils/index.d.ts +0 -3
- package/dist/types/utils/plugin-static-resource/plugin-static-resource.d.ts +0 -63
- package/dist/types/utils/util/util.d.ts +0 -29
package/dist/index.es.js
CHANGED
|
@@ -1,297 +1,298 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import './style.css';
|
|
2
|
+
var Kt = Object.defineProperty;
|
|
3
|
+
var Qt = (n, e, t) => e in n ? Kt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
4
|
+
var y = (n, e, t) => (Qt(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
|
+
import Ae from "interactjs";
|
|
6
|
+
import en from "cherry-markdown";
|
|
7
|
+
var Se, v, kt, $t, X, Xe, Nt, Re, Q = {}, xt = [], tn = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ke = Array.isArray;
|
|
8
|
+
function B(n, e) {
|
|
9
|
+
for (var t in e)
|
|
10
|
+
n[t] = e[t];
|
|
11
|
+
return n;
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
-
var e =
|
|
14
|
-
e && e.removeChild(
|
|
13
|
+
function At(n) {
|
|
14
|
+
var e = n.parentNode;
|
|
15
|
+
e && e.removeChild(n);
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
var i, s,
|
|
18
|
-
for (
|
|
19
|
-
|
|
20
|
-
if (arguments.length > 2 && (
|
|
21
|
-
for (
|
|
22
|
-
o
|
|
23
|
-
return
|
|
17
|
+
function H(n, e, t) {
|
|
18
|
+
var i, s, o, r = {};
|
|
19
|
+
for (o in e)
|
|
20
|
+
o == "key" ? i = e[o] : o == "ref" ? s = e[o] : r[o] = e[o];
|
|
21
|
+
if (arguments.length > 2 && (r.children = arguments.length > 3 ? Se.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null)
|
|
22
|
+
for (o in n.defaultProps)
|
|
23
|
+
r[o] === void 0 && (r[o] = n.defaultProps[o]);
|
|
24
|
+
return me(n, r, i, s, null);
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
var
|
|
27
|
-
return s == null &&
|
|
26
|
+
function me(n, e, t, i, s) {
|
|
27
|
+
var o = { type: n, props: e, key: t, ref: i, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: s == null ? ++kt : s };
|
|
28
|
+
return s == null && v.vnode != null && v.vnode(o), o;
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function Ie() {
|
|
30
31
|
return { current: null };
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
33
|
+
function te(n) {
|
|
34
|
+
return n.children;
|
|
34
35
|
}
|
|
35
|
-
function M(
|
|
36
|
-
this.props =
|
|
36
|
+
function M(n, e) {
|
|
37
|
+
this.props = n, this.context = e;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function le(n, e) {
|
|
39
40
|
if (e == null)
|
|
40
|
-
return
|
|
41
|
-
for (var
|
|
42
|
-
if ((
|
|
43
|
-
return
|
|
44
|
-
return typeof
|
|
45
|
-
}
|
|
46
|
-
function
|
|
47
|
-
var e,
|
|
48
|
-
if ((
|
|
49
|
-
for (
|
|
50
|
-
if ((
|
|
51
|
-
|
|
41
|
+
return n.__ ? le(n.__, n.__.__k.indexOf(n) + 1) : null;
|
|
42
|
+
for (var t; e < n.__k.length; e++)
|
|
43
|
+
if ((t = n.__k[e]) != null && t.__e != null)
|
|
44
|
+
return t.__d || t.__e;
|
|
45
|
+
return typeof n.type == "function" ? le(n) : null;
|
|
46
|
+
}
|
|
47
|
+
function It(n) {
|
|
48
|
+
var e, t;
|
|
49
|
+
if ((n = n.__) != null && n.__c != null) {
|
|
50
|
+
for (n.__e = n.__c.base = null, e = 0; e < n.__k.length; e++)
|
|
51
|
+
if ((t = n.__k[e]) != null && t.__e != null) {
|
|
52
|
+
n.__e = n.__c.base = t.__e;
|
|
52
53
|
break;
|
|
53
54
|
}
|
|
54
|
-
return
|
|
55
|
+
return It(n);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
-
(!
|
|
59
|
-
}
|
|
60
|
-
function ae() {
|
|
61
|
-
var t, e, n, i, s, r, o, l, c;
|
|
62
|
-
for (B.sort(Ee); t = B.shift(); )
|
|
63
|
-
t.__d && (e = B.length, i = void 0, s = void 0, r = void 0, l = (o = (n = t).__v).__e, (c = n.__P) && (i = [], s = [], (r = F({}, o)).__v = o.__v + 1, Pe(c, o, r, n.__n, c.ownerSVGElement !== void 0, o.__h != null ? [l] : null, i, l == null ? Q(o) : l, o.__h, s), wt(i, o, s), o.__e != l && mt(o)), B.length > e && B.sort(Ee));
|
|
64
|
-
ae.__r = 0;
|
|
58
|
+
function Ze(n) {
|
|
59
|
+
(!n.__d && (n.__d = !0) && X.push(n) && !be.__r++ || Xe !== v.debounceRendering) && ((Xe = v.debounceRendering) || Nt)(be);
|
|
65
60
|
}
|
|
66
|
-
function
|
|
67
|
-
var
|
|
68
|
-
for (
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
for (
|
|
75
|
-
(
|
|
61
|
+
function be() {
|
|
62
|
+
var n, e, t, i, s, o, r, c, u;
|
|
63
|
+
for (X.sort(Re); n = X.shift(); )
|
|
64
|
+
n.__d && (e = X.length, i = void 0, s = void 0, o = void 0, c = (r = (t = n).__v).__e, (u = t.__P) && (i = [], s = [], (o = B({}, r)).__v = r.__v + 1, Fe(u, r, o, t.__n, u.ownerSVGElement !== void 0, r.__h != null ? [c] : null, i, c == null ? le(r) : c, r.__h, s), Ht(i, r, s), r.__e != c && It(r)), X.length > e && X.sort(Re));
|
|
65
|
+
be.__r = 0;
|
|
66
|
+
}
|
|
67
|
+
function Dt(n, e, t, i, s, o, r, c, u, d, h) {
|
|
68
|
+
var a, _, p, f, g, N, b, C, x, T = 0, E = i && i.__k || xt, L = E.length, I = L, R = e.length;
|
|
69
|
+
for (t.__k = [], a = 0; a < R; a++)
|
|
70
|
+
(f = t.__k[a] = (f = e[a]) == null || typeof f == "boolean" || typeof f == "function" ? null : typeof f == "string" || typeof f == "number" || typeof f == "bigint" ? me(null, f, null, null, f) : ke(f) ? me(te, { children: f }, null, null, null) : f.__b > 0 ? me(f.type, f.props, f.key, f.ref ? f.ref : null, f.__v) : f) != null ? (f.__ = t, f.__b = t.__b + 1, (C = nn(f, E, b = a + T, I)) === -1 ? p = Q : (p = E[C] || Q, E[C] = void 0, I--), Fe(n, f, p, s, o, r, c, u, d, h), g = f.__e, (_ = f.ref) && p.ref != _ && (p.ref && We(p.ref, null, f), h.push(_, f.__c || g, f)), g != null && (N == null && (N = g), (x = p === Q || p.__v === null) ? C == -1 && T-- : C !== b && (C === b + 1 ? T++ : C > b ? I > R - b ? T += C - b : T-- : T = C < b && C == b - 1 ? C - b : 0), b = a + T, typeof f.type != "function" || C === b && p.__k !== f.__k ? typeof f.type == "function" || C === b && !x ? f.__d !== void 0 ? (u = f.__d, f.__d = void 0) : u = g.nextSibling : u = zt(n, g, u) : u = Mt(f, u, n), typeof t.type == "function" && (t.__d = u))) : (p = E[a]) && p.key == null && p.__e && (p.__e == u && (p.__ = i, u = le(p)), Oe(p, p, !1), E[a] = null);
|
|
71
|
+
for (t.__e = N, a = L; a--; )
|
|
72
|
+
E[a] != null && (typeof t.type == "function" && E[a].__e != null && E[a].__e == t.__d && (t.__d = E[a].__e.nextSibling), Oe(E[a], E[a]));
|
|
73
|
+
}
|
|
74
|
+
function Mt(n, e, t) {
|
|
75
|
+
for (var i, s = n.__k, o = 0; s && o < s.length; o++)
|
|
76
|
+
(i = s[o]) && (i.__ = n, e = typeof i.type == "function" ? Mt(i, e, t) : zt(t, i.__e, e));
|
|
76
77
|
return e;
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
return e = e || [],
|
|
80
|
-
|
|
81
|
-
}) : e.push(
|
|
79
|
+
function we(n, e) {
|
|
80
|
+
return e = e || [], n == null || typeof n == "boolean" || (ke(n) ? n.some(function(t) {
|
|
81
|
+
we(t, e);
|
|
82
|
+
}) : e.push(n)), e;
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
return
|
|
84
|
+
function zt(n, e, t) {
|
|
85
|
+
return t == null || t.parentNode !== n ? n.insertBefore(e, null) : e == t && e.parentNode != null || n.insertBefore(e, t), e.nextSibling;
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
-
var s =
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
90
|
-
if (i > (
|
|
91
|
-
for (;
|
|
92
|
-
if (
|
|
93
|
-
if ((
|
|
94
|
-
return
|
|
95
|
-
|
|
87
|
+
function nn(n, e, t, i) {
|
|
88
|
+
var s = n.key, o = n.type, r = t - 1, c = t + 1, u = e[t];
|
|
89
|
+
if (u === null || u && s == u.key && o === u.type)
|
|
90
|
+
return t;
|
|
91
|
+
if (i > (u != null ? 1 : 0))
|
|
92
|
+
for (; r >= 0 || c < e.length; ) {
|
|
93
|
+
if (r >= 0) {
|
|
94
|
+
if ((u = e[r]) && s == u.key && o === u.type)
|
|
95
|
+
return r;
|
|
96
|
+
r--;
|
|
96
97
|
}
|
|
97
|
-
if (
|
|
98
|
-
if ((
|
|
99
|
-
return
|
|
100
|
-
|
|
98
|
+
if (c < e.length) {
|
|
99
|
+
if ((u = e[c]) && s == u.key && o === u.type)
|
|
100
|
+
return c;
|
|
101
|
+
c++;
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
return -1;
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
-
var
|
|
107
|
-
for (
|
|
108
|
-
|
|
109
|
-
for (
|
|
110
|
-
s && typeof e[
|
|
106
|
+
function sn(n, e, t, i, s) {
|
|
107
|
+
var o;
|
|
108
|
+
for (o in t)
|
|
109
|
+
o === "children" || o === "key" || o in e || Ce(n, o, null, t[o], i);
|
|
110
|
+
for (o in e)
|
|
111
|
+
s && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || t[o] === e[o] || Ce(n, o, e[o], t[o], i);
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
-
e[0] === "-" ?
|
|
113
|
+
function Ge(n, e, t) {
|
|
114
|
+
e[0] === "-" ? n.setProperty(e, t == null ? "" : t) : n[e] = t == null ? "" : typeof t != "number" || tn.test(e) ? t : t + "px";
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
-
var
|
|
116
|
+
function Ce(n, e, t, i, s) {
|
|
117
|
+
var o;
|
|
117
118
|
e:
|
|
118
119
|
if (e === "style")
|
|
119
|
-
if (typeof
|
|
120
|
-
|
|
120
|
+
if (typeof t == "string")
|
|
121
|
+
n.style.cssText = t;
|
|
121
122
|
else {
|
|
122
|
-
if (typeof i == "string" && (
|
|
123
|
+
if (typeof i == "string" && (n.style.cssText = i = ""), i)
|
|
123
124
|
for (e in i)
|
|
124
|
-
|
|
125
|
-
if (
|
|
126
|
-
for (e in
|
|
127
|
-
i &&
|
|
125
|
+
t && e in t || Ge(n.style, e, "");
|
|
126
|
+
if (t)
|
|
127
|
+
for (e in t)
|
|
128
|
+
i && t[e] === i[e] || Ge(n.style, e, t[e]);
|
|
128
129
|
}
|
|
129
130
|
else if (e[0] === "o" && e[1] === "n")
|
|
130
|
-
|
|
131
|
+
o = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in n ? e.toLowerCase().slice(2) : e.slice(2), n.l || (n.l = {}), n.l[e + o] = t, t ? i ? t.u = i.u : (t.u = Date.now(), n.addEventListener(e, o ? Ke : Je, o)) : n.removeEventListener(e, o ? Ke : Je, o);
|
|
131
132
|
else if (e !== "dangerouslySetInnerHTML") {
|
|
132
133
|
if (s)
|
|
133
134
|
e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
134
|
-
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 n)
|
|
135
136
|
try {
|
|
136
|
-
|
|
137
|
+
n[e] = t == null ? "" : t;
|
|
137
138
|
break e;
|
|
138
|
-
} catch (
|
|
139
|
+
} catch (r) {
|
|
139
140
|
}
|
|
140
|
-
typeof
|
|
141
|
+
typeof t == "function" || (t == null || t === !1 && e[4] !== "-" ? n.removeAttribute(e) : n.setAttribute(e, t));
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
-
var e = this.l[
|
|
145
|
-
if (
|
|
146
|
-
if (
|
|
144
|
+
function Je(n) {
|
|
145
|
+
var e = this.l[n.type + !1];
|
|
146
|
+
if (n.t) {
|
|
147
|
+
if (n.t <= e.u)
|
|
147
148
|
return;
|
|
148
149
|
} else
|
|
149
|
-
|
|
150
|
-
return e(
|
|
150
|
+
n.t = Date.now();
|
|
151
|
+
return e(v.event ? v.event(n) : n);
|
|
151
152
|
}
|
|
152
|
-
function
|
|
153
|
-
return this.l[
|
|
153
|
+
function Ke(n) {
|
|
154
|
+
return this.l[n.type + !0](v.event ? v.event(n) : n);
|
|
154
155
|
}
|
|
155
|
-
function
|
|
156
|
-
var h, a,
|
|
156
|
+
function Fe(n, e, t, i, s, o, r, c, u, d) {
|
|
157
|
+
var h, a, _, p, f, g, N, b, C, x, T, E, L, I, R, D = e.type;
|
|
157
158
|
if (e.constructor !== void 0)
|
|
158
159
|
return null;
|
|
159
|
-
|
|
160
|
+
t.__h != null && (u = t.__h, c = e.__e = t.__e, e.__h = null, o = [c]), (h = v.__b) && h(e);
|
|
160
161
|
e:
|
|
161
|
-
if (typeof
|
|
162
|
+
if (typeof D == "function")
|
|
162
163
|
try {
|
|
163
|
-
if (
|
|
164
|
-
|
|
164
|
+
if (b = e.props, C = (h = D.contextType) && i[h.__c], x = h ? C ? C.props.value : h.__ : i, t.__c ? N = (a = e.__c = t.__c).__ = a.__E : ("prototype" in D && D.prototype.render ? e.__c = a = new D(b, x) : (e.__c = a = new M(b, x), a.constructor = D, a.render = rn), C && C.sub(a), a.props = b, a.state || (a.state = {}), a.context = x, a.__n = i, _ = a.__d = !0, a.__h = [], a._sb = []), a.__s == null && (a.__s = a.state), D.getDerivedStateFromProps != null && (a.__s == a.state && (a.__s = B({}, a.__s)), B(a.__s, D.getDerivedStateFromProps(b, a.__s))), p = a.props, f = a.state, a.__v = e, _)
|
|
165
|
+
D.getDerivedStateFromProps == null && a.componentWillMount != null && a.componentWillMount(), a.componentDidMount != null && a.__h.push(a.componentDidMount);
|
|
165
166
|
else {
|
|
166
|
-
if (
|
|
167
|
-
for (e.__v !==
|
|
168
|
-
|
|
169
|
-
}),
|
|
170
|
-
a.__h.push(a._sb[
|
|
171
|
-
a._sb = [], a.__h.length &&
|
|
167
|
+
if (D.getDerivedStateFromProps == null && b !== p && a.componentWillReceiveProps != null && a.componentWillReceiveProps(b, x), !a.__e && (a.shouldComponentUpdate != null && a.shouldComponentUpdate(b, a.__s, x) === !1 || e.__v === t.__v)) {
|
|
168
|
+
for (e.__v !== t.__v && (a.props = b, a.state = a.__s, a.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(fe) {
|
|
169
|
+
fe && (fe.__ = e);
|
|
170
|
+
}), T = 0; T < a._sb.length; T++)
|
|
171
|
+
a.__h.push(a._sb[T]);
|
|
172
|
+
a._sb = [], a.__h.length && r.push(a);
|
|
172
173
|
break e;
|
|
173
174
|
}
|
|
174
|
-
a.componentWillUpdate != null && a.componentWillUpdate(
|
|
175
|
-
a.componentDidUpdate(
|
|
175
|
+
a.componentWillUpdate != null && a.componentWillUpdate(b, a.__s, x), a.componentDidUpdate != null && a.__h.push(function() {
|
|
176
|
+
a.componentDidUpdate(p, f, g);
|
|
176
177
|
});
|
|
177
178
|
}
|
|
178
|
-
if (a.context =
|
|
179
|
-
for (a.state = a.__s, a.__d = !1,
|
|
180
|
-
a.__h.push(a._sb[
|
|
179
|
+
if (a.context = x, a.props = b, a.__P = n, a.__e = !1, E = v.__r, L = 0, "prototype" in D && D.prototype.render) {
|
|
180
|
+
for (a.state = a.__s, a.__d = !1, E && E(e), h = a.render(a.props, a.state, a.context), I = 0; I < a._sb.length; I++)
|
|
181
|
+
a.__h.push(a._sb[I]);
|
|
181
182
|
a._sb = [];
|
|
182
183
|
} else
|
|
183
184
|
do
|
|
184
|
-
a.__d = !1,
|
|
185
|
-
while (a.__d && ++
|
|
186
|
-
a.state = a.__s, a.getChildContext != null && (i =
|
|
187
|
-
} catch (
|
|
188
|
-
e.__v = null, (
|
|
185
|
+
a.__d = !1, E && E(e), h = a.render(a.props, a.state, a.context), a.state = a.__s;
|
|
186
|
+
while (a.__d && ++L < 25);
|
|
187
|
+
a.state = a.__s, a.getChildContext != null && (i = B(B({}, i), a.getChildContext())), _ || a.getSnapshotBeforeUpdate == null || (g = a.getSnapshotBeforeUpdate(p, f)), Dt(n, ke(R = h != null && h.type === te && h.key == null ? h.props.children : h) ? R : [R], e, t, i, s, o, r, c, u, d), a.base = e.__e, e.__h = null, a.__h.length && r.push(a), N && (a.__E = a.__ = null);
|
|
188
|
+
} catch (fe) {
|
|
189
|
+
e.__v = null, (u || o != null) && (e.__e = c, e.__h = !!u, o[o.indexOf(c)] = null), v.__e(fe, e, t);
|
|
189
190
|
}
|
|
190
191
|
else
|
|
191
|
-
|
|
192
|
-
(h =
|
|
192
|
+
o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = on(t.__e, e, t, i, s, o, r, u, d);
|
|
193
|
+
(h = v.diffed) && h(e);
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
-
for (var i = 0; i <
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
function Ht(n, e, t) {
|
|
196
|
+
for (var i = 0; i < t.length; i++)
|
|
197
|
+
We(t[i], t[++i], t[++i]);
|
|
198
|
+
v.__c && v.__c(e, n), n.some(function(s) {
|
|
198
199
|
try {
|
|
199
|
-
|
|
200
|
-
|
|
200
|
+
n = s.__h, s.__h = [], n.some(function(o) {
|
|
201
|
+
o.call(s);
|
|
201
202
|
});
|
|
202
|
-
} catch (
|
|
203
|
-
|
|
203
|
+
} catch (o) {
|
|
204
|
+
v.__e(o, s.__v);
|
|
204
205
|
}
|
|
205
206
|
});
|
|
206
207
|
}
|
|
207
|
-
function
|
|
208
|
-
var
|
|
209
|
-
if (
|
|
210
|
-
for (;
|
|
211
|
-
if ((
|
|
212
|
-
|
|
208
|
+
function on(n, e, t, i, s, o, r, c, u) {
|
|
209
|
+
var d, h, a, _ = t.props, p = e.props, f = e.type, g = 0;
|
|
210
|
+
if (f === "svg" && (s = !0), o != null) {
|
|
211
|
+
for (; g < o.length; g++)
|
|
212
|
+
if ((d = o[g]) && "setAttribute" in d == !!f && (f ? d.localName === f : d.nodeType === 3)) {
|
|
213
|
+
n = d, o[g] = null;
|
|
213
214
|
break;
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
|
-
if (
|
|
217
|
-
if (
|
|
218
|
-
return document.createTextNode(
|
|
219
|
-
|
|
217
|
+
if (n == null) {
|
|
218
|
+
if (f === null)
|
|
219
|
+
return document.createTextNode(p);
|
|
220
|
+
n = s ? document.createElementNS("http://www.w3.org/2000/svg", f) : document.createElement(f, p.is && p), o = null, c = !1;
|
|
220
221
|
}
|
|
221
|
-
if (
|
|
222
|
-
|
|
222
|
+
if (f === null)
|
|
223
|
+
_ === p || c && n.data === p || (n.data = p);
|
|
223
224
|
else {
|
|
224
|
-
if (
|
|
225
|
-
if (
|
|
226
|
-
for (
|
|
227
|
-
|
|
228
|
-
(a || h) && (a && (h && a.__html == h.__html || a.__html ===
|
|
225
|
+
if (o = o && Se.call(n.childNodes), h = (_ = t.props || Q).dangerouslySetInnerHTML, a = p.dangerouslySetInnerHTML, !c) {
|
|
226
|
+
if (o != null)
|
|
227
|
+
for (_ = {}, g = 0; g < n.attributes.length; g++)
|
|
228
|
+
_[n.attributes[g].name] = n.attributes[g].value;
|
|
229
|
+
(a || h) && (a && (h && a.__html == h.__html || a.__html === n.innerHTML) || (n.innerHTML = a && a.__html || ""));
|
|
229
230
|
}
|
|
230
|
-
if (
|
|
231
|
+
if (sn(n, p, _, s, c), a)
|
|
231
232
|
e.__k = [];
|
|
232
|
-
else if (
|
|
233
|
-
for (
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
else if (Dt(n, ke(g = e.props.children) ? g : [g], e, t, i, s && f !== "foreignObject", o, r, o ? o[0] : t.__k && le(t, 0), c, u), o != null)
|
|
234
|
+
for (g = o.length; g--; )
|
|
235
|
+
o[g] != null && At(o[g]);
|
|
236
|
+
c || ("value" in p && (g = p.value) !== void 0 && (g !== n.value || f === "progress" && !g || f === "option" && g !== _.value) && Ce(n, "value", g, _.value, !1), "checked" in p && (g = p.checked) !== void 0 && g !== n.checked && Ce(n, "checked", g, _.checked, !1));
|
|
236
237
|
}
|
|
237
|
-
return
|
|
238
|
+
return n;
|
|
238
239
|
}
|
|
239
|
-
function
|
|
240
|
+
function We(n, e, t) {
|
|
240
241
|
try {
|
|
241
|
-
typeof
|
|
242
|
+
typeof n == "function" ? n(e) : n.current = e;
|
|
242
243
|
} catch (i) {
|
|
243
|
-
|
|
244
|
+
v.__e(i, t);
|
|
244
245
|
}
|
|
245
246
|
}
|
|
246
|
-
function
|
|
247
|
+
function Oe(n, e, t) {
|
|
247
248
|
var i, s;
|
|
248
|
-
if (
|
|
249
|
+
if (v.unmount && v.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || We(i, null, e)), (i = n.__c) != null) {
|
|
249
250
|
if (i.componentWillUnmount)
|
|
250
251
|
try {
|
|
251
252
|
i.componentWillUnmount();
|
|
252
|
-
} catch (
|
|
253
|
-
|
|
253
|
+
} catch (o) {
|
|
254
|
+
v.__e(o, e);
|
|
254
255
|
}
|
|
255
|
-
i.base = i.__P = null,
|
|
256
|
+
i.base = i.__P = null, n.__c = void 0;
|
|
256
257
|
}
|
|
257
|
-
if (i =
|
|
258
|
+
if (i = n.__k)
|
|
258
259
|
for (s = 0; s < i.length; s++)
|
|
259
|
-
i[s] &&
|
|
260
|
-
|
|
260
|
+
i[s] && Oe(i[s], e, t || typeof n.type != "function");
|
|
261
|
+
t || n.__e == null || At(n.__e), n.__ = n.__e = n.__d = void 0;
|
|
261
262
|
}
|
|
262
|
-
function
|
|
263
|
-
return this.constructor(
|
|
263
|
+
function rn(n, e, t) {
|
|
264
|
+
return this.constructor(n, t);
|
|
264
265
|
}
|
|
265
|
-
function
|
|
266
|
-
var i, s,
|
|
267
|
-
|
|
266
|
+
function K(n, e, t) {
|
|
267
|
+
var i, s, o, r;
|
|
268
|
+
v.__ && v.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, o = [], r = [], Fe(e, n = (!i && t || e).__k = H(te, null, [n]), s || Q, Q, e.ownerSVGElement !== void 0, !i && t ? [t] : s ? null : e.firstChild ? Se.call(e.childNodes) : null, o, !i && t ? t : s ? s.__e : e.firstChild, i, r), Ht(o, n, r);
|
|
268
269
|
}
|
|
269
|
-
|
|
270
|
-
for (var s,
|
|
270
|
+
Se = xt.slice, v = { __e: function(n, e, t, i) {
|
|
271
|
+
for (var s, o, r; e = e.__; )
|
|
271
272
|
if ((s = e.__c) && !s.__)
|
|
272
273
|
try {
|
|
273
|
-
if ((
|
|
274
|
+
if ((o = s.constructor) && o.getDerivedStateFromError != null && (s.setState(o.getDerivedStateFromError(n)), r = s.__d), s.componentDidCatch != null && (s.componentDidCatch(n, i || {}), r = s.__d), r)
|
|
274
275
|
return s.__E = s;
|
|
275
|
-
} catch (
|
|
276
|
-
|
|
276
|
+
} catch (c) {
|
|
277
|
+
n = c;
|
|
277
278
|
}
|
|
278
|
-
throw
|
|
279
|
-
} },
|
|
280
|
-
return
|
|
281
|
-
}, M.prototype.setState = function(
|
|
282
|
-
var
|
|
283
|
-
|
|
284
|
-
}, M.prototype.forceUpdate = function(
|
|
285
|
-
this.__v && (this.__e = !0,
|
|
286
|
-
}, M.prototype.render =
|
|
287
|
-
return
|
|
288
|
-
},
|
|
289
|
-
const
|
|
290
|
-
function
|
|
291
|
-
let
|
|
292
|
-
return
|
|
293
|
-
}
|
|
294
|
-
class
|
|
279
|
+
throw n;
|
|
280
|
+
} }, kt = 0, $t = function(n) {
|
|
281
|
+
return n != null && n.constructor === void 0;
|
|
282
|
+
}, M.prototype.setState = function(n, e) {
|
|
283
|
+
var t;
|
|
284
|
+
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = B({}, this.state), typeof n == "function" && (n = n(B({}, t), this.props)), n && B(t, n), n != null && this.__v && (e && this._sb.push(e), Ze(this));
|
|
285
|
+
}, M.prototype.forceUpdate = function(n) {
|
|
286
|
+
this.__v && (this.__e = !0, n && this.__h.push(n), Ze(this));
|
|
287
|
+
}, M.prototype.render = te, X = [], Nt = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Re = function(n, e) {
|
|
288
|
+
return n.__v.__b - e.__v.__b;
|
|
289
|
+
}, be.__r = 0;
|
|
290
|
+
const an = "ibiz", cn = "is-";
|
|
291
|
+
function j(n, e, t, i, s) {
|
|
292
|
+
let o = "".concat(n, "-").concat(e);
|
|
293
|
+
return t && (o += "-".concat(t)), i && (o += "__".concat(i)), s && (o += "--".concat(s)), o;
|
|
294
|
+
}
|
|
295
|
+
class A {
|
|
295
296
|
/**
|
|
296
297
|
* Creates an instance of Namespace.
|
|
297
298
|
*
|
|
@@ -300,7 +301,7 @@ class U {
|
|
|
300
301
|
* @param {string} block 当前命名空间的根模块,例如组件的名称
|
|
301
302
|
* @param {string} [namespace] 指定命名空间,未指定使用默认值 ibiz
|
|
302
303
|
*/
|
|
303
|
-
constructor(e,
|
|
304
|
+
constructor(e, t) {
|
|
304
305
|
/**
|
|
305
306
|
* 命名空间
|
|
306
307
|
*
|
|
@@ -308,8 +309,8 @@ class U {
|
|
|
308
309
|
* @date 2023-11-03 10:11:31
|
|
309
310
|
* @type {string}
|
|
310
311
|
*/
|
|
311
|
-
|
|
312
|
-
this.block = e, this.namespace =
|
|
312
|
+
y(this, "namespace");
|
|
313
|
+
this.block = e, this.namespace = t || an;
|
|
313
314
|
}
|
|
314
315
|
/**
|
|
315
316
|
* namespace-block
|
|
@@ -321,7 +322,7 @@ class U {
|
|
|
321
322
|
* @return {*} {string}
|
|
322
323
|
*/
|
|
323
324
|
b(e = "") {
|
|
324
|
-
return
|
|
325
|
+
return j(this.namespace, this.block, e, "", "");
|
|
325
326
|
}
|
|
326
327
|
/**
|
|
327
328
|
* namespace-block__element
|
|
@@ -332,7 +333,7 @@ class U {
|
|
|
332
333
|
* @return {*} {string}
|
|
333
334
|
*/
|
|
334
335
|
e(e) {
|
|
335
|
-
return e ?
|
|
336
|
+
return e ? j(this.namespace, this.block, "", e, "") : "";
|
|
336
337
|
}
|
|
337
338
|
/**
|
|
338
339
|
* namespace-block--modifier
|
|
@@ -343,7 +344,7 @@ class U {
|
|
|
343
344
|
* @return {*} {string}
|
|
344
345
|
*/
|
|
345
346
|
m(e) {
|
|
346
|
-
return e ?
|
|
347
|
+
return e ? j(this.namespace, this.block, "", "", e) : "";
|
|
347
348
|
}
|
|
348
349
|
/**
|
|
349
350
|
* namespace-block-blockSuffix__element
|
|
@@ -354,8 +355,8 @@ class U {
|
|
|
354
355
|
* @param {string} [element]
|
|
355
356
|
* @return {*} {string}
|
|
356
357
|
*/
|
|
357
|
-
be(e,
|
|
358
|
-
return e &&
|
|
358
|
+
be(e, t) {
|
|
359
|
+
return e && t ? j(this.namespace, this.block, e, t, "") : "";
|
|
359
360
|
}
|
|
360
361
|
/**
|
|
361
362
|
* namespace-block__element--modifier
|
|
@@ -366,8 +367,8 @@ class U {
|
|
|
366
367
|
* @param {string} [modifier]
|
|
367
368
|
* @return {*} {string}
|
|
368
369
|
*/
|
|
369
|
-
em(e,
|
|
370
|
-
return e &&
|
|
370
|
+
em(e, t) {
|
|
371
|
+
return e && t ? j(this.namespace, this.block, "", e, t) : "";
|
|
371
372
|
}
|
|
372
373
|
/**
|
|
373
374
|
* namespace-block-blockSuffix--modifier
|
|
@@ -378,8 +379,8 @@ class U {
|
|
|
378
379
|
* @param {string} [modifier]
|
|
379
380
|
* @return {*} {string}
|
|
380
381
|
*/
|
|
381
|
-
bm(e,
|
|
382
|
-
return e &&
|
|
382
|
+
bm(e, t) {
|
|
383
|
+
return e && t ? j(this.namespace, this.block, e, "", t) : "";
|
|
383
384
|
}
|
|
384
385
|
/**
|
|
385
386
|
* namespace-block-blockSuffix__element--modifier
|
|
@@ -391,8 +392,8 @@ class U {
|
|
|
391
392
|
* @param {string} [modifier]
|
|
392
393
|
* @return {*} {string}
|
|
393
394
|
*/
|
|
394
|
-
bem(e,
|
|
395
|
-
return e &&
|
|
395
|
+
bem(e, t, i) {
|
|
396
|
+
return e && t && i ? j(this.namespace, this.block, e, t, i) : "";
|
|
396
397
|
}
|
|
397
398
|
/**
|
|
398
399
|
* 返回状态 class
|
|
@@ -406,8 +407,8 @@ class U {
|
|
|
406
407
|
* @param {boolean} [state]
|
|
407
408
|
* @return {*} {string}
|
|
408
409
|
*/
|
|
409
|
-
is(e,
|
|
410
|
-
return e &&
|
|
410
|
+
is(e, t) {
|
|
411
|
+
return e && t ? "".concat(cn).concat(e) : "";
|
|
411
412
|
}
|
|
412
413
|
/**
|
|
413
414
|
* 生成使用到的 css 变量 style 对象
|
|
@@ -418,10 +419,10 @@ class U {
|
|
|
418
419
|
* @return {*} {Record<string, string>}
|
|
419
420
|
*/
|
|
420
421
|
cssVar(e) {
|
|
421
|
-
const
|
|
422
|
+
const t = {};
|
|
422
423
|
for (const i in e)
|
|
423
|
-
e[i] && (
|
|
424
|
-
return
|
|
424
|
+
e[i] && (t[this.cssVarName(i)] = e[i]);
|
|
425
|
+
return t;
|
|
425
426
|
}
|
|
426
427
|
/**
|
|
427
428
|
* 生成使用到的 css block 变量 style 对象
|
|
@@ -432,10 +433,10 @@ class U {
|
|
|
432
433
|
* @return {*} {Record<string, string>}
|
|
433
434
|
*/
|
|
434
435
|
cssVarBlock(e) {
|
|
435
|
-
const
|
|
436
|
+
const t = {};
|
|
436
437
|
for (const i in e)
|
|
437
|
-
e[i] && (
|
|
438
|
-
return
|
|
438
|
+
e[i] && (t[this.cssVarBlockName(i)] = e[i]);
|
|
439
|
+
return t;
|
|
439
440
|
}
|
|
440
441
|
/**
|
|
441
442
|
* 生成 css var 变量名称
|
|
@@ -460,61 +461,61 @@ class U {
|
|
|
460
461
|
return "--".concat(this.namespace, "-").concat(this.block, "-").concat(e);
|
|
461
462
|
}
|
|
462
463
|
}
|
|
463
|
-
function z(
|
|
464
|
-
if (typeof
|
|
465
|
-
throw new TypeError("Path must be a string. Received " + JSON.stringify(
|
|
464
|
+
function z(n) {
|
|
465
|
+
if (typeof n != "string")
|
|
466
|
+
throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
|
|
466
467
|
}
|
|
467
|
-
function
|
|
468
|
-
for (var
|
|
469
|
-
if (
|
|
470
|
-
|
|
468
|
+
function Qe(n, e) {
|
|
469
|
+
for (var t = "", i = 0, s = -1, o = 0, r, c = 0; c <= n.length; ++c) {
|
|
470
|
+
if (c < n.length)
|
|
471
|
+
r = n.charCodeAt(c);
|
|
471
472
|
else {
|
|
472
|
-
if (
|
|
473
|
+
if (r === 47)
|
|
473
474
|
break;
|
|
474
|
-
|
|
475
|
+
r = 47;
|
|
475
476
|
}
|
|
476
|
-
if (
|
|
477
|
-
if (!(s ===
|
|
478
|
-
if (s !==
|
|
479
|
-
if (
|
|
480
|
-
if (
|
|
481
|
-
var
|
|
482
|
-
if (
|
|
483
|
-
|
|
477
|
+
if (r === 47) {
|
|
478
|
+
if (!(s === c - 1 || o === 1))
|
|
479
|
+
if (s !== c - 1 && o === 2) {
|
|
480
|
+
if (t.length < 2 || i !== 2 || t.charCodeAt(t.length - 1) !== 46 || t.charCodeAt(t.length - 2) !== 46) {
|
|
481
|
+
if (t.length > 2) {
|
|
482
|
+
var u = t.lastIndexOf("/");
|
|
483
|
+
if (u !== t.length - 1) {
|
|
484
|
+
u === -1 ? (t = "", i = 0) : (t = t.slice(0, u), i = t.length - 1 - t.lastIndexOf("/")), s = c, o = 0;
|
|
484
485
|
continue;
|
|
485
486
|
}
|
|
486
|
-
} else if (
|
|
487
|
-
|
|
487
|
+
} else if (t.length === 2 || t.length === 1) {
|
|
488
|
+
t = "", i = 0, s = c, o = 0;
|
|
488
489
|
continue;
|
|
489
490
|
}
|
|
490
491
|
}
|
|
491
|
-
e && (
|
|
492
|
+
e && (t.length > 0 ? t += "/.." : t = "..", i = 2);
|
|
492
493
|
} else
|
|
493
|
-
|
|
494
|
-
s =
|
|
494
|
+
t.length > 0 ? t += "/" + n.slice(s + 1, c) : t = n.slice(s + 1, c), i = c - s - 1;
|
|
495
|
+
s = c, o = 0;
|
|
495
496
|
} else
|
|
496
|
-
|
|
497
|
+
r === 46 && o !== -1 ? ++o : o = -1;
|
|
497
498
|
}
|
|
498
|
-
return
|
|
499
|
+
return t;
|
|
499
500
|
}
|
|
500
|
-
function
|
|
501
|
-
var
|
|
502
|
-
return
|
|
501
|
+
function ln(n, e) {
|
|
502
|
+
var t = e.dir || e.root, i = e.base || (e.name || "") + (e.ext || "");
|
|
503
|
+
return t ? t === e.root ? t + i : t + n + i : i;
|
|
503
504
|
}
|
|
504
|
-
var
|
|
505
|
+
var re = {
|
|
505
506
|
// path.resolve([from ...], to)
|
|
506
507
|
resolve: function() {
|
|
507
|
-
for (var e = "",
|
|
508
|
-
var
|
|
509
|
-
s >= 0 ?
|
|
508
|
+
for (var e = "", t = !1, i, s = arguments.length - 1; s >= -1 && !t; s--) {
|
|
509
|
+
var o;
|
|
510
|
+
s >= 0 ? o = arguments[s] : (i === void 0 && (i = process.cwd()), o = i), z(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
|
|
510
511
|
}
|
|
511
|
-
return e =
|
|
512
|
+
return e = Qe(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
|
|
512
513
|
},
|
|
513
514
|
normalize: function(e) {
|
|
514
515
|
if (z(e), e.length === 0)
|
|
515
516
|
return ".";
|
|
516
|
-
var
|
|
517
|
-
return e =
|
|
517
|
+
var t = e.charCodeAt(0) === 47, i = e.charCodeAt(e.length - 1) === 47;
|
|
518
|
+
return e = Qe(e, !t), e.length === 0 && !t && (e = "."), e.length > 0 && i && (e += "/"), t ? "/" + e : e;
|
|
518
519
|
},
|
|
519
520
|
isAbsolute: function(e) {
|
|
520
521
|
return z(e), e.length > 0 && e.charCodeAt(0) === 47;
|
|
@@ -522,39 +523,39 @@ var J = {
|
|
|
522
523
|
join: function() {
|
|
523
524
|
if (arguments.length === 0)
|
|
524
525
|
return ".";
|
|
525
|
-
for (var e,
|
|
526
|
-
var i = arguments[
|
|
526
|
+
for (var e, t = 0; t < arguments.length; ++t) {
|
|
527
|
+
var i = arguments[t];
|
|
527
528
|
z(i), i.length > 0 && (e === void 0 ? e = i : e += "/" + i);
|
|
528
529
|
}
|
|
529
|
-
return e === void 0 ? "." :
|
|
530
|
+
return e === void 0 ? "." : re.normalize(e);
|
|
530
531
|
},
|
|
531
|
-
relative: function(e,
|
|
532
|
-
if (z(e), z(
|
|
532
|
+
relative: function(e, t) {
|
|
533
|
+
if (z(e), z(t), e === t || (e = re.resolve(e), t = re.resolve(t), e === t))
|
|
533
534
|
return "";
|
|
534
535
|
for (var i = 1; i < e.length && e.charCodeAt(i) === 47; ++i)
|
|
535
536
|
;
|
|
536
|
-
for (var s = e.length,
|
|
537
|
+
for (var s = e.length, o = s - i, r = 1; r < t.length && t.charCodeAt(r) === 47; ++r)
|
|
537
538
|
;
|
|
538
|
-
for (var
|
|
539
|
-
if (a ===
|
|
540
|
-
if (
|
|
541
|
-
if (
|
|
542
|
-
return
|
|
539
|
+
for (var c = t.length, u = c - r, d = o < u ? o : u, h = -1, a = 0; a <= d; ++a) {
|
|
540
|
+
if (a === d) {
|
|
541
|
+
if (u > d) {
|
|
542
|
+
if (t.charCodeAt(r + a) === 47)
|
|
543
|
+
return t.slice(r + a + 1);
|
|
543
544
|
if (a === 0)
|
|
544
|
-
return
|
|
545
|
+
return t.slice(r + a);
|
|
545
546
|
} else
|
|
546
|
-
|
|
547
|
+
o > d && (e.charCodeAt(i + a) === 47 ? h = a : a === 0 && (h = 0));
|
|
547
548
|
break;
|
|
548
549
|
}
|
|
549
|
-
var
|
|
550
|
-
if (
|
|
550
|
+
var _ = e.charCodeAt(i + a), p = t.charCodeAt(r + a);
|
|
551
|
+
if (_ !== p)
|
|
551
552
|
break;
|
|
552
|
-
|
|
553
|
+
_ === 47 && (h = a);
|
|
553
554
|
}
|
|
554
|
-
var
|
|
555
|
+
var f = "";
|
|
555
556
|
for (a = i + h + 1; a <= s; ++a)
|
|
556
|
-
(a === s || e.charCodeAt(a) === 47) && (
|
|
557
|
-
return
|
|
557
|
+
(a === s || e.charCodeAt(a) === 47) && (f.length === 0 ? f += ".." : f += "/..");
|
|
558
|
+
return f.length > 0 ? f + t.slice(r + h) : (r += h, t.charCodeAt(r) === 47 && ++r, t.slice(r));
|
|
558
559
|
},
|
|
559
560
|
_makeLong: function(e) {
|
|
560
561
|
return e;
|
|
@@ -562,104 +563,104 @@ var J = {
|
|
|
562
563
|
dirname: function(e) {
|
|
563
564
|
if (z(e), e.length === 0)
|
|
564
565
|
return ".";
|
|
565
|
-
for (var
|
|
566
|
-
if (
|
|
567
|
-
if (!
|
|
568
|
-
s =
|
|
566
|
+
for (var t = e.charCodeAt(0), i = t === 47, s = -1, o = !0, r = e.length - 1; r >= 1; --r)
|
|
567
|
+
if (t = e.charCodeAt(r), t === 47) {
|
|
568
|
+
if (!o) {
|
|
569
|
+
s = r;
|
|
569
570
|
break;
|
|
570
571
|
}
|
|
571
572
|
} else
|
|
572
|
-
|
|
573
|
+
o = !1;
|
|
573
574
|
return s === -1 ? i ? "/" : "." : i && s === 1 ? "//" : e.slice(0, s);
|
|
574
575
|
},
|
|
575
|
-
basename: function(e,
|
|
576
|
-
if (
|
|
576
|
+
basename: function(e, t) {
|
|
577
|
+
if (t !== void 0 && typeof t != "string")
|
|
577
578
|
throw new TypeError('"ext" argument must be a string');
|
|
578
579
|
z(e);
|
|
579
|
-
var i = 0, s = -1,
|
|
580
|
-
if (
|
|
581
|
-
if (
|
|
580
|
+
var i = 0, s = -1, o = !0, r;
|
|
581
|
+
if (t !== void 0 && t.length > 0 && t.length <= e.length) {
|
|
582
|
+
if (t.length === e.length && t === e)
|
|
582
583
|
return "";
|
|
583
|
-
var
|
|
584
|
-
for (
|
|
585
|
-
var
|
|
586
|
-
if (
|
|
587
|
-
if (!
|
|
588
|
-
i =
|
|
584
|
+
var c = t.length - 1, u = -1;
|
|
585
|
+
for (r = e.length - 1; r >= 0; --r) {
|
|
586
|
+
var d = e.charCodeAt(r);
|
|
587
|
+
if (d === 47) {
|
|
588
|
+
if (!o) {
|
|
589
|
+
i = r + 1;
|
|
589
590
|
break;
|
|
590
591
|
}
|
|
591
592
|
} else
|
|
592
|
-
|
|
593
|
+
u === -1 && (o = !1, u = r + 1), c >= 0 && (d === t.charCodeAt(c) ? --c === -1 && (s = r) : (c = -1, s = u));
|
|
593
594
|
}
|
|
594
|
-
return i === s ? s =
|
|
595
|
+
return i === s ? s = u : s === -1 && (s = e.length), e.slice(i, s);
|
|
595
596
|
} else {
|
|
596
|
-
for (
|
|
597
|
-
if (e.charCodeAt(
|
|
598
|
-
if (!
|
|
599
|
-
i =
|
|
597
|
+
for (r = e.length - 1; r >= 0; --r)
|
|
598
|
+
if (e.charCodeAt(r) === 47) {
|
|
599
|
+
if (!o) {
|
|
600
|
+
i = r + 1;
|
|
600
601
|
break;
|
|
601
602
|
}
|
|
602
603
|
} else
|
|
603
|
-
s === -1 && (
|
|
604
|
+
s === -1 && (o = !1, s = r + 1);
|
|
604
605
|
return s === -1 ? "" : e.slice(i, s);
|
|
605
606
|
}
|
|
606
607
|
},
|
|
607
608
|
extname: function(e) {
|
|
608
609
|
z(e);
|
|
609
|
-
for (var
|
|
610
|
-
var
|
|
611
|
-
if (
|
|
612
|
-
if (!
|
|
613
|
-
i =
|
|
610
|
+
for (var t = -1, i = 0, s = -1, o = !0, r = 0, c = e.length - 1; c >= 0; --c) {
|
|
611
|
+
var u = e.charCodeAt(c);
|
|
612
|
+
if (u === 47) {
|
|
613
|
+
if (!o) {
|
|
614
|
+
i = c + 1;
|
|
614
615
|
break;
|
|
615
616
|
}
|
|
616
617
|
continue;
|
|
617
618
|
}
|
|
618
|
-
s === -1 && (
|
|
619
|
+
s === -1 && (o = !1, s = c + 1), u === 46 ? t === -1 ? t = c : r !== 1 && (r = 1) : t !== -1 && (r = -1);
|
|
619
620
|
}
|
|
620
|
-
return
|
|
621
|
-
|
|
622
|
-
|
|
621
|
+
return t === -1 || s === -1 || // We saw a non-dot character immediately before the dot
|
|
622
|
+
r === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
623
|
+
r === 1 && t === s - 1 && t === i + 1 ? "" : e.slice(t, s);
|
|
623
624
|
},
|
|
624
625
|
format: function(e) {
|
|
625
626
|
if (e === null || typeof e != "object")
|
|
626
627
|
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof e);
|
|
627
|
-
return
|
|
628
|
+
return ln("/", e);
|
|
628
629
|
},
|
|
629
630
|
parse: function(e) {
|
|
630
631
|
z(e);
|
|
631
|
-
var
|
|
632
|
+
var t = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
632
633
|
if (e.length === 0)
|
|
633
|
-
return
|
|
634
|
-
var i = e.charCodeAt(0), s = i === 47,
|
|
635
|
-
s ? (
|
|
636
|
-
for (var
|
|
634
|
+
return t;
|
|
635
|
+
var i = e.charCodeAt(0), s = i === 47, o;
|
|
636
|
+
s ? (t.root = "/", o = 1) : o = 0;
|
|
637
|
+
for (var r = -1, c = 0, u = -1, d = !0, h = e.length - 1, a = 0; h >= o; --h) {
|
|
637
638
|
if (i = e.charCodeAt(h), i === 47) {
|
|
638
|
-
if (!
|
|
639
|
-
|
|
639
|
+
if (!d) {
|
|
640
|
+
c = h + 1;
|
|
640
641
|
break;
|
|
641
642
|
}
|
|
642
643
|
continue;
|
|
643
644
|
}
|
|
644
|
-
|
|
645
|
+
u === -1 && (d = !1, u = h + 1), i === 46 ? r === -1 ? r = h : a !== 1 && (a = 1) : r !== -1 && (a = -1);
|
|
645
646
|
}
|
|
646
|
-
return
|
|
647
|
+
return r === -1 || u === -1 || // We saw a non-dot character immediately before the dot
|
|
647
648
|
a === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
648
|
-
a === 1 &&
|
|
649
|
+
a === 1 && r === u - 1 && r === c + 1 ? u !== -1 && (c === 0 && s ? t.base = t.name = e.slice(1, u) : t.base = t.name = e.slice(c, u)) : (c === 0 && s ? (t.name = e.slice(1, r), t.base = e.slice(1, u)) : (t.name = e.slice(c, r), t.base = e.slice(c, u)), t.ext = e.slice(r, u)), c > 0 ? t.dir = e.slice(0, c - 1) : s && (t.dir = "/"), t;
|
|
649
650
|
},
|
|
650
651
|
sep: "/",
|
|
651
652
|
delimiter: ":",
|
|
652
653
|
win32: null,
|
|
653
654
|
posix: null
|
|
654
655
|
};
|
|
655
|
-
|
|
656
|
-
function
|
|
656
|
+
re.posix = re;
|
|
657
|
+
function O() {
|
|
657
658
|
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
658
659
|
}
|
|
659
|
-
function
|
|
660
|
-
return "".concat(
|
|
660
|
+
function Lt() {
|
|
661
|
+
return "".concat(O() + O(), "-").concat(O(), "-").concat(O(), "-").concat(O(), "-").concat(O()).concat(O()).concat(O());
|
|
661
662
|
}
|
|
662
|
-
class
|
|
663
|
+
class Rt {
|
|
663
664
|
/**
|
|
664
665
|
* 拷贝文本
|
|
665
666
|
*
|
|
@@ -680,645 +681,1098 @@ class kt {
|
|
|
680
681
|
* @private
|
|
681
682
|
* @type {(HTMLInputElement | null)}
|
|
682
683
|
*/
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
684
|
+
y(Rt, "inputElement", null);
|
|
685
|
+
const m = class m {
|
|
686
|
+
/**
|
|
687
|
+
* 检查数据库是否存在
|
|
688
|
+
*
|
|
689
|
+
* @param {string} storeName
|
|
690
|
+
* @return {*} {Promise<boolean>}
|
|
691
|
+
* @memberof IndexedDBUtil
|
|
692
|
+
*/
|
|
693
|
+
static async checkDataBaseExists(e) {
|
|
694
|
+
try {
|
|
695
|
+
return (await indexedDB.databases()).some((i) => i.name === e);
|
|
696
|
+
} catch (t) {
|
|
697
|
+
return console.error("检查数据库是否存在时出错:", t), !1;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* 删除数据库
|
|
702
|
+
*
|
|
703
|
+
* @return {*} {Promise<void>}
|
|
704
|
+
* @memberof IndexedDBUtil
|
|
705
|
+
*/
|
|
706
|
+
static async deleteDatabase(e) {
|
|
707
|
+
var t, i;
|
|
708
|
+
return m.lastLink && ((i = (t = m.lastLink).close) == null || i.call(t)), new Promise((s, o) => {
|
|
709
|
+
const r = indexedDB.deleteDatabase(e);
|
|
710
|
+
r.onsuccess = () => {
|
|
711
|
+
s(!0);
|
|
712
|
+
}, r.onerror = () => {
|
|
713
|
+
s(!1);
|
|
714
|
+
}, r.onblocked = () => {
|
|
715
|
+
console.warn("删除数据库 ".concat(e, " 被阻塞,可能有其他连接正在使用该数据库。")), o(new Error("删除数据库 ".concat(e, " 被阻塞")));
|
|
716
|
+
};
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* 检查是否存在某个库以及库内是否存在某个表
|
|
721
|
+
*
|
|
722
|
+
* @param {string} storeName
|
|
723
|
+
* @param {string} tableName
|
|
724
|
+
* @return {*}
|
|
725
|
+
* @memberof IndexedDBUtil
|
|
726
|
+
*/
|
|
727
|
+
static async checkTableExists(e, t) {
|
|
728
|
+
return await m.checkDataBaseExists(e) ? new Promise((s, o) => {
|
|
729
|
+
const r = indexedDB.open(e);
|
|
730
|
+
r.onupgradeneeded = (c) => {
|
|
731
|
+
m.db = c.target.result, m.version = m.db.version;
|
|
732
|
+
}, r.onsuccess = (c) => {
|
|
733
|
+
m.db = c.target.result, m.lastLink = r.result;
|
|
734
|
+
const u = m.db.objectStoreNames.contains(t);
|
|
735
|
+
r.result.close(), s(u);
|
|
736
|
+
}, r.onerror = (c) => {
|
|
737
|
+
o(c.target.error);
|
|
738
|
+
};
|
|
739
|
+
}) : !1;
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* 创建表
|
|
743
|
+
*
|
|
744
|
+
* @param {string} storeName 库名称
|
|
745
|
+
* @param {(string | null)} keyPath 表主键
|
|
746
|
+
* @param {boolean} [useAutoIncrement=false] 是否使用自增
|
|
747
|
+
* @return {*} {Promise<void>}
|
|
748
|
+
* @memberof IndexedDBUtil
|
|
749
|
+
*/
|
|
750
|
+
static async createTable(e, t, i, s = !1) {
|
|
751
|
+
return new Promise((o) => {
|
|
752
|
+
var c, u;
|
|
753
|
+
m.version += 1, m.lastLink && ((u = (c = m.lastLink).close) == null || u.call(c));
|
|
754
|
+
const r = indexedDB.open(e, m.version);
|
|
755
|
+
r.onupgradeneeded = (d) => {
|
|
756
|
+
if (m.db = d.target.result, !m.db.objectStoreNames.contains(t)) {
|
|
757
|
+
const h = {};
|
|
758
|
+
i ? h.keyPath = i : s && (h.autoIncrement = !0), m.db.createObjectStore(t, h);
|
|
759
|
+
}
|
|
760
|
+
}, r.onsuccess = () => {
|
|
761
|
+
m.lastLink = r.result, r.result.close(), o(!0);
|
|
762
|
+
}, r.onerror = () => {
|
|
763
|
+
o(!1);
|
|
764
|
+
};
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* 删除表
|
|
769
|
+
*
|
|
770
|
+
* @param {string} storeName 表名称
|
|
771
|
+
* @return {*} {Promise<void>}
|
|
772
|
+
* @memberof IndexedDBUtil
|
|
773
|
+
*/
|
|
774
|
+
static async deleteTable(e, t) {
|
|
775
|
+
return new Promise((i) => {
|
|
776
|
+
var o, r;
|
|
777
|
+
m.version += 1, m.lastLink && ((r = (o = m.lastLink).close) == null || r.call(o));
|
|
778
|
+
const s = indexedDB.open(e, m.version);
|
|
779
|
+
s.onupgradeneeded = (c) => {
|
|
780
|
+
m.db = c.target.result, m.lastLink = s.result, m.db.objectStoreNames.contains(t) && m.db.deleteObjectStore(t);
|
|
781
|
+
}, s.onsuccess = (c) => {
|
|
782
|
+
m.db = c.target.result, m.lastLink = s.result, s.result.close(), i(!0);
|
|
783
|
+
}, s.onerror = () => {
|
|
784
|
+
s.result.close(), i(!1);
|
|
785
|
+
};
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* 新增数据
|
|
790
|
+
*
|
|
791
|
+
* @param {string} storeName 表名称
|
|
792
|
+
* @param {*} data 新增数据
|
|
793
|
+
* @return {*} {Promise<void>}
|
|
794
|
+
* @memberof IndexedDBUtil
|
|
795
|
+
*/
|
|
796
|
+
static async addData(e, t, i) {
|
|
797
|
+
return new Promise((s, o) => {
|
|
798
|
+
const r = indexedDB.open(e);
|
|
799
|
+
r.onsuccess = (c) => {
|
|
800
|
+
if (m.db = c.target.result, m.lastLink = r.result, m.db.objectStoreNames.contains(t)) {
|
|
801
|
+
const h = m.db.transaction([t], "readwrite").objectStore(t).add(i);
|
|
802
|
+
h.onsuccess = (a) => {
|
|
803
|
+
s(i);
|
|
804
|
+
}, h.onerror = () => {
|
|
805
|
+
s(null);
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
r.result.close();
|
|
809
|
+
}, r.onerror = () => {
|
|
810
|
+
r.result.close(), o();
|
|
811
|
+
};
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* 删除数据
|
|
816
|
+
*
|
|
817
|
+
* @param {string} storeName 表名称
|
|
818
|
+
* @param {IDBValidKey} key 数据键
|
|
819
|
+
* @return {*} {Promise<void>}
|
|
820
|
+
* @memberof IndexedDBUtil
|
|
821
|
+
*/
|
|
822
|
+
static async deleteData(e, t, i) {
|
|
823
|
+
return new Promise((s, o) => {
|
|
824
|
+
const r = indexedDB.open(e);
|
|
825
|
+
r.onsuccess = (c) => {
|
|
826
|
+
if (m.db = c.target.result, m.lastLink = r.result, m.db.objectStoreNames.contains(t)) {
|
|
827
|
+
const h = m.db.transaction([t], "readwrite").objectStore(t).delete(i);
|
|
828
|
+
h.onsuccess = (a) => {
|
|
829
|
+
s(!0);
|
|
830
|
+
}, h.onerror = () => {
|
|
831
|
+
s(!1);
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
r.result.close();
|
|
835
|
+
}, r.onerror = () => {
|
|
836
|
+
r.result.close(), o();
|
|
837
|
+
};
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* 修改数据
|
|
842
|
+
*
|
|
843
|
+
* @param {string} storeName 表名称
|
|
844
|
+
* @param {*} data 需要修改的数据
|
|
845
|
+
* @return {*} {Promise<void>}
|
|
846
|
+
* @memberof IndexedDBUtil
|
|
847
|
+
*/
|
|
848
|
+
static async updateData(e, t, i) {
|
|
849
|
+
return new Promise((s, o) => {
|
|
850
|
+
const r = indexedDB.open(e);
|
|
851
|
+
r.onsuccess = (c) => {
|
|
852
|
+
if (m.db = c.target.result, m.lastLink = r.result, m.db.objectStoreNames.contains(t)) {
|
|
853
|
+
const h = m.db.transaction([t], "readwrite").objectStore(t).put(i);
|
|
854
|
+
h.onsuccess = (a) => {
|
|
855
|
+
s(i);
|
|
856
|
+
}, h.onerror = () => {
|
|
857
|
+
s(i);
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
r.result.close();
|
|
861
|
+
}, r.onerror = () => {
|
|
862
|
+
r.result.close(), o();
|
|
863
|
+
};
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* 读取单条数据
|
|
868
|
+
*
|
|
869
|
+
* @param {string} storeName 表名称
|
|
870
|
+
* @param {IDBValidKey} key 数据主键
|
|
871
|
+
* @return {*} {Promise<any>}
|
|
872
|
+
* @memberof IndexedDBUtil
|
|
873
|
+
*/
|
|
874
|
+
static async getData(e, t, i) {
|
|
875
|
+
return new Promise((s, o) => {
|
|
876
|
+
const r = indexedDB.open(e);
|
|
877
|
+
r.onsuccess = (c) => {
|
|
878
|
+
if (m.db = c.target.result, m.lastLink = r.result, m.db.objectStoreNames.contains(t)) {
|
|
879
|
+
const h = m.db.transaction([t], "readonly").objectStore(t).get(i);
|
|
880
|
+
h.onsuccess = (a) => {
|
|
881
|
+
s(h.result);
|
|
882
|
+
}, h.onerror = () => {
|
|
883
|
+
o(new Error("未找到数据".concat(i)));
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
r.result.close();
|
|
887
|
+
}, r.onerror = () => {
|
|
888
|
+
r.result.close(), o();
|
|
889
|
+
};
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* 读取所有数据
|
|
894
|
+
*
|
|
895
|
+
* @param {string} storeName 表名称
|
|
896
|
+
* @return {*} {Promise<any[]>}
|
|
897
|
+
* @memberof IndexedDBUtil
|
|
898
|
+
*/
|
|
899
|
+
static async getAllData(e, t) {
|
|
900
|
+
return new Promise((i, s) => {
|
|
901
|
+
const o = indexedDB.open(e);
|
|
902
|
+
o.onsuccess = (r) => {
|
|
903
|
+
if (m.db = r.target.result, m.lastLink = o.result, m.db.objectStoreNames.contains(t)) {
|
|
904
|
+
const d = m.db.transaction([t], "readonly").objectStore(t).getAll();
|
|
905
|
+
d.onsuccess = (h) => {
|
|
906
|
+
i(d.result);
|
|
907
|
+
}, d.onerror = () => {
|
|
908
|
+
i([]);
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
o.result.close();
|
|
912
|
+
}, o.onerror = () => {
|
|
913
|
+
o.result.close(), s();
|
|
914
|
+
};
|
|
915
|
+
});
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
// 数据库版本
|
|
919
|
+
y(m, "version", 1), // 数据库连接句柄
|
|
920
|
+
y(m, "db", null), // 上一个连接
|
|
921
|
+
y(m, "lastLink");
|
|
922
|
+
let U = m;
|
|
923
|
+
var ue, S, De, et, he = 0, Ot = [], ge = [], tt = v.__b, nt = v.__r, it = v.diffed, st = v.__c, ot = v.unmount;
|
|
924
|
+
function Ve(n, e) {
|
|
925
|
+
v.__h && v.__h(S, n, he || e), he = 0;
|
|
926
|
+
var t = S.__H || (S.__H = { __: [], __h: [] });
|
|
927
|
+
return n >= t.__.length && t.__.push({ __V: ge }), t.__[n];
|
|
928
|
+
}
|
|
929
|
+
function Pt(n) {
|
|
930
|
+
return he = 1, un(Ut, n);
|
|
931
|
+
}
|
|
932
|
+
function un(n, e, t) {
|
|
933
|
+
var i = Ve(ue++, 2);
|
|
934
|
+
if (i.t = n, !i.__c && (i.__ = [t ? t(e) : Ut(void 0, e), function(c) {
|
|
935
|
+
var u = i.__N ? i.__N[0] : i.__[0], d = i.t(u, c);
|
|
936
|
+
u !== d && (i.__N = [d, i.__[1]], i.__c.setState({}));
|
|
937
|
+
}], i.__c = S, !S.u)) {
|
|
938
|
+
var s = function(c, u, d) {
|
|
939
|
+
if (!i.__c.__H)
|
|
940
|
+
return !0;
|
|
941
|
+
var h = i.__c.__H.__.filter(function(_) {
|
|
942
|
+
return _.__c;
|
|
943
|
+
});
|
|
944
|
+
if (h.every(function(_) {
|
|
945
|
+
return !_.__N;
|
|
946
|
+
}))
|
|
947
|
+
return !o || o.call(this, c, u, d);
|
|
948
|
+
var a = !1;
|
|
949
|
+
return h.forEach(function(_) {
|
|
950
|
+
if (_.__N) {
|
|
951
|
+
var p = _.__[0];
|
|
952
|
+
_.__ = _.__N, _.__N = void 0, p !== _.__[0] && (a = !0);
|
|
953
|
+
}
|
|
954
|
+
}), !(!a && i.__c.props === c) && (!o || o.call(this, c, u, d));
|
|
955
|
+
};
|
|
956
|
+
S.u = !0;
|
|
957
|
+
var o = S.shouldComponentUpdate, r = S.componentWillUpdate;
|
|
958
|
+
S.componentWillUpdate = function(c, u, d) {
|
|
959
|
+
if (this.__e) {
|
|
960
|
+
var h = o;
|
|
961
|
+
o = void 0, s(c, u, d), o = h;
|
|
962
|
+
}
|
|
963
|
+
r && r.call(this, c, u, d);
|
|
964
|
+
}, S.shouldComponentUpdate = s;
|
|
965
|
+
}
|
|
966
|
+
return i.__N || i.__;
|
|
967
|
+
}
|
|
968
|
+
function F(n, e) {
|
|
969
|
+
var t = Ve(ue++, 3);
|
|
970
|
+
!v.__s && Bt(t.__H, e) && (t.__ = n, t.i = e, S.__H.__h.push(t));
|
|
971
|
+
}
|
|
972
|
+
function Z(n) {
|
|
973
|
+
return he = 5, G(function() {
|
|
974
|
+
return { current: n };
|
|
697
975
|
}, []);
|
|
698
976
|
}
|
|
699
|
-
function
|
|
700
|
-
var
|
|
701
|
-
return
|
|
977
|
+
function G(n, e) {
|
|
978
|
+
var t = Ve(ue++, 7);
|
|
979
|
+
return Bt(t.__H, e) ? (t.__V = n(), t.i = e, t.__h = n, t.__V) : t.__;
|
|
702
980
|
}
|
|
703
|
-
function
|
|
704
|
-
return
|
|
705
|
-
return
|
|
981
|
+
function rt(n, e) {
|
|
982
|
+
return he = 8, G(function() {
|
|
983
|
+
return n;
|
|
706
984
|
}, e);
|
|
707
985
|
}
|
|
708
|
-
function
|
|
709
|
-
for (var
|
|
710
|
-
if (
|
|
986
|
+
function hn() {
|
|
987
|
+
for (var n; n = Ot.shift(); )
|
|
988
|
+
if (n.__P && n.__H)
|
|
711
989
|
try {
|
|
712
|
-
|
|
990
|
+
n.__H.__h.forEach(ye), n.__H.__h.forEach(Pe), n.__H.__h = [];
|
|
713
991
|
} catch (e) {
|
|
714
|
-
|
|
992
|
+
n.__H.__h = [], v.__e(e, n.__v);
|
|
715
993
|
}
|
|
716
994
|
}
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
},
|
|
720
|
-
|
|
721
|
-
var e = (
|
|
722
|
-
e && (
|
|
723
|
-
|
|
724
|
-
})) : (e.__h.forEach(
|
|
725
|
-
},
|
|
726
|
-
|
|
727
|
-
var e =
|
|
728
|
-
e && e.__H && (e.__H.__h.length && (
|
|
729
|
-
|
|
730
|
-
})),
|
|
731
|
-
},
|
|
732
|
-
e.some(function(
|
|
995
|
+
v.__b = function(n) {
|
|
996
|
+
S = null, tt && tt(n);
|
|
997
|
+
}, v.__r = function(n) {
|
|
998
|
+
nt && nt(n), ue = 0;
|
|
999
|
+
var e = (S = n.__c).__H;
|
|
1000
|
+
e && (De === S ? (e.__h = [], S.__h = [], e.__.forEach(function(t) {
|
|
1001
|
+
t.__N && (t.__ = t.__N), t.__V = ge, t.__N = t.i = void 0;
|
|
1002
|
+
})) : (e.__h.forEach(ye), e.__h.forEach(Pe), e.__h = [], ue = 0)), De = S;
|
|
1003
|
+
}, v.diffed = function(n) {
|
|
1004
|
+
it && it(n);
|
|
1005
|
+
var e = n.__c;
|
|
1006
|
+
e && e.__H && (e.__H.__h.length && (Ot.push(e) !== 1 && et === v.requestAnimationFrame || ((et = v.requestAnimationFrame) || dn)(hn)), e.__H.__.forEach(function(t) {
|
|
1007
|
+
t.i && (t.__H = t.i), t.__V !== ge && (t.__ = t.__V), t.i = void 0, t.__V = ge;
|
|
1008
|
+
})), De = S = null;
|
|
1009
|
+
}, v.__c = function(n, e) {
|
|
1010
|
+
e.some(function(t) {
|
|
733
1011
|
try {
|
|
734
|
-
|
|
735
|
-
return !i.__ ||
|
|
1012
|
+
t.__h.forEach(ye), t.__h = t.__h.filter(function(i) {
|
|
1013
|
+
return !i.__ || Pe(i);
|
|
736
1014
|
});
|
|
737
1015
|
} catch (i) {
|
|
738
1016
|
e.some(function(s) {
|
|
739
1017
|
s.__h && (s.__h = []);
|
|
740
|
-
}), e = [],
|
|
1018
|
+
}), e = [], v.__e(i, t.__v);
|
|
741
1019
|
}
|
|
742
|
-
}),
|
|
743
|
-
},
|
|
744
|
-
|
|
745
|
-
var e,
|
|
746
|
-
|
|
1020
|
+
}), st && st(n, e);
|
|
1021
|
+
}, v.unmount = function(n) {
|
|
1022
|
+
ot && ot(n);
|
|
1023
|
+
var e, t = n.__c;
|
|
1024
|
+
t && t.__H && (t.__H.__.forEach(function(i) {
|
|
747
1025
|
try {
|
|
748
|
-
|
|
1026
|
+
ye(i);
|
|
749
1027
|
} catch (s) {
|
|
750
1028
|
e = s;
|
|
751
1029
|
}
|
|
752
|
-
}),
|
|
1030
|
+
}), t.__H = void 0, e && v.__e(e, t.__v));
|
|
753
1031
|
};
|
|
754
|
-
var
|
|
755
|
-
function
|
|
756
|
-
var e,
|
|
757
|
-
clearTimeout(i),
|
|
758
|
-
}, i = setTimeout(
|
|
759
|
-
|
|
760
|
-
}
|
|
761
|
-
function
|
|
762
|
-
var e =
|
|
763
|
-
typeof
|
|
764
|
-
}
|
|
765
|
-
function
|
|
766
|
-
var e =
|
|
767
|
-
|
|
768
|
-
}
|
|
769
|
-
function
|
|
770
|
-
return !
|
|
771
|
-
return
|
|
1032
|
+
var at = typeof requestAnimationFrame == "function";
|
|
1033
|
+
function dn(n) {
|
|
1034
|
+
var e, t = function() {
|
|
1035
|
+
clearTimeout(i), at && cancelAnimationFrame(e), setTimeout(n);
|
|
1036
|
+
}, i = setTimeout(t, 100);
|
|
1037
|
+
at && (e = requestAnimationFrame(t));
|
|
1038
|
+
}
|
|
1039
|
+
function ye(n) {
|
|
1040
|
+
var e = S, t = n.__c;
|
|
1041
|
+
typeof t == "function" && (n.__c = void 0, t()), S = e;
|
|
1042
|
+
}
|
|
1043
|
+
function Pe(n) {
|
|
1044
|
+
var e = S;
|
|
1045
|
+
n.__c = n.__(), S = e;
|
|
1046
|
+
}
|
|
1047
|
+
function Bt(n, e) {
|
|
1048
|
+
return !n || n.length !== e.length || e.some(function(t, i) {
|
|
1049
|
+
return t !== n[i];
|
|
772
1050
|
});
|
|
773
1051
|
}
|
|
774
|
-
function
|
|
1052
|
+
function Ut(n, e) {
|
|
1053
|
+
return typeof e == "function" ? e(n) : e;
|
|
1054
|
+
}
|
|
1055
|
+
function $e() {
|
|
775
1056
|
throw new Error("Cycle detected");
|
|
776
1057
|
}
|
|
777
|
-
var
|
|
778
|
-
function
|
|
779
|
-
if (
|
|
780
|
-
|
|
1058
|
+
var fn = Symbol.for("preact-signals");
|
|
1059
|
+
function je() {
|
|
1060
|
+
if (ee > 1)
|
|
1061
|
+
ee--;
|
|
781
1062
|
else {
|
|
782
|
-
for (var
|
|
783
|
-
var
|
|
784
|
-
for (
|
|
785
|
-
var i =
|
|
786
|
-
if (
|
|
1063
|
+
for (var n, e = !1; ae !== void 0; ) {
|
|
1064
|
+
var t = ae;
|
|
1065
|
+
for (ae = void 0, Be++; t !== void 0; ) {
|
|
1066
|
+
var i = t.o;
|
|
1067
|
+
if (t.o = void 0, t.f &= -3, !(8 & t.f) && Wt(t))
|
|
787
1068
|
try {
|
|
788
|
-
|
|
1069
|
+
t.c();
|
|
789
1070
|
} catch (s) {
|
|
790
|
-
e || (
|
|
1071
|
+
e || (n = s, e = !0);
|
|
791
1072
|
}
|
|
792
|
-
|
|
1073
|
+
t = i;
|
|
793
1074
|
}
|
|
794
1075
|
}
|
|
795
|
-
if (
|
|
796
|
-
throw
|
|
1076
|
+
if (Be = 0, ee--, e)
|
|
1077
|
+
throw n;
|
|
797
1078
|
}
|
|
798
1079
|
}
|
|
799
|
-
var
|
|
800
|
-
function
|
|
801
|
-
if (
|
|
802
|
-
var e =
|
|
803
|
-
if (e === void 0 || e.t !==
|
|
804
|
-
return e = { i: 0, S:
|
|
1080
|
+
var w = void 0, ae = void 0, ee = 0, Be = 0, Te = 0;
|
|
1081
|
+
function Ft(n) {
|
|
1082
|
+
if (w !== void 0) {
|
|
1083
|
+
var e = n.n;
|
|
1084
|
+
if (e === void 0 || e.t !== w)
|
|
1085
|
+
return e = { i: 0, S: n, p: w.s, n: void 0, t: w, e: void 0, x: void 0, r: e }, w.s !== void 0 && (w.s.n = e), w.s = e, n.n = e, 32 & w.f && n.S(e), e;
|
|
805
1086
|
if (e.i === -1)
|
|
806
|
-
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p =
|
|
1087
|
+
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = w.s, e.n = void 0, w.s.n = e, w.s = e), e;
|
|
807
1088
|
}
|
|
808
1089
|
}
|
|
809
|
-
function
|
|
810
|
-
this.v =
|
|
1090
|
+
function $(n) {
|
|
1091
|
+
this.v = n, this.i = 0, this.n = void 0, this.t = void 0;
|
|
811
1092
|
}
|
|
812
|
-
|
|
813
|
-
|
|
1093
|
+
$.prototype.brand = fn;
|
|
1094
|
+
$.prototype.h = function() {
|
|
814
1095
|
return !0;
|
|
815
1096
|
};
|
|
816
|
-
|
|
817
|
-
this.t !==
|
|
1097
|
+
$.prototype.S = function(n) {
|
|
1098
|
+
this.t !== n && n.e === void 0 && (n.x = this.t, this.t !== void 0 && (this.t.e = n), this.t = n);
|
|
818
1099
|
};
|
|
819
|
-
|
|
1100
|
+
$.prototype.U = function(n) {
|
|
820
1101
|
if (this.t !== void 0) {
|
|
821
|
-
var e =
|
|
822
|
-
e !== void 0 && (e.x =
|
|
1102
|
+
var e = n.e, t = n.x;
|
|
1103
|
+
e !== void 0 && (e.x = t, n.e = void 0), t !== void 0 && (t.e = e, n.x = void 0), n === this.t && (this.t = t);
|
|
823
1104
|
}
|
|
824
1105
|
};
|
|
825
|
-
|
|
1106
|
+
$.prototype.subscribe = function(n) {
|
|
826
1107
|
var e = this;
|
|
827
|
-
return
|
|
828
|
-
var
|
|
1108
|
+
return Ne(function() {
|
|
1109
|
+
var t = e.value, i = 32 & this.f;
|
|
829
1110
|
this.f &= -33;
|
|
830
1111
|
try {
|
|
831
|
-
t
|
|
1112
|
+
n(t);
|
|
832
1113
|
} finally {
|
|
833
1114
|
this.f |= i;
|
|
834
1115
|
}
|
|
835
1116
|
});
|
|
836
1117
|
};
|
|
837
|
-
|
|
1118
|
+
$.prototype.valueOf = function() {
|
|
838
1119
|
return this.value;
|
|
839
1120
|
};
|
|
840
|
-
|
|
1121
|
+
$.prototype.toString = function() {
|
|
841
1122
|
return this.value + "";
|
|
842
1123
|
};
|
|
843
|
-
|
|
1124
|
+
$.prototype.toJSON = function() {
|
|
844
1125
|
return this.value;
|
|
845
1126
|
};
|
|
846
|
-
|
|
1127
|
+
$.prototype.peek = function() {
|
|
847
1128
|
return this.v;
|
|
848
1129
|
};
|
|
849
|
-
Object.defineProperty(
|
|
850
|
-
var
|
|
851
|
-
return
|
|
852
|
-
}, set: function(
|
|
853
|
-
if (
|
|
1130
|
+
Object.defineProperty($.prototype, "value", { get: function() {
|
|
1131
|
+
var n = Ft(this);
|
|
1132
|
+
return n !== void 0 && (n.i = this.i), this.v;
|
|
1133
|
+
}, set: function(n) {
|
|
1134
|
+
if (w instanceof V && function() {
|
|
854
1135
|
throw new Error("Computed cannot have side-effects");
|
|
855
|
-
}(),
|
|
856
|
-
|
|
1136
|
+
}(), n !== this.v) {
|
|
1137
|
+
Be > 100 && $e(), this.v = n, this.i++, Te++, ee++;
|
|
857
1138
|
try {
|
|
858
1139
|
for (var e = this.t; e !== void 0; e = e.x)
|
|
859
1140
|
e.t.N();
|
|
860
1141
|
} finally {
|
|
861
|
-
|
|
1142
|
+
je();
|
|
862
1143
|
}
|
|
863
1144
|
}
|
|
864
1145
|
} });
|
|
865
|
-
function
|
|
866
|
-
return new
|
|
1146
|
+
function ne(n) {
|
|
1147
|
+
return new $(n);
|
|
867
1148
|
}
|
|
868
|
-
function
|
|
869
|
-
for (var e =
|
|
1149
|
+
function Wt(n) {
|
|
1150
|
+
for (var e = n.s; e !== void 0; e = e.n)
|
|
870
1151
|
if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i)
|
|
871
1152
|
return !0;
|
|
872
1153
|
return !1;
|
|
873
1154
|
}
|
|
874
|
-
function
|
|
875
|
-
for (var e =
|
|
876
|
-
var
|
|
877
|
-
if (
|
|
878
|
-
|
|
1155
|
+
function Vt(n) {
|
|
1156
|
+
for (var e = n.s; e !== void 0; e = e.n) {
|
|
1157
|
+
var t = e.S.n;
|
|
1158
|
+
if (t !== void 0 && (e.r = t), e.S.n = e, e.i = -1, e.n === void 0) {
|
|
1159
|
+
n.s = e;
|
|
879
1160
|
break;
|
|
880
1161
|
}
|
|
881
1162
|
}
|
|
882
1163
|
}
|
|
883
|
-
function
|
|
884
|
-
for (var e =
|
|
1164
|
+
function jt(n) {
|
|
1165
|
+
for (var e = n.s, t = void 0; e !== void 0; ) {
|
|
885
1166
|
var i = e.p;
|
|
886
|
-
e.i === -1 ? (e.S.U(e), i !== void 0 && (i.n = e.n), e.n !== void 0 && (e.n.p = i)) :
|
|
1167
|
+
e.i === -1 ? (e.S.U(e), i !== void 0 && (i.n = e.n), e.n !== void 0 && (e.n.p = i)) : t = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = i;
|
|
887
1168
|
}
|
|
888
|
-
|
|
1169
|
+
n.s = t;
|
|
889
1170
|
}
|
|
890
|
-
function
|
|
891
|
-
|
|
1171
|
+
function V(n) {
|
|
1172
|
+
$.call(this, void 0), this.x = n, this.s = void 0, this.g = Te - 1, this.f = 4;
|
|
892
1173
|
}
|
|
893
|
-
(
|
|
1174
|
+
(V.prototype = new $()).h = function() {
|
|
894
1175
|
if (this.f &= -3, 1 & this.f)
|
|
895
1176
|
return !1;
|
|
896
|
-
if ((36 & this.f) == 32 || (this.f &= -5, this.g ===
|
|
1177
|
+
if ((36 & this.f) == 32 || (this.f &= -5, this.g === Te))
|
|
897
1178
|
return !0;
|
|
898
|
-
if (this.g =
|
|
1179
|
+
if (this.g = Te, this.f |= 1, this.i > 0 && !Wt(this))
|
|
899
1180
|
return this.f &= -2, !0;
|
|
900
|
-
var
|
|
1181
|
+
var n = w;
|
|
901
1182
|
try {
|
|
902
|
-
|
|
1183
|
+
Vt(this), w = this;
|
|
903
1184
|
var e = this.x();
|
|
904
1185
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
905
|
-
} catch (
|
|
906
|
-
this.v =
|
|
1186
|
+
} catch (t) {
|
|
1187
|
+
this.v = t, this.f |= 16, this.i++;
|
|
907
1188
|
}
|
|
908
|
-
return
|
|
1189
|
+
return w = n, jt(this), this.f &= -2, !0;
|
|
909
1190
|
};
|
|
910
|
-
|
|
1191
|
+
V.prototype.S = function(n) {
|
|
911
1192
|
if (this.t === void 0) {
|
|
912
1193
|
this.f |= 36;
|
|
913
1194
|
for (var e = this.s; e !== void 0; e = e.n)
|
|
914
1195
|
e.S.S(e);
|
|
915
1196
|
}
|
|
916
|
-
|
|
1197
|
+
$.prototype.S.call(this, n);
|
|
917
1198
|
};
|
|
918
|
-
|
|
919
|
-
if (this.t !== void 0 && (
|
|
1199
|
+
V.prototype.U = function(n) {
|
|
1200
|
+
if (this.t !== void 0 && ($.prototype.U.call(this, n), this.t === void 0)) {
|
|
920
1201
|
this.f &= -33;
|
|
921
1202
|
for (var e = this.s; e !== void 0; e = e.n)
|
|
922
1203
|
e.S.U(e);
|
|
923
1204
|
}
|
|
924
1205
|
};
|
|
925
|
-
|
|
1206
|
+
V.prototype.N = function() {
|
|
926
1207
|
if (!(2 & this.f)) {
|
|
927
1208
|
this.f |= 6;
|
|
928
|
-
for (var
|
|
929
|
-
|
|
1209
|
+
for (var n = this.t; n !== void 0; n = n.x)
|
|
1210
|
+
n.t.N();
|
|
930
1211
|
}
|
|
931
1212
|
};
|
|
932
|
-
|
|
933
|
-
if (this.h() ||
|
|
1213
|
+
V.prototype.peek = function() {
|
|
1214
|
+
if (this.h() || $e(), 16 & this.f)
|
|
934
1215
|
throw this.v;
|
|
935
1216
|
return this.v;
|
|
936
1217
|
};
|
|
937
|
-
Object.defineProperty(
|
|
938
|
-
1 & this.f &&
|
|
939
|
-
var
|
|
940
|
-
if (this.h(),
|
|
1218
|
+
Object.defineProperty(V.prototype, "value", { get: function() {
|
|
1219
|
+
1 & this.f && $e();
|
|
1220
|
+
var n = Ft(this);
|
|
1221
|
+
if (this.h(), n !== void 0 && (n.i = this.i), 16 & this.f)
|
|
941
1222
|
throw this.v;
|
|
942
1223
|
return this.v;
|
|
943
1224
|
} });
|
|
944
|
-
function
|
|
945
|
-
return new
|
|
946
|
-
}
|
|
947
|
-
function
|
|
948
|
-
var e =
|
|
949
|
-
if (
|
|
950
|
-
|
|
951
|
-
var
|
|
952
|
-
|
|
1225
|
+
function Yt(n) {
|
|
1226
|
+
return new V(n);
|
|
1227
|
+
}
|
|
1228
|
+
function qt(n) {
|
|
1229
|
+
var e = n.u;
|
|
1230
|
+
if (n.u = void 0, typeof e == "function") {
|
|
1231
|
+
ee++;
|
|
1232
|
+
var t = w;
|
|
1233
|
+
w = void 0;
|
|
953
1234
|
try {
|
|
954
1235
|
e();
|
|
955
1236
|
} catch (i) {
|
|
956
|
-
throw
|
|
1237
|
+
throw n.f &= -2, n.f |= 8, Ye(n), i;
|
|
957
1238
|
} finally {
|
|
958
|
-
|
|
1239
|
+
w = t, je();
|
|
959
1240
|
}
|
|
960
1241
|
}
|
|
961
1242
|
}
|
|
962
|
-
function
|
|
963
|
-
for (var e =
|
|
1243
|
+
function Ye(n) {
|
|
1244
|
+
for (var e = n.s; e !== void 0; e = e.n)
|
|
964
1245
|
e.S.U(e);
|
|
965
|
-
|
|
1246
|
+
n.x = void 0, n.s = void 0, qt(n);
|
|
966
1247
|
}
|
|
967
|
-
function
|
|
968
|
-
if (
|
|
1248
|
+
function _n(n) {
|
|
1249
|
+
if (w !== this)
|
|
969
1250
|
throw new Error("Out-of-order effect");
|
|
970
|
-
|
|
1251
|
+
jt(this), w = n, this.f &= -2, 8 & this.f && Ye(this), je();
|
|
971
1252
|
}
|
|
972
|
-
function
|
|
973
|
-
this.x =
|
|
1253
|
+
function de(n) {
|
|
1254
|
+
this.x = n, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32;
|
|
974
1255
|
}
|
|
975
|
-
|
|
976
|
-
var
|
|
1256
|
+
de.prototype.c = function() {
|
|
1257
|
+
var n = this.S();
|
|
977
1258
|
try {
|
|
978
1259
|
if (8 & this.f || this.x === void 0)
|
|
979
1260
|
return;
|
|
980
1261
|
var e = this.x();
|
|
981
1262
|
typeof e == "function" && (this.u = e);
|
|
982
1263
|
} finally {
|
|
983
|
-
|
|
1264
|
+
n();
|
|
984
1265
|
}
|
|
985
1266
|
};
|
|
986
|
-
|
|
987
|
-
1 & this.f &&
|
|
988
|
-
var
|
|
989
|
-
return
|
|
1267
|
+
de.prototype.S = function() {
|
|
1268
|
+
1 & this.f && $e(), this.f |= 1, this.f &= -9, qt(this), Vt(this), ee++;
|
|
1269
|
+
var n = w;
|
|
1270
|
+
return w = this, _n.bind(this, n);
|
|
990
1271
|
};
|
|
991
|
-
|
|
992
|
-
2 & this.f || (this.f |= 2, this.o =
|
|
1272
|
+
de.prototype.N = function() {
|
|
1273
|
+
2 & this.f || (this.f |= 2, this.o = ae, ae = this);
|
|
993
1274
|
};
|
|
994
|
-
|
|
995
|
-
this.f |= 8, 1 & this.f ||
|
|
1275
|
+
de.prototype.d = function() {
|
|
1276
|
+
this.f |= 8, 1 & this.f || Ye(this);
|
|
996
1277
|
};
|
|
997
|
-
function
|
|
998
|
-
var e = new
|
|
1278
|
+
function Ne(n) {
|
|
1279
|
+
var e = new de(n);
|
|
999
1280
|
try {
|
|
1000
1281
|
e.c();
|
|
1001
|
-
} catch (
|
|
1002
|
-
throw e.d(),
|
|
1282
|
+
} catch (t) {
|
|
1283
|
+
throw e.d(), t;
|
|
1003
1284
|
}
|
|
1004
1285
|
return e.d.bind(e);
|
|
1005
1286
|
}
|
|
1006
|
-
var
|
|
1007
|
-
function
|
|
1008
|
-
|
|
1287
|
+
var xe, Me;
|
|
1288
|
+
function ie(n, e) {
|
|
1289
|
+
v[n] = e.bind(null, v[n] || function() {
|
|
1009
1290
|
});
|
|
1010
1291
|
}
|
|
1011
|
-
function
|
|
1012
|
-
|
|
1292
|
+
function Ee(n) {
|
|
1293
|
+
Me && Me(), Me = n && n.S();
|
|
1013
1294
|
}
|
|
1014
|
-
function
|
|
1015
|
-
var e = this,
|
|
1016
|
-
i.value =
|
|
1017
|
-
var s =
|
|
1018
|
-
for (var
|
|
1019
|
-
if (
|
|
1020
|
-
|
|
1295
|
+
function Xt(n) {
|
|
1296
|
+
var e = this, t = n.data, i = W(t);
|
|
1297
|
+
i.value = t;
|
|
1298
|
+
var s = G(function() {
|
|
1299
|
+
for (var o = e.__v; o = o.__; )
|
|
1300
|
+
if (o.__c) {
|
|
1301
|
+
o.__c.__$f |= 4;
|
|
1021
1302
|
break;
|
|
1022
1303
|
}
|
|
1023
1304
|
return e.__$u.c = function() {
|
|
1024
|
-
var
|
|
1025
|
-
|
|
1026
|
-
},
|
|
1027
|
-
var
|
|
1028
|
-
return
|
|
1305
|
+
var r;
|
|
1306
|
+
!$t(s.peek()) && ((r = e.base) == null ? void 0 : r.nodeType) === 3 ? e.base.data = s.peek() : (e.__$f |= 1, e.setState({}));
|
|
1307
|
+
}, Yt(function() {
|
|
1308
|
+
var r = i.value.value;
|
|
1309
|
+
return r === 0 ? 0 : r === !0 ? "" : r || "";
|
|
1029
1310
|
});
|
|
1030
1311
|
}, []);
|
|
1031
1312
|
return s.value;
|
|
1032
1313
|
}
|
|
1033
|
-
|
|
1034
|
-
Object.defineProperties(
|
|
1314
|
+
Xt.displayName = "_st";
|
|
1315
|
+
Object.defineProperties($.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Xt }, props: { configurable: !0, get: function() {
|
|
1035
1316
|
return { data: this };
|
|
1036
1317
|
} }, __b: { configurable: !0, value: 1 } });
|
|
1037
|
-
|
|
1318
|
+
ie("__b", function(n, e) {
|
|
1038
1319
|
if (typeof e.type == "string") {
|
|
1039
|
-
var
|
|
1320
|
+
var t, i = e.props;
|
|
1040
1321
|
for (var s in i)
|
|
1041
1322
|
if (s !== "children") {
|
|
1042
|
-
var
|
|
1043
|
-
|
|
1323
|
+
var o = i[s];
|
|
1324
|
+
o instanceof $ && (t || (e.__np = t = {}), t[s] = o, i[s] = o.peek());
|
|
1044
1325
|
}
|
|
1045
1326
|
}
|
|
1046
|
-
|
|
1327
|
+
n(e);
|
|
1047
1328
|
});
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
var
|
|
1051
|
-
i && (i.__$f &= -2, (
|
|
1052
|
-
var
|
|
1053
|
-
return
|
|
1054
|
-
|
|
1055
|
-
}),
|
|
1329
|
+
ie("__r", function(n, e) {
|
|
1330
|
+
Ee();
|
|
1331
|
+
var t, i = e.__c;
|
|
1332
|
+
i && (i.__$f &= -2, (t = i.__$u) === void 0 && (i.__$u = t = function(s) {
|
|
1333
|
+
var o;
|
|
1334
|
+
return Ne(function() {
|
|
1335
|
+
o = this;
|
|
1336
|
+
}), o.c = function() {
|
|
1056
1337
|
i.__$f |= 1, i.setState({});
|
|
1057
|
-
},
|
|
1058
|
-
}())),
|
|
1338
|
+
}, o;
|
|
1339
|
+
}())), xe = i, Ee(t), n(e);
|
|
1059
1340
|
});
|
|
1060
|
-
|
|
1061
|
-
|
|
1341
|
+
ie("__e", function(n, e, t, i) {
|
|
1342
|
+
Ee(), xe = void 0, n(e, t, i);
|
|
1062
1343
|
});
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
var
|
|
1066
|
-
if (typeof e.type == "string" && (
|
|
1344
|
+
ie("diffed", function(n, e) {
|
|
1345
|
+
Ee(), xe = void 0;
|
|
1346
|
+
var t;
|
|
1347
|
+
if (typeof e.type == "string" && (t = e.__e)) {
|
|
1067
1348
|
var i = e.__np, s = e.props;
|
|
1068
1349
|
if (i) {
|
|
1069
|
-
var
|
|
1070
|
-
if (
|
|
1071
|
-
for (var
|
|
1072
|
-
var
|
|
1073
|
-
|
|
1350
|
+
var o = t.U;
|
|
1351
|
+
if (o)
|
|
1352
|
+
for (var r in o) {
|
|
1353
|
+
var c = o[r];
|
|
1354
|
+
c !== void 0 && !(r in i) && (c.d(), o[r] = void 0);
|
|
1074
1355
|
}
|
|
1075
1356
|
else
|
|
1076
|
-
|
|
1077
|
-
for (var
|
|
1078
|
-
var
|
|
1079
|
-
|
|
1357
|
+
t.U = o = {};
|
|
1358
|
+
for (var u in i) {
|
|
1359
|
+
var d = o[u], h = i[u];
|
|
1360
|
+
d === void 0 ? (d = pn(t, u, h, s), o[u] = d) : d.o(h, s);
|
|
1080
1361
|
}
|
|
1081
1362
|
}
|
|
1082
1363
|
}
|
|
1083
|
-
|
|
1364
|
+
n(e);
|
|
1084
1365
|
});
|
|
1085
|
-
function
|
|
1086
|
-
var s = e in
|
|
1087
|
-
return { o: function(
|
|
1088
|
-
|
|
1089
|
-
}, d:
|
|
1090
|
-
var
|
|
1091
|
-
i[e] !==
|
|
1366
|
+
function pn(n, e, t, i) {
|
|
1367
|
+
var s = e in n && n.ownerSVGElement === void 0, o = ne(t);
|
|
1368
|
+
return { o: function(r, c) {
|
|
1369
|
+
o.value = r, i = c;
|
|
1370
|
+
}, d: Ne(function() {
|
|
1371
|
+
var r = o.value.value;
|
|
1372
|
+
i[e] !== r && (i[e] = r, s ? n[e] = r : r ? n.setAttribute(e, r) : n.removeAttribute(e));
|
|
1092
1373
|
}) };
|
|
1093
1374
|
}
|
|
1094
|
-
|
|
1375
|
+
ie("unmount", function(n, e) {
|
|
1095
1376
|
if (typeof e.type == "string") {
|
|
1096
|
-
var
|
|
1097
|
-
if (
|
|
1098
|
-
var i =
|
|
1377
|
+
var t = e.__e;
|
|
1378
|
+
if (t) {
|
|
1379
|
+
var i = t.U;
|
|
1099
1380
|
if (i) {
|
|
1100
|
-
|
|
1381
|
+
t.U = void 0;
|
|
1101
1382
|
for (var s in i) {
|
|
1102
|
-
var
|
|
1103
|
-
|
|
1383
|
+
var o = i[s];
|
|
1384
|
+
o && o.d();
|
|
1104
1385
|
}
|
|
1105
1386
|
}
|
|
1106
1387
|
}
|
|
1107
1388
|
} else {
|
|
1108
|
-
var
|
|
1109
|
-
if (
|
|
1110
|
-
var
|
|
1111
|
-
|
|
1389
|
+
var r = e.__c;
|
|
1390
|
+
if (r) {
|
|
1391
|
+
var c = r.__$u;
|
|
1392
|
+
c && (r.__$u = void 0, c.d());
|
|
1112
1393
|
}
|
|
1113
1394
|
}
|
|
1114
|
-
|
|
1395
|
+
n(e);
|
|
1115
1396
|
});
|
|
1116
|
-
|
|
1117
|
-
(i < 3 || i === 9) && (e.__$f |= 2),
|
|
1397
|
+
ie("__h", function(n, e, t, i) {
|
|
1398
|
+
(i < 3 || i === 9) && (e.__$f |= 2), n(e, t, i);
|
|
1118
1399
|
});
|
|
1119
|
-
M.prototype.shouldComponentUpdate = function(
|
|
1120
|
-
var
|
|
1121
|
-
if (!(
|
|
1400
|
+
M.prototype.shouldComponentUpdate = function(n, e) {
|
|
1401
|
+
var t = this.__$u;
|
|
1402
|
+
if (!(t && t.s !== void 0 || 4 & this.__$f) || 3 & this.__$f)
|
|
1122
1403
|
return !0;
|
|
1123
1404
|
for (var i in e)
|
|
1124
1405
|
return !0;
|
|
1125
|
-
for (var s in
|
|
1126
|
-
if (s !== "__source" &&
|
|
1406
|
+
for (var s in n)
|
|
1407
|
+
if (s !== "__source" && n[s] !== this.props[s])
|
|
1127
1408
|
return !0;
|
|
1128
|
-
for (var
|
|
1129
|
-
if (!(
|
|
1409
|
+
for (var o in this.props)
|
|
1410
|
+
if (!(o in n))
|
|
1130
1411
|
return !0;
|
|
1131
1412
|
return !1;
|
|
1132
1413
|
};
|
|
1133
|
-
function
|
|
1134
|
-
return
|
|
1135
|
-
return
|
|
1414
|
+
function W(n) {
|
|
1415
|
+
return G(function() {
|
|
1416
|
+
return ne(n);
|
|
1136
1417
|
}, []);
|
|
1137
1418
|
}
|
|
1138
|
-
function
|
|
1139
|
-
var e =
|
|
1140
|
-
return e.current =
|
|
1141
|
-
return
|
|
1419
|
+
function qe(n) {
|
|
1420
|
+
var e = Z(n);
|
|
1421
|
+
return e.current = n, xe.__$f |= 4, G(function() {
|
|
1422
|
+
return Yt(function() {
|
|
1142
1423
|
return e.current();
|
|
1143
1424
|
});
|
|
1144
1425
|
}, []);
|
|
1145
1426
|
}
|
|
1146
|
-
function
|
|
1147
|
-
var e =
|
|
1148
|
-
e.current =
|
|
1149
|
-
return
|
|
1427
|
+
function vn(n) {
|
|
1428
|
+
var e = Z(n);
|
|
1429
|
+
e.current = n, F(function() {
|
|
1430
|
+
return Ne(function() {
|
|
1150
1431
|
return e.current();
|
|
1151
1432
|
});
|
|
1152
1433
|
}, []);
|
|
1153
1434
|
}
|
|
1154
|
-
var
|
|
1155
|
-
function
|
|
1156
|
-
var
|
|
1157
|
-
for (
|
|
1158
|
-
|
|
1159
|
-
var
|
|
1160
|
-
if (typeof
|
|
1161
|
-
for (
|
|
1162
|
-
c
|
|
1163
|
-
return
|
|
1164
|
-
}
|
|
1165
|
-
const
|
|
1435
|
+
var mn = 0;
|
|
1436
|
+
function l(n, e, t, i, s, o) {
|
|
1437
|
+
var r, c, u = {};
|
|
1438
|
+
for (c in e)
|
|
1439
|
+
c == "ref" ? r = e[c] : u[c] = e[c];
|
|
1440
|
+
var d = { type: n, props: u, key: t, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --mn, __source: s, __self: o };
|
|
1441
|
+
if (typeof n == "function" && (r = n.defaultProps))
|
|
1442
|
+
for (c in r)
|
|
1443
|
+
u[c] === void 0 && (u[c] = r[c]);
|
|
1444
|
+
return v.vnode && v.vnode(d), d;
|
|
1445
|
+
}
|
|
1446
|
+
const gn = () => l("svg", {
|
|
1166
1447
|
viewBox: "0 0 1024 1024",
|
|
1167
1448
|
version: "1.1",
|
|
1168
1449
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1169
|
-
children:
|
|
1450
|
+
children: l("path", {
|
|
1170
1451
|
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"
|
|
1171
1452
|
})
|
|
1172
|
-
}),
|
|
1453
|
+
}), yn = () => l("svg", {
|
|
1173
1454
|
className: "icon",
|
|
1174
1455
|
viewBox: "0 0 1024 1024",
|
|
1175
1456
|
version: "1.1",
|
|
1176
1457
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1177
|
-
children:
|
|
1458
|
+
children: l("path", {
|
|
1178
1459
|
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"
|
|
1179
1460
|
})
|
|
1180
|
-
}),
|
|
1461
|
+
}), bn = () => l("svg", {
|
|
1181
1462
|
viewBox: "0 0 1024 1024",
|
|
1182
1463
|
version: "1.1",
|
|
1183
1464
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1184
|
-
children:
|
|
1465
|
+
children: l("path", {
|
|
1185
1466
|
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"
|
|
1186
1467
|
})
|
|
1187
|
-
}),
|
|
1468
|
+
}), wn = () => l("svg", {
|
|
1188
1469
|
viewBox: "0 0 1024 1024",
|
|
1189
1470
|
version: "1.1",
|
|
1190
1471
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1191
|
-
children:
|
|
1472
|
+
children: l("path", {
|
|
1192
1473
|
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"
|
|
1193
1474
|
})
|
|
1194
|
-
}),
|
|
1475
|
+
}), ct = () => l("svg", {
|
|
1195
1476
|
viewBox: "0 0 1024 1024",
|
|
1196
1477
|
version: "1.1",
|
|
1197
1478
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1198
|
-
children:
|
|
1479
|
+
children: l("path", {
|
|
1199
1480
|
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"
|
|
1200
1481
|
})
|
|
1201
|
-
}),
|
|
1482
|
+
}), Cn = () => l("svg", {
|
|
1202
1483
|
viewBox: "0 0 1024 1024",
|
|
1203
1484
|
version: "1.1",
|
|
1204
1485
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1205
|
-
children:
|
|
1486
|
+
children: l("path", {
|
|
1206
1487
|
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"
|
|
1207
1488
|
})
|
|
1208
|
-
}),
|
|
1489
|
+
}), Tn = () => l("svg", {
|
|
1209
1490
|
viewBox: "0 0 1024 1024",
|
|
1210
1491
|
version: "1.1",
|
|
1211
1492
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1212
|
-
children:
|
|
1493
|
+
children: l("path", {
|
|
1213
1494
|
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"
|
|
1214
1495
|
})
|
|
1215
|
-
}),
|
|
1496
|
+
}), En = () => l("svg", {
|
|
1216
1497
|
viewBox: "0 0 1024 1024",
|
|
1217
1498
|
version: "1.1",
|
|
1218
1499
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1219
|
-
children:
|
|
1500
|
+
children: l("path", {
|
|
1220
1501
|
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"
|
|
1221
1502
|
})
|
|
1503
|
+
}), Sn = () => l("svg", {
|
|
1504
|
+
viewBox: "0 0 1024 1024",
|
|
1505
|
+
version: "1.1",
|
|
1506
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1507
|
+
children: l("path", {
|
|
1508
|
+
d: "M960 544H64a32 32 0 1 1 0-64h896a32 32 0 1 1 0 64"
|
|
1509
|
+
})
|
|
1510
|
+
}), kn = () => l("svg", {
|
|
1511
|
+
viewBox: "0 0 1024 1024",
|
|
1512
|
+
version: "1.1",
|
|
1513
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1514
|
+
children: [l("path", {
|
|
1515
|
+
d: "M481.0752 263.3728l50.9952 1.024 1.8432-105.8816-50.9952-0.8192z"
|
|
1516
|
+
}), l("path", {
|
|
1517
|
+
d: "M486.441426 180.895362a66.56 66.56 0 1 0 42.091944-126.290153 66.56 66.56 0 1 0-42.091944 126.290153Z"
|
|
1518
|
+
}), l("path", {
|
|
1519
|
+
d: "M138.8544 664.3712c-52.8384 0-95.8464-43.008-95.8464-95.8464s43.008-95.8464 95.8464-95.8464M880.0256 472.6784c52.8384 0 95.8464 43.008 95.8464 95.8464s-43.008 95.8464-95.8464 95.8464"
|
|
1520
|
+
}), l("path", {
|
|
1521
|
+
d: "M507.4944 220.5696c-220.16 0-398.7456 162.816-398.7456 363.7248s178.5856 363.7248 398.7456 363.7248 398.7456-162.816 398.7456-363.7248-178.5856-363.7248-398.7456-363.7248z m0 559.9232c-166.2976 0-301.2608-100.5568-301.2608-224.4608s134.9632-224.4608 301.2608-224.4608S808.7552 432.128 808.7552 556.032 673.792 780.4928 507.4944 780.4928z"
|
|
1522
|
+
}), l("path", {
|
|
1523
|
+
d: "M319.6928 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"
|
|
1524
|
+
}), l("path", {
|
|
1525
|
+
d: "M617.472 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"
|
|
1526
|
+
})]
|
|
1527
|
+
}), $n = () => l("svg", {
|
|
1528
|
+
viewBox: "0 0 18 18",
|
|
1529
|
+
fill: "none",
|
|
1530
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1531
|
+
children: [l("path", {
|
|
1532
|
+
d: "M5.856 17.121a.979.979 0 0 1-.327-.06.839.839 0 0 1-.283-.177.739.739 0 0 1-.187-.255.724.724 0 0 1-.07-.303l-.02-1.609a4.663 4.663 0 0 1-1.446-.455 4.252 4.252 0 0 1-.637-.401c-.199-.146-.385-.31-.553-.492a4.442 4.442 0 0 1-.45-.577 4.303 4.303 0 0 1-.327-.637 3.823 3.823 0 0 1-.206-.686 3.729 3.729 0 0 1-.064-.704V6.478c0-.261.025-.516.077-.771a4.43 4.43 0 0 1 .244-.747 4.062 4.062 0 0 1 .932-1.28c.2-.183.418-.347.65-.493.23-.145.482-.267.739-.364a4.21 4.21 0 0 1 .81-.225c.27-.054.553-.078.835-.078H8.55c.103 0 .2.018.29.054a.7.7 0 0 1 .411.376.667.667 0 0 1-.161.766.736.736 0 0 1-.25.151.764.764 0 0 1-.29.055H5.573c-.186 0-.366.012-.54.049-.18.03-.353.079-.52.145-.167.061-.328.14-.482.237-.148.091-.29.2-.418.316a2.897 2.897 0 0 0-.347.388c-.097.14-.187.286-.257.444a2.473 2.473 0 0 0-.206.977v4.287c0 .17.013.333.051.503a2.549 2.549 0 0 0 .772 1.33 2.721 2.721 0 0 0 .913.559c.167.066.347.115.527.152.18.03.36.048.546.048a.904.904 0 0 1 .61.23.848.848 0 0 1 .194.262.84.84 0 0 1 .07.303l.007.99 1.915-1.293a2.877 2.877 0 0 1 1.64-.492h2.372c.186 0 .366-.018.54-.048.18-.03.353-.08.52-.146.168-.067.329-.146.483-.237.148-.091.29-.2.418-.316.128-.121.244-.249.347-.388a2.8 2.8 0 0 0 .257-.444 2.47 2.47 0 0 0 .206-.977V8.585a.646.646 0 0 1 .225-.492.679.679 0 0 1 .244-.152.814.814 0 0 1 .585 0c.09.03.174.085.244.152a.657.657 0 0 1 .225.492V10.8c0 .261-.032.516-.083.771a4.192 4.192 0 0 1-.245.74c-.109.244-.244.468-.398.687a3.735 3.735 0 0 1-.534.6c-.2.183-.418.347-.65.493a4.134 4.134 0 0 1-.738.364 4.7 4.7 0 0 1-.81.225c-.27.054-.553.079-.836.079h-1.877c-.604 0-1.144.164-1.633.491l-2.54 1.713a.913.913 0 0 1-.514.157z",
|
|
1533
|
+
fill: "currentColor"
|
|
1534
|
+
}), l("path", {
|
|
1535
|
+
d: "M15.866 4.125h-4.174c-.41 0-.741.313-.741.7 0 .387.332.7.741.7h4.174c.41 0 .742-.313.742-.7 0-.387-.332-.7-.742-.7z",
|
|
1536
|
+
fill: "currentColor"
|
|
1537
|
+
}), l("path", {
|
|
1538
|
+
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",
|
|
1539
|
+
fill: "currentColor"
|
|
1540
|
+
})]
|
|
1541
|
+
}), Nn = () => l("svg", {
|
|
1542
|
+
viewBox: "64 64 896 896",
|
|
1543
|
+
focusable: "false",
|
|
1544
|
+
width: "1em",
|
|
1545
|
+
height: "1em",
|
|
1546
|
+
fill: "currentColor",
|
|
1547
|
+
"aria-hidden": "true",
|
|
1548
|
+
children: l("path", {
|
|
1549
|
+
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"
|
|
1550
|
+
})
|
|
1551
|
+
}), xn = () => l("svg", {
|
|
1552
|
+
fill: "currentColor",
|
|
1553
|
+
viewBox: "0 0 1000 1000",
|
|
1554
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1555
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1556
|
+
children: Array.from({
|
|
1557
|
+
length: 4
|
|
1558
|
+
}).map((c, u) => {
|
|
1559
|
+
const h = u * (146.66666666666666 + 140), a = 1e3 / 2 - 250 / 2, _ = 1e3 / 2 - 500 / 2;
|
|
1560
|
+
return l("rect", {
|
|
1561
|
+
fill: "currentColor",
|
|
1562
|
+
rx: 70,
|
|
1563
|
+
ry: 70,
|
|
1564
|
+
height: 250,
|
|
1565
|
+
width: 140,
|
|
1566
|
+
x: h,
|
|
1567
|
+
y: a,
|
|
1568
|
+
children: [l("animate", {
|
|
1569
|
+
attributeName: "height",
|
|
1570
|
+
values: "250; 500; 250",
|
|
1571
|
+
keyTimes: "0; 0.5; 1",
|
|
1572
|
+
dur: "".concat(0.8, "s"),
|
|
1573
|
+
begin: "".concat(0.8 / 4 * u, "s"),
|
|
1574
|
+
repeatCount: "indefinite"
|
|
1575
|
+
}), l("animate", {
|
|
1576
|
+
attributeName: "y",
|
|
1577
|
+
values: "".concat(a, "; ").concat(_, "; ").concat(a),
|
|
1578
|
+
keyTimes: "0; 0.5; 1",
|
|
1579
|
+
dur: "".concat(0.8, "s"),
|
|
1580
|
+
begin: "".concat(0.8 / 4 * u, "s"),
|
|
1581
|
+
repeatCount: "indefinite"
|
|
1582
|
+
})]
|
|
1583
|
+
}, u);
|
|
1584
|
+
})
|
|
1585
|
+
}), An = (n) => l("svg", {
|
|
1586
|
+
className: n.className,
|
|
1587
|
+
onClick: n.onClick,
|
|
1588
|
+
viewBox: "0 0 1024 1024",
|
|
1589
|
+
version: "1.1",
|
|
1590
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1591
|
+
children: l("path", {
|
|
1592
|
+
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"
|
|
1593
|
+
})
|
|
1594
|
+
}), In = (n) => l("svg", {
|
|
1595
|
+
className: n.className,
|
|
1596
|
+
viewBox: "0 0 1024 1024",
|
|
1597
|
+
version: "1.1",
|
|
1598
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1599
|
+
children: l("path", {
|
|
1600
|
+
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"
|
|
1601
|
+
})
|
|
1602
|
+
}), Dn = (n) => l("svg", {
|
|
1603
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1604
|
+
className: n.className,
|
|
1605
|
+
viewBox: "0 0 512 512",
|
|
1606
|
+
children: l("path", {
|
|
1607
|
+
fill: "none",
|
|
1608
|
+
stroke: "currentColor",
|
|
1609
|
+
strokeLinecap: "round",
|
|
1610
|
+
strokeLinejoin: "round",
|
|
1611
|
+
strokeWidth: "48",
|
|
1612
|
+
d: "M112 184l144 144 144-144"
|
|
1613
|
+
})
|
|
1614
|
+
}), lt = (n) => l("svg", {
|
|
1615
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1616
|
+
className: "".concat(n.className, " icon"),
|
|
1617
|
+
viewBox: "0 0 512 512",
|
|
1618
|
+
children: l("path", {
|
|
1619
|
+
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"
|
|
1620
|
+
})
|
|
1621
|
+
}), ze = (n) => l("svg", {
|
|
1622
|
+
className: n.className,
|
|
1623
|
+
width: "16",
|
|
1624
|
+
height: "16",
|
|
1625
|
+
viewBox: "0 0 50 50",
|
|
1626
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1627
|
+
children: l("circle", {
|
|
1628
|
+
cx: "25",
|
|
1629
|
+
cy: "25",
|
|
1630
|
+
r: "20",
|
|
1631
|
+
stroke: "currentColor",
|
|
1632
|
+
strokeWidth: "5",
|
|
1633
|
+
fill: "none",
|
|
1634
|
+
strokeDasharray: "31.415, 31.415",
|
|
1635
|
+
strokeLinecap: "round",
|
|
1636
|
+
children: l("animateTransform", {
|
|
1637
|
+
attributeName: "transform",
|
|
1638
|
+
type: "rotate",
|
|
1639
|
+
from: "0 25 25",
|
|
1640
|
+
to: "360 25 25",
|
|
1641
|
+
dur: "1s",
|
|
1642
|
+
repeatCount: "indefinite"
|
|
1643
|
+
})
|
|
1644
|
+
})
|
|
1222
1645
|
});
|
|
1223
|
-
const
|
|
1646
|
+
const Mn = (n) => {
|
|
1647
|
+
const {
|
|
1648
|
+
items: e
|
|
1649
|
+
} = n, t = W([]), i = new A("chat-thought-chain"), s = W([]);
|
|
1650
|
+
F(() => {
|
|
1651
|
+
s.value = e.filter((r) => r.description), s.value.length > 0 && s.value.forEach((r, c) => {
|
|
1652
|
+
r.done && (t.value = [...t.value, c]);
|
|
1653
|
+
});
|
|
1654
|
+
}, [e]);
|
|
1655
|
+
const o = (r) => {
|
|
1656
|
+
t.value.includes(r) ? t.value = t.value.filter((c) => c !== r) : t.value = [...t.value, r];
|
|
1657
|
+
};
|
|
1658
|
+
return s.value.length === 0 ? null : l("div", {
|
|
1659
|
+
className: "".concat(i.b(), " ").concat(i.is("single", s.value.length === 1)),
|
|
1660
|
+
children: s.value.map((r, c) => {
|
|
1661
|
+
if (!r.description)
|
|
1662
|
+
return;
|
|
1663
|
+
const u = t.value.includes(c);
|
|
1664
|
+
return l("div", {
|
|
1665
|
+
className: "".concat(i.e("item"), " ").concat(i.is("collapsed", u)),
|
|
1666
|
+
children: [l("div", {
|
|
1667
|
+
className: i.e("item-icon"),
|
|
1668
|
+
children: r.icon || l("span", {
|
|
1669
|
+
children: c
|
|
1670
|
+
})
|
|
1671
|
+
}), l("div", {
|
|
1672
|
+
className: i.e("item-content"),
|
|
1673
|
+
children: [l("div", {
|
|
1674
|
+
className: i.e("item-title"),
|
|
1675
|
+
onClick: () => o(c),
|
|
1676
|
+
children: [r.title, l(Dn, {
|
|
1677
|
+
className: i.e("icon")
|
|
1678
|
+
})]
|
|
1679
|
+
}), l("div", {
|
|
1680
|
+
className: i.e("item-description"),
|
|
1681
|
+
children: r.description
|
|
1682
|
+
})]
|
|
1683
|
+
})]
|
|
1684
|
+
}, c);
|
|
1685
|
+
})
|
|
1686
|
+
});
|
|
1687
|
+
}, Y = new A("markdown-message"), zn = (n) => {
|
|
1224
1688
|
const {
|
|
1225
1689
|
message: e,
|
|
1226
|
-
size:
|
|
1227
|
-
} =
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1690
|
+
size: t
|
|
1691
|
+
} = n, i = W(Lt()), s = W(null), o = G(() => e.state === 20 && e.completed !== !0, [e.state, e.completed]), r = G(() => e.state === 20 && e.completed === !0, [e.state, e.completed]), c = W({
|
|
1692
|
+
title: "思考过程",
|
|
1693
|
+
description: "",
|
|
1694
|
+
icon: l(ze, {})
|
|
1695
|
+
}), u = (d) => {
|
|
1696
|
+
const h = d.indexOf("<think>"), a = d.indexOf("</think>");
|
|
1697
|
+
let _ = "", p = "", f = !1;
|
|
1698
|
+
return a === -1 ? (f = !1, _ = d.slice(h + 7), p = "") : (f = !0, _ = d.slice(h + 7, a), p = d.slice(a + 8)), {
|
|
1699
|
+
isThoughtCompleted: f,
|
|
1700
|
+
thoughtContent: _,
|
|
1701
|
+
answerContent: p
|
|
1702
|
+
};
|
|
1703
|
+
};
|
|
1704
|
+
return F(() => {
|
|
1705
|
+
if (t >= 0 && s.value)
|
|
1706
|
+
if (e.content.indexOf("<think>") !== -1) {
|
|
1707
|
+
const {
|
|
1708
|
+
isThoughtCompleted: d,
|
|
1709
|
+
thoughtContent: h,
|
|
1710
|
+
answerContent: a
|
|
1711
|
+
} = u(e.content);
|
|
1712
|
+
d && (c.value.icon = d ? l(lt, {}) : l(ze, {})), h && (c.value.description = h), a && s.value.setMarkdown(a);
|
|
1713
|
+
} else
|
|
1714
|
+
s.value.setMarkdown(e.content);
|
|
1715
|
+
}, [e, t]), F(() => {
|
|
1716
|
+
let d = "";
|
|
1717
|
+
if (e.content.indexOf("<think>") !== -1) {
|
|
1718
|
+
const {
|
|
1719
|
+
isThoughtCompleted: h,
|
|
1720
|
+
thoughtContent: a,
|
|
1721
|
+
answerContent: _
|
|
1722
|
+
} = u(e.content);
|
|
1723
|
+
c.value = {
|
|
1724
|
+
title: "思考过程",
|
|
1725
|
+
description: a || "",
|
|
1726
|
+
icon: h ? l(lt, {}) : l(ze, {})
|
|
1727
|
+
}, _ && (d = _);
|
|
1728
|
+
} else
|
|
1729
|
+
d = e.content;
|
|
1730
|
+
s.value = new en({
|
|
1232
1731
|
id: i,
|
|
1233
|
-
value:
|
|
1732
|
+
value: d || "",
|
|
1234
1733
|
editor: {
|
|
1235
1734
|
defaultModel: "previewOnly"
|
|
1236
1735
|
}
|
|
1237
1736
|
});
|
|
1238
|
-
}, [])
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
t.controller.refreshMessage(e);
|
|
1245
|
-
}, c = () => {
|
|
1246
|
-
t.controller.copyMessage(e);
|
|
1247
|
-
};
|
|
1248
|
-
return u("div", {
|
|
1249
|
-
className: "".concat(S.b(), " ").concat(S.is("loading", e.state === 20)),
|
|
1250
|
-
children: [u("div", {
|
|
1251
|
-
className: S.b("header"),
|
|
1252
|
-
children: [u("div", {
|
|
1253
|
-
className: S.be("header", "caption"),
|
|
1737
|
+
}, []), l("div", {
|
|
1738
|
+
className: "".concat(Y.b(), " ").concat(Y.is("loading", o)),
|
|
1739
|
+
children: [l("div", {
|
|
1740
|
+
className: Y.b("header"),
|
|
1741
|
+
children: [l("div", {
|
|
1742
|
+
className: Y.be("header", "caption"),
|
|
1254
1743
|
children: "AI "
|
|
1255
|
-
}),
|
|
1256
|
-
className:
|
|
1257
|
-
children:
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
}), u("div", {
|
|
1265
|
-
className: S.be("header", "action-item"),
|
|
1266
|
-
onClick: l,
|
|
1267
|
-
children: [u(Ue, {}), u("span", {
|
|
1268
|
-
className: S.bem("header", "action-item", "title"),
|
|
1269
|
-
children: "刷新"
|
|
1270
|
-
})]
|
|
1271
|
-
}), u("div", {
|
|
1272
|
-
className: S.be("header", "action-item"),
|
|
1273
|
-
onClick: o,
|
|
1274
|
-
children: [u(Tt, {}), u("span", {
|
|
1275
|
-
className: S.bem("header", "action-item", "title"),
|
|
1276
|
-
children: "删除"
|
|
1277
|
-
})]
|
|
1278
|
-
}), u("div", {
|
|
1279
|
-
className: S.be("header", "action-item"),
|
|
1280
|
-
onClick: c,
|
|
1281
|
-
children: [u(Lt, {}), u("span", {
|
|
1282
|
-
className: S.bem("header", "action-item", "title"),
|
|
1283
|
-
children: "复制"
|
|
1284
|
-
})]
|
|
1285
|
-
})]
|
|
1286
|
-
})]
|
|
1287
|
-
}), u("div", {
|
|
1288
|
-
className: "".concat(S.b("content"), " pre-wrap-container"),
|
|
1289
|
-
children: u("div", {
|
|
1744
|
+
}), n.children, r ? l("div", {
|
|
1745
|
+
className: Y.be("header", "timeout"),
|
|
1746
|
+
children: "请求超时"
|
|
1747
|
+
}) : null]
|
|
1748
|
+
}), l("div", {
|
|
1749
|
+
className: "".concat(Y.b("content"), " pre-wrap-container"),
|
|
1750
|
+
children: [l(Mn, {
|
|
1751
|
+
items: [c.value]
|
|
1752
|
+
}), l("div", {
|
|
1290
1753
|
id: i
|
|
1291
|
-
})
|
|
1292
|
-
}),
|
|
1293
|
-
className:
|
|
1754
|
+
})]
|
|
1755
|
+
}), l("div", {
|
|
1756
|
+
className: Y.b("footer")
|
|
1294
1757
|
})]
|
|
1295
1758
|
});
|
|
1296
1759
|
};
|
|
1297
|
-
const
|
|
1298
|
-
const e =
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
children: [u("div", {
|
|
1306
|
-
className: O.e("user-action"),
|
|
1307
|
-
onClick: n,
|
|
1308
|
-
children: [u(Ue, {}), u("span", {
|
|
1309
|
-
className: O.em("user-action", "title"),
|
|
1310
|
-
children: "刷新"
|
|
1311
|
-
})]
|
|
1312
|
-
}), u("div", {
|
|
1313
|
-
className: O.e("user"),
|
|
1760
|
+
const se = new A("user-message-question"), Hn = (n) => {
|
|
1761
|
+
const e = qe(() => n.message.content);
|
|
1762
|
+
return l("div", {
|
|
1763
|
+
className: se.b(),
|
|
1764
|
+
children: [l("div", {
|
|
1765
|
+
className: se.e("user-header"),
|
|
1766
|
+
children: [n.children, l("div", {
|
|
1767
|
+
className: se.e("user"),
|
|
1314
1768
|
children: "我"
|
|
1315
1769
|
})]
|
|
1316
|
-
}),
|
|
1317
|
-
className:
|
|
1318
|
-
children:
|
|
1770
|
+
}), l("div", {
|
|
1771
|
+
className: se.e("content"),
|
|
1772
|
+
children: l("div", {
|
|
1319
1773
|
dir: "auto",
|
|
1320
|
-
className:
|
|
1321
|
-
children:
|
|
1774
|
+
className: se.em("content", "body"),
|
|
1775
|
+
children: l("p", {
|
|
1322
1776
|
dir: "auto",
|
|
1323
1777
|
className: "pre-wrap-container",
|
|
1324
1778
|
children: e
|
|
@@ -1327,454 +1781,752 @@ const O = new U("user-message-question"), un = (t) => {
|
|
|
1327
1781
|
})]
|
|
1328
1782
|
});
|
|
1329
1783
|
};
|
|
1330
|
-
const
|
|
1331
|
-
const e =
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
t.controller.copyMessage(t.message);
|
|
1339
|
-
};
|
|
1340
|
-
return u("div", {
|
|
1341
|
-
className: x.b(),
|
|
1342
|
-
children: [u("div", {
|
|
1343
|
-
className: x.b("header"),
|
|
1344
|
-
children: [u("div", {
|
|
1345
|
-
className: x.be("header", "caption"),
|
|
1784
|
+
const _e = new A("error-message"), Ln = (n) => {
|
|
1785
|
+
const e = qe(() => n.message.content);
|
|
1786
|
+
return l("div", {
|
|
1787
|
+
className: _e.b(),
|
|
1788
|
+
children: [l("div", {
|
|
1789
|
+
className: _e.b("header"),
|
|
1790
|
+
children: [l("div", {
|
|
1791
|
+
className: _e.be("header", "caption"),
|
|
1346
1792
|
children: "AI "
|
|
1347
|
-
}),
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
onClick: n,
|
|
1352
|
-
children: [u(Rt, {}), u("span", {
|
|
1353
|
-
className: x.bem("header", "action-item", "title"),
|
|
1354
|
-
children: "回填"
|
|
1355
|
-
})]
|
|
1356
|
-
}), u("div", {
|
|
1357
|
-
className: x.be("header", "action-item"),
|
|
1358
|
-
onClick: s,
|
|
1359
|
-
children: [u(Ue, {}), u("span", {
|
|
1360
|
-
className: x.bem("header", "action-item", "title"),
|
|
1361
|
-
children: "刷新"
|
|
1362
|
-
})]
|
|
1363
|
-
}), u("div", {
|
|
1364
|
-
className: x.be("header", "action-item"),
|
|
1365
|
-
onClick: i,
|
|
1366
|
-
children: [u(Tt, {}), u("span", {
|
|
1367
|
-
className: x.bem("header", "action-item", "title"),
|
|
1368
|
-
children: "删除"
|
|
1369
|
-
})]
|
|
1370
|
-
}), u("div", {
|
|
1371
|
-
className: x.be("header", "action-item"),
|
|
1372
|
-
onClick: r,
|
|
1373
|
-
children: [u(Lt, {}), u("span", {
|
|
1374
|
-
className: x.bem("header", "action-item", "title"),
|
|
1375
|
-
children: "复制"
|
|
1376
|
-
})]
|
|
1377
|
-
})]
|
|
1378
|
-
})]
|
|
1379
|
-
}), u("div", {
|
|
1380
|
-
className: "".concat(x.e("content"), " pre-wrap-container"),
|
|
1381
|
-
children: u("span", {
|
|
1793
|
+
}), n.children]
|
|
1794
|
+
}), l("div", {
|
|
1795
|
+
className: "".concat(_e.e("content"), " pre-wrap-container"),
|
|
1796
|
+
children: l("span", {
|
|
1382
1797
|
children: e
|
|
1383
1798
|
})
|
|
1384
1799
|
})]
|
|
1385
1800
|
});
|
|
1386
1801
|
};
|
|
1387
|
-
const
|
|
1388
|
-
className:
|
|
1389
|
-
children:
|
|
1390
|
-
className: "".concat(
|
|
1391
|
-
children: ["暂未支持的消息类型: ",
|
|
1802
|
+
const ut = new A("unknown-message"), Rn = (n) => l("div", {
|
|
1803
|
+
className: ut.b(),
|
|
1804
|
+
children: l("span", {
|
|
1805
|
+
className: "".concat(ut.e("content"), " pre-wrap-container"),
|
|
1806
|
+
children: ["暂未支持的消息类型: ", n.message.type]
|
|
1392
1807
|
})
|
|
1393
|
-
})
|
|
1808
|
+
});
|
|
1809
|
+
const On = new A("chat-message-item"), Pn = (n) => {
|
|
1394
1810
|
const {
|
|
1395
1811
|
message: e,
|
|
1396
|
-
size:
|
|
1397
|
-
} =
|
|
1812
|
+
size: t
|
|
1813
|
+
} = n;
|
|
1398
1814
|
let i = null;
|
|
1399
1815
|
switch (e.type) {
|
|
1400
1816
|
case "DEFAULT":
|
|
1401
|
-
i = e.role === "ASSISTANT" ?
|
|
1817
|
+
i = e.role === "ASSISTANT" ? zn : Hn;
|
|
1402
1818
|
break;
|
|
1403
1819
|
case "ERROR":
|
|
1404
|
-
i =
|
|
1820
|
+
i = Ln;
|
|
1405
1821
|
break;
|
|
1406
1822
|
default:
|
|
1407
|
-
i =
|
|
1823
|
+
i = Rn;
|
|
1408
1824
|
}
|
|
1409
|
-
return
|
|
1410
|
-
className:
|
|
1411
|
-
children:
|
|
1412
|
-
size:
|
|
1825
|
+
return l("div", {
|
|
1826
|
+
className: On.b(),
|
|
1827
|
+
children: H(i, {
|
|
1828
|
+
size: t,
|
|
1413
1829
|
message: e,
|
|
1414
|
-
controller:
|
|
1830
|
+
controller: n.controller,
|
|
1831
|
+
children: n.children
|
|
1832
|
+
})
|
|
1833
|
+
});
|
|
1834
|
+
};
|
|
1835
|
+
const J = new A("chat-toolbar"), Ue = (n) => {
|
|
1836
|
+
const {
|
|
1837
|
+
controller: e,
|
|
1838
|
+
items: t = [],
|
|
1839
|
+
data: i,
|
|
1840
|
+
type: s,
|
|
1841
|
+
className: o
|
|
1842
|
+
} = n;
|
|
1843
|
+
let r = [], c = "default";
|
|
1844
|
+
const u = [{
|
|
1845
|
+
label: "新建对话",
|
|
1846
|
+
title: "新建对话",
|
|
1847
|
+
icon: l($n, {}),
|
|
1848
|
+
onClick: () => {
|
|
1849
|
+
e.newDialogue();
|
|
1850
|
+
}
|
|
1851
|
+
}], d = [{
|
|
1852
|
+
label: "回填",
|
|
1853
|
+
title: "回填",
|
|
1854
|
+
icon: l(yn, {}),
|
|
1855
|
+
onClick: () => {
|
|
1856
|
+
e.backfill(i);
|
|
1857
|
+
}
|
|
1858
|
+
}, {
|
|
1859
|
+
label: "刷新",
|
|
1860
|
+
title: "刷新",
|
|
1861
|
+
icon: l(ct, {}),
|
|
1862
|
+
onClick: () => {
|
|
1863
|
+
e.refreshMessage(i);
|
|
1864
|
+
}
|
|
1865
|
+
}, {
|
|
1866
|
+
label: "删除",
|
|
1867
|
+
title: "删除",
|
|
1868
|
+
icon: l(wn, {}),
|
|
1869
|
+
onClick: () => {
|
|
1870
|
+
e.deleteMessage(i);
|
|
1871
|
+
}
|
|
1872
|
+
}, {
|
|
1873
|
+
label: "复制",
|
|
1874
|
+
title: "复制",
|
|
1875
|
+
icon: l(Cn, {}),
|
|
1876
|
+
onClick: () => {
|
|
1877
|
+
e.copyMessage(i);
|
|
1878
|
+
}
|
|
1879
|
+
}], h = [{
|
|
1880
|
+
label: "刷新",
|
|
1881
|
+
title: "刷新",
|
|
1882
|
+
icon: l(ct, {}),
|
|
1883
|
+
onClick: () => {
|
|
1884
|
+
e.refreshMessage(i, !0);
|
|
1885
|
+
}
|
|
1886
|
+
}];
|
|
1887
|
+
if (s === "content")
|
|
1888
|
+
switch (c = "circle", i.type) {
|
|
1889
|
+
case "DEFAULT":
|
|
1890
|
+
i.role === "ASSISTANT" ? r = [...d, ...t] : r = [...h];
|
|
1891
|
+
break;
|
|
1892
|
+
case "ERROR":
|
|
1893
|
+
r = [...d, ...t];
|
|
1894
|
+
break;
|
|
1895
|
+
}
|
|
1896
|
+
else
|
|
1897
|
+
r = [...u, ...t];
|
|
1898
|
+
const a = (f) => typeof f.hidden == "function" ? f.hidden(i) : f.hidden === !0, _ = (f) => typeof f.disabled == "function" ? f.disabled(i) : f.disabled === !0, p = (f, g) => {
|
|
1899
|
+
var N;
|
|
1900
|
+
_(g) || (N = g.onClick) == null || N.call(g, f, e.context, e.params, i);
|
|
1901
|
+
};
|
|
1902
|
+
return l("div", {
|
|
1903
|
+
className: "".concat(J.b(), " ").concat(J.e(c), " ").concat(o || ""),
|
|
1904
|
+
children: r.map((f, g) => {
|
|
1905
|
+
if (!a(f))
|
|
1906
|
+
return l("div", {
|
|
1907
|
+
className: "".concat(J.e("item"), " ").concat(J.is("disabled", _(f)), " ").concat(o || ""),
|
|
1908
|
+
title: f.title,
|
|
1909
|
+
onClick: (N) => p(N, f),
|
|
1910
|
+
children: [l("div", {
|
|
1911
|
+
className: "".concat(J.em("item", "icon")),
|
|
1912
|
+
children: typeof f.icon == "function" ? f.icon(H) : f.icon
|
|
1913
|
+
}), l("div", {
|
|
1914
|
+
className: "".concat(J.em("item", "label")),
|
|
1915
|
+
children: typeof f.label == "function" ? f.label(H) : f.label
|
|
1916
|
+
})]
|
|
1917
|
+
}, g);
|
|
1415
1918
|
})
|
|
1416
1919
|
});
|
|
1417
1920
|
};
|
|
1418
|
-
const
|
|
1419
|
-
const e =
|
|
1420
|
-
return
|
|
1421
|
-
e.current &&
|
|
1422
|
-
}),
|
|
1921
|
+
const Bn = new A("chat-messages"), ht = (n) => {
|
|
1922
|
+
const e = Z(null), t = n.controller.messages;
|
|
1923
|
+
return vn(() => {
|
|
1924
|
+
e.current && t.value.length > 0 && (e.current.scrollTop = e.current.scrollHeight);
|
|
1925
|
+
}), l("div", {
|
|
1423
1926
|
ref: e,
|
|
1424
|
-
className:
|
|
1425
|
-
children:
|
|
1426
|
-
var
|
|
1427
|
-
const s = ((
|
|
1428
|
-
return
|
|
1429
|
-
message: i,
|
|
1927
|
+
className: Bn.b(),
|
|
1928
|
+
children: t.value.map((i) => {
|
|
1929
|
+
var o;
|
|
1930
|
+
const s = ((o = i.content) == null ? void 0 : o.length) || 0;
|
|
1931
|
+
return l(Pn, {
|
|
1430
1932
|
size: s,
|
|
1431
|
-
|
|
1933
|
+
message: i,
|
|
1934
|
+
controller: n.controller,
|
|
1935
|
+
children: l(Ue, {
|
|
1936
|
+
data: i,
|
|
1937
|
+
type: "content",
|
|
1938
|
+
items: n.toolbarItems,
|
|
1939
|
+
controller: n.controller
|
|
1940
|
+
})
|
|
1432
1941
|
}, i.messageid);
|
|
1433
1942
|
})
|
|
1434
1943
|
});
|
|
1435
1944
|
};
|
|
1436
|
-
function
|
|
1437
|
-
for (var
|
|
1438
|
-
t
|
|
1439
|
-
return
|
|
1945
|
+
function Un(n, e) {
|
|
1946
|
+
for (var t in e)
|
|
1947
|
+
n[t] = e[t];
|
|
1948
|
+
return n;
|
|
1440
1949
|
}
|
|
1441
|
-
function
|
|
1442
|
-
for (var
|
|
1443
|
-
if (
|
|
1950
|
+
function dt(n, e) {
|
|
1951
|
+
for (var t in n)
|
|
1952
|
+
if (t !== "__source" && !(t in e))
|
|
1444
1953
|
return !0;
|
|
1445
1954
|
for (var i in e)
|
|
1446
|
-
if (i !== "__source" &&
|
|
1955
|
+
if (i !== "__source" && n[i] !== e[i])
|
|
1447
1956
|
return !0;
|
|
1448
1957
|
return !1;
|
|
1449
1958
|
}
|
|
1450
|
-
function
|
|
1451
|
-
this.props =
|
|
1959
|
+
function ft(n) {
|
|
1960
|
+
this.props = n;
|
|
1452
1961
|
}
|
|
1453
|
-
(
|
|
1454
|
-
return
|
|
1962
|
+
(ft.prototype = new M()).isPureReactComponent = !0, ft.prototype.shouldComponentUpdate = function(n, e) {
|
|
1963
|
+
return dt(this.props, n) || dt(this.state, e);
|
|
1455
1964
|
};
|
|
1456
|
-
var
|
|
1457
|
-
|
|
1458
|
-
|
|
1965
|
+
var _t = v.__b;
|
|
1966
|
+
v.__b = function(n) {
|
|
1967
|
+
n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null), _t && _t(n);
|
|
1459
1968
|
};
|
|
1460
|
-
var
|
|
1461
|
-
|
|
1462
|
-
if (
|
|
1463
|
-
for (var s,
|
|
1464
|
-
if ((s =
|
|
1465
|
-
return e.__e == null && (e.__e =
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1969
|
+
var Fn = v.__e;
|
|
1970
|
+
v.__e = function(n, e, t, i) {
|
|
1971
|
+
if (n.then) {
|
|
1972
|
+
for (var s, o = e; o = o.__; )
|
|
1973
|
+
if ((s = o.__c) && s.__c)
|
|
1974
|
+
return e.__e == null && (e.__e = t.__e, e.__k = t.__k), s.__c(n, e);
|
|
1975
|
+
}
|
|
1976
|
+
Fn(n, e, t, i);
|
|
1468
1977
|
};
|
|
1469
|
-
var
|
|
1470
|
-
function
|
|
1471
|
-
return
|
|
1978
|
+
var pt = v.unmount;
|
|
1979
|
+
function Zt(n, e, t) {
|
|
1980
|
+
return n && (n.__c && n.__c.__H && (n.__c.__H.__.forEach(function(i) {
|
|
1472
1981
|
typeof i.__c == "function" && i.__c();
|
|
1473
|
-
}),
|
|
1474
|
-
return
|
|
1475
|
-
})),
|
|
1982
|
+
}), n.__c.__H = null), (n = Un({}, n)).__c != null && (n.__c.__P === t && (n.__c.__P = e), n.__c = null), n.__k = n.__k && n.__k.map(function(i) {
|
|
1983
|
+
return Zt(i, e, t);
|
|
1984
|
+
})), n;
|
|
1476
1985
|
}
|
|
1477
|
-
function
|
|
1478
|
-
return
|
|
1479
|
-
return
|
|
1480
|
-
}),
|
|
1986
|
+
function Gt(n, e, t) {
|
|
1987
|
+
return n && t && (n.__v = null, n.__k = n.__k && n.__k.map(function(i) {
|
|
1988
|
+
return Gt(i, e, t);
|
|
1989
|
+
}), n.__c && n.__c.__P === e && (n.__e && t.insertBefore(n.__e, n.__d), n.__c.__e = !0, n.__c.__P = t)), n;
|
|
1481
1990
|
}
|
|
1482
|
-
function
|
|
1991
|
+
function He() {
|
|
1483
1992
|
this.__u = 0, this.t = null, this.__b = null;
|
|
1484
1993
|
}
|
|
1485
|
-
function
|
|
1486
|
-
var e =
|
|
1487
|
-
return e && e.__a && e.__a(
|
|
1994
|
+
function Jt(n) {
|
|
1995
|
+
var e = n.__.__c;
|
|
1996
|
+
return e && e.__a && e.__a(n);
|
|
1488
1997
|
}
|
|
1489
|
-
function
|
|
1998
|
+
function pe() {
|
|
1490
1999
|
this.u = null, this.o = null;
|
|
1491
2000
|
}
|
|
1492
|
-
|
|
1493
|
-
var e =
|
|
1494
|
-
e && e.__R && e.__R(), e &&
|
|
1495
|
-
}, (
|
|
1496
|
-
var
|
|
1497
|
-
i.t == null && (i.t = []), i.t.push(
|
|
1498
|
-
var s =
|
|
1499
|
-
|
|
2001
|
+
v.unmount = function(n) {
|
|
2002
|
+
var e = n.__c;
|
|
2003
|
+
e && e.__R && e.__R(), e && n.__h === !0 && (n.type = null), pt && pt(n);
|
|
2004
|
+
}, (He.prototype = new M()).__c = function(n, e) {
|
|
2005
|
+
var t = e.__c, i = this;
|
|
2006
|
+
i.t == null && (i.t = []), i.t.push(t);
|
|
2007
|
+
var s = Jt(i.__v), o = !1, r = function() {
|
|
2008
|
+
o || (o = !0, t.__R = null, s ? s(c) : c());
|
|
1500
2009
|
};
|
|
1501
|
-
|
|
1502
|
-
var
|
|
2010
|
+
t.__R = r;
|
|
2011
|
+
var c = function() {
|
|
1503
2012
|
if (!--i.__u) {
|
|
1504
2013
|
if (i.state.__a) {
|
|
1505
|
-
var
|
|
1506
|
-
i.__v.__k[0] =
|
|
2014
|
+
var d = i.state.__a;
|
|
2015
|
+
i.__v.__k[0] = Gt(d, d.__c.__P, d.__c.__O);
|
|
1507
2016
|
}
|
|
1508
2017
|
var h;
|
|
1509
2018
|
for (i.setState({ __a: i.__b = null }); h = i.t.pop(); )
|
|
1510
2019
|
h.forceUpdate();
|
|
1511
2020
|
}
|
|
1512
|
-
},
|
|
1513
|
-
i.__u++ ||
|
|
1514
|
-
},
|
|
2021
|
+
}, u = e.__h === !0;
|
|
2022
|
+
i.__u++ || u || i.setState({ __a: i.__b = i.__v.__k[0] }), n.then(r, r);
|
|
2023
|
+
}, He.prototype.componentWillUnmount = function() {
|
|
1515
2024
|
this.t = [];
|
|
1516
|
-
},
|
|
2025
|
+
}, He.prototype.render = function(n, e) {
|
|
1517
2026
|
if (this.__b) {
|
|
1518
2027
|
if (this.__v.__k) {
|
|
1519
|
-
var
|
|
1520
|
-
this.__v.__k[0] =
|
|
2028
|
+
var t = document.createElement("div"), i = this.__v.__k[0].__c;
|
|
2029
|
+
this.__v.__k[0] = Zt(this.__b, t, i.__O = i.__P);
|
|
1521
2030
|
}
|
|
1522
2031
|
this.__b = null;
|
|
1523
2032
|
}
|
|
1524
|
-
var s = e.__a &&
|
|
1525
|
-
return s && (s.__h = null), [
|
|
2033
|
+
var s = e.__a && H(te, null, n.fallback);
|
|
2034
|
+
return s && (s.__h = null), [H(te, null, e.__a ? null : n.children), s];
|
|
1526
2035
|
};
|
|
1527
|
-
var
|
|
1528
|
-
if (++
|
|
1529
|
-
for (
|
|
1530
|
-
for (;
|
|
1531
|
-
|
|
1532
|
-
if (
|
|
2036
|
+
var vt = function(n, e, t) {
|
|
2037
|
+
if (++t[1] === t[0] && n.o.delete(e), n.props.revealOrder && (n.props.revealOrder[0] !== "t" || !n.o.size))
|
|
2038
|
+
for (t = n.u; t; ) {
|
|
2039
|
+
for (; t.length > 3; )
|
|
2040
|
+
t.pop()();
|
|
2041
|
+
if (t[1] < t[0])
|
|
1533
2042
|
break;
|
|
1534
|
-
|
|
2043
|
+
n.u = t = t[2];
|
|
1535
2044
|
}
|
|
1536
2045
|
};
|
|
1537
|
-
|
|
1538
|
-
|
|
2046
|
+
function Wn(n) {
|
|
2047
|
+
return this.getChildContext = function() {
|
|
2048
|
+
return n.context;
|
|
2049
|
+
}, n.children;
|
|
2050
|
+
}
|
|
2051
|
+
function Vn(n) {
|
|
2052
|
+
var e = this, t = n.i;
|
|
2053
|
+
e.componentWillUnmount = function() {
|
|
2054
|
+
K(null, e.l), e.l = null, e.i = null;
|
|
2055
|
+
}, e.i && e.i !== t && e.componentWillUnmount(), e.l || (e.i = t, e.l = { nodeType: 1, parentNode: t, childNodes: [], appendChild: function(i) {
|
|
2056
|
+
this.childNodes.push(i), e.i.appendChild(i);
|
|
2057
|
+
}, insertBefore: function(i, s) {
|
|
2058
|
+
this.childNodes.push(i), e.i.appendChild(i);
|
|
2059
|
+
}, removeChild: function(i) {
|
|
2060
|
+
this.childNodes.splice(this.childNodes.indexOf(i) >>> 1, 1), e.i.removeChild(i);
|
|
2061
|
+
} }), K(H(Wn, { context: e.context }, n.__v), e.l);
|
|
2062
|
+
}
|
|
2063
|
+
function jn(n, e) {
|
|
2064
|
+
var t = H(Vn, { __v: n, i: e });
|
|
2065
|
+
return t.containerInfo = e, t;
|
|
2066
|
+
}
|
|
2067
|
+
(pe.prototype = new M()).__a = function(n) {
|
|
2068
|
+
var e = this, t = Jt(e.__v), i = e.o.get(n);
|
|
1539
2069
|
return i[0]++, function(s) {
|
|
1540
|
-
var
|
|
1541
|
-
e.props.revealOrder ? (i.push(s),
|
|
2070
|
+
var o = function() {
|
|
2071
|
+
e.props.revealOrder ? (i.push(s), vt(e, n, i)) : s();
|
|
1542
2072
|
};
|
|
1543
|
-
|
|
2073
|
+
t ? t(o) : o();
|
|
1544
2074
|
};
|
|
1545
|
-
},
|
|
2075
|
+
}, pe.prototype.render = function(n) {
|
|
1546
2076
|
this.u = null, this.o = /* @__PURE__ */ new Map();
|
|
1547
|
-
var e =
|
|
1548
|
-
|
|
1549
|
-
for (var
|
|
1550
|
-
this.o.set(e[
|
|
1551
|
-
return
|
|
1552
|
-
},
|
|
1553
|
-
var
|
|
1554
|
-
this.o.forEach(function(e,
|
|
1555
|
-
|
|
2077
|
+
var e = we(n.children);
|
|
2078
|
+
n.revealOrder && n.revealOrder[0] === "b" && e.reverse();
|
|
2079
|
+
for (var t = e.length; t--; )
|
|
2080
|
+
this.o.set(e[t], this.u = [1, 0, this.u]);
|
|
2081
|
+
return n.children;
|
|
2082
|
+
}, pe.prototype.componentDidUpdate = pe.prototype.componentDidMount = function() {
|
|
2083
|
+
var n = this;
|
|
2084
|
+
this.o.forEach(function(e, t) {
|
|
2085
|
+
vt(n, t, e);
|
|
1556
2086
|
});
|
|
1557
2087
|
};
|
|
1558
|
-
var
|
|
1559
|
-
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(
|
|
2088
|
+
var Yn = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, qn = /^(?: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]/, Xn = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Zn = /[A-Z0-9]/g, Gn = typeof document < "u", Jn = function(n) {
|
|
2089
|
+
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(n);
|
|
1560
2090
|
};
|
|
1561
|
-
M.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(
|
|
1562
|
-
Object.defineProperty(M.prototype,
|
|
1563
|
-
return this["UNSAFE_" +
|
|
2091
|
+
M.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(n) {
|
|
2092
|
+
Object.defineProperty(M.prototype, n, { configurable: !0, get: function() {
|
|
2093
|
+
return this["UNSAFE_" + n];
|
|
1564
2094
|
}, set: function(e) {
|
|
1565
|
-
Object.defineProperty(this,
|
|
2095
|
+
Object.defineProperty(this, n, { configurable: !0, writable: !0, value: e });
|
|
1566
2096
|
} });
|
|
1567
2097
|
});
|
|
1568
|
-
var
|
|
1569
|
-
function
|
|
2098
|
+
var mt = v.event;
|
|
2099
|
+
function Kn() {
|
|
1570
2100
|
}
|
|
1571
|
-
function
|
|
2101
|
+
function Qn() {
|
|
1572
2102
|
return this.cancelBubble;
|
|
1573
2103
|
}
|
|
1574
|
-
function
|
|
2104
|
+
function ei() {
|
|
1575
2105
|
return this.defaultPrevented;
|
|
1576
2106
|
}
|
|
1577
|
-
|
|
1578
|
-
return
|
|
2107
|
+
v.event = function(n) {
|
|
2108
|
+
return mt && (n = mt(n)), n.persist = Kn, n.isPropagationStopped = Qn, n.isDefaultPrevented = ei, n.nativeEvent = n;
|
|
1579
2109
|
};
|
|
1580
|
-
var
|
|
2110
|
+
var ti = { enumerable: !1, configurable: !0, get: function() {
|
|
1581
2111
|
return this.class;
|
|
1582
|
-
} },
|
|
1583
|
-
|
|
1584
|
-
typeof
|
|
1585
|
-
var
|
|
1586
|
-
for (var
|
|
1587
|
-
var
|
|
1588
|
-
if (!(
|
|
1589
|
-
var
|
|
1590
|
-
|
|
2112
|
+
} }, gt = v.vnode;
|
|
2113
|
+
v.vnode = function(n) {
|
|
2114
|
+
typeof n.type == "string" && function(e) {
|
|
2115
|
+
var t = e.props, i = e.type, s = {};
|
|
2116
|
+
for (var o in t) {
|
|
2117
|
+
var r = t[o];
|
|
2118
|
+
if (!(o === "value" && "defaultValue" in t && r == null || Gn && o === "children" && i === "noscript" || o === "class" || o === "className")) {
|
|
2119
|
+
var c = o.toLowerCase();
|
|
2120
|
+
o === "defaultValue" && "value" in t && t.value == null ? o = "value" : o === "download" && r === !0 ? r = "" : c === "ondoubleclick" ? o = "ondblclick" : c !== "onchange" || i !== "input" && i !== "textarea" || Jn(t.type) ? c === "onfocus" ? o = "onfocusin" : c === "onblur" ? o = "onfocusout" : Xn.test(o) ? o = c : i.indexOf("-") === -1 && qn.test(o) ? o = o.replace(Zn, "-$&").toLowerCase() : r === null && (r = void 0) : c = o = "oninput", c === "oninput" && s[o = c] && (o = "oninputCapture"), s[o] = r;
|
|
1591
2121
|
}
|
|
1592
2122
|
}
|
|
1593
|
-
i == "select" && s.multiple && Array.isArray(s.value) && (s.value =
|
|
1594
|
-
|
|
1595
|
-
})), i == "select" && s.defaultValue != null && (s.value =
|
|
1596
|
-
|
|
1597
|
-
})),
|
|
1598
|
-
}(
|
|
2123
|
+
i == "select" && s.multiple && Array.isArray(s.value) && (s.value = we(t.children).forEach(function(u) {
|
|
2124
|
+
u.props.selected = s.value.indexOf(u.props.value) != -1;
|
|
2125
|
+
})), i == "select" && s.defaultValue != null && (s.value = we(t.children).forEach(function(u) {
|
|
2126
|
+
u.props.selected = s.multiple ? s.defaultValue.indexOf(u.props.value) != -1 : s.defaultValue == u.props.value;
|
|
2127
|
+
})), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className", ti)) : (t.className && !t.class || t.class && t.className) && (s.class = s.className = t.className), e.props = s;
|
|
2128
|
+
}(n), n.$$typeof = Yn, gt && gt(n);
|
|
1599
2129
|
};
|
|
1600
|
-
var
|
|
1601
|
-
|
|
1602
|
-
|
|
2130
|
+
var yt = v.__r;
|
|
2131
|
+
v.__r = function(n) {
|
|
2132
|
+
yt && yt(n), n.__c;
|
|
1603
2133
|
};
|
|
1604
|
-
var
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
var e =
|
|
1608
|
-
|
|
2134
|
+
var bt = v.diffed;
|
|
2135
|
+
v.diffed = function(n) {
|
|
2136
|
+
bt && bt(n);
|
|
2137
|
+
var e = n.props, t = n.__e;
|
|
2138
|
+
t != null && n.type === "textarea" && "value" in e && e.value !== t.value && (t.value = e.value == null ? "" : e.value);
|
|
1609
2139
|
};
|
|
1610
|
-
var
|
|
1611
|
-
function
|
|
1612
|
-
var e =
|
|
2140
|
+
var ce = /* @__PURE__ */ new Map();
|
|
2141
|
+
function ni(n) {
|
|
2142
|
+
var e = ce.get(n);
|
|
1613
2143
|
e && e.destroy();
|
|
1614
2144
|
}
|
|
1615
|
-
function
|
|
1616
|
-
var e =
|
|
2145
|
+
function ii(n) {
|
|
2146
|
+
var e = ce.get(n);
|
|
1617
2147
|
e && e.update();
|
|
1618
2148
|
}
|
|
1619
|
-
var
|
|
1620
|
-
typeof window > "u" ? ((
|
|
1621
|
-
return
|
|
1622
|
-
}).destroy = function(
|
|
1623
|
-
return
|
|
1624
|
-
},
|
|
1625
|
-
return
|
|
1626
|
-
}) : ((
|
|
1627
|
-
return
|
|
2149
|
+
var oe = null;
|
|
2150
|
+
typeof window > "u" ? ((oe = function(n) {
|
|
2151
|
+
return n;
|
|
2152
|
+
}).destroy = function(n) {
|
|
2153
|
+
return n;
|
|
2154
|
+
}, oe.update = function(n) {
|
|
2155
|
+
return n;
|
|
2156
|
+
}) : ((oe = function(n, e) {
|
|
2157
|
+
return n && Array.prototype.forEach.call(n.length ? n : [n], function(t) {
|
|
1628
2158
|
return function(i) {
|
|
1629
|
-
if (i && i.nodeName && i.nodeName === "TEXTAREA" && !
|
|
1630
|
-
var s,
|
|
1631
|
-
|
|
1632
|
-
}),
|
|
1633
|
-
i.removeEventListener("autosize:destroy",
|
|
1634
|
-
return i.style[
|
|
1635
|
-
}),
|
|
2159
|
+
if (i && i.nodeName && i.nodeName === "TEXTAREA" && !ce.has(i)) {
|
|
2160
|
+
var s, o = null, r = window.getComputedStyle(i), c = (s = i.value, function() {
|
|
2161
|
+
d({ testForHeightReduction: s === "" || !i.value.startsWith(s), restoreTextAlign: null }), s = i.value;
|
|
2162
|
+
}), u = (function(a) {
|
|
2163
|
+
i.removeEventListener("autosize:destroy", u), i.removeEventListener("autosize:update", h), i.removeEventListener("input", c), window.removeEventListener("resize", h), Object.keys(a).forEach(function(_) {
|
|
2164
|
+
return i.style[_] = a[_];
|
|
2165
|
+
}), ce.delete(i);
|
|
1636
2166
|
}).bind(i, { height: i.style.height, resize: i.style.resize, textAlign: i.style.textAlign, overflowY: i.style.overflowY, overflowX: i.style.overflowX, wordWrap: i.style.wordWrap });
|
|
1637
|
-
i.addEventListener("autosize:destroy",
|
|
2167
|
+
i.addEventListener("autosize:destroy", u), i.addEventListener("autosize:update", h), i.addEventListener("input", c), window.addEventListener("resize", h), i.style.overflowX = "hidden", i.style.wordWrap = "break-word", ce.set(i, { destroy: u, update: h }), h();
|
|
1638
2168
|
}
|
|
1639
|
-
function
|
|
1640
|
-
var
|
|
1641
|
-
if (i.scrollHeight !== 0 && (
|
|
1642
|
-
for (var
|
|
1643
|
-
|
|
2169
|
+
function d(a) {
|
|
2170
|
+
var _, p, f = a.restoreTextAlign, g = f === void 0 ? null : f, N = a.testForHeightReduction, b = N === void 0 || N, C = r.overflowY;
|
|
2171
|
+
if (i.scrollHeight !== 0 && (r.resize === "vertical" ? i.style.resize = "none" : r.resize === "both" && (i.style.resize = "horizontal"), b && (_ = function(T) {
|
|
2172
|
+
for (var E = []; T && T.parentNode && T.parentNode instanceof Element; )
|
|
2173
|
+
T.parentNode.scrollTop && E.push([T.parentNode, T.parentNode.scrollTop]), T = T.parentNode;
|
|
1644
2174
|
return function() {
|
|
1645
|
-
return
|
|
1646
|
-
var
|
|
1647
|
-
|
|
2175
|
+
return E.forEach(function(L) {
|
|
2176
|
+
var I = L[0], R = L[1];
|
|
2177
|
+
I.style.scrollBehavior = "auto", I.scrollTop = R, I.style.scrollBehavior = null;
|
|
1648
2178
|
});
|
|
1649
2179
|
};
|
|
1650
|
-
}(i), i.style.height = ""),
|
|
1651
|
-
var
|
|
1652
|
-
|
|
2180
|
+
}(i), i.style.height = ""), p = r.boxSizing === "content-box" ? i.scrollHeight - (parseFloat(r.paddingTop) + parseFloat(r.paddingBottom)) : i.scrollHeight + parseFloat(r.borderTopWidth) + parseFloat(r.borderBottomWidth), r.maxHeight !== "none" && p > parseFloat(r.maxHeight) ? (r.overflowY === "hidden" && (i.style.overflow = "scroll"), p = parseFloat(r.maxHeight)) : r.overflowY !== "hidden" && (i.style.overflow = "hidden"), i.style.height = p + "px", g && (i.style.textAlign = g), _ && _(), o !== p && (i.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), o = p), C !== r.overflow && !g)) {
|
|
2181
|
+
var x = r.textAlign;
|
|
2182
|
+
r.overflow === "hidden" && (i.style.textAlign = x === "start" ? "end" : "start"), d({ restoreTextAlign: x, testForHeightReduction: !0 });
|
|
1653
2183
|
}
|
|
1654
2184
|
}
|
|
1655
2185
|
function h() {
|
|
1656
|
-
|
|
2186
|
+
d({ testForHeightReduction: !0, restoreTextAlign: null });
|
|
1657
2187
|
}
|
|
1658
|
-
}(
|
|
1659
|
-
}),
|
|
1660
|
-
}).destroy = function(
|
|
1661
|
-
return
|
|
1662
|
-
},
|
|
1663
|
-
return
|
|
2188
|
+
}(t);
|
|
2189
|
+
}), n;
|
|
2190
|
+
}).destroy = function(n) {
|
|
2191
|
+
return n && Array.prototype.forEach.call(n.length ? n : [n], ni), n;
|
|
2192
|
+
}, oe.update = function(n) {
|
|
2193
|
+
return n && Array.prototype.forEach.call(n.length ? n : [n], ii), n;
|
|
1664
2194
|
});
|
|
1665
|
-
var
|
|
1666
|
-
const
|
|
1667
|
-
const e =
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
2195
|
+
var wt = oe;
|
|
2196
|
+
const q = new A("chat-input"), Ct = window.SpeechRecognition || window.webkitSpeechRecognition, Tt = (n) => {
|
|
2197
|
+
const e = Z(null), t = n.controller.input, i = W(!1), s = W(!1), o = Z();
|
|
2198
|
+
Ct && !o.current && (o.current = new Ct(), o.current.onstart = () => {
|
|
2199
|
+
s.value = !0;
|
|
2200
|
+
}, o.current.onend = () => {
|
|
2201
|
+
s.value = !1;
|
|
2202
|
+
}, o.current.onresult = (a) => {
|
|
2203
|
+
var p, f, g;
|
|
2204
|
+
const _ = (g = (f = (p = a.results) == null ? void 0 : p[0]) == null ? void 0 : f[0]) == null ? void 0 : g.transcript;
|
|
2205
|
+
_ && (t.value = "".concat(t.value).concat(_));
|
|
2206
|
+
});
|
|
2207
|
+
const r = () => {
|
|
2208
|
+
o.current && !s.value && o.current.start();
|
|
2209
|
+
}, c = rt((a) => {
|
|
2210
|
+
t.value = a.target.value;
|
|
2211
|
+
}, [t]), u = qe(() => t.value.length <= 0 || i.value === !0);
|
|
2212
|
+
F(() => (e.current && wt(e.current), () => {
|
|
2213
|
+
e.current && wt.destroy(e.current);
|
|
1672
2214
|
}), [e]);
|
|
1673
|
-
const
|
|
2215
|
+
const d = rt(async () => {
|
|
1674
2216
|
i.value = !0;
|
|
1675
2217
|
try {
|
|
1676
|
-
await
|
|
1677
|
-
} catch (
|
|
1678
|
-
console.error(
|
|
2218
|
+
await n.controller.question(t.value), t.value = "";
|
|
2219
|
+
} catch (a) {
|
|
2220
|
+
console.error(a);
|
|
1679
2221
|
} finally {
|
|
1680
2222
|
i.value = !1;
|
|
1681
2223
|
}
|
|
1682
|
-
}, [
|
|
1683
|
-
|
|
2224
|
+
}, [t, i]), h = (a) => {
|
|
2225
|
+
a.code === "Enter" && (a.stopPropagation(), a.shiftKey === !1 && d());
|
|
1684
2226
|
};
|
|
1685
|
-
return
|
|
1686
|
-
className:
|
|
1687
|
-
children: [
|
|
1688
|
-
className:
|
|
2227
|
+
return l("div", {
|
|
2228
|
+
className: q.b(),
|
|
2229
|
+
children: [l("textarea", {
|
|
2230
|
+
className: q.e("textarea"),
|
|
1689
2231
|
type: "text",
|
|
1690
2232
|
rows: 6,
|
|
1691
2233
|
autoCorrect: "off",
|
|
1692
2234
|
autoCapitalize: "off",
|
|
1693
2235
|
autoComplete: "off",
|
|
1694
|
-
value:
|
|
1695
|
-
onInput:
|
|
1696
|
-
onKeyDown:
|
|
2236
|
+
value: t,
|
|
2237
|
+
onInput: c,
|
|
2238
|
+
onKeyDown: h,
|
|
1697
2239
|
ref: e,
|
|
1698
2240
|
disabled: i
|
|
1699
|
-
}),
|
|
1700
|
-
className:
|
|
1701
|
-
children:
|
|
1702
|
-
title:
|
|
1703
|
-
className: "".concat(
|
|
1704
|
-
onClick:
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
2241
|
+
}), l("div", {
|
|
2242
|
+
className: q.b("action-wrapper"),
|
|
2243
|
+
children: [l("div", {
|
|
2244
|
+
title: s.value ? "语音输入中..." : "语音输入",
|
|
2245
|
+
className: "".concat(q.be("action-wrapper", "action-item")),
|
|
2246
|
+
onClick: r,
|
|
2247
|
+
children: s.value ? l(xn, {}) : l(Nn, {})
|
|
2248
|
+
}), l("div", {
|
|
2249
|
+
title: i.value ? "思考中..." : "发送消息",
|
|
2250
|
+
className: "".concat(q.be("action-wrapper", "action-item"), " ").concat(q.is("disabled", u.value), " ").concat(q.is("loading", i.value)),
|
|
2251
|
+
onClick: d,
|
|
2252
|
+
disabled: u,
|
|
2253
|
+
children: l(bn, {})
|
|
2254
|
+
})]
|
|
2255
|
+
})]
|
|
2256
|
+
});
|
|
2257
|
+
};
|
|
2258
|
+
var k = /* @__PURE__ */ ((n) => (n.STYLE_CACHE = "ai-chat-style-cache", n.MINIMIZE_STYLY_CHCHE = "ai-chat-minimize-style-cache", n.DATA_BASE_NAME = "ibiz-chat", n.DATA_TABLE_NAME = "history-message", n.DATA_TABLE_KEY_NAME = "id", n))(k || {});
|
|
2259
|
+
const si = ({
|
|
2260
|
+
children: n,
|
|
2261
|
+
actions: e,
|
|
2262
|
+
// 接收行为数据
|
|
2263
|
+
position: t = "bottom",
|
|
2264
|
+
isOpen: i,
|
|
2265
|
+
onToggleOpen: s,
|
|
2266
|
+
onAction: o
|
|
2267
|
+
// 接收行为事件回调
|
|
2268
|
+
}) => {
|
|
2269
|
+
const r = new A("pop"), [c, u] = Pt(i || !1), d = Z(null), h = Z(null);
|
|
2270
|
+
F(() => {
|
|
2271
|
+
i !== void 0 && u(i);
|
|
2272
|
+
}, [i]), F(() => (h.current || (h.current = document.createElement("div"), h.current.className = r.b("content-container"), document.body.appendChild(h.current)), () => {
|
|
2273
|
+
h.current && document.body.removeChild(h.current);
|
|
2274
|
+
}), []), F(() => {
|
|
2275
|
+
const _ = (p) => {
|
|
2276
|
+
d.current && !d.current.contains(p.target) && !p.target.closest(r.b("content")) && (u(!1), s == null || s(!1));
|
|
2277
|
+
};
|
|
2278
|
+
return c && document.addEventListener("mousedown", _), () => {
|
|
2279
|
+
document.removeEventListener("mousedown", _);
|
|
2280
|
+
};
|
|
2281
|
+
}, [c, s]);
|
|
2282
|
+
const a = () => {
|
|
2283
|
+
if (!d.current)
|
|
2284
|
+
return {};
|
|
2285
|
+
const _ = d.current.getBoundingClientRect(), p = {
|
|
2286
|
+
position: "absolute",
|
|
2287
|
+
zIndex: 1e3
|
|
2288
|
+
}, f = {
|
|
2289
|
+
bottom: {
|
|
2290
|
+
top: _.bottom + window.scrollY,
|
|
2291
|
+
left: _.left + window.scrollX
|
|
2292
|
+
},
|
|
2293
|
+
top: {
|
|
2294
|
+
bottom: window.innerHeight - _.top + window.scrollY,
|
|
2295
|
+
left: _.left + window.scrollX
|
|
2296
|
+
},
|
|
2297
|
+
left: {
|
|
2298
|
+
top: _.top + window.scrollY,
|
|
2299
|
+
right: window.innerWidth - _.left + window.scrollX
|
|
2300
|
+
},
|
|
2301
|
+
right: {
|
|
2302
|
+
top: _.top + window.scrollY,
|
|
2303
|
+
left: _.right + window.scrollX
|
|
2304
|
+
}
|
|
2305
|
+
};
|
|
2306
|
+
return {
|
|
2307
|
+
...p,
|
|
2308
|
+
...f[t]
|
|
2309
|
+
};
|
|
2310
|
+
};
|
|
2311
|
+
return l("span", {
|
|
2312
|
+
className: "".concat(r.b("trigger-container")),
|
|
2313
|
+
children: [l("span", {
|
|
2314
|
+
className: "".concat(r.b("trigger-element")),
|
|
2315
|
+
ref: d,
|
|
2316
|
+
onClick: (_) => {
|
|
2317
|
+
_.stopPropagation();
|
|
2318
|
+
const p = !c;
|
|
2319
|
+
u(p), s == null || s(p);
|
|
2320
|
+
},
|
|
2321
|
+
children: n
|
|
2322
|
+
}), c && h.current && jn(l("div", {
|
|
2323
|
+
className: "".concat(r.b("content"), " pop-").concat(t),
|
|
2324
|
+
style: a(),
|
|
2325
|
+
children: e == null ? void 0 : e.map((_) => l("div", {
|
|
2326
|
+
className: r.b("content-item"),
|
|
2327
|
+
onMouseDown: (p) => {
|
|
2328
|
+
p.stopPropagation(), o == null || o(_.id, p);
|
|
2329
|
+
},
|
|
2330
|
+
children: [_.icon && l("img", {
|
|
2331
|
+
className: r.b("content-item__icon"),
|
|
2332
|
+
src: _.icon,
|
|
2333
|
+
alt: _.caption
|
|
2334
|
+
}), l("div", {
|
|
2335
|
+
className: r.b("content-item__caption"),
|
|
2336
|
+
children: _.caption
|
|
2337
|
+
})]
|
|
2338
|
+
}, _.id))
|
|
2339
|
+
}), h.current)]
|
|
2340
|
+
});
|
|
2341
|
+
};
|
|
2342
|
+
const P = new A("chat-topic-item"), oi = (n) => {
|
|
2343
|
+
const {
|
|
2344
|
+
current: e,
|
|
2345
|
+
active: t,
|
|
2346
|
+
topic: i,
|
|
2347
|
+
onClick: s,
|
|
2348
|
+
onAction: o
|
|
2349
|
+
} = n, [r, c] = Pt(!1), u = (h) => {
|
|
2350
|
+
h.stopPropagation(), o("LINK", h);
|
|
2351
|
+
}, d = (h, a) => {
|
|
2352
|
+
h === "DELETE" && o("DELETE", a), c(!1);
|
|
2353
|
+
};
|
|
2354
|
+
return l("div", {
|
|
2355
|
+
className: "".concat(P.b(), " ").concat(P.is("active", t)),
|
|
2356
|
+
onClick: s.bind(void 0),
|
|
2357
|
+
children: [l("div", {
|
|
2358
|
+
className: P.b("caption"),
|
|
2359
|
+
title: i.caption,
|
|
2360
|
+
children: i.caption
|
|
2361
|
+
}), l("div", {
|
|
2362
|
+
className: P.b("icon"),
|
|
2363
|
+
children: [l("span", {
|
|
2364
|
+
className: P.be("icon", "item"),
|
|
2365
|
+
title: "跳转主视图",
|
|
2366
|
+
onClick: u.bind(void 0),
|
|
2367
|
+
children: l(In, {
|
|
2368
|
+
className: P.b("link-icon")
|
|
2369
|
+
})
|
|
2370
|
+
}), e ? null : l(si, {
|
|
2371
|
+
actions: [{
|
|
2372
|
+
id: "DELETE",
|
|
2373
|
+
caption: "删除话题"
|
|
2374
|
+
}],
|
|
2375
|
+
position: "bottom",
|
|
2376
|
+
isOpen: r,
|
|
2377
|
+
onToggleOpen: c,
|
|
2378
|
+
onAction: d.bind(void 0),
|
|
2379
|
+
children: l("span", {
|
|
2380
|
+
className: P.be("icon", "item"),
|
|
2381
|
+
title: "更多",
|
|
2382
|
+
children: l(An, {
|
|
2383
|
+
className: P.b("more-icon")
|
|
2384
|
+
})
|
|
2385
|
+
})
|
|
2386
|
+
})]
|
|
1708
2387
|
})]
|
|
1709
2388
|
});
|
|
1710
2389
|
};
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
2390
|
+
const ri = new A("chat-topics"), ai = (n) => {
|
|
2391
|
+
const e = n.controller.topics, t = (s) => {
|
|
2392
|
+
n.controller.handleTopicChange(s);
|
|
2393
|
+
}, i = (s, o, r) => {
|
|
2394
|
+
n.controller.handleTopicAction(s, o, r);
|
|
2395
|
+
};
|
|
2396
|
+
return l("div", {
|
|
2397
|
+
className: ri.b(),
|
|
2398
|
+
children: e.value.map((s) => {
|
|
2399
|
+
var o, r;
|
|
2400
|
+
return l(oi, {
|
|
2401
|
+
topic: s,
|
|
2402
|
+
current: s.id === ((o = n.controller.currentTopicOptions) == null ? void 0 : o.id),
|
|
2403
|
+
active: s.id === ((r = n.controller.activedTopic.value) == null ? void 0 : r.id),
|
|
2404
|
+
onClick: () => t(s),
|
|
2405
|
+
onAction: (c, u) => i(c, s, u)
|
|
2406
|
+
}, s.id);
|
|
2407
|
+
})
|
|
2408
|
+
});
|
|
2409
|
+
};
|
|
2410
|
+
class Et extends M {
|
|
2411
|
+
constructor(t) {
|
|
2412
|
+
super(t);
|
|
2413
|
+
y(this, "ns", new A("chat-container"));
|
|
2414
|
+
y(this, "containerRef", Ie());
|
|
2415
|
+
y(this, "dragHandle", Ie());
|
|
2416
|
+
y(this, "minimizeRef", Ie());
|
|
2417
|
+
y(this, "data", {
|
|
2418
|
+
x: window.innerWidth - 600,
|
|
2419
|
+
y: 0,
|
|
1721
2420
|
width: 600,
|
|
1722
|
-
height:
|
|
2421
|
+
height: window.innerHeight,
|
|
1723
2422
|
minWidth: 300,
|
|
1724
2423
|
minHeight: 300
|
|
1725
2424
|
});
|
|
2425
|
+
y(this, "minimizeData", {
|
|
2426
|
+
x: window.innerWidth - 86,
|
|
2427
|
+
y: window.innerHeight - 86
|
|
2428
|
+
});
|
|
2429
|
+
/**
|
|
2430
|
+
* 是否禁止拖动
|
|
2431
|
+
* - 拖拽边时应禁止拖动
|
|
2432
|
+
* @type {boolean}
|
|
2433
|
+
* @memberof ChatContainer
|
|
2434
|
+
*/
|
|
2435
|
+
y(this, "disabled", !1);
|
|
2436
|
+
/**
|
|
2437
|
+
* 最小化是否在拖拽中
|
|
2438
|
+
* - 在拖拽时不应触发点击事件
|
|
2439
|
+
* @type {boolean}
|
|
2440
|
+
* @memberof ChatContainer
|
|
2441
|
+
*/
|
|
2442
|
+
y(this, "isDragging", !1);
|
|
1726
2443
|
this.state = {
|
|
1727
|
-
isFullScreen: !1
|
|
2444
|
+
isFullScreen: !1,
|
|
2445
|
+
isMinimize: !1
|
|
1728
2446
|
};
|
|
1729
2447
|
}
|
|
1730
|
-
|
|
2448
|
+
calcWindowStyle() {
|
|
1731
2449
|
return {
|
|
1732
|
-
|
|
1733
|
-
top: "
|
|
1734
|
-
height: "
|
|
2450
|
+
left: "".concat(this.data.x, "px"),
|
|
2451
|
+
top: "".concat(this.data.y, "px"),
|
|
2452
|
+
height: "".concat(this.data.height, "px"),
|
|
1735
2453
|
width: "".concat(this.data.width, "px"),
|
|
1736
2454
|
"z-index": "1000"
|
|
1737
2455
|
};
|
|
1738
2456
|
}
|
|
2457
|
+
calcMinimizeStyle() {
|
|
2458
|
+
return {
|
|
2459
|
+
left: "".concat(this.minimizeData.x, "px"),
|
|
2460
|
+
top: "".concat(this.minimizeData.y, "px"),
|
|
2461
|
+
"z-index": "99999"
|
|
2462
|
+
};
|
|
2463
|
+
}
|
|
1739
2464
|
setStyle() {
|
|
1740
|
-
Object.assign(this.containerRef.current.style, this.
|
|
2465
|
+
Object.assign(this.containerRef.current.style, this.calcWindowStyle()), Object.assign(this.minimizeRef.current.style, this.calcMinimizeStyle());
|
|
1741
2466
|
}
|
|
1742
2467
|
componentDidMount() {
|
|
1743
|
-
const
|
|
1744
|
-
|
|
1745
|
-
const i =
|
|
1746
|
-
|
|
2468
|
+
const t = localStorage.getItem(k.MINIMIZE_STYLY_CHCHE);
|
|
2469
|
+
t && (this.minimizeData = JSON.parse(t));
|
|
2470
|
+
const i = localStorage.getItem(k.STYLE_CACHE);
|
|
2471
|
+
i && (this.data = JSON.parse(i), this.data.x > window.innerWidth && (this.data.x = window.innerWidth - 100), this.data.y > window.innerHeight && (this.data.y = window.innerHeight - 100)), this.setStyle();
|
|
2472
|
+
const s = this.data;
|
|
2473
|
+
this.minimizeRef.current.onmousedown = (o) => {
|
|
2474
|
+
document.body.style.userSelect = "none";
|
|
2475
|
+
const r = o.clientX - this.minimizeRef.current.offsetLeft, c = o.clientY - this.minimizeRef.current.offsetTop, u = Date.now(), d = (a) => {
|
|
2476
|
+
this.minimizeData.x = a.clientX - r, this.minimizeData.y = a.clientY - c, this.setStyle();
|
|
2477
|
+
}, h = () => {
|
|
2478
|
+
const a = Date.now();
|
|
2479
|
+
this.isDragging = a - u > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", h);
|
|
2480
|
+
};
|
|
2481
|
+
document.addEventListener("mousemove", d), document.addEventListener("mouseup", h);
|
|
2482
|
+
}, this.dragHandle.current.onmousedown = (o) => {
|
|
2483
|
+
if (this.disabled || this.state.isFullScreen)
|
|
2484
|
+
return;
|
|
2485
|
+
document.body.style.userSelect = "none";
|
|
2486
|
+
const r = o.clientX - this.containerRef.current.offsetLeft, c = o.clientY - this.containerRef.current.offsetTop, u = (h) => {
|
|
2487
|
+
s.x = h.clientX - r, s.y = h.clientY - c, this.setStyle();
|
|
2488
|
+
}, d = () => {
|
|
2489
|
+
document.body.style.userSelect = "", document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", d);
|
|
2490
|
+
};
|
|
2491
|
+
document.addEventListener("mousemove", u), document.addEventListener("mouseup", d);
|
|
2492
|
+
}, Ae(this.containerRef.current).resizable({
|
|
1747
2493
|
// 可拖拽的边缘
|
|
1748
2494
|
edges: {
|
|
1749
|
-
top: !
|
|
2495
|
+
top: !0,
|
|
1750
2496
|
right: !0,
|
|
1751
|
-
bottom: !
|
|
2497
|
+
bottom: !0,
|
|
1752
2498
|
left: !0
|
|
1753
2499
|
},
|
|
1754
2500
|
margin: 6,
|
|
1755
2501
|
modifiers: [
|
|
1756
2502
|
// 保持在父对象内部
|
|
1757
|
-
|
|
2503
|
+
Ae.modifiers.restrictEdges({
|
|
1758
2504
|
outer: document.body
|
|
1759
2505
|
}),
|
|
1760
2506
|
// 缩放最小宽度
|
|
1761
|
-
|
|
2507
|
+
Ae.modifiers.restrictSize({
|
|
1762
2508
|
min: {
|
|
1763
|
-
width:
|
|
1764
|
-
height:
|
|
2509
|
+
width: s.minWidth,
|
|
2510
|
+
height: s.minHeight
|
|
1765
2511
|
}
|
|
1766
2512
|
})
|
|
1767
2513
|
],
|
|
1768
2514
|
inertia: !0,
|
|
1769
2515
|
listeners: {
|
|
1770
|
-
move: (
|
|
1771
|
-
|
|
2516
|
+
move: (o) => {
|
|
2517
|
+
this.state.isFullScreen || (s.x = o.rect.left, s.y = o.rect.top, s.width = o.rect.width, s.height = o.rect.height, this.setStyle());
|
|
2518
|
+
},
|
|
2519
|
+
start: () => {
|
|
2520
|
+
this.disabled = !0, document.body.style.userSelect = "none";
|
|
2521
|
+
},
|
|
2522
|
+
end: () => {
|
|
2523
|
+
this.disabled = !1, document.body.style.userSelect = "";
|
|
1772
2524
|
}
|
|
1773
2525
|
}
|
|
1774
2526
|
});
|
|
1775
2527
|
}
|
|
1776
2528
|
componentWillUnmount() {
|
|
1777
|
-
localStorage.setItem(
|
|
2529
|
+
localStorage.setItem(k.STYLE_CACHE, JSON.stringify(this.data)), localStorage.setItem(k.MINIMIZE_STYLY_CHCHE, JSON.stringify(this.minimizeData));
|
|
1778
2530
|
}
|
|
1779
2531
|
/**
|
|
1780
2532
|
* 关闭聊天窗口
|
|
@@ -1792,8 +2544,8 @@ class zn extends M {
|
|
|
1792
2544
|
* @date 2024-05-07 15:10:31
|
|
1793
2545
|
*/
|
|
1794
2546
|
fullScreen() {
|
|
1795
|
-
const
|
|
1796
|
-
|
|
2547
|
+
const t = this.containerRef.current;
|
|
2548
|
+
t && (t.requestFullscreen(), this.setState({
|
|
1797
2549
|
isFullScreen: !0
|
|
1798
2550
|
}), this.props.fullscreen(!0));
|
|
1799
2551
|
}
|
|
@@ -1806,49 +2558,137 @@ class zn extends M {
|
|
|
1806
2558
|
closeFullScreen() {
|
|
1807
2559
|
this.state.isFullScreen && (document == null || document.exitFullscreen(), this.setState({
|
|
1808
2560
|
isFullScreen: !1
|
|
1809
|
-
}), this.props.fullscreen(!1));
|
|
2561
|
+
}), this.props.fullscreen(!1), this.setStyle());
|
|
2562
|
+
}
|
|
2563
|
+
/**
|
|
2564
|
+
* 最小化
|
|
2565
|
+
*
|
|
2566
|
+
* @memberof ChatContainer
|
|
2567
|
+
*/
|
|
2568
|
+
minimize() {
|
|
2569
|
+
this.closeFullScreen(), this.setState({
|
|
2570
|
+
isMinimize: !0
|
|
2571
|
+
}), this.props.minimize(!0);
|
|
2572
|
+
}
|
|
2573
|
+
/**
|
|
2574
|
+
* 退出最小化
|
|
2575
|
+
*
|
|
2576
|
+
* @memberof ChatContainer
|
|
2577
|
+
*/
|
|
2578
|
+
exitMinimize() {
|
|
2579
|
+
this.isDragging || (this.setState({
|
|
2580
|
+
isMinimize: !1
|
|
2581
|
+
}), this.props.minimize(!1));
|
|
2582
|
+
}
|
|
2583
|
+
/**
|
|
2584
|
+
* 阻止冒泡
|
|
2585
|
+
* - 防止点击头部行为时误触发拖动监听
|
|
2586
|
+
* @param {MouseEvent} evt
|
|
2587
|
+
* @memberof ChatContainer
|
|
2588
|
+
*/
|
|
2589
|
+
stopPropagation(t) {
|
|
2590
|
+
t.stopPropagation();
|
|
1810
2591
|
}
|
|
1811
2592
|
render() {
|
|
1812
|
-
return
|
|
1813
|
-
className: "
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
ref: this.
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
className: this.ns.b("header
|
|
1820
|
-
children:
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
className:
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
2593
|
+
return l("div", {
|
|
2594
|
+
className: "".concat(this.ns.b()),
|
|
2595
|
+
children: [l("div", {
|
|
2596
|
+
className: "".concat(this.ns.e("dialog"), " ").concat(this.ns.is("full-screen", this.state.isFullScreen), " ").concat(this.ns.is("hidden", this.state.isMinimize)),
|
|
2597
|
+
ref: this.containerRef,
|
|
2598
|
+
children: [l("div", {
|
|
2599
|
+
ref: this.dragHandle,
|
|
2600
|
+
className: this.ns.b("header"),
|
|
2601
|
+
children: [l("div", {
|
|
2602
|
+
className: this.ns.b("header-caption"),
|
|
2603
|
+
children: this.props.caption || "AI助手"
|
|
2604
|
+
}), l("div", {
|
|
2605
|
+
className: this.ns.b("header-action-wrapper"),
|
|
2606
|
+
children: [l("div", {
|
|
2607
|
+
title: "最小化",
|
|
2608
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "minimize")),
|
|
2609
|
+
onMouseDown: this.stopPropagation.bind(this),
|
|
2610
|
+
onClick: this.minimize.bind(this),
|
|
2611
|
+
children: l(Sn, {})
|
|
2612
|
+
}), this.state.isFullScreen ? l("div", {
|
|
2613
|
+
title: "退出全屏",
|
|
2614
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "close-full-screen")),
|
|
2615
|
+
onMouseDown: this.stopPropagation.bind(this),
|
|
2616
|
+
onClick: this.closeFullScreen.bind(this),
|
|
2617
|
+
children: l(En, {})
|
|
2618
|
+
}) : l("div", {
|
|
2619
|
+
title: "全屏",
|
|
2620
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "full-screen")),
|
|
2621
|
+
onMouseDown: this.stopPropagation.bind(this),
|
|
2622
|
+
onClick: this.fullScreen.bind(this),
|
|
2623
|
+
children: l(Tn, {})
|
|
2624
|
+
}), l("div", {
|
|
2625
|
+
title: "关闭",
|
|
2626
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "action-close")),
|
|
2627
|
+
onMouseDown: this.stopPropagation.bind(this),
|
|
2628
|
+
onClick: this.close.bind(this),
|
|
2629
|
+
children: l(gn, {})
|
|
2630
|
+
})]
|
|
2631
|
+
})]
|
|
2632
|
+
}), this.props.mode === "TOPIC" ? l("div", {
|
|
2633
|
+
className: "".concat(this.ns.b("main")),
|
|
2634
|
+
children: [l("div", {
|
|
2635
|
+
className: "".concat(this.ns.be("main", "left")),
|
|
2636
|
+
children: l(ai, {
|
|
2637
|
+
controller: this.props.aiTopic
|
|
2638
|
+
})
|
|
2639
|
+
}), l("div", {
|
|
2640
|
+
className: "".concat(this.ns.be("main", "right")),
|
|
2641
|
+
children: [l("div", {
|
|
2642
|
+
className: this.ns.b("content"),
|
|
2643
|
+
children: l(ht, {
|
|
2644
|
+
controller: this.props.aiChat,
|
|
2645
|
+
toolbarItems: this.props.contentToolbarItems
|
|
2646
|
+
})
|
|
2647
|
+
}), l(Ue, {
|
|
2648
|
+
data: this.props.aiTopic.activedTopic.value,
|
|
2649
|
+
type: "footer",
|
|
2650
|
+
className: this.ns.e("toolbar"),
|
|
2651
|
+
controller: this.props.aiChat,
|
|
2652
|
+
items: this.props.footerToolbarItems
|
|
2653
|
+
}), l("div", {
|
|
2654
|
+
className: this.ns.b("footer"),
|
|
2655
|
+
children: l(Tt, {
|
|
2656
|
+
controller: this.props.aiChat
|
|
2657
|
+
})
|
|
2658
|
+
})]
|
|
2659
|
+
})]
|
|
2660
|
+
}) : l("div", {
|
|
2661
|
+
className: "".concat(this.ns.be("main", "default")),
|
|
2662
|
+
children: [l("div", {
|
|
2663
|
+
className: this.ns.b("content"),
|
|
2664
|
+
children: l(ht, {
|
|
2665
|
+
controller: this.props.aiChat,
|
|
2666
|
+
toolbarItems: this.props.contentToolbarItems
|
|
2667
|
+
})
|
|
2668
|
+
}), l(Ue, {
|
|
2669
|
+
data: this.props.aiTopic.activedTopic.value,
|
|
2670
|
+
type: "footer",
|
|
2671
|
+
className: this.ns.e("toolbar"),
|
|
2672
|
+
controller: this.props.aiChat,
|
|
2673
|
+
items: this.props.footerToolbarItems
|
|
2674
|
+
}), l("div", {
|
|
2675
|
+
className: this.ns.b("footer"),
|
|
2676
|
+
children: l(Tt, {
|
|
2677
|
+
controller: this.props.aiChat
|
|
2678
|
+
})
|
|
1835
2679
|
})]
|
|
1836
2680
|
})]
|
|
1837
|
-
}),
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
className: this.ns.b("footer"),
|
|
1844
|
-
children: u(Hn, {
|
|
1845
|
-
controller: this.props.controller
|
|
1846
|
-
})
|
|
2681
|
+
}), l("div", {
|
|
2682
|
+
title: "AI助手",
|
|
2683
|
+
ref: this.minimizeRef,
|
|
2684
|
+
className: "".concat(this.ns.e("minimize"), " ").concat(this.ns.is("hidden", !this.state.isMinimize)),
|
|
2685
|
+
onClick: this.exitMinimize.bind(this),
|
|
2686
|
+
children: l(kn, {})
|
|
1847
2687
|
})]
|
|
1848
2688
|
});
|
|
1849
2689
|
}
|
|
1850
2690
|
}
|
|
1851
|
-
class
|
|
2691
|
+
class Le {
|
|
1852
2692
|
constructor(e) {
|
|
1853
2693
|
this.msg = e;
|
|
1854
2694
|
}
|
|
@@ -1867,6 +2707,9 @@ class xe {
|
|
|
1867
2707
|
get content() {
|
|
1868
2708
|
return this.msg.content;
|
|
1869
2709
|
}
|
|
2710
|
+
get completed() {
|
|
2711
|
+
return this.msg.completed;
|
|
2712
|
+
}
|
|
1870
2713
|
get _origin() {
|
|
1871
2714
|
return this.msg;
|
|
1872
2715
|
}
|
|
@@ -1880,8 +2723,41 @@ class xe {
|
|
|
1880
2723
|
update(e) {
|
|
1881
2724
|
e.content || (e.content = ""), this.msg.content += e.content;
|
|
1882
2725
|
}
|
|
2726
|
+
/**
|
|
2727
|
+
* 更新消息完成状态
|
|
2728
|
+
*
|
|
2729
|
+
* @author tony001
|
|
2730
|
+
* @date 2025-02-25 17:02:31
|
|
2731
|
+
* @param {boolean} completed
|
|
2732
|
+
*/
|
|
2733
|
+
updateCompleted(e) {
|
|
2734
|
+
this.msg.completed = e;
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
class ve {
|
|
2738
|
+
constructor(e) {
|
|
2739
|
+
this.data = e;
|
|
2740
|
+
}
|
|
2741
|
+
get appid() {
|
|
2742
|
+
return this.data.appid;
|
|
2743
|
+
}
|
|
2744
|
+
get id() {
|
|
2745
|
+
return this.data.id;
|
|
2746
|
+
}
|
|
2747
|
+
get type() {
|
|
2748
|
+
return this.data.type;
|
|
2749
|
+
}
|
|
2750
|
+
get caption() {
|
|
2751
|
+
return this.data.caption;
|
|
2752
|
+
}
|
|
2753
|
+
get url() {
|
|
2754
|
+
return this.data.url;
|
|
2755
|
+
}
|
|
2756
|
+
get aiChat() {
|
|
2757
|
+
return this.data.aiChat;
|
|
2758
|
+
}
|
|
1883
2759
|
}
|
|
1884
|
-
class
|
|
2760
|
+
class St {
|
|
1885
2761
|
/**
|
|
1886
2762
|
* Creates an instance of AiChatController.
|
|
1887
2763
|
*
|
|
@@ -1897,7 +2773,7 @@ class Pn {
|
|
|
1897
2773
|
* @date 2023-10-16 16:10:29
|
|
1898
2774
|
* @type {Signal<ChatMessage[]>}
|
|
1899
2775
|
*/
|
|
1900
|
-
|
|
2776
|
+
y(this, "messages", ne([]));
|
|
1901
2777
|
/**
|
|
1902
2778
|
* 聊天框输入值
|
|
1903
2779
|
*
|
|
@@ -1905,8 +2781,84 @@ class Pn {
|
|
|
1905
2781
|
* @date 2023-10-16 15:10:43
|
|
1906
2782
|
* @type {Signal<string>}
|
|
1907
2783
|
*/
|
|
1908
|
-
|
|
1909
|
-
|
|
2784
|
+
y(this, "input", ne(""));
|
|
2785
|
+
/**
|
|
2786
|
+
* 视图参数
|
|
2787
|
+
*
|
|
2788
|
+
* @author tony001
|
|
2789
|
+
* @date 2025-02-24 14:02:23
|
|
2790
|
+
* @type {object}
|
|
2791
|
+
*/
|
|
2792
|
+
y(this, "context");
|
|
2793
|
+
/**
|
|
2794
|
+
* 视图参数
|
|
2795
|
+
*
|
|
2796
|
+
* @author tony001
|
|
2797
|
+
* @date 2025-02-24 14:02:32
|
|
2798
|
+
* @type {object}
|
|
2799
|
+
*/
|
|
2800
|
+
y(this, "params");
|
|
2801
|
+
/**
|
|
2802
|
+
* 应用实体标记
|
|
2803
|
+
*
|
|
2804
|
+
* @author tony001
|
|
2805
|
+
* @date 2025-02-24 14:02:10
|
|
2806
|
+
* @type {string}
|
|
2807
|
+
*/
|
|
2808
|
+
y(this, "appDataEntityId");
|
|
2809
|
+
/**
|
|
2810
|
+
* 话题标识
|
|
2811
|
+
*
|
|
2812
|
+
* @author tony001
|
|
2813
|
+
* @date 2025-02-24 18:02:02
|
|
2814
|
+
* @type {(string | undefined)}
|
|
2815
|
+
*/
|
|
2816
|
+
y(this, "topicId");
|
|
2817
|
+
this.opts = e, this.context = e.context, this.params = e.params, this.appDataEntityId = e.appDataEntityId, this.topicId = e.topicId, this.fecthHistory();
|
|
2818
|
+
}
|
|
2819
|
+
/**
|
|
2820
|
+
* 获取历史记录
|
|
2821
|
+
*
|
|
2822
|
+
* @author tony001
|
|
2823
|
+
* @date 2025-02-24 13:02:52
|
|
2824
|
+
* @return {*} {Promise<boolean>}
|
|
2825
|
+
*/
|
|
2826
|
+
async fecthHistory() {
|
|
2827
|
+
if (this.topicId) {
|
|
2828
|
+
const e = await U.getData(k.DATA_BASE_NAME, k.DATA_TABLE_NAME, this.topicId);
|
|
2829
|
+
if (e && e.data && e.data.length > 0)
|
|
2830
|
+
return e.data.forEach((t) => {
|
|
2831
|
+
const i = {
|
|
2832
|
+
messageid: t.messageid,
|
|
2833
|
+
state: t.state,
|
|
2834
|
+
type: t.type,
|
|
2835
|
+
role: t.role,
|
|
2836
|
+
content: t.content,
|
|
2837
|
+
completed: !0
|
|
2838
|
+
};
|
|
2839
|
+
this.addMessage(i);
|
|
2840
|
+
}), !0;
|
|
2841
|
+
}
|
|
2842
|
+
return this.opts.history(this.context, this.params, {
|
|
2843
|
+
appDataEntityId: this.appDataEntityId
|
|
2844
|
+
});
|
|
2845
|
+
}
|
|
2846
|
+
/**
|
|
2847
|
+
* 更新数据到indexdb
|
|
2848
|
+
*
|
|
2849
|
+
* @author tony001
|
|
2850
|
+
* @date 2025-02-24 18:02:41
|
|
2851
|
+
* @return {*} {Promise<void>}
|
|
2852
|
+
*/
|
|
2853
|
+
async asyncToIndexDB() {
|
|
2854
|
+
if (!this.topicId)
|
|
2855
|
+
return;
|
|
2856
|
+
const e = {
|
|
2857
|
+
id: this.topicId,
|
|
2858
|
+
data: this.messages.value.map((t) => t._origin),
|
|
2859
|
+
timestamp: (/* @__PURE__ */ new Date()).getTime()
|
|
2860
|
+
};
|
|
2861
|
+
await U.updateData(k.DATA_BASE_NAME, k.DATA_TABLE_NAME, e);
|
|
1910
2862
|
}
|
|
1911
2863
|
/**
|
|
1912
2864
|
* 设置聊天框值
|
|
@@ -1926,8 +2878,20 @@ class Pn {
|
|
|
1926
2878
|
* @param {IMessage} data
|
|
1927
2879
|
*/
|
|
1928
2880
|
addMessage(e) {
|
|
1929
|
-
const
|
|
1930
|
-
|
|
2881
|
+
const t = this.messages.value.find((i) => i.messageid === e.messageid);
|
|
2882
|
+
t ? (t.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new Le(e)], this.asyncToIndexDB();
|
|
2883
|
+
}
|
|
2884
|
+
/**
|
|
2885
|
+
* 更新消息完成状态
|
|
2886
|
+
*
|
|
2887
|
+
* @author tony001
|
|
2888
|
+
* @date 2025-02-25 17:02:19
|
|
2889
|
+
* @param {string} id
|
|
2890
|
+
* @param {boolean} completed
|
|
2891
|
+
*/
|
|
2892
|
+
completeMessage(e, t) {
|
|
2893
|
+
const i = this.messages.value.find((s) => s.messageid === e);
|
|
2894
|
+
i && (i.updateCompleted(t), this.messages.value = [...this.messages.value], this.asyncToIndexDB());
|
|
1931
2895
|
}
|
|
1932
2896
|
/**
|
|
1933
2897
|
* 替换已经存在的聊天消息
|
|
@@ -1937,8 +2901,8 @@ class Pn {
|
|
|
1937
2901
|
* @param {IChatMessage} data
|
|
1938
2902
|
*/
|
|
1939
2903
|
replaceMessage(e) {
|
|
1940
|
-
const
|
|
1941
|
-
|
|
2904
|
+
const t = this.messages.value.findIndex((i) => i.messageid === e.messageid);
|
|
2905
|
+
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();
|
|
1942
2906
|
}
|
|
1943
2907
|
/**
|
|
1944
2908
|
* 提问
|
|
@@ -1950,11 +2914,13 @@ class Pn {
|
|
|
1950
2914
|
async question(e) {
|
|
1951
2915
|
this.addMessage({
|
|
1952
2916
|
state: 30,
|
|
1953
|
-
messageid:
|
|
2917
|
+
messageid: Lt(),
|
|
1954
2918
|
role: "USER",
|
|
1955
2919
|
type: "DEFAULT",
|
|
1956
2920
|
content: e
|
|
1957
|
-
}), await this.opts.question(this.
|
|
2921
|
+
}), await this.opts.question(this.context, this.params, {
|
|
2922
|
+
appDataEntityId: this.appDataEntityId
|
|
2923
|
+
}, this.messages.value.filter((t) => t.type !== "ERROR").map((t) => t._origin)), this.opts.action && this.opts.action("question", e);
|
|
1958
2924
|
}
|
|
1959
2925
|
/**
|
|
1960
2926
|
* 回填选中的消息
|
|
@@ -1974,25 +2940,29 @@ class Pn {
|
|
|
1974
2940
|
* @memberof AiChatController
|
|
1975
2941
|
*/
|
|
1976
2942
|
deleteMessage(e) {
|
|
1977
|
-
const
|
|
1978
|
-
|
|
2943
|
+
const t = this.messages.value.findIndex((i) => i.messageid === e.messageid);
|
|
2944
|
+
t !== -1 && (this.messages.value.splice(t, 1), this.messages.value = [...this.messages.value]), this.asyncToIndexDB(), this.opts.action && this.opts.action("deletemsg", e);
|
|
1979
2945
|
}
|
|
1980
2946
|
/**
|
|
1981
2947
|
* 刷新当前消息
|
|
1982
2948
|
*
|
|
1983
2949
|
* @memberof AiChatController
|
|
1984
2950
|
*/
|
|
1985
|
-
async refreshMessage(e,
|
|
2951
|
+
async refreshMessage(e, t = !1) {
|
|
1986
2952
|
const i = this.messages.value.findIndex((s) => s.messageid === e.messageid);
|
|
1987
|
-
if (
|
|
1988
|
-
this.messages.value.splice(i + 1, this.messages.value.length - i - 1), this.messages.value = [...this.messages.value], await this.opts.question(this.
|
|
2953
|
+
if (t)
|
|
2954
|
+
this.messages.value.splice(i + 1, this.messages.value.length - i - 1), this.messages.value = [...this.messages.value], await this.opts.question(this.context, this.params, {
|
|
2955
|
+
appDataEntityId: this.appDataEntityId
|
|
2956
|
+
}, this.messages.value.filter((s) => s.type !== "ERROR").map((s) => s._origin));
|
|
1989
2957
|
else if (i === this.messages.value.length - 1)
|
|
1990
|
-
this.messages.value.pop(), this.messages.value = [...this.messages.value], await this.opts.question(this.
|
|
2958
|
+
this.messages.value.pop(), this.messages.value = [...this.messages.value], await this.opts.question(this.context, this.params, {
|
|
2959
|
+
appDataEntityId: this.appDataEntityId
|
|
2960
|
+
}, this.messages.value.filter((s) => s.type !== "ERROR").map((s) => s._origin));
|
|
1991
2961
|
else {
|
|
1992
2962
|
const s = this.messages.value[i - 1].content;
|
|
1993
2963
|
this.messages.value.splice(i - 1, 2), this.question(s);
|
|
1994
2964
|
}
|
|
1995
|
-
this.opts.action && this.opts.action("refreshmsg", e);
|
|
2965
|
+
this.asyncToIndexDB(), this.opts.action && this.opts.action("refreshmsg", e);
|
|
1996
2966
|
}
|
|
1997
2967
|
/**
|
|
1998
2968
|
* 复制消息
|
|
@@ -2001,11 +2971,158 @@ class Pn {
|
|
|
2001
2971
|
* @memberof AiChatController
|
|
2002
2972
|
*/
|
|
2003
2973
|
copyMessage(e) {
|
|
2004
|
-
const
|
|
2005
|
-
|
|
2974
|
+
const t = e.content;
|
|
2975
|
+
Rt.copy(t), this.opts.action && this.opts.action("copymsg", e);
|
|
2976
|
+
}
|
|
2977
|
+
/**
|
|
2978
|
+
* 新建对话
|
|
2979
|
+
*
|
|
2980
|
+
* @memberof AiChatController
|
|
2981
|
+
*/
|
|
2982
|
+
async newDialogue() {
|
|
2983
|
+
this.messages.value.length = 0, this.topicId && await U.deleteData(k.DATA_BASE_NAME, k.DATA_TABLE_NAME, this.topicId), this.opts.history(this.context, this.params, {
|
|
2984
|
+
appDataEntityId: this.appDataEntityId
|
|
2985
|
+
});
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
class ci {
|
|
2989
|
+
/**
|
|
2990
|
+
* Creates an instance of AiTopicController.
|
|
2991
|
+
* @author tony001
|
|
2992
|
+
* @date 2025-02-24 11:02:26
|
|
2993
|
+
* @param {ChatController} chat
|
|
2994
|
+
*/
|
|
2995
|
+
constructor(e) {
|
|
2996
|
+
/**
|
|
2997
|
+
* 话题清单
|
|
2998
|
+
*
|
|
2999
|
+
* @author tony001
|
|
3000
|
+
* @date 2025-02-20 16:02:38
|
|
3001
|
+
* @type {Signal<ChatTopic[]>}
|
|
3002
|
+
*/
|
|
3003
|
+
y(this, "topics", ne([]));
|
|
3004
|
+
/**
|
|
3005
|
+
* 激活话题
|
|
3006
|
+
*
|
|
3007
|
+
* @author tony001
|
|
3008
|
+
* @date 2025-02-24 16:02:44
|
|
3009
|
+
* @type {(Signal<ITopic | null>)}
|
|
3010
|
+
*/
|
|
3011
|
+
y(this, "activedTopic", ne(null));
|
|
3012
|
+
/**
|
|
3013
|
+
* 当前话题配置备份
|
|
3014
|
+
*
|
|
3015
|
+
* @author tony001
|
|
3016
|
+
* @date 2025-02-24 16:02:28
|
|
3017
|
+
* @public
|
|
3018
|
+
* @type {(ITopicOptions | undefined)}
|
|
3019
|
+
*/
|
|
3020
|
+
y(this, "currentTopicOptions");
|
|
3021
|
+
this.chat = e;
|
|
3022
|
+
}
|
|
3023
|
+
/**
|
|
3024
|
+
* 获取历史话题
|
|
3025
|
+
*
|
|
3026
|
+
* @author tony001
|
|
3027
|
+
* @date 2025-02-23 16:02:37
|
|
3028
|
+
* @return {*} {Promise<void>}
|
|
3029
|
+
*/
|
|
3030
|
+
async fetchHistory(e) {
|
|
3031
|
+
const i = await e.configService(e.appid, "aitopics", e.type).load();
|
|
3032
|
+
i && i.length > 0 && i.forEach((s) => {
|
|
3033
|
+
this.topics.value = [...this.topics.value, new ve(s)];
|
|
3034
|
+
});
|
|
3035
|
+
}
|
|
3036
|
+
/**
|
|
3037
|
+
* 更新当前话题
|
|
3038
|
+
*
|
|
3039
|
+
* @author tony001
|
|
3040
|
+
* @date 2025-02-23 17:02:43
|
|
3041
|
+
* @param {ITopicOptions} options
|
|
3042
|
+
* @return {*} {Promise<void>}
|
|
3043
|
+
*/
|
|
3044
|
+
async updateCurrentTopic(e) {
|
|
3045
|
+
this.currentTopicOptions = e;
|
|
3046
|
+
const t = this.topics.value.findIndex((r) => r.id === e.id), i = new ve(e);
|
|
3047
|
+
t !== -1 ? this.topics.value.splice(t, 1, new ve(e)) : this.topics.value = [...this.topics.value, new ve(e)];
|
|
3048
|
+
const s = this.topics.value.map((r) => ({
|
|
3049
|
+
appid: r.appid,
|
|
3050
|
+
id: r.id,
|
|
3051
|
+
type: r.type,
|
|
3052
|
+
caption: r.caption,
|
|
3053
|
+
url: r.url,
|
|
3054
|
+
aiChat: r.aiChat
|
|
3055
|
+
})), o = e.configService(e.appid, "aitopics", e.type);
|
|
3056
|
+
await (o == null ? void 0 : o.save(s)), this.activedTopic.value = i;
|
|
3057
|
+
}
|
|
3058
|
+
/**
|
|
3059
|
+
* 删除话题
|
|
3060
|
+
*
|
|
3061
|
+
* @author tony001
|
|
3062
|
+
* @date 2025-02-24 16:02:03
|
|
3063
|
+
* @param {ITopicOptions} options
|
|
3064
|
+
* @param {object} context
|
|
3065
|
+
* @param {object} params
|
|
3066
|
+
* @param {ITopic} data
|
|
3067
|
+
* @param {MouseEvent} event
|
|
3068
|
+
* @return {*} {Promise<void>}
|
|
3069
|
+
*/
|
|
3070
|
+
async removeTopic(e, t, i, s, o) {
|
|
3071
|
+
var h;
|
|
3072
|
+
let r = !0;
|
|
3073
|
+
if (e.beforeDelete && (r = await e.beforeDelete(t, i, s, o)), !r)
|
|
3074
|
+
return;
|
|
3075
|
+
const c = this.topics.value.findIndex((a) => a.id === s.id);
|
|
3076
|
+
c !== -1 && (this.topics.value.splice(c, 1), this.topics.value = [...this.topics.value]);
|
|
3077
|
+
const u = this.topics.value.map((a) => ({
|
|
3078
|
+
appid: a.appid,
|
|
3079
|
+
id: a.id,
|
|
3080
|
+
type: a.type,
|
|
3081
|
+
caption: a.caption,
|
|
3082
|
+
url: a.url,
|
|
3083
|
+
aiChat: a.aiChat
|
|
3084
|
+
})), d = e.configService(e.appid, "aitopics", e.type);
|
|
3085
|
+
await (d == null ? void 0 : d.save(u)), await U.deleteData(k.DATA_BASE_NAME, k.DATA_TABLE_NAME, s.id), this.topics.value.length > 0 && s.id === ((h = this.activedTopic.value) == null ? void 0 : h.id) && this.handleTopicChange(this.topics.value[0]);
|
|
3086
|
+
}
|
|
3087
|
+
/**
|
|
3088
|
+
* 处理选中变化
|
|
3089
|
+
*
|
|
3090
|
+
* @author tony001
|
|
3091
|
+
* @date 2025-02-20 19:02:27
|
|
3092
|
+
* @param {ChatTopic} item
|
|
3093
|
+
*/
|
|
3094
|
+
handleTopicChange(e) {
|
|
3095
|
+
var t;
|
|
3096
|
+
((t = this.activedTopic.value) == null ? void 0 : t.id) !== e.id && (this.activedTopic.value = e, this.chat.switchAiChatController(e));
|
|
3097
|
+
}
|
|
3098
|
+
/**
|
|
3099
|
+
* 处理话题行为
|
|
3100
|
+
*
|
|
3101
|
+
* @author tony001
|
|
3102
|
+
* @date 2025-02-24 16:02:58
|
|
3103
|
+
* @param {string} action
|
|
3104
|
+
* @param {ChatTopic} topic
|
|
3105
|
+
* @param {MouseEvent} event
|
|
3106
|
+
* @return {*} {Promise<void>}
|
|
3107
|
+
*/
|
|
3108
|
+
async handleTopicAction(e, t, i) {
|
|
3109
|
+
var o, r;
|
|
3110
|
+
const s = this.topics.value.find((c) => c.id === t.id);
|
|
3111
|
+
if (this.currentTopicOptions && s && s.aiChat) {
|
|
3112
|
+
const {
|
|
3113
|
+
context: c,
|
|
3114
|
+
params: u
|
|
3115
|
+
} = s.aiChat;
|
|
3116
|
+
e === "DELETE" && await this.removeTopic(this.currentTopicOptions, c, u, s, i), (r = (o = this.currentTopicOptions).action) == null || r.call(o, e, c, u, t, i);
|
|
3117
|
+
}
|
|
2006
3118
|
}
|
|
2007
3119
|
}
|
|
2008
|
-
class
|
|
3120
|
+
class li {
|
|
3121
|
+
/**
|
|
3122
|
+
* Creates an instance of ChatController.
|
|
3123
|
+
* @author tony001
|
|
3124
|
+
* @date 2025-02-24 11:02:20
|
|
3125
|
+
*/
|
|
2009
3126
|
constructor() {
|
|
2010
3127
|
/**
|
|
2011
3128
|
* 聊天框容器
|
|
@@ -2015,27 +3132,142 @@ class Rn {
|
|
|
2015
3132
|
* @protected
|
|
2016
3133
|
* @type {HTMLDivElement}
|
|
2017
3134
|
*/
|
|
2018
|
-
|
|
3135
|
+
y(this, "container");
|
|
3136
|
+
/**
|
|
3137
|
+
* 默认模式(聊天框)和话题模式(支持多话题切换),聊天框为默认模式
|
|
3138
|
+
*
|
|
3139
|
+
* @author tony001
|
|
3140
|
+
* @date 2025-02-20 16:02:50
|
|
3141
|
+
* @protected
|
|
3142
|
+
* @type {('DEFAULT' | 'TOPIC')}
|
|
3143
|
+
*/
|
|
3144
|
+
y(this, "mode", "DEFAULT");
|
|
3145
|
+
/**
|
|
3146
|
+
* 是否挂载ai话题
|
|
3147
|
+
*
|
|
3148
|
+
* @author tony001
|
|
3149
|
+
* @date 2025-02-23 16:02:54
|
|
3150
|
+
* @protected
|
|
3151
|
+
* @type {boolean}
|
|
3152
|
+
*/
|
|
3153
|
+
y(this, "isMountedAiTopic", !1);
|
|
3154
|
+
/**
|
|
3155
|
+
* 容器配置备份
|
|
3156
|
+
*
|
|
3157
|
+
* @author tony001
|
|
3158
|
+
* @date 2025-02-24 11:02:49
|
|
3159
|
+
* @protected
|
|
3160
|
+
* @type {(IContainerOptions | undefined)}
|
|
3161
|
+
*/
|
|
3162
|
+
y(this, "backupChatOptions");
|
|
3163
|
+
/**
|
|
3164
|
+
* 话题控制器
|
|
3165
|
+
*
|
|
3166
|
+
* @author tony001
|
|
3167
|
+
* @date 2025-02-23 16:02:56
|
|
3168
|
+
* @public
|
|
3169
|
+
* @type {AiTopicController}
|
|
3170
|
+
*/
|
|
3171
|
+
y(this, "aiTopic");
|
|
3172
|
+
/**
|
|
3173
|
+
* 聊天控制器
|
|
3174
|
+
*
|
|
3175
|
+
* @author tony001
|
|
3176
|
+
* @date 2025-02-23 16:02:09
|
|
3177
|
+
* @public
|
|
3178
|
+
* @type {(AiChatController | undefined)}
|
|
3179
|
+
*/
|
|
3180
|
+
y(this, "aiChat");
|
|
3181
|
+
this.aiTopic = new ci(this);
|
|
3182
|
+
}
|
|
3183
|
+
/**
|
|
3184
|
+
* 初始化IndexDB
|
|
3185
|
+
*
|
|
3186
|
+
* @author tony001
|
|
3187
|
+
* @date 2025-02-24 18:02:50
|
|
3188
|
+
* @return {*} {Promise<void>}
|
|
3189
|
+
*/
|
|
3190
|
+
async initIndexDB() {
|
|
3191
|
+
await U.checkTableExists(k.DATA_BASE_NAME, k.DATA_TABLE_NAME) || await U.createTable(k.DATA_BASE_NAME, k.DATA_TABLE_NAME, k.DATA_TABLE_KEY_NAME, !1);
|
|
2019
3192
|
}
|
|
2020
3193
|
/**
|
|
2021
3194
|
* 创建聊天窗口(会同时显示出来)
|
|
2022
3195
|
*
|
|
2023
|
-
* @author
|
|
2024
|
-
* @date
|
|
3196
|
+
* @author tony001
|
|
3197
|
+
* @date 2025-02-24 12:02:58
|
|
3198
|
+
* @param {IContainerOptions} opts
|
|
3199
|
+
* @return {*} {Promise<AiChatController>}
|
|
2025
3200
|
*/
|
|
2026
|
-
create(e) {
|
|
2027
|
-
this.close(), this.container = document.createElement("div"), this.container.classList.add("ibiz-ai-chat"), document.body.appendChild(this.container);
|
|
2028
|
-
const
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
3201
|
+
async create(e) {
|
|
3202
|
+
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);
|
|
3203
|
+
const t = e.chatOptions;
|
|
3204
|
+
let i;
|
|
3205
|
+
return e.mode && e.mode === "TOPIC" && (this.isMountedAiTopic || (await this.aiTopic.fetchHistory(e.topicOptions), this.isMountedAiTopic = !0), i = e.topicOptions, Object.assign(i, {
|
|
3206
|
+
aiChat: {
|
|
3207
|
+
caption: t.caption,
|
|
3208
|
+
context: t.context,
|
|
3209
|
+
params: t.params,
|
|
3210
|
+
appDataEntityId: t.appDataEntityId,
|
|
3211
|
+
contentToolbarItems: t.contentToolbarItems,
|
|
3212
|
+
footerToolbarItems: t.footerToolbarItems
|
|
3213
|
+
}
|
|
3214
|
+
}), await this.aiTopic.updateCurrentTopic(i)), Object.assign(t, {
|
|
3215
|
+
topicId: i == null ? void 0 : i.id
|
|
3216
|
+
}), this.aiChat = new St(t), K(H(Et, {
|
|
3217
|
+
aiTopic: this.aiTopic,
|
|
3218
|
+
aiChat: this.aiChat,
|
|
3219
|
+
mode: e.mode ? e.mode : "DEFAULT",
|
|
3220
|
+
caption: e.mode && e.mode === "TOPIC" ? "AI助手" : t.caption,
|
|
3221
|
+
contentToolbarItems: t.contentToolbarItems,
|
|
3222
|
+
footerToolbarItems: t.footerToolbarItems,
|
|
2032
3223
|
close: () => {
|
|
2033
|
-
this.close(),
|
|
3224
|
+
this.close(), t.closed && t.closed(t.context, t.params);
|
|
3225
|
+
},
|
|
3226
|
+
fullscreen: (s) => {
|
|
3227
|
+
t.fullscreen && t.fullscreen(s, t.context, t.params);
|
|
3228
|
+
},
|
|
3229
|
+
minimize: (s) => {
|
|
3230
|
+
t.minimize && t.minimize(s, t.context, t.params);
|
|
3231
|
+
}
|
|
3232
|
+
}), this.container), this.aiChat;
|
|
3233
|
+
}
|
|
3234
|
+
/**
|
|
3235
|
+
* 切换聊天控制器
|
|
3236
|
+
*
|
|
3237
|
+
* @author tony001
|
|
3238
|
+
* @date 2025-02-24 11:02:24
|
|
3239
|
+
* @param {ChatTopic} topic
|
|
3240
|
+
*/
|
|
3241
|
+
switchAiChatController(e) {
|
|
3242
|
+
var i, s;
|
|
3243
|
+
const t = {
|
|
3244
|
+
...this.backupChatOptions.chatOptions
|
|
3245
|
+
};
|
|
3246
|
+
e.aiChat && Object.assign(t, {
|
|
3247
|
+
caption: e.aiChat.caption,
|
|
3248
|
+
context: e.aiChat.context,
|
|
3249
|
+
params: e.aiChat.params,
|
|
3250
|
+
contentToolbarItems: e.aiChat.contentToolbarItems,
|
|
3251
|
+
footerToolbarItems: e.aiChat.footerToolbarItems,
|
|
3252
|
+
appDataEntityId: e.aiChat.appDataEntityId,
|
|
3253
|
+
topicId: e.id
|
|
3254
|
+
}), this.aiChat = new St(t), this.container && (K(null, this.container), K(H(Et, {
|
|
3255
|
+
aiTopic: this.aiTopic,
|
|
3256
|
+
aiChat: this.aiChat,
|
|
3257
|
+
mode: (i = this.backupChatOptions) != null && i.mode ? this.backupChatOptions.mode : "DEFAULT",
|
|
3258
|
+
caption: (s = this.backupChatOptions) != null && s.mode && this.backupChatOptions.mode === "TOPIC" ? "AI助手" : t.caption,
|
|
3259
|
+
contentToolbarItems: t.contentToolbarItems,
|
|
3260
|
+
footerToolbarItems: t.footerToolbarItems,
|
|
3261
|
+
close: () => {
|
|
3262
|
+
this.close(), t.closed && t.closed(t.context, t.params);
|
|
3263
|
+
},
|
|
3264
|
+
fullscreen: (o) => {
|
|
3265
|
+
t.fullscreen && t.fullscreen(o, t.context, t.params);
|
|
2034
3266
|
},
|
|
2035
|
-
|
|
2036
|
-
|
|
3267
|
+
minimize: (o) => {
|
|
3268
|
+
t.minimize && t.minimize(o, t.context, t.params);
|
|
2037
3269
|
}
|
|
2038
|
-
}), this.container)
|
|
3270
|
+
}), this.container));
|
|
2039
3271
|
}
|
|
2040
3272
|
/**
|
|
2041
3273
|
* 隐藏聊天窗口(必须先创建)
|
|
@@ -2062,11 +3294,11 @@ class Rn {
|
|
|
2062
3294
|
* @date 2023-10-13 17:10:10
|
|
2063
3295
|
*/
|
|
2064
3296
|
close() {
|
|
2065
|
-
this.container && (
|
|
3297
|
+
this.container && (K(null, this.container), this.container.remove(), this.container = void 0);
|
|
2066
3298
|
}
|
|
2067
3299
|
}
|
|
2068
|
-
const
|
|
3300
|
+
const fi = new li();
|
|
2069
3301
|
export {
|
|
2070
|
-
|
|
2071
|
-
|
|
3302
|
+
Et as ChatContainer,
|
|
3303
|
+
fi as chat
|
|
2072
3304
|
};
|