@ibiz-template-plugin/ai-chat 0.0.10 → 0.0.12
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 +1810 -1171
- package/dist/index.legacy.js +1 -1
- package/dist/polyfills.legacy.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/chat-container/chat-container.d.ts +32 -2
- package/dist/types/components/chat-input/chat-input.d.ts +11 -1
- package/dist/types/components/chat-input-material/chat-input-material.d.ts +12 -0
- package/dist/types/components/chat-input-material-item/chat-input-material-item.d.ts +30 -0
- package/dist/types/components/chat-input-material-item/common-material/common-material.d.ts +8 -0
- package/dist/types/components/chat-input-material-item/ossfile-material/ossfile-material.d.ts +7 -0
- package/dist/types/components/chat-topic-item/chat-topic-item.d.ts +2 -2
- package/dist/types/components/popup/popup.d.ts +3 -2
- package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +42 -1
- package/dist/types/controller/ai-material/ai-material-factory.d.ts +6 -0
- package/dist/types/controller/ai-material/common-helper.d.ts +12 -0
- package/dist/types/controller/ai-material/file-helper.d.ts +21 -0
- package/dist/types/controller/ai-material/material-helper.d.ts +15 -0
- package/dist/types/controller/index.d.ts +1 -0
- package/dist/types/entity/chart-material/chart-material.d.ts +9 -0
- package/dist/types/entity/index.d.ts +1 -0
- package/dist/types/icons/default-material-svg.d.ts +1 -0
- package/dist/types/icons/index.d.ts +4 -0
- package/dist/types/icons/material-remove-svg.d.ts +1 -0
- package/dist/types/icons/paperclip-svg.d.ts +1 -0
- package/dist/types/icons/upload-svg.d.ts +1 -0
- package/dist/types/interface/i-chat-container/i-chat-container.d.ts +8 -0
- package/dist/types/interface/i-chat-options/i-chat-options.d.ts +17 -0
- package/dist/types/interface/i-chat-toolbar-item/i-chat-toolbar-item.d.ts +11 -2
- package/dist/types/interface/i-file-uploader-options/i-file-uploader-options.d.ts +27 -0
- package/dist/types/interface/i-material/i-material.d.ts +34 -0
- package/dist/types/interface/index.d.ts +3 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/util/file-uploader.d.ts +36 -0
- package/dist/types/utils/util/material-resource-parser.d.ts +66 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import './style.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
var
|
|
8
|
-
function
|
|
2
|
+
var hn = Object.defineProperty;
|
|
3
|
+
var fn = (n, e, t) => e in n ? hn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
4
|
+
var w = (n, e, t) => (fn(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
|
+
import ze from "interactjs";
|
|
6
|
+
import pn from "cherry-markdown";
|
|
7
|
+
var $e, m, Dt, zt, G, et, Ht, We, Lt, ne = {}, Ot = [], _n = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ke = Array.isArray;
|
|
8
|
+
function F(n, e) {
|
|
9
9
|
for (var t in e)
|
|
10
10
|
n[t] = e[t];
|
|
11
11
|
return n;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Rt(n) {
|
|
14
14
|
var e = n.parentNode;
|
|
15
15
|
e && e.removeChild(n);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function I(n, e, t) {
|
|
18
18
|
var i, s, o, r = {};
|
|
19
19
|
for (o in e)
|
|
20
20
|
o == "key" ? i = e[o] : o == "ref" ? s = e[o] : r[o] = e[o];
|
|
21
|
-
if (arguments.length > 2 && (r.children = arguments.length > 3 ?
|
|
21
|
+
if (arguments.length > 2 && (r.children = arguments.length > 3 ? $e.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null)
|
|
22
22
|
for (o in n.defaultProps)
|
|
23
23
|
r[o] === void 0 && (r[o] = n.defaultProps[o]);
|
|
24
|
-
return
|
|
24
|
+
return be(n, r, i, s, null);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
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 ? ++
|
|
28
|
-
return s == null &&
|
|
26
|
+
function be(n, e, t, i, s) {
|
|
27
|
+
var o = { type: n, props: e, key: t, ref: i, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: s == null ? ++Dt : s };
|
|
28
|
+
return s == null && m.vnode != null && m.vnode(o), o;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function He() {
|
|
31
31
|
return { current: null };
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function se(n) {
|
|
34
34
|
return n.children;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function H(n, e) {
|
|
37
37
|
this.props = n, this.context = e;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function fe(n, e) {
|
|
40
40
|
if (e == null)
|
|
41
|
-
return n.__ ?
|
|
41
|
+
return n.__ ? fe(n.__, n.__.__k.indexOf(n) + 1) : null;
|
|
42
42
|
for (var t; e < n.__k.length; e++)
|
|
43
43
|
if ((t = n.__k[e]) != null && t.__e != null)
|
|
44
44
|
return t.__d || t.__e;
|
|
45
|
-
return typeof n.type == "function" ?
|
|
45
|
+
return typeof n.type == "function" ? fe(n) : null;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Pt(n) {
|
|
48
48
|
var e, t;
|
|
49
49
|
if ((n = n.__) != null && n.__c != null) {
|
|
50
50
|
for (n.__e = n.__c.base = null, e = 0; e < n.__k.length; e++)
|
|
@@ -52,39 +52,39 @@ function It(n) {
|
|
|
52
52
|
n.__e = n.__c.base = t.__e;
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return Pt(n);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
(!n.__d && (n.__d = !0) &&
|
|
58
|
+
function Ve(n) {
|
|
59
|
+
(!n.__d && (n.__d = !0) && G.push(n) && !Te.__r++ || et !== m.debounceRendering) && ((et = m.debounceRendering) || Ht)(Te);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Te() {
|
|
62
62
|
var n, e, t, i, s, o, r, c, u;
|
|
63
|
-
for (
|
|
64
|
-
n.__d && (e =
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
function
|
|
68
|
-
var a, _,
|
|
69
|
-
for (t.__k = [], a = 0; a <
|
|
70
|
-
(
|
|
71
|
-
for (t.__e =
|
|
72
|
-
E[a] != null && (typeof t.type == "function" && E[a].__e != null && E[a].__e == t.__d && (t.__d = E[a].__e.nextSibling),
|
|
73
|
-
}
|
|
74
|
-
function
|
|
63
|
+
for (G.sort(We); n = G.shift(); )
|
|
64
|
+
n.__d && (e = G.length, i = void 0, s = void 0, o = void 0, c = (r = (t = n).__v).__e, (u = t.__P) && (i = [], s = [], (o = F({}, r)).__v = r.__v + 1, Ze(u, r, o, t.__n, u.ownerSVGElement !== void 0, r.__h != null ? [c] : null, i, c == null ? fe(r) : c, r.__h, s), Wt(i, r, s), r.__e != c && Pt(r)), G.length > e && G.sort(We));
|
|
65
|
+
Te.__r = 0;
|
|
66
|
+
}
|
|
67
|
+
function Bt(n, e, t, i, s, o, r, c, u, f, d) {
|
|
68
|
+
var a, _, v, h, p, g, b, C, $, T = 0, E = i && i.__k || Ot, R = E.length, D = R, P = e.length;
|
|
69
|
+
for (t.__k = [], a = 0; a < P; a++)
|
|
70
|
+
(h = t.__k[a] = (h = e[a]) == null || typeof h == "boolean" || typeof h == "function" ? null : typeof h == "string" || typeof h == "number" || typeof h == "bigint" ? be(null, h, null, null, h) : ke(h) ? be(se, { children: h }, null, null, null) : h.__b > 0 ? be(h.type, h.props, h.key, h.ref ? h.ref : null, h.__v) : h) != null ? (h.__ = t, h.__b = t.__b + 1, (C = vn(h, E, b = a + T, D)) === -1 ? v = ne : (v = E[C] || ne, E[C] = void 0, D--), Ze(n, h, v, s, o, r, c, u, f, d), p = h.__e, (_ = h.ref) && v.ref != _ && (v.ref && Ge(v.ref, null, h), d.push(_, h.__c || p, h)), p != null && (g == null && (g = p), ($ = v === ne || v.__v === null) ? C == -1 && T-- : C !== b && (C === b + 1 ? T++ : C > b ? D > P - b ? T += C - b : T-- : T = C < b && C == b - 1 ? C - b : 0), b = a + T, typeof h.type != "function" || C === b && v.__k !== h.__k ? typeof h.type == "function" || C === b && !$ ? h.__d !== void 0 ? (u = h.__d, h.__d = void 0) : u = p.nextSibling : u = Ft(n, p, u) : u = Ut(h, u, n), typeof t.type == "function" && (t.__d = u))) : (v = E[a]) && v.key == null && v.__e && (v.__e == u && (v.__ = i, u = fe(v)), qe(v, v, !1), E[a] = null);
|
|
71
|
+
for (t.__e = g, a = R; a--; )
|
|
72
|
+
E[a] != null && (typeof t.type == "function" && E[a].__e != null && E[a].__e == t.__d && (t.__d = E[a].__e.nextSibling), qe(E[a], E[a]));
|
|
73
|
+
}
|
|
74
|
+
function Ut(n, e, t) {
|
|
75
75
|
for (var i, s = n.__k, o = 0; s && o < s.length; o++)
|
|
76
|
-
(i = s[o]) && (i.__ = n, e = typeof i.type == "function" ?
|
|
76
|
+
(i = s[o]) && (i.__ = n, e = typeof i.type == "function" ? Ut(i, e, t) : Ft(t, i.__e, e));
|
|
77
77
|
return e;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function xe(n, e) {
|
|
80
80
|
return e = e || [], n == null || typeof n == "boolean" || (ke(n) ? n.some(function(t) {
|
|
81
|
-
|
|
81
|
+
xe(t, e);
|
|
82
82
|
}) : e.push(n)), e;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Ft(n, e, t) {
|
|
85
85
|
return t == null || t.parentNode !== n ? n.insertBefore(e, null) : e == t && e.parentNode != null || n.insertBefore(e, t), e.nextSibling;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function vn(n, e, t, i) {
|
|
88
88
|
var s = n.key, o = n.type, r = t - 1, c = t + 1, u = e[t];
|
|
89
89
|
if (u === null || u && s == u.key && o === u.type)
|
|
90
90
|
return t;
|
|
@@ -103,17 +103,17 @@ function nn(n, e, t, i) {
|
|
|
103
103
|
}
|
|
104
104
|
return -1;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function mn(n, e, t, i, s) {
|
|
107
107
|
var o;
|
|
108
108
|
for (o in t)
|
|
109
|
-
o === "children" || o === "key" || o in e ||
|
|
109
|
+
o === "children" || o === "key" || o in e || Se(n, o, null, t[o], i);
|
|
110
110
|
for (o in e)
|
|
111
|
-
s && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || t[o] === e[o] ||
|
|
111
|
+
s && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || t[o] === e[o] || Se(n, o, e[o], t[o], i);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
e[0] === "-" ? n.setProperty(e, t == null ? "" : t) : n[e] = t == null ? "" : typeof t != "number" ||
|
|
113
|
+
function tt(n, e, t) {
|
|
114
|
+
e[0] === "-" ? n.setProperty(e, t == null ? "" : t) : n[e] = t == null ? "" : typeof t != "number" || _n.test(e) ? t : t + "px";
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Se(n, e, t, i, s) {
|
|
117
117
|
var o;
|
|
118
118
|
e:
|
|
119
119
|
if (e === "style")
|
|
@@ -122,13 +122,13 @@ function Ce(n, e, t, i, s) {
|
|
|
122
122
|
else {
|
|
123
123
|
if (typeof i == "string" && (n.style.cssText = i = ""), i)
|
|
124
124
|
for (e in i)
|
|
125
|
-
t && e in t ||
|
|
125
|
+
t && e in t || tt(n.style, e, "");
|
|
126
126
|
if (t)
|
|
127
127
|
for (e in t)
|
|
128
|
-
i && t[e] === i[e] ||
|
|
128
|
+
i && t[e] === i[e] || tt(n.style, e, t[e]);
|
|
129
129
|
}
|
|
130
130
|
else if (e[0] === "o" && e[1] === "n")
|
|
131
|
-
o = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in n ? e.toLowerCase().slice(2) : e.slice(2), n.l || (n.l = {}), n.l[e + o] = t, t ? i ? t.u = i.u : (t.u = Date.now(), n.addEventListener(e, o ?
|
|
131
|
+
o = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in n ? e.toLowerCase().slice(2) : e.slice(2), n.l || (n.l = {}), n.l[e + o] = t, t ? i ? t.u = i.u : (t.u = Date.now(), n.addEventListener(e, o ? it : nt, o)) : n.removeEventListener(e, o ? it : nt, o);
|
|
132
132
|
else if (e !== "dangerouslySetInnerHTML") {
|
|
133
133
|
if (s)
|
|
134
134
|
e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
@@ -141,133 +141,154 @@ function Ce(n, e, t, i, s) {
|
|
|
141
141
|
typeof t == "function" || (t == null || t === !1 && e[4] !== "-" ? n.removeAttribute(e) : n.setAttribute(e, t));
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function nt(n) {
|
|
145
145
|
var e = this.l[n.type + !1];
|
|
146
146
|
if (n.t) {
|
|
147
147
|
if (n.t <= e.u)
|
|
148
148
|
return;
|
|
149
149
|
} else
|
|
150
150
|
n.t = Date.now();
|
|
151
|
-
return e(
|
|
151
|
+
return e(m.event ? m.event(n) : n);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
return this.l[n.type + !0](
|
|
153
|
+
function it(n) {
|
|
154
|
+
return this.l[n.type + !0](m.event ? m.event(n) : n);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
var
|
|
156
|
+
function Ze(n, e, t, i, s, o, r, c, u, f) {
|
|
157
|
+
var d, a, _, v, h, p, g, b, C, $, T, E, R, D, P, z = e.type;
|
|
158
158
|
if (e.constructor !== void 0)
|
|
159
159
|
return null;
|
|
160
|
-
t.__h != null && (u = t.__h, c = e.__e = t.__e, e.__h = null, o = [c]), (
|
|
160
|
+
t.__h != null && (u = t.__h, c = e.__e = t.__e, e.__h = null, o = [c]), (d = m.__b) && d(e);
|
|
161
161
|
e:
|
|
162
|
-
if (typeof
|
|
162
|
+
if (typeof z == "function")
|
|
163
163
|
try {
|
|
164
|
-
if (b = e.props, C = (
|
|
165
|
-
|
|
164
|
+
if (b = e.props, C = (d = z.contextType) && i[d.__c], $ = d ? C ? C.props.value : d.__ : i, t.__c ? g = (a = e.__c = t.__c).__ = a.__E : ("prototype" in z && z.prototype.render ? e.__c = a = new z(b, $) : (e.__c = a = new H(b, $), a.constructor = z, a.render = yn), C && C.sub(a), a.props = b, a.state || (a.state = {}), a.context = $, a.__n = i, _ = a.__d = !0, a.__h = [], a._sb = []), a.__s == null && (a.__s = a.state), z.getDerivedStateFromProps != null && (a.__s == a.state && (a.__s = F({}, a.__s)), F(a.__s, z.getDerivedStateFromProps(b, a.__s))), v = a.props, h = a.state, a.__v = e, _)
|
|
165
|
+
z.getDerivedStateFromProps == null && a.componentWillMount != null && a.componentWillMount(), a.componentDidMount != null && a.__h.push(a.componentDidMount);
|
|
166
166
|
else {
|
|
167
|
-
if (
|
|
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(
|
|
169
|
-
|
|
167
|
+
if (z.getDerivedStateFromProps == null && b !== v && a.componentWillReceiveProps != null && a.componentWillReceiveProps(b, $), !a.__e && (a.shouldComponentUpdate != null && a.shouldComponentUpdate(b, a.__s, $) === !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(ve) {
|
|
169
|
+
ve && (ve.__ = e);
|
|
170
170
|
}), T = 0; T < a._sb.length; T++)
|
|
171
171
|
a.__h.push(a._sb[T]);
|
|
172
172
|
a._sb = [], a.__h.length && r.push(a);
|
|
173
173
|
break e;
|
|
174
174
|
}
|
|
175
|
-
a.componentWillUpdate != null && a.componentWillUpdate(b, a.__s,
|
|
176
|
-
a.componentDidUpdate(
|
|
175
|
+
a.componentWillUpdate != null && a.componentWillUpdate(b, a.__s, $), a.componentDidUpdate != null && a.__h.push(function() {
|
|
176
|
+
a.componentDidUpdate(v, h, p);
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
if (a.context =
|
|
180
|
-
for (a.state = a.__s, a.__d = !1, E && E(e),
|
|
181
|
-
a.__h.push(a._sb[
|
|
179
|
+
if (a.context = $, a.props = b, a.__P = n, a.__e = !1, E = m.__r, R = 0, "prototype" in z && z.prototype.render) {
|
|
180
|
+
for (a.state = a.__s, a.__d = !1, E && E(e), d = a.render(a.props, a.state, a.context), D = 0; D < a._sb.length; D++)
|
|
181
|
+
a.__h.push(a._sb[D]);
|
|
182
182
|
a._sb = [];
|
|
183
183
|
} else
|
|
184
184
|
do
|
|
185
|
-
a.__d = !1, E && E(e),
|
|
186
|
-
while (a.__d && ++
|
|
187
|
-
a.state = a.__s, a.getChildContext != null && (i =
|
|
188
|
-
} catch (
|
|
189
|
-
e.__v = null, (u || o != null) && (e.__e = c, e.__h = !!u, o[o.indexOf(c)] = null),
|
|
185
|
+
a.__d = !1, E && E(e), d = a.render(a.props, a.state, a.context), a.state = a.__s;
|
|
186
|
+
while (a.__d && ++R < 25);
|
|
187
|
+
a.state = a.__s, a.getChildContext != null && (i = F(F({}, i), a.getChildContext())), _ || a.getSnapshotBeforeUpdate == null || (p = a.getSnapshotBeforeUpdate(v, h)), Bt(n, ke(P = d != null && d.type === se && d.key == null ? d.props.children : d) ? P : [P], e, t, i, s, o, r, c, u, f), a.base = e.__e, e.__h = null, a.__h.length && r.push(a), g && (a.__E = a.__ = null);
|
|
188
|
+
} catch (ve) {
|
|
189
|
+
e.__v = null, (u || o != null) && (e.__e = c, e.__h = !!u, o[o.indexOf(c)] = null), m.__e(ve, e, t);
|
|
190
190
|
}
|
|
191
191
|
else
|
|
192
|
-
o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e =
|
|
193
|
-
(
|
|
192
|
+
o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = gn(t.__e, e, t, i, s, o, r, u, f);
|
|
193
|
+
(d = m.diffed) && d(e);
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function Wt(n, e, t) {
|
|
196
196
|
for (var i = 0; i < t.length; i++)
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
Ge(t[i], t[++i], t[++i]);
|
|
198
|
+
m.__c && m.__c(e, n), n.some(function(s) {
|
|
199
199
|
try {
|
|
200
200
|
n = s.__h, s.__h = [], n.some(function(o) {
|
|
201
201
|
o.call(s);
|
|
202
202
|
});
|
|
203
203
|
} catch (o) {
|
|
204
|
-
|
|
204
|
+
m.__e(o, s.__v);
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
var
|
|
210
|
-
if (
|
|
211
|
-
for (;
|
|
212
|
-
if ((
|
|
213
|
-
n =
|
|
208
|
+
function gn(n, e, t, i, s, o, r, c, u) {
|
|
209
|
+
var f, d, a, _ = t.props, v = e.props, h = e.type, p = 0;
|
|
210
|
+
if (h === "svg" && (s = !0), o != null) {
|
|
211
|
+
for (; p < o.length; p++)
|
|
212
|
+
if ((f = o[p]) && "setAttribute" in f == !!h && (h ? f.localName === h : f.nodeType === 3)) {
|
|
213
|
+
n = f, o[p] = null;
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
if (n == null) {
|
|
218
|
-
if (
|
|
219
|
-
return document.createTextNode(
|
|
220
|
-
n = s ? document.createElementNS("http://www.w3.org/2000/svg",
|
|
218
|
+
if (h === null)
|
|
219
|
+
return document.createTextNode(v);
|
|
220
|
+
n = s ? document.createElementNS("http://www.w3.org/2000/svg", h) : document.createElement(h, v.is && v), o = null, c = !1;
|
|
221
221
|
}
|
|
222
|
-
if (
|
|
223
|
-
_ ===
|
|
222
|
+
if (h === null)
|
|
223
|
+
_ === v || c && n.data === v || (n.data = v);
|
|
224
224
|
else {
|
|
225
|
-
if (o = o &&
|
|
225
|
+
if (o = o && $e.call(n.childNodes), d = (_ = t.props || ne).dangerouslySetInnerHTML, a = v.dangerouslySetInnerHTML, !c) {
|
|
226
226
|
if (o != null)
|
|
227
|
-
for (_ = {},
|
|
228
|
-
_[n.attributes[
|
|
229
|
-
(a ||
|
|
227
|
+
for (_ = {}, p = 0; p < n.attributes.length; p++)
|
|
228
|
+
_[n.attributes[p].name] = n.attributes[p].value;
|
|
229
|
+
(a || d) && (a && (d && a.__html == d.__html || a.__html === n.innerHTML) || (n.innerHTML = a && a.__html || ""));
|
|
230
230
|
}
|
|
231
|
-
if (
|
|
231
|
+
if (mn(n, v, _, s, c), a)
|
|
232
232
|
e.__k = [];
|
|
233
|
-
else if (
|
|
234
|
-
for (
|
|
235
|
-
o[
|
|
236
|
-
c || ("value" in
|
|
233
|
+
else if (Bt(n, ke(p = e.props.children) ? p : [p], e, t, i, s && h !== "foreignObject", o, r, o ? o[0] : t.__k && fe(t, 0), c, u), o != null)
|
|
234
|
+
for (p = o.length; p--; )
|
|
235
|
+
o[p] != null && Rt(o[p]);
|
|
236
|
+
c || ("value" in v && (p = v.value) !== void 0 && (p !== n.value || h === "progress" && !p || h === "option" && p !== _.value) && Se(n, "value", p, _.value, !1), "checked" in v && (p = v.checked) !== void 0 && p !== n.checked && Se(n, "checked", p, _.checked, !1));
|
|
237
237
|
}
|
|
238
238
|
return n;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function Ge(n, e, t) {
|
|
241
241
|
try {
|
|
242
242
|
typeof n == "function" ? n(e) : n.current = e;
|
|
243
243
|
} catch (i) {
|
|
244
|
-
|
|
244
|
+
m.__e(i, t);
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function qe(n, e, t) {
|
|
248
248
|
var i, s;
|
|
249
|
-
if (
|
|
249
|
+
if (m.unmount && m.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || Ge(i, null, e)), (i = n.__c) != null) {
|
|
250
250
|
if (i.componentWillUnmount)
|
|
251
251
|
try {
|
|
252
252
|
i.componentWillUnmount();
|
|
253
253
|
} catch (o) {
|
|
254
|
-
|
|
254
|
+
m.__e(o, e);
|
|
255
255
|
}
|
|
256
256
|
i.base = i.__P = null, n.__c = void 0;
|
|
257
257
|
}
|
|
258
258
|
if (i = n.__k)
|
|
259
259
|
for (s = 0; s < i.length; s++)
|
|
260
|
-
i[s] &&
|
|
261
|
-
t || n.__e == null ||
|
|
260
|
+
i[s] && qe(i[s], e, t || typeof n.type != "function");
|
|
261
|
+
t || n.__e == null || Rt(n.__e), n.__ = n.__e = n.__d = void 0;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function yn(n, e, t) {
|
|
264
264
|
return this.constructor(n, t);
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function te(n, e, t) {
|
|
267
267
|
var i, s, o, r;
|
|
268
|
-
|
|
268
|
+
m.__ && m.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, o = [], r = [], Ze(e, n = (!i && t || e).__k = I(se, null, [n]), s || ne, ne, e.ownerSVGElement !== void 0, !i && t ? [t] : s ? null : e.firstChild ? $e.call(e.childNodes) : null, o, !i && t ? t : s ? s.__e : e.firstChild, i, r), Wt(o, n, r);
|
|
269
|
+
}
|
|
270
|
+
function bn(n, e) {
|
|
271
|
+
var t = { __c: e = "__cC" + Lt++, __: n, Consumer: function(i, s) {
|
|
272
|
+
return i.children(s);
|
|
273
|
+
}, Provider: function(i) {
|
|
274
|
+
var s, o;
|
|
275
|
+
return this.getChildContext || (s = [], (o = {})[e] = this, this.getChildContext = function() {
|
|
276
|
+
return o;
|
|
277
|
+
}, this.shouldComponentUpdate = function(r) {
|
|
278
|
+
this.props.value !== r.value && s.some(function(c) {
|
|
279
|
+
c.__e = !0, Ve(c);
|
|
280
|
+
});
|
|
281
|
+
}, this.sub = function(r) {
|
|
282
|
+
s.push(r);
|
|
283
|
+
var c = r.componentWillUnmount;
|
|
284
|
+
r.componentWillUnmount = function() {
|
|
285
|
+
s.splice(s.indexOf(r), 1), c && c.call(r);
|
|
286
|
+
};
|
|
287
|
+
}), i.children;
|
|
288
|
+
} };
|
|
289
|
+
return t.Provider.__ = t.Consumer.contextType = t;
|
|
269
290
|
}
|
|
270
|
-
|
|
291
|
+
$e = Ot.slice, m = { __e: function(n, e, t, i) {
|
|
271
292
|
for (var s, o, r; e = e.__; )
|
|
272
293
|
if ((s = e.__c) && !s.__)
|
|
273
294
|
try {
|
|
@@ -277,22 +298,22 @@ Se = xt.slice, v = { __e: function(n, e, t, i) {
|
|
|
277
298
|
n = c;
|
|
278
299
|
}
|
|
279
300
|
throw n;
|
|
280
|
-
} },
|
|
301
|
+
} }, Dt = 0, zt = function(n) {
|
|
281
302
|
return n != null && n.constructor === void 0;
|
|
282
|
-
},
|
|
303
|
+
}, H.prototype.setState = function(n, e) {
|
|
283
304
|
var t;
|
|
284
|
-
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s =
|
|
285
|
-
},
|
|
286
|
-
this.__v && (this.__e = !0, n && this.__h.push(n),
|
|
287
|
-
},
|
|
305
|
+
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = F({}, this.state), typeof n == "function" && (n = n(F({}, t), this.props)), n && F(t, n), n != null && this.__v && (e && this._sb.push(e), Ve(this));
|
|
306
|
+
}, H.prototype.forceUpdate = function(n) {
|
|
307
|
+
this.__v && (this.__e = !0, n && this.__h.push(n), Ve(this));
|
|
308
|
+
}, H.prototype.render = se, G = [], Ht = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, We = function(n, e) {
|
|
288
309
|
return n.__v.__b - e.__v.__b;
|
|
289
|
-
},
|
|
290
|
-
const
|
|
291
|
-
function
|
|
310
|
+
}, Te.__r = 0, Lt = 0;
|
|
311
|
+
const wn = "ibiz", Cn = "is-";
|
|
312
|
+
function X(n, e, t, i, s) {
|
|
292
313
|
let o = "".concat(n, "-").concat(e);
|
|
293
314
|
return t && (o += "-".concat(t)), i && (o += "__".concat(i)), s && (o += "--".concat(s)), o;
|
|
294
315
|
}
|
|
295
|
-
class
|
|
316
|
+
class M {
|
|
296
317
|
/**
|
|
297
318
|
* Creates an instance of Namespace.
|
|
298
319
|
*
|
|
@@ -309,8 +330,8 @@ class A {
|
|
|
309
330
|
* @date 2023-11-03 10:11:31
|
|
310
331
|
* @type {string}
|
|
311
332
|
*/
|
|
312
|
-
|
|
313
|
-
this.block = e, this.namespace = t ||
|
|
333
|
+
w(this, "namespace");
|
|
334
|
+
this.block = e, this.namespace = t || wn;
|
|
314
335
|
}
|
|
315
336
|
/**
|
|
316
337
|
* namespace-block
|
|
@@ -322,7 +343,7 @@ class A {
|
|
|
322
343
|
* @return {*} {string}
|
|
323
344
|
*/
|
|
324
345
|
b(e = "") {
|
|
325
|
-
return
|
|
346
|
+
return X(this.namespace, this.block, e, "", "");
|
|
326
347
|
}
|
|
327
348
|
/**
|
|
328
349
|
* namespace-block__element
|
|
@@ -333,7 +354,7 @@ class A {
|
|
|
333
354
|
* @return {*} {string}
|
|
334
355
|
*/
|
|
335
356
|
e(e) {
|
|
336
|
-
return e ?
|
|
357
|
+
return e ? X(this.namespace, this.block, "", e, "") : "";
|
|
337
358
|
}
|
|
338
359
|
/**
|
|
339
360
|
* namespace-block--modifier
|
|
@@ -344,7 +365,7 @@ class A {
|
|
|
344
365
|
* @return {*} {string}
|
|
345
366
|
*/
|
|
346
367
|
m(e) {
|
|
347
|
-
return e ?
|
|
368
|
+
return e ? X(this.namespace, this.block, "", "", e) : "";
|
|
348
369
|
}
|
|
349
370
|
/**
|
|
350
371
|
* namespace-block-blockSuffix__element
|
|
@@ -356,7 +377,7 @@ class A {
|
|
|
356
377
|
* @return {*} {string}
|
|
357
378
|
*/
|
|
358
379
|
be(e, t) {
|
|
359
|
-
return e && t ?
|
|
380
|
+
return e && t ? X(this.namespace, this.block, e, t, "") : "";
|
|
360
381
|
}
|
|
361
382
|
/**
|
|
362
383
|
* namespace-block__element--modifier
|
|
@@ -368,7 +389,7 @@ class A {
|
|
|
368
389
|
* @return {*} {string}
|
|
369
390
|
*/
|
|
370
391
|
em(e, t) {
|
|
371
|
-
return e && t ?
|
|
392
|
+
return e && t ? X(this.namespace, this.block, "", e, t) : "";
|
|
372
393
|
}
|
|
373
394
|
/**
|
|
374
395
|
* namespace-block-blockSuffix--modifier
|
|
@@ -380,7 +401,7 @@ class A {
|
|
|
380
401
|
* @return {*} {string}
|
|
381
402
|
*/
|
|
382
403
|
bm(e, t) {
|
|
383
|
-
return e && t ?
|
|
404
|
+
return e && t ? X(this.namespace, this.block, e, "", t) : "";
|
|
384
405
|
}
|
|
385
406
|
/**
|
|
386
407
|
* namespace-block-blockSuffix__element--modifier
|
|
@@ -393,7 +414,7 @@ class A {
|
|
|
393
414
|
* @return {*} {string}
|
|
394
415
|
*/
|
|
395
416
|
bem(e, t, i) {
|
|
396
|
-
return e && t && i ?
|
|
417
|
+
return e && t && i ? X(this.namespace, this.block, e, t, i) : "";
|
|
397
418
|
}
|
|
398
419
|
/**
|
|
399
420
|
* 返回状态 class
|
|
@@ -408,7 +429,7 @@ class A {
|
|
|
408
429
|
* @return {*} {string}
|
|
409
430
|
*/
|
|
410
431
|
is(e, t) {
|
|
411
|
-
return e && t ? "".concat(
|
|
432
|
+
return e && t ? "".concat(Cn).concat(e) : "";
|
|
412
433
|
}
|
|
413
434
|
/**
|
|
414
435
|
* 生成使用到的 css 变量 style 对象
|
|
@@ -461,11 +482,11 @@ class A {
|
|
|
461
482
|
return "--".concat(this.namespace, "-").concat(this.block, "-").concat(e);
|
|
462
483
|
}
|
|
463
484
|
}
|
|
464
|
-
function
|
|
485
|
+
function L(n) {
|
|
465
486
|
if (typeof n != "string")
|
|
466
487
|
throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
|
|
467
488
|
}
|
|
468
|
-
function
|
|
489
|
+
function st(n, e) {
|
|
469
490
|
for (var t = "", i = 0, s = -1, o = 0, r, c = 0; c <= n.length; ++c) {
|
|
470
491
|
if (c < n.length)
|
|
471
492
|
r = n.charCodeAt(c);
|
|
@@ -498,70 +519,70 @@ function Qe(n, e) {
|
|
|
498
519
|
}
|
|
499
520
|
return t;
|
|
500
521
|
}
|
|
501
|
-
function
|
|
522
|
+
function Tn(n, e) {
|
|
502
523
|
var t = e.dir || e.root, i = e.base || (e.name || "") + (e.ext || "");
|
|
503
524
|
return t ? t === e.root ? t + i : t + n + i : i;
|
|
504
525
|
}
|
|
505
|
-
var
|
|
526
|
+
var ue = {
|
|
506
527
|
// path.resolve([from ...], to)
|
|
507
528
|
resolve: function() {
|
|
508
529
|
for (var e = "", t = !1, i, s = arguments.length - 1; s >= -1 && !t; s--) {
|
|
509
530
|
var o;
|
|
510
|
-
s >= 0 ? o = arguments[s] : (i === void 0 && (i = process.cwd()), o = i),
|
|
531
|
+
s >= 0 ? o = arguments[s] : (i === void 0 && (i = process.cwd()), o = i), L(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
|
|
511
532
|
}
|
|
512
|
-
return e =
|
|
533
|
+
return e = st(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
|
|
513
534
|
},
|
|
514
535
|
normalize: function(e) {
|
|
515
|
-
if (
|
|
536
|
+
if (L(e), e.length === 0)
|
|
516
537
|
return ".";
|
|
517
538
|
var t = e.charCodeAt(0) === 47, i = e.charCodeAt(e.length - 1) === 47;
|
|
518
|
-
return e =
|
|
539
|
+
return e = st(e, !t), e.length === 0 && !t && (e = "."), e.length > 0 && i && (e += "/"), t ? "/" + e : e;
|
|
519
540
|
},
|
|
520
541
|
isAbsolute: function(e) {
|
|
521
|
-
return
|
|
542
|
+
return L(e), e.length > 0 && e.charCodeAt(0) === 47;
|
|
522
543
|
},
|
|
523
544
|
join: function() {
|
|
524
545
|
if (arguments.length === 0)
|
|
525
546
|
return ".";
|
|
526
547
|
for (var e, t = 0; t < arguments.length; ++t) {
|
|
527
548
|
var i = arguments[t];
|
|
528
|
-
|
|
549
|
+
L(i), i.length > 0 && (e === void 0 ? e = i : e += "/" + i);
|
|
529
550
|
}
|
|
530
|
-
return e === void 0 ? "." :
|
|
551
|
+
return e === void 0 ? "." : ue.normalize(e);
|
|
531
552
|
},
|
|
532
553
|
relative: function(e, t) {
|
|
533
|
-
if (
|
|
554
|
+
if (L(e), L(t), e === t || (e = ue.resolve(e), t = ue.resolve(t), e === t))
|
|
534
555
|
return "";
|
|
535
556
|
for (var i = 1; i < e.length && e.charCodeAt(i) === 47; ++i)
|
|
536
557
|
;
|
|
537
558
|
for (var s = e.length, o = s - i, r = 1; r < t.length && t.charCodeAt(r) === 47; ++r)
|
|
538
559
|
;
|
|
539
|
-
for (var c = t.length, u = c - r,
|
|
540
|
-
if (a ===
|
|
541
|
-
if (u >
|
|
560
|
+
for (var c = t.length, u = c - r, f = o < u ? o : u, d = -1, a = 0; a <= f; ++a) {
|
|
561
|
+
if (a === f) {
|
|
562
|
+
if (u > f) {
|
|
542
563
|
if (t.charCodeAt(r + a) === 47)
|
|
543
564
|
return t.slice(r + a + 1);
|
|
544
565
|
if (a === 0)
|
|
545
566
|
return t.slice(r + a);
|
|
546
567
|
} else
|
|
547
|
-
o >
|
|
568
|
+
o > f && (e.charCodeAt(i + a) === 47 ? d = a : a === 0 && (d = 0));
|
|
548
569
|
break;
|
|
549
570
|
}
|
|
550
|
-
var _ = e.charCodeAt(i + a),
|
|
551
|
-
if (_ !==
|
|
571
|
+
var _ = e.charCodeAt(i + a), v = t.charCodeAt(r + a);
|
|
572
|
+
if (_ !== v)
|
|
552
573
|
break;
|
|
553
|
-
_ === 47 && (
|
|
574
|
+
_ === 47 && (d = a);
|
|
554
575
|
}
|
|
555
|
-
var
|
|
556
|
-
for (a = i +
|
|
557
|
-
(a === s || e.charCodeAt(a) === 47) && (
|
|
558
|
-
return
|
|
576
|
+
var h = "";
|
|
577
|
+
for (a = i + d + 1; a <= s; ++a)
|
|
578
|
+
(a === s || e.charCodeAt(a) === 47) && (h.length === 0 ? h += ".." : h += "/..");
|
|
579
|
+
return h.length > 0 ? h + t.slice(r + d) : (r += d, t.charCodeAt(r) === 47 && ++r, t.slice(r));
|
|
559
580
|
},
|
|
560
581
|
_makeLong: function(e) {
|
|
561
582
|
return e;
|
|
562
583
|
},
|
|
563
584
|
dirname: function(e) {
|
|
564
|
-
if (
|
|
585
|
+
if (L(e), e.length === 0)
|
|
565
586
|
return ".";
|
|
566
587
|
for (var t = e.charCodeAt(0), i = t === 47, s = -1, o = !0, r = e.length - 1; r >= 1; --r)
|
|
567
588
|
if (t = e.charCodeAt(r), t === 47) {
|
|
@@ -576,21 +597,21 @@ var re = {
|
|
|
576
597
|
basename: function(e, t) {
|
|
577
598
|
if (t !== void 0 && typeof t != "string")
|
|
578
599
|
throw new TypeError('"ext" argument must be a string');
|
|
579
|
-
|
|
600
|
+
L(e);
|
|
580
601
|
var i = 0, s = -1, o = !0, r;
|
|
581
602
|
if (t !== void 0 && t.length > 0 && t.length <= e.length) {
|
|
582
603
|
if (t.length === e.length && t === e)
|
|
583
604
|
return "";
|
|
584
605
|
var c = t.length - 1, u = -1;
|
|
585
606
|
for (r = e.length - 1; r >= 0; --r) {
|
|
586
|
-
var
|
|
587
|
-
if (
|
|
607
|
+
var f = e.charCodeAt(r);
|
|
608
|
+
if (f === 47) {
|
|
588
609
|
if (!o) {
|
|
589
610
|
i = r + 1;
|
|
590
611
|
break;
|
|
591
612
|
}
|
|
592
613
|
} else
|
|
593
|
-
u === -1 && (o = !1, u = r + 1), c >= 0 && (
|
|
614
|
+
u === -1 && (o = !1, u = r + 1), c >= 0 && (f === t.charCodeAt(c) ? --c === -1 && (s = r) : (c = -1, s = u));
|
|
594
615
|
}
|
|
595
616
|
return i === s ? s = u : s === -1 && (s = e.length), e.slice(i, s);
|
|
596
617
|
} else {
|
|
@@ -606,7 +627,7 @@ var re = {
|
|
|
606
627
|
}
|
|
607
628
|
},
|
|
608
629
|
extname: function(e) {
|
|
609
|
-
|
|
630
|
+
L(e);
|
|
610
631
|
for (var t = -1, i = 0, s = -1, o = !0, r = 0, c = e.length - 1; c >= 0; --c) {
|
|
611
632
|
var u = e.charCodeAt(c);
|
|
612
633
|
if (u === 47) {
|
|
@@ -625,24 +646,24 @@ var re = {
|
|
|
625
646
|
format: function(e) {
|
|
626
647
|
if (e === null || typeof e != "object")
|
|
627
648
|
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof e);
|
|
628
|
-
return
|
|
649
|
+
return Tn("/", e);
|
|
629
650
|
},
|
|
630
651
|
parse: function(e) {
|
|
631
|
-
|
|
652
|
+
L(e);
|
|
632
653
|
var t = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
633
654
|
if (e.length === 0)
|
|
634
655
|
return t;
|
|
635
656
|
var i = e.charCodeAt(0), s = i === 47, o;
|
|
636
657
|
s ? (t.root = "/", o = 1) : o = 0;
|
|
637
|
-
for (var r = -1, c = 0, u = -1,
|
|
638
|
-
if (i = e.charCodeAt(
|
|
639
|
-
if (!
|
|
640
|
-
c =
|
|
658
|
+
for (var r = -1, c = 0, u = -1, f = !0, d = e.length - 1, a = 0; d >= o; --d) {
|
|
659
|
+
if (i = e.charCodeAt(d), i === 47) {
|
|
660
|
+
if (!f) {
|
|
661
|
+
c = d + 1;
|
|
641
662
|
break;
|
|
642
663
|
}
|
|
643
664
|
continue;
|
|
644
665
|
}
|
|
645
|
-
u === -1 && (
|
|
666
|
+
u === -1 && (f = !1, u = d + 1), i === 46 ? r === -1 ? r = d : a !== 1 && (a = 1) : r !== -1 && (a = -1);
|
|
646
667
|
}
|
|
647
668
|
return r === -1 || u === -1 || // We saw a non-dot character immediately before the dot
|
|
648
669
|
a === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
@@ -653,14 +674,14 @@ var re = {
|
|
|
653
674
|
win32: null,
|
|
654
675
|
posix: null
|
|
655
676
|
};
|
|
656
|
-
|
|
657
|
-
function
|
|
677
|
+
ue.posix = ue;
|
|
678
|
+
function B() {
|
|
658
679
|
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
659
680
|
}
|
|
660
|
-
function
|
|
661
|
-
return "".concat(
|
|
681
|
+
function Vt() {
|
|
682
|
+
return "".concat(B() + B(), "-").concat(B(), "-").concat(B(), "-").concat(B(), "-").concat(B()).concat(B()).concat(B());
|
|
662
683
|
}
|
|
663
|
-
class
|
|
684
|
+
class qt {
|
|
664
685
|
/**
|
|
665
686
|
* 拷贝文本
|
|
666
687
|
*
|
|
@@ -681,8 +702,8 @@ class Rt {
|
|
|
681
702
|
* @private
|
|
682
703
|
* @type {(HTMLInputElement | null)}
|
|
683
704
|
*/
|
|
684
|
-
|
|
685
|
-
const
|
|
705
|
+
w(qt, "inputElement", null);
|
|
706
|
+
const y = class y {
|
|
686
707
|
/**
|
|
687
708
|
* 检查数据库是否存在
|
|
688
709
|
*
|
|
@@ -705,7 +726,7 @@ const m = class m {
|
|
|
705
726
|
*/
|
|
706
727
|
static async deleteDatabase(e) {
|
|
707
728
|
var t, i;
|
|
708
|
-
return
|
|
729
|
+
return y.lastLink && ((i = (t = y.lastLink).close) == null || i.call(t)), new Promise((s, o) => {
|
|
709
730
|
const r = indexedDB.deleteDatabase(e);
|
|
710
731
|
r.onsuccess = () => {
|
|
711
732
|
s(!0);
|
|
@@ -725,13 +746,13 @@ const m = class m {
|
|
|
725
746
|
* @memberof IndexedDBUtil
|
|
726
747
|
*/
|
|
727
748
|
static async checkTableExists(e, t) {
|
|
728
|
-
return await
|
|
749
|
+
return await y.checkDataBaseExists(e) ? new Promise((s, o) => {
|
|
729
750
|
const r = indexedDB.open(e);
|
|
730
751
|
r.onupgradeneeded = (c) => {
|
|
731
|
-
|
|
752
|
+
y.db = c.target.result, y.version = y.db.version;
|
|
732
753
|
}, r.onsuccess = (c) => {
|
|
733
|
-
|
|
734
|
-
const u =
|
|
754
|
+
y.db = c.target.result, y.lastLink = r.result;
|
|
755
|
+
const u = y.db.objectStoreNames.contains(t);
|
|
735
756
|
r.result.close(), s(u);
|
|
736
757
|
}, r.onerror = (c) => {
|
|
737
758
|
o(c.target.error);
|
|
@@ -750,15 +771,15 @@ const m = class m {
|
|
|
750
771
|
static async createTable(e, t, i, s = !1) {
|
|
751
772
|
return new Promise((o) => {
|
|
752
773
|
var c, u;
|
|
753
|
-
|
|
754
|
-
const r = indexedDB.open(e,
|
|
755
|
-
r.onupgradeneeded = (
|
|
756
|
-
if (
|
|
757
|
-
const
|
|
758
|
-
i ?
|
|
774
|
+
y.version += 1, y.lastLink && ((u = (c = y.lastLink).close) == null || u.call(c));
|
|
775
|
+
const r = indexedDB.open(e, y.version);
|
|
776
|
+
r.onupgradeneeded = (f) => {
|
|
777
|
+
if (y.db = f.target.result, !y.db.objectStoreNames.contains(t)) {
|
|
778
|
+
const d = {};
|
|
779
|
+
i ? d.keyPath = i : s && (d.autoIncrement = !0), y.db.createObjectStore(t, d);
|
|
759
780
|
}
|
|
760
781
|
}, r.onsuccess = () => {
|
|
761
|
-
|
|
782
|
+
y.lastLink = r.result, r.result.close(), o(!0);
|
|
762
783
|
}, r.onerror = () => {
|
|
763
784
|
o(!1);
|
|
764
785
|
};
|
|
@@ -774,12 +795,12 @@ const m = class m {
|
|
|
774
795
|
static async deleteTable(e, t) {
|
|
775
796
|
return new Promise((i) => {
|
|
776
797
|
var o, r;
|
|
777
|
-
|
|
778
|
-
const s = indexedDB.open(e,
|
|
798
|
+
y.version += 1, y.lastLink && ((r = (o = y.lastLink).close) == null || r.call(o));
|
|
799
|
+
const s = indexedDB.open(e, y.version);
|
|
779
800
|
s.onupgradeneeded = (c) => {
|
|
780
|
-
|
|
801
|
+
y.db = c.target.result, y.lastLink = s.result, y.db.objectStoreNames.contains(t) && y.db.deleteObjectStore(t);
|
|
781
802
|
}, s.onsuccess = (c) => {
|
|
782
|
-
|
|
803
|
+
y.db = c.target.result, y.lastLink = s.result, s.result.close(), i(!0);
|
|
783
804
|
}, s.onerror = () => {
|
|
784
805
|
s.result.close(), i(!1);
|
|
785
806
|
};
|
|
@@ -797,11 +818,11 @@ const m = class m {
|
|
|
797
818
|
return new Promise((s, o) => {
|
|
798
819
|
const r = indexedDB.open(e);
|
|
799
820
|
r.onsuccess = (c) => {
|
|
800
|
-
if (
|
|
801
|
-
const
|
|
802
|
-
|
|
821
|
+
if (y.db = c.target.result, y.lastLink = r.result, y.db.objectStoreNames.contains(t)) {
|
|
822
|
+
const d = y.db.transaction([t], "readwrite").objectStore(t).add(i);
|
|
823
|
+
d.onsuccess = (a) => {
|
|
803
824
|
s(i);
|
|
804
|
-
},
|
|
825
|
+
}, d.onerror = () => {
|
|
805
826
|
s(null);
|
|
806
827
|
};
|
|
807
828
|
}
|
|
@@ -823,11 +844,11 @@ const m = class m {
|
|
|
823
844
|
return new Promise((s, o) => {
|
|
824
845
|
const r = indexedDB.open(e);
|
|
825
846
|
r.onsuccess = (c) => {
|
|
826
|
-
if (
|
|
827
|
-
const
|
|
828
|
-
|
|
847
|
+
if (y.db = c.target.result, y.lastLink = r.result, y.db.objectStoreNames.contains(t)) {
|
|
848
|
+
const d = y.db.transaction([t], "readwrite").objectStore(t).delete(i);
|
|
849
|
+
d.onsuccess = (a) => {
|
|
829
850
|
s(!0);
|
|
830
|
-
},
|
|
851
|
+
}, d.onerror = () => {
|
|
831
852
|
s(!1);
|
|
832
853
|
};
|
|
833
854
|
}
|
|
@@ -849,11 +870,11 @@ const m = class m {
|
|
|
849
870
|
return new Promise((s, o) => {
|
|
850
871
|
const r = indexedDB.open(e);
|
|
851
872
|
r.onsuccess = (c) => {
|
|
852
|
-
if (
|
|
853
|
-
const
|
|
854
|
-
|
|
873
|
+
if (y.db = c.target.result, y.lastLink = r.result, y.db.objectStoreNames.contains(t)) {
|
|
874
|
+
const d = y.db.transaction([t], "readwrite").objectStore(t).put(i);
|
|
875
|
+
d.onsuccess = (a) => {
|
|
855
876
|
s(i);
|
|
856
|
-
},
|
|
877
|
+
}, d.onerror = () => {
|
|
857
878
|
s(i);
|
|
858
879
|
};
|
|
859
880
|
}
|
|
@@ -875,11 +896,11 @@ const m = class m {
|
|
|
875
896
|
return new Promise((s, o) => {
|
|
876
897
|
const r = indexedDB.open(e);
|
|
877
898
|
r.onsuccess = (c) => {
|
|
878
|
-
if (
|
|
879
|
-
const
|
|
880
|
-
|
|
881
|
-
s(
|
|
882
|
-
},
|
|
899
|
+
if (y.db = c.target.result, y.lastLink = r.result, y.db.objectStoreNames.contains(t)) {
|
|
900
|
+
const d = y.db.transaction([t], "readonly").objectStore(t).get(i);
|
|
901
|
+
d.onsuccess = (a) => {
|
|
902
|
+
s(d.result);
|
|
903
|
+
}, d.onerror = () => {
|
|
883
904
|
o(new Error("未找到数据".concat(i)));
|
|
884
905
|
};
|
|
885
906
|
}
|
|
@@ -900,11 +921,11 @@ const m = class m {
|
|
|
900
921
|
return new Promise((i, s) => {
|
|
901
922
|
const o = indexedDB.open(e);
|
|
902
923
|
o.onsuccess = (r) => {
|
|
903
|
-
if (
|
|
904
|
-
const
|
|
905
|
-
|
|
906
|
-
i(
|
|
907
|
-
},
|
|
924
|
+
if (y.db = r.target.result, y.lastLink = o.result, y.db.objectStoreNames.contains(t)) {
|
|
925
|
+
const f = y.db.transaction([t], "readonly").objectStore(t).getAll();
|
|
926
|
+
f.onsuccess = (d) => {
|
|
927
|
+
i(f.result);
|
|
928
|
+
}, f.onerror = () => {
|
|
908
929
|
i([]);
|
|
909
930
|
};
|
|
910
931
|
}
|
|
@@ -916,155 +937,331 @@ const m = class m {
|
|
|
916
937
|
}
|
|
917
938
|
};
|
|
918
939
|
// 数据库版本
|
|
919
|
-
y
|
|
920
|
-
y
|
|
921
|
-
y
|
|
922
|
-
let
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
940
|
+
w(y, "version", 1), // 数据库连接句柄
|
|
941
|
+
w(y, "db", null), // 上一个连接
|
|
942
|
+
w(y, "lastLink");
|
|
943
|
+
let W = y;
|
|
944
|
+
class xn {
|
|
945
|
+
/**
|
|
946
|
+
* Creates an instance of FileUploader.
|
|
947
|
+
* @author tony001
|
|
948
|
+
* @date 2025-02-28 15:02:15
|
|
949
|
+
* @param {FileUploaderOptions<T>} options
|
|
950
|
+
*/
|
|
951
|
+
constructor(e) {
|
|
952
|
+
w(this, "options");
|
|
953
|
+
this.options = {
|
|
954
|
+
multiple: !0,
|
|
955
|
+
accept: "*/*",
|
|
956
|
+
maxSize: 5 * 1024 * 1024,
|
|
957
|
+
...e
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* 打开文件选择对话框
|
|
962
|
+
*/
|
|
963
|
+
openFilePicker() {
|
|
964
|
+
const e = document.createElement("input");
|
|
965
|
+
e.type = "file", e.multiple = this.options.multiple, e.accept = this.options.accept || "", e.onchange = (t) => {
|
|
966
|
+
const i = Array.from(t.target.files || []);
|
|
967
|
+
this.handleFiles(i);
|
|
968
|
+
}, e.click();
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* 处理选择的文件
|
|
972
|
+
*/
|
|
973
|
+
async handleFiles(e) {
|
|
974
|
+
var i, s;
|
|
975
|
+
if (e.length === 0)
|
|
976
|
+
return;
|
|
977
|
+
const t = e.filter((o) => {
|
|
978
|
+
var r, c;
|
|
979
|
+
return this.options.maxSize && o.size > this.options.maxSize ? ((c = (r = this.options).onError) == null || c.call(r, new Error("文件大小超过限制 (".concat(this.formatSize(o.size), " > ").concat(this.formatSize(this.options.maxSize), ")")), o), !1) : !0;
|
|
980
|
+
});
|
|
981
|
+
(s = (i = this.options).onSelect) == null || s.call(i, t), await Promise.all(t.map((o) => this.processFile(o)));
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* 处理单个文件上传
|
|
985
|
+
*/
|
|
986
|
+
async processFile(e) {
|
|
987
|
+
var t, i, s, o, r, c;
|
|
988
|
+
try {
|
|
989
|
+
const u = (d) => {
|
|
990
|
+
var a, _;
|
|
991
|
+
(_ = (a = this.options).onProgress) == null || _.call(a, e, d);
|
|
992
|
+
}, f = await this.options.onUpload(e, u);
|
|
993
|
+
(i = (t = this.options).onProgress) == null || i.call(t, e, 100), (o = (s = this.options).onSuccess) == null || o.call(s, f, e);
|
|
994
|
+
} catch (u) {
|
|
995
|
+
(c = (r = this.options).onError) == null || c.call(r, u instanceof Error ? u : new Error("上传失败"), e);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* 格式化文件大小
|
|
1000
|
+
*/
|
|
1001
|
+
formatSize(e) {
|
|
1002
|
+
if (e === 0)
|
|
1003
|
+
return "0 B";
|
|
1004
|
+
const t = ["B", "KB", "MB", "GB"], i = Math.floor(Math.log(e) / Math.log(1024));
|
|
1005
|
+
return "".concat((e / 1024 ** i).toFixed(2), " ").concat(t[i]);
|
|
1006
|
+
}
|
|
928
1007
|
}
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1008
|
+
class jt {
|
|
1009
|
+
/**
|
|
1010
|
+
* 从XML元素中提取CDATA内容
|
|
1011
|
+
*
|
|
1012
|
+
* @author tony001
|
|
1013
|
+
* @date 2025-03-03 15:03:43
|
|
1014
|
+
* @private
|
|
1015
|
+
* @static
|
|
1016
|
+
* @param {(Element | null)} element
|
|
1017
|
+
* @return {*} {(string | null)}
|
|
1018
|
+
*/
|
|
1019
|
+
static getCdataContent(e) {
|
|
1020
|
+
if (!e)
|
|
1021
|
+
return null;
|
|
1022
|
+
const t = Array.from(e.childNodes).find((i) => i.nodeType === i.CDATA_SECTION_NODE);
|
|
1023
|
+
return (t == null ? void 0 : t.nodeValue) || e.textContent;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* XML 字符串转数据对象
|
|
1027
|
+
*
|
|
1028
|
+
* @author tony001
|
|
1029
|
+
* @date 2025-03-03 11:03:17
|
|
1030
|
+
* @static
|
|
1031
|
+
* @param {string} xmlString
|
|
1032
|
+
* @return {*} {IMaterial[]}
|
|
1033
|
+
*/
|
|
1034
|
+
static parse(e) {
|
|
1035
|
+
const i = new DOMParser().parseFromString(e, "text/xml");
|
|
1036
|
+
return Array.from(i.querySelectorAll("resource")).map((o) => {
|
|
1037
|
+
const r = o.getAttribute("type") || "", c = o.querySelector("data"), u = o.querySelector("metadata");
|
|
1038
|
+
try {
|
|
1039
|
+
const f = this.getCdataContent(c), d = this.getCdataContent(u), a = f ? JSON.parse(f) : {}, _ = d ? JSON.parse(d) : {};
|
|
1040
|
+
return {
|
|
1041
|
+
id: a.id,
|
|
1042
|
+
type: r,
|
|
1043
|
+
data: a,
|
|
1044
|
+
metadata: _
|
|
1045
|
+
};
|
|
1046
|
+
} catch (f) {
|
|
1047
|
+
throw new Error("XML 解析错误: ".concat(f.message));
|
|
1048
|
+
}
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* 混合内容解析
|
|
1053
|
+
*
|
|
1054
|
+
* @author tony001
|
|
1055
|
+
* @date 2025-03-03 13:03:35
|
|
1056
|
+
* @static
|
|
1057
|
+
* @param {string} input 包含 XML 和其他文本的混合字符串
|
|
1058
|
+
* @return {*} {{
|
|
1059
|
+
* resources: IMaterial[];
|
|
1060
|
+
* remainingText: string;
|
|
1061
|
+
* hasResources: boolean;
|
|
1062
|
+
* error?: string;
|
|
1063
|
+
* }}
|
|
1064
|
+
*/
|
|
1065
|
+
static parseMixedContent(e) {
|
|
1066
|
+
const i = /<resources\b[^>]*>[\s\S]*?<\/resources>/i.exec(e);
|
|
1067
|
+
if (!i)
|
|
1068
|
+
return {
|
|
1069
|
+
resources: [],
|
|
1070
|
+
remainingText: e,
|
|
1071
|
+
hasResources: !1
|
|
1072
|
+
};
|
|
1073
|
+
const [s] = i, o = i.index, r = o + s.length, c = (e.slice(0, o) + e.slice(r)).replace(/\n/g, "");
|
|
1074
|
+
try {
|
|
1075
|
+
return {
|
|
1076
|
+
resources: this.parse(s),
|
|
1077
|
+
remainingText: c,
|
|
1078
|
+
hasResources: !0
|
|
1079
|
+
};
|
|
1080
|
+
} catch (u) {
|
|
1081
|
+
return {
|
|
1082
|
+
resources: [],
|
|
1083
|
+
remainingText: c,
|
|
1084
|
+
hasResources: !0,
|
|
1085
|
+
error: "资源解析失败: ".concat(u.message)
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* 数据对象转 XML 字符串
|
|
1091
|
+
*
|
|
1092
|
+
* @author tony001
|
|
1093
|
+
* @date 2025-03-03 11:03:51
|
|
1094
|
+
* @static
|
|
1095
|
+
* @param {IMaterial[]} resources
|
|
1096
|
+
* @return {*} {string}
|
|
1097
|
+
*/
|
|
1098
|
+
static stringify(e) {
|
|
1099
|
+
const t = document.implementation.createDocument(null, null, null), i = t.createElement("resources");
|
|
1100
|
+
i.setAttribute("version", "1.0");
|
|
1101
|
+
const s = (r) => "\n".concat(" ".repeat(r)), o = 1;
|
|
1102
|
+
return e.forEach((r) => {
|
|
1103
|
+
i.appendChild(t.createTextNode(s(o)));
|
|
1104
|
+
const c = t.createElement("resource");
|
|
1105
|
+
c.setAttribute("type", r.type), c.setAttribute("version", "1.0");
|
|
1106
|
+
const u = (f, d) => {
|
|
1107
|
+
const a = t.createElement(f);
|
|
1108
|
+
a.appendChild(t.createTextNode(s(o + 1)));
|
|
1109
|
+
const _ = t.createCDATASection(JSON.stringify(d));
|
|
1110
|
+
return a.appendChild(_), a.appendChild(t.createTextNode(s(o))), a;
|
|
1111
|
+
};
|
|
1112
|
+
c.appendChild(t.createTextNode(s(o + 1))), c.appendChild(u("data", r.data)), c.appendChild(t.createTextNode(s(o + 1))), c.appendChild(u("metadata", r.metadata)), c.appendChild(t.createTextNode(s(o))), i.appendChild(c);
|
|
1113
|
+
}), i.appendChild(t.createTextNode("\n")), t.appendChild(i), new XMLSerializer().serializeToString(t).replace(/></g, ">\n<");
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
var oe, x, Le, ot, pe = 0, Yt = [], we = [], rt = m.__b, at = m.__r, ct = m.diffed, lt = m.__c, ut = m.unmount;
|
|
1117
|
+
function Me(n, e) {
|
|
1118
|
+
m.__h && m.__h(x, n, pe || e), pe = 0;
|
|
1119
|
+
var t = x.__H || (x.__H = { __: [], __h: [] });
|
|
1120
|
+
return n >= t.__.length && t.__.push({ __V: we }), t.__[n];
|
|
1121
|
+
}
|
|
1122
|
+
function Je(n) {
|
|
1123
|
+
return pe = 1, Sn(Zt, n);
|
|
1124
|
+
}
|
|
1125
|
+
function Sn(n, e, t) {
|
|
1126
|
+
var i = Me(oe++, 2);
|
|
1127
|
+
if (i.t = n, !i.__c && (i.__ = [t ? t(e) : Zt(void 0, e), function(c) {
|
|
1128
|
+
var u = i.__N ? i.__N[0] : i.__[0], f = i.t(u, c);
|
|
1129
|
+
u !== f && (i.__N = [f, i.__[1]], i.__c.setState({}));
|
|
1130
|
+
}], i.__c = x, !x.u)) {
|
|
1131
|
+
var s = function(c, u, f) {
|
|
939
1132
|
if (!i.__c.__H)
|
|
940
1133
|
return !0;
|
|
941
|
-
var
|
|
1134
|
+
var d = i.__c.__H.__.filter(function(_) {
|
|
942
1135
|
return _.__c;
|
|
943
1136
|
});
|
|
944
|
-
if (
|
|
1137
|
+
if (d.every(function(_) {
|
|
945
1138
|
return !_.__N;
|
|
946
1139
|
}))
|
|
947
|
-
return !o || o.call(this, c, u,
|
|
1140
|
+
return !o || o.call(this, c, u, f);
|
|
948
1141
|
var a = !1;
|
|
949
|
-
return
|
|
1142
|
+
return d.forEach(function(_) {
|
|
950
1143
|
if (_.__N) {
|
|
951
|
-
var
|
|
952
|
-
_.__ = _.__N, _.__N = void 0,
|
|
1144
|
+
var v = _.__[0];
|
|
1145
|
+
_.__ = _.__N, _.__N = void 0, v !== _.__[0] && (a = !0);
|
|
953
1146
|
}
|
|
954
|
-
}), !(!a && i.__c.props === c) && (!o || o.call(this, c, u,
|
|
1147
|
+
}), !(!a && i.__c.props === c) && (!o || o.call(this, c, u, f));
|
|
955
1148
|
};
|
|
956
|
-
|
|
957
|
-
var o =
|
|
958
|
-
|
|
1149
|
+
x.u = !0;
|
|
1150
|
+
var o = x.shouldComponentUpdate, r = x.componentWillUpdate;
|
|
1151
|
+
x.componentWillUpdate = function(c, u, f) {
|
|
959
1152
|
if (this.__e) {
|
|
960
|
-
var
|
|
961
|
-
o = void 0, s(c, u,
|
|
1153
|
+
var d = o;
|
|
1154
|
+
o = void 0, s(c, u, f), o = d;
|
|
962
1155
|
}
|
|
963
|
-
r && r.call(this, c, u,
|
|
964
|
-
},
|
|
1156
|
+
r && r.call(this, c, u, f);
|
|
1157
|
+
}, x.shouldComponentUpdate = s;
|
|
965
1158
|
}
|
|
966
1159
|
return i.__N || i.__;
|
|
967
1160
|
}
|
|
968
|
-
function
|
|
969
|
-
var t =
|
|
970
|
-
!
|
|
1161
|
+
function V(n, e) {
|
|
1162
|
+
var t = Me(oe++, 3);
|
|
1163
|
+
!m.__s && Xt(t.__H, e) && (t.__ = n, t.i = e, x.__H.__h.push(t));
|
|
971
1164
|
}
|
|
972
|
-
function
|
|
973
|
-
return
|
|
1165
|
+
function K(n) {
|
|
1166
|
+
return pe = 5, j(function() {
|
|
974
1167
|
return { current: n };
|
|
975
1168
|
}, []);
|
|
976
1169
|
}
|
|
977
|
-
function
|
|
978
|
-
var t =
|
|
979
|
-
return
|
|
1170
|
+
function j(n, e) {
|
|
1171
|
+
var t = Me(oe++, 7);
|
|
1172
|
+
return Xt(t.__H, e) ? (t.__V = n(), t.i = e, t.__h = n, t.__V) : t.__;
|
|
980
1173
|
}
|
|
981
|
-
function
|
|
982
|
-
return
|
|
1174
|
+
function dt(n, e) {
|
|
1175
|
+
return pe = 8, j(function() {
|
|
983
1176
|
return n;
|
|
984
1177
|
}, e);
|
|
985
1178
|
}
|
|
986
|
-
function
|
|
987
|
-
|
|
1179
|
+
function En(n) {
|
|
1180
|
+
var e = x.context[n.__c], t = Me(oe++, 9);
|
|
1181
|
+
return t.c = n, e ? (t.__ == null && (t.__ = !0, e.sub(x)), e.props.value) : n.__;
|
|
1182
|
+
}
|
|
1183
|
+
function Nn() {
|
|
1184
|
+
for (var n; n = Yt.shift(); )
|
|
988
1185
|
if (n.__P && n.__H)
|
|
989
1186
|
try {
|
|
990
|
-
n.__H.__h.forEach(
|
|
1187
|
+
n.__H.__h.forEach(Ce), n.__H.__h.forEach(je), n.__H.__h = [];
|
|
991
1188
|
} catch (e) {
|
|
992
|
-
n.__H.__h = [],
|
|
1189
|
+
n.__H.__h = [], m.__e(e, n.__v);
|
|
993
1190
|
}
|
|
994
1191
|
}
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
},
|
|
998
|
-
|
|
999
|
-
var e = (
|
|
1000
|
-
e && (
|
|
1001
|
-
t.__N && (t.__ = t.__N), t.__V =
|
|
1002
|
-
})) : (e.__h.forEach(
|
|
1003
|
-
},
|
|
1004
|
-
|
|
1192
|
+
m.__b = function(n) {
|
|
1193
|
+
x = null, rt && rt(n);
|
|
1194
|
+
}, m.__r = function(n) {
|
|
1195
|
+
at && at(n), oe = 0;
|
|
1196
|
+
var e = (x = n.__c).__H;
|
|
1197
|
+
e && (Le === x ? (e.__h = [], x.__h = [], e.__.forEach(function(t) {
|
|
1198
|
+
t.__N && (t.__ = t.__N), t.__V = we, t.__N = t.i = void 0;
|
|
1199
|
+
})) : (e.__h.forEach(Ce), e.__h.forEach(je), e.__h = [], oe = 0)), Le = x;
|
|
1200
|
+
}, m.diffed = function(n) {
|
|
1201
|
+
ct && ct(n);
|
|
1005
1202
|
var e = n.__c;
|
|
1006
|
-
e && e.__H && (e.__H.__h.length && (
|
|
1007
|
-
t.i && (t.__H = t.i), t.__V !==
|
|
1008
|
-
})),
|
|
1009
|
-
},
|
|
1203
|
+
e && e.__H && (e.__H.__h.length && (Yt.push(e) !== 1 && ot === m.requestAnimationFrame || ((ot = m.requestAnimationFrame) || $n)(Nn)), e.__H.__.forEach(function(t) {
|
|
1204
|
+
t.i && (t.__H = t.i), t.__V !== we && (t.__ = t.__V), t.i = void 0, t.__V = we;
|
|
1205
|
+
})), Le = x = null;
|
|
1206
|
+
}, m.__c = function(n, e) {
|
|
1010
1207
|
e.some(function(t) {
|
|
1011
1208
|
try {
|
|
1012
|
-
t.__h.forEach(
|
|
1013
|
-
return !i.__ ||
|
|
1209
|
+
t.__h.forEach(Ce), t.__h = t.__h.filter(function(i) {
|
|
1210
|
+
return !i.__ || je(i);
|
|
1014
1211
|
});
|
|
1015
1212
|
} catch (i) {
|
|
1016
1213
|
e.some(function(s) {
|
|
1017
1214
|
s.__h && (s.__h = []);
|
|
1018
|
-
}), e = [],
|
|
1215
|
+
}), e = [], m.__e(i, t.__v);
|
|
1019
1216
|
}
|
|
1020
|
-
}),
|
|
1021
|
-
},
|
|
1022
|
-
|
|
1217
|
+
}), lt && lt(n, e);
|
|
1218
|
+
}, m.unmount = function(n) {
|
|
1219
|
+
ut && ut(n);
|
|
1023
1220
|
var e, t = n.__c;
|
|
1024
1221
|
t && t.__H && (t.__H.__.forEach(function(i) {
|
|
1025
1222
|
try {
|
|
1026
|
-
|
|
1223
|
+
Ce(i);
|
|
1027
1224
|
} catch (s) {
|
|
1028
1225
|
e = s;
|
|
1029
1226
|
}
|
|
1030
|
-
}), t.__H = void 0, e &&
|
|
1227
|
+
}), t.__H = void 0, e && m.__e(e, t.__v));
|
|
1031
1228
|
};
|
|
1032
|
-
var
|
|
1033
|
-
function
|
|
1229
|
+
var ht = typeof requestAnimationFrame == "function";
|
|
1230
|
+
function $n(n) {
|
|
1034
1231
|
var e, t = function() {
|
|
1035
|
-
clearTimeout(i),
|
|
1232
|
+
clearTimeout(i), ht && cancelAnimationFrame(e), setTimeout(n);
|
|
1036
1233
|
}, i = setTimeout(t, 100);
|
|
1037
|
-
|
|
1234
|
+
ht && (e = requestAnimationFrame(t));
|
|
1038
1235
|
}
|
|
1039
|
-
function
|
|
1040
|
-
var e =
|
|
1041
|
-
typeof t == "function" && (n.__c = void 0, t()),
|
|
1236
|
+
function Ce(n) {
|
|
1237
|
+
var e = x, t = n.__c;
|
|
1238
|
+
typeof t == "function" && (n.__c = void 0, t()), x = e;
|
|
1042
1239
|
}
|
|
1043
|
-
function
|
|
1044
|
-
var e =
|
|
1045
|
-
n.__c = n.__(),
|
|
1240
|
+
function je(n) {
|
|
1241
|
+
var e = x;
|
|
1242
|
+
n.__c = n.__(), x = e;
|
|
1046
1243
|
}
|
|
1047
|
-
function
|
|
1244
|
+
function Xt(n, e) {
|
|
1048
1245
|
return !n || n.length !== e.length || e.some(function(t, i) {
|
|
1049
1246
|
return t !== n[i];
|
|
1050
1247
|
});
|
|
1051
1248
|
}
|
|
1052
|
-
function
|
|
1249
|
+
function Zt(n, e) {
|
|
1053
1250
|
return typeof e == "function" ? e(n) : e;
|
|
1054
1251
|
}
|
|
1055
|
-
function
|
|
1252
|
+
function Ae() {
|
|
1056
1253
|
throw new Error("Cycle detected");
|
|
1057
1254
|
}
|
|
1058
|
-
var
|
|
1059
|
-
function
|
|
1060
|
-
if (
|
|
1061
|
-
|
|
1255
|
+
var kn = Symbol.for("preact-signals");
|
|
1256
|
+
function Ke() {
|
|
1257
|
+
if (ie > 1)
|
|
1258
|
+
ie--;
|
|
1062
1259
|
else {
|
|
1063
|
-
for (var n, e = !1;
|
|
1064
|
-
var t =
|
|
1065
|
-
for (
|
|
1260
|
+
for (var n, e = !1; de !== void 0; ) {
|
|
1261
|
+
var t = de;
|
|
1262
|
+
for (de = void 0, Ye++; t !== void 0; ) {
|
|
1066
1263
|
var i = t.o;
|
|
1067
|
-
if (t.o = void 0, t.f &= -3, !(8 & t.f) &&
|
|
1264
|
+
if (t.o = void 0, t.f &= -3, !(8 & t.f) && Jt(t))
|
|
1068
1265
|
try {
|
|
1069
1266
|
t.c();
|
|
1070
1267
|
} catch (s) {
|
|
@@ -1073,39 +1270,39 @@ function je() {
|
|
|
1073
1270
|
t = i;
|
|
1074
1271
|
}
|
|
1075
1272
|
}
|
|
1076
|
-
if (
|
|
1273
|
+
if (Ye = 0, ie--, e)
|
|
1077
1274
|
throw n;
|
|
1078
1275
|
}
|
|
1079
1276
|
}
|
|
1080
|
-
var
|
|
1081
|
-
function
|
|
1082
|
-
if (
|
|
1277
|
+
var S = void 0, de = void 0, ie = 0, Ye = 0, Ee = 0;
|
|
1278
|
+
function Gt(n) {
|
|
1279
|
+
if (S !== void 0) {
|
|
1083
1280
|
var e = n.n;
|
|
1084
|
-
if (e === void 0 || e.t !==
|
|
1085
|
-
return e = { i: 0, S: n, p:
|
|
1281
|
+
if (e === void 0 || e.t !== S)
|
|
1282
|
+
return e = { i: 0, S: n, p: S.s, n: void 0, t: S, e: void 0, x: void 0, r: e }, S.s !== void 0 && (S.s.n = e), S.s = e, n.n = e, 32 & S.f && n.S(e), e;
|
|
1086
1283
|
if (e.i === -1)
|
|
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 =
|
|
1284
|
+
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = S.s, e.n = void 0, S.s.n = e, S.s = e), e;
|
|
1088
1285
|
}
|
|
1089
1286
|
}
|
|
1090
|
-
function
|
|
1287
|
+
function A(n) {
|
|
1091
1288
|
this.v = n, this.i = 0, this.n = void 0, this.t = void 0;
|
|
1092
1289
|
}
|
|
1093
|
-
|
|
1094
|
-
|
|
1290
|
+
A.prototype.brand = kn;
|
|
1291
|
+
A.prototype.h = function() {
|
|
1095
1292
|
return !0;
|
|
1096
1293
|
};
|
|
1097
|
-
|
|
1294
|
+
A.prototype.S = function(n) {
|
|
1098
1295
|
this.t !== n && n.e === void 0 && (n.x = this.t, this.t !== void 0 && (this.t.e = n), this.t = n);
|
|
1099
1296
|
};
|
|
1100
|
-
|
|
1297
|
+
A.prototype.U = function(n) {
|
|
1101
1298
|
if (this.t !== void 0) {
|
|
1102
1299
|
var e = n.e, t = n.x;
|
|
1103
1300
|
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);
|
|
1104
1301
|
}
|
|
1105
1302
|
};
|
|
1106
|
-
|
|
1303
|
+
A.prototype.subscribe = function(n) {
|
|
1107
1304
|
var e = this;
|
|
1108
|
-
return
|
|
1305
|
+
return Ie(function() {
|
|
1109
1306
|
var t = e.value, i = 32 & this.f;
|
|
1110
1307
|
this.f &= -33;
|
|
1111
1308
|
try {
|
|
@@ -1115,44 +1312,44 @@ $.prototype.subscribe = function(n) {
|
|
|
1115
1312
|
}
|
|
1116
1313
|
});
|
|
1117
1314
|
};
|
|
1118
|
-
|
|
1315
|
+
A.prototype.valueOf = function() {
|
|
1119
1316
|
return this.value;
|
|
1120
1317
|
};
|
|
1121
|
-
|
|
1318
|
+
A.prototype.toString = function() {
|
|
1122
1319
|
return this.value + "";
|
|
1123
1320
|
};
|
|
1124
|
-
|
|
1321
|
+
A.prototype.toJSON = function() {
|
|
1125
1322
|
return this.value;
|
|
1126
1323
|
};
|
|
1127
|
-
|
|
1324
|
+
A.prototype.peek = function() {
|
|
1128
1325
|
return this.v;
|
|
1129
1326
|
};
|
|
1130
|
-
Object.defineProperty(
|
|
1131
|
-
var n =
|
|
1327
|
+
Object.defineProperty(A.prototype, "value", { get: function() {
|
|
1328
|
+
var n = Gt(this);
|
|
1132
1329
|
return n !== void 0 && (n.i = this.i), this.v;
|
|
1133
1330
|
}, set: function(n) {
|
|
1134
|
-
if (
|
|
1331
|
+
if (S instanceof Y && function() {
|
|
1135
1332
|
throw new Error("Computed cannot have side-effects");
|
|
1136
1333
|
}(), n !== this.v) {
|
|
1137
|
-
|
|
1334
|
+
Ye > 100 && Ae(), this.v = n, this.i++, Ee++, ie++;
|
|
1138
1335
|
try {
|
|
1139
1336
|
for (var e = this.t; e !== void 0; e = e.x)
|
|
1140
1337
|
e.t.N();
|
|
1141
1338
|
} finally {
|
|
1142
|
-
|
|
1339
|
+
Ke();
|
|
1143
1340
|
}
|
|
1144
1341
|
}
|
|
1145
1342
|
} });
|
|
1146
|
-
function
|
|
1147
|
-
return new
|
|
1343
|
+
function J(n) {
|
|
1344
|
+
return new A(n);
|
|
1148
1345
|
}
|
|
1149
|
-
function
|
|
1346
|
+
function Jt(n) {
|
|
1150
1347
|
for (var e = n.s; e !== void 0; e = e.n)
|
|
1151
1348
|
if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i)
|
|
1152
1349
|
return !0;
|
|
1153
1350
|
return !1;
|
|
1154
1351
|
}
|
|
1155
|
-
function
|
|
1352
|
+
function Kt(n) {
|
|
1156
1353
|
for (var e = n.s; e !== void 0; e = e.n) {
|
|
1157
1354
|
var t = e.S.n;
|
|
1158
1355
|
if (t !== void 0 && (e.r = t), e.S.n = e, e.i = -1, e.n === void 0) {
|
|
@@ -1161,99 +1358,99 @@ function Vt(n) {
|
|
|
1161
1358
|
}
|
|
1162
1359
|
}
|
|
1163
1360
|
}
|
|
1164
|
-
function
|
|
1361
|
+
function Qt(n) {
|
|
1165
1362
|
for (var e = n.s, t = void 0; e !== void 0; ) {
|
|
1166
1363
|
var i = e.p;
|
|
1167
1364
|
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;
|
|
1168
1365
|
}
|
|
1169
1366
|
n.s = t;
|
|
1170
1367
|
}
|
|
1171
|
-
function
|
|
1172
|
-
|
|
1368
|
+
function Y(n) {
|
|
1369
|
+
A.call(this, void 0), this.x = n, this.s = void 0, this.g = Ee - 1, this.f = 4;
|
|
1173
1370
|
}
|
|
1174
|
-
(
|
|
1371
|
+
(Y.prototype = new A()).h = function() {
|
|
1175
1372
|
if (this.f &= -3, 1 & this.f)
|
|
1176
1373
|
return !1;
|
|
1177
|
-
if ((36 & this.f) == 32 || (this.f &= -5, this.g ===
|
|
1374
|
+
if ((36 & this.f) == 32 || (this.f &= -5, this.g === Ee))
|
|
1178
1375
|
return !0;
|
|
1179
|
-
if (this.g =
|
|
1376
|
+
if (this.g = Ee, this.f |= 1, this.i > 0 && !Jt(this))
|
|
1180
1377
|
return this.f &= -2, !0;
|
|
1181
|
-
var n =
|
|
1378
|
+
var n = S;
|
|
1182
1379
|
try {
|
|
1183
|
-
|
|
1380
|
+
Kt(this), S = this;
|
|
1184
1381
|
var e = this.x();
|
|
1185
1382
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
1186
1383
|
} catch (t) {
|
|
1187
1384
|
this.v = t, this.f |= 16, this.i++;
|
|
1188
1385
|
}
|
|
1189
|
-
return
|
|
1386
|
+
return S = n, Qt(this), this.f &= -2, !0;
|
|
1190
1387
|
};
|
|
1191
|
-
|
|
1388
|
+
Y.prototype.S = function(n) {
|
|
1192
1389
|
if (this.t === void 0) {
|
|
1193
1390
|
this.f |= 36;
|
|
1194
1391
|
for (var e = this.s; e !== void 0; e = e.n)
|
|
1195
1392
|
e.S.S(e);
|
|
1196
1393
|
}
|
|
1197
|
-
|
|
1394
|
+
A.prototype.S.call(this, n);
|
|
1198
1395
|
};
|
|
1199
|
-
|
|
1200
|
-
if (this.t !== void 0 && (
|
|
1396
|
+
Y.prototype.U = function(n) {
|
|
1397
|
+
if (this.t !== void 0 && (A.prototype.U.call(this, n), this.t === void 0)) {
|
|
1201
1398
|
this.f &= -33;
|
|
1202
1399
|
for (var e = this.s; e !== void 0; e = e.n)
|
|
1203
1400
|
e.S.U(e);
|
|
1204
1401
|
}
|
|
1205
1402
|
};
|
|
1206
|
-
|
|
1403
|
+
Y.prototype.N = function() {
|
|
1207
1404
|
if (!(2 & this.f)) {
|
|
1208
1405
|
this.f |= 6;
|
|
1209
1406
|
for (var n = this.t; n !== void 0; n = n.x)
|
|
1210
1407
|
n.t.N();
|
|
1211
1408
|
}
|
|
1212
1409
|
};
|
|
1213
|
-
|
|
1214
|
-
if (this.h() ||
|
|
1410
|
+
Y.prototype.peek = function() {
|
|
1411
|
+
if (this.h() || Ae(), 16 & this.f)
|
|
1215
1412
|
throw this.v;
|
|
1216
1413
|
return this.v;
|
|
1217
1414
|
};
|
|
1218
|
-
Object.defineProperty(
|
|
1219
|
-
1 & this.f &&
|
|
1220
|
-
var n =
|
|
1415
|
+
Object.defineProperty(Y.prototype, "value", { get: function() {
|
|
1416
|
+
1 & this.f && Ae();
|
|
1417
|
+
var n = Gt(this);
|
|
1221
1418
|
if (this.h(), n !== void 0 && (n.i = this.i), 16 & this.f)
|
|
1222
1419
|
throw this.v;
|
|
1223
1420
|
return this.v;
|
|
1224
1421
|
} });
|
|
1225
|
-
function
|
|
1226
|
-
return new
|
|
1422
|
+
function en(n) {
|
|
1423
|
+
return new Y(n);
|
|
1227
1424
|
}
|
|
1228
|
-
function
|
|
1425
|
+
function tn(n) {
|
|
1229
1426
|
var e = n.u;
|
|
1230
1427
|
if (n.u = void 0, typeof e == "function") {
|
|
1231
|
-
|
|
1232
|
-
var t =
|
|
1233
|
-
|
|
1428
|
+
ie++;
|
|
1429
|
+
var t = S;
|
|
1430
|
+
S = void 0;
|
|
1234
1431
|
try {
|
|
1235
1432
|
e();
|
|
1236
1433
|
} catch (i) {
|
|
1237
|
-
throw n.f &= -2, n.f |= 8,
|
|
1434
|
+
throw n.f &= -2, n.f |= 8, Qe(n), i;
|
|
1238
1435
|
} finally {
|
|
1239
|
-
|
|
1436
|
+
S = t, Ke();
|
|
1240
1437
|
}
|
|
1241
1438
|
}
|
|
1242
1439
|
}
|
|
1243
|
-
function
|
|
1440
|
+
function Qe(n) {
|
|
1244
1441
|
for (var e = n.s; e !== void 0; e = e.n)
|
|
1245
1442
|
e.S.U(e);
|
|
1246
|
-
n.x = void 0, n.s = void 0,
|
|
1443
|
+
n.x = void 0, n.s = void 0, tn(n);
|
|
1247
1444
|
}
|
|
1248
|
-
function
|
|
1249
|
-
if (
|
|
1445
|
+
function Mn(n) {
|
|
1446
|
+
if (S !== this)
|
|
1250
1447
|
throw new Error("Out-of-order effect");
|
|
1251
|
-
|
|
1448
|
+
Qt(this), S = n, this.f &= -2, 8 & this.f && Qe(this), Ke();
|
|
1252
1449
|
}
|
|
1253
|
-
function
|
|
1450
|
+
function _e(n) {
|
|
1254
1451
|
this.x = n, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32;
|
|
1255
1452
|
}
|
|
1256
|
-
|
|
1453
|
+
_e.prototype.c = function() {
|
|
1257
1454
|
var n = this.S();
|
|
1258
1455
|
try {
|
|
1259
1456
|
if (8 & this.f || this.x === void 0)
|
|
@@ -1264,19 +1461,19 @@ de.prototype.c = function() {
|
|
|
1264
1461
|
n();
|
|
1265
1462
|
}
|
|
1266
1463
|
};
|
|
1267
|
-
|
|
1268
|
-
1 & this.f &&
|
|
1269
|
-
var n =
|
|
1270
|
-
return
|
|
1464
|
+
_e.prototype.S = function() {
|
|
1465
|
+
1 & this.f && Ae(), this.f |= 1, this.f &= -9, tn(this), Kt(this), ie++;
|
|
1466
|
+
var n = S;
|
|
1467
|
+
return S = this, Mn.bind(this, n);
|
|
1271
1468
|
};
|
|
1272
|
-
|
|
1273
|
-
2 & this.f || (this.f |= 2, this.o =
|
|
1469
|
+
_e.prototype.N = function() {
|
|
1470
|
+
2 & this.f || (this.f |= 2, this.o = de, de = this);
|
|
1274
1471
|
};
|
|
1275
|
-
|
|
1276
|
-
this.f |= 8, 1 & this.f ||
|
|
1472
|
+
_e.prototype.d = function() {
|
|
1473
|
+
this.f |= 8, 1 & this.f || Qe(this);
|
|
1277
1474
|
};
|
|
1278
|
-
function
|
|
1279
|
-
var e = new
|
|
1475
|
+
function Ie(n) {
|
|
1476
|
+
var e = new _e(n);
|
|
1280
1477
|
try {
|
|
1281
1478
|
e.c();
|
|
1282
1479
|
} catch (t) {
|
|
@@ -1284,18 +1481,18 @@ function Ne(n) {
|
|
|
1284
1481
|
}
|
|
1285
1482
|
return e.d.bind(e);
|
|
1286
1483
|
}
|
|
1287
|
-
var
|
|
1288
|
-
function
|
|
1289
|
-
|
|
1484
|
+
var De, Oe;
|
|
1485
|
+
function re(n, e) {
|
|
1486
|
+
m[n] = e.bind(null, m[n] || function() {
|
|
1290
1487
|
});
|
|
1291
1488
|
}
|
|
1292
|
-
function
|
|
1293
|
-
|
|
1489
|
+
function Ne(n) {
|
|
1490
|
+
Oe && Oe(), Oe = n && n.S();
|
|
1294
1491
|
}
|
|
1295
|
-
function
|
|
1296
|
-
var e = this, t = n.data, i =
|
|
1492
|
+
function nn(n) {
|
|
1493
|
+
var e = this, t = n.data, i = q(t);
|
|
1297
1494
|
i.value = t;
|
|
1298
|
-
var s =
|
|
1495
|
+
var s = j(function() {
|
|
1299
1496
|
for (var o = e.__v; o = o.__; )
|
|
1300
1497
|
if (o.__c) {
|
|
1301
1498
|
o.__c.__$f |= 4;
|
|
@@ -1303,46 +1500,46 @@ function Xt(n) {
|
|
|
1303
1500
|
}
|
|
1304
1501
|
return e.__$u.c = function() {
|
|
1305
1502
|
var r;
|
|
1306
|
-
|
|
1307
|
-
},
|
|
1503
|
+
!zt(s.peek()) && ((r = e.base) == null ? void 0 : r.nodeType) === 3 ? e.base.data = s.peek() : (e.__$f |= 1, e.setState({}));
|
|
1504
|
+
}, en(function() {
|
|
1308
1505
|
var r = i.value.value;
|
|
1309
1506
|
return r === 0 ? 0 : r === !0 ? "" : r || "";
|
|
1310
1507
|
});
|
|
1311
1508
|
}, []);
|
|
1312
1509
|
return s.value;
|
|
1313
1510
|
}
|
|
1314
|
-
|
|
1315
|
-
Object.defineProperties(
|
|
1511
|
+
nn.displayName = "_st";
|
|
1512
|
+
Object.defineProperties(A.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: nn }, props: { configurable: !0, get: function() {
|
|
1316
1513
|
return { data: this };
|
|
1317
1514
|
} }, __b: { configurable: !0, value: 1 } });
|
|
1318
|
-
|
|
1515
|
+
re("__b", function(n, e) {
|
|
1319
1516
|
if (typeof e.type == "string") {
|
|
1320
1517
|
var t, i = e.props;
|
|
1321
1518
|
for (var s in i)
|
|
1322
1519
|
if (s !== "children") {
|
|
1323
1520
|
var o = i[s];
|
|
1324
|
-
o instanceof
|
|
1521
|
+
o instanceof A && (t || (e.__np = t = {}), t[s] = o, i[s] = o.peek());
|
|
1325
1522
|
}
|
|
1326
1523
|
}
|
|
1327
1524
|
n(e);
|
|
1328
1525
|
});
|
|
1329
|
-
|
|
1330
|
-
|
|
1526
|
+
re("__r", function(n, e) {
|
|
1527
|
+
Ne();
|
|
1331
1528
|
var t, i = e.__c;
|
|
1332
1529
|
i && (i.__$f &= -2, (t = i.__$u) === void 0 && (i.__$u = t = function(s) {
|
|
1333
1530
|
var o;
|
|
1334
|
-
return
|
|
1531
|
+
return Ie(function() {
|
|
1335
1532
|
o = this;
|
|
1336
1533
|
}), o.c = function() {
|
|
1337
1534
|
i.__$f |= 1, i.setState({});
|
|
1338
1535
|
}, o;
|
|
1339
|
-
}())),
|
|
1536
|
+
}())), De = i, Ne(t), n(e);
|
|
1340
1537
|
});
|
|
1341
|
-
|
|
1342
|
-
|
|
1538
|
+
re("__e", function(n, e, t, i) {
|
|
1539
|
+
Ne(), De = void 0, n(e, t, i);
|
|
1343
1540
|
});
|
|
1344
|
-
|
|
1345
|
-
|
|
1541
|
+
re("diffed", function(n, e) {
|
|
1542
|
+
Ne(), De = void 0;
|
|
1346
1543
|
var t;
|
|
1347
1544
|
if (typeof e.type == "string" && (t = e.__e)) {
|
|
1348
1545
|
var i = e.__np, s = e.props;
|
|
@@ -1356,23 +1553,23 @@ ie("diffed", function(n, e) {
|
|
|
1356
1553
|
else
|
|
1357
1554
|
t.U = o = {};
|
|
1358
1555
|
for (var u in i) {
|
|
1359
|
-
var
|
|
1360
|
-
|
|
1556
|
+
var f = o[u], d = i[u];
|
|
1557
|
+
f === void 0 ? (f = An(t, u, d, s), o[u] = f) : f.o(d, s);
|
|
1361
1558
|
}
|
|
1362
1559
|
}
|
|
1363
1560
|
}
|
|
1364
1561
|
n(e);
|
|
1365
1562
|
});
|
|
1366
|
-
function
|
|
1367
|
-
var s = e in n && n.ownerSVGElement === void 0, o =
|
|
1563
|
+
function An(n, e, t, i) {
|
|
1564
|
+
var s = e in n && n.ownerSVGElement === void 0, o = J(t);
|
|
1368
1565
|
return { o: function(r, c) {
|
|
1369
1566
|
o.value = r, i = c;
|
|
1370
|
-
}, d:
|
|
1567
|
+
}, d: Ie(function() {
|
|
1371
1568
|
var r = o.value.value;
|
|
1372
1569
|
i[e] !== r && (i[e] = r, s ? n[e] = r : r ? n.setAttribute(e, r) : n.removeAttribute(e));
|
|
1373
1570
|
}) };
|
|
1374
1571
|
}
|
|
1375
|
-
|
|
1572
|
+
re("unmount", function(n, e) {
|
|
1376
1573
|
if (typeof e.type == "string") {
|
|
1377
1574
|
var t = e.__e;
|
|
1378
1575
|
if (t) {
|
|
@@ -1394,10 +1591,10 @@ ie("unmount", function(n, e) {
|
|
|
1394
1591
|
}
|
|
1395
1592
|
n(e);
|
|
1396
1593
|
});
|
|
1397
|
-
|
|
1594
|
+
re("__h", function(n, e, t, i) {
|
|
1398
1595
|
(i < 3 || i === 9) && (e.__$f |= 2), n(e, t, i);
|
|
1399
1596
|
});
|
|
1400
|
-
|
|
1597
|
+
H.prototype.shouldComponentUpdate = function(n, e) {
|
|
1401
1598
|
var t = this.__$u;
|
|
1402
1599
|
if (!(t && t.s !== void 0 || 4 & this.__$f) || 3 & this.__$f)
|
|
1403
1600
|
return !0;
|
|
@@ -1411,46 +1608,46 @@ M.prototype.shouldComponentUpdate = function(n, e) {
|
|
|
1411
1608
|
return !0;
|
|
1412
1609
|
return !1;
|
|
1413
1610
|
};
|
|
1414
|
-
function
|
|
1415
|
-
return
|
|
1416
|
-
return
|
|
1611
|
+
function q(n) {
|
|
1612
|
+
return j(function() {
|
|
1613
|
+
return J(n);
|
|
1417
1614
|
}, []);
|
|
1418
1615
|
}
|
|
1419
|
-
function
|
|
1420
|
-
var e =
|
|
1421
|
-
return e.current = n,
|
|
1422
|
-
return
|
|
1616
|
+
function O(n) {
|
|
1617
|
+
var e = K(n);
|
|
1618
|
+
return e.current = n, De.__$f |= 4, j(function() {
|
|
1619
|
+
return en(function() {
|
|
1423
1620
|
return e.current();
|
|
1424
1621
|
});
|
|
1425
1622
|
}, []);
|
|
1426
1623
|
}
|
|
1427
|
-
function
|
|
1428
|
-
var e =
|
|
1429
|
-
e.current = n,
|
|
1430
|
-
return
|
|
1624
|
+
function In(n) {
|
|
1625
|
+
var e = K(n);
|
|
1626
|
+
e.current = n, V(function() {
|
|
1627
|
+
return Ie(function() {
|
|
1431
1628
|
return e.current();
|
|
1432
1629
|
});
|
|
1433
1630
|
}, []);
|
|
1434
1631
|
}
|
|
1435
|
-
var
|
|
1632
|
+
var Dn = 0;
|
|
1436
1633
|
function l(n, e, t, i, s, o) {
|
|
1437
1634
|
var r, c, u = {};
|
|
1438
1635
|
for (c in e)
|
|
1439
1636
|
c == "ref" ? r = e[c] : u[c] = e[c];
|
|
1440
|
-
var
|
|
1637
|
+
var f = { type: n, props: u, key: t, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --Dn, __source: s, __self: o };
|
|
1441
1638
|
if (typeof n == "function" && (r = n.defaultProps))
|
|
1442
1639
|
for (c in r)
|
|
1443
1640
|
u[c] === void 0 && (u[c] = r[c]);
|
|
1444
|
-
return
|
|
1641
|
+
return m.vnode && m.vnode(f), f;
|
|
1445
1642
|
}
|
|
1446
|
-
const
|
|
1643
|
+
const zn = () => l("svg", {
|
|
1447
1644
|
viewBox: "0 0 1024 1024",
|
|
1448
1645
|
version: "1.1",
|
|
1449
1646
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1450
1647
|
children: l("path", {
|
|
1451
1648
|
d: "M843.904 783.573333 783.573333 843.904 512.042667 572.373333 240.512 843.904 180.181333 783.573333 451.712 512.042667 180.181333 240.512 240.512 180.181333 512.042667 451.712 783.573333 180.181333 843.904 240.512 572.373333 512.042667 843.904 783.573333Z"
|
|
1452
1649
|
})
|
|
1453
|
-
}),
|
|
1650
|
+
}), Hn = () => l("svg", {
|
|
1454
1651
|
className: "icon",
|
|
1455
1652
|
viewBox: "0 0 1024 1024",
|
|
1456
1653
|
version: "1.1",
|
|
@@ -1458,56 +1655,56 @@ const gn = () => l("svg", {
|
|
|
1458
1655
|
children: l("path", {
|
|
1459
1656
|
d: "M900.64 379.808l-263.072-256.032c-36.448-35.328-105.76-35.392-142.304 0.096l-327.04 319.904c-56.416 54.72-70.72 76.704-70.72 150.976l0 143.936c0 132.768 26.976 192 186.912 192l131.872 0c81.12 0 128.448-46.656 193.952-111.264l290.016-297.696c18.592-17.984 29.248-43.968 29.248-71.264C929.504 423.36 918.976 397.6 900.64 379.808zM323.008 786.752c-52.928 0-96-43.072-96-96s43.072-96 96-96 96 43.072 96 96S375.936 786.752 323.008 786.752z"
|
|
1460
1657
|
})
|
|
1461
|
-
}),
|
|
1658
|
+
}), Ln = () => l("svg", {
|
|
1462
1659
|
viewBox: "0 0 1024 1024",
|
|
1463
1660
|
version: "1.1",
|
|
1464
1661
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1465
1662
|
children: l("path", {
|
|
1466
1663
|
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"
|
|
1467
1664
|
})
|
|
1468
|
-
}),
|
|
1665
|
+
}), On = () => l("svg", {
|
|
1469
1666
|
viewBox: "0 0 1024 1024",
|
|
1470
1667
|
version: "1.1",
|
|
1471
1668
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1472
1669
|
children: l("path", {
|
|
1473
1670
|
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"
|
|
1474
1671
|
})
|
|
1475
|
-
}),
|
|
1672
|
+
}), ft = () => l("svg", {
|
|
1476
1673
|
viewBox: "0 0 1024 1024",
|
|
1477
1674
|
version: "1.1",
|
|
1478
1675
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1479
1676
|
children: l("path", {
|
|
1480
1677
|
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"
|
|
1481
1678
|
})
|
|
1482
|
-
}),
|
|
1679
|
+
}), Rn = () => l("svg", {
|
|
1483
1680
|
viewBox: "0 0 1024 1024",
|
|
1484
1681
|
version: "1.1",
|
|
1485
1682
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1486
1683
|
children: l("path", {
|
|
1487
1684
|
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"
|
|
1488
1685
|
})
|
|
1489
|
-
}),
|
|
1686
|
+
}), Pn = () => l("svg", {
|
|
1490
1687
|
viewBox: "0 0 1024 1024",
|
|
1491
1688
|
version: "1.1",
|
|
1492
1689
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1493
1690
|
children: l("path", {
|
|
1494
1691
|
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"
|
|
1495
1692
|
})
|
|
1496
|
-
}),
|
|
1693
|
+
}), Bn = () => l("svg", {
|
|
1497
1694
|
viewBox: "0 0 1024 1024",
|
|
1498
1695
|
version: "1.1",
|
|
1499
1696
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1500
1697
|
children: l("path", {
|
|
1501
1698
|
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"
|
|
1502
1699
|
})
|
|
1503
|
-
}),
|
|
1700
|
+
}), Un = () => l("svg", {
|
|
1504
1701
|
viewBox: "0 0 1024 1024",
|
|
1505
1702
|
version: "1.1",
|
|
1506
1703
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1507
1704
|
children: l("path", {
|
|
1508
1705
|
d: "M960 544H64a32 32 0 1 1 0-64h896a32 32 0 1 1 0 64"
|
|
1509
1706
|
})
|
|
1510
|
-
}),
|
|
1707
|
+
}), Fn = () => l("svg", {
|
|
1511
1708
|
viewBox: "0 0 1024 1024",
|
|
1512
1709
|
version: "1.1",
|
|
1513
1710
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1524,7 +1721,7 @@ const gn = () => l("svg", {
|
|
|
1524
1721
|
}), l("path", {
|
|
1525
1722
|
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
1723
|
})]
|
|
1527
|
-
}),
|
|
1724
|
+
}), Wn = () => l("svg", {
|
|
1528
1725
|
viewBox: "0 0 18 18",
|
|
1529
1726
|
fill: "none",
|
|
1530
1727
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1538,7 +1735,7 @@ const gn = () => l("svg", {
|
|
|
1538
1735
|
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
1736
|
fill: "currentColor"
|
|
1540
1737
|
})]
|
|
1541
|
-
}),
|
|
1738
|
+
}), Vn = () => l("svg", {
|
|
1542
1739
|
viewBox: "64 64 896 896",
|
|
1543
1740
|
focusable: "false",
|
|
1544
1741
|
width: "1em",
|
|
@@ -1548,7 +1745,7 @@ const gn = () => l("svg", {
|
|
|
1548
1745
|
children: l("path", {
|
|
1549
1746
|
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
1747
|
})
|
|
1551
|
-
}),
|
|
1748
|
+
}), qn = () => l("svg", {
|
|
1552
1749
|
fill: "currentColor",
|
|
1553
1750
|
viewBox: "0 0 1000 1000",
|
|
1554
1751
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1556,14 +1753,14 @@ const gn = () => l("svg", {
|
|
|
1556
1753
|
children: Array.from({
|
|
1557
1754
|
length: 4
|
|
1558
1755
|
}).map((c, u) => {
|
|
1559
|
-
const
|
|
1756
|
+
const d = u * (146.66666666666666 + 140), a = 1e3 / 2 - 250 / 2, _ = 1e3 / 2 - 500 / 2;
|
|
1560
1757
|
return l("rect", {
|
|
1561
1758
|
fill: "currentColor",
|
|
1562
1759
|
rx: 70,
|
|
1563
1760
|
ry: 70,
|
|
1564
1761
|
height: 250,
|
|
1565
1762
|
width: 140,
|
|
1566
|
-
x:
|
|
1763
|
+
x: d,
|
|
1567
1764
|
y: a,
|
|
1568
1765
|
children: [l("animate", {
|
|
1569
1766
|
attributeName: "height",
|
|
@@ -1582,7 +1779,7 @@ const gn = () => l("svg", {
|
|
|
1582
1779
|
})]
|
|
1583
1780
|
}, u);
|
|
1584
1781
|
})
|
|
1585
|
-
}),
|
|
1782
|
+
}), jn = (n) => l("svg", {
|
|
1586
1783
|
className: n.className,
|
|
1587
1784
|
onClick: n.onClick,
|
|
1588
1785
|
viewBox: "0 0 1024 1024",
|
|
@@ -1591,7 +1788,7 @@ const gn = () => l("svg", {
|
|
|
1591
1788
|
children: l("path", {
|
|
1592
1789
|
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
1790
|
})
|
|
1594
|
-
}),
|
|
1791
|
+
}), Yn = (n) => l("svg", {
|
|
1595
1792
|
className: n.className,
|
|
1596
1793
|
viewBox: "0 0 1024 1024",
|
|
1597
1794
|
version: "1.1",
|
|
@@ -1599,7 +1796,7 @@ const gn = () => l("svg", {
|
|
|
1599
1796
|
children: l("path", {
|
|
1600
1797
|
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
1798
|
})
|
|
1602
|
-
}),
|
|
1799
|
+
}), Xn = (n) => l("svg", {
|
|
1603
1800
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1604
1801
|
className: n.className,
|
|
1605
1802
|
viewBox: "0 0 512 512",
|
|
@@ -1611,14 +1808,14 @@ const gn = () => l("svg", {
|
|
|
1611
1808
|
strokeWidth: "48",
|
|
1612
1809
|
d: "M112 184l144 144 144-144"
|
|
1613
1810
|
})
|
|
1614
|
-
}),
|
|
1811
|
+
}), pt = (n) => l("svg", {
|
|
1615
1812
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1616
1813
|
className: "".concat(n.className, " icon"),
|
|
1617
1814
|
viewBox: "0 0 512 512",
|
|
1618
1815
|
children: l("path", {
|
|
1619
1816
|
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
1817
|
})
|
|
1621
|
-
}),
|
|
1818
|
+
}), Re = (n) => l("svg", {
|
|
1622
1819
|
className: n.className,
|
|
1623
1820
|
width: "16",
|
|
1624
1821
|
height: "16",
|
|
@@ -1642,12 +1839,57 @@ const gn = () => l("svg", {
|
|
|
1642
1839
|
repeatCount: "indefinite"
|
|
1643
1840
|
})
|
|
1644
1841
|
})
|
|
1842
|
+
}), Zn = () => l("svg", {
|
|
1843
|
+
className: "icon",
|
|
1844
|
+
viewBox: "0 0 1024 1024",
|
|
1845
|
+
version: "1.1",
|
|
1846
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1847
|
+
width: "18",
|
|
1848
|
+
height: "18",
|
|
1849
|
+
children: l("path", {
|
|
1850
|
+
d: "M704 256v490.666667a170.666667 170.666667 0 0 1-170.666667 170.666666 170.666667 170.666667 0 0 1-170.666666-170.666666V213.333333A106.666667 106.666667 0 0 1 469.333333 106.666667 106.666667 106.666667 0 0 1 576 213.333333v448a42.666667 42.666667 0 0 1-42.666667 42.666667 42.666667 42.666667 0 0 1-42.666666-42.666667V256H426.666667v405.333333a106.666667 106.666667 0 0 0 106.666666 106.666667 106.666667 106.666667 0 0 0 106.666667-106.666667V213.333333a170.666667 170.666667 0 0 0-170.666667-170.666666 170.666667 170.666667 0 0 0-170.666666 170.666666v533.333334a234.666667 234.666667 0 0 0 234.666666 234.666666 234.666667 234.666667 0 0 0 234.666667-234.666666V256h-64z"
|
|
1851
|
+
})
|
|
1852
|
+
}), sn = () => l("svg", {
|
|
1853
|
+
className: "icon",
|
|
1854
|
+
viewBox: "0 0 1024 1024",
|
|
1855
|
+
version: "1.1",
|
|
1856
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1857
|
+
width: "18",
|
|
1858
|
+
height: "18",
|
|
1859
|
+
children: [l("path", {
|
|
1860
|
+
d: "M842.666667 285.866667l-187.733334-187.733334c-14.933333-14.933333-32-21.333333-53.333333-21.333333H234.666667C194.133333 74.666667 160 108.8 160 149.333333v725.333334c0 40.533333 34.133333 74.666667 74.666667 74.666666h554.666666c40.533333 0 74.666667-34.133333 74.666667-74.666666V337.066667c0-19.2-8.533333-38.4-21.333333-51.2z m-44.8 44.8c-2.133333 2.133333-4.266667 0-8.533334 0h-170.666666c-6.4 0-10.666667-4.266667-10.666667-10.666667V149.333333c0-2.133333 0-6.4-2.133333-8.533333 0 0 2.133333 0 2.133333 2.133333l189.866667 187.733334z m-8.533334 554.666666H234.666667c-6.4 0-10.666667-4.266667-10.666667-10.666666V149.333333c0-6.4 4.266667-10.666667 10.666667-10.666666h311.466666c-2.133333 4.266667-2.133333 6.4-2.133333 10.666666v170.666667c0 40.533333 34.133333 74.666667 74.666667 74.666667h170.666666c4.266667 0 6.4 0 10.666667-2.133334V874.666667c0 6.4-4.266667 10.666667-10.666667 10.666666z",
|
|
1861
|
+
fill: "currentColor"
|
|
1862
|
+
}), l("path", {
|
|
1863
|
+
d: "M640 693.333333H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM640 522.666667H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM341.333333 416h85.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-85.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32z",
|
|
1864
|
+
fill: "currentColor"
|
|
1865
|
+
})]
|
|
1866
|
+
}), Gn = () => l("svg", {
|
|
1867
|
+
className: "icon",
|
|
1868
|
+
viewBox: "0 0 1024 1024",
|
|
1869
|
+
version: "1.1",
|
|
1870
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1871
|
+
width: "18",
|
|
1872
|
+
height: "18",
|
|
1873
|
+
children: l("path", {
|
|
1874
|
+
d: "M557.248 511.68l135.776-135.744-45.248-45.28L512 466.432l-135.776-135.776-45.248 45.28 135.776 135.744-135.776 135.776 45.248 45.248L512 556.928l135.776 135.776 45.248-45.248-135.776-135.776zM512 64c247.136 0 448 200.864 448 448s-200.864 448-448 448S64 759.136 64 512 264.864 64 512 64z",
|
|
1875
|
+
fill: "currentColor"
|
|
1876
|
+
})
|
|
1877
|
+
}), Jn = () => l("svg", {
|
|
1878
|
+
className: "icon",
|
|
1879
|
+
viewBox: "0 0 1024 1024",
|
|
1880
|
+
version: "1.1",
|
|
1881
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1882
|
+
width: "18",
|
|
1883
|
+
height: "18",
|
|
1884
|
+
children: l("path", {
|
|
1885
|
+
d: "M512.43945313 904.51953125c-6.06445313 0-12.12890625-1.58203125-17.57812501-4.74609375L136.70703125 689.71484375c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867188-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l76.37695313-44.91210938L136.97070312 540.125c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867187-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l73.38867187-43.15429688-73.125-42.890625C126.51171875 387.81054687 120.0078125 376.38476562 120.0078125 364.08007812c0-12.3046875 6.50390625-23.73046875 17.13867188-29.97070312L495.828125 122.99609375c10.8984375-6.41601563 24.34570313-6.41601563 35.24414063 0l358.15429687 210.05859375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-73.38867188 43.15429688 73.12500001 42.890625c10.63476563 6.24023438 17.13867188 17.66601563 17.13867187 29.97070312s-6.50390625 23.73046875-17.13867187 29.97070313L812.5859375 583.89453125l76.11328125 44.6484375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-358.59375 211.2890625c-5.44921875 3.1640625-11.6015625 4.74609375-17.66601563 4.74609375zM223.015625 659.65625l289.42382813 169.8046875 290.12695312-170.77148438-58.44726563-34.27734374L530.28125 750.18359375a34.67285156 34.67285156 0 0 1-35.24414063 0L281.7265625 625.02734375 223.015625 659.65625z m76.90429688-104.58984375l212.69531249 124.8046875 290.12695313-170.77148438-55.546875-32.60742187-216.65039063 127.6171875a34.67285156 34.67285156 0 0 1-35.24414062 0L279.00195312 477.28320312l-55.81054687 32.78320313 75.49804688 44.296875c0.43945313 0.26367188 0.79101563 0.52734375 1.23046874 0.703125z m-2.81250001-147.83203125l215.68359376 126.5625 216.12304687-127.17773438c0.3515625-0.26367188 0.703125-0.43945313 1.0546875-0.61523437l72.86132813-42.890625-289.33593751-169.8046875-290.12695312 170.68359375 72.59765625 42.62695313c0.43945313 0.17578125 0.79101563 0.43945313 1.14257813 0.61523437z"
|
|
1886
|
+
})
|
|
1645
1887
|
});
|
|
1646
|
-
const
|
|
1888
|
+
const Kn = (n) => {
|
|
1647
1889
|
const {
|
|
1648
1890
|
items: e
|
|
1649
|
-
} = n, t =
|
|
1650
|
-
|
|
1891
|
+
} = n, t = q([]), i = new M("chat-thought-chain"), s = q([]);
|
|
1892
|
+
V(() => {
|
|
1651
1893
|
s.value = e.filter((r) => r.description), s.value.length > 0 && s.value.forEach((r, c) => {
|
|
1652
1894
|
r.done && (t.value = [...t.value, c]);
|
|
1653
1895
|
});
|
|
@@ -1673,7 +1915,7 @@ const Mn = (n) => {
|
|
|
1673
1915
|
children: [l("div", {
|
|
1674
1916
|
className: i.e("item-title"),
|
|
1675
1917
|
onClick: () => o(c),
|
|
1676
|
-
children: [r.title, l(
|
|
1918
|
+
children: [r.title, l(Xn, {
|
|
1677
1919
|
className: i.e("icon")
|
|
1678
1920
|
})]
|
|
1679
1921
|
}), l("div", {
|
|
@@ -1684,129 +1926,227 @@ const Mn = (n) => {
|
|
|
1684
1926
|
}, c);
|
|
1685
1927
|
})
|
|
1686
1928
|
});
|
|
1687
|
-
},
|
|
1929
|
+
}, Z = new M("markdown-message"), Qn = (n) => {
|
|
1688
1930
|
const {
|
|
1689
1931
|
message: e,
|
|
1690
1932
|
size: t
|
|
1691
|
-
} = n, i =
|
|
1933
|
+
} = n, i = q(Vt()), s = q(null), o = j(() => e.state === 20 && e.completed !== !0, [e.state, e.completed]), r = j(() => e.state === 20 && e.completed === !0, [e.state, e.completed]), c = q({
|
|
1692
1934
|
title: "思考过程",
|
|
1693
1935
|
description: "",
|
|
1694
|
-
icon: l(
|
|
1695
|
-
}), u = (
|
|
1696
|
-
const
|
|
1697
|
-
let _ = "",
|
|
1698
|
-
return a === -1 ? (
|
|
1699
|
-
isThoughtCompleted:
|
|
1936
|
+
icon: l(Re, {})
|
|
1937
|
+
}), u = (f) => {
|
|
1938
|
+
const d = f.indexOf("<think>"), a = f.indexOf("</think>");
|
|
1939
|
+
let _ = "", v = "", h = !1;
|
|
1940
|
+
return a === -1 ? (h = !1, _ = f.slice(d + 7), v = "") : (h = !0, _ = f.slice(d + 7, a), v = f.slice(a + 8)), {
|
|
1941
|
+
isThoughtCompleted: h,
|
|
1700
1942
|
thoughtContent: _,
|
|
1701
|
-
answerContent:
|
|
1943
|
+
answerContent: v
|
|
1702
1944
|
};
|
|
1703
1945
|
};
|
|
1704
|
-
return
|
|
1946
|
+
return V(() => {
|
|
1705
1947
|
if (t >= 0 && s.value)
|
|
1706
1948
|
if (e.content.indexOf("<think>") !== -1) {
|
|
1707
1949
|
const {
|
|
1708
|
-
isThoughtCompleted:
|
|
1709
|
-
thoughtContent:
|
|
1950
|
+
isThoughtCompleted: f,
|
|
1951
|
+
thoughtContent: d,
|
|
1710
1952
|
answerContent: a
|
|
1711
1953
|
} = u(e.content);
|
|
1712
|
-
|
|
1954
|
+
f && (c.value.icon = f ? l(pt, {}) : l(Re, {})), d && (c.value.description = d), a && s.value.setMarkdown(a);
|
|
1713
1955
|
} else
|
|
1714
1956
|
s.value.setMarkdown(e.content);
|
|
1715
|
-
}, [e, t]),
|
|
1716
|
-
let
|
|
1957
|
+
}, [e, t]), V(() => {
|
|
1958
|
+
let f = "";
|
|
1717
1959
|
if (e.content.indexOf("<think>") !== -1) {
|
|
1718
1960
|
const {
|
|
1719
|
-
isThoughtCompleted:
|
|
1961
|
+
isThoughtCompleted: d,
|
|
1720
1962
|
thoughtContent: a,
|
|
1721
1963
|
answerContent: _
|
|
1722
1964
|
} = u(e.content);
|
|
1723
1965
|
c.value = {
|
|
1724
1966
|
title: "思考过程",
|
|
1725
1967
|
description: a || "",
|
|
1726
|
-
icon:
|
|
1727
|
-
}, _ && (
|
|
1968
|
+
icon: d ? l(pt, {}) : l(Re, {})
|
|
1969
|
+
}, _ && (f = _);
|
|
1728
1970
|
} else
|
|
1729
|
-
|
|
1730
|
-
s.value = new
|
|
1971
|
+
f = e.content;
|
|
1972
|
+
s.value = new pn({
|
|
1731
1973
|
id: i,
|
|
1732
|
-
value:
|
|
1974
|
+
value: f || "",
|
|
1733
1975
|
editor: {
|
|
1734
1976
|
defaultModel: "previewOnly"
|
|
1735
1977
|
}
|
|
1736
1978
|
});
|
|
1737
1979
|
}, []), l("div", {
|
|
1738
|
-
className: "".concat(
|
|
1980
|
+
className: "".concat(Z.b(), " ").concat(Z.is("loading", o)),
|
|
1739
1981
|
children: [l("div", {
|
|
1740
|
-
className:
|
|
1982
|
+
className: Z.b("header"),
|
|
1741
1983
|
children: [l("div", {
|
|
1742
|
-
className:
|
|
1984
|
+
className: Z.be("header", "caption"),
|
|
1743
1985
|
children: "AI "
|
|
1744
1986
|
}), n.children, r ? l("div", {
|
|
1745
|
-
className:
|
|
1987
|
+
className: Z.be("header", "timeout"),
|
|
1746
1988
|
children: "请求超时"
|
|
1747
1989
|
}) : null]
|
|
1748
1990
|
}), l("div", {
|
|
1749
|
-
className: "".concat(
|
|
1750
|
-
children: [l(
|
|
1991
|
+
className: "".concat(Z.b("content"), " pre-wrap-container"),
|
|
1992
|
+
children: [l(Kn, {
|
|
1751
1993
|
items: [c.value]
|
|
1752
1994
|
}), l("div", {
|
|
1753
1995
|
id: i
|
|
1754
1996
|
})]
|
|
1755
1997
|
}), l("div", {
|
|
1756
|
-
className:
|
|
1998
|
+
className: Z.b("footer")
|
|
1999
|
+
})]
|
|
2000
|
+
});
|
|
2001
|
+
};
|
|
2002
|
+
const ae = new M("ossfile-material"), ei = (n) => {
|
|
2003
|
+
const e = O(() => n.material.data.name), t = O(() => n.material.metadata.size), i = O(() => {
|
|
2004
|
+
const o = n.material.metadata.state;
|
|
2005
|
+
return o === "successed" ? "上传成功" : o === "uploading" ? "上传中" : o === "failed" ? "上传失败" : "未知状态";
|
|
2006
|
+
}), s = O(() => {
|
|
2007
|
+
switch (n.material.metadata.state) {
|
|
2008
|
+
case "successed":
|
|
2009
|
+
return "#1890ff";
|
|
2010
|
+
case "uploading":
|
|
2011
|
+
return "#52c41a";
|
|
2012
|
+
case "failed":
|
|
2013
|
+
return "#ff4d4f";
|
|
2014
|
+
default:
|
|
2015
|
+
return "#ff4d4f";
|
|
2016
|
+
}
|
|
2017
|
+
});
|
|
2018
|
+
return l("div", {
|
|
2019
|
+
className: ae.b(),
|
|
2020
|
+
children: [l("div", {
|
|
2021
|
+
className: ae.b("left"),
|
|
2022
|
+
children: l(sn, {})
|
|
2023
|
+
}), l("div", {
|
|
2024
|
+
className: ae.b("right"),
|
|
2025
|
+
children: [l("div", {
|
|
2026
|
+
className: ae.e("name"),
|
|
2027
|
+
title: e,
|
|
2028
|
+
children: e
|
|
2029
|
+
}), l("div", {
|
|
2030
|
+
className: ae.e("metadata"),
|
|
2031
|
+
children: [l("div", {
|
|
2032
|
+
children: [t, "B"]
|
|
2033
|
+
}), l("div", {
|
|
2034
|
+
style: {
|
|
2035
|
+
color: s.value
|
|
2036
|
+
},
|
|
2037
|
+
children: i
|
|
2038
|
+
})]
|
|
2039
|
+
})]
|
|
2040
|
+
})]
|
|
2041
|
+
});
|
|
2042
|
+
};
|
|
2043
|
+
const ce = new M("common-material"), ti = (n) => {
|
|
2044
|
+
var i;
|
|
2045
|
+
const e = (i = n.controller.opts.questionToolbarItems) == null ? void 0 : i.find((s) => s.id === n.material.metadata.actionId), t = O(() => n.material.metadata.name);
|
|
2046
|
+
return l("div", {
|
|
2047
|
+
className: ce.b(),
|
|
2048
|
+
children: [l("div", {
|
|
2049
|
+
className: ce.b("left"),
|
|
2050
|
+
children: e && e.icon ? typeof e.icon == "function" ? e.icon(I) : e.icon : l(Jn, {})
|
|
2051
|
+
}), l("div", {
|
|
2052
|
+
className: ce.b("right"),
|
|
2053
|
+
children: [l("div", {
|
|
2054
|
+
className: ce.e("name"),
|
|
2055
|
+
title: t,
|
|
2056
|
+
children: t
|
|
2057
|
+
}), l("div", {
|
|
2058
|
+
className: ce.e("metadata"),
|
|
2059
|
+
children: l("div", {
|
|
2060
|
+
children: (e == null ? void 0 : e.label) || "素材资源"
|
|
2061
|
+
})
|
|
2062
|
+
})]
|
|
1757
2063
|
})]
|
|
1758
2064
|
});
|
|
1759
2065
|
};
|
|
1760
|
-
const
|
|
1761
|
-
const
|
|
2066
|
+
const Pe = new M("chat-input-material-item"), on = (n) => {
|
|
2067
|
+
const {
|
|
2068
|
+
material: e
|
|
2069
|
+
} = n;
|
|
2070
|
+
let t = null;
|
|
2071
|
+
switch (e.type) {
|
|
2072
|
+
case "ossfile":
|
|
2073
|
+
t = ei;
|
|
2074
|
+
break;
|
|
2075
|
+
default:
|
|
2076
|
+
t = ti;
|
|
2077
|
+
}
|
|
2078
|
+
const i = () => {
|
|
2079
|
+
n.controller.deleteMaterial(e);
|
|
2080
|
+
};
|
|
2081
|
+
return l("div", {
|
|
2082
|
+
className: "".concat(Pe.b(), " ").concat(Pe.is("disabled", n.disabled)),
|
|
2083
|
+
children: [l("div", {
|
|
2084
|
+
className: Pe.e("icon"),
|
|
2085
|
+
onClick: i,
|
|
2086
|
+
children: l(Gn, {})
|
|
2087
|
+
}), I(t, {
|
|
2088
|
+
material: e,
|
|
2089
|
+
controller: n.controller
|
|
2090
|
+
})]
|
|
2091
|
+
});
|
|
2092
|
+
}, Q = new M("user-message-question"), ni = (n) => {
|
|
2093
|
+
const e = O(() => n.message.content), t = O(() => jt.parseMixedContent(e.value));
|
|
1762
2094
|
return l("div", {
|
|
1763
|
-
className:
|
|
2095
|
+
className: Q.b(),
|
|
1764
2096
|
children: [l("div", {
|
|
1765
|
-
className:
|
|
2097
|
+
className: Q.e("user-header"),
|
|
1766
2098
|
children: [n.children, l("div", {
|
|
1767
|
-
className:
|
|
2099
|
+
className: Q.e("user"),
|
|
1768
2100
|
children: "我"
|
|
1769
2101
|
})]
|
|
1770
2102
|
}), l("div", {
|
|
1771
|
-
className:
|
|
2103
|
+
className: Q.e("content"),
|
|
1772
2104
|
children: l("div", {
|
|
1773
2105
|
dir: "auto",
|
|
1774
|
-
className:
|
|
1775
|
-
children: l("p", {
|
|
2106
|
+
className: Q.em("content", "body"),
|
|
2107
|
+
children: [l("p", {
|
|
2108
|
+
dir: "auto",
|
|
2109
|
+
className: Q.em("content", "material"),
|
|
2110
|
+
children: t.value.hasResources && t.value.resources.map((i) => l(on, {
|
|
2111
|
+
material: i,
|
|
2112
|
+
disabled: !0,
|
|
2113
|
+
controller: n.controller
|
|
2114
|
+
}, i.id))
|
|
2115
|
+
}), l("p", {
|
|
1776
2116
|
dir: "auto",
|
|
1777
2117
|
className: "pre-wrap-container",
|
|
1778
|
-
children:
|
|
1779
|
-
})
|
|
2118
|
+
children: t.value.remainingText
|
|
2119
|
+
})]
|
|
1780
2120
|
})
|
|
1781
2121
|
})]
|
|
1782
2122
|
});
|
|
1783
2123
|
};
|
|
1784
|
-
const
|
|
1785
|
-
const e =
|
|
2124
|
+
const me = new M("error-message"), ii = (n) => {
|
|
2125
|
+
const e = O(() => n.message.content);
|
|
1786
2126
|
return l("div", {
|
|
1787
|
-
className:
|
|
2127
|
+
className: me.b(),
|
|
1788
2128
|
children: [l("div", {
|
|
1789
|
-
className:
|
|
2129
|
+
className: me.b("header"),
|
|
1790
2130
|
children: [l("div", {
|
|
1791
|
-
className:
|
|
2131
|
+
className: me.be("header", "caption"),
|
|
1792
2132
|
children: "AI "
|
|
1793
2133
|
}), n.children]
|
|
1794
2134
|
}), l("div", {
|
|
1795
|
-
className: "".concat(
|
|
2135
|
+
className: "".concat(me.e("content"), " pre-wrap-container"),
|
|
1796
2136
|
children: l("span", {
|
|
1797
2137
|
children: e
|
|
1798
2138
|
})
|
|
1799
2139
|
})]
|
|
1800
2140
|
});
|
|
1801
2141
|
};
|
|
1802
|
-
const
|
|
1803
|
-
className:
|
|
2142
|
+
const _t = new M("unknown-message"), si = (n) => l("div", {
|
|
2143
|
+
className: _t.b(),
|
|
1804
2144
|
children: l("span", {
|
|
1805
|
-
className: "".concat(
|
|
2145
|
+
className: "".concat(_t.e("content"), " pre-wrap-container"),
|
|
1806
2146
|
children: ["暂未支持的消息类型: ", n.message.type]
|
|
1807
2147
|
})
|
|
1808
2148
|
});
|
|
1809
|
-
const
|
|
2149
|
+
const oi = new M("chat-message-item"), ri = (n) => {
|
|
1810
2150
|
const {
|
|
1811
2151
|
message: e,
|
|
1812
2152
|
size: t
|
|
@@ -1814,17 +2154,17 @@ const On = new A("chat-message-item"), Pn = (n) => {
|
|
|
1814
2154
|
let i = null;
|
|
1815
2155
|
switch (e.type) {
|
|
1816
2156
|
case "DEFAULT":
|
|
1817
|
-
i = e.role === "ASSISTANT" ?
|
|
2157
|
+
i = e.role === "ASSISTANT" ? Qn : ni;
|
|
1818
2158
|
break;
|
|
1819
2159
|
case "ERROR":
|
|
1820
|
-
i =
|
|
2160
|
+
i = ii;
|
|
1821
2161
|
break;
|
|
1822
2162
|
default:
|
|
1823
|
-
i =
|
|
2163
|
+
i = si;
|
|
1824
2164
|
}
|
|
1825
2165
|
return l("div", {
|
|
1826
|
-
className:
|
|
1827
|
-
children:
|
|
2166
|
+
className: oi.b(),
|
|
2167
|
+
children: I(i, {
|
|
1828
2168
|
size: t,
|
|
1829
2169
|
message: e,
|
|
1830
2170
|
controller: n.controller,
|
|
@@ -1832,7 +2172,7 @@ const On = new A("chat-message-item"), Pn = (n) => {
|
|
|
1832
2172
|
})
|
|
1833
2173
|
});
|
|
1834
2174
|
};
|
|
1835
|
-
const
|
|
2175
|
+
const ee = new M("chat-toolbar"), Xe = (n) => {
|
|
1836
2176
|
const {
|
|
1837
2177
|
controller: e,
|
|
1838
2178
|
items: t = [],
|
|
@@ -1844,42 +2184,42 @@ const J = new A("chat-toolbar"), Ue = (n) => {
|
|
|
1844
2184
|
const u = [{
|
|
1845
2185
|
label: "新建对话",
|
|
1846
2186
|
title: "新建对话",
|
|
1847
|
-
icon: l(
|
|
2187
|
+
icon: l(Wn, {}),
|
|
1848
2188
|
onClick: () => {
|
|
1849
2189
|
e.newDialogue();
|
|
1850
2190
|
}
|
|
1851
|
-
}],
|
|
2191
|
+
}], f = [{
|
|
1852
2192
|
label: "回填",
|
|
1853
2193
|
title: "回填",
|
|
1854
|
-
icon: l(
|
|
2194
|
+
icon: l(Hn, {}),
|
|
1855
2195
|
onClick: () => {
|
|
1856
2196
|
e.backfill(i);
|
|
1857
2197
|
}
|
|
1858
2198
|
}, {
|
|
1859
2199
|
label: "刷新",
|
|
1860
2200
|
title: "刷新",
|
|
1861
|
-
icon: l(
|
|
2201
|
+
icon: l(ft, {}),
|
|
1862
2202
|
onClick: () => {
|
|
1863
2203
|
e.refreshMessage(i);
|
|
1864
2204
|
}
|
|
1865
2205
|
}, {
|
|
1866
2206
|
label: "删除",
|
|
1867
2207
|
title: "删除",
|
|
1868
|
-
icon: l(
|
|
2208
|
+
icon: l(On, {}),
|
|
1869
2209
|
onClick: () => {
|
|
1870
2210
|
e.deleteMessage(i);
|
|
1871
2211
|
}
|
|
1872
2212
|
}, {
|
|
1873
2213
|
label: "复制",
|
|
1874
2214
|
title: "复制",
|
|
1875
|
-
icon: l(
|
|
2215
|
+
icon: l(Rn, {}),
|
|
1876
2216
|
onClick: () => {
|
|
1877
2217
|
e.copyMessage(i);
|
|
1878
2218
|
}
|
|
1879
|
-
}],
|
|
2219
|
+
}], d = [{
|
|
1880
2220
|
label: "刷新",
|
|
1881
2221
|
title: "刷新",
|
|
1882
|
-
icon: l(
|
|
2222
|
+
icon: l(ft, {}),
|
|
1883
2223
|
onClick: () => {
|
|
1884
2224
|
e.refreshMessage(i, !0);
|
|
1885
2225
|
}
|
|
@@ -1887,52 +2227,52 @@ const J = new A("chat-toolbar"), Ue = (n) => {
|
|
|
1887
2227
|
if (s === "content")
|
|
1888
2228
|
switch (c = "circle", i.type) {
|
|
1889
2229
|
case "DEFAULT":
|
|
1890
|
-
i.role === "ASSISTANT" ? r = [...
|
|
2230
|
+
i.role === "ASSISTANT" ? r = [...f, ...t] : r = [...d];
|
|
1891
2231
|
break;
|
|
1892
2232
|
case "ERROR":
|
|
1893
|
-
r = [...
|
|
2233
|
+
r = [...f, ...t];
|
|
1894
2234
|
break;
|
|
1895
2235
|
}
|
|
1896
2236
|
else
|
|
1897
2237
|
r = [...u, ...t];
|
|
1898
|
-
const a = (
|
|
1899
|
-
var
|
|
1900
|
-
_(g) || (
|
|
1901
|
-
};
|
|
2238
|
+
const a = (p) => typeof p.hidden == "function" ? p.hidden(i) : p.hidden === !0, _ = (p) => typeof p.disabled == "function" ? p.disabled(i) : p.disabled === !0, v = (p, g) => {
|
|
2239
|
+
var b;
|
|
2240
|
+
_(g) || (b = g.onClick) == null || b.call(g, p, e.context, e.params, i);
|
|
2241
|
+
}, h = j(() => s === "content" && (i == null ? void 0 : i.state) === 20 && (i == null ? void 0 : i.completed) !== !0, [i == null ? void 0 : i.state, i == null ? void 0 : i.completed]);
|
|
1902
2242
|
return l("div", {
|
|
1903
|
-
className: "".concat(
|
|
1904
|
-
children: r.map((
|
|
1905
|
-
if (!a(
|
|
2243
|
+
className: "".concat(ee.b(), " ").concat(ee.e(c), " ").concat(o || ""),
|
|
2244
|
+
children: r.map((p, g) => {
|
|
2245
|
+
if (!a(p))
|
|
1906
2246
|
return l("div", {
|
|
1907
|
-
className: "".concat(
|
|
1908
|
-
title:
|
|
1909
|
-
onClick: (
|
|
2247
|
+
className: "".concat(ee.e("item"), " ").concat(ee.is("disabled", _(p) || h), " ").concat(o || ""),
|
|
2248
|
+
title: p.title,
|
|
2249
|
+
onClick: (b) => v(b, p),
|
|
1910
2250
|
children: [l("div", {
|
|
1911
|
-
className: "".concat(
|
|
1912
|
-
children: typeof
|
|
2251
|
+
className: "".concat(ee.em("item", "icon")),
|
|
2252
|
+
children: typeof p.icon == "function" ? p.icon(I) : p.icon
|
|
1913
2253
|
}), l("div", {
|
|
1914
|
-
className: "".concat(
|
|
1915
|
-
children: typeof
|
|
2254
|
+
className: "".concat(ee.em("item", "label")),
|
|
2255
|
+
children: typeof p.label == "function" ? p.label(I) : p.label
|
|
1916
2256
|
})]
|
|
1917
2257
|
}, g);
|
|
1918
2258
|
})
|
|
1919
2259
|
});
|
|
1920
2260
|
};
|
|
1921
|
-
const
|
|
1922
|
-
const e =
|
|
1923
|
-
return
|
|
2261
|
+
const ai = new M("chat-messages"), vt = (n) => {
|
|
2262
|
+
const e = K(null), t = n.controller.messages;
|
|
2263
|
+
return In(() => {
|
|
1924
2264
|
e.current && t.value.length > 0 && (e.current.scrollTop = e.current.scrollHeight);
|
|
1925
2265
|
}), l("div", {
|
|
1926
2266
|
ref: e,
|
|
1927
|
-
className:
|
|
2267
|
+
className: ai.b(),
|
|
1928
2268
|
children: t.value.map((i) => {
|
|
1929
2269
|
var o;
|
|
1930
2270
|
const s = ((o = i.content) == null ? void 0 : o.length) || 0;
|
|
1931
|
-
return l(
|
|
2271
|
+
return l(ri, {
|
|
1932
2272
|
size: s,
|
|
1933
2273
|
message: i,
|
|
1934
2274
|
controller: n.controller,
|
|
1935
|
-
children: l(
|
|
2275
|
+
children: l(Xe, {
|
|
1936
2276
|
data: i,
|
|
1937
2277
|
type: "content",
|
|
1938
2278
|
items: n.toolbarItems,
|
|
@@ -1942,12 +2282,12 @@ const Bn = new A("chat-messages"), ht = (n) => {
|
|
|
1942
2282
|
})
|
|
1943
2283
|
});
|
|
1944
2284
|
};
|
|
1945
|
-
function
|
|
2285
|
+
function ci(n, e) {
|
|
1946
2286
|
for (var t in e)
|
|
1947
2287
|
n[t] = e[t];
|
|
1948
2288
|
return n;
|
|
1949
2289
|
}
|
|
1950
|
-
function
|
|
2290
|
+
function mt(n, e) {
|
|
1951
2291
|
for (var t in n)
|
|
1952
2292
|
if (t !== "__source" && !(t in e))
|
|
1953
2293
|
return !0;
|
|
@@ -1956,84 +2296,84 @@ function dt(n, e) {
|
|
|
1956
2296
|
return !0;
|
|
1957
2297
|
return !1;
|
|
1958
2298
|
}
|
|
1959
|
-
function
|
|
2299
|
+
function gt(n) {
|
|
1960
2300
|
this.props = n;
|
|
1961
2301
|
}
|
|
1962
|
-
(
|
|
1963
|
-
return
|
|
2302
|
+
(gt.prototype = new H()).isPureReactComponent = !0, gt.prototype.shouldComponentUpdate = function(n, e) {
|
|
2303
|
+
return mt(this.props, n) || mt(this.state, e);
|
|
1964
2304
|
};
|
|
1965
|
-
var
|
|
1966
|
-
|
|
1967
|
-
n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null),
|
|
2305
|
+
var yt = m.__b;
|
|
2306
|
+
m.__b = function(n) {
|
|
2307
|
+
n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null), yt && yt(n);
|
|
1968
2308
|
};
|
|
1969
|
-
var
|
|
1970
|
-
|
|
2309
|
+
var li = m.__e;
|
|
2310
|
+
m.__e = function(n, e, t, i) {
|
|
1971
2311
|
if (n.then) {
|
|
1972
2312
|
for (var s, o = e; o = o.__; )
|
|
1973
2313
|
if ((s = o.__c) && s.__c)
|
|
1974
2314
|
return e.__e == null && (e.__e = t.__e, e.__k = t.__k), s.__c(n, e);
|
|
1975
2315
|
}
|
|
1976
|
-
|
|
2316
|
+
li(n, e, t, i);
|
|
1977
2317
|
};
|
|
1978
|
-
var
|
|
1979
|
-
function
|
|
2318
|
+
var bt = m.unmount;
|
|
2319
|
+
function rn(n, e, t) {
|
|
1980
2320
|
return n && (n.__c && n.__c.__H && (n.__c.__H.__.forEach(function(i) {
|
|
1981
2321
|
typeof i.__c == "function" && i.__c();
|
|
1982
|
-
}), n.__c.__H = null), (n =
|
|
1983
|
-
return
|
|
2322
|
+
}), n.__c.__H = null), (n = ci({}, n)).__c != null && (n.__c.__P === t && (n.__c.__P = e), n.__c = null), n.__k = n.__k && n.__k.map(function(i) {
|
|
2323
|
+
return rn(i, e, t);
|
|
1984
2324
|
})), n;
|
|
1985
2325
|
}
|
|
1986
|
-
function
|
|
2326
|
+
function an(n, e, t) {
|
|
1987
2327
|
return n && t && (n.__v = null, n.__k = n.__k && n.__k.map(function(i) {
|
|
1988
|
-
return
|
|
2328
|
+
return an(i, e, t);
|
|
1989
2329
|
}), n.__c && n.__c.__P === e && (n.__e && t.insertBefore(n.__e, n.__d), n.__c.__e = !0, n.__c.__P = t)), n;
|
|
1990
2330
|
}
|
|
1991
|
-
function
|
|
2331
|
+
function Be() {
|
|
1992
2332
|
this.__u = 0, this.t = null, this.__b = null;
|
|
1993
2333
|
}
|
|
1994
|
-
function
|
|
2334
|
+
function cn(n) {
|
|
1995
2335
|
var e = n.__.__c;
|
|
1996
2336
|
return e && e.__a && e.__a(n);
|
|
1997
2337
|
}
|
|
1998
|
-
function
|
|
2338
|
+
function ge() {
|
|
1999
2339
|
this.u = null, this.o = null;
|
|
2000
2340
|
}
|
|
2001
|
-
|
|
2341
|
+
m.unmount = function(n) {
|
|
2002
2342
|
var e = n.__c;
|
|
2003
|
-
e && e.__R && e.__R(), e && n.__h === !0 && (n.type = null),
|
|
2004
|
-
}, (
|
|
2343
|
+
e && e.__R && e.__R(), e && n.__h === !0 && (n.type = null), bt && bt(n);
|
|
2344
|
+
}, (Be.prototype = new H()).__c = function(n, e) {
|
|
2005
2345
|
var t = e.__c, i = this;
|
|
2006
2346
|
i.t == null && (i.t = []), i.t.push(t);
|
|
2007
|
-
var s =
|
|
2347
|
+
var s = cn(i.__v), o = !1, r = function() {
|
|
2008
2348
|
o || (o = !0, t.__R = null, s ? s(c) : c());
|
|
2009
2349
|
};
|
|
2010
2350
|
t.__R = r;
|
|
2011
2351
|
var c = function() {
|
|
2012
2352
|
if (!--i.__u) {
|
|
2013
2353
|
if (i.state.__a) {
|
|
2014
|
-
var
|
|
2015
|
-
i.__v.__k[0] =
|
|
2354
|
+
var f = i.state.__a;
|
|
2355
|
+
i.__v.__k[0] = an(f, f.__c.__P, f.__c.__O);
|
|
2016
2356
|
}
|
|
2017
|
-
var
|
|
2018
|
-
for (i.setState({ __a: i.__b = null });
|
|
2019
|
-
|
|
2357
|
+
var d;
|
|
2358
|
+
for (i.setState({ __a: i.__b = null }); d = i.t.pop(); )
|
|
2359
|
+
d.forceUpdate();
|
|
2020
2360
|
}
|
|
2021
2361
|
}, u = e.__h === !0;
|
|
2022
2362
|
i.__u++ || u || i.setState({ __a: i.__b = i.__v.__k[0] }), n.then(r, r);
|
|
2023
|
-
},
|
|
2363
|
+
}, Be.prototype.componentWillUnmount = function() {
|
|
2024
2364
|
this.t = [];
|
|
2025
|
-
},
|
|
2365
|
+
}, Be.prototype.render = function(n, e) {
|
|
2026
2366
|
if (this.__b) {
|
|
2027
2367
|
if (this.__v.__k) {
|
|
2028
2368
|
var t = document.createElement("div"), i = this.__v.__k[0].__c;
|
|
2029
|
-
this.__v.__k[0] =
|
|
2369
|
+
this.__v.__k[0] = rn(this.__b, t, i.__O = i.__P);
|
|
2030
2370
|
}
|
|
2031
2371
|
this.__b = null;
|
|
2032
2372
|
}
|
|
2033
|
-
var s = e.__a &&
|
|
2034
|
-
return s && (s.__h = null), [
|
|
2373
|
+
var s = e.__a && I(se, null, n.fallback);
|
|
2374
|
+
return s && (s.__h = null), [I(se, null, e.__a ? null : n.children), s];
|
|
2035
2375
|
};
|
|
2036
|
-
var
|
|
2376
|
+
var wt = function(n, e, t) {
|
|
2037
2377
|
if (++t[1] === t[0] && n.o.delete(e), n.props.revealOrder && (n.props.revealOrder[0] !== "t" || !n.o.size))
|
|
2038
2378
|
for (t = n.u; t; ) {
|
|
2039
2379
|
for (; t.length > 3; )
|
|
@@ -2043,652 +2383,157 @@ var vt = function(n, e, t) {
|
|
|
2043
2383
|
n.u = t = t[2];
|
|
2044
2384
|
}
|
|
2045
2385
|
};
|
|
2046
|
-
function
|
|
2386
|
+
function ui(n) {
|
|
2047
2387
|
return this.getChildContext = function() {
|
|
2048
2388
|
return n.context;
|
|
2049
2389
|
}, n.children;
|
|
2050
2390
|
}
|
|
2051
|
-
function
|
|
2391
|
+
function di(n) {
|
|
2052
2392
|
var e = this, t = n.i;
|
|
2053
2393
|
e.componentWillUnmount = function() {
|
|
2054
|
-
|
|
2394
|
+
te(null, e.l), e.l = null, e.i = null;
|
|
2055
2395
|
}, e.i && e.i !== t && e.componentWillUnmount(), e.l || (e.i = t, e.l = { nodeType: 1, parentNode: t, childNodes: [], appendChild: function(i) {
|
|
2056
2396
|
this.childNodes.push(i), e.i.appendChild(i);
|
|
2057
2397
|
}, insertBefore: function(i, s) {
|
|
2058
2398
|
this.childNodes.push(i), e.i.appendChild(i);
|
|
2059
2399
|
}, removeChild: function(i) {
|
|
2060
2400
|
this.childNodes.splice(this.childNodes.indexOf(i) >>> 1, 1), e.i.removeChild(i);
|
|
2061
|
-
} }),
|
|
2401
|
+
} }), te(I(ui, { context: e.context }, n.__v), e.l);
|
|
2062
2402
|
}
|
|
2063
|
-
function
|
|
2064
|
-
var t =
|
|
2403
|
+
function hi(n, e) {
|
|
2404
|
+
var t = I(di, { __v: n, i: e });
|
|
2065
2405
|
return t.containerInfo = e, t;
|
|
2066
2406
|
}
|
|
2067
|
-
(
|
|
2068
|
-
var e = this, t =
|
|
2407
|
+
(ge.prototype = new H()).__a = function(n) {
|
|
2408
|
+
var e = this, t = cn(e.__v), i = e.o.get(n);
|
|
2069
2409
|
return i[0]++, function(s) {
|
|
2070
2410
|
var o = function() {
|
|
2071
|
-
e.props.revealOrder ? (i.push(s),
|
|
2411
|
+
e.props.revealOrder ? (i.push(s), wt(e, n, i)) : s();
|
|
2072
2412
|
};
|
|
2073
2413
|
t ? t(o) : o();
|
|
2074
2414
|
};
|
|
2075
|
-
},
|
|
2415
|
+
}, ge.prototype.render = function(n) {
|
|
2076
2416
|
this.u = null, this.o = /* @__PURE__ */ new Map();
|
|
2077
|
-
var e =
|
|
2417
|
+
var e = xe(n.children);
|
|
2078
2418
|
n.revealOrder && n.revealOrder[0] === "b" && e.reverse();
|
|
2079
2419
|
for (var t = e.length; t--; )
|
|
2080
2420
|
this.o.set(e[t], this.u = [1, 0, this.u]);
|
|
2081
2421
|
return n.children;
|
|
2082
|
-
},
|
|
2422
|
+
}, ge.prototype.componentDidUpdate = ge.prototype.componentDidMount = function() {
|
|
2083
2423
|
var n = this;
|
|
2084
2424
|
this.o.forEach(function(e, t) {
|
|
2085
|
-
|
|
2425
|
+
wt(n, t, e);
|
|
2086
2426
|
});
|
|
2087
2427
|
};
|
|
2088
|
-
var
|
|
2428
|
+
var fi = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, pi = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, _i = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, vi = /[A-Z0-9]/g, mi = typeof document < "u", gi = function(n) {
|
|
2089
2429
|
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(n);
|
|
2090
2430
|
};
|
|
2091
|
-
|
|
2092
|
-
Object.defineProperty(
|
|
2431
|
+
H.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(n) {
|
|
2432
|
+
Object.defineProperty(H.prototype, n, { configurable: !0, get: function() {
|
|
2093
2433
|
return this["UNSAFE_" + n];
|
|
2094
2434
|
}, set: function(e) {
|
|
2095
2435
|
Object.defineProperty(this, n, { configurable: !0, writable: !0, value: e });
|
|
2096
2436
|
} });
|
|
2097
2437
|
});
|
|
2098
|
-
var
|
|
2099
|
-
function
|
|
2438
|
+
var Ct = m.event;
|
|
2439
|
+
function yi() {
|
|
2100
2440
|
}
|
|
2101
|
-
function
|
|
2441
|
+
function bi() {
|
|
2102
2442
|
return this.cancelBubble;
|
|
2103
2443
|
}
|
|
2104
|
-
function
|
|
2444
|
+
function wi() {
|
|
2105
2445
|
return this.defaultPrevented;
|
|
2106
2446
|
}
|
|
2107
|
-
|
|
2108
|
-
return
|
|
2447
|
+
m.event = function(n) {
|
|
2448
|
+
return Ct && (n = Ct(n)), n.persist = yi, n.isPropagationStopped = bi, n.isDefaultPrevented = wi, n.nativeEvent = n;
|
|
2109
2449
|
};
|
|
2110
|
-
var
|
|
2450
|
+
var Ci = { enumerable: !1, configurable: !0, get: function() {
|
|
2111
2451
|
return this.class;
|
|
2112
|
-
} },
|
|
2113
|
-
|
|
2452
|
+
} }, Tt = m.vnode;
|
|
2453
|
+
m.vnode = function(n) {
|
|
2114
2454
|
typeof n.type == "string" && function(e) {
|
|
2115
2455
|
var t = e.props, i = e.type, s = {};
|
|
2116
2456
|
for (var o in t) {
|
|
2117
2457
|
var r = t[o];
|
|
2118
|
-
if (!(o === "value" && "defaultValue" in t && r == null ||
|
|
2458
|
+
if (!(o === "value" && "defaultValue" in t && r == null || mi && o === "children" && i === "noscript" || o === "class" || o === "className")) {
|
|
2119
2459
|
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" ||
|
|
2460
|
+
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" || gi(t.type) ? c === "onfocus" ? o = "onfocusin" : c === "onblur" ? o = "onfocusout" : _i.test(o) ? o = c : i.indexOf("-") === -1 && pi.test(o) ? o = o.replace(vi, "-$&").toLowerCase() : r === null && (r = void 0) : c = o = "oninput", c === "oninput" && s[o = c] && (o = "oninputCapture"), s[o] = r;
|
|
2121
2461
|
}
|
|
2122
2462
|
}
|
|
2123
|
-
i == "select" && s.multiple && Array.isArray(s.value) && (s.value =
|
|
2463
|
+
i == "select" && s.multiple && Array.isArray(s.value) && (s.value = xe(t.children).forEach(function(u) {
|
|
2124
2464
|
u.props.selected = s.value.indexOf(u.props.value) != -1;
|
|
2125
|
-
})), i == "select" && s.defaultValue != null && (s.value =
|
|
2465
|
+
})), i == "select" && s.defaultValue != null && (s.value = xe(t.children).forEach(function(u) {
|
|
2126
2466
|
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",
|
|
2128
|
-
}(n), n.$$typeof =
|
|
2467
|
+
})), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className", Ci)) : (t.className && !t.class || t.class && t.className) && (s.class = s.className = t.className), e.props = s;
|
|
2468
|
+
}(n), n.$$typeof = fi, Tt && Tt(n);
|
|
2129
2469
|
};
|
|
2130
|
-
var
|
|
2131
|
-
|
|
2132
|
-
|
|
2470
|
+
var xt = m.__r;
|
|
2471
|
+
m.__r = function(n) {
|
|
2472
|
+
xt && xt(n), n.__c;
|
|
2133
2473
|
};
|
|
2134
|
-
var
|
|
2135
|
-
|
|
2136
|
-
|
|
2474
|
+
var St = m.diffed;
|
|
2475
|
+
m.diffed = function(n) {
|
|
2476
|
+
St && St(n);
|
|
2137
2477
|
var e = n.props, t = n.__e;
|
|
2138
2478
|
t != null && n.type === "textarea" && "value" in e && e.value !== t.value && (t.value = e.value == null ? "" : e.value);
|
|
2139
2479
|
};
|
|
2140
|
-
var
|
|
2141
|
-
function
|
|
2142
|
-
var e =
|
|
2480
|
+
var he = /* @__PURE__ */ new Map();
|
|
2481
|
+
function Ti(n) {
|
|
2482
|
+
var e = he.get(n);
|
|
2143
2483
|
e && e.destroy();
|
|
2144
2484
|
}
|
|
2145
|
-
function
|
|
2146
|
-
var e =
|
|
2485
|
+
function xi(n) {
|
|
2486
|
+
var e = he.get(n);
|
|
2147
2487
|
e && e.update();
|
|
2148
2488
|
}
|
|
2149
|
-
var
|
|
2150
|
-
typeof window > "u" ? ((
|
|
2489
|
+
var le = null;
|
|
2490
|
+
typeof window > "u" ? ((le = function(n) {
|
|
2151
2491
|
return n;
|
|
2152
2492
|
}).destroy = function(n) {
|
|
2153
2493
|
return n;
|
|
2154
|
-
},
|
|
2494
|
+
}, le.update = function(n) {
|
|
2155
2495
|
return n;
|
|
2156
|
-
}) : ((
|
|
2496
|
+
}) : ((le = function(n, e) {
|
|
2157
2497
|
return n && Array.prototype.forEach.call(n.length ? n : [n], function(t) {
|
|
2158
2498
|
return function(i) {
|
|
2159
|
-
if (i && i.nodeName && i.nodeName === "TEXTAREA" && !
|
|
2499
|
+
if (i && i.nodeName && i.nodeName === "TEXTAREA" && !he.has(i)) {
|
|
2160
2500
|
var s, o = null, r = window.getComputedStyle(i), c = (s = i.value, function() {
|
|
2161
|
-
|
|
2501
|
+
f({ testForHeightReduction: s === "" || !i.value.startsWith(s), restoreTextAlign: null }), s = i.value;
|
|
2162
2502
|
}), u = (function(a) {
|
|
2163
|
-
i.removeEventListener("autosize:destroy", u), i.removeEventListener("autosize:update",
|
|
2503
|
+
i.removeEventListener("autosize:destroy", u), i.removeEventListener("autosize:update", d), i.removeEventListener("input", c), window.removeEventListener("resize", d), Object.keys(a).forEach(function(_) {
|
|
2164
2504
|
return i.style[_] = a[_];
|
|
2165
|
-
}),
|
|
2505
|
+
}), he.delete(i);
|
|
2166
2506
|
}).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 });
|
|
2167
|
-
i.addEventListener("autosize:destroy", u), i.addEventListener("autosize:update",
|
|
2507
|
+
i.addEventListener("autosize:destroy", u), i.addEventListener("autosize:update", d), i.addEventListener("input", c), window.addEventListener("resize", d), i.style.overflowX = "hidden", i.style.wordWrap = "break-word", he.set(i, { destroy: u, update: d }), d();
|
|
2168
2508
|
}
|
|
2169
|
-
function
|
|
2170
|
-
var _,
|
|
2509
|
+
function f(a) {
|
|
2510
|
+
var _, v, h = a.restoreTextAlign, p = h === void 0 ? null : h, g = a.testForHeightReduction, b = g === void 0 || g, C = r.overflowY;
|
|
2171
2511
|
if (i.scrollHeight !== 0 && (r.resize === "vertical" ? i.style.resize = "none" : r.resize === "both" && (i.style.resize = "horizontal"), b && (_ = function(T) {
|
|
2172
2512
|
for (var E = []; T && T.parentNode && T.parentNode instanceof Element; )
|
|
2173
2513
|
T.parentNode.scrollTop && E.push([T.parentNode, T.parentNode.scrollTop]), T = T.parentNode;
|
|
2174
2514
|
return function() {
|
|
2175
|
-
return E.forEach(function(
|
|
2176
|
-
var
|
|
2177
|
-
|
|
2515
|
+
return E.forEach(function(R) {
|
|
2516
|
+
var D = R[0], P = R[1];
|
|
2517
|
+
D.style.scrollBehavior = "auto", D.scrollTop = P, D.style.scrollBehavior = null;
|
|
2178
2518
|
});
|
|
2179
2519
|
};
|
|
2180
|
-
}(i), i.style.height = ""),
|
|
2181
|
-
var
|
|
2182
|
-
r.overflow === "hidden" && (i.style.textAlign =
|
|
2520
|
+
}(i), i.style.height = ""), v = r.boxSizing === "content-box" ? i.scrollHeight - (parseFloat(r.paddingTop) + parseFloat(r.paddingBottom)) : i.scrollHeight + parseFloat(r.borderTopWidth) + parseFloat(r.borderBottomWidth), r.maxHeight !== "none" && v > parseFloat(r.maxHeight) ? (r.overflowY === "hidden" && (i.style.overflow = "scroll"), v = parseFloat(r.maxHeight)) : r.overflowY !== "hidden" && (i.style.overflow = "hidden"), i.style.height = v + "px", p && (i.style.textAlign = p), _ && _(), o !== v && (i.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), o = v), C !== r.overflow && !p)) {
|
|
2521
|
+
var $ = r.textAlign;
|
|
2522
|
+
r.overflow === "hidden" && (i.style.textAlign = $ === "start" ? "end" : "start"), f({ restoreTextAlign: $, testForHeightReduction: !0 });
|
|
2183
2523
|
}
|
|
2184
2524
|
}
|
|
2185
|
-
function
|
|
2186
|
-
|
|
2525
|
+
function d() {
|
|
2526
|
+
f({ testForHeightReduction: !0, restoreTextAlign: null });
|
|
2187
2527
|
}
|
|
2188
2528
|
}(t);
|
|
2189
2529
|
}), n;
|
|
2190
2530
|
}).destroy = function(n) {
|
|
2191
|
-
return n && Array.prototype.forEach.call(n.length ? n : [n],
|
|
2192
|
-
},
|
|
2193
|
-
return n && Array.prototype.forEach.call(n.length ? n : [n],
|
|
2531
|
+
return n && Array.prototype.forEach.call(n.length ? n : [n], Ti), n;
|
|
2532
|
+
}, le.update = function(n) {
|
|
2533
|
+
return n && Array.prototype.forEach.call(n.length ? n : [n], xi), n;
|
|
2194
2534
|
});
|
|
2195
|
-
var
|
|
2196
|
-
|
|
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);
|
|
2214
|
-
}), [e]);
|
|
2215
|
-
const d = rt(async () => {
|
|
2216
|
-
i.value = !0;
|
|
2217
|
-
try {
|
|
2218
|
-
await n.controller.question(t.value), t.value = "";
|
|
2219
|
-
} catch (a) {
|
|
2220
|
-
console.error(a);
|
|
2221
|
-
} finally {
|
|
2222
|
-
i.value = !1;
|
|
2223
|
-
}
|
|
2224
|
-
}, [t, i]), h = (a) => {
|
|
2225
|
-
a.code === "Enter" && (a.stopPropagation(), a.shiftKey === !1 && d());
|
|
2226
|
-
};
|
|
2227
|
-
return l("div", {
|
|
2228
|
-
className: q.b(),
|
|
2229
|
-
children: [l("textarea", {
|
|
2230
|
-
className: q.e("textarea"),
|
|
2231
|
-
type: "text",
|
|
2232
|
-
rows: 6,
|
|
2233
|
-
autoCorrect: "off",
|
|
2234
|
-
autoCapitalize: "off",
|
|
2235
|
-
autoComplete: "off",
|
|
2236
|
-
value: t,
|
|
2237
|
-
onInput: c,
|
|
2238
|
-
onKeyDown: h,
|
|
2239
|
-
ref: e,
|
|
2240
|
-
disabled: i
|
|
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
|
-
})]
|
|
2387
|
-
})]
|
|
2388
|
-
});
|
|
2389
|
-
};
|
|
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,
|
|
2420
|
-
width: 600,
|
|
2421
|
-
height: window.innerHeight,
|
|
2422
|
-
minWidth: 300,
|
|
2423
|
-
minHeight: 300
|
|
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);
|
|
2443
|
-
this.state = {
|
|
2444
|
-
isFullScreen: !1,
|
|
2445
|
-
isMinimize: !1
|
|
2446
|
-
};
|
|
2447
|
-
}
|
|
2448
|
-
calcWindowStyle() {
|
|
2449
|
-
return {
|
|
2450
|
-
left: "".concat(this.data.x, "px"),
|
|
2451
|
-
top: "".concat(this.data.y, "px"),
|
|
2452
|
-
height: "".concat(this.data.height, "px"),
|
|
2453
|
-
width: "".concat(this.data.width, "px"),
|
|
2454
|
-
"z-index": "1000"
|
|
2455
|
-
};
|
|
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
|
-
}
|
|
2464
|
-
setStyle() {
|
|
2465
|
-
Object.assign(this.containerRef.current.style, this.calcWindowStyle()), Object.assign(this.minimizeRef.current.style, this.calcMinimizeStyle());
|
|
2466
|
-
}
|
|
2467
|
-
componentDidMount() {
|
|
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({
|
|
2493
|
-
// 可拖拽的边缘
|
|
2494
|
-
edges: {
|
|
2495
|
-
top: !0,
|
|
2496
|
-
right: !0,
|
|
2497
|
-
bottom: !0,
|
|
2498
|
-
left: !0
|
|
2499
|
-
},
|
|
2500
|
-
margin: 6,
|
|
2501
|
-
modifiers: [
|
|
2502
|
-
// 保持在父对象内部
|
|
2503
|
-
Ae.modifiers.restrictEdges({
|
|
2504
|
-
outer: document.body
|
|
2505
|
-
}),
|
|
2506
|
-
// 缩放最小宽度
|
|
2507
|
-
Ae.modifiers.restrictSize({
|
|
2508
|
-
min: {
|
|
2509
|
-
width: s.minWidth,
|
|
2510
|
-
height: s.minHeight
|
|
2511
|
-
}
|
|
2512
|
-
})
|
|
2513
|
-
],
|
|
2514
|
-
inertia: !0,
|
|
2515
|
-
listeners: {
|
|
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 = "";
|
|
2524
|
-
}
|
|
2525
|
-
}
|
|
2526
|
-
});
|
|
2527
|
-
}
|
|
2528
|
-
componentWillUnmount() {
|
|
2529
|
-
localStorage.setItem(k.STYLE_CACHE, JSON.stringify(this.data)), localStorage.setItem(k.MINIMIZE_STYLY_CHCHE, JSON.stringify(this.minimizeData));
|
|
2530
|
-
}
|
|
2531
|
-
/**
|
|
2532
|
-
* 关闭聊天窗口
|
|
2533
|
-
*
|
|
2534
|
-
* @author chitanda
|
|
2535
|
-
* @date 2023-10-15 19:10:31
|
|
2536
|
-
*/
|
|
2537
|
-
close() {
|
|
2538
|
-
this.props.close();
|
|
2539
|
-
}
|
|
2540
|
-
/**
|
|
2541
|
-
* 全屏
|
|
2542
|
-
*
|
|
2543
|
-
* @author ljx
|
|
2544
|
-
* @date 2024-05-07 15:10:31
|
|
2545
|
-
*/
|
|
2546
|
-
fullScreen() {
|
|
2547
|
-
const t = this.containerRef.current;
|
|
2548
|
-
t && (t.requestFullscreen(), this.setState({
|
|
2549
|
-
isFullScreen: !0
|
|
2550
|
-
}), this.props.fullscreen(!0));
|
|
2551
|
-
}
|
|
2552
|
-
/**
|
|
2553
|
-
* 关闭全屏
|
|
2554
|
-
*
|
|
2555
|
-
* @author ljx
|
|
2556
|
-
* @date 2024-05-07 15:10:31
|
|
2557
|
-
*/
|
|
2558
|
-
closeFullScreen() {
|
|
2559
|
-
this.state.isFullScreen && (document == null || document.exitFullscreen(), this.setState({
|
|
2560
|
-
isFullScreen: !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();
|
|
2591
|
-
}
|
|
2592
|
-
render() {
|
|
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
|
-
})
|
|
2679
|
-
})]
|
|
2680
|
-
})]
|
|
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, {})
|
|
2687
|
-
})]
|
|
2688
|
-
});
|
|
2689
|
-
}
|
|
2690
|
-
}
|
|
2691
|
-
class Le {
|
|
2535
|
+
var Et = le;
|
|
2536
|
+
class Ue {
|
|
2692
2537
|
constructor(e) {
|
|
2693
2538
|
this.msg = e;
|
|
2694
2539
|
}
|
|
@@ -2734,7 +2579,7 @@ class Le {
|
|
|
2734
2579
|
this.msg.completed = e;
|
|
2735
2580
|
}
|
|
2736
2581
|
}
|
|
2737
|
-
class
|
|
2582
|
+
class ye {
|
|
2738
2583
|
constructor(e) {
|
|
2739
2584
|
this.data = e;
|
|
2740
2585
|
}
|
|
@@ -2757,7 +2602,25 @@ class ve {
|
|
|
2757
2602
|
return this.data.aiChat;
|
|
2758
2603
|
}
|
|
2759
2604
|
}
|
|
2760
|
-
class
|
|
2605
|
+
class Fe {
|
|
2606
|
+
constructor(e) {
|
|
2607
|
+
this.material = e;
|
|
2608
|
+
}
|
|
2609
|
+
get id() {
|
|
2610
|
+
return this.material.id;
|
|
2611
|
+
}
|
|
2612
|
+
get type() {
|
|
2613
|
+
return this.material.type;
|
|
2614
|
+
}
|
|
2615
|
+
get metadata() {
|
|
2616
|
+
return this.material.metadata;
|
|
2617
|
+
}
|
|
2618
|
+
get data() {
|
|
2619
|
+
return this.material.data;
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
var N = /* @__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))(N || {});
|
|
2623
|
+
class Nt {
|
|
2761
2624
|
/**
|
|
2762
2625
|
* Creates an instance of AiChatController.
|
|
2763
2626
|
*
|
|
@@ -2773,7 +2636,15 @@ class St {
|
|
|
2773
2636
|
* @date 2023-10-16 16:10:29
|
|
2774
2637
|
* @type {Signal<ChatMessage[]>}
|
|
2775
2638
|
*/
|
|
2776
|
-
|
|
2639
|
+
w(this, "messages", J([]));
|
|
2640
|
+
/**
|
|
2641
|
+
* 素材列表
|
|
2642
|
+
*
|
|
2643
|
+
* @author tony001
|
|
2644
|
+
* @date 2025-02-27 18:02:46
|
|
2645
|
+
* @type {Signal<IMaterial[]>}
|
|
2646
|
+
*/
|
|
2647
|
+
w(this, "materials", J([]));
|
|
2777
2648
|
/**
|
|
2778
2649
|
* 聊天框输入值
|
|
2779
2650
|
*
|
|
@@ -2781,7 +2652,7 @@ class St {
|
|
|
2781
2652
|
* @date 2023-10-16 15:10:43
|
|
2782
2653
|
* @type {Signal<string>}
|
|
2783
2654
|
*/
|
|
2784
|
-
|
|
2655
|
+
w(this, "input", J(""));
|
|
2785
2656
|
/**
|
|
2786
2657
|
* 视图参数
|
|
2787
2658
|
*
|
|
@@ -2789,7 +2660,7 @@ class St {
|
|
|
2789
2660
|
* @date 2025-02-24 14:02:23
|
|
2790
2661
|
* @type {object}
|
|
2791
2662
|
*/
|
|
2792
|
-
|
|
2663
|
+
w(this, "context");
|
|
2793
2664
|
/**
|
|
2794
2665
|
* 视图参数
|
|
2795
2666
|
*
|
|
@@ -2797,7 +2668,7 @@ class St {
|
|
|
2797
2668
|
* @date 2025-02-24 14:02:32
|
|
2798
2669
|
* @type {object}
|
|
2799
2670
|
*/
|
|
2800
|
-
|
|
2671
|
+
w(this, "params");
|
|
2801
2672
|
/**
|
|
2802
2673
|
* 应用实体标记
|
|
2803
2674
|
*
|
|
@@ -2805,7 +2676,7 @@ class St {
|
|
|
2805
2676
|
* @date 2025-02-24 14:02:10
|
|
2806
2677
|
* @type {string}
|
|
2807
2678
|
*/
|
|
2808
|
-
|
|
2679
|
+
w(this, "appDataEntityId");
|
|
2809
2680
|
/**
|
|
2810
2681
|
* 话题标识
|
|
2811
2682
|
*
|
|
@@ -2813,7 +2684,7 @@ class St {
|
|
|
2813
2684
|
* @date 2025-02-24 18:02:02
|
|
2814
2685
|
* @type {(string | undefined)}
|
|
2815
2686
|
*/
|
|
2816
|
-
|
|
2687
|
+
w(this, "topicId");
|
|
2817
2688
|
this.opts = e, this.context = e.context, this.params = e.params, this.appDataEntityId = e.appDataEntityId, this.topicId = e.topicId, this.fecthHistory();
|
|
2818
2689
|
}
|
|
2819
2690
|
/**
|
|
@@ -2825,7 +2696,7 @@ class St {
|
|
|
2825
2696
|
*/
|
|
2826
2697
|
async fecthHistory() {
|
|
2827
2698
|
if (this.topicId) {
|
|
2828
|
-
const e = await
|
|
2699
|
+
const e = await W.getData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, this.topicId);
|
|
2829
2700
|
if (e && e.data && e.data.length > 0)
|
|
2830
2701
|
return e.data.forEach((t) => {
|
|
2831
2702
|
const i = {
|
|
@@ -2858,7 +2729,7 @@ class St {
|
|
|
2858
2729
|
data: this.messages.value.map((t) => t._origin),
|
|
2859
2730
|
timestamp: (/* @__PURE__ */ new Date()).getTime()
|
|
2860
2731
|
};
|
|
2861
|
-
await
|
|
2732
|
+
await W.updateData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, e);
|
|
2862
2733
|
}
|
|
2863
2734
|
/**
|
|
2864
2735
|
* 设置聊天框值
|
|
@@ -2879,7 +2750,7 @@ class St {
|
|
|
2879
2750
|
*/
|
|
2880
2751
|
addMessage(e) {
|
|
2881
2752
|
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
|
|
2753
|
+
t ? (t.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new Ue(e)], this.asyncToIndexDB();
|
|
2883
2754
|
}
|
|
2884
2755
|
/**
|
|
2885
2756
|
* 更新消息完成状态
|
|
@@ -2902,7 +2773,25 @@ class St {
|
|
|
2902
2773
|
*/
|
|
2903
2774
|
replaceMessage(e) {
|
|
2904
2775
|
const t = this.messages.value.findIndex((i) => i.messageid === e.messageid);
|
|
2905
|
-
t !== -1 ? (this.messages.value[t] = new
|
|
2776
|
+
t !== -1 ? (this.messages.value[t] = new Ue(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new Ue(e)], this.asyncToIndexDB();
|
|
2777
|
+
}
|
|
2778
|
+
/**
|
|
2779
|
+
* 数据对象转 XML 字符串
|
|
2780
|
+
*
|
|
2781
|
+
* @author tony001
|
|
2782
|
+
* @date 2025-03-03 11:03:55
|
|
2783
|
+
* @return {*} {string}
|
|
2784
|
+
*/
|
|
2785
|
+
stringlyMaterialResource() {
|
|
2786
|
+
let e = "";
|
|
2787
|
+
const t = [];
|
|
2788
|
+
return this.materials.value && this.materials.value.length > 0 && (this.materials.value.forEach((i) => {
|
|
2789
|
+
if (i.type === "ossfile") {
|
|
2790
|
+
const s = i.metadata;
|
|
2791
|
+
s.state && s.state === "successed" && t.push(i);
|
|
2792
|
+
} else
|
|
2793
|
+
t.push(i);
|
|
2794
|
+
}), this.materials.value = []), t && t.length > 0 && (e = jt.stringify(t)), e;
|
|
2906
2795
|
}
|
|
2907
2796
|
/**
|
|
2908
2797
|
* 提问
|
|
@@ -2912,15 +2801,16 @@ class St {
|
|
|
2912
2801
|
* @return {*} {Promise<void>}
|
|
2913
2802
|
*/
|
|
2914
2803
|
async question(e) {
|
|
2915
|
-
this.
|
|
2804
|
+
let t = this.stringlyMaterialResource();
|
|
2805
|
+
t ? t += "\n".concat(e) : t = e, this.addMessage({
|
|
2916
2806
|
state: 30,
|
|
2917
|
-
messageid:
|
|
2807
|
+
messageid: Vt(),
|
|
2918
2808
|
role: "USER",
|
|
2919
2809
|
type: "DEFAULT",
|
|
2920
|
-
content:
|
|
2810
|
+
content: t
|
|
2921
2811
|
}), await this.opts.question(this.context, this.params, {
|
|
2922
2812
|
appDataEntityId: this.appDataEntityId
|
|
2923
|
-
}, this.messages.value.filter((
|
|
2813
|
+
}, this.messages.value.filter((i) => i.type !== "ERROR").map((i) => i._origin)), this.opts.action && this.opts.action("question", e);
|
|
2924
2814
|
}
|
|
2925
2815
|
/**
|
|
2926
2816
|
* 回填选中的消息
|
|
@@ -2972,7 +2862,7 @@ class St {
|
|
|
2972
2862
|
*/
|
|
2973
2863
|
copyMessage(e) {
|
|
2974
2864
|
const t = e.content;
|
|
2975
|
-
|
|
2865
|
+
qt.copy(t), this.opts.action && this.opts.action("copymsg", e);
|
|
2976
2866
|
}
|
|
2977
2867
|
/**
|
|
2978
2868
|
* 新建对话
|
|
@@ -2980,12 +2870,45 @@ class St {
|
|
|
2980
2870
|
* @memberof AiChatController
|
|
2981
2871
|
*/
|
|
2982
2872
|
async newDialogue() {
|
|
2983
|
-
this.messages.value.length = 0, this.topicId && await
|
|
2873
|
+
this.messages.value.length = 0, this.topicId && await W.deleteData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, this.topicId), this.opts.history(this.context, this.params, {
|
|
2984
2874
|
appDataEntityId: this.appDataEntityId
|
|
2985
2875
|
});
|
|
2986
2876
|
}
|
|
2877
|
+
/**
|
|
2878
|
+
* 新增素材资源
|
|
2879
|
+
*
|
|
2880
|
+
* @author tony001
|
|
2881
|
+
* @date 2025-02-27 18:02:00
|
|
2882
|
+
* @param {IMaterial} data
|
|
2883
|
+
*/
|
|
2884
|
+
addMaterial(e) {
|
|
2885
|
+
this.materials.value.find((i) => i.id === e.id) ? this.materials.value = [...this.materials.value] : this.materials.value = [...this.materials.value, new Fe(e)];
|
|
2886
|
+
}
|
|
2887
|
+
/**
|
|
2888
|
+
* 替换素材资源
|
|
2889
|
+
*
|
|
2890
|
+
* @author tony001
|
|
2891
|
+
* @date 2025-02-28 15:02:24
|
|
2892
|
+
* @param {string} id
|
|
2893
|
+
* @param {IMaterial} data
|
|
2894
|
+
*/
|
|
2895
|
+
replaceMaterial(e, t) {
|
|
2896
|
+
const i = this.materials.value.findIndex((s) => s.id === e);
|
|
2897
|
+
i !== -1 ? (this.materials.value[i] = new Fe(t), this.materials.value = [...this.materials.value]) : this.materials.value = [...this.materials.value, new Fe(t)];
|
|
2898
|
+
}
|
|
2899
|
+
/**
|
|
2900
|
+
* 删除指定素材资源
|
|
2901
|
+
*
|
|
2902
|
+
* @author tony001
|
|
2903
|
+
* @date 2025-02-27 18:02:33
|
|
2904
|
+
* @param {IMaterial} data
|
|
2905
|
+
*/
|
|
2906
|
+
deleteMaterial(e) {
|
|
2907
|
+
const t = this.materials.value.findIndex((i) => i.id === e.id);
|
|
2908
|
+
t !== -1 && (this.materials.value.splice(t, 1), this.materials.value = [...this.materials.value]);
|
|
2909
|
+
}
|
|
2987
2910
|
}
|
|
2988
|
-
class
|
|
2911
|
+
class Si {
|
|
2989
2912
|
/**
|
|
2990
2913
|
* Creates an instance of AiTopicController.
|
|
2991
2914
|
* @author tony001
|
|
@@ -3000,7 +2923,7 @@ class ci {
|
|
|
3000
2923
|
* @date 2025-02-20 16:02:38
|
|
3001
2924
|
* @type {Signal<ChatTopic[]>}
|
|
3002
2925
|
*/
|
|
3003
|
-
|
|
2926
|
+
w(this, "topics", J([]));
|
|
3004
2927
|
/**
|
|
3005
2928
|
* 激活话题
|
|
3006
2929
|
*
|
|
@@ -3008,7 +2931,7 @@ class ci {
|
|
|
3008
2931
|
* @date 2025-02-24 16:02:44
|
|
3009
2932
|
* @type {(Signal<ITopic | null>)}
|
|
3010
2933
|
*/
|
|
3011
|
-
|
|
2934
|
+
w(this, "activedTopic", J(null));
|
|
3012
2935
|
/**
|
|
3013
2936
|
* 当前话题配置备份
|
|
3014
2937
|
*
|
|
@@ -3017,7 +2940,7 @@ class ci {
|
|
|
3017
2940
|
* @public
|
|
3018
2941
|
* @type {(ITopicOptions | undefined)}
|
|
3019
2942
|
*/
|
|
3020
|
-
|
|
2943
|
+
w(this, "currentTopicOptions");
|
|
3021
2944
|
this.chat = e;
|
|
3022
2945
|
}
|
|
3023
2946
|
/**
|
|
@@ -3030,7 +2953,7 @@ class ci {
|
|
|
3030
2953
|
async fetchHistory(e) {
|
|
3031
2954
|
const i = await e.configService(e.appid, "aitopics", e.type).load();
|
|
3032
2955
|
i && i.length > 0 && i.forEach((s) => {
|
|
3033
|
-
this.topics.value = [...this.topics.value, new
|
|
2956
|
+
this.topics.value = [...this.topics.value, new ye(s)];
|
|
3034
2957
|
});
|
|
3035
2958
|
}
|
|
3036
2959
|
/**
|
|
@@ -3043,8 +2966,8 @@ class ci {
|
|
|
3043
2966
|
*/
|
|
3044
2967
|
async updateCurrentTopic(e) {
|
|
3045
2968
|
this.currentTopicOptions = e;
|
|
3046
|
-
const t = this.topics.value.findIndex((r) => r.id === e.id), i = new
|
|
3047
|
-
t !== -1 ? this.topics.value.splice(t, 1, new
|
|
2969
|
+
const t = this.topics.value.findIndex((r) => r.id === e.id), i = new ye(e);
|
|
2970
|
+
t !== -1 ? this.topics.value.splice(t, 1, new ye(e)) : this.topics.value = [...this.topics.value, new ye(e)];
|
|
3048
2971
|
const s = this.topics.value.map((r) => ({
|
|
3049
2972
|
appid: r.appid,
|
|
3050
2973
|
id: r.id,
|
|
@@ -3068,7 +2991,7 @@ class ci {
|
|
|
3068
2991
|
* @return {*} {Promise<void>}
|
|
3069
2992
|
*/
|
|
3070
2993
|
async removeTopic(e, t, i, s, o) {
|
|
3071
|
-
var
|
|
2994
|
+
var d;
|
|
3072
2995
|
let r = !0;
|
|
3073
2996
|
if (e.beforeDelete && (r = await e.beforeDelete(t, i, s, o)), !r)
|
|
3074
2997
|
return;
|
|
@@ -3081,8 +3004,8 @@ class ci {
|
|
|
3081
3004
|
caption: a.caption,
|
|
3082
3005
|
url: a.url,
|
|
3083
3006
|
aiChat: a.aiChat
|
|
3084
|
-
})),
|
|
3085
|
-
await (
|
|
3007
|
+
})), f = e.configService(e.appid, "aitopics", e.type);
|
|
3008
|
+
await (f == null ? void 0 : f.save(u)), await W.deleteData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, s.id), this.topics.value.length > 0 && s.id === ((d = this.activedTopic.value) == null ? void 0 : d.id) && this.handleTopicChange(this.topics.value[0]);
|
|
3086
3009
|
}
|
|
3087
3010
|
/**
|
|
3088
3011
|
* 处理选中变化
|
|
@@ -3117,7 +3040,138 @@ class ci {
|
|
|
3117
3040
|
}
|
|
3118
3041
|
}
|
|
3119
3042
|
}
|
|
3120
|
-
class
|
|
3043
|
+
class ln {
|
|
3044
|
+
constructor(e) {
|
|
3045
|
+
this.aiChat = e;
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3048
|
+
class Ei extends ln {
|
|
3049
|
+
/**
|
|
3050
|
+
* 执行操作
|
|
3051
|
+
*
|
|
3052
|
+
* @author tony001
|
|
3053
|
+
* @date 2025-02-28 15:02:48
|
|
3054
|
+
* @return {*} {Promise<void>}
|
|
3055
|
+
*/
|
|
3056
|
+
async excuteAction(e, t) {
|
|
3057
|
+
if (t && t.onClick) {
|
|
3058
|
+
const i = await t.onClick(e, this.aiChat.context, this.aiChat.params);
|
|
3059
|
+
if (i && i.data && i.data.length > 0) {
|
|
3060
|
+
const s = i.data[0], o = {
|
|
3061
|
+
id: s.id,
|
|
3062
|
+
type: s.type,
|
|
3063
|
+
data: s.data || {},
|
|
3064
|
+
metadata: s.metadata || {}
|
|
3065
|
+
};
|
|
3066
|
+
t.id && Object.assign(o.metadata, {
|
|
3067
|
+
actionId: t.id
|
|
3068
|
+
}), this.aiChat.addMaterial(o);
|
|
3069
|
+
}
|
|
3070
|
+
}
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
class Ni extends ln {
|
|
3074
|
+
/**
|
|
3075
|
+
* 执行操作
|
|
3076
|
+
*
|
|
3077
|
+
* @author tony001
|
|
3078
|
+
* @date 2025-02-28 15:02:27
|
|
3079
|
+
* @return {*} {Promise<void>}
|
|
3080
|
+
*/
|
|
3081
|
+
async excuteAction(e, t) {
|
|
3082
|
+
const i = this.aiChat.opts.uploader, {
|
|
3083
|
+
multiple: s,
|
|
3084
|
+
accept: o,
|
|
3085
|
+
maxSize: r,
|
|
3086
|
+
onSelect: c,
|
|
3087
|
+
onUpload: u,
|
|
3088
|
+
onSuccess: f,
|
|
3089
|
+
onError: d,
|
|
3090
|
+
onProgress: a
|
|
3091
|
+
} = i, _ = {
|
|
3092
|
+
multiple: s || !0,
|
|
3093
|
+
accept: o || "*/*",
|
|
3094
|
+
maxSize: r || 5 * 1024 * 1024,
|
|
3095
|
+
onSelect: (h) => {
|
|
3096
|
+
c == null || c(h), h.length > 0 && h.forEach((p) => {
|
|
3097
|
+
const g = this.buildMaterialObject(p);
|
|
3098
|
+
Object.assign(g.metadata, {
|
|
3099
|
+
state: "uploading"
|
|
3100
|
+
}), this.aiChat.addMaterial(g);
|
|
3101
|
+
});
|
|
3102
|
+
},
|
|
3103
|
+
onUpload: async (h, p) => u(h, p, {
|
|
3104
|
+
context: this.aiChat.context,
|
|
3105
|
+
params: this.aiChat.params
|
|
3106
|
+
}),
|
|
3107
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3108
|
+
onSuccess: (h, p) => {
|
|
3109
|
+
const g = {
|
|
3110
|
+
id: h.id,
|
|
3111
|
+
type: "ossfile",
|
|
3112
|
+
data: {
|
|
3113
|
+
id: h.id,
|
|
3114
|
+
name: h.name
|
|
3115
|
+
},
|
|
3116
|
+
metadata: {
|
|
3117
|
+
ext: h.ext,
|
|
3118
|
+
fileext: h.fileext,
|
|
3119
|
+
fileid: h.fileid,
|
|
3120
|
+
filename: h.filename,
|
|
3121
|
+
size: h.size,
|
|
3122
|
+
filesize: h.filesize,
|
|
3123
|
+
state: "successed"
|
|
3124
|
+
}
|
|
3125
|
+
};
|
|
3126
|
+
this.aiChat.replaceMaterial(p.name, g), f == null || f(h, p);
|
|
3127
|
+
},
|
|
3128
|
+
onError: (h, p) => {
|
|
3129
|
+
const g = this.buildMaterialObject(p);
|
|
3130
|
+
Object.assign(g.metadata, {
|
|
3131
|
+
state: "failed"
|
|
3132
|
+
}), this.aiChat.replaceMaterial(p.name, g), d == null || d(h, p);
|
|
3133
|
+
},
|
|
3134
|
+
onProgress: (h, p) => {
|
|
3135
|
+
a == null || a(h, p);
|
|
3136
|
+
}
|
|
3137
|
+
};
|
|
3138
|
+
new xn(_).openFilePicker();
|
|
3139
|
+
}
|
|
3140
|
+
/**
|
|
3141
|
+
* 构建素材对象
|
|
3142
|
+
*
|
|
3143
|
+
* @author tony001
|
|
3144
|
+
* @date 2025-02-28 15:02:12
|
|
3145
|
+
* @param {File} file
|
|
3146
|
+
* @return {*} {IMaterial}
|
|
3147
|
+
*/
|
|
3148
|
+
buildMaterialObject(e) {
|
|
3149
|
+
return {
|
|
3150
|
+
id: e.name,
|
|
3151
|
+
type: "ossfile",
|
|
3152
|
+
data: {
|
|
3153
|
+
name: e.name,
|
|
3154
|
+
id: e.name
|
|
3155
|
+
},
|
|
3156
|
+
metadata: {
|
|
3157
|
+
size: e.size,
|
|
3158
|
+
type: e.type,
|
|
3159
|
+
lastModified: e.lastModified
|
|
3160
|
+
}
|
|
3161
|
+
};
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
class $t {
|
|
3165
|
+
static getMaterialHelper(e, t) {
|
|
3166
|
+
switch (e) {
|
|
3167
|
+
case "ossfile":
|
|
3168
|
+
return new Ni(t);
|
|
3169
|
+
default:
|
|
3170
|
+
return new Ei(t);
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
class $i {
|
|
3121
3175
|
/**
|
|
3122
3176
|
* Creates an instance of ChatController.
|
|
3123
3177
|
* @author tony001
|
|
@@ -3132,7 +3186,7 @@ class li {
|
|
|
3132
3186
|
* @protected
|
|
3133
3187
|
* @type {HTMLDivElement}
|
|
3134
3188
|
*/
|
|
3135
|
-
|
|
3189
|
+
w(this, "container");
|
|
3136
3190
|
/**
|
|
3137
3191
|
* 默认模式(聊天框)和话题模式(支持多话题切换),聊天框为默认模式
|
|
3138
3192
|
*
|
|
@@ -3141,7 +3195,7 @@ class li {
|
|
|
3141
3195
|
* @protected
|
|
3142
3196
|
* @type {('DEFAULT' | 'TOPIC')}
|
|
3143
3197
|
*/
|
|
3144
|
-
|
|
3198
|
+
w(this, "mode", "DEFAULT");
|
|
3145
3199
|
/**
|
|
3146
3200
|
* 是否挂载ai话题
|
|
3147
3201
|
*
|
|
@@ -3150,7 +3204,7 @@ class li {
|
|
|
3150
3204
|
* @protected
|
|
3151
3205
|
* @type {boolean}
|
|
3152
3206
|
*/
|
|
3153
|
-
|
|
3207
|
+
w(this, "isMountedAiTopic", !1);
|
|
3154
3208
|
/**
|
|
3155
3209
|
* 容器配置备份
|
|
3156
3210
|
*
|
|
@@ -3159,7 +3213,7 @@ class li {
|
|
|
3159
3213
|
* @protected
|
|
3160
3214
|
* @type {(IContainerOptions | undefined)}
|
|
3161
3215
|
*/
|
|
3162
|
-
|
|
3216
|
+
w(this, "backupChatOptions");
|
|
3163
3217
|
/**
|
|
3164
3218
|
* 话题控制器
|
|
3165
3219
|
*
|
|
@@ -3168,7 +3222,7 @@ class li {
|
|
|
3168
3222
|
* @public
|
|
3169
3223
|
* @type {AiTopicController}
|
|
3170
3224
|
*/
|
|
3171
|
-
|
|
3225
|
+
w(this, "aiTopic");
|
|
3172
3226
|
/**
|
|
3173
3227
|
* 聊天控制器
|
|
3174
3228
|
*
|
|
@@ -3177,8 +3231,8 @@ class li {
|
|
|
3177
3231
|
* @public
|
|
3178
3232
|
* @type {(AiChatController | undefined)}
|
|
3179
3233
|
*/
|
|
3180
|
-
|
|
3181
|
-
this.aiTopic = new
|
|
3234
|
+
w(this, "aiChat");
|
|
3235
|
+
this.aiTopic = new Si(this);
|
|
3182
3236
|
}
|
|
3183
3237
|
/**
|
|
3184
3238
|
* 初始化IndexDB
|
|
@@ -3188,7 +3242,7 @@ class li {
|
|
|
3188
3242
|
* @return {*} {Promise<void>}
|
|
3189
3243
|
*/
|
|
3190
3244
|
async initIndexDB() {
|
|
3191
|
-
await
|
|
3245
|
+
await W.checkTableExists(N.DATA_BASE_NAME, N.DATA_TABLE_NAME) || await W.createTable(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, N.DATA_TABLE_KEY_NAME, !1);
|
|
3192
3246
|
}
|
|
3193
3247
|
/**
|
|
3194
3248
|
* 创建聊天窗口(会同时显示出来)
|
|
@@ -3209,17 +3263,20 @@ class li {
|
|
|
3209
3263
|
params: t.params,
|
|
3210
3264
|
appDataEntityId: t.appDataEntityId,
|
|
3211
3265
|
contentToolbarItems: t.contentToolbarItems,
|
|
3212
|
-
footerToolbarItems: t.footerToolbarItems
|
|
3266
|
+
footerToolbarItems: t.footerToolbarItems,
|
|
3267
|
+
questionToolbarItems: t.questionToolbarItems
|
|
3213
3268
|
}
|
|
3214
3269
|
}), await this.aiTopic.updateCurrentTopic(i)), Object.assign(t, {
|
|
3215
3270
|
topicId: i == null ? void 0 : i.id
|
|
3216
|
-
}), this.aiChat = new
|
|
3271
|
+
}), this.aiChat = new Nt(t), te(I(At, {
|
|
3217
3272
|
aiTopic: this.aiTopic,
|
|
3218
3273
|
aiChat: this.aiChat,
|
|
3219
3274
|
mode: e.mode ? e.mode : "DEFAULT",
|
|
3275
|
+
containerOptions: e.containerOptions,
|
|
3220
3276
|
caption: e.mode && e.mode === "TOPIC" ? "AI助手" : t.caption,
|
|
3221
3277
|
contentToolbarItems: t.contentToolbarItems,
|
|
3222
3278
|
footerToolbarItems: t.footerToolbarItems,
|
|
3279
|
+
questionToolbarItems: t.questionToolbarItems,
|
|
3223
3280
|
close: () => {
|
|
3224
3281
|
this.close(), t.closed && t.closed(t.context, t.params);
|
|
3225
3282
|
},
|
|
@@ -3239,7 +3296,7 @@ class li {
|
|
|
3239
3296
|
* @param {ChatTopic} topic
|
|
3240
3297
|
*/
|
|
3241
3298
|
switchAiChatController(e) {
|
|
3242
|
-
var i, s;
|
|
3299
|
+
var i, s, o;
|
|
3243
3300
|
const t = {
|
|
3244
3301
|
...this.backupChatOptions.chatOptions
|
|
3245
3302
|
};
|
|
@@ -3249,23 +3306,26 @@ class li {
|
|
|
3249
3306
|
params: e.aiChat.params,
|
|
3250
3307
|
contentToolbarItems: e.aiChat.contentToolbarItems,
|
|
3251
3308
|
footerToolbarItems: e.aiChat.footerToolbarItems,
|
|
3309
|
+
questionToolbarItems: e.aiChat.questionToolbarItems,
|
|
3252
3310
|
appDataEntityId: e.aiChat.appDataEntityId,
|
|
3253
3311
|
topicId: e.id
|
|
3254
|
-
}), this.aiChat = new
|
|
3312
|
+
}), this.aiChat = new Nt(t), this.container && (te(null, this.container), te(I(At, {
|
|
3255
3313
|
aiTopic: this.aiTopic,
|
|
3256
3314
|
aiChat: this.aiChat,
|
|
3257
3315
|
mode: (i = this.backupChatOptions) != null && i.mode ? this.backupChatOptions.mode : "DEFAULT",
|
|
3258
|
-
|
|
3316
|
+
containerOptions: (s = this.backupChatOptions) == null ? void 0 : s.containerOptions,
|
|
3317
|
+
caption: (o = this.backupChatOptions) != null && o.mode && this.backupChatOptions.mode === "TOPIC" ? "AI助手" : t.caption,
|
|
3259
3318
|
contentToolbarItems: t.contentToolbarItems,
|
|
3260
3319
|
footerToolbarItems: t.footerToolbarItems,
|
|
3320
|
+
questionToolbarItems: t.questionToolbarItems,
|
|
3261
3321
|
close: () => {
|
|
3262
3322
|
this.close(), t.closed && t.closed(t.context, t.params);
|
|
3263
3323
|
},
|
|
3264
|
-
fullscreen: (
|
|
3265
|
-
t.fullscreen && t.fullscreen(
|
|
3324
|
+
fullscreen: (r) => {
|
|
3325
|
+
t.fullscreen && t.fullscreen(r, t.context, t.params);
|
|
3266
3326
|
},
|
|
3267
|
-
minimize: (
|
|
3268
|
-
t.minimize && t.minimize(
|
|
3327
|
+
minimize: (r) => {
|
|
3328
|
+
t.minimize && t.minimize(r, t.context, t.params);
|
|
3269
3329
|
}
|
|
3270
3330
|
}), this.container));
|
|
3271
3331
|
}
|
|
@@ -3294,11 +3354,590 @@ class li {
|
|
|
3294
3354
|
* @date 2023-10-13 17:10:10
|
|
3295
3355
|
*/
|
|
3296
3356
|
close() {
|
|
3297
|
-
this.container && (
|
|
3357
|
+
this.container && (te(null, this.container), this.container.remove(), this.container = void 0);
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
const Oi = new $i();
|
|
3361
|
+
const ki = new M("chat-input-material"), Mi = (n) => {
|
|
3362
|
+
const e = n.controller.materials;
|
|
3363
|
+
return l("div", {
|
|
3364
|
+
className: ki.b(),
|
|
3365
|
+
children: e.value.map((t) => l(on, {
|
|
3366
|
+
material: t,
|
|
3367
|
+
disabled: !1,
|
|
3368
|
+
controller: n.controller
|
|
3369
|
+
}, t.id))
|
|
3370
|
+
});
|
|
3371
|
+
};
|
|
3372
|
+
const un = ({
|
|
3373
|
+
children: n,
|
|
3374
|
+
actions: e,
|
|
3375
|
+
// 接收行为数据
|
|
3376
|
+
content: t,
|
|
3377
|
+
position: i = "bottom",
|
|
3378
|
+
isOpen: s,
|
|
3379
|
+
onToggleOpen: o,
|
|
3380
|
+
onAction: r
|
|
3381
|
+
// 接收行为事件回调
|
|
3382
|
+
}) => {
|
|
3383
|
+
const c = new M("pop"), u = En(dn), [f, d] = Je(s || !1), a = K(null), _ = K(null);
|
|
3384
|
+
V(() => {
|
|
3385
|
+
s !== void 0 && d(s);
|
|
3386
|
+
}, [s]), V(() => (_.current || (_.current = document.createElement("div"), _.current.className = c.b("content-container"), document.body.appendChild(_.current)), () => {
|
|
3387
|
+
_.current && document.body.removeChild(_.current);
|
|
3388
|
+
}), []), V(() => {
|
|
3389
|
+
const h = (p) => {
|
|
3390
|
+
a.current && !a.current.contains(p.target) && !p.target.closest(".".concat(c.b("content"))) && !p.target.closest(".ibiz-quick-edit") && !p.target.closest(".ibiz-picker__transfer") && (d(!1), o == null || o(!1));
|
|
3391
|
+
};
|
|
3392
|
+
return f && document.addEventListener("mousedown", h), () => {
|
|
3393
|
+
document.removeEventListener("mousedown", h);
|
|
3394
|
+
};
|
|
3395
|
+
}, [f, o]);
|
|
3396
|
+
const v = () => {
|
|
3397
|
+
if (!a.current)
|
|
3398
|
+
return {};
|
|
3399
|
+
const h = a.current.getBoundingClientRect(), p = {
|
|
3400
|
+
position: "absolute",
|
|
3401
|
+
zIndex: u.zIndex + 1
|
|
3402
|
+
}, g = {
|
|
3403
|
+
bottom: {
|
|
3404
|
+
top: h.bottom + window.scrollY,
|
|
3405
|
+
left: h.left + window.scrollX
|
|
3406
|
+
},
|
|
3407
|
+
top: {
|
|
3408
|
+
bottom: window.innerHeight - h.top + window.scrollY,
|
|
3409
|
+
left: h.left + window.scrollX
|
|
3410
|
+
},
|
|
3411
|
+
left: {
|
|
3412
|
+
top: h.top + window.scrollY,
|
|
3413
|
+
right: window.innerWidth - h.left + window.scrollX
|
|
3414
|
+
},
|
|
3415
|
+
right: {
|
|
3416
|
+
top: h.top + window.scrollY,
|
|
3417
|
+
left: h.right + window.scrollX
|
|
3418
|
+
},
|
|
3419
|
+
"top-left": {
|
|
3420
|
+
bottom: window.innerHeight - h.top + window.scrollY,
|
|
3421
|
+
right: window.innerWidth - h.left + window.scrollX
|
|
3422
|
+
}
|
|
3423
|
+
};
|
|
3424
|
+
return {
|
|
3425
|
+
...p,
|
|
3426
|
+
...g[i]
|
|
3427
|
+
};
|
|
3428
|
+
};
|
|
3429
|
+
return l("span", {
|
|
3430
|
+
className: "".concat(c.b("trigger-container")),
|
|
3431
|
+
children: [l("span", {
|
|
3432
|
+
className: "".concat(c.b("trigger-element")),
|
|
3433
|
+
ref: a,
|
|
3434
|
+
onClick: (h) => {
|
|
3435
|
+
h.stopPropagation();
|
|
3436
|
+
const p = !f;
|
|
3437
|
+
d(p), o == null || o(p);
|
|
3438
|
+
},
|
|
3439
|
+
children: n
|
|
3440
|
+
}), f && _.current && hi(l("div", {
|
|
3441
|
+
className: "".concat(c.b("content"), " pop-").concat(i),
|
|
3442
|
+
style: v(),
|
|
3443
|
+
children: t || (e == null ? void 0 : e.map((h) => l("div", {
|
|
3444
|
+
className: c.b("content-item"),
|
|
3445
|
+
onMouseDown: (p) => {
|
|
3446
|
+
p.stopPropagation(), r == null || r(h.id, p);
|
|
3447
|
+
},
|
|
3448
|
+
children: [h.icon && l("img", {
|
|
3449
|
+
className: c.b("content-item__icon"),
|
|
3450
|
+
src: h.icon,
|
|
3451
|
+
alt: h.caption
|
|
3452
|
+
}), l("div", {
|
|
3453
|
+
className: c.b("content-item__caption"),
|
|
3454
|
+
children: h.caption
|
|
3455
|
+
})]
|
|
3456
|
+
}, h.id)))
|
|
3457
|
+
}), _.current)]
|
|
3458
|
+
});
|
|
3459
|
+
}, k = new M("chat-input"), kt = window.SpeechRecognition || window.webkitSpeechRecognition, Mt = (n) => {
|
|
3460
|
+
var p;
|
|
3461
|
+
const [e, t] = Je(!1), i = K(null), s = n.controller.input, o = q(!1), r = q(!1), c = K();
|
|
3462
|
+
kt && !c.current && (c.current = new kt(), c.current.onstart = () => {
|
|
3463
|
+
r.value = !0;
|
|
3464
|
+
}, c.current.onend = () => {
|
|
3465
|
+
r.value = !1;
|
|
3466
|
+
}, c.current.onresult = (g) => {
|
|
3467
|
+
var C, $, T;
|
|
3468
|
+
const b = (T = ($ = (C = g.results) == null ? void 0 : C[0]) == null ? void 0 : $[0]) == null ? void 0 : T.transcript;
|
|
3469
|
+
b && (s.value = "".concat(s.value).concat(b));
|
|
3470
|
+
});
|
|
3471
|
+
const u = () => {
|
|
3472
|
+
c.current && !r.value && c.current.start();
|
|
3473
|
+
}, f = dt((g) => {
|
|
3474
|
+
s.value = g.target.value;
|
|
3475
|
+
}, [s]), d = O(() => s.value.length <= 0 || o.value === !0);
|
|
3476
|
+
V(() => (i.current && Et(i.current), () => {
|
|
3477
|
+
i.current && Et.destroy(i.current);
|
|
3478
|
+
}), [i]);
|
|
3479
|
+
const a = dt(async () => {
|
|
3480
|
+
o.value = !0;
|
|
3481
|
+
try {
|
|
3482
|
+
const g = s.value;
|
|
3483
|
+
s.value = "", await n.controller.question(g);
|
|
3484
|
+
} catch (g) {
|
|
3485
|
+
console.error(g);
|
|
3486
|
+
} finally {
|
|
3487
|
+
o.value = !1;
|
|
3488
|
+
}
|
|
3489
|
+
}, [s, o]), _ = (g) => {
|
|
3490
|
+
g.code === "Enter" && (g.stopPropagation(), g.shiftKey === !1 && a());
|
|
3491
|
+
}, v = async (g) => {
|
|
3492
|
+
await $t.getMaterialHelper("ossfile", n.controller).excuteAction(g), t(!1);
|
|
3493
|
+
}, h = async (g, b) => {
|
|
3494
|
+
await $t.getMaterialHelper("common", n.controller).excuteAction(g, b), t(!1);
|
|
3495
|
+
};
|
|
3496
|
+
return l("div", {
|
|
3497
|
+
className: k.b("wrapper"),
|
|
3498
|
+
children: [l("div", {
|
|
3499
|
+
className: k.b("material-wrapper"),
|
|
3500
|
+
children: l(Mi, {
|
|
3501
|
+
controller: n.controller
|
|
3502
|
+
})
|
|
3503
|
+
}), l("div", {
|
|
3504
|
+
className: k.b("main-wrapper"),
|
|
3505
|
+
children: [l("textarea", {
|
|
3506
|
+
className: k.e("textarea"),
|
|
3507
|
+
type: "text",
|
|
3508
|
+
rows: 6,
|
|
3509
|
+
autoCorrect: "off",
|
|
3510
|
+
autoCapitalize: "off",
|
|
3511
|
+
autoComplete: "off",
|
|
3512
|
+
value: s,
|
|
3513
|
+
onInput: f,
|
|
3514
|
+
onKeyDown: _,
|
|
3515
|
+
ref: i,
|
|
3516
|
+
disabled: o
|
|
3517
|
+
}), l("div", {
|
|
3518
|
+
className: k.b("action-wrapper"),
|
|
3519
|
+
children: [l("div", {
|
|
3520
|
+
className: "".concat(k.be("action-wrapper", "action-item")),
|
|
3521
|
+
children: l(un, {
|
|
3522
|
+
content: l("div", {
|
|
3523
|
+
className: k.b("pop-actions"),
|
|
3524
|
+
children: [l("div", {
|
|
3525
|
+
className: k.b("pop-action-item"),
|
|
3526
|
+
onClick: (g) => {
|
|
3527
|
+
v(g);
|
|
3528
|
+
},
|
|
3529
|
+
children: [l("span", {
|
|
3530
|
+
className: k.b("pop-action-item-icon"),
|
|
3531
|
+
children: l(sn, {})
|
|
3532
|
+
}), l("span", {
|
|
3533
|
+
className: k.b("pop-action-item-title"),
|
|
3534
|
+
children: "文件资料"
|
|
3535
|
+
})]
|
|
3536
|
+
}), (p = n.questionToolbarItems) == null ? void 0 : p.map((g) => l("div", {
|
|
3537
|
+
className: k.b("pop-action-item"),
|
|
3538
|
+
onClick: (b) => {
|
|
3539
|
+
h(b, g);
|
|
3540
|
+
},
|
|
3541
|
+
children: [l("span", {
|
|
3542
|
+
className: k.b("pop-action-item-icon"),
|
|
3543
|
+
children: typeof g.icon == "function" ? g.icon(I) : g.icon
|
|
3544
|
+
}), l("span", {
|
|
3545
|
+
className: k.b("pop-action-item-title"),
|
|
3546
|
+
children: typeof g.label == "function" ? g.label(I) : g.label
|
|
3547
|
+
})]
|
|
3548
|
+
}, g.id))]
|
|
3549
|
+
}),
|
|
3550
|
+
position: "top-left",
|
|
3551
|
+
isOpen: e,
|
|
3552
|
+
onToggleOpen: t,
|
|
3553
|
+
children: l(Zn, {})
|
|
3554
|
+
})
|
|
3555
|
+
}), l("div", {
|
|
3556
|
+
title: r.value ? "语音输入中..." : "语音输入",
|
|
3557
|
+
className: "".concat(k.be("action-wrapper", "action-item")),
|
|
3558
|
+
onClick: u,
|
|
3559
|
+
children: r.value ? l(qn, {}) : l(Vn, {})
|
|
3560
|
+
}), l("div", {
|
|
3561
|
+
title: o.value ? "思考中..." : "发送消息",
|
|
3562
|
+
className: "".concat(k.be("action-wrapper", "action-item"), " ").concat(k.is("disabled", d.value), " ").concat(k.is("loading", o.value)),
|
|
3563
|
+
onClick: a,
|
|
3564
|
+
disabled: d,
|
|
3565
|
+
children: l(Ln, {})
|
|
3566
|
+
})]
|
|
3567
|
+
})]
|
|
3568
|
+
})]
|
|
3569
|
+
});
|
|
3570
|
+
};
|
|
3571
|
+
const U = new M("chat-topic-item"), Ai = (n) => {
|
|
3572
|
+
const {
|
|
3573
|
+
controller: e,
|
|
3574
|
+
topic: t,
|
|
3575
|
+
onClick: i,
|
|
3576
|
+
onAction: s
|
|
3577
|
+
} = n, o = O(() => {
|
|
3578
|
+
var a;
|
|
3579
|
+
return ((a = e.activedTopic.value) == null ? void 0 : a.id) === t.id;
|
|
3580
|
+
}), [r, c] = Je(!1), u = (d) => {
|
|
3581
|
+
d.stopPropagation(), s("LINK", d);
|
|
3582
|
+
}, f = (d, a) => {
|
|
3583
|
+
d === "DELETE" && s("DELETE", a), c(!1);
|
|
3584
|
+
};
|
|
3585
|
+
return l("div", {
|
|
3586
|
+
className: "".concat(U.b(), " ").concat(U.is("active", o.value)),
|
|
3587
|
+
onClick: i.bind(void 0),
|
|
3588
|
+
children: [l("div", {
|
|
3589
|
+
className: U.b("caption"),
|
|
3590
|
+
title: t.caption,
|
|
3591
|
+
children: t.caption
|
|
3592
|
+
}), l("div", {
|
|
3593
|
+
className: U.b("icon"),
|
|
3594
|
+
children: [l("span", {
|
|
3595
|
+
className: U.be("icon", "item"),
|
|
3596
|
+
title: "跳转主视图",
|
|
3597
|
+
onClick: u.bind(void 0),
|
|
3598
|
+
children: l(Yn, {
|
|
3599
|
+
className: U.b("link-icon")
|
|
3600
|
+
})
|
|
3601
|
+
}), o.value ? null : l(un, {
|
|
3602
|
+
actions: [{
|
|
3603
|
+
id: "DELETE",
|
|
3604
|
+
caption: "删除话题"
|
|
3605
|
+
}],
|
|
3606
|
+
position: "bottom",
|
|
3607
|
+
isOpen: r,
|
|
3608
|
+
onToggleOpen: c,
|
|
3609
|
+
onAction: f.bind(void 0),
|
|
3610
|
+
children: l("span", {
|
|
3611
|
+
className: U.be("icon", "item"),
|
|
3612
|
+
title: "更多",
|
|
3613
|
+
children: l(jn, {
|
|
3614
|
+
className: U.b("more-icon")
|
|
3615
|
+
})
|
|
3616
|
+
})
|
|
3617
|
+
})]
|
|
3618
|
+
})]
|
|
3619
|
+
});
|
|
3620
|
+
};
|
|
3621
|
+
const Ii = new M("chat-topics"), Di = (n) => {
|
|
3622
|
+
const e = n.controller.topics, t = (s) => {
|
|
3623
|
+
n.controller.handleTopicChange(s);
|
|
3624
|
+
}, i = (s, o, r) => {
|
|
3625
|
+
n.controller.handleTopicAction(s, o, r);
|
|
3626
|
+
};
|
|
3627
|
+
return l("div", {
|
|
3628
|
+
className: Ii.b(),
|
|
3629
|
+
children: e.value.map((s) => l(Ai, {
|
|
3630
|
+
topic: s,
|
|
3631
|
+
controller: n.controller,
|
|
3632
|
+
onClick: () => t(s),
|
|
3633
|
+
onAction: (o, r) => i(o, s, r)
|
|
3634
|
+
}, s.id))
|
|
3635
|
+
});
|
|
3636
|
+
};
|
|
3637
|
+
const dn = bn({
|
|
3638
|
+
zIndex: 10
|
|
3639
|
+
});
|
|
3640
|
+
var It;
|
|
3641
|
+
class At extends H {
|
|
3642
|
+
constructor(t) {
|
|
3643
|
+
super(t);
|
|
3644
|
+
w(this, "ns", new M("chat-container"));
|
|
3645
|
+
w(this, "containerRef", He());
|
|
3646
|
+
w(this, "dragHandle", He());
|
|
3647
|
+
w(this, "minimizeRef", He());
|
|
3648
|
+
w(this, "data", {
|
|
3649
|
+
x: window.innerWidth - 600,
|
|
3650
|
+
y: 0,
|
|
3651
|
+
width: 600,
|
|
3652
|
+
height: window.innerHeight,
|
|
3653
|
+
minWidth: 500,
|
|
3654
|
+
minHeight: 300
|
|
3655
|
+
});
|
|
3656
|
+
w(this, "minimizeData", {
|
|
3657
|
+
x: window.innerWidth - 86,
|
|
3658
|
+
y: window.innerHeight - 86
|
|
3659
|
+
});
|
|
3660
|
+
/**
|
|
3661
|
+
* 是否禁止拖动
|
|
3662
|
+
* - 拖拽边时应禁止拖动
|
|
3663
|
+
* @type {boolean}
|
|
3664
|
+
* @memberof ChatContainer
|
|
3665
|
+
*/
|
|
3666
|
+
w(this, "disabled", !1);
|
|
3667
|
+
/**
|
|
3668
|
+
* 最小化是否在拖拽中
|
|
3669
|
+
* - 在拖拽时不应触发点击事件
|
|
3670
|
+
* @type {boolean}
|
|
3671
|
+
* @memberof ChatContainer
|
|
3672
|
+
*/
|
|
3673
|
+
w(this, "isDragging", !1);
|
|
3674
|
+
/**
|
|
3675
|
+
* 容器上下文
|
|
3676
|
+
*
|
|
3677
|
+
* @author tony001
|
|
3678
|
+
* @date 2025-03-03 16:03:44
|
|
3679
|
+
* @type {ContainerContext}
|
|
3680
|
+
*/
|
|
3681
|
+
w(this, "containerContext", {
|
|
3682
|
+
zIndex: ((It = this.props.containerOptions) == null ? void 0 : It.zIndex) || 10
|
|
3683
|
+
});
|
|
3684
|
+
this.state = {
|
|
3685
|
+
isFullScreen: !1,
|
|
3686
|
+
isMinimize: !1
|
|
3687
|
+
};
|
|
3688
|
+
}
|
|
3689
|
+
calcWindowStyle() {
|
|
3690
|
+
var t, i;
|
|
3691
|
+
return {
|
|
3692
|
+
left: "".concat(this.data.x / window.innerWidth * 100, "%"),
|
|
3693
|
+
top: "".concat(this.data.y / window.innerHeight * 100, "%"),
|
|
3694
|
+
width: "".concat(this.data.width / window.innerWidth * 100, "%"),
|
|
3695
|
+
height: "".concat(this.data.height / window.innerHeight * 100, "%"),
|
|
3696
|
+
minWidth: "".concat(this.data.minWidth, "px"),
|
|
3697
|
+
minHeight: "".concat(this.data.minHeight, "px"),
|
|
3698
|
+
"z-index": ((i = (t = this.props.containerOptions) == null ? void 0 : t.zIndex) == null ? void 0 : i.toString()) || "10"
|
|
3699
|
+
};
|
|
3700
|
+
}
|
|
3701
|
+
calcMinimizeStyle() {
|
|
3702
|
+
return {
|
|
3703
|
+
left: "".concat(this.minimizeData.x / window.innerWidth * 100, "%"),
|
|
3704
|
+
top: "".concat(this.minimizeData.y / window.innerHeight * 100, "%"),
|
|
3705
|
+
"z-index": "99999"
|
|
3706
|
+
};
|
|
3707
|
+
}
|
|
3708
|
+
setStyle() {
|
|
3709
|
+
Object.assign(this.containerRef.current.style, this.calcWindowStyle()), Object.assign(this.minimizeRef.current.style, this.calcMinimizeStyle());
|
|
3710
|
+
}
|
|
3711
|
+
componentDidMount() {
|
|
3712
|
+
const t = localStorage.getItem(N.MINIMIZE_STYLY_CHCHE);
|
|
3713
|
+
t && (this.minimizeData = JSON.parse(t));
|
|
3714
|
+
const i = localStorage.getItem(N.STYLE_CACHE);
|
|
3715
|
+
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();
|
|
3716
|
+
const s = this.data;
|
|
3717
|
+
this.minimizeRef.current.onmousedown = (o) => {
|
|
3718
|
+
document.body.style.userSelect = "none";
|
|
3719
|
+
const r = o.clientX - this.minimizeRef.current.offsetLeft, c = o.clientY - this.minimizeRef.current.offsetTop, u = Date.now(), f = (a) => {
|
|
3720
|
+
this.minimizeData.x = a.clientX - r, this.minimizeData.y = a.clientY - c, this.setStyle();
|
|
3721
|
+
}, d = () => {
|
|
3722
|
+
const a = Date.now();
|
|
3723
|
+
this.isDragging = a - u > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", d);
|
|
3724
|
+
};
|
|
3725
|
+
document.addEventListener("mousemove", f), document.addEventListener("mouseup", d);
|
|
3726
|
+
}, this.dragHandle.current.onmousedown = (o) => {
|
|
3727
|
+
if (this.disabled || this.state.isFullScreen)
|
|
3728
|
+
return;
|
|
3729
|
+
document.body.style.userSelect = "none";
|
|
3730
|
+
const r = o.clientX - this.containerRef.current.offsetLeft, c = o.clientY - this.containerRef.current.offsetTop, u = (d) => {
|
|
3731
|
+
s.x = d.clientX - r, s.y = d.clientY - c, this.setStyle();
|
|
3732
|
+
}, f = () => {
|
|
3733
|
+
document.body.style.userSelect = "", document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", f);
|
|
3734
|
+
};
|
|
3735
|
+
document.addEventListener("mousemove", u), document.addEventListener("mouseup", f);
|
|
3736
|
+
}, ze(this.containerRef.current).resizable({
|
|
3737
|
+
// 可拖拽的边缘
|
|
3738
|
+
edges: {
|
|
3739
|
+
top: !0,
|
|
3740
|
+
right: !0,
|
|
3741
|
+
bottom: !0,
|
|
3742
|
+
left: !0
|
|
3743
|
+
},
|
|
3744
|
+
margin: 6,
|
|
3745
|
+
modifiers: [
|
|
3746
|
+
// 保持在父对象内部
|
|
3747
|
+
ze.modifiers.restrictEdges({
|
|
3748
|
+
outer: document.body
|
|
3749
|
+
}),
|
|
3750
|
+
// 缩放最小宽度
|
|
3751
|
+
ze.modifiers.restrictSize({
|
|
3752
|
+
min: {
|
|
3753
|
+
width: s.minWidth,
|
|
3754
|
+
height: s.minHeight
|
|
3755
|
+
}
|
|
3756
|
+
})
|
|
3757
|
+
],
|
|
3758
|
+
inertia: !0,
|
|
3759
|
+
listeners: {
|
|
3760
|
+
move: (o) => {
|
|
3761
|
+
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());
|
|
3762
|
+
},
|
|
3763
|
+
start: () => {
|
|
3764
|
+
this.disabled = !0, document.body.style.userSelect = "none";
|
|
3765
|
+
},
|
|
3766
|
+
end: () => {
|
|
3767
|
+
this.disabled = !1, document.body.style.userSelect = "";
|
|
3768
|
+
}
|
|
3769
|
+
}
|
|
3770
|
+
});
|
|
3771
|
+
}
|
|
3772
|
+
componentWillUnmount() {
|
|
3773
|
+
localStorage.setItem(N.STYLE_CACHE, JSON.stringify(this.data)), localStorage.setItem(N.MINIMIZE_STYLY_CHCHE, JSON.stringify(this.minimizeData));
|
|
3774
|
+
}
|
|
3775
|
+
/**
|
|
3776
|
+
* 关闭聊天窗口
|
|
3777
|
+
*
|
|
3778
|
+
* @author chitanda
|
|
3779
|
+
* @date 2023-10-15 19:10:31
|
|
3780
|
+
*/
|
|
3781
|
+
close() {
|
|
3782
|
+
this.props.close();
|
|
3783
|
+
}
|
|
3784
|
+
/**
|
|
3785
|
+
* 全屏
|
|
3786
|
+
*
|
|
3787
|
+
* @author ljx
|
|
3788
|
+
* @date 2024-05-07 15:10:31
|
|
3789
|
+
*/
|
|
3790
|
+
fullScreen() {
|
|
3791
|
+
const t = this.containerRef.current;
|
|
3792
|
+
t && (t.requestFullscreen(), this.setState({
|
|
3793
|
+
isFullScreen: !0
|
|
3794
|
+
}), this.props.fullscreen(!0));
|
|
3795
|
+
}
|
|
3796
|
+
/**
|
|
3797
|
+
* 关闭全屏
|
|
3798
|
+
*
|
|
3799
|
+
* @author ljx
|
|
3800
|
+
* @date 2024-05-07 15:10:31
|
|
3801
|
+
*/
|
|
3802
|
+
closeFullScreen() {
|
|
3803
|
+
this.state.isFullScreen && (document == null || document.exitFullscreen(), this.setState({
|
|
3804
|
+
isFullScreen: !1
|
|
3805
|
+
}), this.props.fullscreen(!1), this.setStyle());
|
|
3806
|
+
}
|
|
3807
|
+
/**
|
|
3808
|
+
* 最小化
|
|
3809
|
+
*
|
|
3810
|
+
* @memberof ChatContainer
|
|
3811
|
+
*/
|
|
3812
|
+
minimize() {
|
|
3813
|
+
this.closeFullScreen(), this.setState({
|
|
3814
|
+
isMinimize: !0
|
|
3815
|
+
}), this.props.minimize(!0);
|
|
3816
|
+
}
|
|
3817
|
+
/**
|
|
3818
|
+
* 退出最小化
|
|
3819
|
+
*
|
|
3820
|
+
* @memberof ChatContainer
|
|
3821
|
+
*/
|
|
3822
|
+
exitMinimize() {
|
|
3823
|
+
this.isDragging || (this.setState({
|
|
3824
|
+
isMinimize: !1
|
|
3825
|
+
}), this.props.minimize(!1));
|
|
3826
|
+
}
|
|
3827
|
+
/**
|
|
3828
|
+
* 阻止冒泡
|
|
3829
|
+
* - 防止点击头部行为时误触发拖动监听
|
|
3830
|
+
* @param {MouseEvent} evt
|
|
3831
|
+
* @memberof ChatContainer
|
|
3832
|
+
*/
|
|
3833
|
+
stopPropagation(t) {
|
|
3834
|
+
t.stopPropagation();
|
|
3835
|
+
}
|
|
3836
|
+
render() {
|
|
3837
|
+
return l(dn.Provider, {
|
|
3838
|
+
value: this.containerContext,
|
|
3839
|
+
children: l("div", {
|
|
3840
|
+
className: "".concat(this.ns.b()),
|
|
3841
|
+
children: [l("div", {
|
|
3842
|
+
className: "".concat(this.ns.e("dialog"), " ").concat(this.ns.is("full-screen", this.state.isFullScreen), " ").concat(this.ns.is("hidden", this.state.isMinimize)),
|
|
3843
|
+
ref: this.containerRef,
|
|
3844
|
+
children: [l("div", {
|
|
3845
|
+
ref: this.dragHandle,
|
|
3846
|
+
className: this.ns.b("header"),
|
|
3847
|
+
children: [l("div", {
|
|
3848
|
+
className: this.ns.b("header-caption"),
|
|
3849
|
+
children: this.props.caption || "AI助手"
|
|
3850
|
+
}), l("div", {
|
|
3851
|
+
className: this.ns.b("header-action-wrapper"),
|
|
3852
|
+
children: [l("div", {
|
|
3853
|
+
title: "最小化",
|
|
3854
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "minimize")),
|
|
3855
|
+
onMouseDown: this.stopPropagation.bind(this),
|
|
3856
|
+
onClick: this.minimize.bind(this),
|
|
3857
|
+
children: l(Un, {})
|
|
3858
|
+
}), this.state.isFullScreen ? l("div", {
|
|
3859
|
+
title: "退出全屏",
|
|
3860
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "close-full-screen")),
|
|
3861
|
+
onMouseDown: this.stopPropagation.bind(this),
|
|
3862
|
+
onClick: this.closeFullScreen.bind(this),
|
|
3863
|
+
children: l(Bn, {})
|
|
3864
|
+
}) : l("div", {
|
|
3865
|
+
title: "全屏",
|
|
3866
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "full-screen")),
|
|
3867
|
+
onMouseDown: this.stopPropagation.bind(this),
|
|
3868
|
+
onClick: this.fullScreen.bind(this),
|
|
3869
|
+
children: l(Pn, {})
|
|
3870
|
+
}), l("div", {
|
|
3871
|
+
title: "关闭",
|
|
3872
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "action-close")),
|
|
3873
|
+
onMouseDown: this.stopPropagation.bind(this),
|
|
3874
|
+
onClick: this.close.bind(this),
|
|
3875
|
+
children: l(zn, {})
|
|
3876
|
+
})]
|
|
3877
|
+
})]
|
|
3878
|
+
}), this.props.mode === "TOPIC" ? l("div", {
|
|
3879
|
+
className: "".concat(this.ns.b("main")),
|
|
3880
|
+
children: [l("div", {
|
|
3881
|
+
className: "".concat(this.ns.be("main", "left")),
|
|
3882
|
+
children: l(Di, {
|
|
3883
|
+
controller: this.props.aiTopic
|
|
3884
|
+
})
|
|
3885
|
+
}), l("div", {
|
|
3886
|
+
className: "".concat(this.ns.be("main", "right")),
|
|
3887
|
+
children: [l("div", {
|
|
3888
|
+
className: this.ns.b("content"),
|
|
3889
|
+
children: l(vt, {
|
|
3890
|
+
controller: this.props.aiChat,
|
|
3891
|
+
toolbarItems: this.props.contentToolbarItems
|
|
3892
|
+
})
|
|
3893
|
+
}), l(Xe, {
|
|
3894
|
+
data: this.props.aiTopic.activedTopic.value,
|
|
3895
|
+
type: "footer",
|
|
3896
|
+
className: this.ns.e("toolbar"),
|
|
3897
|
+
controller: this.props.aiChat,
|
|
3898
|
+
items: this.props.footerToolbarItems
|
|
3899
|
+
}), l("div", {
|
|
3900
|
+
className: this.ns.b("footer"),
|
|
3901
|
+
children: l(Mt, {
|
|
3902
|
+
controller: this.props.aiChat,
|
|
3903
|
+
questionToolbarItems: this.props.questionToolbarItems
|
|
3904
|
+
})
|
|
3905
|
+
})]
|
|
3906
|
+
})]
|
|
3907
|
+
}) : l("div", {
|
|
3908
|
+
className: "".concat(this.ns.be("main", "default")),
|
|
3909
|
+
children: [l("div", {
|
|
3910
|
+
className: this.ns.b("content"),
|
|
3911
|
+
children: l(vt, {
|
|
3912
|
+
controller: this.props.aiChat,
|
|
3913
|
+
toolbarItems: this.props.contentToolbarItems
|
|
3914
|
+
})
|
|
3915
|
+
}), l(Xe, {
|
|
3916
|
+
data: this.props.aiTopic.activedTopic.value,
|
|
3917
|
+
type: "footer",
|
|
3918
|
+
className: this.ns.e("toolbar"),
|
|
3919
|
+
controller: this.props.aiChat,
|
|
3920
|
+
items: this.props.footerToolbarItems
|
|
3921
|
+
}), l("div", {
|
|
3922
|
+
className: this.ns.b("footer"),
|
|
3923
|
+
children: l(Mt, {
|
|
3924
|
+
controller: this.props.aiChat,
|
|
3925
|
+
questionToolbarItems: this.props.questionToolbarItems
|
|
3926
|
+
})
|
|
3927
|
+
})]
|
|
3928
|
+
})]
|
|
3929
|
+
}), l("div", {
|
|
3930
|
+
title: "AI助手",
|
|
3931
|
+
ref: this.minimizeRef,
|
|
3932
|
+
className: "".concat(this.ns.e("minimize"), " ").concat(this.ns.is("hidden", !this.state.isMinimize)),
|
|
3933
|
+
onClick: this.exitMinimize.bind(this),
|
|
3934
|
+
children: l(Fn, {})
|
|
3935
|
+
})]
|
|
3936
|
+
})
|
|
3937
|
+
});
|
|
3298
3938
|
}
|
|
3299
3939
|
}
|
|
3300
|
-
const fi = new li();
|
|
3301
3940
|
export {
|
|
3302
|
-
|
|
3303
|
-
|
|
3941
|
+
At as ChatContainer,
|
|
3942
|
+
Oi as chat
|
|
3304
3943
|
};
|