@anam-ai/agent-widget 0.3.0 → 0.3.1-alpha.1
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.js +402 -397
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Be, D,
|
|
1
|
+
var Be, D, ii, ni, _e, Ut, ri, oi, si, mt, ct, ut, De = {}, ai = [], Xi = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Ze = Array.isArray;
|
|
2
2
|
function ee(t, e) {
|
|
3
3
|
for (var n in e) t[n] = e[n];
|
|
4
4
|
return t;
|
|
@@ -13,7 +13,7 @@ function we(t, e, n) {
|
|
|
13
13
|
return xe(t, u, o, c, null);
|
|
14
14
|
}
|
|
15
15
|
function xe(t, e, n, o, c) {
|
|
16
|
-
var s = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: c ?? ++
|
|
16
|
+
var s = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: c ?? ++ii, __i: -1, __u: 0 };
|
|
17
17
|
return c == null && D.vnode != null && D.vnode(s), s;
|
|
18
18
|
}
|
|
19
19
|
function pe(t) {
|
|
@@ -27,38 +27,38 @@ function be(t, e) {
|
|
|
27
27
|
for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
|
|
28
28
|
return typeof t.type == "function" ? be(t) : null;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function li(t) {
|
|
31
31
|
var e, n;
|
|
32
32
|
if ((t = t.__) != null && t.__c != null) {
|
|
33
33
|
for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
|
|
34
34
|
t.__e = t.__c.base = n.__e;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return li(t);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
(!t.__d && (t.__d = !0) && _e.push(t) && !qe.__r++ ||
|
|
40
|
+
function Mt(t) {
|
|
41
|
+
(!t.__d && (t.__d = !0) && _e.push(t) && !qe.__r++ || Ut != D.debounceRendering) && ((Ut = D.debounceRendering) || ri)(qe);
|
|
42
42
|
}
|
|
43
43
|
function qe() {
|
|
44
|
-
for (var t, e, n, o, c, s, u, l = 1; _e.length; ) _e.length > l && _e.sort(
|
|
44
|
+
for (var t, e, n, o, c, s, u, l = 1; _e.length; ) _e.length > l && _e.sort(oi), t = _e.shift(), l = _e.length, t.__d && (n = void 0, o = void 0, c = (o = (e = t).__v).__e, s = [], u = [], e.__P && ((n = ee({}, o)).__v = o.__v + 1, D.vnode && D.vnode(n), vt(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [c] : null, s, c ?? be(o), !!(32 & o.__u), u), n.__v = o.__v, n.__.__k[n.__i] = n, di(s, n, u), o.__e = o.__ = null, n.__e != c && li(n)));
|
|
45
45
|
qe.__r = 0;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
var d, y, g, S, C, A, I, b = o && o.__k ||
|
|
49
|
-
for (E =
|
|
47
|
+
function ci(t, e, n, o, c, s, u, l, E, _, p) {
|
|
48
|
+
var d, y, g, S, C, A, I, b = o && o.__k || ai, T = e.length;
|
|
49
|
+
for (E = Zi(n, e, b, E, T), d = 0; d < T; d++) (g = n.__k[d]) != null && (y = g.__i == -1 ? De : b[g.__i] || De, g.__i = d, A = vt(t, g, y, c, s, u, l, E, _, p), S = g.__e, g.ref && y.ref != g.ref && (y.ref && yt(y.ref, null, g), p.push(g.ref, g.__c || S, g)), C == null && S != null && (C = S), (I = !!(4 & g.__u)) || y.__k === g.__k ? E = ui(g, E, t, I) : typeof g.type == "function" && A !== void 0 ? E = A : S && (E = S.nextSibling), g.__u &= -7);
|
|
50
50
|
return n.__e = C, E;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
var s, u, l, E,
|
|
54
|
-
for (t.__k = new Array(c), s = 0; s < c; s++) (u = e[s]) != null && typeof u != "boolean" && typeof u != "function" ? (typeof u == "string" || typeof u == "number" || typeof u == "bigint" || u.constructor == String ? u = t.__k[s] = xe(null, u, null, null, null) : Ze(u) ? u = t.__k[s] = xe(pe, { children: u }, null, null, null) : u.constructor === void 0 && u.__b > 0 ? u = t.__k[s] = xe(u.type, u.props, u.key, u.ref ? u.ref : null, u.__v) : t.__k[s] = u, E = s + y, u.__ = t, u.__b = t.__b + 1, l = null, (
|
|
55
|
-
if (d) for (s = 0; s <
|
|
52
|
+
function Zi(t, e, n, o, c) {
|
|
53
|
+
var s, u, l, E, _, p = n.length, d = p, y = 0;
|
|
54
|
+
for (t.__k = new Array(c), s = 0; s < c; s++) (u = e[s]) != null && typeof u != "boolean" && typeof u != "function" ? (typeof u == "string" || typeof u == "number" || typeof u == "bigint" || u.constructor == String ? u = t.__k[s] = xe(null, u, null, null, null) : Ze(u) ? u = t.__k[s] = xe(pe, { children: u }, null, null, null) : u.constructor === void 0 && u.__b > 0 ? u = t.__k[s] = xe(u.type, u.props, u.key, u.ref ? u.ref : null, u.__v) : t.__k[s] = u, E = s + y, u.__ = t, u.__b = t.__b + 1, l = null, (_ = u.__i = Qi(u, n, E, d)) != -1 && (d--, (l = n[_]) && (l.__u |= 2)), l == null || l.__v == null ? (_ == -1 && (c > p ? y-- : c < p && y++), typeof u.type != "function" && (u.__u |= 4)) : _ != E && (_ == E - 1 ? y-- : _ == E + 1 ? y++ : (_ > E ? y-- : y++, u.__u |= 4))) : t.__k[s] = null;
|
|
55
|
+
if (d) for (s = 0; s < p; s++) (l = n[s]) != null && (2 & l.__u) == 0 && (l.__e == o && (o = be(l)), fi(l, l));
|
|
56
56
|
return o;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function ui(t, e, n, o) {
|
|
59
59
|
var c, s;
|
|
60
60
|
if (typeof t.type == "function") {
|
|
61
|
-
for (c = t.__k, s = 0; c && s < c.length; s++) c[s] && (c[s].__ = t, e =
|
|
61
|
+
for (c = t.__k, s = 0; c && s < c.length; s++) c[s] && (c[s].__ = t, e = ui(c[s], e, n, o));
|
|
62
62
|
return e;
|
|
63
63
|
}
|
|
64
64
|
t.__e != e && (o && (e && t.type && !e.parentNode && (e = be(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
|
|
@@ -67,16 +67,16 @@ function ci(t, e, n, o) {
|
|
|
67
67
|
while (e != null && e.nodeType == 8);
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
var c, s, u, l = t.key, E = t.type,
|
|
72
|
-
if (
|
|
73
|
-
if (o > (
|
|
74
|
-
for (c = n - 1, s = n + 1; c >= 0 || s < e.length; ) if ((
|
|
70
|
+
function Qi(t, e, n, o) {
|
|
71
|
+
var c, s, u, l = t.key, E = t.type, _ = e[n], p = _ != null && (2 & _.__u) == 0;
|
|
72
|
+
if (_ === null && l == null || p && l == _.key && E == _.type) return n;
|
|
73
|
+
if (o > (p ? 1 : 0)) {
|
|
74
|
+
for (c = n - 1, s = n + 1; c >= 0 || s < e.length; ) if ((_ = e[u = c >= 0 ? c-- : s++]) != null && (2 & _.__u) == 0 && l == _.key && E == _.type) return u;
|
|
75
75
|
}
|
|
76
76
|
return -1;
|
|
77
77
|
}
|
|
78
78
|
function Lt(t, e, n) {
|
|
79
|
-
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" ||
|
|
79
|
+
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || Xi.test(e) ? n : n + "px";
|
|
80
80
|
}
|
|
81
81
|
function $e(t, e, n, o, c) {
|
|
82
82
|
var s, u;
|
|
@@ -85,7 +85,7 @@ function $e(t, e, n, o, c) {
|
|
|
85
85
|
if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || Lt(t.style, e, "");
|
|
86
86
|
if (n) for (e in n) o && n[e] == o[e] || Lt(t.style, e, n[e]);
|
|
87
87
|
}
|
|
88
|
-
else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(
|
|
88
|
+
else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(si, "$1")), u = e.toLowerCase(), e = u in t || e == "onFocusOut" || e == "onFocusIn" ? u.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = n, n ? o ? n.u = o.u : (n.u = mt, t.addEventListener(e, s ? ut : ct, s)) : t.removeEventListener(e, s ? ut : ct, s);
|
|
89
89
|
else {
|
|
90
90
|
if (c == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
91
91
|
else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
|
|
@@ -106,12 +106,12 @@ function Bt(t) {
|
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function vt(t, e, n, o, c, s, u, l, E,
|
|
110
|
-
var
|
|
109
|
+
function vt(t, e, n, o, c, s, u, l, E, _) {
|
|
110
|
+
var p, d, y, g, S, C, A, I, b, T, O, N, Y, ie, $, ne, re, Z = e.type;
|
|
111
111
|
if (e.constructor !== void 0) return null;
|
|
112
|
-
128 & n.__u && (E = !!(32 & n.__u), s = [l = e.__e = n.__e]), (
|
|
112
|
+
128 & n.__u && (E = !!(32 & n.__u), s = [l = e.__e = n.__e]), (p = D.__b) && p(e);
|
|
113
113
|
e: if (typeof Z == "function") try {
|
|
114
|
-
if (I = e.props, b = "prototype" in Z && Z.prototype.render, T = (
|
|
114
|
+
if (I = e.props, b = "prototype" in Z && Z.prototype.render, T = (p = Z.contextType) && o[p.__c], O = p ? T ? T.props.value : p.__ : o, n.__c ? A = (d = e.__c = n.__c).__ = d.__E : (b ? e.__c = d = new Z(I, O) : (e.__c = d = new Ce(I, O), d.constructor = Z, d.render = tn), T && T.sub(d), d.state || (d.state = {}), d.__n = o, y = d.__d = !0, d.__h = [], d._sb = []), b && d.__s == null && (d.__s = d.state), b && Z.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = ee({}, d.__s)), ee(d.__s, Z.getDerivedStateFromProps(I, d.__s))), g = d.props, S = d.state, d.__v = e, y) b && Z.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), b && d.componentDidMount != null && d.__h.push(d.componentDidMount);
|
|
115
115
|
else {
|
|
116
116
|
if (b && Z.getDerivedStateFromProps == null && I !== g && d.componentWillReceiveProps != null && d.componentWillReceiveProps(I, O), e.__v == n.__v || !d.__e && d.shouldComponentUpdate != null && d.shouldComponentUpdate(I, d.__s, O) === !1) {
|
|
117
117
|
for (e.__v != n.__v && (d.props = I, d.state = d.__s, d.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(se) {
|
|
@@ -125,12 +125,12 @@ function vt(t, e, n, o, c, s, u, l, E, p) {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
if (d.context = O, d.props = I, d.__P = t, d.__e = !1, Y = D.__r, ie = 0, b) {
|
|
128
|
-
for (d.state = d.__s, d.__d = !1, Y && Y(e),
|
|
128
|
+
for (d.state = d.__s, d.__d = !1, Y && Y(e), p = d.render(d.props, d.state, d.context), $ = 0; $ < d._sb.length; $++) d.__h.push(d._sb[$]);
|
|
129
129
|
d._sb = [];
|
|
130
130
|
} else do
|
|
131
|
-
d.__d = !1, Y && Y(e),
|
|
131
|
+
d.__d = !1, Y && Y(e), p = d.render(d.props, d.state, d.context), d.state = d.__s;
|
|
132
132
|
while (d.__d && ++ie < 25);
|
|
133
|
-
d.state = d.__s, d.getChildContext != null && (o = ee(ee({}, o), d.getChildContext())), b && !y && d.getSnapshotBeforeUpdate != null && (C = d.getSnapshotBeforeUpdate(g, S)), ne =
|
|
133
|
+
d.state = d.__s, d.getChildContext != null && (o = ee(ee({}, o), d.getChildContext())), b && !y && d.getSnapshotBeforeUpdate != null && (C = d.getSnapshotBeforeUpdate(g, S)), ne = p, p != null && p.type === pe && p.key == null && (ne = hi(p.props.children)), l = ci(t, Ze(ne) ? ne : [ne], e, n, o, c, s, u, l, E, _), d.base = e.__e, e.__u &= -161, d.__h.length && u.push(d), A && (d.__E = d.__ = null);
|
|
134
134
|
} catch (se) {
|
|
135
135
|
if (e.__v = null, E || s != null) if (se.then) {
|
|
136
136
|
for (e.__u |= E ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
@@ -142,13 +142,13 @@ function vt(t, e, n, o, c, s, u, l, E, p) {
|
|
|
142
142
|
else e.__e = n.__e, e.__k = n.__k, se.then || dt(e);
|
|
143
143
|
D.__e(se, e, n);
|
|
144
144
|
}
|
|
145
|
-
else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e =
|
|
146
|
-
return (
|
|
145
|
+
else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = en(n.__e, e, n, o, c, s, u, E, _);
|
|
146
|
+
return (p = D.diffed) && p(e), 128 & e.__u ? void 0 : l;
|
|
147
147
|
}
|
|
148
148
|
function dt(t) {
|
|
149
149
|
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(dt);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function di(t, e, n) {
|
|
152
152
|
for (var o = 0; o < n.length; o++) yt(n[o], n[++o], n[++o]);
|
|
153
153
|
D.__c && D.__c(e, t), t.some(function(c) {
|
|
154
154
|
try {
|
|
@@ -160,14 +160,14 @@ function ui(t, e, n) {
|
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : Ze(t) ? t.map(
|
|
163
|
+
function hi(t) {
|
|
164
|
+
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : Ze(t) ? t.map(hi) : ee({}, t);
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
var
|
|
166
|
+
function en(t, e, n, o, c, s, u, l, E) {
|
|
167
|
+
var _, p, d, y, g, S, C, A = n.props || De, I = e.props, b = e.type;
|
|
168
168
|
if (b == "svg" ? c = "http://www.w3.org/2000/svg" : b == "math" ? c = "http://www.w3.org/1998/Math/MathML" : c || (c = "http://www.w3.org/1999/xhtml"), s != null) {
|
|
169
|
-
for (
|
|
170
|
-
t = g, s[
|
|
169
|
+
for (_ = 0; _ < s.length; _++) if ((g = s[_]) && "setAttribute" in g == !!b && (b ? g.localName == b : g.nodeType == 3)) {
|
|
170
|
+
t = g, s[_] = null;
|
|
171
171
|
break;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
@@ -177,18 +177,18 @@ function Qi(t, e, n, o, c, s, u, l, E) {
|
|
|
177
177
|
}
|
|
178
178
|
if (b == null) A === I || l && t.data == I || (t.data = I);
|
|
179
179
|
else {
|
|
180
|
-
if (s = s && Be.call(t.childNodes), !l && s != null) for (A = {},
|
|
181
|
-
for (
|
|
182
|
-
if (
|
|
183
|
-
else if (!(
|
|
184
|
-
if (
|
|
185
|
-
$e(t,
|
|
180
|
+
if (s = s && Be.call(t.childNodes), !l && s != null) for (A = {}, _ = 0; _ < t.attributes.length; _++) A[(g = t.attributes[_]).name] = g.value;
|
|
181
|
+
for (_ in A) if (g = A[_], _ != "children") {
|
|
182
|
+
if (_ == "dangerouslySetInnerHTML") d = g;
|
|
183
|
+
else if (!(_ in I)) {
|
|
184
|
+
if (_ == "value" && "defaultValue" in I || _ == "checked" && "defaultChecked" in I) continue;
|
|
185
|
+
$e(t, _, null, g, c);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
for (
|
|
189
|
-
if (
|
|
190
|
-
else if (d && (t.innerHTML = ""),
|
|
191
|
-
l || (
|
|
188
|
+
for (_ in I) g = I[_], _ == "children" ? y = g : _ == "dangerouslySetInnerHTML" ? p = g : _ == "value" ? S = g : _ == "checked" ? C = g : l && typeof g != "function" || A[_] === g || $e(t, _, g, A[_], c);
|
|
189
|
+
if (p) l || d && (p.__html == d.__html || p.__html == t.innerHTML) || (t.innerHTML = p.__html), e.__k = [];
|
|
190
|
+
else if (d && (t.innerHTML = ""), ci(e.type == "template" ? t.content : t, Ze(y) ? y : [y], e, n, o, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : c, s, u, s ? s[0] : n.__k && be(n, 0), l, E), s != null) for (_ = s.length; _--; ) gt(s[_]);
|
|
191
|
+
l || (_ = "value", b == "progress" && S == null ? t.removeAttribute("value") : S != null && (S !== t[_] || b == "progress" && !S || b == "option" && S != A[_]) && $e(t, _, S, A[_], c), _ = "checked", C != null && C != t[_] && $e(t, _, C, A[_], c));
|
|
192
192
|
}
|
|
193
193
|
return t;
|
|
194
194
|
}
|
|
@@ -202,7 +202,7 @@ function yt(t, e, n) {
|
|
|
202
202
|
D.__e(c, n);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function fi(t, e, n) {
|
|
206
206
|
var o, c;
|
|
207
207
|
if (D.unmount && D.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || yt(o, null, e)), (o = t.__c) != null) {
|
|
208
208
|
if (o.componentWillUnmount) try {
|
|
@@ -212,41 +212,41 @@ function hi(t, e, n) {
|
|
|
212
212
|
}
|
|
213
213
|
o.base = o.__P = null;
|
|
214
214
|
}
|
|
215
|
-
if (o = t.__k) for (c = 0; c < o.length; c++) o[c] &&
|
|
215
|
+
if (o = t.__k) for (c = 0; c < o.length; c++) o[c] && fi(o[c], e, n || typeof t.type != "function");
|
|
216
216
|
n || gt(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function tn(t, e, n) {
|
|
219
219
|
return this.constructor(t, n);
|
|
220
220
|
}
|
|
221
221
|
function Qe(t, e, n) {
|
|
222
222
|
var o, c, s, u;
|
|
223
|
-
e == document && (e = document.documentElement), D.__ && D.__(t, e), c = (o = typeof n == "function") ? null : n && n.__k || e.__k, s = [], u = [], vt(e, t = (!o && n || e).__k = we(pe, null, [t]), c || De, De, e.namespaceURI, !o && n ? [n] : c ? null : e.firstChild ? Be.call(e.childNodes) : null, s, !o && n ? n : c ? c.__e : e.firstChild, o, u),
|
|
223
|
+
e == document && (e = document.documentElement), D.__ && D.__(t, e), c = (o = typeof n == "function") ? null : n && n.__k || e.__k, s = [], u = [], vt(e, t = (!o && n || e).__k = we(pe, null, [t]), c || De, De, e.namespaceURI, !o && n ? [n] : c ? null : e.firstChild ? Be.call(e.childNodes) : null, s, !o && n ? n : c ? c.__e : e.firstChild, o, u), di(s, t, u);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
Qe(t, e,
|
|
225
|
+
function pi(t, e) {
|
|
226
|
+
Qe(t, e, pi);
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function _i(t, e, n) {
|
|
229
229
|
var o, c, s, u, l = ee({}, t.props);
|
|
230
230
|
for (s in t.type && t.type.defaultProps && (u = t.type.defaultProps), e) s == "key" ? o = e[s] : s == "ref" ? c = e[s] : l[s] = e[s] === void 0 && u != null ? u[s] : e[s];
|
|
231
231
|
return arguments.length > 2 && (l.children = arguments.length > 3 ? Be.call(arguments, 2) : n), xe(t.type, l, o || t.key, c || t.ref, null);
|
|
232
232
|
}
|
|
233
|
-
Be =
|
|
233
|
+
Be = ai.slice, D = { __e: function(t, e, n, o) {
|
|
234
234
|
for (var c, s, u; e = e.__; ) if ((c = e.__c) && !c.__) try {
|
|
235
235
|
if ((s = c.constructor) && s.getDerivedStateFromError != null && (c.setState(s.getDerivedStateFromError(t)), u = c.__d), c.componentDidCatch != null && (c.componentDidCatch(t, o || {}), u = c.__d), u) return c.__E = c;
|
|
236
236
|
} catch (l) {
|
|
237
237
|
t = l;
|
|
238
238
|
}
|
|
239
239
|
throw t;
|
|
240
|
-
} },
|
|
240
|
+
} }, ii = 0, ni = function(t) {
|
|
241
241
|
return t != null && t.constructor === void 0;
|
|
242
242
|
}, Ce.prototype.setState = function(t, e) {
|
|
243
243
|
var n;
|
|
244
|
-
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = ee({}, this.state), typeof t == "function" && (t = t(ee({}, n), this.props)), t && ee(n, t), t != null && this.__v && (e && this._sb.push(e),
|
|
244
|
+
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = ee({}, this.state), typeof t == "function" && (t = t(ee({}, n), this.props)), t && ee(n, t), t != null && this.__v && (e && this._sb.push(e), Mt(this));
|
|
245
245
|
}, Ce.prototype.forceUpdate = function(t) {
|
|
246
|
-
this.__v && (this.__e = !0, t && this.__h.push(t),
|
|
247
|
-
}, Ce.prototype.render = pe, _e = [],
|
|
246
|
+
this.__v && (this.__e = !0, t && this.__h.push(t), Mt(this));
|
|
247
|
+
}, Ce.prototype.render = pe, _e = [], ri = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, oi = function(t, e) {
|
|
248
248
|
return t.__v.__b - e.__v.__b;
|
|
249
|
-
}, qe.__r = 0,
|
|
249
|
+
}, qe.__r = 0, si = /(PointerCapture)$|Capture$/i, mt = 0, ct = Bt(!1), ut = Bt(!0);
|
|
250
250
|
function Ye() {
|
|
251
251
|
return Ye = Object.assign ? Object.assign.bind() : function(t) {
|
|
252
252
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -256,21 +256,21 @@ function Ye() {
|
|
|
256
256
|
return t;
|
|
257
257
|
}, Ye.apply(this, arguments);
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function Ei(t, e) {
|
|
260
260
|
if (t == null) return {};
|
|
261
261
|
var n, o, c = {}, s = Object.keys(t);
|
|
262
262
|
for (o = 0; o < s.length; o++) e.indexOf(n = s[o]) >= 0 || (c[n] = t[n]);
|
|
263
263
|
return c;
|
|
264
264
|
}
|
|
265
|
-
var
|
|
266
|
-
function
|
|
265
|
+
var nn = ["context", "children"], rn = ["useFragment"];
|
|
266
|
+
function on(t, e, n, o) {
|
|
267
267
|
function c() {
|
|
268
268
|
var s, u = Reflect.construct(HTMLElement, [], c);
|
|
269
269
|
return u._vdomComponent = t, o && o.shadow ? (u._root = u.attachShadow({ mode: o.mode || "open", serializable: (s = o.serializable) != null && s }), o.adoptedStyleSheets && (u._root.adoptedStyleSheets = o.adoptedStyleSheets)) : u._root = u, u;
|
|
270
270
|
}
|
|
271
271
|
return (c.prototype = Object.create(HTMLElement.prototype)).constructor = c, c.prototype.connectedCallback = function() {
|
|
272
|
-
|
|
273
|
-
}, c.prototype.attributeChangedCallback =
|
|
272
|
+
an.call(this, o);
|
|
273
|
+
}, c.prototype.attributeChangedCallback = ln, c.prototype.disconnectedCallback = cn, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), c.observedAttributes = n, t.formAssociated && (c.formAssociated = !0), n.forEach(function(s) {
|
|
274
274
|
Object.defineProperty(c.prototype, s, { get: function() {
|
|
275
275
|
return this._vdom ? this._vdom.props[s] : this._props[s];
|
|
276
276
|
}, set: function(u) {
|
|
@@ -280,123 +280,123 @@ function rn(t, e, n, o) {
|
|
|
280
280
|
} });
|
|
281
281
|
}), customElements.define(e || t.tagName || t.displayName || t.name, c), c;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function sn(t) {
|
|
284
284
|
this.getChildContext = function() {
|
|
285
285
|
return t.context;
|
|
286
286
|
};
|
|
287
|
-
var e = t.children, n =
|
|
288
|
-
return
|
|
287
|
+
var e = t.children, n = Ei(t, nn);
|
|
288
|
+
return _i(e, n);
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function an(t) {
|
|
291
291
|
var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
|
|
292
|
-
this.dispatchEvent(e), this._vdom = we(
|
|
292
|
+
this.dispatchEvent(e), this._vdom = we(sn, Ye({}, this._props, { context: e.detail.context }), gi(this, this._vdomComponent, t)), (this.hasAttribute("hydrate") ? pi : Qe)(this._vdom, this._root);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function mi(t) {
|
|
295
295
|
return t.replace(/-(\w)/g, function(e, n) {
|
|
296
296
|
return n ? n.toUpperCase() : "";
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function ln(t, e, n) {
|
|
300
300
|
if (this._vdom) {
|
|
301
301
|
var o = {};
|
|
302
|
-
o[t] = n = n ?? void 0, o[
|
|
302
|
+
o[t] = n = n ?? void 0, o[mi(t)] = n, this._vdom = _i(this._vdom, o), Qe(this._vdom, this._root);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function cn() {
|
|
306
306
|
Qe(this._vdom = null, this._root);
|
|
307
307
|
}
|
|
308
308
|
function Pt(t, e) {
|
|
309
|
-
var n = this, o = t.useFragment, c =
|
|
309
|
+
var n = this, o = t.useFragment, c = Ei(t, rn);
|
|
310
310
|
return we(o ? pe : "slot", Ye({}, c, { ref: function(s) {
|
|
311
311
|
s ? (n.ref = s, n._listener || (n._listener = function(u) {
|
|
312
312
|
u.stopPropagation(), u.detail.context = e;
|
|
313
313
|
}, s.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
|
|
314
314
|
} }));
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function gi(t, e, n) {
|
|
317
317
|
if (t.nodeType === 3) return t.data;
|
|
318
318
|
if (t.nodeType !== 1) return null;
|
|
319
319
|
var o = [], c = {}, s = 0, u = t.attributes, l = t.childNodes;
|
|
320
|
-
for (s = u.length; s--; ) u[s].name !== "slot" && (c[u[s].name] = u[s].value, c[
|
|
320
|
+
for (s = u.length; s--; ) u[s].name !== "slot" && (c[u[s].name] = u[s].value, c[mi(u[s].name)] = u[s].value);
|
|
321
321
|
for (s = l.length; s--; ) {
|
|
322
|
-
var E =
|
|
323
|
-
|
|
322
|
+
var E = gi(l[s], null, n), _ = l[s].slot;
|
|
323
|
+
_ ? c[_] = we(Pt, { name: _ }, E) : o[s] = E;
|
|
324
324
|
}
|
|
325
|
-
var
|
|
326
|
-
return !
|
|
325
|
+
var p = !(!n || !n.shadow), d = e ? we(Pt, { useFragment: !p }, o) : o;
|
|
326
|
+
return !p && e && (t.innerHTML = ""), we(e || t.nodeName.toLowerCase(), c, d);
|
|
327
327
|
}
|
|
328
|
-
var
|
|
328
|
+
var un = 0;
|
|
329
329
|
function w(t, e, n, o, c, s) {
|
|
330
330
|
e || (e = {});
|
|
331
331
|
var u, l, E = e;
|
|
332
332
|
if ("ref" in E) for (l in E = {}, e) l == "ref" ? u = e[l] : E[l] = e[l];
|
|
333
|
-
var
|
|
333
|
+
var _ = { type: t, props: E, key: n, ref: u, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --un, __i: -1, __u: 0, __source: c, __self: s };
|
|
334
334
|
if (typeof t == "function" && (u = t.defaultProps)) for (l in u) E[l] === void 0 && (E[l] = u[l]);
|
|
335
|
-
return D.vnode && D.vnode(
|
|
335
|
+
return D.vnode && D.vnode(_), _;
|
|
336
336
|
}
|
|
337
|
-
var
|
|
337
|
+
var Ue, P, rt, Ft, Me = 0, vi = [], F = D, $t = F.__b, Vt = F.__r, Gt = F.diffed, jt = F.__c, Ht = F.unmount, Wt = F.__;
|
|
338
338
|
function St(t, e) {
|
|
339
|
-
F.__h && F.__h(P, t,
|
|
339
|
+
F.__h && F.__h(P, t, Me || e), Me = 0;
|
|
340
340
|
var n = P.__H || (P.__H = { __: [], __h: [] });
|
|
341
341
|
return t >= n.__.length && n.__.push({}), n.__[t];
|
|
342
342
|
}
|
|
343
343
|
function je(t) {
|
|
344
|
-
return
|
|
344
|
+
return Me = 1, dn(Si, t);
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
var o = St(
|
|
348
|
-
if (o.t = t, !o.__c && (o.__ = [
|
|
349
|
-
var E = o.__N ? o.__N[0] : o.__[0],
|
|
350
|
-
E !==
|
|
346
|
+
function dn(t, e, n) {
|
|
347
|
+
var o = St(Ue++, 2);
|
|
348
|
+
if (o.t = t, !o.__c && (o.__ = [Si(void 0, e), function(l) {
|
|
349
|
+
var E = o.__N ? o.__N[0] : o.__[0], _ = o.t(E, l);
|
|
350
|
+
E !== _ && (o.__N = [_, o.__[1]], o.__c.setState({}));
|
|
351
351
|
}], o.__c = P, !P.__f)) {
|
|
352
|
-
var c = function(l, E,
|
|
352
|
+
var c = function(l, E, _) {
|
|
353
353
|
if (!o.__c.__H) return !0;
|
|
354
|
-
var
|
|
354
|
+
var p = o.__c.__H.__.filter(function(y) {
|
|
355
355
|
return !!y.__c;
|
|
356
356
|
});
|
|
357
|
-
if (
|
|
357
|
+
if (p.every(function(y) {
|
|
358
358
|
return !y.__N;
|
|
359
|
-
})) return !s || s.call(this, l, E,
|
|
359
|
+
})) return !s || s.call(this, l, E, _);
|
|
360
360
|
var d = o.__c.props !== l;
|
|
361
|
-
return
|
|
361
|
+
return p.forEach(function(y) {
|
|
362
362
|
if (y.__N) {
|
|
363
363
|
var g = y.__[0];
|
|
364
364
|
y.__ = y.__N, y.__N = void 0, g !== y.__[0] && (d = !0);
|
|
365
365
|
}
|
|
366
|
-
}), s && s.call(this, l, E,
|
|
366
|
+
}), s && s.call(this, l, E, _) || d;
|
|
367
367
|
};
|
|
368
368
|
P.__f = !0;
|
|
369
369
|
var s = P.shouldComponentUpdate, u = P.componentWillUpdate;
|
|
370
|
-
P.componentWillUpdate = function(l, E,
|
|
370
|
+
P.componentWillUpdate = function(l, E, _) {
|
|
371
371
|
if (this.__e) {
|
|
372
|
-
var
|
|
373
|
-
s = void 0, c(l, E,
|
|
372
|
+
var p = s;
|
|
373
|
+
s = void 0, c(l, E, _), s = p;
|
|
374
374
|
}
|
|
375
|
-
u && u.call(this, l, E,
|
|
375
|
+
u && u.call(this, l, E, _);
|
|
376
376
|
}, P.shouldComponentUpdate = c;
|
|
377
377
|
}
|
|
378
378
|
return o.__N || o.__;
|
|
379
379
|
}
|
|
380
380
|
function He(t, e) {
|
|
381
|
-
var n = St(
|
|
382
|
-
!F.__s &&
|
|
381
|
+
var n = St(Ue++, 3);
|
|
382
|
+
!F.__s && yi(n.__H, e) && (n.__ = t, n.u = e, P.__H.__h.push(n));
|
|
383
383
|
}
|
|
384
384
|
function Le(t) {
|
|
385
|
-
return
|
|
385
|
+
return Me = 5, Ie(function() {
|
|
386
386
|
return { current: t };
|
|
387
387
|
}, []);
|
|
388
388
|
}
|
|
389
389
|
function Ie(t, e) {
|
|
390
|
-
var n = St(
|
|
391
|
-
return
|
|
390
|
+
var n = St(Ue++, 7);
|
|
391
|
+
return yi(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
|
|
392
392
|
}
|
|
393
393
|
function We(t, e) {
|
|
394
|
-
return
|
|
394
|
+
return Me = 8, Ie(function() {
|
|
395
395
|
return t;
|
|
396
396
|
}, e);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
for (var t; t =
|
|
398
|
+
function hn() {
|
|
399
|
+
for (var t; t = vi.shift(); ) if (t.__P && t.__H) try {
|
|
400
400
|
t.__H.__h.forEach(ze), t.__H.__h.forEach(ht), t.__H.__h = [];
|
|
401
401
|
} catch (e) {
|
|
402
402
|
t.__H.__h = [], F.__e(e, t.__v);
|
|
@@ -407,15 +407,15 @@ F.__b = function(t) {
|
|
|
407
407
|
}, F.__ = function(t, e) {
|
|
408
408
|
t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Wt && Wt(t, e);
|
|
409
409
|
}, F.__r = function(t) {
|
|
410
|
-
Vt && Vt(t),
|
|
410
|
+
Vt && Vt(t), Ue = 0;
|
|
411
411
|
var e = (P = t.__c).__H;
|
|
412
412
|
e && (rt === P ? (e.__h = [], P.__h = [], e.__.forEach(function(n) {
|
|
413
413
|
n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
|
|
414
|
-
})) : (e.__h.forEach(ze), e.__h.forEach(ht), e.__h = [],
|
|
414
|
+
})) : (e.__h.forEach(ze), e.__h.forEach(ht), e.__h = [], Ue = 0)), rt = P;
|
|
415
415
|
}, F.diffed = function(t) {
|
|
416
416
|
Gt && Gt(t);
|
|
417
417
|
var e = t.__c;
|
|
418
|
-
e && e.__H && (e.__H.__h.length && (
|
|
418
|
+
e && e.__H && (e.__H.__h.length && (vi.push(e) !== 1 && Ft === F.requestAnimationFrame || ((Ft = F.requestAnimationFrame) || fn)(hn)), e.__H.__.forEach(function(n) {
|
|
419
419
|
n.u && (n.__H = n.u), n.u = void 0;
|
|
420
420
|
})), rt = P = null;
|
|
421
421
|
}, F.__c = function(t, e) {
|
|
@@ -442,7 +442,7 @@ F.__b = function(t) {
|
|
|
442
442
|
}), n.__H = void 0, e && F.__e(e, n.__v));
|
|
443
443
|
};
|
|
444
444
|
var zt = typeof requestAnimationFrame == "function";
|
|
445
|
-
function
|
|
445
|
+
function fn(t) {
|
|
446
446
|
var e, n = function() {
|
|
447
447
|
clearTimeout(o), zt && cancelAnimationFrame(e), setTimeout(t);
|
|
448
448
|
}, o = setTimeout(n, 35);
|
|
@@ -456,15 +456,15 @@ function ht(t) {
|
|
|
456
456
|
var e = P;
|
|
457
457
|
t.__c = t.__(), P = e;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function yi(t, e) {
|
|
460
460
|
return !t || t.length !== e.length || e.some(function(n, o) {
|
|
461
461
|
return n !== t[o];
|
|
462
462
|
});
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function Si(t, e) {
|
|
465
465
|
return typeof e == "function" ? e(t) : e;
|
|
466
466
|
}
|
|
467
|
-
var
|
|
467
|
+
var pn = /* @__PURE__ */ Symbol.for("preact-signals");
|
|
468
468
|
function et() {
|
|
469
469
|
if (he > 1)
|
|
470
470
|
he--;
|
|
@@ -473,7 +473,7 @@ function et() {
|
|
|
473
473
|
var n = Oe;
|
|
474
474
|
for (Oe = void 0, ft++; n !== void 0; ) {
|
|
475
475
|
var o = n.o;
|
|
476
|
-
if (n.o = void 0, n.f &= -3, !(8 & n.f) &&
|
|
476
|
+
if (n.o = void 0, n.f &= -3, !(8 & n.f) && Ii(n)) try {
|
|
477
477
|
n.c();
|
|
478
478
|
} catch (c) {
|
|
479
479
|
e || (t = c, e = !0);
|
|
@@ -484,7 +484,7 @@ function et() {
|
|
|
484
484
|
if (ft = 0, he--, e) throw t;
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function _n(t) {
|
|
488
488
|
if (he > 0) return t();
|
|
489
489
|
he++;
|
|
490
490
|
try {
|
|
@@ -494,7 +494,7 @@ function pn(t) {
|
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
var k = void 0;
|
|
497
|
-
function
|
|
497
|
+
function wi(t) {
|
|
498
498
|
var e = k;
|
|
499
499
|
k = void 0;
|
|
500
500
|
try {
|
|
@@ -504,7 +504,7 @@ function Si(t) {
|
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
var Oe = void 0, he = 0, ft = 0, Ke = 0;
|
|
507
|
-
function
|
|
507
|
+
function Ci(t) {
|
|
508
508
|
if (k !== void 0) {
|
|
509
509
|
var e = t.n;
|
|
510
510
|
if (e === void 0 || e.t !== k)
|
|
@@ -516,13 +516,13 @@ function wi(t) {
|
|
|
516
516
|
function H(t, e) {
|
|
517
517
|
this.v = t, this.i = 0, this.n = void 0, this.t = void 0, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
|
|
518
518
|
}
|
|
519
|
-
H.prototype.brand =
|
|
519
|
+
H.prototype.brand = pn;
|
|
520
520
|
H.prototype.h = function() {
|
|
521
521
|
return !0;
|
|
522
522
|
};
|
|
523
523
|
H.prototype.S = function(t) {
|
|
524
524
|
var e = this, n = this.t;
|
|
525
|
-
n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t :
|
|
525
|
+
n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t : wi(function() {
|
|
526
526
|
var o;
|
|
527
527
|
(o = e.W) == null || o.call(e);
|
|
528
528
|
}));
|
|
@@ -531,7 +531,7 @@ H.prototype.U = function(t) {
|
|
|
531
531
|
var e = this;
|
|
532
532
|
if (this.t !== void 0) {
|
|
533
533
|
var n = t.e, o = t.x;
|
|
534
|
-
n !== void 0 && (n.x = o, t.e = void 0), o !== void 0 && (o.e = n, t.x = void 0), t === this.t && (this.t = o, o === void 0 &&
|
|
534
|
+
n !== void 0 && (n.x = o, t.e = void 0), o !== void 0 && (o.e = n, t.x = void 0), t === this.t && (this.t = o, o === void 0 && wi(function() {
|
|
535
535
|
var c;
|
|
536
536
|
(c = e.Z) == null || c.call(e);
|
|
537
537
|
}));
|
|
@@ -568,7 +568,7 @@ H.prototype.peek = function() {
|
|
|
568
568
|
}
|
|
569
569
|
};
|
|
570
570
|
Object.defineProperty(H.prototype, "value", { get: function() {
|
|
571
|
-
var t =
|
|
571
|
+
var t = Ci(this);
|
|
572
572
|
return t !== void 0 && (t.i = this.i), this.v;
|
|
573
573
|
}, set: function(t) {
|
|
574
574
|
if (t !== this.v) {
|
|
@@ -584,11 +584,11 @@ Object.defineProperty(H.prototype, "value", { get: function() {
|
|
|
584
584
|
function z(t, e) {
|
|
585
585
|
return new H(t, e);
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Ii(t) {
|
|
588
588
|
for (var e = t.s; e !== void 0; e = e.n) if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i) return !0;
|
|
589
589
|
return !1;
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function bi(t) {
|
|
592
592
|
for (var e = t.s; e !== void 0; e = e.n) {
|
|
593
593
|
var n = e.S.n;
|
|
594
594
|
if (n !== void 0 && (e.r = n), e.S.n = e, e.i = -1, e.n === void 0) {
|
|
@@ -597,7 +597,7 @@ function Ii(t) {
|
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function Ai(t) {
|
|
601
601
|
for (var e = t.s, n = void 0; e !== void 0; ) {
|
|
602
602
|
var o = e.p;
|
|
603
603
|
e.i === -1 ? (e.S.U(e), o !== void 0 && (o.n = e.n), e.n !== void 0 && (e.n.p = o)) : n = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = o;
|
|
@@ -611,17 +611,17 @@ me.prototype = new H();
|
|
|
611
611
|
me.prototype.h = function() {
|
|
612
612
|
if (this.f &= -3, 1 & this.f) return !1;
|
|
613
613
|
if ((36 & this.f) == 32 || (this.f &= -5, this.g === Ke)) return !0;
|
|
614
|
-
if (this.g = Ke, this.f |= 1, this.i > 0 && !
|
|
614
|
+
if (this.g = Ke, this.f |= 1, this.i > 0 && !Ii(this))
|
|
615
615
|
return this.f &= -2, !0;
|
|
616
616
|
var t = k;
|
|
617
617
|
try {
|
|
618
|
-
|
|
618
|
+
bi(this), k = this;
|
|
619
619
|
var e = this.x();
|
|
620
620
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
621
621
|
} catch (n) {
|
|
622
622
|
this.v = n, this.f |= 16, this.i++;
|
|
623
623
|
}
|
|
624
|
-
return k = t,
|
|
624
|
+
return k = t, Ai(this), this.f &= -2, !0;
|
|
625
625
|
};
|
|
626
626
|
me.prototype.S = function(t) {
|
|
627
627
|
if (this.t === void 0) {
|
|
@@ -644,14 +644,14 @@ me.prototype.N = function() {
|
|
|
644
644
|
};
|
|
645
645
|
Object.defineProperty(me.prototype, "value", { get: function() {
|
|
646
646
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
647
|
-
var t =
|
|
647
|
+
var t = Ci(this);
|
|
648
648
|
if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v;
|
|
649
649
|
return this.v;
|
|
650
650
|
} });
|
|
651
651
|
function qt(t, e) {
|
|
652
652
|
return new me(t, e);
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function Ti(t) {
|
|
655
655
|
var e = t.u;
|
|
656
656
|
if (t.u = void 0, typeof e == "function") {
|
|
657
657
|
he++;
|
|
@@ -668,11 +668,11 @@ function Ai(t) {
|
|
|
668
668
|
}
|
|
669
669
|
function wt(t) {
|
|
670
670
|
for (var e = t.s; e !== void 0; e = e.n) e.S.U(e);
|
|
671
|
-
t.x = void 0, t.s = void 0,
|
|
671
|
+
t.x = void 0, t.s = void 0, Ti(t);
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function En(t) {
|
|
674
674
|
if (k !== this) throw new Error("Out-of-order effect");
|
|
675
|
-
|
|
675
|
+
Ai(this), k = t, this.f &= -2, 8 & this.f && wt(this), et();
|
|
676
676
|
}
|
|
677
677
|
function Ae(t, e) {
|
|
678
678
|
this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = e?.name;
|
|
@@ -689,9 +689,9 @@ Ae.prototype.c = function() {
|
|
|
689
689
|
};
|
|
690
690
|
Ae.prototype.S = function() {
|
|
691
691
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
692
|
-
this.f |= 1, this.f &= -9,
|
|
692
|
+
this.f |= 1, this.f &= -9, Ti(this), bi(this), he++;
|
|
693
693
|
var t = k;
|
|
694
|
-
return k = this,
|
|
694
|
+
return k = this, En.bind(this, t);
|
|
695
695
|
};
|
|
696
696
|
Ae.prototype.N = function() {
|
|
697
697
|
2 & this.f || (this.f |= 2, this.o = Oe, Oe = this);
|
|
@@ -712,9 +712,9 @@ function Pe(t, e) {
|
|
|
712
712
|
var o = n.d.bind(n);
|
|
713
713
|
return o[Symbol.dispose] = o, o;
|
|
714
714
|
}
|
|
715
|
-
var
|
|
715
|
+
var Ri, ot, mn = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Ni = [];
|
|
716
716
|
Pe(function() {
|
|
717
|
-
|
|
717
|
+
Ri = this.N;
|
|
718
718
|
})();
|
|
719
719
|
function Te(t, e) {
|
|
720
720
|
D[t] = e.bind(null, D[t] || function() {
|
|
@@ -723,33 +723,33 @@ function Te(t, e) {
|
|
|
723
723
|
function Je(t) {
|
|
724
724
|
ot && ot(), ot = t && t.S();
|
|
725
725
|
}
|
|
726
|
-
function
|
|
727
|
-
var e = this, n = t.data, o =
|
|
726
|
+
function xi(t) {
|
|
727
|
+
var e = this, n = t.data, o = Oi(n);
|
|
728
728
|
o.value = n;
|
|
729
729
|
var c = Ie(function() {
|
|
730
730
|
for (var l = e, E = e.__v; E = E.__; ) if (E.__c) {
|
|
731
731
|
E.__c.__$f |= 4;
|
|
732
732
|
break;
|
|
733
733
|
}
|
|
734
|
-
var
|
|
734
|
+
var _ = qt(function() {
|
|
735
735
|
var g = o.value.value;
|
|
736
736
|
return g === 0 ? 0 : g === !0 ? "" : g || "";
|
|
737
|
-
}),
|
|
738
|
-
return !Array.isArray(
|
|
737
|
+
}), p = qt(function() {
|
|
738
|
+
return !Array.isArray(_.value) && !ni(_.value);
|
|
739
739
|
}), d = Pe(function() {
|
|
740
|
-
if (this.N =
|
|
741
|
-
var g =
|
|
740
|
+
if (this.N = ki, p.value) {
|
|
741
|
+
var g = _.value;
|
|
742
742
|
l.__v && l.__v.__e && l.__v.__e.nodeType === 3 && (l.__v.__e.data = g);
|
|
743
743
|
}
|
|
744
744
|
}), y = e.__$u.d;
|
|
745
745
|
return e.__$u.d = function() {
|
|
746
746
|
d(), y.call(this);
|
|
747
|
-
}, [
|
|
747
|
+
}, [p, _];
|
|
748
748
|
}, []), s = c[0], u = c[1];
|
|
749
749
|
return s.value ? u.peek() : u.value;
|
|
750
750
|
}
|
|
751
|
-
|
|
752
|
-
Object.defineProperties(H.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value:
|
|
751
|
+
xi.displayName = "ReactiveTextNode";
|
|
752
|
+
Object.defineProperties(H.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: xi }, props: { configurable: !0, get: function() {
|
|
753
753
|
return { data: this };
|
|
754
754
|
} }, __b: { configurable: !0, value: 1 } });
|
|
755
755
|
Te("__b", function(t, e) {
|
|
@@ -773,7 +773,7 @@ Te("__r", function(t, e) {
|
|
|
773
773
|
}, { name: s }), u.c = c, u;
|
|
774
774
|
})(function() {
|
|
775
775
|
var c;
|
|
776
|
-
|
|
776
|
+
mn && ((c = n.y) == null || c.call(n)), o.__$f |= 1, o.setState({});
|
|
777
777
|
}, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), Je(n);
|
|
778
778
|
}
|
|
779
779
|
t(e);
|
|
@@ -795,19 +795,19 @@ Te("diffed", function(t, e) {
|
|
|
795
795
|
else
|
|
796
796
|
s = {}, n.U = s;
|
|
797
797
|
for (var E in o) {
|
|
798
|
-
var
|
|
799
|
-
|
|
798
|
+
var _ = s[E], p = o[E];
|
|
799
|
+
_ === void 0 ? (_ = gn(n, E, p, c), s[E] = _) : _.o(p, c);
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
t(e);
|
|
804
804
|
});
|
|
805
|
-
function
|
|
805
|
+
function gn(t, e, n, o) {
|
|
806
806
|
var c = e in t && t.ownerSVGElement === void 0, s = z(n);
|
|
807
807
|
return { o: function(u, l) {
|
|
808
808
|
s.value = u, o = l;
|
|
809
809
|
}, d: Pe(function() {
|
|
810
|
-
this.N =
|
|
810
|
+
this.N = ki;
|
|
811
811
|
var u = s.value.value;
|
|
812
812
|
o[e] !== u && (o[e] = u, c ? t[e] = u : u != null && (u !== !1 || e[4] === "-") ? t.setAttribute(e, u) : t.removeAttribute(e));
|
|
813
813
|
}) };
|
|
@@ -849,23 +849,23 @@ Ce.prototype.shouldComponentUpdate = function(t, e) {
|
|
|
849
849
|
for (var l in this.props) if (!(l in t)) return !0;
|
|
850
850
|
return !1;
|
|
851
851
|
};
|
|
852
|
-
function
|
|
852
|
+
function Oi(t, e) {
|
|
853
853
|
return je(function() {
|
|
854
854
|
return z(t, e);
|
|
855
855
|
})[0];
|
|
856
856
|
}
|
|
857
|
-
var
|
|
857
|
+
var vn = function(t) {
|
|
858
858
|
queueMicrotask(function() {
|
|
859
859
|
queueMicrotask(t);
|
|
860
860
|
});
|
|
861
861
|
};
|
|
862
|
-
function
|
|
863
|
-
|
|
864
|
-
for (var t; t =
|
|
862
|
+
function yn() {
|
|
863
|
+
_n(function() {
|
|
864
|
+
for (var t; t = Ni.shift(); ) Ri.call(t);
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
|
-
function
|
|
868
|
-
|
|
867
|
+
function ki() {
|
|
868
|
+
Ni.push(this) === 1 && (D.requestAnimationFrame || vn)(yn);
|
|
869
869
|
}
|
|
870
870
|
const Yt = {
|
|
871
871
|
layout: "floating",
|
|
@@ -881,7 +881,7 @@ const Yt = {
|
|
|
881
881
|
"bottom-left": { bottom: "24px", left: "24px" },
|
|
882
882
|
"top-right": { top: "24px", right: "24px" },
|
|
883
883
|
"top-left": { top: "24px", left: "24px" }
|
|
884
|
-
},
|
|
884
|
+
}, Sn = /* @__PURE__ */ new Set([
|
|
885
885
|
"top",
|
|
886
886
|
"right",
|
|
887
887
|
"bottom",
|
|
@@ -892,7 +892,7 @@ const Yt = {
|
|
|
892
892
|
"margin-bottom",
|
|
893
893
|
"margin-left"
|
|
894
894
|
]);
|
|
895
|
-
function
|
|
895
|
+
function wn(t) {
|
|
896
896
|
if (Ve[t])
|
|
897
897
|
return Ve[t];
|
|
898
898
|
const e = t.match(/^\[(.+)\]$/);
|
|
@@ -902,16 +902,16 @@ function Sn(t) {
|
|
|
902
902
|
const c = o.trim(), s = c.lastIndexOf("-");
|
|
903
903
|
if (s <= 0) continue;
|
|
904
904
|
const u = c.slice(0, s);
|
|
905
|
-
if (!
|
|
905
|
+
if (!Sn.has(u)) continue;
|
|
906
906
|
const l = c.slice(s + 1);
|
|
907
907
|
/^[\w.%-]+$/.test(l) && (n[u] = /^\d+$/.test(l) ? `${l}px` : l);
|
|
908
908
|
}
|
|
909
909
|
return Object.keys(n).length > 0 ? n : Ve["bottom-right"];
|
|
910
910
|
}
|
|
911
911
|
var st = {}, Ne = {}, Kt;
|
|
912
|
-
function
|
|
912
|
+
function Cn() {
|
|
913
913
|
if (Kt) return Ne;
|
|
914
|
-
Kt = 1, Ne.byteLength = l, Ne.toByteArray =
|
|
914
|
+
Kt = 1, Ne.byteLength = l, Ne.toByteArray = _, Ne.fromByteArray = y;
|
|
915
915
|
for (var t = [], e = [], n = typeof Uint8Array < "u" ? Uint8Array : Array, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = 0, s = o.length; c < s; ++c)
|
|
916
916
|
t[c] = o[c], e[o.charCodeAt(c)] = c;
|
|
917
917
|
e[45] = 62, e[95] = 63;
|
|
@@ -931,18 +931,18 @@ function wn() {
|
|
|
931
931
|
function E(g, S, C) {
|
|
932
932
|
return (S + C) * 3 / 4 - C;
|
|
933
933
|
}
|
|
934
|
-
function
|
|
934
|
+
function _(g) {
|
|
935
935
|
var S, C = u(g), A = C[0], I = C[1], b = new n(E(g, A, I)), T = 0, O = I > 0 ? A - 4 : A, N;
|
|
936
936
|
for (N = 0; N < O; N += 4)
|
|
937
937
|
S = e[g.charCodeAt(N)] << 18 | e[g.charCodeAt(N + 1)] << 12 | e[g.charCodeAt(N + 2)] << 6 | e[g.charCodeAt(N + 3)], b[T++] = S >> 16 & 255, b[T++] = S >> 8 & 255, b[T++] = S & 255;
|
|
938
938
|
return I === 2 && (S = e[g.charCodeAt(N)] << 2 | e[g.charCodeAt(N + 1)] >> 4, b[T++] = S & 255), I === 1 && (S = e[g.charCodeAt(N)] << 10 | e[g.charCodeAt(N + 1)] << 4 | e[g.charCodeAt(N + 2)] >> 2, b[T++] = S >> 8 & 255, b[T++] = S & 255), b;
|
|
939
939
|
}
|
|
940
|
-
function
|
|
940
|
+
function p(g) {
|
|
941
941
|
return t[g >> 18 & 63] + t[g >> 12 & 63] + t[g >> 6 & 63] + t[g & 63];
|
|
942
942
|
}
|
|
943
943
|
function d(g, S, C) {
|
|
944
944
|
for (var A, I = [], b = S; b < C; b += 3)
|
|
945
|
-
A = (g[b] << 16 & 16711680) + (g[b + 1] << 8 & 65280) + (g[b + 2] & 255), I.push(
|
|
945
|
+
A = (g[b] << 16 & 16711680) + (g[b + 1] << 8 & 65280) + (g[b + 2] & 255), I.push(p(A));
|
|
946
946
|
return I.join("");
|
|
947
947
|
}
|
|
948
948
|
function y(g) {
|
|
@@ -958,34 +958,34 @@ function wn() {
|
|
|
958
958
|
}
|
|
959
959
|
var Ge = {};
|
|
960
960
|
var Jt;
|
|
961
|
-
function
|
|
961
|
+
function In() {
|
|
962
962
|
return Jt || (Jt = 1, Ge.read = function(t, e, n, o, c) {
|
|
963
|
-
var s, u, l = c * 8 - o - 1, E = (1 << l) - 1,
|
|
964
|
-
for (d += y, s = g & (1 << -
|
|
963
|
+
var s, u, l = c * 8 - o - 1, E = (1 << l) - 1, _ = E >> 1, p = -7, d = n ? c - 1 : 0, y = n ? -1 : 1, g = t[e + d];
|
|
964
|
+
for (d += y, s = g & (1 << -p) - 1, g >>= -p, p += l; p > 0; s = s * 256 + t[e + d], d += y, p -= 8)
|
|
965
965
|
;
|
|
966
|
-
for (u = s & (1 << -
|
|
966
|
+
for (u = s & (1 << -p) - 1, s >>= -p, p += o; p > 0; u = u * 256 + t[e + d], d += y, p -= 8)
|
|
967
967
|
;
|
|
968
968
|
if (s === 0)
|
|
969
|
-
s = 1 -
|
|
969
|
+
s = 1 - _;
|
|
970
970
|
else {
|
|
971
971
|
if (s === E)
|
|
972
972
|
return u ? NaN : (g ? -1 : 1) * (1 / 0);
|
|
973
|
-
u = u + Math.pow(2, o), s = s -
|
|
973
|
+
u = u + Math.pow(2, o), s = s - _;
|
|
974
974
|
}
|
|
975
975
|
return (g ? -1 : 1) * u * Math.pow(2, s - o);
|
|
976
976
|
}, Ge.write = function(t, e, n, o, c, s) {
|
|
977
|
-
var u, l, E,
|
|
978
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (l = isNaN(e) ? 1 : 0, u =
|
|
977
|
+
var u, l, E, _ = s * 8 - c - 1, p = (1 << _) - 1, d = p >> 1, y = c === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = o ? 0 : s - 1, S = o ? 1 : -1, C = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
978
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (l = isNaN(e) ? 1 : 0, u = p) : (u = Math.floor(Math.log(e) / Math.LN2), e * (E = Math.pow(2, -u)) < 1 && (u--, E *= 2), u + d >= 1 ? e += y / E : e += y * Math.pow(2, 1 - d), e * E >= 2 && (u++, E /= 2), u + d >= p ? (l = 0, u = p) : u + d >= 1 ? (l = (e * E - 1) * Math.pow(2, c), u = u + d) : (l = e * Math.pow(2, d - 1) * Math.pow(2, c), u = 0)); c >= 8; t[n + g] = l & 255, g += S, l /= 256, c -= 8)
|
|
979
979
|
;
|
|
980
|
-
for (u = u << c | l,
|
|
980
|
+
for (u = u << c | l, _ += c; _ > 0; t[n + g] = u & 255, g += S, u /= 256, _ -= 8)
|
|
981
981
|
;
|
|
982
982
|
t[n + g - S] |= C * 128;
|
|
983
983
|
}), Ge;
|
|
984
984
|
}
|
|
985
985
|
var Xt;
|
|
986
|
-
function
|
|
986
|
+
function bn() {
|
|
987
987
|
return Xt || (Xt = 1, (function(t) {
|
|
988
|
-
const e =
|
|
988
|
+
const e = Cn(), n = In(), o = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
|
|
989
989
|
t.Buffer = l, t.SlowBuffer = b, t.INSPECT_MAX_BYTES = 50;
|
|
990
990
|
const c = 2147483647;
|
|
991
991
|
t.kMaxLength = c, l.TYPED_ARRAY_SUPPORT = s(), !l.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
@@ -1060,20 +1060,20 @@ function In() {
|
|
|
1060
1060
|
l.from = function(a, i, r) {
|
|
1061
1061
|
return E(a, i, r);
|
|
1062
1062
|
}, Object.setPrototypeOf(l.prototype, Uint8Array.prototype), Object.setPrototypeOf(l, Uint8Array);
|
|
1063
|
-
function
|
|
1063
|
+
function _(a) {
|
|
1064
1064
|
if (typeof a != "number")
|
|
1065
1065
|
throw new TypeError('"size" argument must be of type number');
|
|
1066
1066
|
if (a < 0)
|
|
1067
1067
|
throw new RangeError('The value "' + a + '" is invalid for option "size"');
|
|
1068
1068
|
}
|
|
1069
|
-
function
|
|
1070
|
-
return
|
|
1069
|
+
function p(a, i, r) {
|
|
1070
|
+
return _(a), a <= 0 ? u(a) : i !== void 0 ? typeof r == "string" ? u(a).fill(i, r) : u(a).fill(i) : u(a);
|
|
1071
1071
|
}
|
|
1072
1072
|
l.alloc = function(a, i, r) {
|
|
1073
|
-
return
|
|
1073
|
+
return p(a, i, r);
|
|
1074
1074
|
};
|
|
1075
1075
|
function d(a) {
|
|
1076
|
-
return
|
|
1076
|
+
return _(a), u(a < 0 ? 0 : I(a) | 0);
|
|
1077
1077
|
}
|
|
1078
1078
|
l.allocUnsafe = function(a) {
|
|
1079
1079
|
return d(a);
|
|
@@ -1230,22 +1230,22 @@ function In() {
|
|
|
1230
1230
|
for (a || (a = "utf8"); ; )
|
|
1231
1231
|
switch (a) {
|
|
1232
1232
|
case "hex":
|
|
1233
|
-
return
|
|
1233
|
+
return Gi(this, i, r);
|
|
1234
1234
|
case "utf8":
|
|
1235
1235
|
case "utf-8":
|
|
1236
1236
|
return It(this, i, r);
|
|
1237
1237
|
case "ascii":
|
|
1238
|
-
return
|
|
1238
|
+
return $i(this, i, r);
|
|
1239
1239
|
case "latin1":
|
|
1240
1240
|
case "binary":
|
|
1241
|
-
return
|
|
1241
|
+
return Vi(this, i, r);
|
|
1242
1242
|
case "base64":
|
|
1243
|
-
return
|
|
1243
|
+
return Pi(this, i, r);
|
|
1244
1244
|
case "ucs2":
|
|
1245
1245
|
case "ucs-2":
|
|
1246
1246
|
case "utf16le":
|
|
1247
1247
|
case "utf-16le":
|
|
1248
|
-
return
|
|
1248
|
+
return ji(this, i, r);
|
|
1249
1249
|
default:
|
|
1250
1250
|
if (h) throw new TypeError("Unknown encoding: " + a);
|
|
1251
1251
|
a = (a + "").toLowerCase(), h = !0;
|
|
@@ -1302,10 +1302,10 @@ function In() {
|
|
|
1302
1302
|
return 1;
|
|
1303
1303
|
if (r >>>= 0, h >>>= 0, f >>>= 0, m >>>= 0, this === i) return 0;
|
|
1304
1304
|
let v = m - f, R = h - r;
|
|
1305
|
-
const L = Math.min(v, R),
|
|
1306
|
-
for (let
|
|
1307
|
-
if (U
|
|
1308
|
-
v = U
|
|
1305
|
+
const L = Math.min(v, R), M = this.slice(f, m), B = i.slice(r, h);
|
|
1306
|
+
for (let U = 0; U < L; ++U)
|
|
1307
|
+
if (M[U] !== B[U]) {
|
|
1308
|
+
v = M[U], R = B[U];
|
|
1309
1309
|
break;
|
|
1310
1310
|
}
|
|
1311
1311
|
return v < R ? -1 : R < v ? 1 : 0;
|
|
@@ -1331,26 +1331,26 @@ function In() {
|
|
|
1331
1331
|
return -1;
|
|
1332
1332
|
m = 2, v /= 2, R /= 2, r /= 2;
|
|
1333
1333
|
}
|
|
1334
|
-
function L(B,
|
|
1335
|
-
return m === 1 ? B[
|
|
1334
|
+
function L(B, U) {
|
|
1335
|
+
return m === 1 ? B[U] : B.readUInt16BE(U * m);
|
|
1336
1336
|
}
|
|
1337
|
-
let
|
|
1337
|
+
let M;
|
|
1338
1338
|
if (f) {
|
|
1339
1339
|
let B = -1;
|
|
1340
|
-
for (
|
|
1341
|
-
if (L(a,
|
|
1342
|
-
if (B === -1 && (B =
|
|
1340
|
+
for (M = r; M < v; M++)
|
|
1341
|
+
if (L(a, M) === L(i, B === -1 ? 0 : M - B)) {
|
|
1342
|
+
if (B === -1 && (B = M), M - B + 1 === R) return B * m;
|
|
1343
1343
|
} else
|
|
1344
|
-
B !== -1 && (
|
|
1344
|
+
B !== -1 && (M -= M - B), B = -1;
|
|
1345
1345
|
} else
|
|
1346
|
-
for (r + R > v && (r = v - R),
|
|
1346
|
+
for (r + R > v && (r = v - R), M = r; M >= 0; M--) {
|
|
1347
1347
|
let B = !0;
|
|
1348
|
-
for (let
|
|
1349
|
-
if (L(a,
|
|
1348
|
+
for (let U = 0; U < R; U++)
|
|
1349
|
+
if (L(a, M + U) !== L(i, U)) {
|
|
1350
1350
|
B = !1;
|
|
1351
1351
|
break;
|
|
1352
1352
|
}
|
|
1353
|
-
if (B) return
|
|
1353
|
+
if (B) return M;
|
|
1354
1354
|
}
|
|
1355
1355
|
return -1;
|
|
1356
1356
|
}
|
|
@@ -1379,13 +1379,13 @@ function In() {
|
|
|
1379
1379
|
return Fe(it(i, a.length - r), a, r, h);
|
|
1380
1380
|
}
|
|
1381
1381
|
function re(a, i, r, h) {
|
|
1382
|
-
return Fe(
|
|
1382
|
+
return Fe(qi(i), a, r, h);
|
|
1383
1383
|
}
|
|
1384
1384
|
function Z(a, i, r, h) {
|
|
1385
1385
|
return Fe(Dt(i), a, r, h);
|
|
1386
1386
|
}
|
|
1387
1387
|
function se(a, i, r, h) {
|
|
1388
|
-
return Fe(
|
|
1388
|
+
return Fe(Yi(i, a.length - r), a, r, h);
|
|
1389
1389
|
}
|
|
1390
1390
|
l.prototype.write = function(i, r, h, f) {
|
|
1391
1391
|
if (r === void 0)
|
|
@@ -1431,7 +1431,7 @@ function In() {
|
|
|
1431
1431
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
1432
1432
|
};
|
|
1433
1433
|
};
|
|
1434
|
-
function
|
|
1434
|
+
function Pi(a, i, r) {
|
|
1435
1435
|
return i === 0 && r === a.length ? e.fromByteArray(a) : e.fromByteArray(a.slice(i, r));
|
|
1436
1436
|
}
|
|
1437
1437
|
function It(a, i, r) {
|
|
@@ -1442,27 +1442,27 @@ function In() {
|
|
|
1442
1442
|
const m = a[f];
|
|
1443
1443
|
let v = null, R = m > 239 ? 4 : m > 223 ? 3 : m > 191 ? 2 : 1;
|
|
1444
1444
|
if (f + R <= r) {
|
|
1445
|
-
let L,
|
|
1445
|
+
let L, M, B, U;
|
|
1446
1446
|
switch (R) {
|
|
1447
1447
|
case 1:
|
|
1448
1448
|
m < 128 && (v = m);
|
|
1449
1449
|
break;
|
|
1450
1450
|
case 2:
|
|
1451
|
-
L = a[f + 1], (L & 192) === 128 && (
|
|
1451
|
+
L = a[f + 1], (L & 192) === 128 && (U = (m & 31) << 6 | L & 63, U > 127 && (v = U));
|
|
1452
1452
|
break;
|
|
1453
1453
|
case 3:
|
|
1454
|
-
L = a[f + 1],
|
|
1454
|
+
L = a[f + 1], M = a[f + 2], (L & 192) === 128 && (M & 192) === 128 && (U = (m & 15) << 12 | (L & 63) << 6 | M & 63, U > 2047 && (U < 55296 || U > 57343) && (v = U));
|
|
1455
1455
|
break;
|
|
1456
1456
|
case 4:
|
|
1457
|
-
L = a[f + 1],
|
|
1457
|
+
L = a[f + 1], M = a[f + 2], B = a[f + 3], (L & 192) === 128 && (M & 192) === 128 && (B & 192) === 128 && (U = (m & 15) << 18 | (L & 63) << 12 | (M & 63) << 6 | B & 63, U > 65535 && U < 1114112 && (v = U));
|
|
1458
1458
|
}
|
|
1459
1459
|
}
|
|
1460
1460
|
v === null ? (v = 65533, R = 1) : v > 65535 && (v -= 65536, h.push(v >>> 10 & 1023 | 55296), v = 56320 | v & 1023), h.push(v), f += R;
|
|
1461
1461
|
}
|
|
1462
|
-
return
|
|
1462
|
+
return Fi(h);
|
|
1463
1463
|
}
|
|
1464
1464
|
const bt = 4096;
|
|
1465
|
-
function
|
|
1465
|
+
function Fi(a) {
|
|
1466
1466
|
const i = a.length;
|
|
1467
1467
|
if (i <= bt)
|
|
1468
1468
|
return String.fromCharCode.apply(String, a);
|
|
@@ -1474,29 +1474,29 @@ function In() {
|
|
|
1474
1474
|
);
|
|
1475
1475
|
return r;
|
|
1476
1476
|
}
|
|
1477
|
-
function
|
|
1477
|
+
function $i(a, i, r) {
|
|
1478
1478
|
let h = "";
|
|
1479
1479
|
r = Math.min(a.length, r);
|
|
1480
1480
|
for (let f = i; f < r; ++f)
|
|
1481
1481
|
h += String.fromCharCode(a[f] & 127);
|
|
1482
1482
|
return h;
|
|
1483
1483
|
}
|
|
1484
|
-
function
|
|
1484
|
+
function Vi(a, i, r) {
|
|
1485
1485
|
let h = "";
|
|
1486
1486
|
r = Math.min(a.length, r);
|
|
1487
1487
|
for (let f = i; f < r; ++f)
|
|
1488
1488
|
h += String.fromCharCode(a[f]);
|
|
1489
1489
|
return h;
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1491
|
+
function Gi(a, i, r) {
|
|
1492
1492
|
const h = a.length;
|
|
1493
1493
|
(!i || i < 0) && (i = 0), (!r || r < 0 || r > h) && (r = h);
|
|
1494
1494
|
let f = "";
|
|
1495
1495
|
for (let m = i; m < r; ++m)
|
|
1496
|
-
f +=
|
|
1496
|
+
f += Ki[a[m]];
|
|
1497
1497
|
return f;
|
|
1498
1498
|
}
|
|
1499
|
-
function
|
|
1499
|
+
function ji(a, i, r) {
|
|
1500
1500
|
const h = a.slice(i, r);
|
|
1501
1501
|
let f = "";
|
|
1502
1502
|
for (let m = 0; m < h.length - 1; m += 2)
|
|
@@ -1795,7 +1795,7 @@ function In() {
|
|
|
1795
1795
|
i = `_${a.slice(r - 3, r)}${i}`;
|
|
1796
1796
|
return `${a.slice(0, r)}${i}`;
|
|
1797
1797
|
}
|
|
1798
|
-
function
|
|
1798
|
+
function Hi(a, i, r) {
|
|
1799
1799
|
ve(i, "offset"), (a[i] === void 0 || a[i + r] === void 0) && Re(i, a.length - (r + 1));
|
|
1800
1800
|
}
|
|
1801
1801
|
function kt(a, i, r, h, f, m) {
|
|
@@ -1804,7 +1804,7 @@ function In() {
|
|
|
1804
1804
|
let R;
|
|
1805
1805
|
throw i === 0 || i === BigInt(0) ? R = `>= 0${v} and < 2${v} ** ${(m + 1) * 8}${v}` : R = `>= -(2${v} ** ${(m + 1) * 8 - 1}${v}) and < 2 ** ${(m + 1) * 8 - 1}${v}`, new ge.ERR_OUT_OF_RANGE("value", R, a);
|
|
1806
1806
|
}
|
|
1807
|
-
|
|
1807
|
+
Hi(h, f, m);
|
|
1808
1808
|
}
|
|
1809
1809
|
function ve(a, i) {
|
|
1810
1810
|
if (typeof a != "number")
|
|
@@ -1817,9 +1817,9 @@ function In() {
|
|
|
1817
1817
|
a
|
|
1818
1818
|
);
|
|
1819
1819
|
}
|
|
1820
|
-
const
|
|
1821
|
-
function
|
|
1822
|
-
if (a = a.split("=")[0], a = a.trim().replace(
|
|
1820
|
+
const Wi = /[^+/0-9A-Za-z-_]/g;
|
|
1821
|
+
function zi(a) {
|
|
1822
|
+
if (a = a.split("=")[0], a = a.trim().replace(Wi, ""), a.length < 2) return "";
|
|
1823
1823
|
for (; a.length % 4 !== 0; )
|
|
1824
1824
|
a = a + "=";
|
|
1825
1825
|
return a;
|
|
@@ -1878,13 +1878,13 @@ function In() {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
return m;
|
|
1880
1880
|
}
|
|
1881
|
-
function
|
|
1881
|
+
function qi(a) {
|
|
1882
1882
|
const i = [];
|
|
1883
1883
|
for (let r = 0; r < a.length; ++r)
|
|
1884
1884
|
i.push(a.charCodeAt(r) & 255);
|
|
1885
1885
|
return i;
|
|
1886
1886
|
}
|
|
1887
|
-
function
|
|
1887
|
+
function Yi(a, i) {
|
|
1888
1888
|
let r, h, f;
|
|
1889
1889
|
const m = [];
|
|
1890
1890
|
for (let v = 0; v < a.length && !((i -= 2) < 0); ++v)
|
|
@@ -1892,7 +1892,7 @@ function In() {
|
|
|
1892
1892
|
return m;
|
|
1893
1893
|
}
|
|
1894
1894
|
function Dt(a) {
|
|
1895
|
-
return e.toByteArray(
|
|
1895
|
+
return e.toByteArray(zi(a));
|
|
1896
1896
|
}
|
|
1897
1897
|
function Fe(a, i, r, h) {
|
|
1898
1898
|
let f;
|
|
@@ -1906,7 +1906,7 @@ function In() {
|
|
|
1906
1906
|
function nt(a) {
|
|
1907
1907
|
return a !== a;
|
|
1908
1908
|
}
|
|
1909
|
-
const
|
|
1909
|
+
const Ki = (function() {
|
|
1910
1910
|
const a = "0123456789abcdef", i = new Array(256);
|
|
1911
1911
|
for (let r = 0; r < 16; ++r) {
|
|
1912
1912
|
const h = r * 16;
|
|
@@ -1916,57 +1916,57 @@ function In() {
|
|
|
1916
1916
|
return i;
|
|
1917
1917
|
})();
|
|
1918
1918
|
function ae(a) {
|
|
1919
|
-
return typeof BigInt > "u" ?
|
|
1919
|
+
return typeof BigInt > "u" ? Ji : a;
|
|
1920
1920
|
}
|
|
1921
|
-
function
|
|
1921
|
+
function Ji() {
|
|
1922
1922
|
throw new Error("BigInt not supported");
|
|
1923
1923
|
}
|
|
1924
1924
|
})(st)), st;
|
|
1925
1925
|
}
|
|
1926
|
-
var
|
|
1927
|
-
const
|
|
1926
|
+
var An = bn();
|
|
1927
|
+
const Tn = "https://api.anam.ai", Rn = "/v1", Di = {
|
|
1928
1928
|
client: "js-sdk",
|
|
1929
1929
|
version: "4.8.0"
|
|
1930
1930
|
};
|
|
1931
|
-
var
|
|
1931
|
+
var Nn = function(t, e, n, o) {
|
|
1932
1932
|
function c(s) {
|
|
1933
1933
|
return s instanceof n ? s : new n(function(u) {
|
|
1934
1934
|
u(s);
|
|
1935
1935
|
});
|
|
1936
1936
|
}
|
|
1937
1937
|
return new (n || (n = Promise))(function(s, u) {
|
|
1938
|
-
function l(
|
|
1938
|
+
function l(p) {
|
|
1939
1939
|
try {
|
|
1940
|
-
|
|
1940
|
+
_(o.next(p));
|
|
1941
1941
|
} catch (d) {
|
|
1942
1942
|
u(d);
|
|
1943
1943
|
}
|
|
1944
1944
|
}
|
|
1945
|
-
function E(
|
|
1945
|
+
function E(p) {
|
|
1946
1946
|
try {
|
|
1947
|
-
|
|
1947
|
+
_(o.throw(p));
|
|
1948
1948
|
} catch (d) {
|
|
1949
1949
|
u(d);
|
|
1950
1950
|
}
|
|
1951
1951
|
}
|
|
1952
|
-
function p
|
|
1953
|
-
|
|
1952
|
+
function _(p) {
|
|
1953
|
+
p.done ? s(p.value) : c(p.value).then(l, E);
|
|
1954
1954
|
}
|
|
1955
|
-
|
|
1955
|
+
_((o = o.apply(t, e || [])).next());
|
|
1956
1956
|
});
|
|
1957
1957
|
};
|
|
1958
|
-
const
|
|
1958
|
+
const Ui = "https://api.anam.ai", Ct = "/v1";
|
|
1959
1959
|
var oe;
|
|
1960
1960
|
(function(t) {
|
|
1961
1961
|
t.CLIENT_METRIC_MEASUREMENT_ERROR = "client_error", t.CLIENT_METRIC_MEASUREMENT_CONNECTION_CLOSED = "client_connection_closed", t.CLIENT_METRIC_MEASUREMENT_CONNECTION_ESTABLISHED = "client_connection_established", t.CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT = "client_session_attempt", t.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS = "client_session_success";
|
|
1962
1962
|
})(oe || (oe = {}));
|
|
1963
|
-
let pt =
|
|
1964
|
-
const
|
|
1963
|
+
let pt = Ui, Mi = Ct, ce, Li = !1;
|
|
1964
|
+
const xn = (t, e = Ct) => {
|
|
1965
1965
|
pt = t, Mi = e;
|
|
1966
|
-
}, xn = (t) => {
|
|
1967
|
-
ce = t;
|
|
1968
1966
|
}, On = (t) => {
|
|
1969
|
-
|
|
1967
|
+
ce = t;
|
|
1968
|
+
}, kn = (t) => {
|
|
1969
|
+
Li = t;
|
|
1970
1970
|
};
|
|
1971
1971
|
let ue = {
|
|
1972
1972
|
sessionId: null,
|
|
@@ -1975,10 +1975,10 @@ let ue = {
|
|
|
1975
1975
|
};
|
|
1976
1976
|
const ye = (t) => {
|
|
1977
1977
|
ue = Object.assign(Object.assign({}, ue), t);
|
|
1978
|
-
}, Ee = (t, e, n) =>
|
|
1979
|
-
if (!
|
|
1978
|
+
}, Ee = (t, e, n) => Nn(void 0, void 0, void 0, function* () {
|
|
1979
|
+
if (!Li)
|
|
1980
1980
|
try {
|
|
1981
|
-
const o = Object.assign(Object.assign({},
|
|
1981
|
+
const o = Object.assign(Object.assign({}, Di), n);
|
|
1982
1982
|
ue.sessionId && (o.sessionId = ue.sessionId), ue.organizationId && (o.organizationId = ue.organizationId), ue.attemptCorrelationId && (o.attemptCorrelationId = ue.attemptCorrelationId);
|
|
1983
1983
|
const c = `${Mi}/metrics/client`;
|
|
1984
1984
|
let s, u = {
|
|
@@ -1996,7 +1996,7 @@ const ye = (t) => {
|
|
|
1996
1996
|
} catch (o) {
|
|
1997
1997
|
console.error("Failed to send error metric:", o);
|
|
1998
1998
|
}
|
|
1999
|
-
}),
|
|
1999
|
+
}), Dn = (t, e = "console") => {
|
|
2000
2000
|
var n, o, c;
|
|
2001
2001
|
const s = {};
|
|
2002
2002
|
t.forEach((d) => {
|
|
@@ -2030,8 +2030,8 @@ const ye = (t) => {
|
|
|
2030
2030
|
};
|
|
2031
2031
|
u.personaAudioStream.push(C);
|
|
2032
2032
|
}));
|
|
2033
|
-
const
|
|
2034
|
-
|
|
2033
|
+
const _ = ((c = s["outbound-rtp"]) === null || c === void 0 ? void 0 : c.filter((d) => d.kind === "audio")) || [];
|
|
2034
|
+
_.length > 0 && (u.userAudioInput = [], _.forEach((d) => {
|
|
2035
2035
|
var y, g;
|
|
2036
2036
|
const S = {
|
|
2037
2037
|
packetsSent: (y = d.packetsSent) !== null && y !== void 0 ? y : "unknown",
|
|
@@ -2057,12 +2057,12 @@ const ye = (t) => {
|
|
|
2057
2057
|
};
|
|
2058
2058
|
u.transportLayer.push(y);
|
|
2059
2059
|
}));
|
|
2060
|
-
const
|
|
2060
|
+
const p = [];
|
|
2061
2061
|
if (l.forEach((d) => {
|
|
2062
|
-
typeof d.framesDropped == "number" && d.framesDropped > 0 &&
|
|
2062
|
+
typeof d.framesDropped == "number" && d.framesDropped > 0 && p.push(`Video: ${d.framesDropped} frames dropped`), typeof d.packetsLost == "number" && d.packetsLost > 0 && p.push(`Video: ${d.packetsLost} packets lost`), typeof d.framesPerSecond == "number" && d.framesPerSecond < 23 && p.push(`Video: Low frame rate (${d.framesPerSecond} fps)`);
|
|
2063
2063
|
}), E.forEach((d) => {
|
|
2064
|
-
typeof d.packetsLost == "number" && d.packetsLost > 0 &&
|
|
2065
|
-
}), u.issues =
|
|
2064
|
+
typeof d.packetsLost == "number" && d.packetsLost > 0 && p.push(`Audio: ${d.packetsLost} packets lost`), typeof d.jitter == "number" && d.jitter > 0.1 && p.push(`Audio: High jitter (${(d.jitter * 1e3).toFixed(1)}ms)`);
|
|
2065
|
+
}), u.issues = p, e === "json")
|
|
2066
2066
|
return u;
|
|
2067
2067
|
console.group("📊 WebRTC Session Statistics Report"), u.personaVideoStream && u.personaVideoStream.length > 0 && (console.group("📹 Persona Video Stream (Inbound)"), u.personaVideoStream.forEach((d) => {
|
|
2068
2068
|
console.log(`Frames Received: ${d.framesReceived}`), console.log(`Frames Dropped: ${d.framesDropped}`), console.log(`Frames Per Second: ${d.framesPerSecond}`), console.log(`Packets Received: ${typeof d.packetsReceived == "number" ? d.packetsReceived.toLocaleString() : d.packetsReceived}`), console.log(`Packets Lost: ${d.packetsLost}`), d.resolution && console.log(`Resolution: ${d.resolution}`), d.jitter !== void 0 && console.log(`Jitter: ${d.jitter.toFixed(5)}ms`);
|
|
@@ -2091,7 +2091,7 @@ class V extends Error {
|
|
|
2091
2091
|
function Zt() {
|
|
2092
2092
|
return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : Date.now().toString(36) + Math.random().toString(36).substr(2, 9);
|
|
2093
2093
|
}
|
|
2094
|
-
function
|
|
2094
|
+
function Un(t) {
|
|
2095
2095
|
if (!(!t || !t.enabled)) {
|
|
2096
2096
|
if (!t.baseUrl)
|
|
2097
2097
|
return "API Gateway baseUrl is required when enabled";
|
|
@@ -2183,44 +2183,44 @@ var Se = function(t, e, n, o) {
|
|
|
2183
2183
|
});
|
|
2184
2184
|
}
|
|
2185
2185
|
return new (n || (n = Promise))(function(s, u) {
|
|
2186
|
-
function l(
|
|
2186
|
+
function l(p) {
|
|
2187
2187
|
try {
|
|
2188
|
-
|
|
2188
|
+
_(o.next(p));
|
|
2189
2189
|
} catch (d) {
|
|
2190
2190
|
u(d);
|
|
2191
2191
|
}
|
|
2192
2192
|
}
|
|
2193
|
-
function E(
|
|
2193
|
+
function E(p) {
|
|
2194
2194
|
try {
|
|
2195
|
-
|
|
2195
|
+
_(o.throw(p));
|
|
2196
2196
|
} catch (d) {
|
|
2197
2197
|
u(d);
|
|
2198
2198
|
}
|
|
2199
2199
|
}
|
|
2200
|
-
function p
|
|
2201
|
-
|
|
2200
|
+
function _(p) {
|
|
2201
|
+
p.done ? s(p.value) : c(p.value).then(l, E);
|
|
2202
2202
|
}
|
|
2203
|
-
|
|
2203
|
+
_((o = o.apply(t, e || [])).next());
|
|
2204
2204
|
});
|
|
2205
2205
|
};
|
|
2206
|
-
const
|
|
2207
|
-
class
|
|
2206
|
+
const Ln = 5, Bn = 5;
|
|
2207
|
+
class Pn {
|
|
2208
2208
|
constructor(e, n, o, c, s) {
|
|
2209
|
-
var u, l, E,
|
|
2209
|
+
var u, l, E, _, p;
|
|
2210
2210
|
if (this.stopSignal = !1, this.sendingBuffer = [], this.wsConnectionAttempts = 0, this.socket = null, this.heartBeatIntervalRef = null, this.publicEventEmitter = o, this.internalEventEmitter = c, this.apiGatewayConfig = s, !e)
|
|
2211
2211
|
throw new Error("Signalling Client: sessionId is required");
|
|
2212
2212
|
this.sessionId = e;
|
|
2213
2213
|
const { heartbeatIntervalSeconds: d, maxWsReconnectionAttempts: y, url: g } = n;
|
|
2214
|
-
if (this.heartbeatIntervalSeconds = d ||
|
|
2214
|
+
if (this.heartbeatIntervalSeconds = d || Ln, this.maxWsReconnectionAttempts = y || Bn, !g.baseUrl)
|
|
2215
2215
|
throw new Error("Signalling Client: baseUrl is required");
|
|
2216
2216
|
if (!((u = this.apiGatewayConfig) === null || u === void 0) && u.enabled && (!((l = this.apiGatewayConfig) === null || l === void 0) && l.baseUrl)) {
|
|
2217
2217
|
const S = new URL(this.apiGatewayConfig.baseUrl), C = (E = this.apiGatewayConfig.wsPath) !== null && E !== void 0 ? E : "/ws";
|
|
2218
2218
|
S.protocol = S.protocol.replace("http", "ws"), S.pathname = C, this.url = S;
|
|
2219
|
-
const A = g.protocol || "https", I = A === "http" ? "ws" : "wss", b = `${A}://${g.baseUrl}`, T = (
|
|
2219
|
+
const A = g.protocol || "https", I = A === "http" ? "ws" : "wss", b = `${A}://${g.baseUrl}`, T = (_ = g.signallingPath) !== null && _ !== void 0 ? _ : "/ws", O = new URL(b);
|
|
2220
2220
|
O.protocol = I === "ws" ? "ws:" : "wss:", g.port && (O.port = g.port), O.pathname = T, O.searchParams.append("session_id", e), this.url.searchParams.append("target_url", O.href);
|
|
2221
2221
|
} else {
|
|
2222
2222
|
const C = `${g.protocol || "https"}://${g.baseUrl}`;
|
|
2223
|
-
this.url = new URL(C), this.url.protocol = g.protocol === "http" ? "ws:" : "wss:", g.port && (this.url.port = g.port), this.url.pathname = (
|
|
2223
|
+
this.url = new URL(C), this.url.protocol = g.protocol === "http" ? "ws:" : "wss:", g.port && (this.url.port = g.port), this.url.pathname = (p = g.signallingPath) !== null && p !== void 0 ? p : "/ws", this.url.searchParams.append("session_id", e);
|
|
2224
2224
|
}
|
|
2225
2225
|
}
|
|
2226
2226
|
stop() {
|
|
@@ -2342,7 +2342,7 @@ class Bn {
|
|
|
2342
2342
|
}, e);
|
|
2343
2343
|
}
|
|
2344
2344
|
}
|
|
2345
|
-
function
|
|
2345
|
+
function Fn(t) {
|
|
2346
2346
|
return "brainType" in t || "llmId" in t;
|
|
2347
2347
|
}
|
|
2348
2348
|
var Qt = function(t, e, n, o) {
|
|
@@ -2352,31 +2352,31 @@ var Qt = function(t, e, n, o) {
|
|
|
2352
2352
|
});
|
|
2353
2353
|
}
|
|
2354
2354
|
return new (n || (n = Promise))(function(s, u) {
|
|
2355
|
-
function l(
|
|
2355
|
+
function l(p) {
|
|
2356
2356
|
try {
|
|
2357
|
-
|
|
2357
|
+
_(o.next(p));
|
|
2358
2358
|
} catch (d) {
|
|
2359
2359
|
u(d);
|
|
2360
2360
|
}
|
|
2361
2361
|
}
|
|
2362
|
-
function E(
|
|
2362
|
+
function E(p) {
|
|
2363
2363
|
try {
|
|
2364
|
-
|
|
2364
|
+
_(o.throw(p));
|
|
2365
2365
|
} catch (d) {
|
|
2366
2366
|
u(d);
|
|
2367
2367
|
}
|
|
2368
2368
|
}
|
|
2369
|
-
function p
|
|
2370
|
-
|
|
2369
|
+
function _(p) {
|
|
2370
|
+
p.done ? s(p.value) : c(p.value).then(l, E);
|
|
2371
2371
|
}
|
|
2372
|
-
|
|
2372
|
+
_((o = o.apply(t, e || [])).next());
|
|
2373
2373
|
});
|
|
2374
2374
|
};
|
|
2375
|
-
class
|
|
2375
|
+
class $n {
|
|
2376
2376
|
constructor(e, n, o) {
|
|
2377
2377
|
if (!e && !n)
|
|
2378
2378
|
throw new Error("Either sessionToken or apiKey must be provided");
|
|
2379
|
-
this.sessionToken = e || null, this.apiKey = n || null, this.baseUrl = o?.baseUrl ||
|
|
2379
|
+
this.sessionToken = e || null, this.apiKey = n || null, this.baseUrl = o?.baseUrl || Tn, this.apiVersion = o?.apiVersion || Rn, this.apiGatewayConfig = o?.apiGateway || void 0;
|
|
2380
2380
|
}
|
|
2381
2381
|
/**
|
|
2382
2382
|
* Builds URL and headers for a request, applying API Gateway configuration if enabled
|
|
@@ -2410,7 +2410,7 @@ class Fn {
|
|
|
2410
2410
|
body: JSON.stringify({
|
|
2411
2411
|
personaConfig: e,
|
|
2412
2412
|
sessionOptions: n,
|
|
2413
|
-
clientMetadata:
|
|
2413
|
+
clientMetadata: Di
|
|
2414
2414
|
})
|
|
2415
2415
|
}), l = yield u.json(), E = l.error;
|
|
2416
2416
|
switch (u.status) {
|
|
@@ -2445,7 +2445,7 @@ class Fn {
|
|
|
2445
2445
|
let n = {
|
|
2446
2446
|
clientLabel: "js-sdk-api-key"
|
|
2447
2447
|
};
|
|
2448
|
-
|
|
2448
|
+
Fn(e) && (n = Object.assign(Object.assign({}, n), { personaConfig: e }));
|
|
2449
2449
|
try {
|
|
2450
2450
|
const o = `${this.apiVersion}/auth/session-token`, { url: c, headers: s } = this.buildGatewayUrlAndHeaders(o, {
|
|
2451
2451
|
"Content-Type": "application/json",
|
|
@@ -2465,39 +2465,39 @@ class Fn {
|
|
|
2465
2465
|
return `${this.baseUrl}${this.apiVersion}`;
|
|
2466
2466
|
}
|
|
2467
2467
|
}
|
|
2468
|
-
var
|
|
2468
|
+
var Vn = function(t, e, n, o) {
|
|
2469
2469
|
function c(s) {
|
|
2470
2470
|
return s instanceof n ? s : new n(function(u) {
|
|
2471
2471
|
u(s);
|
|
2472
2472
|
});
|
|
2473
2473
|
}
|
|
2474
2474
|
return new (n || (n = Promise))(function(s, u) {
|
|
2475
|
-
function l(
|
|
2475
|
+
function l(p) {
|
|
2476
2476
|
try {
|
|
2477
|
-
|
|
2477
|
+
_(o.next(p));
|
|
2478
2478
|
} catch (d) {
|
|
2479
2479
|
u(d);
|
|
2480
2480
|
}
|
|
2481
2481
|
}
|
|
2482
|
-
function E(
|
|
2482
|
+
function E(p) {
|
|
2483
2483
|
try {
|
|
2484
|
-
|
|
2484
|
+
_(o.throw(p));
|
|
2485
2485
|
} catch (d) {
|
|
2486
2486
|
u(d);
|
|
2487
2487
|
}
|
|
2488
2488
|
}
|
|
2489
|
-
function p
|
|
2490
|
-
|
|
2489
|
+
function _(p) {
|
|
2490
|
+
p.done ? s(p.value) : c(p.value).then(l, E);
|
|
2491
2491
|
}
|
|
2492
|
-
|
|
2492
|
+
_((o = o.apply(t, e || [])).next());
|
|
2493
2493
|
});
|
|
2494
2494
|
};
|
|
2495
|
-
class
|
|
2495
|
+
class Gn {
|
|
2496
2496
|
constructor(e, n, o) {
|
|
2497
2497
|
this.baseUrl = e, this.sessionId = n, this.apiGatewayConfig = o;
|
|
2498
2498
|
}
|
|
2499
2499
|
sendTalkCommand(e) {
|
|
2500
|
-
return
|
|
2500
|
+
return Vn(this, void 0, void 0, function* () {
|
|
2501
2501
|
var n, o;
|
|
2502
2502
|
try {
|
|
2503
2503
|
let c, s = {
|
|
@@ -2506,8 +2506,8 @@ class Vn {
|
|
|
2506
2506
|
const u = "/talk", l = `?session_id=${this.sessionId}`;
|
|
2507
2507
|
if (!((n = this.apiGatewayConfig) === null || n === void 0) && n.enabled && (!((o = this.apiGatewayConfig) === null || o === void 0) && o.baseUrl)) {
|
|
2508
2508
|
c = `${this.apiGatewayConfig.baseUrl}${u}${l}`;
|
|
2509
|
-
const
|
|
2510
|
-
s["X-Anam-Target-Url"] =
|
|
2509
|
+
const _ = new URL(`${this.baseUrl}${u}${l}`);
|
|
2510
|
+
s["X-Anam-Target-Url"] = _.href;
|
|
2511
2511
|
} else
|
|
2512
2512
|
c = `${this.baseUrl}${u}${l}`;
|
|
2513
2513
|
const E = yield fetch(c, {
|
|
@@ -2525,7 +2525,7 @@ class Vn {
|
|
|
2525
2525
|
});
|
|
2526
2526
|
}
|
|
2527
2527
|
}
|
|
2528
|
-
class
|
|
2528
|
+
class jn {
|
|
2529
2529
|
constructor() {
|
|
2530
2530
|
this.listeners = {};
|
|
2531
2531
|
}
|
|
@@ -2541,7 +2541,7 @@ class Gn {
|
|
|
2541
2541
|
});
|
|
2542
2542
|
}
|
|
2543
2543
|
}
|
|
2544
|
-
class
|
|
2544
|
+
class Hn {
|
|
2545
2545
|
constructor(e, n) {
|
|
2546
2546
|
this.messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(X.WEBRTC_CHAT_MESSAGE_RECEIVED, this.processWebRtcTextMessageEvent.bind(this));
|
|
2547
2547
|
}
|
|
@@ -2589,7 +2589,7 @@ class jn {
|
|
|
2589
2589
|
n.endOfSpeech && this.publicEventEmitter.emit(x.MESSAGE_HISTORY_UPDATED, this.messages);
|
|
2590
2590
|
}
|
|
2591
2591
|
}
|
|
2592
|
-
class
|
|
2592
|
+
class Wn {
|
|
2593
2593
|
constructor() {
|
|
2594
2594
|
this.listeners = {};
|
|
2595
2595
|
}
|
|
@@ -2620,27 +2620,27 @@ var at = function(t, e, n, o) {
|
|
|
2620
2620
|
});
|
|
2621
2621
|
}
|
|
2622
2622
|
return new (n || (n = Promise))(function(s, u) {
|
|
2623
|
-
function l(
|
|
2623
|
+
function l(p) {
|
|
2624
2624
|
try {
|
|
2625
|
-
|
|
2625
|
+
_(o.next(p));
|
|
2626
2626
|
} catch (d) {
|
|
2627
2627
|
u(d);
|
|
2628
2628
|
}
|
|
2629
2629
|
}
|
|
2630
|
-
function E(
|
|
2630
|
+
function E(p) {
|
|
2631
2631
|
try {
|
|
2632
|
-
|
|
2632
|
+
_(o.throw(p));
|
|
2633
2633
|
} catch (d) {
|
|
2634
2634
|
u(d);
|
|
2635
2635
|
}
|
|
2636
2636
|
}
|
|
2637
|
-
function p
|
|
2638
|
-
|
|
2637
|
+
function _(p) {
|
|
2638
|
+
p.done ? s(p.value) : c(p.value).then(l, E);
|
|
2639
2639
|
}
|
|
2640
|
-
|
|
2640
|
+
_((o = o.apply(t, e || [])).next());
|
|
2641
2641
|
});
|
|
2642
2642
|
};
|
|
2643
|
-
class
|
|
2643
|
+
class zn {
|
|
2644
2644
|
constructor(e, n, o) {
|
|
2645
2645
|
this.state = q.UNSTARTED, this.correlationId = e, this.internalEventEmitter = n, this.signallingClient = o, this.internalEventEmitter.addListener(X.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this));
|
|
2646
2646
|
}
|
|
@@ -2701,36 +2701,36 @@ var J = function(t, e, n, o) {
|
|
|
2701
2701
|
});
|
|
2702
2702
|
}
|
|
2703
2703
|
return new (n || (n = Promise))(function(s, u) {
|
|
2704
|
-
function l(
|
|
2704
|
+
function l(p) {
|
|
2705
2705
|
try {
|
|
2706
|
-
|
|
2706
|
+
_(o.next(p));
|
|
2707
2707
|
} catch (d) {
|
|
2708
2708
|
u(d);
|
|
2709
2709
|
}
|
|
2710
2710
|
}
|
|
2711
|
-
function E(
|
|
2711
|
+
function E(p) {
|
|
2712
2712
|
try {
|
|
2713
|
-
|
|
2713
|
+
_(o.throw(p));
|
|
2714
2714
|
} catch (d) {
|
|
2715
2715
|
u(d);
|
|
2716
2716
|
}
|
|
2717
2717
|
}
|
|
2718
|
-
function p
|
|
2719
|
-
|
|
2718
|
+
function _(p) {
|
|
2719
|
+
p.done ? s(p.value) : c(p.value).then(l, E);
|
|
2720
2720
|
}
|
|
2721
|
-
|
|
2721
|
+
_((o = o.apply(t, e || [])).next());
|
|
2722
2722
|
});
|
|
2723
2723
|
};
|
|
2724
|
-
const
|
|
2725
|
-
class
|
|
2724
|
+
const qn = 15e3, Yn = 5e3, Kn = 2;
|
|
2725
|
+
class Jn {
|
|
2726
2726
|
constructor(e, n, o, c) {
|
|
2727
2727
|
var s, u, l, E;
|
|
2728
2728
|
this.peerConnection = null, this.connectionReceivedAnswer = !1, this.remoteIceCandidateBuffer = [], this.inputAudioStream = null, this.dataChannel = null, this.videoElement = null, this.videoStream = null, this.audioStream = null, this.inputAudioState = {
|
|
2729
2729
|
isMuted: !1,
|
|
2730
2730
|
permissionState: de.NOT_REQUESTED
|
|
2731
2731
|
}, this.successMetricPoller = null, this.successMetricFired = !1, this.showPeerConnectionStatsReport = !1, this.peerConnectionStatsReportOutputFormat = "console", this.statsCollectionInterval = null, this.agentAudioInputStream = null, this.publicEventEmitter = o, this.internalEventEmitter = c, this.apiGatewayConfig = n.apiGateway;
|
|
2732
|
-
const { inputAudio:
|
|
2733
|
-
this.inputAudioState =
|
|
2732
|
+
const { inputAudio: _ } = n;
|
|
2733
|
+
this.inputAudioState = _.inputAudioState, n.inputAudio.userProvidedMediaStream && (this.inputAudioStream = n.inputAudio.userProvidedMediaStream), this.disableInputAudio = n.inputAudio.disableInputAudio === !0, this.internalEventEmitter.addListener(X.WEB_SOCKET_OPEN, this.onSignallingClientConnected.bind(this)), this.internalEventEmitter.addListener(X.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this)), this.iceServers = n.iceServers, this.signallingClient = new Pn(e, n.signalling, this.publicEventEmitter, this.internalEventEmitter, this.apiGatewayConfig), this.engineApiRestClient = new Gn(n.engine.baseUrl, e, this.apiGatewayConfig), this.audioDeviceId = n.inputAudio.audioDeviceId, this.showPeerConnectionStatsReport = (u = (s = n.metrics) === null || s === void 0 ? void 0 : s.showPeerConnectionStatsReport) !== null && u !== void 0 ? u : !1, this.peerConnectionStatsReportOutputFormat = (E = (l = n.metrics) === null || l === void 0 ? void 0 : l.peerConnectionStatsReportOutputFormat) !== null && E !== void 0 ? E : "console";
|
|
2734
2734
|
}
|
|
2735
2735
|
onInputAudioStateChange(e, n) {
|
|
2736
2736
|
e.isMuted !== n.isMuted && (n.isMuted ? this.muteAllAudioTracks() : this.unmuteAllAudioTracks());
|
|
@@ -2756,7 +2756,7 @@ class Kn {
|
|
|
2756
2756
|
} catch (e) {
|
|
2757
2757
|
console.error("Failed to collect and send stats:", e);
|
|
2758
2758
|
}
|
|
2759
|
-
}),
|
|
2759
|
+
}), Yn));
|
|
2760
2760
|
}
|
|
2761
2761
|
sendClientSideMetrics(e) {
|
|
2762
2762
|
e.forEach((n) => {
|
|
@@ -2774,7 +2774,7 @@ class Kn {
|
|
|
2774
2774
|
return;
|
|
2775
2775
|
const e = setTimeout(() => {
|
|
2776
2776
|
this.successMetricPoller && (console.warn("No video frames received, there is a problem with the connection."), clearInterval(this.successMetricPoller), this.successMetricPoller = null);
|
|
2777
|
-
},
|
|
2777
|
+
}, qn);
|
|
2778
2778
|
this.successMetricPoller = setInterval(() => J(this, void 0, void 0, function* () {
|
|
2779
2779
|
if (!this.peerConnection || this.successMetricFired) {
|
|
2780
2780
|
this.successMetricPoller && clearInterval(this.successMetricPoller), clearTimeout(e);
|
|
@@ -2874,7 +2874,7 @@ class Kn {
|
|
|
2874
2874
|
});
|
|
2875
2875
|
}
|
|
2876
2876
|
startTalkMessageStream(e) {
|
|
2877
|
-
return e || (e = Math.random().toString(36).substring(2, 15)), new
|
|
2877
|
+
return e || (e = Math.random().toString(36).substring(2, 15)), new zn(e, this.internalEventEmitter, this.signallingClient);
|
|
2878
2878
|
}
|
|
2879
2879
|
createAgentAudioInputStream(e) {
|
|
2880
2880
|
return this.agentAudioInputStream = new Mn(e, this.signallingClient), this.agentAudioInputStream;
|
|
@@ -2886,7 +2886,7 @@ class Kn {
|
|
|
2886
2886
|
return J(this, void 0, void 0, function* () {
|
|
2887
2887
|
this.peerConnection = new RTCPeerConnection({
|
|
2888
2888
|
iceServers: this.iceServers,
|
|
2889
|
-
iceCandidatePoolSize:
|
|
2889
|
+
iceCandidatePoolSize: Kn
|
|
2890
2890
|
}), this.peerConnection.onicecandidate = this.onIceCandidate.bind(this), this.peerConnection.oniceconnectionstatechange = this.onIceConnectionStateChange.bind(this), this.peerConnection.onconnectionstatechange = this.onConnectionStateChange.bind(this), this.peerConnection.addEventListener("track", this.onTrackEventHandler.bind(this)), yield this.setupDataChannels(), this.peerConnection.addTransceiver("video", { direction: "recvonly" }), this.disableInputAudio ? this.peerConnection.addTransceiver("audio", { direction: "recvonly" }) : (this.peerConnection.addTransceiver("audio", { direction: "sendrecv" }), this.inputAudioStream ? yield this.setupAudioTrack() : this.requestMicrophonePermissionAsync().catch((e) => {
|
|
2891
2891
|
console.error("Async microphone permission request failed:", e);
|
|
2892
2892
|
}));
|
|
@@ -3008,7 +3008,7 @@ class Kn {
|
|
|
3008
3008
|
case ke.CLIENT_TOOL_EVENT:
|
|
3009
3009
|
const c = o.data;
|
|
3010
3010
|
this.internalEventEmitter.emit(X.WEBRTC_CLIENT_TOOL_EVENT_RECEIVED, c);
|
|
3011
|
-
const s =
|
|
3011
|
+
const s = Xn.WebRTCClientToolEventToClientToolEvent(c);
|
|
3012
3012
|
this.publicEventEmitter.emit(x.CLIENT_TOOL_EVENT_RECEIVED, s);
|
|
3013
3013
|
break;
|
|
3014
3014
|
case ke.REASONING_TEXT:
|
|
@@ -3098,7 +3098,7 @@ class Kn {
|
|
|
3098
3098
|
if (this.showPeerConnectionStatsReport) {
|
|
3099
3099
|
const n = yield (e = this.peerConnection) === null || e === void 0 ? void 0 : e.getStats();
|
|
3100
3100
|
if (n) {
|
|
3101
|
-
const o =
|
|
3101
|
+
const o = Dn(n, this.peerConnectionStatsReportOutputFormat);
|
|
3102
3102
|
o && console.log(o, void 0, 2);
|
|
3103
3103
|
}
|
|
3104
3104
|
}
|
|
@@ -3123,7 +3123,7 @@ class Kn {
|
|
|
3123
3123
|
});
|
|
3124
3124
|
}
|
|
3125
3125
|
}
|
|
3126
|
-
class
|
|
3126
|
+
class Xn {
|
|
3127
3127
|
/**
|
|
3128
3128
|
* Converts a WebRtcClientToolEvent to a ClientToolEvent
|
|
3129
3129
|
*/
|
|
@@ -3139,7 +3139,7 @@ class Jn {
|
|
|
3139
3139
|
};
|
|
3140
3140
|
}
|
|
3141
3141
|
}
|
|
3142
|
-
class
|
|
3142
|
+
class Zn {
|
|
3143
3143
|
constructor(e, n) {
|
|
3144
3144
|
this.reasoning_messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(X.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED, this.processWebRtcReasoningTextMessageEvent.bind(this));
|
|
3145
3145
|
}
|
|
@@ -3174,41 +3174,41 @@ var le = function(t, e, n, o) {
|
|
|
3174
3174
|
});
|
|
3175
3175
|
}
|
|
3176
3176
|
return new (n || (n = Promise))(function(s, u) {
|
|
3177
|
-
function l(
|
|
3177
|
+
function l(p) {
|
|
3178
3178
|
try {
|
|
3179
|
-
|
|
3179
|
+
_(o.next(p));
|
|
3180
3180
|
} catch (d) {
|
|
3181
3181
|
u(d);
|
|
3182
3182
|
}
|
|
3183
3183
|
}
|
|
3184
|
-
function E(
|
|
3184
|
+
function E(p) {
|
|
3185
3185
|
try {
|
|
3186
|
-
|
|
3186
|
+
_(o.throw(p));
|
|
3187
3187
|
} catch (d) {
|
|
3188
3188
|
u(d);
|
|
3189
3189
|
}
|
|
3190
3190
|
}
|
|
3191
|
-
function p
|
|
3192
|
-
|
|
3191
|
+
function _(p) {
|
|
3192
|
+
p.done ? s(p.value) : c(p.value).then(l, E);
|
|
3193
3193
|
}
|
|
3194
|
-
|
|
3194
|
+
_((o = o.apply(t, e || [])).next());
|
|
3195
3195
|
});
|
|
3196
3196
|
};
|
|
3197
|
-
class
|
|
3197
|
+
class Qn {
|
|
3198
3198
|
constructor(e, n, o) {
|
|
3199
3199
|
var c, s, u, l, E;
|
|
3200
3200
|
this.inputAudioState = {
|
|
3201
3201
|
isMuted: !1,
|
|
3202
3202
|
permissionState: de.NOT_REQUESTED
|
|
3203
3203
|
}, this.sessionId = null, this.organizationId = null, this.streamingClient = null, this._isStreaming = !1;
|
|
3204
|
-
const
|
|
3205
|
-
if (
|
|
3206
|
-
throw new V(
|
|
3207
|
-
this.personaConfig = n, this.clientOptions = o, (!((c = o?.api) === null || c === void 0) && c.baseUrl || !((s = o?.api) === null || s === void 0) && s.apiVersion) &&
|
|
3204
|
+
const _ = this.validateClientConfig(e, n, o);
|
|
3205
|
+
if (_)
|
|
3206
|
+
throw new V(_, j.CLIENT_ERROR_CODE_CONFIGURATION_ERROR, 400);
|
|
3207
|
+
this.personaConfig = n, this.clientOptions = o, (!((c = o?.api) === null || c === void 0) && c.baseUrl || !((s = o?.api) === null || s === void 0) && s.apiVersion) && xn(o.api.baseUrl || Ui, o.api.apiVersion || Ct), !((l = (u = o?.api) === null || u === void 0 ? void 0 : u.apiGateway) === null || l === void 0) && l.enabled && On(o.api.apiGateway), !((E = o?.metrics) === null || E === void 0) && E.disableClientMetrics && kn(!0), this.publicEventEmitter = new Wn(), this.internalEventEmitter = new jn(), this.apiClient = new $n(e, o?.apiKey, o?.api), this.messageHistoryClient = new Hn(this.publicEventEmitter, this.internalEventEmitter), this.reasoningHistoryClient = new Zn(this.publicEventEmitter, this.internalEventEmitter);
|
|
3208
3208
|
}
|
|
3209
3209
|
decodeJwt(e) {
|
|
3210
3210
|
try {
|
|
3211
|
-
const n = e.split(".")[1], o =
|
|
3211
|
+
const n = e.split(".")[1], o = An.Buffer.from(n, "base64").toString("utf8");
|
|
3212
3212
|
return JSON.parse(o);
|
|
3213
3213
|
} catch {
|
|
3214
3214
|
throw new Error("Invalid session token format");
|
|
@@ -3220,7 +3220,7 @@ class Zn {
|
|
|
3220
3220
|
return "Either sessionToken or apiKey must be provided";
|
|
3221
3221
|
if (o?.apiKey && e)
|
|
3222
3222
|
return "Only one of sessionToken or apiKey should be used";
|
|
3223
|
-
const u =
|
|
3223
|
+
const u = Un((c = o?.api) === null || c === void 0 ? void 0 : c.apiGateway);
|
|
3224
3224
|
if (u)
|
|
3225
3225
|
return u;
|
|
3226
3226
|
if (e) {
|
|
@@ -3254,14 +3254,14 @@ class Zn {
|
|
|
3254
3254
|
}
|
|
3255
3255
|
startSession(e) {
|
|
3256
3256
|
return le(this, void 0, void 0, function* () {
|
|
3257
|
-
var n, o, c, s, u, l, E,
|
|
3257
|
+
var n, o, c, s, u, l, E, _, p, d, y, g;
|
|
3258
3258
|
const S = this.personaConfig, C = this.buildStartSessionOptionsForClient(), A = yield this.apiClient.startSession(S, C), { sessionId: I, clientConfig: b, engineHost: T, engineProtocol: O, signallingEndpoint: N } = A, { heartbeatIntervalSeconds: Y, maxWsReconnectionAttempts: ie, iceServers: $ } = b;
|
|
3259
3259
|
this.sessionId = I, ye({
|
|
3260
3260
|
sessionId: this.sessionId
|
|
3261
3261
|
});
|
|
3262
3262
|
const ne = !((n = this.clientOptions) === null || n === void 0) && n.iceServers ? this.clientOptions.iceServers : $;
|
|
3263
3263
|
try {
|
|
3264
|
-
this.streamingClient = new
|
|
3264
|
+
this.streamingClient = new Jn(I, {
|
|
3265
3265
|
engine: {
|
|
3266
3266
|
baseUrl: `${O}://${T}`
|
|
3267
3267
|
},
|
|
@@ -3283,7 +3283,7 @@ class Zn {
|
|
|
3283
3283
|
},
|
|
3284
3284
|
apiGateway: (l = (u = this.clientOptions) === null || u === void 0 ? void 0 : u.api) === null || l === void 0 ? void 0 : l.apiGateway,
|
|
3285
3285
|
metrics: {
|
|
3286
|
-
showPeerConnectionStatsReport: (
|
|
3286
|
+
showPeerConnectionStatsReport: (p = (_ = (E = this.clientOptions) === null || E === void 0 ? void 0 : E.metrics) === null || _ === void 0 ? void 0 : _.showPeerConnectionStatsReport) !== null && p !== void 0 ? p : !1,
|
|
3287
3287
|
peerConnectionStatsReportOutputFormat: (g = (y = (d = this.clientOptions) === null || d === void 0 ? void 0 : d.metrics) === null || y === void 0 ? void 0 : y.peerConnectionStatsReportOutputFormat) !== null && g !== void 0 ? g : "console"
|
|
3288
3288
|
}
|
|
3289
3289
|
}, this.publicEventEmitter, this.internalEventEmitter);
|
|
@@ -3320,10 +3320,10 @@ class Zn {
|
|
|
3320
3320
|
var s;
|
|
3321
3321
|
const u = [];
|
|
3322
3322
|
let l = !1, E = !1;
|
|
3323
|
-
this.publicEventEmitter.addListener(x.VIDEO_STREAM_STARTED, (
|
|
3324
|
-
u.push(
|
|
3325
|
-
}), this.publicEventEmitter.addListener(x.AUDIO_STREAM_STARTED, (
|
|
3326
|
-
u.push(
|
|
3323
|
+
this.publicEventEmitter.addListener(x.VIDEO_STREAM_STARTED, (_) => {
|
|
3324
|
+
u.push(_), l = !0, E && c(u);
|
|
3325
|
+
}), this.publicEventEmitter.addListener(x.AUDIO_STREAM_STARTED, (_) => {
|
|
3326
|
+
u.push(_), E = !0, l && c(u);
|
|
3327
3327
|
}), (s = this.streamingClient) === null || s === void 0 || s.startConnection();
|
|
3328
3328
|
});
|
|
3329
3329
|
});
|
|
@@ -3485,7 +3485,7 @@ class Zn {
|
|
|
3485
3485
|
return this.sessionId;
|
|
3486
3486
|
}
|
|
3487
3487
|
}
|
|
3488
|
-
const
|
|
3488
|
+
const er = (t, e) => new Qn(t, void 0, e), te = {
|
|
3489
3489
|
SESSION_STARTED: "anam-agent:session-started",
|
|
3490
3490
|
SESSION_ENDED: "anam-agent:session-ended",
|
|
3491
3491
|
MESSAGE_RECEIVED: "anam-agent:message-received",
|
|
@@ -3495,11 +3495,11 @@ const Qn = (t, e) => new Zn(t, void 0, e), te = {
|
|
|
3495
3495
|
ERROR: "anam-agent:error",
|
|
3496
3496
|
MIC_MUTED: "anam-agent:mic-muted",
|
|
3497
3497
|
MIC_UNMUTED: "anam-agent:mic-unmuted"
|
|
3498
|
-
},
|
|
3499
|
-
function
|
|
3498
|
+
}, tr = "https://api.anam.ai";
|
|
3499
|
+
function Bi(t) {
|
|
3500
3500
|
return /^[a-zA-Z0-9_-]{1,128}$/.test(t);
|
|
3501
3501
|
}
|
|
3502
|
-
function
|
|
3502
|
+
function ei(t) {
|
|
3503
3503
|
try {
|
|
3504
3504
|
const e = t.split(".")[1];
|
|
3505
3505
|
return JSON.parse(atob(e));
|
|
@@ -3531,7 +3531,7 @@ function nr() {
|
|
|
3531
3531
|
};
|
|
3532
3532
|
}
|
|
3533
3533
|
async function rr(t, e, n) {
|
|
3534
|
-
if (t.isReady.value = !1, !
|
|
3534
|
+
if (t.isReady.value = !1, !Bi(e)) {
|
|
3535
3535
|
console.error("[AnamWidget] Invalid agent ID format:", e);
|
|
3536
3536
|
return;
|
|
3537
3537
|
}
|
|
@@ -3559,22 +3559,22 @@ async function or(t, e, n, o, c) {
|
|
|
3559
3559
|
if (c)
|
|
3560
3560
|
l = c;
|
|
3561
3561
|
else {
|
|
3562
|
-
if (!
|
|
3562
|
+
if (!Bi(e))
|
|
3563
3563
|
throw new Error("Invalid agent ID format");
|
|
3564
|
-
const
|
|
3564
|
+
const p = await fetch(`${n}/v1/auth/widget`, {
|
|
3565
3565
|
method: "POST",
|
|
3566
3566
|
headers: { "Content-Type": "application/json" },
|
|
3567
3567
|
body: JSON.stringify({ agentId: e })
|
|
3568
3568
|
});
|
|
3569
3569
|
if (s !== t.generation) return;
|
|
3570
|
-
if (u =
|
|
3571
|
-
const y = await
|
|
3572
|
-
throw new Error(y.error || `HTTP ${
|
|
3570
|
+
if (u = p.status, !p.ok) {
|
|
3571
|
+
const y = await p.json().catch(() => ({}));
|
|
3572
|
+
throw new Error(y.error || `HTTP ${p.status}`);
|
|
3573
3573
|
}
|
|
3574
|
-
l = (await
|
|
3574
|
+
l = (await p.json()).sessionToken;
|
|
3575
3575
|
}
|
|
3576
3576
|
if (s !== t.generation) return;
|
|
3577
|
-
const E =
|
|
3577
|
+
const E = er(l, {
|
|
3578
3578
|
api: n ? { baseUrl: n } : void 0,
|
|
3579
3579
|
metrics: { disableClientMetrics: !0 }
|
|
3580
3580
|
});
|
|
@@ -3583,28 +3583,28 @@ async function or(t, e, n, o, c) {
|
|
|
3583
3583
|
}), E.addListener(x.VIDEO_STREAM_STARTED, () => {
|
|
3584
3584
|
s === t.generation && (t.isStreaming.value = !0);
|
|
3585
3585
|
}), E.addListener(x.AUDIO_STREAM_STARTED, () => {
|
|
3586
|
-
}), E.addListener(x.MESSAGE_HISTORY_UPDATED, (
|
|
3586
|
+
}), E.addListener(x.MESSAGE_HISTORY_UPDATED, (p) => {
|
|
3587
3587
|
if (s === t.generation) {
|
|
3588
|
-
for (let d = t.prevMessageCount; d <
|
|
3589
|
-
const y =
|
|
3588
|
+
for (let d = t.prevMessageCount; d < p.length; d++) {
|
|
3589
|
+
const y = p[d];
|
|
3590
3590
|
t.dispatch?.(te.MESSAGE_RECEIVED, {
|
|
3591
3591
|
role: y.role === "persona" ? "agent" : "user",
|
|
3592
3592
|
content: y.content
|
|
3593
3593
|
});
|
|
3594
3594
|
}
|
|
3595
|
-
t.prevMessageCount =
|
|
3595
|
+
t.prevMessageCount = p.length, t.messages.value = [...p];
|
|
3596
3596
|
}
|
|
3597
|
-
}), E.addListener(x.CONNECTION_CLOSED, (
|
|
3597
|
+
}), E.addListener(x.CONNECTION_CLOSED, (p, d) => {
|
|
3598
3598
|
if (s !== t.generation) return;
|
|
3599
3599
|
const y = t.sessionId.value;
|
|
3600
3600
|
t.connectionStatus.value = "idle", t.isStreaming.value = !1, t.sessionId.value = null, t.dispatch?.(te.SESSION_ENDED, {
|
|
3601
3601
|
sessionId: y ?? "",
|
|
3602
|
-
reason: d ??
|
|
3602
|
+
reason: d ?? p
|
|
3603
3603
|
});
|
|
3604
|
-
}), E.addListener(x.SESSION_READY, (
|
|
3605
|
-
s === t.generation && (t.sessionId.value =
|
|
3604
|
+
}), E.addListener(x.SESSION_READY, (p) => {
|
|
3605
|
+
s === t.generation && (t.sessionId.value = p, t.dispatch?.(te.SESSION_STARTED, { sessionId: p }));
|
|
3606
3606
|
});
|
|
3607
|
-
const
|
|
3607
|
+
const _ = await E.stream();
|
|
3608
3608
|
if (s !== t.generation) {
|
|
3609
3609
|
try {
|
|
3610
3610
|
await E.stopStreaming();
|
|
@@ -3612,9 +3612,9 @@ async function or(t, e, n, o, c) {
|
|
|
3612
3612
|
}
|
|
3613
3613
|
return;
|
|
3614
3614
|
}
|
|
3615
|
-
if (t.client.value = E, o &&
|
|
3616
|
-
const
|
|
3617
|
-
|
|
3615
|
+
if (t.client.value = E, o && _.length > 0) {
|
|
3616
|
+
const p = _.find((d) => d.getVideoTracks().length > 0);
|
|
3617
|
+
p && (o.srcObject = p);
|
|
3618
3618
|
}
|
|
3619
3619
|
} catch (l) {
|
|
3620
3620
|
if (s !== t.generation) return;
|
|
@@ -3653,9 +3653,9 @@ function ur(t, e, n, o) {
|
|
|
3653
3653
|
c.current || (c.current = nr());
|
|
3654
3654
|
const s = c.current;
|
|
3655
3655
|
s.dispatch = o ?? null;
|
|
3656
|
-
const u = t || (n ?
|
|
3656
|
+
const u = t || (n ? ei(n).personaId : void 0), l = !!u || !!n;
|
|
3657
3657
|
s.isConfigured.value !== l && (s.isConfigured.value = l);
|
|
3658
|
-
const E = e ||
|
|
3658
|
+
const E = e || tr;
|
|
3659
3659
|
return {
|
|
3660
3660
|
connectionStatus: s.connectionStatus,
|
|
3661
3661
|
isStreaming: s.isStreaming,
|
|
@@ -3670,15 +3670,20 @@ function ur(t, e, n, o) {
|
|
|
3670
3670
|
personaName: s.personaName,
|
|
3671
3671
|
serverConfig: s.serverConfig,
|
|
3672
3672
|
fetchWidgetConfig: () => {
|
|
3673
|
-
if (
|
|
3674
|
-
s
|
|
3673
|
+
if (u) {
|
|
3674
|
+
rr(s, u, E);
|
|
3675
|
+
return;
|
|
3676
|
+
}
|
|
3677
|
+
if (n) {
|
|
3678
|
+
const p = ei(n).widgetConfig;
|
|
3679
|
+
p && (typeof p.personaName == "string" && p.personaName && (s.personaName.value = p.personaName), typeof p.avatarImageUrl == "string" && p.avatarImageUrl && (s.avatarThumbnailUrl.value = p.avatarImageUrl), typeof p.avatarVideoUrl == "string" && p.avatarVideoUrl && (s.avatarVideoUrl.value = p.avatarVideoUrl), p.removeWatermark === !0 && (s.serverConfig.value = { removeWatermark: !0 })), s.isReady.value = !0;
|
|
3675
3680
|
return;
|
|
3676
3681
|
}
|
|
3677
|
-
|
|
3682
|
+
s.isReady.value = !0;
|
|
3678
3683
|
},
|
|
3679
|
-
startSession: (
|
|
3684
|
+
startSession: (_) => !u && !n ? (s.error.value = "No agent ID or session token configured", Promise.resolve()) : or(s, u || "", E, _, n),
|
|
3680
3685
|
stopSession: () => sr(s),
|
|
3681
|
-
sendMessage: (
|
|
3686
|
+
sendMessage: (_) => ar(s, _),
|
|
3682
3687
|
toggleMute: () => lr(s),
|
|
3683
3688
|
cleanup: () => cr(s)
|
|
3684
3689
|
};
|
|
@@ -3753,17 +3758,17 @@ function yr({
|
|
|
3753
3758
|
onCollapse: u,
|
|
3754
3759
|
onStop: l
|
|
3755
3760
|
}) {
|
|
3756
|
-
const E = Le(null), [
|
|
3761
|
+
const E = Le(null), [_, p] = je(""), [d, y] = je(null), [g, S] = je(!1), C = Le(null), A = e.connectionStatus.value === "connected", I = e.connectionStatus.value === "connecting", b = e.connectionStatus.value === "error", T = e.isStreaming.value, O = !I && !A && !b, N = We(async () => {
|
|
3757
3762
|
n.current && await e.startSession(n.current);
|
|
3758
3763
|
}, [e.startSession]), Y = We(() => {
|
|
3759
|
-
if (!
|
|
3760
|
-
const $ =
|
|
3761
|
-
e.sendMessage($),
|
|
3764
|
+
if (!_.trim()) return;
|
|
3765
|
+
const $ = _.trim();
|
|
3766
|
+
e.sendMessage($), p(""), E.current?.focus(), C.current && clearTimeout(C.current), S(!1), y($), C.current = window.setTimeout(() => {
|
|
3762
3767
|
S(!0), C.current = window.setTimeout(() => {
|
|
3763
3768
|
y(null), S(!1);
|
|
3764
3769
|
}, 400);
|
|
3765
3770
|
}, 2600);
|
|
3766
|
-
}, [
|
|
3771
|
+
}, [_]), ie = We(($) => {
|
|
3767
3772
|
$.key === "Enter" && !$.shiftKey && ($.preventDefault(), Y());
|
|
3768
3773
|
}, [Y]);
|
|
3769
3774
|
return He(() => () => {
|
|
@@ -3853,8 +3858,8 @@ function yr({
|
|
|
3853
3858
|
type: "text",
|
|
3854
3859
|
class: "anam-ctl-input",
|
|
3855
3860
|
placeholder: "Type a message...",
|
|
3856
|
-
value:
|
|
3857
|
-
onInput: ($) =>
|
|
3861
|
+
value: _,
|
|
3862
|
+
onInput: ($) => p($.target.value),
|
|
3858
3863
|
onKeyDown: ie,
|
|
3859
3864
|
disabled: !A
|
|
3860
3865
|
}
|
|
@@ -3864,7 +3869,7 @@ function yr({
|
|
|
3864
3869
|
{
|
|
3865
3870
|
class: "anam-ctl-send",
|
|
3866
3871
|
onClick: Y,
|
|
3867
|
-
disabled: !A || !
|
|
3872
|
+
disabled: !A || !_.trim(),
|
|
3868
3873
|
"aria-label": "Send message",
|
|
3869
3874
|
children: /* @__PURE__ */ w(vr, {})
|
|
3870
3875
|
}
|
|
@@ -3911,7 +3916,7 @@ function wr(t) {
|
|
|
3911
3916
|
), l = Ie(() => {
|
|
3912
3917
|
const T = s.serverConfig.value;
|
|
3913
3918
|
return _t(_t({ ...Yt }, T ?? {}), u);
|
|
3914
|
-
}, [s.serverConfig.value, u]), E =
|
|
3919
|
+
}, [s.serverConfig.value, u]), E = Oi(
|
|
3915
3920
|
l.layout === "floating" ? l.initialState : "expanded"
|
|
3916
3921
|
);
|
|
3917
3922
|
He(() => {
|
|
@@ -3919,9 +3924,9 @@ function wr(t) {
|
|
|
3919
3924
|
}, [l.layout, l.initialState]), He(() => {
|
|
3920
3925
|
s.fetchWidgetConfig();
|
|
3921
3926
|
}, [c, t["api-base-url"], t["session-token"]]);
|
|
3922
|
-
const
|
|
3927
|
+
const _ = t["avatar-url"] || s.avatarThumbnailUrl.value || null, p = t["avatar-video-url"] || s.avatarVideoUrl.value || null, y = t["agent-name"] || s.personaName.value, g = l.callToAction === Yt.callToAction && y ? `Talk to ${y}` : l.callToAction, S = Ie(() => {
|
|
3923
3928
|
if (l.layout === "inline") return "";
|
|
3924
|
-
const T =
|
|
3929
|
+
const T = wn(l.position);
|
|
3925
3930
|
return Object.entries(T).map(([O, N]) => `${O}: ${N}`).join("; ");
|
|
3926
3931
|
}, [l.layout, l.position]), C = l.layout === "floating", A = () => {
|
|
3927
3932
|
E.value = "expanded", o(te.EXPANDED, {});
|
|
@@ -3943,7 +3948,7 @@ function wr(t) {
|
|
|
3943
3948
|
class: "anam-trigger",
|
|
3944
3949
|
onClick: A,
|
|
3945
3950
|
"aria-label": g,
|
|
3946
|
-
children:
|
|
3951
|
+
children: _ ? /* @__PURE__ */ w("img", { src: _, alt: "Avatar" }) : /* @__PURE__ */ w(Et, {})
|
|
3947
3952
|
}
|
|
3948
3953
|
),
|
|
3949
3954
|
b && /* @__PURE__ */ w(
|
|
@@ -3952,8 +3957,8 @@ function wr(t) {
|
|
|
3952
3957
|
config: l,
|
|
3953
3958
|
session: s,
|
|
3954
3959
|
videoRef: e,
|
|
3955
|
-
avatarSrc:
|
|
3956
|
-
avatarVideoSrc:
|
|
3960
|
+
avatarSrc: _,
|
|
3961
|
+
avatarVideoSrc: p,
|
|
3957
3962
|
displayCta: g,
|
|
3958
3963
|
onCollapse: C ? I : null,
|
|
3959
3964
|
onStop: C ? null : () => s.stopSession()
|
|
@@ -3991,14 +3996,14 @@ const Cr = [
|
|
|
3991
3996
|
"agent-name"
|
|
3992
3997
|
// Override persona name for CTA (Lab preview)
|
|
3993
3998
|
];
|
|
3994
|
-
function
|
|
3995
|
-
|
|
3999
|
+
function ti(t = "anam-agent") {
|
|
4000
|
+
on(Sr, t, [...Cr], {
|
|
3996
4001
|
shadow: !0
|
|
3997
4002
|
});
|
|
3998
4003
|
}
|
|
3999
|
-
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () =>
|
|
4004
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => ti()) : ti());
|
|
4000
4005
|
export {
|
|
4001
4006
|
Yt as DefaultConfig,
|
|
4002
4007
|
te as WidgetEventNames,
|
|
4003
|
-
|
|
4008
|
+
ti as registerWidget
|
|
4004
4009
|
};
|