@anam-ai/agent-widget 0.1.0-alpha.12 → 0.1.0-alpha.14
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 +1124 -1087
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Fe, k,
|
|
1
|
+
var Fe, k, pi, _i, Ee, Wt, Ei, mi, gi, It, pt, _t, Me = {}, vi = [], cn = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, it = Array.isArray;
|
|
2
2
|
function ie(t, e) {
|
|
3
3
|
for (var n in e) t[n] = e[n];
|
|
4
4
|
return t;
|
|
@@ -7,16 +7,16 @@ function bt(t) {
|
|
|
7
7
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
8
8
|
}
|
|
9
9
|
function Ce(t, e, n) {
|
|
10
|
-
var o,
|
|
11
|
-
for (a in e) a == "key" ? o = e[a] : a == "ref" ?
|
|
12
|
-
if (arguments.length > 2 && (
|
|
13
|
-
return xe(t,
|
|
10
|
+
var o, u, a, c = {};
|
|
11
|
+
for (a in e) a == "key" ? o = e[a] : a == "ref" ? u = e[a] : c[a] = e[a];
|
|
12
|
+
if (arguments.length > 2 && (c.children = arguments.length > 3 ? Fe.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (a in t.defaultProps) c[a] === void 0 && (c[a] = t.defaultProps[a]);
|
|
13
|
+
return xe(t, c, o, u, null);
|
|
14
14
|
}
|
|
15
|
-
function xe(t, e, n, o,
|
|
16
|
-
var a = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v:
|
|
17
|
-
return
|
|
15
|
+
function xe(t, e, n, o, u) {
|
|
16
|
+
var a = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: u ?? ++pi, __i: -1, __u: 0 };
|
|
17
|
+
return u == null && k.vnode != null && k.vnode(a), a;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function _e(t) {
|
|
20
20
|
return t.children;
|
|
21
21
|
}
|
|
22
22
|
function Oe(t, e) {
|
|
@@ -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 yi(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 yi(t);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
(!t.__d && (t.__d = !0) && Ee.push(t) && !
|
|
40
|
+
function zt(t) {
|
|
41
|
+
(!t.__d && (t.__d = !0) && Ee.push(t) && !Ke.__r++ || Wt != k.debounceRendering) && ((Wt = k.debounceRendering) || Ei)(Ke);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
for (var t, e, n, o,
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
function
|
|
48
|
-
var d,
|
|
49
|
-
for (
|
|
50
|
-
return n.__e = C,
|
|
51
|
-
}
|
|
52
|
-
function
|
|
53
|
-
var a,
|
|
54
|
-
for (t.__k = new Array(
|
|
55
|
-
if (d) for (a = 0; a < _; a++) (l = n[a]) != null && (2 & l.__u) == 0 && (l.__e == o && (o = be(l)),
|
|
43
|
+
function Ke() {
|
|
44
|
+
for (var t, e, n, o, u, a, c, l = 1; Ee.length; ) Ee.length > l && Ee.sort(mi), t = Ee.shift(), l = Ee.length, t.__d && (n = void 0, o = void 0, u = (o = (e = t).__v).__e, a = [], c = [], e.__P && ((n = ie({}, o)).__v = o.__v + 1, k.vnode && k.vnode(n), At(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [u] : null, a, u ?? be(o), !!(32 & o.__u), c), n.__v = o.__v, n.__.__k[n.__i] = n, Ci(a, n, c), o.__e = o.__ = null, n.__e != u && yi(n)));
|
|
45
|
+
Ke.__r = 0;
|
|
46
|
+
}
|
|
47
|
+
function Si(t, e, n, o, u, a, c, l, E, p, _) {
|
|
48
|
+
var d, S, g, y, C, A, I, b = o && o.__k || vi, N = e.length;
|
|
49
|
+
for (E = un(n, e, b, E, N), d = 0; d < N; d++) (g = n.__k[d]) != null && (S = g.__i == -1 ? Me : b[g.__i] || Me, g.__i = d, A = At(t, g, S, u, a, c, l, E, p, _), y = g.__e, g.ref && S.ref != g.ref && (S.ref && Tt(S.ref, null, g), _.push(g.ref, g.__c || y, g)), C == null && y != null && (C = y), (I = !!(4 & g.__u)) || S.__k === g.__k ? E = wi(g, E, t, I) : typeof g.type == "function" && A !== void 0 ? E = A : y && (E = y.nextSibling), g.__u &= -7);
|
|
50
|
+
return n.__e = C, E;
|
|
51
|
+
}
|
|
52
|
+
function un(t, e, n, o, u) {
|
|
53
|
+
var a, c, l, E, p, _ = n.length, d = _, S = 0;
|
|
54
|
+
for (t.__k = new Array(u), a = 0; a < u; a++) (c = e[a]) != null && typeof c != "boolean" && typeof c != "function" ? (typeof c == "string" || typeof c == "number" || typeof c == "bigint" || c.constructor == String ? c = t.__k[a] = xe(null, c, null, null, null) : it(c) ? c = t.__k[a] = xe(_e, { children: c }, null, null, null) : c.constructor === void 0 && c.__b > 0 ? c = t.__k[a] = xe(c.type, c.props, c.key, c.ref ? c.ref : null, c.__v) : t.__k[a] = c, E = a + S, c.__ = t, c.__b = t.__b + 1, l = null, (p = c.__i = dn(c, n, E, d)) != -1 && (d--, (l = n[p]) && (l.__u |= 2)), l == null || l.__v == null ? (p == -1 && (u > _ ? S-- : u < _ && S++), typeof c.type != "function" && (c.__u |= 4)) : p != E && (p == E - 1 ? S-- : p == E + 1 ? S++ : (p > E ? S-- : S++, c.__u |= 4))) : t.__k[a] = null;
|
|
55
|
+
if (d) for (a = 0; a < _; a++) (l = n[a]) != null && (2 & l.__u) == 0 && (l.__e == o && (o = be(l)), bi(l, l));
|
|
56
56
|
return o;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
var
|
|
58
|
+
function wi(t, e, n, o) {
|
|
59
|
+
var u, a;
|
|
60
60
|
if (typeof t.type == "function") {
|
|
61
|
-
for (
|
|
61
|
+
for (u = t.__k, a = 0; u && a < u.length; a++) u[a] && (u[a].__ = t, e = wi(u[a], 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,27 +67,27 @@ function Si(t, e, n, o) {
|
|
|
67
67
|
while (e != null && e.nodeType == 8);
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
var
|
|
72
|
-
if (p === null && l == null || _ && l == p.key &&
|
|
70
|
+
function dn(t, e, n, o) {
|
|
71
|
+
var u, a, c, l = t.key, E = t.type, p = e[n], _ = p != null && (2 & p.__u) == 0;
|
|
72
|
+
if (p === null && l == null || _ && l == p.key && E == p.type) return n;
|
|
73
73
|
if (o > (_ ? 1 : 0)) {
|
|
74
|
-
for (
|
|
74
|
+
for (u = n - 1, a = n + 1; u >= 0 || a < e.length; ) if ((p = e[c = u >= 0 ? u-- : a++]) != null && (2 & p.__u) == 0 && l == p.key && E == p.type) return c;
|
|
75
75
|
}
|
|
76
76
|
return -1;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" ||
|
|
78
|
+
function qt(t, e, n) {
|
|
79
|
+
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || cn.test(e) ? n : n + "px";
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
var a,
|
|
81
|
+
function Ge(t, e, n, o, u) {
|
|
82
|
+
var a, c;
|
|
83
83
|
e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
|
|
84
84
|
else {
|
|
85
|
-
if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n ||
|
|
86
|
-
if (n) for (e in n) o && n[e] == o[e] ||
|
|
85
|
+
if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || qt(t.style, e, "");
|
|
86
|
+
if (n) for (e in n) o && n[e] == o[e] || qt(t.style, e, n[e]);
|
|
87
87
|
}
|
|
88
|
-
else if (e[0] == "o" && e[1] == "n") a = e != (e = e.replace(
|
|
88
|
+
else if (e[0] == "o" && e[1] == "n") a = e != (e = e.replace(gi, "$1")), c = e.toLowerCase(), e = c in t || e == "onFocusOut" || e == "onFocusIn" ? c.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + a] = n, n ? o ? n.u = o.u : (n.u = It, t.addEventListener(e, a ? _t : pt, a)) : t.removeEventListener(e, a ? _t : pt, a);
|
|
89
89
|
else {
|
|
90
|
-
if (
|
|
90
|
+
if (u == "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 {
|
|
92
92
|
t[e] = n ?? "";
|
|
93
93
|
break e;
|
|
@@ -96,7 +96,7 @@ function Ve(t, e, n, o, c) {
|
|
|
96
96
|
typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Yt(t) {
|
|
100
100
|
return function(e) {
|
|
101
101
|
if (this.l) {
|
|
102
102
|
var n = this.l[e.type + t];
|
|
@@ -106,66 +106,66 @@ function qt(t) {
|
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function At(t, e, n, o,
|
|
110
|
-
var _, d,
|
|
109
|
+
function At(t, e, n, o, u, a, c, l, E, p) {
|
|
110
|
+
var _, d, S, g, y, C, A, I, b, N, D, x, Z, V, se, ne, re, Q = e.type;
|
|
111
111
|
if (e.constructor !== void 0) return null;
|
|
112
|
-
128 & n.__u && (
|
|
112
|
+
128 & n.__u && (E = !!(32 & n.__u), a = [l = e.__e = n.__e]), (_ = k.__b) && _(e);
|
|
113
113
|
e: if (typeof Q == "function") try {
|
|
114
|
-
if (I = e.props, b = "prototype" in Q && Q.prototype.render,
|
|
114
|
+
if (I = e.props, b = "prototype" in Q && Q.prototype.render, N = (_ = Q.contextType) && o[_.__c], D = _ ? N ? N.props.value : _.__ : o, n.__c ? A = (d = e.__c = n.__c).__ = d.__E : (b ? e.__c = d = new Q(I, D) : (e.__c = d = new Oe(I, D), d.constructor = Q, d.render = fn), N && N.sub(d), d.state || (d.state = {}), d.__n = o, S = d.__d = !0, d.__h = [], d._sb = []), b && d.__s == null && (d.__s = d.state), b && Q.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = ie({}, d.__s)), ie(d.__s, Q.getDerivedStateFromProps(I, d.__s))), g = d.props, y = d.state, d.__v = e, S) b && Q.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), b && d.componentDidMount != null && d.__h.push(d.componentDidMount);
|
|
115
115
|
else {
|
|
116
116
|
if (b && Q.getDerivedStateFromProps == null && I !== g && d.componentWillReceiveProps != null && d.componentWillReceiveProps(I, D), e.__v == n.__v || !d.__e && d.shouldComponentUpdate != null && d.shouldComponentUpdate(I, d.__s, D) === !1) {
|
|
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(
|
|
118
|
-
|
|
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(ae) {
|
|
118
|
+
ae && (ae.__ = e);
|
|
119
119
|
}), x = 0; x < d._sb.length; x++) d.__h.push(d._sb[x]);
|
|
120
|
-
d._sb = [], d.__h.length &&
|
|
120
|
+
d._sb = [], d.__h.length && c.push(d);
|
|
121
121
|
break e;
|
|
122
122
|
}
|
|
123
123
|
d.componentWillUpdate != null && d.componentWillUpdate(I, d.__s, D), b && d.componentDidUpdate != null && d.__h.push(function() {
|
|
124
|
-
d.componentDidUpdate(g,
|
|
124
|
+
d.componentDidUpdate(g, y, C);
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
if (d.context = D, d.props = I, d.__P = t, d.__e = !1, Z = k.__r,
|
|
128
|
-
for (d.state = d.__s, d.__d = !1, Z && Z(e), _ = d.render(d.props, d.state, d.context),
|
|
127
|
+
if (d.context = D, d.props = I, d.__P = t, d.__e = !1, Z = k.__r, V = 0, b) {
|
|
128
|
+
for (d.state = d.__s, d.__d = !1, Z && Z(e), _ = d.render(d.props, d.state, d.context), se = 0; se < d._sb.length; se++) d.__h.push(d._sb[se]);
|
|
129
129
|
d._sb = [];
|
|
130
130
|
} else do
|
|
131
131
|
d.__d = !1, Z && Z(e), _ = d.render(d.props, d.state, d.context), d.state = d.__s;
|
|
132
|
-
while (d.__d && ++
|
|
133
|
-
d.state = d.__s, d.getChildContext != null && (o = ie(ie({}, o), d.getChildContext())), b && !
|
|
134
|
-
} catch (
|
|
135
|
-
if (e.__v = null,
|
|
136
|
-
for (e.__u |=
|
|
132
|
+
while (d.__d && ++V < 25);
|
|
133
|
+
d.state = d.__s, d.getChildContext != null && (o = ie(ie({}, o), d.getChildContext())), b && !S && d.getSnapshotBeforeUpdate != null && (C = d.getSnapshotBeforeUpdate(g, y)), ne = _, _ != null && _.type === _e && _.key == null && (ne = Ii(_.props.children)), l = Si(t, it(ne) ? ne : [ne], e, n, o, u, a, c, l, E, p), d.base = e.__e, e.__u &= -161, d.__h.length && c.push(d), A && (d.__E = d.__ = null);
|
|
134
|
+
} catch (ae) {
|
|
135
|
+
if (e.__v = null, E || a != null) if (ae.then) {
|
|
136
|
+
for (e.__u |= E ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
137
137
|
a[a.indexOf(l)] = null, e.__e = l;
|
|
138
138
|
} else {
|
|
139
139
|
for (re = a.length; re--; ) bt(a[re]);
|
|
140
|
-
|
|
140
|
+
Et(e);
|
|
141
141
|
}
|
|
142
|
-
else e.__e = n.__e, e.__k = n.__k,
|
|
143
|
-
k.__e(
|
|
142
|
+
else e.__e = n.__e, e.__k = n.__k, ae.then || Et(e);
|
|
143
|
+
k.__e(ae, e, n);
|
|
144
144
|
}
|
|
145
|
-
else a == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e =
|
|
145
|
+
else a == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = hn(n.__e, e, n, o, u, a, c, E, p);
|
|
146
146
|
return (_ = k.diffed) && _(e), 128 & e.__u ? void 0 : l;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(
|
|
148
|
+
function Et(t) {
|
|
149
|
+
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(Et);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function Ci(t, e, n) {
|
|
152
152
|
for (var o = 0; o < n.length; o++) Tt(n[o], n[++o], n[++o]);
|
|
153
|
-
k.__c && k.__c(e, t), t.some(function(
|
|
153
|
+
k.__c && k.__c(e, t), t.some(function(u) {
|
|
154
154
|
try {
|
|
155
|
-
t =
|
|
156
|
-
a.call(
|
|
155
|
+
t = u.__h, u.__h = [], t.some(function(a) {
|
|
156
|
+
a.call(u);
|
|
157
157
|
});
|
|
158
158
|
} catch (a) {
|
|
159
|
-
k.__e(a,
|
|
159
|
+
k.__e(a, u.__v);
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t :
|
|
163
|
+
function Ii(t) {
|
|
164
|
+
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : it(t) ? t.map(Ii) : ie({}, t);
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
var p, _, d,
|
|
168
|
-
if (b == "svg" ?
|
|
166
|
+
function hn(t, e, n, o, u, a, c, l, E) {
|
|
167
|
+
var p, _, d, S, g, y, C, A = n.props || Me, I = e.props, b = e.type;
|
|
168
|
+
if (b == "svg" ? u = "http://www.w3.org/2000/svg" : b == "math" ? u = "http://www.w3.org/1998/Math/MathML" : u || (u = "http://www.w3.org/1999/xhtml"), a != null) {
|
|
169
169
|
for (p = 0; p < a.length; p++) if ((g = a[p]) && "setAttribute" in g == !!b && (b ? g.localName == b : g.nodeType == 3)) {
|
|
170
170
|
t = g, a[p] = null;
|
|
171
171
|
break;
|
|
@@ -173,7 +173,7 @@ function dn(t, e, n, o, c, a, u, l, m) {
|
|
|
173
173
|
}
|
|
174
174
|
if (t == null) {
|
|
175
175
|
if (b == null) return document.createTextNode(I);
|
|
176
|
-
t = document.createElementNS(
|
|
176
|
+
t = document.createElementNS(u, b, I.is && I), l && (k.__m && k.__m(e, a), l = !1), a = null;
|
|
177
177
|
}
|
|
178
178
|
if (b == null) A === I || l && t.data == I || (t.data = I);
|
|
179
179
|
else {
|
|
@@ -182,13 +182,13 @@ function dn(t, e, n, o, c, a, u, l, m) {
|
|
|
182
182
|
if (p == "dangerouslySetInnerHTML") d = g;
|
|
183
183
|
else if (!(p in I)) {
|
|
184
184
|
if (p == "value" && "defaultValue" in I || p == "checked" && "defaultChecked" in I) continue;
|
|
185
|
-
|
|
185
|
+
Ge(t, p, null, g, u);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
for (p in I) g = I[p], p == "children" ?
|
|
188
|
+
for (p in I) g = I[p], p == "children" ? S = g : p == "dangerouslySetInnerHTML" ? _ = g : p == "value" ? y = g : p == "checked" ? C = g : l && typeof g != "function" || A[p] === g || Ge(t, p, g, A[p], u);
|
|
189
189
|
if (_) l || d && (_.__html == d.__html || _.__html == t.innerHTML) || (t.innerHTML = _.__html), e.__k = [];
|
|
190
|
-
else if (d && (t.innerHTML = ""),
|
|
191
|
-
l || (p = "value", b == "progress" &&
|
|
190
|
+
else if (d && (t.innerHTML = ""), Si(e.type == "template" ? t.content : t, it(S) ? S : [S], e, n, o, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : u, a, c, a ? a[0] : n.__k && be(n, 0), l, E), a != null) for (p = a.length; p--; ) bt(a[p]);
|
|
191
|
+
l || (p = "value", b == "progress" && y == null ? t.removeAttribute("value") : y != null && (y !== t[p] || b == "progress" && !y || b == "option" && y != A[p]) && Ge(t, p, y, A[p], u), p = "checked", C != null && C != t[p] && Ge(t, p, C, A[p], u));
|
|
192
192
|
}
|
|
193
193
|
return t;
|
|
194
194
|
}
|
|
@@ -198,12 +198,12 @@ function Tt(t, e, n) {
|
|
|
198
198
|
var o = typeof t.__u == "function";
|
|
199
199
|
o && t.__u(), o && e == null || (t.__u = t(e));
|
|
200
200
|
} else t.current = e;
|
|
201
|
-
} catch (
|
|
202
|
-
k.__e(
|
|
201
|
+
} catch (u) {
|
|
202
|
+
k.__e(u, n);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
var o,
|
|
205
|
+
function bi(t, e, n) {
|
|
206
|
+
var o, u;
|
|
207
207
|
if (k.unmount && k.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || Tt(o, null, e)), (o = t.__c) != null) {
|
|
208
208
|
if (o.componentWillUnmount) try {
|
|
209
209
|
o.componentWillUnmount();
|
|
@@ -212,243 +212,243 @@ function Ii(t, e, n) {
|
|
|
212
212
|
}
|
|
213
213
|
o.base = o.__P = null;
|
|
214
214
|
}
|
|
215
|
-
if (o = t.__k) for (
|
|
215
|
+
if (o = t.__k) for (u = 0; u < o.length; u++) o[u] && bi(o[u], e, n || typeof t.type != "function");
|
|
216
216
|
n || bt(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function fn(t, e, n) {
|
|
219
219
|
return this.constructor(t, n);
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
var o,
|
|
223
|
-
e == document && (e = document.documentElement), k.__ && k.__(t, e),
|
|
221
|
+
function nt(t, e, n) {
|
|
222
|
+
var o, u, a, c;
|
|
223
|
+
e == document && (e = document.documentElement), k.__ && k.__(t, e), u = (o = typeof n == "function") ? null : n && n.__k || e.__k, a = [], c = [], At(e, t = (!o && n || e).__k = Ce(_e, null, [t]), u || Me, Me, e.namespaceURI, !o && n ? [n] : u ? null : e.firstChild ? Fe.call(e.childNodes) : null, a, !o && n ? n : u ? u.__e : e.firstChild, o, c), Ci(a, t, c);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
|
|
225
|
+
function Ai(t, e) {
|
|
226
|
+
nt(t, e, Ai);
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
var o,
|
|
230
|
-
for (a in t.type && t.type.defaultProps && (
|
|
231
|
-
return arguments.length > 2 && (l.children = arguments.length > 3 ? Fe.call(arguments, 2) : n), xe(t.type, l, o || t.key,
|
|
228
|
+
function Ti(t, e, n) {
|
|
229
|
+
var o, u, a, c, l = ie({}, t.props);
|
|
230
|
+
for (a in t.type && t.type.defaultProps && (c = t.type.defaultProps), e) a == "key" ? o = e[a] : a == "ref" ? u = e[a] : l[a] = e[a] === void 0 && c != null ? c[a] : e[a];
|
|
231
|
+
return arguments.length > 2 && (l.children = arguments.length > 3 ? Fe.call(arguments, 2) : n), xe(t.type, l, o || t.key, u || t.ref, null);
|
|
232
232
|
}
|
|
233
|
-
Fe =
|
|
234
|
-
for (var
|
|
235
|
-
if ((a =
|
|
233
|
+
Fe = vi.slice, k = { __e: function(t, e, n, o) {
|
|
234
|
+
for (var u, a, c; e = e.__; ) if ((u = e.__c) && !u.__) try {
|
|
235
|
+
if ((a = u.constructor) && a.getDerivedStateFromError != null && (u.setState(a.getDerivedStateFromError(t)), c = u.__d), u.componentDidCatch != null && (u.componentDidCatch(t, o || {}), c = u.__d), c) return u.__E = u;
|
|
236
236
|
} catch (l) {
|
|
237
237
|
t = l;
|
|
238
238
|
}
|
|
239
239
|
throw t;
|
|
240
|
-
} },
|
|
240
|
+
} }, pi = 0, _i = function(t) {
|
|
241
241
|
return t != null && t.constructor === void 0;
|
|
242
242
|
}, Oe.prototype.setState = function(t, e) {
|
|
243
243
|
var n;
|
|
244
|
-
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = ie({}, this.state), typeof t == "function" && (t = t(ie({}, n), this.props)), t && ie(n, t), t != null && this.__v && (e && this._sb.push(e),
|
|
244
|
+
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = ie({}, this.state), typeof t == "function" && (t = t(ie({}, n), this.props)), t && ie(n, t), t != null && this.__v && (e && this._sb.push(e), zt(this));
|
|
245
245
|
}, Oe.prototype.forceUpdate = function(t) {
|
|
246
|
-
this.__v && (this.__e = !0, t && this.__h.push(t),
|
|
247
|
-
}, Oe.prototype.render =
|
|
246
|
+
this.__v && (this.__e = !0, t && this.__h.push(t), zt(this));
|
|
247
|
+
}, Oe.prototype.render = _e, Ee = [], Ei = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, mi = function(t, e) {
|
|
248
248
|
return t.__v.__b - e.__v.__b;
|
|
249
|
-
},
|
|
250
|
-
function
|
|
251
|
-
return
|
|
249
|
+
}, Ke.__r = 0, gi = /(PointerCapture)$|Capture$/i, It = 0, pt = Yt(!1), _t = Yt(!0);
|
|
250
|
+
function Je() {
|
|
251
|
+
return Je = Object.assign ? Object.assign.bind() : function(t) {
|
|
252
252
|
for (var e = 1; e < arguments.length; e++) {
|
|
253
253
|
var n = arguments[e];
|
|
254
254
|
for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
|
|
255
255
|
}
|
|
256
256
|
return t;
|
|
257
|
-
},
|
|
257
|
+
}, Je.apply(this, arguments);
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function Ri(t, e) {
|
|
260
260
|
if (t == null) return {};
|
|
261
|
-
var n, o,
|
|
262
|
-
for (o = 0; o < a.length; o++) e.indexOf(n = a[o]) >= 0 || (
|
|
263
|
-
return
|
|
264
|
-
}
|
|
265
|
-
var
|
|
266
|
-
function
|
|
267
|
-
function
|
|
268
|
-
var a,
|
|
269
|
-
return
|
|
270
|
-
}
|
|
271
|
-
return (
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
Object.defineProperty(
|
|
261
|
+
var n, o, u = {}, a = Object.keys(t);
|
|
262
|
+
for (o = 0; o < a.length; o++) e.indexOf(n = a[o]) >= 0 || (u[n] = t[n]);
|
|
263
|
+
return u;
|
|
264
|
+
}
|
|
265
|
+
var pn = ["context", "children"], _n = ["useFragment"];
|
|
266
|
+
function En(t, e, n, o) {
|
|
267
|
+
function u() {
|
|
268
|
+
var a, c = Reflect.construct(HTMLElement, [], u);
|
|
269
|
+
return c._vdomComponent = t, o && o.shadow ? (c._root = c.attachShadow({ mode: o.mode || "open", serializable: (a = o.serializable) != null && a }), o.adoptedStyleSheets && (c._root.adoptedStyleSheets = o.adoptedStyleSheets)) : c._root = c, c;
|
|
270
|
+
}
|
|
271
|
+
return (u.prototype = Object.create(HTMLElement.prototype)).constructor = u, u.prototype.connectedCallback = function() {
|
|
272
|
+
gn.call(this, o);
|
|
273
|
+
}, u.prototype.attributeChangedCallback = vn, u.prototype.disconnectedCallback = yn, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), u.observedAttributes = n, t.formAssociated && (u.formAssociated = !0), n.forEach(function(a) {
|
|
274
|
+
Object.defineProperty(u.prototype, a, { get: function() {
|
|
275
275
|
return this._vdom ? this._vdom.props[a] : this._props[a];
|
|
276
|
-
}, set: function(
|
|
277
|
-
this._vdom ? this.attributeChangedCallback(a, null,
|
|
278
|
-
var l = typeof
|
|
279
|
-
|
|
276
|
+
}, set: function(c) {
|
|
277
|
+
this._vdom ? this.attributeChangedCallback(a, null, c) : (this._props || (this._props = {}), this._props[a] = c);
|
|
278
|
+
var l = typeof c;
|
|
279
|
+
c != null && l !== "string" && l !== "boolean" && l !== "number" || this.setAttribute(a, c);
|
|
280
280
|
} });
|
|
281
|
-
}), customElements.define(e || t.tagName || t.displayName || t.name,
|
|
281
|
+
}), customElements.define(e || t.tagName || t.displayName || t.name, u), u;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function mn(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 = Ri(t, pn);
|
|
288
|
+
return Ti(e, n);
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function gn(t) {
|
|
291
291
|
var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
|
|
292
|
-
this.dispatchEvent(e), this._vdom = Ce(
|
|
292
|
+
this.dispatchEvent(e), this._vdom = Ce(mn, Je({}, this._props, { context: e.detail.context }), xi(this, this._vdomComponent, t)), (this.hasAttribute("hydrate") ? Ai : nt)(this._vdom, this._root);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function Ni(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 vn(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[Ni(t)] = n, this._vdom = Ti(this._vdom, o), nt(this._vdom, this._root);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
|
|
305
|
+
function yn() {
|
|
306
|
+
nt(this._vdom = null, this._root);
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
var n = this, o = t.useFragment,
|
|
310
|
-
return Ce(o ?
|
|
311
|
-
a ? (n.ref = a, n._listener || (n._listener = function(
|
|
312
|
-
|
|
308
|
+
function Kt(t, e) {
|
|
309
|
+
var n = this, o = t.useFragment, u = Ri(t, _n);
|
|
310
|
+
return Ce(o ? _e : "slot", Je({}, u, { ref: function(a) {
|
|
311
|
+
a ? (n.ref = a, n._listener || (n._listener = function(c) {
|
|
312
|
+
c.stopPropagation(), c.detail.context = e;
|
|
313
313
|
}, a.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
|
|
314
314
|
} }));
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function xi(t, e, n) {
|
|
317
317
|
if (t.nodeType === 3) return t.data;
|
|
318
318
|
if (t.nodeType !== 1) return null;
|
|
319
|
-
var o = [],
|
|
320
|
-
for (a =
|
|
319
|
+
var o = [], u = {}, a = 0, c = t.attributes, l = t.childNodes;
|
|
320
|
+
for (a = c.length; a--; ) c[a].name !== "slot" && (u[c[a].name] = c[a].value, u[Ni(c[a].name)] = c[a].value);
|
|
321
321
|
for (a = l.length; a--; ) {
|
|
322
|
-
var
|
|
323
|
-
p ?
|
|
322
|
+
var E = xi(l[a], null, n), p = l[a].slot;
|
|
323
|
+
p ? u[p] = Ce(Kt, { name: p }, E) : o[a] = E;
|
|
324
324
|
}
|
|
325
|
-
var _ = !(!n || !n.shadow), d = e ? Ce(
|
|
326
|
-
return !_ && e && (t.innerHTML = ""), Ce(e || t.nodeName.toLowerCase(),
|
|
325
|
+
var _ = !(!n || !n.shadow), d = e ? Ce(Kt, { useFragment: !_ }, o) : o;
|
|
326
|
+
return !_ && e && (t.innerHTML = ""), Ce(e || t.nodeName.toLowerCase(), u, d);
|
|
327
327
|
}
|
|
328
|
-
var
|
|
329
|
-
function w(t, e, n, o,
|
|
328
|
+
var Sn = 0;
|
|
329
|
+
function w(t, e, n, o, u, a) {
|
|
330
330
|
e || (e = {});
|
|
331
|
-
var
|
|
332
|
-
if ("ref" in
|
|
333
|
-
var p = { type: t, props:
|
|
334
|
-
if (typeof t == "function" && (
|
|
331
|
+
var c, l, E = e;
|
|
332
|
+
if ("ref" in E) for (l in E = {}, e) l == "ref" ? c = e[l] : E[l] = e[l];
|
|
333
|
+
var p = { type: t, props: E, key: n, ref: c, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Sn, __i: -1, __u: 0, __source: u, __self: a };
|
|
334
|
+
if (typeof t == "function" && (c = t.defaultProps)) for (l in c) E[l] === void 0 && (E[l] = c[l]);
|
|
335
335
|
return k.vnode && k.vnode(p), p;
|
|
336
336
|
}
|
|
337
|
-
var
|
|
337
|
+
var Ue, P, ct, Jt, Le = 0, Oi = [], F = k, Xt = F.__b, Zt = F.__r, Qt = F.diffed, ei = F.__c, ti = F.unmount, ii = F.__;
|
|
338
338
|
function Rt(t, e) {
|
|
339
|
-
F.__h && F.__h(P, t,
|
|
339
|
+
F.__h && F.__h(P, t, Le || e), Le = 0;
|
|
340
340
|
var n = P.__H || (P.__H = { __: [], __h: [] });
|
|
341
341
|
return t >= n.__.length && n.__.push({}), n.__[t];
|
|
342
342
|
}
|
|
343
|
-
function
|
|
344
|
-
return
|
|
343
|
+
function ze(t) {
|
|
344
|
+
return Le = 1, wn(Di, t);
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
var o = Rt(
|
|
348
|
-
if (o.t = t, !o.__c && (o.__ = [
|
|
349
|
-
var
|
|
350
|
-
|
|
346
|
+
function wn(t, e, n) {
|
|
347
|
+
var o = Rt(Ue++, 2);
|
|
348
|
+
if (o.t = t, !o.__c && (o.__ = [Di(void 0, e), function(l) {
|
|
349
|
+
var E = o.__N ? o.__N[0] : o.__[0], p = o.t(E, l);
|
|
350
|
+
E !== p && (o.__N = [p, o.__[1]], o.__c.setState({}));
|
|
351
351
|
}], o.__c = P, !P.__f)) {
|
|
352
|
-
var
|
|
352
|
+
var u = function(l, E, p) {
|
|
353
353
|
if (!o.__c.__H) return !0;
|
|
354
|
-
var _ = o.__c.__H.__.filter(function(
|
|
355
|
-
return !!
|
|
354
|
+
var _ = o.__c.__H.__.filter(function(S) {
|
|
355
|
+
return !!S.__c;
|
|
356
356
|
});
|
|
357
|
-
if (_.every(function(
|
|
358
|
-
return !
|
|
359
|
-
})) return !a || a.call(this, l,
|
|
357
|
+
if (_.every(function(S) {
|
|
358
|
+
return !S.__N;
|
|
359
|
+
})) return !a || a.call(this, l, E, p);
|
|
360
360
|
var d = o.__c.props !== l;
|
|
361
|
-
return _.forEach(function(
|
|
362
|
-
if (
|
|
363
|
-
var g =
|
|
364
|
-
|
|
361
|
+
return _.forEach(function(S) {
|
|
362
|
+
if (S.__N) {
|
|
363
|
+
var g = S.__[0];
|
|
364
|
+
S.__ = S.__N, S.__N = void 0, g !== S.__[0] && (d = !0);
|
|
365
365
|
}
|
|
366
|
-
}), a && a.call(this, l,
|
|
366
|
+
}), a && a.call(this, l, E, p) || d;
|
|
367
367
|
};
|
|
368
368
|
P.__f = !0;
|
|
369
|
-
var a = P.shouldComponentUpdate,
|
|
370
|
-
P.componentWillUpdate = function(l,
|
|
369
|
+
var a = P.shouldComponentUpdate, c = P.componentWillUpdate;
|
|
370
|
+
P.componentWillUpdate = function(l, E, p) {
|
|
371
371
|
if (this.__e) {
|
|
372
372
|
var _ = a;
|
|
373
|
-
a = void 0,
|
|
373
|
+
a = void 0, u(l, E, p), a = _;
|
|
374
374
|
}
|
|
375
|
-
|
|
376
|
-
}, P.shouldComponentUpdate =
|
|
375
|
+
c && c.call(this, l, E, p);
|
|
376
|
+
}, P.shouldComponentUpdate = u;
|
|
377
377
|
}
|
|
378
378
|
return o.__N || o.__;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
var n = Rt(
|
|
382
|
-
!F.__s &&
|
|
380
|
+
function mt(t, e) {
|
|
381
|
+
var n = Rt(Ue++, 3);
|
|
382
|
+
!F.__s && ki(n.__H, e) && (n.__ = t, n.u = e, P.__H.__h.push(n));
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
return
|
|
384
|
+
function gt(t) {
|
|
385
|
+
return Le = 5, Ie(function() {
|
|
386
386
|
return { current: t };
|
|
387
387
|
}, []);
|
|
388
388
|
}
|
|
389
389
|
function Ie(t, e) {
|
|
390
|
-
var n = Rt(
|
|
391
|
-
return
|
|
390
|
+
var n = Rt(Ue++, 7);
|
|
391
|
+
return ki(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
|
|
392
392
|
}
|
|
393
393
|
function je(t, e) {
|
|
394
|
-
return
|
|
394
|
+
return Le = 8, Ie(function() {
|
|
395
395
|
return t;
|
|
396
396
|
}, e);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
for (var t; t =
|
|
400
|
-
t.__H.__h.forEach(
|
|
398
|
+
function Cn() {
|
|
399
|
+
for (var t; t = Oi.shift(); ) if (t.__P && t.__H) try {
|
|
400
|
+
t.__H.__h.forEach(qe), t.__H.__h.forEach(vt), t.__H.__h = [];
|
|
401
401
|
} catch (e) {
|
|
402
402
|
t.__H.__h = [], F.__e(e, t.__v);
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
F.__b = function(t) {
|
|
406
|
-
P = null,
|
|
406
|
+
P = null, Xt && Xt(t);
|
|
407
407
|
}, F.__ = function(t, e) {
|
|
408
|
-
t && e.__k && e.__k.__m && (t.__m = e.__k.__m),
|
|
408
|
+
t && e.__k && e.__k.__m && (t.__m = e.__k.__m), ii && ii(t, e);
|
|
409
409
|
}, F.__r = function(t) {
|
|
410
|
-
|
|
410
|
+
Zt && Zt(t), Ue = 0;
|
|
411
411
|
var e = (P = t.__c).__H;
|
|
412
|
-
e && (
|
|
412
|
+
e && (ct === 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(
|
|
414
|
+
})) : (e.__h.forEach(qe), e.__h.forEach(vt), e.__h = [], Ue = 0)), ct = P;
|
|
415
415
|
}, F.diffed = function(t) {
|
|
416
|
-
|
|
416
|
+
Qt && Qt(t);
|
|
417
417
|
var e = t.__c;
|
|
418
|
-
e && e.__H && (e.__H.__h.length && (
|
|
418
|
+
e && e.__H && (e.__H.__h.length && (Oi.push(e) !== 1 && Jt === F.requestAnimationFrame || ((Jt = F.requestAnimationFrame) || In)(Cn)), e.__H.__.forEach(function(n) {
|
|
419
419
|
n.u && (n.__H = n.u), n.u = void 0;
|
|
420
|
-
})),
|
|
420
|
+
})), ct = P = null;
|
|
421
421
|
}, F.__c = function(t, e) {
|
|
422
422
|
e.some(function(n) {
|
|
423
423
|
try {
|
|
424
|
-
n.__h.forEach(
|
|
424
|
+
n.__h.forEach(qe), n.__h = n.__h.filter(function(o) {
|
|
425
425
|
return !o.__ || vt(o);
|
|
426
426
|
});
|
|
427
427
|
} catch (o) {
|
|
428
|
-
e.some(function(
|
|
429
|
-
|
|
428
|
+
e.some(function(u) {
|
|
429
|
+
u.__h && (u.__h = []);
|
|
430
430
|
}), e = [], F.__e(o, n.__v);
|
|
431
431
|
}
|
|
432
|
-
}),
|
|
432
|
+
}), ei && ei(t, e);
|
|
433
433
|
}, F.unmount = function(t) {
|
|
434
|
-
|
|
434
|
+
ti && ti(t);
|
|
435
435
|
var e, n = t.__c;
|
|
436
436
|
n && n.__H && (n.__H.__.forEach(function(o) {
|
|
437
437
|
try {
|
|
438
|
-
|
|
439
|
-
} catch (
|
|
440
|
-
e =
|
|
438
|
+
qe(o);
|
|
439
|
+
} catch (u) {
|
|
440
|
+
e = u;
|
|
441
441
|
}
|
|
442
442
|
}), n.__H = void 0, e && F.__e(e, n.__v));
|
|
443
443
|
};
|
|
444
|
-
var
|
|
445
|
-
function
|
|
444
|
+
var ni = typeof requestAnimationFrame == "function";
|
|
445
|
+
function In(t) {
|
|
446
446
|
var e, n = function() {
|
|
447
|
-
clearTimeout(o),
|
|
447
|
+
clearTimeout(o), ni && cancelAnimationFrame(e), setTimeout(t);
|
|
448
448
|
}, o = setTimeout(n, 35);
|
|
449
|
-
|
|
449
|
+
ni && (e = requestAnimationFrame(n));
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function qe(t) {
|
|
452
452
|
var e = P, n = t.__c;
|
|
453
453
|
typeof n == "function" && (t.__c = void 0, n()), P = e;
|
|
454
454
|
}
|
|
@@ -456,45 +456,45 @@ function vt(t) {
|
|
|
456
456
|
var e = P;
|
|
457
457
|
t.__c = t.__(), P = e;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function ki(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 Di(t, e) {
|
|
465
465
|
return typeof e == "function" ? e(t) : e;
|
|
466
466
|
}
|
|
467
|
-
var
|
|
468
|
-
function
|
|
469
|
-
if (
|
|
470
|
-
|
|
467
|
+
var bn = /* @__PURE__ */ Symbol.for("preact-signals");
|
|
468
|
+
function rt() {
|
|
469
|
+
if (fe > 1)
|
|
470
|
+
fe--;
|
|
471
471
|
else {
|
|
472
472
|
for (var t, e = !1; ke !== void 0; ) {
|
|
473
473
|
var n = ke;
|
|
474
474
|
for (ke = void 0, yt++; 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) && Li(n)) try {
|
|
477
477
|
n.c();
|
|
478
|
-
} catch (
|
|
479
|
-
e || (t =
|
|
478
|
+
} catch (u) {
|
|
479
|
+
e || (t = u, e = !0);
|
|
480
480
|
}
|
|
481
481
|
n = o;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
if (yt = 0,
|
|
484
|
+
if (yt = 0, fe--, e) throw t;
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
function
|
|
488
|
-
if (
|
|
489
|
-
|
|
487
|
+
function An(t) {
|
|
488
|
+
if (fe > 0) return t();
|
|
489
|
+
fe++;
|
|
490
490
|
try {
|
|
491
491
|
return t();
|
|
492
492
|
} finally {
|
|
493
|
-
|
|
493
|
+
rt();
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
var O = void 0;
|
|
497
|
-
function
|
|
497
|
+
function Mi(t) {
|
|
498
498
|
var e = O;
|
|
499
499
|
O = void 0;
|
|
500
500
|
try {
|
|
@@ -503,7 +503,7 @@ function Di(t) {
|
|
|
503
503
|
O = e;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
var ke = void 0,
|
|
506
|
+
var ke = void 0, fe = 0, yt = 0, Xe = 0;
|
|
507
507
|
function Ui(t) {
|
|
508
508
|
if (O !== void 0) {
|
|
509
509
|
var e = t.n;
|
|
@@ -513,31 +513,31 @@ function Ui(t) {
|
|
|
513
513
|
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = O.s, e.n = void 0, O.s.n = e, O.s = e), e;
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
function
|
|
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
|
-
|
|
520
|
-
|
|
519
|
+
H.prototype.brand = bn;
|
|
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 : Mi(function() {
|
|
526
526
|
var o;
|
|
527
527
|
(o = e.W) == null || o.call(e);
|
|
528
528
|
}));
|
|
529
529
|
};
|
|
530
|
-
|
|
530
|
+
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 &&
|
|
535
|
-
var
|
|
536
|
-
(
|
|
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 && Mi(function() {
|
|
535
|
+
var u;
|
|
536
|
+
(u = e.Z) == null || u.call(e);
|
|
537
537
|
}));
|
|
538
538
|
}
|
|
539
539
|
};
|
|
540
|
-
|
|
540
|
+
H.prototype.subscribe = function(t) {
|
|
541
541
|
var e = this;
|
|
542
542
|
return $e(function() {
|
|
543
543
|
var n = e.value, o = O;
|
|
@@ -549,16 +549,16 @@ j.prototype.subscribe = function(t) {
|
|
|
549
549
|
}
|
|
550
550
|
}, { name: "sub" });
|
|
551
551
|
};
|
|
552
|
-
|
|
552
|
+
H.prototype.valueOf = function() {
|
|
553
553
|
return this.value;
|
|
554
554
|
};
|
|
555
|
-
|
|
555
|
+
H.prototype.toString = function() {
|
|
556
556
|
return this.value + "";
|
|
557
557
|
};
|
|
558
|
-
|
|
558
|
+
H.prototype.toJSON = function() {
|
|
559
559
|
return this.value;
|
|
560
560
|
};
|
|
561
|
-
|
|
561
|
+
H.prototype.peek = function() {
|
|
562
562
|
var t = O;
|
|
563
563
|
O = void 0;
|
|
564
564
|
try {
|
|
@@ -567,24 +567,24 @@ j.prototype.peek = function() {
|
|
|
567
567
|
O = t;
|
|
568
568
|
}
|
|
569
569
|
};
|
|
570
|
-
Object.defineProperty(
|
|
570
|
+
Object.defineProperty(H.prototype, "value", { get: function() {
|
|
571
571
|
var t = Ui(this);
|
|
572
572
|
return t !== void 0 && (t.i = this.i), this.v;
|
|
573
573
|
}, set: function(t) {
|
|
574
574
|
if (t !== this.v) {
|
|
575
575
|
if (yt > 100) throw new Error("Cycle detected");
|
|
576
|
-
this.v = t, this.i++,
|
|
576
|
+
this.v = t, this.i++, Xe++, fe++;
|
|
577
577
|
try {
|
|
578
578
|
for (var e = this.t; e !== void 0; e = e.x) e.t.N();
|
|
579
579
|
} finally {
|
|
580
|
-
|
|
580
|
+
rt();
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
} });
|
|
584
|
-
function
|
|
585
|
-
return new
|
|
584
|
+
function q(t, e) {
|
|
585
|
+
return new H(t, e);
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Li(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
|
}
|
|
@@ -597,7 +597,7 @@ function Bi(t) {
|
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function Pi(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;
|
|
@@ -605,13 +605,13 @@ function Li(t) {
|
|
|
605
605
|
t.s = n;
|
|
606
606
|
}
|
|
607
607
|
function ge(t, e) {
|
|
608
|
-
|
|
608
|
+
H.call(this, void 0), this.x = t, this.s = void 0, this.g = Xe - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
|
|
609
609
|
}
|
|
610
|
-
ge.prototype = new
|
|
610
|
+
ge.prototype = new H();
|
|
611
611
|
ge.prototype.h = function() {
|
|
612
612
|
if (this.f &= -3, 1 & this.f) return !1;
|
|
613
|
-
if ((36 & this.f) == 32 || (this.f &= -5, this.g ===
|
|
614
|
-
if (this.g =
|
|
613
|
+
if ((36 & this.f) == 32 || (this.f &= -5, this.g === Xe)) return !0;
|
|
614
|
+
if (this.g = Xe, this.f |= 1, this.i > 0 && !Li(this))
|
|
615
615
|
return this.f &= -2, !0;
|
|
616
616
|
var t = O;
|
|
617
617
|
try {
|
|
@@ -621,17 +621,17 @@ ge.prototype.h = function() {
|
|
|
621
621
|
} catch (n) {
|
|
622
622
|
this.v = n, this.f |= 16, this.i++;
|
|
623
623
|
}
|
|
624
|
-
return O = t,
|
|
624
|
+
return O = t, Pi(this), this.f &= -2, !0;
|
|
625
625
|
};
|
|
626
626
|
ge.prototype.S = function(t) {
|
|
627
627
|
if (this.t === void 0) {
|
|
628
628
|
this.f |= 36;
|
|
629
629
|
for (var e = this.s; e !== void 0; e = e.n) e.S.S(e);
|
|
630
630
|
}
|
|
631
|
-
|
|
631
|
+
H.prototype.S.call(this, t);
|
|
632
632
|
};
|
|
633
633
|
ge.prototype.U = function(t) {
|
|
634
|
-
if (this.t !== void 0 && (
|
|
634
|
+
if (this.t !== void 0 && (H.prototype.U.call(this, t), this.t === void 0)) {
|
|
635
635
|
this.f &= -33;
|
|
636
636
|
for (var e = this.s; e !== void 0; e = e.n) e.S.U(e);
|
|
637
637
|
}
|
|
@@ -648,13 +648,13 @@ Object.defineProperty(ge.prototype, "value", { get: function() {
|
|
|
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
|
-
function
|
|
651
|
+
function ri(t, e) {
|
|
652
652
|
return new ge(t, e);
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function Fi(t) {
|
|
655
655
|
var e = t.u;
|
|
656
656
|
if (t.u = void 0, typeof e == "function") {
|
|
657
|
-
|
|
657
|
+
fe++;
|
|
658
658
|
var n = O;
|
|
659
659
|
O = void 0;
|
|
660
660
|
try {
|
|
@@ -662,17 +662,17 @@ function Pi(t) {
|
|
|
662
662
|
} catch (o) {
|
|
663
663
|
throw t.f &= -2, t.f |= 8, Nt(t), o;
|
|
664
664
|
} finally {
|
|
665
|
-
O = n,
|
|
665
|
+
O = n, rt();
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
669
|
function Nt(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, Fi(t);
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function Tn(t) {
|
|
674
674
|
if (O !== this) throw new Error("Out-of-order effect");
|
|
675
|
-
|
|
675
|
+
Pi(this), O = t, this.f &= -2, 8 & this.f && Nt(this), rt();
|
|
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, Fi(this), Bi(this), fe++;
|
|
693
693
|
var t = O;
|
|
694
|
-
return O = this,
|
|
694
|
+
return O = this, Tn.bind(this, t);
|
|
695
695
|
};
|
|
696
696
|
Ae.prototype.N = function() {
|
|
697
697
|
2 & this.f || (this.f |= 2, this.o = ke, ke = this);
|
|
@@ -706,110 +706,110 @@ function $e(t, e) {
|
|
|
706
706
|
var n = new Ae(t, e);
|
|
707
707
|
try {
|
|
708
708
|
n.c();
|
|
709
|
-
} catch (
|
|
710
|
-
throw n.d(),
|
|
709
|
+
} catch (u) {
|
|
710
|
+
throw n.d(), u;
|
|
711
711
|
}
|
|
712
712
|
var o = n.d.bind(n);
|
|
713
713
|
return o[Symbol.dispose] = o, o;
|
|
714
714
|
}
|
|
715
|
-
var
|
|
715
|
+
var $i, ut, Rn = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Vi = [];
|
|
716
716
|
$e(function() {
|
|
717
|
-
|
|
717
|
+
$i = this.N;
|
|
718
718
|
})();
|
|
719
719
|
function Te(t, e) {
|
|
720
720
|
k[t] = e.bind(null, k[t] || function() {
|
|
721
721
|
});
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
|
|
723
|
+
function Ze(t) {
|
|
724
|
+
ut && ut(), ut = t && t.S();
|
|
725
725
|
}
|
|
726
726
|
function Gi(t) {
|
|
727
|
-
var e = this, n = t.data, o =
|
|
727
|
+
var e = this, n = t.data, o = ji(n);
|
|
728
728
|
o.value = n;
|
|
729
|
-
var
|
|
730
|
-
for (var l = e,
|
|
731
|
-
|
|
729
|
+
var u = Ie(function() {
|
|
730
|
+
for (var l = e, E = e.__v; E = E.__; ) if (E.__c) {
|
|
731
|
+
E.__c.__$f |= 4;
|
|
732
732
|
break;
|
|
733
733
|
}
|
|
734
|
-
var p =
|
|
734
|
+
var p = ri(function() {
|
|
735
735
|
var g = o.value.value;
|
|
736
736
|
return g === 0 ? 0 : g === !0 ? "" : g || "";
|
|
737
|
-
}), _ =
|
|
738
|
-
return !Array.isArray(p.value) && !
|
|
737
|
+
}), _ = ri(function() {
|
|
738
|
+
return !Array.isArray(p.value) && !_i(p.value);
|
|
739
739
|
}), d = $e(function() {
|
|
740
|
-
if (this.N =
|
|
740
|
+
if (this.N = Hi, _.value) {
|
|
741
741
|
var g = p.value;
|
|
742
742
|
l.__v && l.__v.__e && l.__v.__e.nodeType === 3 && (l.__v.__e.data = g);
|
|
743
743
|
}
|
|
744
|
-
}),
|
|
744
|
+
}), S = e.__$u.d;
|
|
745
745
|
return e.__$u.d = function() {
|
|
746
|
-
d(),
|
|
746
|
+
d(), S.call(this);
|
|
747
747
|
}, [_, p];
|
|
748
|
-
}, []), a =
|
|
749
|
-
return a.value ?
|
|
748
|
+
}, []), a = u[0], c = u[1];
|
|
749
|
+
return a.value ? c.peek() : c.value;
|
|
750
750
|
}
|
|
751
751
|
Gi.displayName = "ReactiveTextNode";
|
|
752
|
-
Object.defineProperties(
|
|
752
|
+
Object.defineProperties(H.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Gi }, props: { configurable: !0, get: function() {
|
|
753
753
|
return { data: this };
|
|
754
754
|
} }, __b: { configurable: !0, value: 1 } });
|
|
755
755
|
Te("__b", function(t, e) {
|
|
756
756
|
if (typeof e.type == "string") {
|
|
757
757
|
var n, o = e.props;
|
|
758
|
-
for (var
|
|
759
|
-
var a = o[
|
|
760
|
-
a instanceof
|
|
758
|
+
for (var u in o) if (u !== "children") {
|
|
759
|
+
var a = o[u];
|
|
760
|
+
a instanceof H && (n || (e.__np = n = {}), n[u] = a, o[u] = a.peek());
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
763
|
t(e);
|
|
764
764
|
});
|
|
765
765
|
Te("__r", function(t, e) {
|
|
766
|
-
if (e.type !==
|
|
767
|
-
|
|
766
|
+
if (e.type !== _e) {
|
|
767
|
+
Ze();
|
|
768
768
|
var n, o = e.__c;
|
|
769
|
-
o && (o.__$f &= -2, (n = o.__$u) === void 0 && (o.__$u = n = (function(
|
|
770
|
-
var
|
|
769
|
+
o && (o.__$f &= -2, (n = o.__$u) === void 0 && (o.__$u = n = (function(u, a) {
|
|
770
|
+
var c;
|
|
771
771
|
return $e(function() {
|
|
772
|
-
|
|
773
|
-
}, { name: a }),
|
|
772
|
+
c = this;
|
|
773
|
+
}, { name: a }), c.c = u, c;
|
|
774
774
|
})(function() {
|
|
775
|
-
var
|
|
776
|
-
|
|
777
|
-
}, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))),
|
|
775
|
+
var u;
|
|
776
|
+
Rn && ((u = n.y) == null || u.call(n)), o.__$f |= 1, o.setState({});
|
|
777
|
+
}, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), Ze(n);
|
|
778
778
|
}
|
|
779
779
|
t(e);
|
|
780
780
|
});
|
|
781
781
|
Te("__e", function(t, e, n, o) {
|
|
782
|
-
|
|
782
|
+
Ze(), t(e, n, o);
|
|
783
783
|
});
|
|
784
784
|
Te("diffed", function(t, e) {
|
|
785
|
-
|
|
785
|
+
Ze();
|
|
786
786
|
var n;
|
|
787
787
|
if (typeof e.type == "string" && (n = e.__e)) {
|
|
788
|
-
var o = e.__np,
|
|
788
|
+
var o = e.__np, u = e.props;
|
|
789
789
|
if (o) {
|
|
790
790
|
var a = n.U;
|
|
791
|
-
if (a) for (var
|
|
792
|
-
var l = a[
|
|
793
|
-
l !== void 0 && !(
|
|
791
|
+
if (a) for (var c in a) {
|
|
792
|
+
var l = a[c];
|
|
793
|
+
l !== void 0 && !(c in o) && (l.d(), a[c] = void 0);
|
|
794
794
|
}
|
|
795
795
|
else
|
|
796
796
|
a = {}, n.U = a;
|
|
797
|
-
for (var
|
|
798
|
-
var p = a[
|
|
799
|
-
p === void 0 ? (p =
|
|
797
|
+
for (var E in o) {
|
|
798
|
+
var p = a[E], _ = o[E];
|
|
799
|
+
p === void 0 ? (p = Nn(n, E, _, u), a[E] = p) : p.o(_, u);
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
t(e);
|
|
804
804
|
});
|
|
805
|
-
function
|
|
806
|
-
var
|
|
807
|
-
return { o: function(
|
|
808
|
-
a.value =
|
|
805
|
+
function Nn(t, e, n, o) {
|
|
806
|
+
var u = e in t && t.ownerSVGElement === void 0, a = q(n);
|
|
807
|
+
return { o: function(c, l) {
|
|
808
|
+
a.value = c, o = l;
|
|
809
809
|
}, d: $e(function() {
|
|
810
|
-
this.N =
|
|
811
|
-
var
|
|
812
|
-
o[e] !==
|
|
810
|
+
this.N = Hi;
|
|
811
|
+
var c = a.value.value;
|
|
812
|
+
o[e] !== c && (o[e] = c, u ? t[e] = c : c != null && (c !== !1 || e[4] === "-") ? t.setAttribute(e, c) : t.removeAttribute(e));
|
|
813
813
|
}) };
|
|
814
814
|
}
|
|
815
815
|
Te("unmount", function(t, e) {
|
|
@@ -819,17 +819,17 @@ Te("unmount", function(t, e) {
|
|
|
819
819
|
var o = n.U;
|
|
820
820
|
if (o) {
|
|
821
821
|
n.U = void 0;
|
|
822
|
-
for (var
|
|
823
|
-
var a = o[
|
|
822
|
+
for (var u in o) {
|
|
823
|
+
var a = o[u];
|
|
824
824
|
a && a.d();
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
827
|
}
|
|
828
828
|
} else {
|
|
829
|
-
var
|
|
830
|
-
if (
|
|
831
|
-
var l =
|
|
832
|
-
l && (
|
|
829
|
+
var c = e.__c;
|
|
830
|
+
if (c) {
|
|
831
|
+
var l = c.__$u;
|
|
832
|
+
l && (c.__$u = void 0, l.d());
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
t(e);
|
|
@@ -840,36 +840,36 @@ Te("__h", function(t, e, n, o) {
|
|
|
840
840
|
Oe.prototype.shouldComponentUpdate = function(t, e) {
|
|
841
841
|
if (this.__R) return !0;
|
|
842
842
|
var n = this.__$u, o = n && n.s !== void 0;
|
|
843
|
-
for (var
|
|
843
|
+
for (var u in e) return !0;
|
|
844
844
|
if (this.__f || typeof this.u == "boolean" && this.u === !0) {
|
|
845
845
|
var a = 2 & this.__$f;
|
|
846
846
|
if (!(o || a || 4 & this.__$f) || 1 & this.__$f) return !0;
|
|
847
847
|
} else if (!(o || 4 & this.__$f) || 3 & this.__$f) return !0;
|
|
848
|
-
for (var
|
|
848
|
+
for (var c in t) if (c !== "__source" && t[c] !== this.props[c]) return !0;
|
|
849
849
|
for (var l in this.props) if (!(l in t)) return !0;
|
|
850
850
|
return !1;
|
|
851
851
|
};
|
|
852
|
-
function
|
|
853
|
-
return
|
|
854
|
-
return
|
|
852
|
+
function ji(t, e) {
|
|
853
|
+
return ze(function() {
|
|
854
|
+
return q(t, e);
|
|
855
855
|
})[0];
|
|
856
856
|
}
|
|
857
|
-
var
|
|
857
|
+
var xn = function(t) {
|
|
858
858
|
queueMicrotask(function() {
|
|
859
859
|
queueMicrotask(t);
|
|
860
860
|
});
|
|
861
861
|
};
|
|
862
|
-
function
|
|
863
|
-
|
|
864
|
-
for (var t; t =
|
|
862
|
+
function On() {
|
|
863
|
+
An(function() {
|
|
864
|
+
for (var t; t = Vi.shift(); ) $i.call(t);
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
|
-
function
|
|
868
|
-
|
|
867
|
+
function Hi() {
|
|
868
|
+
Vi.push(this) === 1 && (k.requestAnimationFrame || xn)(On);
|
|
869
869
|
}
|
|
870
|
-
const
|
|
871
|
-
|
|
872
|
-
|
|
870
|
+
const oi = {
|
|
871
|
+
layout: "floating",
|
|
872
|
+
initialState: "expanded",
|
|
873
873
|
position: "bottom-right",
|
|
874
874
|
showCaptions: !1,
|
|
875
875
|
showTextInput: !1,
|
|
@@ -881,101 +881,101 @@ const ri = {
|
|
|
881
881
|
"top-right": { top: "24px", right: "24px" },
|
|
882
882
|
"top-left": { top: "24px", left: "24px" }
|
|
883
883
|
};
|
|
884
|
-
function
|
|
884
|
+
function kn(t) {
|
|
885
885
|
if (He[t])
|
|
886
886
|
return He[t];
|
|
887
887
|
const e = t.match(/^\[(.+)\]$/);
|
|
888
888
|
if (!e) return He["bottom-right"];
|
|
889
889
|
const n = {};
|
|
890
890
|
for (const o of e[1].split(",")) {
|
|
891
|
-
const
|
|
891
|
+
const u = o.trim(), a = u.lastIndexOf("-");
|
|
892
892
|
if (a <= 0) continue;
|
|
893
|
-
const
|
|
894
|
-
n[
|
|
893
|
+
const c = u.slice(0, a), l = u.slice(a + 1);
|
|
894
|
+
n[c] = /^\d+$/.test(l) ? `${l}px` : l;
|
|
895
895
|
}
|
|
896
896
|
return Object.keys(n).length > 0 ? n : He["bottom-right"];
|
|
897
897
|
}
|
|
898
|
-
var
|
|
899
|
-
function
|
|
900
|
-
if (
|
|
901
|
-
|
|
902
|
-
for (var t = [], e = [], n = typeof Uint8Array < "u" ? Uint8Array : Array, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
|
|
903
|
-
t[
|
|
898
|
+
var dt = {}, Ne = {}, si;
|
|
899
|
+
function Dn() {
|
|
900
|
+
if (si) return Ne;
|
|
901
|
+
si = 1, Ne.byteLength = l, Ne.toByteArray = p, Ne.fromByteArray = S;
|
|
902
|
+
for (var t = [], e = [], n = typeof Uint8Array < "u" ? Uint8Array : Array, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", u = 0, a = o.length; u < a; ++u)
|
|
903
|
+
t[u] = o[u], e[o.charCodeAt(u)] = u;
|
|
904
904
|
e[45] = 62, e[95] = 63;
|
|
905
|
-
function
|
|
906
|
-
var
|
|
907
|
-
if (
|
|
905
|
+
function c(g) {
|
|
906
|
+
var y = g.length;
|
|
907
|
+
if (y % 4 > 0)
|
|
908
908
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
909
909
|
var C = g.indexOf("=");
|
|
910
|
-
C === -1 && (C =
|
|
911
|
-
var A = C ===
|
|
910
|
+
C === -1 && (C = y);
|
|
911
|
+
var A = C === y ? 0 : 4 - C % 4;
|
|
912
912
|
return [C, A];
|
|
913
913
|
}
|
|
914
914
|
function l(g) {
|
|
915
|
-
var
|
|
915
|
+
var y = c(g), C = y[0], A = y[1];
|
|
916
916
|
return (C + A) * 3 / 4 - A;
|
|
917
917
|
}
|
|
918
|
-
function
|
|
919
|
-
return (
|
|
918
|
+
function E(g, y, C) {
|
|
919
|
+
return (y + C) * 3 / 4 - C;
|
|
920
920
|
}
|
|
921
921
|
function p(g) {
|
|
922
|
-
var
|
|
922
|
+
var y, C = c(g), A = C[0], I = C[1], b = new n(E(g, A, I)), N = 0, D = I > 0 ? A - 4 : A, x;
|
|
923
923
|
for (x = 0; x < D; x += 4)
|
|
924
|
-
|
|
925
|
-
return I === 2 && (
|
|
924
|
+
y = e[g.charCodeAt(x)] << 18 | e[g.charCodeAt(x + 1)] << 12 | e[g.charCodeAt(x + 2)] << 6 | e[g.charCodeAt(x + 3)], b[N++] = y >> 16 & 255, b[N++] = y >> 8 & 255, b[N++] = y & 255;
|
|
925
|
+
return I === 2 && (y = e[g.charCodeAt(x)] << 2 | e[g.charCodeAt(x + 1)] >> 4, b[N++] = y & 255), I === 1 && (y = e[g.charCodeAt(x)] << 10 | e[g.charCodeAt(x + 1)] << 4 | e[g.charCodeAt(x + 2)] >> 2, b[N++] = y >> 8 & 255, b[N++] = y & 255), b;
|
|
926
926
|
}
|
|
927
927
|
function _(g) {
|
|
928
928
|
return t[g >> 18 & 63] + t[g >> 12 & 63] + t[g >> 6 & 63] + t[g & 63];
|
|
929
929
|
}
|
|
930
|
-
function d(g,
|
|
931
|
-
for (var A, I = [], b =
|
|
930
|
+
function d(g, y, C) {
|
|
931
|
+
for (var A, I = [], b = y; b < C; b += 3)
|
|
932
932
|
A = (g[b] << 16 & 16711680) + (g[b + 1] << 8 & 65280) + (g[b + 2] & 255), I.push(_(A));
|
|
933
933
|
return I.join("");
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
for (var
|
|
937
|
-
I.push(d(g,
|
|
938
|
-
return A === 1 ? (
|
|
939
|
-
t[
|
|
940
|
-
)) : A === 2 && (
|
|
941
|
-
t[
|
|
935
|
+
function S(g) {
|
|
936
|
+
for (var y, C = g.length, A = C % 3, I = [], b = 16383, N = 0, D = C - A; N < D; N += b)
|
|
937
|
+
I.push(d(g, N, N + b > D ? D : N + b));
|
|
938
|
+
return A === 1 ? (y = g[C - 1], I.push(
|
|
939
|
+
t[y >> 2] + t[y << 4 & 63] + "=="
|
|
940
|
+
)) : A === 2 && (y = (g[C - 2] << 8) + g[C - 1], I.push(
|
|
941
|
+
t[y >> 10] + t[y >> 4 & 63] + t[y << 2 & 63] + "="
|
|
942
942
|
)), I.join("");
|
|
943
943
|
}
|
|
944
944
|
return Ne;
|
|
945
945
|
}
|
|
946
946
|
var We = {};
|
|
947
|
-
var
|
|
948
|
-
function
|
|
949
|
-
return
|
|
950
|
-
var a,
|
|
951
|
-
for (d +=
|
|
947
|
+
var ai;
|
|
948
|
+
function Mn() {
|
|
949
|
+
return ai || (ai = 1, We.read = function(t, e, n, o, u) {
|
|
950
|
+
var a, c, l = u * 8 - o - 1, E = (1 << l) - 1, p = E >> 1, _ = -7, d = n ? u - 1 : 0, S = n ? -1 : 1, g = t[e + d];
|
|
951
|
+
for (d += S, a = g & (1 << -_) - 1, g >>= -_, _ += l; _ > 0; a = a * 256 + t[e + d], d += S, _ -= 8)
|
|
952
952
|
;
|
|
953
|
-
for (
|
|
953
|
+
for (c = a & (1 << -_) - 1, a >>= -_, _ += o; _ > 0; c = c * 256 + t[e + d], d += S, _ -= 8)
|
|
954
954
|
;
|
|
955
955
|
if (a === 0)
|
|
956
956
|
a = 1 - p;
|
|
957
957
|
else {
|
|
958
|
-
if (a ===
|
|
959
|
-
return
|
|
960
|
-
|
|
961
|
-
}
|
|
962
|
-
return (g ? -1 : 1) *
|
|
963
|
-
}, We.write = function(t, e, n, o,
|
|
964
|
-
var
|
|
965
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (l = isNaN(e) ? 1 : 0,
|
|
958
|
+
if (a === E)
|
|
959
|
+
return c ? NaN : (g ? -1 : 1) * (1 / 0);
|
|
960
|
+
c = c + Math.pow(2, o), a = a - p;
|
|
961
|
+
}
|
|
962
|
+
return (g ? -1 : 1) * c * Math.pow(2, a - o);
|
|
963
|
+
}, We.write = function(t, e, n, o, u, a) {
|
|
964
|
+
var c, l, E, p = a * 8 - u - 1, _ = (1 << p) - 1, d = _ >> 1, S = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = o ? 0 : a - 1, y = o ? 1 : -1, C = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
965
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (l = isNaN(e) ? 1 : 0, c = _) : (c = Math.floor(Math.log(e) / Math.LN2), e * (E = Math.pow(2, -c)) < 1 && (c--, E *= 2), c + d >= 1 ? e += S / E : e += S * Math.pow(2, 1 - d), e * E >= 2 && (c++, E /= 2), c + d >= _ ? (l = 0, c = _) : c + d >= 1 ? (l = (e * E - 1) * Math.pow(2, u), c = c + d) : (l = e * Math.pow(2, d - 1) * Math.pow(2, u), c = 0)); u >= 8; t[n + g] = l & 255, g += y, l /= 256, u -= 8)
|
|
966
966
|
;
|
|
967
|
-
for (
|
|
967
|
+
for (c = c << u | l, p += u; p > 0; t[n + g] = c & 255, g += y, c /= 256, p -= 8)
|
|
968
968
|
;
|
|
969
|
-
t[n + g -
|
|
969
|
+
t[n + g - y] |= C * 128;
|
|
970
970
|
}), We;
|
|
971
971
|
}
|
|
972
|
-
var
|
|
972
|
+
var li;
|
|
973
973
|
function Un() {
|
|
974
|
-
return
|
|
975
|
-
const e =
|
|
974
|
+
return li || (li = 1, (function(t) {
|
|
975
|
+
const e = Dn(), n = Mn(), o = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
|
|
976
976
|
t.Buffer = l, t.SlowBuffer = b, t.INSPECT_MAX_BYTES = 50;
|
|
977
|
-
const
|
|
978
|
-
t.kMaxLength =
|
|
977
|
+
const u = 2147483647;
|
|
978
|
+
t.kMaxLength = u, l.TYPED_ARRAY_SUPPORT = a(), !l.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
979
979
|
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
980
980
|
);
|
|
981
981
|
function a() {
|
|
@@ -1001,8 +1001,8 @@ function Un() {
|
|
|
1001
1001
|
return this.byteOffset;
|
|
1002
1002
|
}
|
|
1003
1003
|
});
|
|
1004
|
-
function
|
|
1005
|
-
if (s >
|
|
1004
|
+
function c(s) {
|
|
1005
|
+
if (s > u)
|
|
1006
1006
|
throw new RangeError('The value "' + s + '" is invalid for option "size"');
|
|
1007
1007
|
const i = new Uint8Array(s);
|
|
1008
1008
|
return Object.setPrototypeOf(i, l.prototype), i;
|
|
@@ -1015,14 +1015,14 @@ function Un() {
|
|
|
1015
1015
|
);
|
|
1016
1016
|
return d(s);
|
|
1017
1017
|
}
|
|
1018
|
-
return
|
|
1018
|
+
return E(s, i, r);
|
|
1019
1019
|
}
|
|
1020
1020
|
l.poolSize = 8192;
|
|
1021
|
-
function
|
|
1021
|
+
function E(s, i, r) {
|
|
1022
1022
|
if (typeof s == "string")
|
|
1023
|
-
return
|
|
1023
|
+
return S(s, i);
|
|
1024
1024
|
if (ArrayBuffer.isView(s))
|
|
1025
|
-
return
|
|
1025
|
+
return y(s);
|
|
1026
1026
|
if (s == null)
|
|
1027
1027
|
throw new TypeError(
|
|
1028
1028
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof s
|
|
@@ -1045,7 +1045,7 @@ function Un() {
|
|
|
1045
1045
|
);
|
|
1046
1046
|
}
|
|
1047
1047
|
l.from = function(s, i, r) {
|
|
1048
|
-
return
|
|
1048
|
+
return E(s, i, r);
|
|
1049
1049
|
}, Object.setPrototypeOf(l.prototype, Uint8Array.prototype), Object.setPrototypeOf(l, Uint8Array);
|
|
1050
1050
|
function p(s) {
|
|
1051
1051
|
if (typeof s != "number")
|
|
@@ -1054,34 +1054,34 @@ function Un() {
|
|
|
1054
1054
|
throw new RangeError('The value "' + s + '" is invalid for option "size"');
|
|
1055
1055
|
}
|
|
1056
1056
|
function _(s, i, r) {
|
|
1057
|
-
return p(s), s <= 0 ?
|
|
1057
|
+
return p(s), s <= 0 ? c(s) : i !== void 0 ? typeof r == "string" ? c(s).fill(i, r) : c(s).fill(i) : c(s);
|
|
1058
1058
|
}
|
|
1059
1059
|
l.alloc = function(s, i, r) {
|
|
1060
1060
|
return _(s, i, r);
|
|
1061
1061
|
};
|
|
1062
1062
|
function d(s) {
|
|
1063
|
-
return p(s),
|
|
1063
|
+
return p(s), c(s < 0 ? 0 : I(s) | 0);
|
|
1064
1064
|
}
|
|
1065
1065
|
l.allocUnsafe = function(s) {
|
|
1066
1066
|
return d(s);
|
|
1067
1067
|
}, l.allocUnsafeSlow = function(s) {
|
|
1068
1068
|
return d(s);
|
|
1069
1069
|
};
|
|
1070
|
-
function
|
|
1070
|
+
function S(s, i) {
|
|
1071
1071
|
if ((typeof i != "string" || i === "") && (i = "utf8"), !l.isEncoding(i))
|
|
1072
1072
|
throw new TypeError("Unknown encoding: " + i);
|
|
1073
|
-
const r =
|
|
1074
|
-
let h =
|
|
1073
|
+
const r = N(s, i) | 0;
|
|
1074
|
+
let h = c(r);
|
|
1075
1075
|
const f = h.write(s, i);
|
|
1076
1076
|
return f !== r && (h = h.slice(0, f)), h;
|
|
1077
1077
|
}
|
|
1078
1078
|
function g(s) {
|
|
1079
|
-
const i = s.length < 0 ? 0 : I(s.length) | 0, r =
|
|
1079
|
+
const i = s.length < 0 ? 0 : I(s.length) | 0, r = c(i);
|
|
1080
1080
|
for (let h = 0; h < i; h += 1)
|
|
1081
1081
|
r[h] = s[h] & 255;
|
|
1082
1082
|
return r;
|
|
1083
1083
|
}
|
|
1084
|
-
function
|
|
1084
|
+
function y(s) {
|
|
1085
1085
|
if (ee(s, Uint8Array)) {
|
|
1086
1086
|
const i = new Uint8Array(s);
|
|
1087
1087
|
return C(i.buffer, i.byteOffset, i.byteLength);
|
|
@@ -1098,17 +1098,17 @@ function Un() {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
function A(s) {
|
|
1100
1100
|
if (l.isBuffer(s)) {
|
|
1101
|
-
const i = I(s.length) | 0, r =
|
|
1101
|
+
const i = I(s.length) | 0, r = c(i);
|
|
1102
1102
|
return r.length === 0 || s.copy(r, 0, 0, i), r;
|
|
1103
1103
|
}
|
|
1104
1104
|
if (s.length !== void 0)
|
|
1105
|
-
return typeof s.length != "number" ||
|
|
1105
|
+
return typeof s.length != "number" || lt(s.length) ? c(0) : g(s);
|
|
1106
1106
|
if (s.type === "Buffer" && Array.isArray(s.data))
|
|
1107
1107
|
return g(s.data);
|
|
1108
1108
|
}
|
|
1109
1109
|
function I(s) {
|
|
1110
|
-
if (s >=
|
|
1111
|
-
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" +
|
|
1110
|
+
if (s >= u)
|
|
1111
|
+
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + u.toString(16) + " bytes");
|
|
1112
1112
|
return s | 0;
|
|
1113
1113
|
}
|
|
1114
1114
|
function b(s) {
|
|
@@ -1123,9 +1123,9 @@ function Un() {
|
|
|
1123
1123
|
);
|
|
1124
1124
|
if (i === r) return 0;
|
|
1125
1125
|
let h = i.length, f = r.length;
|
|
1126
|
-
for (let
|
|
1127
|
-
if (i[
|
|
1128
|
-
h = i[
|
|
1126
|
+
for (let m = 0, v = Math.min(h, f); m < v; ++m)
|
|
1127
|
+
if (i[m] !== r[m]) {
|
|
1128
|
+
h = i[m], f = r[m];
|
|
1129
1129
|
break;
|
|
1130
1130
|
}
|
|
1131
1131
|
return h < f ? -1 : f < h ? 1 : 0;
|
|
@@ -1156,24 +1156,24 @@ function Un() {
|
|
|
1156
1156
|
for (r = 0, h = 0; h < i.length; ++h)
|
|
1157
1157
|
r += i[h].length;
|
|
1158
1158
|
const f = l.allocUnsafe(r);
|
|
1159
|
-
let
|
|
1159
|
+
let m = 0;
|
|
1160
1160
|
for (h = 0; h < i.length; ++h) {
|
|
1161
1161
|
let v = i[h];
|
|
1162
1162
|
if (ee(v, Uint8Array))
|
|
1163
|
-
|
|
1163
|
+
m + v.length > f.length ? (l.isBuffer(v) || (v = l.from(v)), v.copy(f, m)) : Uint8Array.prototype.set.call(
|
|
1164
1164
|
f,
|
|
1165
1165
|
v,
|
|
1166
|
-
|
|
1166
|
+
m
|
|
1167
1167
|
);
|
|
1168
1168
|
else if (l.isBuffer(v))
|
|
1169
|
-
v.copy(f,
|
|
1169
|
+
v.copy(f, m);
|
|
1170
1170
|
else
|
|
1171
1171
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
1172
|
-
|
|
1172
|
+
m += v.length;
|
|
1173
1173
|
}
|
|
1174
1174
|
return f;
|
|
1175
1175
|
};
|
|
1176
|
-
function
|
|
1176
|
+
function N(s, i) {
|
|
1177
1177
|
if (l.isBuffer(s))
|
|
1178
1178
|
return s.length;
|
|
1179
1179
|
if (ArrayBuffer.isView(s) || ee(s, ArrayBuffer))
|
|
@@ -1193,7 +1193,7 @@ function Un() {
|
|
|
1193
1193
|
return r;
|
|
1194
1194
|
case "utf8":
|
|
1195
1195
|
case "utf-8":
|
|
1196
|
-
return
|
|
1196
|
+
return at(s).length;
|
|
1197
1197
|
case "ucs2":
|
|
1198
1198
|
case "ucs-2":
|
|
1199
1199
|
case "utf16le":
|
|
@@ -1202,14 +1202,14 @@ function Un() {
|
|
|
1202
1202
|
case "hex":
|
|
1203
1203
|
return r >>> 1;
|
|
1204
1204
|
case "base64":
|
|
1205
|
-
return
|
|
1205
|
+
return Ht(s).length;
|
|
1206
1206
|
default:
|
|
1207
1207
|
if (f)
|
|
1208
|
-
return h ? -1 :
|
|
1208
|
+
return h ? -1 : at(s).length;
|
|
1209
1209
|
i = ("" + i).toLowerCase(), f = !0;
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
|
-
l.byteLength =
|
|
1212
|
+
l.byteLength = N;
|
|
1213
1213
|
function D(s, i, r) {
|
|
1214
1214
|
let h = !1;
|
|
1215
1215
|
if ((i === void 0 || i < 0) && (i = 0), i > this.length || ((r === void 0 || r > this.length) && (r = this.length), r <= 0) || (r >>>= 0, i >>>= 0, r <= i))
|
|
@@ -1217,22 +1217,22 @@ function Un() {
|
|
|
1217
1217
|
for (s || (s = "utf8"); ; )
|
|
1218
1218
|
switch (s) {
|
|
1219
1219
|
case "hex":
|
|
1220
|
-
return
|
|
1220
|
+
return Qi(this, i, r);
|
|
1221
1221
|
case "utf8":
|
|
1222
1222
|
case "utf-8":
|
|
1223
1223
|
return Ut(this, i, r);
|
|
1224
1224
|
case "ascii":
|
|
1225
|
-
return
|
|
1225
|
+
return Xi(this, i, r);
|
|
1226
1226
|
case "latin1":
|
|
1227
1227
|
case "binary":
|
|
1228
|
-
return
|
|
1228
|
+
return Zi(this, i, r);
|
|
1229
1229
|
case "base64":
|
|
1230
|
-
return
|
|
1230
|
+
return Ki(this, i, r);
|
|
1231
1231
|
case "ucs2":
|
|
1232
1232
|
case "ucs-2":
|
|
1233
1233
|
case "utf16le":
|
|
1234
1234
|
case "utf-16le":
|
|
1235
|
-
return
|
|
1235
|
+
return en(this, i, r);
|
|
1236
1236
|
default:
|
|
1237
1237
|
if (h) throw new TypeError("Unknown encoding: " + s);
|
|
1238
1238
|
s = (s + "").toLowerCase(), h = !0;
|
|
@@ -1274,70 +1274,70 @@ function Un() {
|
|
|
1274
1274
|
let i = "";
|
|
1275
1275
|
const r = t.INSPECT_MAX_BYTES;
|
|
1276
1276
|
return i = this.toString("hex", 0, r).replace(/(.{2})/g, "$1 ").trim(), this.length > r && (i += " ... "), "<Buffer " + i + ">";
|
|
1277
|
-
}, o && (l.prototype[o] = l.prototype.inspect), l.prototype.compare = function(i, r, h, f,
|
|
1277
|
+
}, o && (l.prototype[o] = l.prototype.inspect), l.prototype.compare = function(i, r, h, f, m) {
|
|
1278
1278
|
if (ee(i, Uint8Array) && (i = l.from(i, i.offset, i.byteLength)), !l.isBuffer(i))
|
|
1279
1279
|
throw new TypeError(
|
|
1280
1280
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof i
|
|
1281
1281
|
);
|
|
1282
|
-
if (r === void 0 && (r = 0), h === void 0 && (h = i ? i.length : 0), f === void 0 && (f = 0),
|
|
1282
|
+
if (r === void 0 && (r = 0), h === void 0 && (h = i ? i.length : 0), f === void 0 && (f = 0), m === void 0 && (m = this.length), r < 0 || h > i.length || f < 0 || m > this.length)
|
|
1283
1283
|
throw new RangeError("out of range index");
|
|
1284
|
-
if (f >=
|
|
1284
|
+
if (f >= m && r >= h)
|
|
1285
1285
|
return 0;
|
|
1286
|
-
if (f >=
|
|
1286
|
+
if (f >= m)
|
|
1287
1287
|
return -1;
|
|
1288
1288
|
if (r >= h)
|
|
1289
1289
|
return 1;
|
|
1290
|
-
if (r >>>= 0, h >>>= 0, f >>>= 0,
|
|
1291
|
-
let v =
|
|
1292
|
-
const
|
|
1293
|
-
for (let
|
|
1294
|
-
if (M
|
|
1295
|
-
v = M
|
|
1290
|
+
if (r >>>= 0, h >>>= 0, f >>>= 0, m >>>= 0, this === i) return 0;
|
|
1291
|
+
let v = m - f, T = h - r;
|
|
1292
|
+
const L = Math.min(v, T), U = this.slice(f, m), B = i.slice(r, h);
|
|
1293
|
+
for (let M = 0; M < L; ++M)
|
|
1294
|
+
if (U[M] !== B[M]) {
|
|
1295
|
+
v = U[M], T = B[M];
|
|
1296
1296
|
break;
|
|
1297
1297
|
}
|
|
1298
|
-
return v <
|
|
1298
|
+
return v < T ? -1 : T < v ? 1 : 0;
|
|
1299
1299
|
};
|
|
1300
1300
|
function Z(s, i, r, h, f) {
|
|
1301
1301
|
if (s.length === 0) return -1;
|
|
1302
|
-
if (typeof r == "string" ? (h = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r,
|
|
1302
|
+
if (typeof r == "string" ? (h = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, lt(r) && (r = f ? 0 : s.length - 1), r < 0 && (r = s.length + r), r >= s.length) {
|
|
1303
1303
|
if (f) return -1;
|
|
1304
1304
|
r = s.length - 1;
|
|
1305
1305
|
} else if (r < 0)
|
|
1306
1306
|
if (f) r = 0;
|
|
1307
1307
|
else return -1;
|
|
1308
1308
|
if (typeof i == "string" && (i = l.from(i, h)), l.isBuffer(i))
|
|
1309
|
-
return i.length === 0 ? -1 :
|
|
1309
|
+
return i.length === 0 ? -1 : V(s, i, r, h, f);
|
|
1310
1310
|
if (typeof i == "number")
|
|
1311
|
-
return i = i & 255, typeof Uint8Array.prototype.indexOf == "function" ? f ? Uint8Array.prototype.indexOf.call(s, i, r) : Uint8Array.prototype.lastIndexOf.call(s, i, r) :
|
|
1311
|
+
return i = i & 255, typeof Uint8Array.prototype.indexOf == "function" ? f ? Uint8Array.prototype.indexOf.call(s, i, r) : Uint8Array.prototype.lastIndexOf.call(s, i, r) : V(s, [i], r, h, f);
|
|
1312
1312
|
throw new TypeError("val must be string, number or Buffer");
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1315
|
-
let
|
|
1314
|
+
function V(s, i, r, h, f) {
|
|
1315
|
+
let m = 1, v = s.length, T = i.length;
|
|
1316
1316
|
if (h !== void 0 && (h = String(h).toLowerCase(), h === "ucs2" || h === "ucs-2" || h === "utf16le" || h === "utf-16le")) {
|
|
1317
1317
|
if (s.length < 2 || i.length < 2)
|
|
1318
1318
|
return -1;
|
|
1319
|
-
|
|
1319
|
+
m = 2, v /= 2, T /= 2, r /= 2;
|
|
1320
1320
|
}
|
|
1321
|
-
function B
|
|
1322
|
-
return
|
|
1321
|
+
function L(B, M) {
|
|
1322
|
+
return m === 1 ? B[M] : B.readUInt16BE(M * m);
|
|
1323
1323
|
}
|
|
1324
|
-
let
|
|
1324
|
+
let U;
|
|
1325
1325
|
if (f) {
|
|
1326
|
-
let
|
|
1327
|
-
for (
|
|
1328
|
-
if (
|
|
1329
|
-
if (
|
|
1326
|
+
let B = -1;
|
|
1327
|
+
for (U = r; U < v; U++)
|
|
1328
|
+
if (L(s, U) === L(i, B === -1 ? 0 : U - B)) {
|
|
1329
|
+
if (B === -1 && (B = U), U - B + 1 === T) return B * m;
|
|
1330
1330
|
} else
|
|
1331
|
-
|
|
1331
|
+
B !== -1 && (U -= U - B), B = -1;
|
|
1332
1332
|
} else
|
|
1333
|
-
for (r +
|
|
1334
|
-
let
|
|
1335
|
-
for (let
|
|
1336
|
-
if (
|
|
1337
|
-
|
|
1333
|
+
for (r + T > v && (r = v - T), U = r; U >= 0; U--) {
|
|
1334
|
+
let B = !0;
|
|
1335
|
+
for (let M = 0; M < T; M++)
|
|
1336
|
+
if (L(s, U + M) !== L(i, M)) {
|
|
1337
|
+
B = !1;
|
|
1338
1338
|
break;
|
|
1339
1339
|
}
|
|
1340
|
-
if (
|
|
1340
|
+
if (B) return U;
|
|
1341
1341
|
}
|
|
1342
1342
|
return -1;
|
|
1343
1343
|
}
|
|
@@ -1348,31 +1348,31 @@ function Un() {
|
|
|
1348
1348
|
}, l.prototype.lastIndexOf = function(i, r, h) {
|
|
1349
1349
|
return Z(this, i, r, h, !1);
|
|
1350
1350
|
};
|
|
1351
|
-
function
|
|
1351
|
+
function se(s, i, r, h) {
|
|
1352
1352
|
r = Number(r) || 0;
|
|
1353
1353
|
const f = s.length - r;
|
|
1354
1354
|
h ? (h = Number(h), h > f && (h = f)) : h = f;
|
|
1355
|
-
const
|
|
1356
|
-
h >
|
|
1355
|
+
const m = i.length;
|
|
1356
|
+
h > m / 2 && (h = m / 2);
|
|
1357
1357
|
let v;
|
|
1358
1358
|
for (v = 0; v < h; ++v) {
|
|
1359
|
-
const
|
|
1360
|
-
if (
|
|
1361
|
-
s[r + v] =
|
|
1359
|
+
const T = parseInt(i.substr(v * 2, 2), 16);
|
|
1360
|
+
if (lt(T)) return v;
|
|
1361
|
+
s[r + v] = T;
|
|
1362
1362
|
}
|
|
1363
1363
|
return v;
|
|
1364
1364
|
}
|
|
1365
1365
|
function ne(s, i, r, h) {
|
|
1366
|
-
return
|
|
1366
|
+
return Ve(at(i, s.length - r), s, r, h);
|
|
1367
1367
|
}
|
|
1368
1368
|
function re(s, i, r, h) {
|
|
1369
|
-
return
|
|
1369
|
+
return Ve(on(i), s, r, h);
|
|
1370
1370
|
}
|
|
1371
1371
|
function Q(s, i, r, h) {
|
|
1372
|
-
return
|
|
1372
|
+
return Ve(Ht(i), s, r, h);
|
|
1373
1373
|
}
|
|
1374
|
-
function
|
|
1375
|
-
return
|
|
1374
|
+
function ae(s, i, r, h) {
|
|
1375
|
+
return Ve(sn(i, s.length - r), s, r, h);
|
|
1376
1376
|
}
|
|
1377
1377
|
l.prototype.write = function(i, r, h, f) {
|
|
1378
1378
|
if (r === void 0)
|
|
@@ -1385,15 +1385,15 @@ function Un() {
|
|
|
1385
1385
|
throw new Error(
|
|
1386
1386
|
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
1387
1387
|
);
|
|
1388
|
-
const
|
|
1389
|
-
if ((h === void 0 || h >
|
|
1388
|
+
const m = this.length - r;
|
|
1389
|
+
if ((h === void 0 || h > m) && (h = m), i.length > 0 && (h < 0 || r < 0) || r > this.length)
|
|
1390
1390
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
1391
1391
|
f || (f = "utf8");
|
|
1392
1392
|
let v = !1;
|
|
1393
1393
|
for (; ; )
|
|
1394
1394
|
switch (f) {
|
|
1395
1395
|
case "hex":
|
|
1396
|
-
return
|
|
1396
|
+
return se(this, i, r, h);
|
|
1397
1397
|
case "utf8":
|
|
1398
1398
|
case "utf-8":
|
|
1399
1399
|
return ne(this, i, r, h);
|
|
@@ -1407,7 +1407,7 @@ function Un() {
|
|
|
1407
1407
|
case "ucs-2":
|
|
1408
1408
|
case "utf16le":
|
|
1409
1409
|
case "utf-16le":
|
|
1410
|
-
return
|
|
1410
|
+
return ae(this, i, r, h);
|
|
1411
1411
|
default:
|
|
1412
1412
|
if (v) throw new TypeError("Unknown encoding: " + f);
|
|
1413
1413
|
f = ("" + f).toLowerCase(), v = !0;
|
|
@@ -1418,7 +1418,7 @@ function Un() {
|
|
|
1418
1418
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
1419
1419
|
};
|
|
1420
1420
|
};
|
|
1421
|
-
function
|
|
1421
|
+
function Ki(s, i, r) {
|
|
1422
1422
|
return i === 0 && r === s.length ? e.fromByteArray(s) : e.fromByteArray(s.slice(i, r));
|
|
1423
1423
|
}
|
|
1424
1424
|
function Ut(s, i, r) {
|
|
@@ -1426,68 +1426,68 @@ function Un() {
|
|
|
1426
1426
|
const h = [];
|
|
1427
1427
|
let f = i;
|
|
1428
1428
|
for (; f < r; ) {
|
|
1429
|
-
const
|
|
1430
|
-
let v = null,
|
|
1431
|
-
if (f +
|
|
1432
|
-
let
|
|
1433
|
-
switch (
|
|
1429
|
+
const m = s[f];
|
|
1430
|
+
let v = null, T = m > 239 ? 4 : m > 223 ? 3 : m > 191 ? 2 : 1;
|
|
1431
|
+
if (f + T <= r) {
|
|
1432
|
+
let L, U, B, M;
|
|
1433
|
+
switch (T) {
|
|
1434
1434
|
case 1:
|
|
1435
|
-
|
|
1435
|
+
m < 128 && (v = m);
|
|
1436
1436
|
break;
|
|
1437
1437
|
case 2:
|
|
1438
|
-
|
|
1438
|
+
L = s[f + 1], (L & 192) === 128 && (M = (m & 31) << 6 | L & 63, M > 127 && (v = M));
|
|
1439
1439
|
break;
|
|
1440
1440
|
case 3:
|
|
1441
|
-
|
|
1441
|
+
L = s[f + 1], U = s[f + 2], (L & 192) === 128 && (U & 192) === 128 && (M = (m & 15) << 12 | (L & 63) << 6 | U & 63, M > 2047 && (M < 55296 || M > 57343) && (v = M));
|
|
1442
1442
|
break;
|
|
1443
1443
|
case 4:
|
|
1444
|
-
|
|
1444
|
+
L = s[f + 1], U = s[f + 2], B = s[f + 3], (L & 192) === 128 && (U & 192) === 128 && (B & 192) === 128 && (M = (m & 15) << 18 | (L & 63) << 12 | (U & 63) << 6 | B & 63, M > 65535 && M < 1114112 && (v = M));
|
|
1445
1445
|
}
|
|
1446
1446
|
}
|
|
1447
|
-
v === null ? (v = 65533,
|
|
1447
|
+
v === null ? (v = 65533, T = 1) : v > 65535 && (v -= 65536, h.push(v >>> 10 & 1023 | 55296), v = 56320 | v & 1023), h.push(v), f += T;
|
|
1448
1448
|
}
|
|
1449
|
-
return
|
|
1449
|
+
return Ji(h);
|
|
1450
1450
|
}
|
|
1451
|
-
const
|
|
1452
|
-
function
|
|
1451
|
+
const Lt = 4096;
|
|
1452
|
+
function Ji(s) {
|
|
1453
1453
|
const i = s.length;
|
|
1454
|
-
if (i <=
|
|
1454
|
+
if (i <= Lt)
|
|
1455
1455
|
return String.fromCharCode.apply(String, s);
|
|
1456
1456
|
let r = "", h = 0;
|
|
1457
1457
|
for (; h < i; )
|
|
1458
1458
|
r += String.fromCharCode.apply(
|
|
1459
1459
|
String,
|
|
1460
|
-
s.slice(h, h +=
|
|
1460
|
+
s.slice(h, h += Lt)
|
|
1461
1461
|
);
|
|
1462
1462
|
return r;
|
|
1463
1463
|
}
|
|
1464
|
-
function
|
|
1464
|
+
function Xi(s, i, r) {
|
|
1465
1465
|
let h = "";
|
|
1466
1466
|
r = Math.min(s.length, r);
|
|
1467
1467
|
for (let f = i; f < r; ++f)
|
|
1468
1468
|
h += String.fromCharCode(s[f] & 127);
|
|
1469
1469
|
return h;
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1471
|
+
function Zi(s, i, r) {
|
|
1472
1472
|
let h = "";
|
|
1473
1473
|
r = Math.min(s.length, r);
|
|
1474
1474
|
for (let f = i; f < r; ++f)
|
|
1475
1475
|
h += String.fromCharCode(s[f]);
|
|
1476
1476
|
return h;
|
|
1477
1477
|
}
|
|
1478
|
-
function
|
|
1478
|
+
function Qi(s, i, r) {
|
|
1479
1479
|
const h = s.length;
|
|
1480
1480
|
(!i || i < 0) && (i = 0), (!r || r < 0 || r > h) && (r = h);
|
|
1481
1481
|
let f = "";
|
|
1482
|
-
for (let
|
|
1483
|
-
f +=
|
|
1482
|
+
for (let m = i; m < r; ++m)
|
|
1483
|
+
f += an[s[m]];
|
|
1484
1484
|
return f;
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function en(s, i, r) {
|
|
1487
1487
|
const h = s.slice(i, r);
|
|
1488
1488
|
let f = "";
|
|
1489
|
-
for (let
|
|
1490
|
-
f += String.fromCharCode(h[
|
|
1489
|
+
for (let m = 0; m < h.length - 1; m += 2)
|
|
1490
|
+
f += String.fromCharCode(h[m] + h[m + 1] * 256);
|
|
1491
1491
|
return f;
|
|
1492
1492
|
}
|
|
1493
1493
|
l.prototype.slice = function(i, r) {
|
|
@@ -1502,15 +1502,15 @@ function Un() {
|
|
|
1502
1502
|
}
|
|
1503
1503
|
l.prototype.readUintLE = l.prototype.readUIntLE = function(i, r, h) {
|
|
1504
1504
|
i = i >>> 0, r = r >>> 0, h || G(i, r, this.length);
|
|
1505
|
-
let f = this[i],
|
|
1506
|
-
for (; ++v < r && (
|
|
1507
|
-
f += this[i + v] *
|
|
1505
|
+
let f = this[i], m = 1, v = 0;
|
|
1506
|
+
for (; ++v < r && (m *= 256); )
|
|
1507
|
+
f += this[i + v] * m;
|
|
1508
1508
|
return f;
|
|
1509
1509
|
}, l.prototype.readUintBE = l.prototype.readUIntBE = function(i, r, h) {
|
|
1510
1510
|
i = i >>> 0, r = r >>> 0, h || G(i, r, this.length);
|
|
1511
|
-
let f = this[i + --r],
|
|
1512
|
-
for (; r > 0 && (
|
|
1513
|
-
f += this[i + --r] *
|
|
1511
|
+
let f = this[i + --r], m = 1;
|
|
1512
|
+
for (; r > 0 && (m *= 256); )
|
|
1513
|
+
f += this[i + --r] * m;
|
|
1514
1514
|
return f;
|
|
1515
1515
|
}, l.prototype.readUint8 = l.prototype.readUInt8 = function(i, r) {
|
|
1516
1516
|
return i = i >>> 0, r || G(i, 1, this.length), this[i];
|
|
@@ -1522,30 +1522,30 @@ function Un() {
|
|
|
1522
1522
|
return i = i >>> 0, r || G(i, 4, this.length), (this[i] | this[i + 1] << 8 | this[i + 2] << 16) + this[i + 3] * 16777216;
|
|
1523
1523
|
}, l.prototype.readUint32BE = l.prototype.readUInt32BE = function(i, r) {
|
|
1524
1524
|
return i = i >>> 0, r || G(i, 4, this.length), this[i] * 16777216 + (this[i + 1] << 16 | this[i + 2] << 8 | this[i + 3]);
|
|
1525
|
-
}, l.prototype.readBigUInt64LE =
|
|
1525
|
+
}, l.prototype.readBigUInt64LE = le(function(i) {
|
|
1526
1526
|
i = i >>> 0, ye(i, "offset");
|
|
1527
1527
|
const r = this[i], h = this[i + 7];
|
|
1528
1528
|
(r === void 0 || h === void 0) && Re(i, this.length - 8);
|
|
1529
|
-
const f = r + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + this[++i] * 2 ** 24,
|
|
1530
|
-
return BigInt(f) + (BigInt(
|
|
1531
|
-
}), l.prototype.readBigUInt64BE =
|
|
1529
|
+
const f = r + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + this[++i] * 2 ** 24, m = this[++i] + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + h * 2 ** 24;
|
|
1530
|
+
return BigInt(f) + (BigInt(m) << BigInt(32));
|
|
1531
|
+
}), l.prototype.readBigUInt64BE = le(function(i) {
|
|
1532
1532
|
i = i >>> 0, ye(i, "offset");
|
|
1533
1533
|
const r = this[i], h = this[i + 7];
|
|
1534
1534
|
(r === void 0 || h === void 0) && Re(i, this.length - 8);
|
|
1535
|
-
const f = r * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + this[++i],
|
|
1536
|
-
return (BigInt(f) << BigInt(32)) + BigInt(
|
|
1535
|
+
const f = r * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + this[++i], m = this[++i] * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + h;
|
|
1536
|
+
return (BigInt(f) << BigInt(32)) + BigInt(m);
|
|
1537
1537
|
}), l.prototype.readIntLE = function(i, r, h) {
|
|
1538
1538
|
i = i >>> 0, r = r >>> 0, h || G(i, r, this.length);
|
|
1539
|
-
let f = this[i],
|
|
1540
|
-
for (; ++v < r && (
|
|
1541
|
-
f += this[i + v] *
|
|
1542
|
-
return
|
|
1539
|
+
let f = this[i], m = 1, v = 0;
|
|
1540
|
+
for (; ++v < r && (m *= 256); )
|
|
1541
|
+
f += this[i + v] * m;
|
|
1542
|
+
return m *= 128, f >= m && (f -= Math.pow(2, 8 * r)), f;
|
|
1543
1543
|
}, l.prototype.readIntBE = function(i, r, h) {
|
|
1544
1544
|
i = i >>> 0, r = r >>> 0, h || G(i, r, this.length);
|
|
1545
|
-
let f = r,
|
|
1546
|
-
for (; f > 0 && (
|
|
1547
|
-
v += this[i + --f] *
|
|
1548
|
-
return
|
|
1545
|
+
let f = r, m = 1, v = this[i + --f];
|
|
1546
|
+
for (; f > 0 && (m *= 256); )
|
|
1547
|
+
v += this[i + --f] * m;
|
|
1548
|
+
return m *= 128, v >= m && (v -= Math.pow(2, 8 * r)), v;
|
|
1549
1549
|
}, l.prototype.readInt8 = function(i, r) {
|
|
1550
1550
|
return i = i >>> 0, r || G(i, 1, this.length), this[i] & 128 ? (255 - this[i] + 1) * -1 : this[i];
|
|
1551
1551
|
}, l.prototype.readInt16LE = function(i, r) {
|
|
@@ -1560,13 +1560,13 @@ function Un() {
|
|
|
1560
1560
|
return i = i >>> 0, r || G(i, 4, this.length), this[i] | this[i + 1] << 8 | this[i + 2] << 16 | this[i + 3] << 24;
|
|
1561
1561
|
}, l.prototype.readInt32BE = function(i, r) {
|
|
1562
1562
|
return i = i >>> 0, r || G(i, 4, this.length), this[i] << 24 | this[i + 1] << 16 | this[i + 2] << 8 | this[i + 3];
|
|
1563
|
-
}, l.prototype.readBigInt64LE =
|
|
1563
|
+
}, l.prototype.readBigInt64LE = le(function(i) {
|
|
1564
1564
|
i = i >>> 0, ye(i, "offset");
|
|
1565
1565
|
const r = this[i], h = this[i + 7];
|
|
1566
1566
|
(r === void 0 || h === void 0) && Re(i, this.length - 8);
|
|
1567
1567
|
const f = this[i + 4] + this[i + 5] * 2 ** 8 + this[i + 6] * 2 ** 16 + (h << 24);
|
|
1568
1568
|
return (BigInt(f) << BigInt(32)) + BigInt(r + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + this[++i] * 2 ** 24);
|
|
1569
|
-
}), l.prototype.readBigInt64BE =
|
|
1569
|
+
}), l.prototype.readBigInt64BE = le(function(i) {
|
|
1570
1570
|
i = i >>> 0, ye(i, "offset");
|
|
1571
1571
|
const r = this[i], h = this[i + 7];
|
|
1572
1572
|
(r === void 0 || h === void 0) && Re(i, this.length - 8);
|
|
@@ -1582,110 +1582,110 @@ function Un() {
|
|
|
1582
1582
|
}, l.prototype.readDoubleBE = function(i, r) {
|
|
1583
1583
|
return i = i >>> 0, r || G(i, 8, this.length), n.read(this, i, !1, 52, 8);
|
|
1584
1584
|
};
|
|
1585
|
-
function
|
|
1585
|
+
function Y(s, i, r, h, f, m) {
|
|
1586
1586
|
if (!l.isBuffer(s)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
1587
|
-
if (i > f || i <
|
|
1587
|
+
if (i > f || i < m) throw new RangeError('"value" argument is out of bounds');
|
|
1588
1588
|
if (r + h > s.length) throw new RangeError("Index out of range");
|
|
1589
1589
|
}
|
|
1590
1590
|
l.prototype.writeUintLE = l.prototype.writeUIntLE = function(i, r, h, f) {
|
|
1591
1591
|
if (i = +i, r = r >>> 0, h = h >>> 0, !f) {
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1592
|
+
const T = Math.pow(2, 8 * h) - 1;
|
|
1593
|
+
Y(this, i, r, h, T, 0);
|
|
1594
1594
|
}
|
|
1595
|
-
let
|
|
1596
|
-
for (this[r] = i & 255; ++v < h && (
|
|
1597
|
-
this[r + v] = i /
|
|
1595
|
+
let m = 1, v = 0;
|
|
1596
|
+
for (this[r] = i & 255; ++v < h && (m *= 256); )
|
|
1597
|
+
this[r + v] = i / m & 255;
|
|
1598
1598
|
return r + h;
|
|
1599
1599
|
}, l.prototype.writeUintBE = l.prototype.writeUIntBE = function(i, r, h, f) {
|
|
1600
1600
|
if (i = +i, r = r >>> 0, h = h >>> 0, !f) {
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1601
|
+
const T = Math.pow(2, 8 * h) - 1;
|
|
1602
|
+
Y(this, i, r, h, T, 0);
|
|
1603
1603
|
}
|
|
1604
|
-
let
|
|
1605
|
-
for (this[r +
|
|
1606
|
-
this[r +
|
|
1604
|
+
let m = h - 1, v = 1;
|
|
1605
|
+
for (this[r + m] = i & 255; --m >= 0 && (v *= 256); )
|
|
1606
|
+
this[r + m] = i / v & 255;
|
|
1607
1607
|
return r + h;
|
|
1608
1608
|
}, l.prototype.writeUint8 = l.prototype.writeUInt8 = function(i, r, h) {
|
|
1609
|
-
return i = +i, r = r >>> 0, h ||
|
|
1609
|
+
return i = +i, r = r >>> 0, h || Y(this, i, r, 1, 255, 0), this[r] = i & 255, r + 1;
|
|
1610
1610
|
}, l.prototype.writeUint16LE = l.prototype.writeUInt16LE = function(i, r, h) {
|
|
1611
|
-
return i = +i, r = r >>> 0, h ||
|
|
1611
|
+
return i = +i, r = r >>> 0, h || Y(this, i, r, 2, 65535, 0), this[r] = i & 255, this[r + 1] = i >>> 8, r + 2;
|
|
1612
1612
|
}, l.prototype.writeUint16BE = l.prototype.writeUInt16BE = function(i, r, h) {
|
|
1613
|
-
return i = +i, r = r >>> 0, h ||
|
|
1613
|
+
return i = +i, r = r >>> 0, h || Y(this, i, r, 2, 65535, 0), this[r] = i >>> 8, this[r + 1] = i & 255, r + 2;
|
|
1614
1614
|
}, l.prototype.writeUint32LE = l.prototype.writeUInt32LE = function(i, r, h) {
|
|
1615
|
-
return i = +i, r = r >>> 0, h ||
|
|
1615
|
+
return i = +i, r = r >>> 0, h || Y(this, i, r, 4, 4294967295, 0), this[r + 3] = i >>> 24, this[r + 2] = i >>> 16, this[r + 1] = i >>> 8, this[r] = i & 255, r + 4;
|
|
1616
1616
|
}, l.prototype.writeUint32BE = l.prototype.writeUInt32BE = function(i, r, h) {
|
|
1617
|
-
return i = +i, r = r >>> 0, h ||
|
|
1617
|
+
return i = +i, r = r >>> 0, h || Y(this, i, r, 4, 4294967295, 0), this[r] = i >>> 24, this[r + 1] = i >>> 16, this[r + 2] = i >>> 8, this[r + 3] = i & 255, r + 4;
|
|
1618
1618
|
};
|
|
1619
1619
|
function Bt(s, i, r, h, f) {
|
|
1620
|
-
|
|
1621
|
-
let
|
|
1622
|
-
s[r++] =
|
|
1620
|
+
jt(i, h, f, s, r, 7);
|
|
1621
|
+
let m = Number(i & BigInt(4294967295));
|
|
1622
|
+
s[r++] = m, m = m >> 8, s[r++] = m, m = m >> 8, s[r++] = m, m = m >> 8, s[r++] = m;
|
|
1623
1623
|
let v = Number(i >> BigInt(32) & BigInt(4294967295));
|
|
1624
1624
|
return s[r++] = v, v = v >> 8, s[r++] = v, v = v >> 8, s[r++] = v, v = v >> 8, s[r++] = v, r;
|
|
1625
1625
|
}
|
|
1626
|
-
function
|
|
1627
|
-
|
|
1628
|
-
let
|
|
1629
|
-
s[r + 7] =
|
|
1626
|
+
function Pt(s, i, r, h, f) {
|
|
1627
|
+
jt(i, h, f, s, r, 7);
|
|
1628
|
+
let m = Number(i & BigInt(4294967295));
|
|
1629
|
+
s[r + 7] = m, m = m >> 8, s[r + 6] = m, m = m >> 8, s[r + 5] = m, m = m >> 8, s[r + 4] = m;
|
|
1630
1630
|
let v = Number(i >> BigInt(32) & BigInt(4294967295));
|
|
1631
1631
|
return s[r + 3] = v, v = v >> 8, s[r + 2] = v, v = v >> 8, s[r + 1] = v, v = v >> 8, s[r] = v, r + 8;
|
|
1632
1632
|
}
|
|
1633
|
-
l.prototype.writeBigUInt64LE =
|
|
1633
|
+
l.prototype.writeBigUInt64LE = le(function(i, r = 0) {
|
|
1634
1634
|
return Bt(this, i, r, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1635
|
-
}), l.prototype.writeBigUInt64BE =
|
|
1636
|
-
return
|
|
1635
|
+
}), l.prototype.writeBigUInt64BE = le(function(i, r = 0) {
|
|
1636
|
+
return Pt(this, i, r, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1637
1637
|
}), l.prototype.writeIntLE = function(i, r, h, f) {
|
|
1638
1638
|
if (i = +i, r = r >>> 0, !f) {
|
|
1639
|
-
const
|
|
1640
|
-
|
|
1639
|
+
const L = Math.pow(2, 8 * h - 1);
|
|
1640
|
+
Y(this, i, r, h, L - 1, -L);
|
|
1641
1641
|
}
|
|
1642
|
-
let
|
|
1643
|
-
for (this[r] = i & 255; ++
|
|
1644
|
-
i < 0 &&
|
|
1642
|
+
let m = 0, v = 1, T = 0;
|
|
1643
|
+
for (this[r] = i & 255; ++m < h && (v *= 256); )
|
|
1644
|
+
i < 0 && T === 0 && this[r + m - 1] !== 0 && (T = 1), this[r + m] = (i / v >> 0) - T & 255;
|
|
1645
1645
|
return r + h;
|
|
1646
1646
|
}, l.prototype.writeIntBE = function(i, r, h, f) {
|
|
1647
1647
|
if (i = +i, r = r >>> 0, !f) {
|
|
1648
|
-
const
|
|
1649
|
-
|
|
1648
|
+
const L = Math.pow(2, 8 * h - 1);
|
|
1649
|
+
Y(this, i, r, h, L - 1, -L);
|
|
1650
1650
|
}
|
|
1651
|
-
let
|
|
1652
|
-
for (this[r +
|
|
1653
|
-
i < 0 &&
|
|
1651
|
+
let m = h - 1, v = 1, T = 0;
|
|
1652
|
+
for (this[r + m] = i & 255; --m >= 0 && (v *= 256); )
|
|
1653
|
+
i < 0 && T === 0 && this[r + m + 1] !== 0 && (T = 1), this[r + m] = (i / v >> 0) - T & 255;
|
|
1654
1654
|
return r + h;
|
|
1655
1655
|
}, l.prototype.writeInt8 = function(i, r, h) {
|
|
1656
|
-
return i = +i, r = r >>> 0, h ||
|
|
1656
|
+
return i = +i, r = r >>> 0, h || Y(this, i, r, 1, 127, -128), i < 0 && (i = 255 + i + 1), this[r] = i & 255, r + 1;
|
|
1657
1657
|
}, l.prototype.writeInt16LE = function(i, r, h) {
|
|
1658
|
-
return i = +i, r = r >>> 0, h ||
|
|
1658
|
+
return i = +i, r = r >>> 0, h || Y(this, i, r, 2, 32767, -32768), this[r] = i & 255, this[r + 1] = i >>> 8, r + 2;
|
|
1659
1659
|
}, l.prototype.writeInt16BE = function(i, r, h) {
|
|
1660
|
-
return i = +i, r = r >>> 0, h ||
|
|
1660
|
+
return i = +i, r = r >>> 0, h || Y(this, i, r, 2, 32767, -32768), this[r] = i >>> 8, this[r + 1] = i & 255, r + 2;
|
|
1661
1661
|
}, l.prototype.writeInt32LE = function(i, r, h) {
|
|
1662
|
-
return i = +i, r = r >>> 0, h ||
|
|
1662
|
+
return i = +i, r = r >>> 0, h || Y(this, i, r, 4, 2147483647, -2147483648), this[r] = i & 255, this[r + 1] = i >>> 8, this[r + 2] = i >>> 16, this[r + 3] = i >>> 24, r + 4;
|
|
1663
1663
|
}, l.prototype.writeInt32BE = function(i, r, h) {
|
|
1664
|
-
return i = +i, r = r >>> 0, h ||
|
|
1665
|
-
}, l.prototype.writeBigInt64LE =
|
|
1664
|
+
return i = +i, r = r >>> 0, h || Y(this, i, r, 4, 2147483647, -2147483648), i < 0 && (i = 4294967295 + i + 1), this[r] = i >>> 24, this[r + 1] = i >>> 16, this[r + 2] = i >>> 8, this[r + 3] = i & 255, r + 4;
|
|
1665
|
+
}, l.prototype.writeBigInt64LE = le(function(i, r = 0) {
|
|
1666
1666
|
return Bt(this, i, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1667
|
-
}), l.prototype.writeBigInt64BE =
|
|
1668
|
-
return
|
|
1667
|
+
}), l.prototype.writeBigInt64BE = le(function(i, r = 0) {
|
|
1668
|
+
return Pt(this, i, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1669
1669
|
});
|
|
1670
|
-
function
|
|
1670
|
+
function Ft(s, i, r, h, f, m) {
|
|
1671
1671
|
if (r + h > s.length) throw new RangeError("Index out of range");
|
|
1672
1672
|
if (r < 0) throw new RangeError("Index out of range");
|
|
1673
1673
|
}
|
|
1674
|
-
function
|
|
1675
|
-
return i = +i, r = r >>> 0, f ||
|
|
1674
|
+
function $t(s, i, r, h, f) {
|
|
1675
|
+
return i = +i, r = r >>> 0, f || Ft(s, i, r, 4), n.write(s, i, r, h, 23, 4), r + 4;
|
|
1676
1676
|
}
|
|
1677
1677
|
l.prototype.writeFloatLE = function(i, r, h) {
|
|
1678
|
-
return
|
|
1678
|
+
return $t(this, i, r, !0, h);
|
|
1679
1679
|
}, l.prototype.writeFloatBE = function(i, r, h) {
|
|
1680
|
-
return
|
|
1680
|
+
return $t(this, i, r, !1, h);
|
|
1681
1681
|
};
|
|
1682
|
-
function
|
|
1683
|
-
return i = +i, r = r >>> 0, f ||
|
|
1682
|
+
function Vt(s, i, r, h, f) {
|
|
1683
|
+
return i = +i, r = r >>> 0, f || Ft(s, i, r, 8), n.write(s, i, r, h, 52, 8), r + 8;
|
|
1684
1684
|
}
|
|
1685
1685
|
l.prototype.writeDoubleLE = function(i, r, h) {
|
|
1686
|
-
return
|
|
1686
|
+
return Vt(this, i, r, !0, h);
|
|
1687
1687
|
}, l.prototype.writeDoubleBE = function(i, r, h) {
|
|
1688
|
-
return
|
|
1688
|
+
return Vt(this, i, r, !1, h);
|
|
1689
1689
|
}, l.prototype.copy = function(i, r, h, f) {
|
|
1690
1690
|
if (!l.isBuffer(i)) throw new TypeError("argument should be a Buffer");
|
|
1691
1691
|
if (h || (h = 0), !f && f !== 0 && (f = this.length), r >= i.length && (r = i.length), r || (r = 0), f > 0 && f < h && (f = h), f === h || i.length === 0 || this.length === 0) return 0;
|
|
@@ -1694,12 +1694,12 @@ function Un() {
|
|
|
1694
1694
|
if (h < 0 || h >= this.length) throw new RangeError("Index out of range");
|
|
1695
1695
|
if (f < 0) throw new RangeError("sourceEnd out of bounds");
|
|
1696
1696
|
f > this.length && (f = this.length), i.length - r < f - h && (f = i.length - r + h);
|
|
1697
|
-
const
|
|
1697
|
+
const m = f - h;
|
|
1698
1698
|
return this === i && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(r, h, f) : Uint8Array.prototype.set.call(
|
|
1699
1699
|
i,
|
|
1700
1700
|
this.subarray(h, f),
|
|
1701
1701
|
r
|
|
1702
|
-
),
|
|
1702
|
+
), m;
|
|
1703
1703
|
}, l.prototype.fill = function(i, r, h, f) {
|
|
1704
1704
|
if (typeof i == "string") {
|
|
1705
1705
|
if (typeof r == "string" ? (f = r, r = 0, h = this.length) : typeof h == "string" && (f = h, h = this.length), f !== void 0 && typeof f != "string")
|
|
@@ -1716,21 +1716,21 @@ function Un() {
|
|
|
1716
1716
|
if (h <= r)
|
|
1717
1717
|
return this;
|
|
1718
1718
|
r = r >>> 0, h = h === void 0 ? this.length : h >>> 0, i || (i = 0);
|
|
1719
|
-
let
|
|
1719
|
+
let m;
|
|
1720
1720
|
if (typeof i == "number")
|
|
1721
|
-
for (
|
|
1722
|
-
this[
|
|
1721
|
+
for (m = r; m < h; ++m)
|
|
1722
|
+
this[m] = i;
|
|
1723
1723
|
else {
|
|
1724
|
-
const v = l.isBuffer(i) ? i : l.from(i, f),
|
|
1725
|
-
if (
|
|
1724
|
+
const v = l.isBuffer(i) ? i : l.from(i, f), T = v.length;
|
|
1725
|
+
if (T === 0)
|
|
1726
1726
|
throw new TypeError('The value "' + i + '" is invalid for argument "value"');
|
|
1727
|
-
for (
|
|
1728
|
-
this[
|
|
1727
|
+
for (m = 0; m < h - r; ++m)
|
|
1728
|
+
this[m + r] = v[m % T];
|
|
1729
1729
|
}
|
|
1730
1730
|
return this;
|
|
1731
1731
|
};
|
|
1732
1732
|
const ve = {};
|
|
1733
|
-
function
|
|
1733
|
+
function st(s, i, r) {
|
|
1734
1734
|
ve[s] = class extends r {
|
|
1735
1735
|
constructor() {
|
|
1736
1736
|
super(), Object.defineProperty(this, "message", {
|
|
@@ -1755,19 +1755,19 @@ function Un() {
|
|
|
1755
1755
|
}
|
|
1756
1756
|
};
|
|
1757
1757
|
}
|
|
1758
|
-
|
|
1758
|
+
st(
|
|
1759
1759
|
"ERR_BUFFER_OUT_OF_BOUNDS",
|
|
1760
1760
|
function(s) {
|
|
1761
1761
|
return s ? `${s} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
|
|
1762
1762
|
},
|
|
1763
1763
|
RangeError
|
|
1764
|
-
),
|
|
1764
|
+
), st(
|
|
1765
1765
|
"ERR_INVALID_ARG_TYPE",
|
|
1766
1766
|
function(s, i) {
|
|
1767
1767
|
return `The "${s}" argument must be of type number. Received type ${typeof i}`;
|
|
1768
1768
|
},
|
|
1769
1769
|
TypeError
|
|
1770
|
-
),
|
|
1770
|
+
), st(
|
|
1771
1771
|
"ERR_OUT_OF_RANGE",
|
|
1772
1772
|
function(s, i, r) {
|
|
1773
1773
|
let h = `The value of "${s}" is out of range.`, f = r;
|
|
@@ -1782,16 +1782,16 @@ function Un() {
|
|
|
1782
1782
|
i = `_${s.slice(r - 3, r)}${i}`;
|
|
1783
1783
|
return `${s.slice(0, r)}${i}`;
|
|
1784
1784
|
}
|
|
1785
|
-
function
|
|
1785
|
+
function tn(s, i, r) {
|
|
1786
1786
|
ye(i, "offset"), (s[i] === void 0 || s[i + r] === void 0) && Re(i, s.length - (r + 1));
|
|
1787
1787
|
}
|
|
1788
|
-
function
|
|
1788
|
+
function jt(s, i, r, h, f, m) {
|
|
1789
1789
|
if (s > r || s < i) {
|
|
1790
1790
|
const v = typeof i == "bigint" ? "n" : "";
|
|
1791
|
-
let
|
|
1792
|
-
throw i === 0 || i === BigInt(0) ?
|
|
1791
|
+
let T;
|
|
1792
|
+
throw i === 0 || i === BigInt(0) ? T = `>= 0${v} and < 2${v} ** ${(m + 1) * 8}${v}` : T = `>= -(2${v} ** ${(m + 1) * 8 - 1}${v}) and < 2 ** ${(m + 1) * 8 - 1}${v}`, new ve.ERR_OUT_OF_RANGE("value", T, s);
|
|
1793
1793
|
}
|
|
1794
|
-
|
|
1794
|
+
tn(h, f, m);
|
|
1795
1795
|
}
|
|
1796
1796
|
function ye(s, i) {
|
|
1797
1797
|
if (typeof s != "number")
|
|
@@ -1804,57 +1804,57 @@ function Un() {
|
|
|
1804
1804
|
s
|
|
1805
1805
|
);
|
|
1806
1806
|
}
|
|
1807
|
-
const
|
|
1808
|
-
function
|
|
1809
|
-
if (s = s.split("=")[0], s = s.trim().replace(
|
|
1807
|
+
const nn = /[^+/0-9A-Za-z-_]/g;
|
|
1808
|
+
function rn(s) {
|
|
1809
|
+
if (s = s.split("=")[0], s = s.trim().replace(nn, ""), s.length < 2) return "";
|
|
1810
1810
|
for (; s.length % 4 !== 0; )
|
|
1811
1811
|
s = s + "=";
|
|
1812
1812
|
return s;
|
|
1813
1813
|
}
|
|
1814
|
-
function
|
|
1814
|
+
function at(s, i) {
|
|
1815
1815
|
i = i || 1 / 0;
|
|
1816
1816
|
let r;
|
|
1817
1817
|
const h = s.length;
|
|
1818
1818
|
let f = null;
|
|
1819
|
-
const
|
|
1819
|
+
const m = [];
|
|
1820
1820
|
for (let v = 0; v < h; ++v) {
|
|
1821
1821
|
if (r = s.charCodeAt(v), r > 55295 && r < 57344) {
|
|
1822
1822
|
if (!f) {
|
|
1823
1823
|
if (r > 56319) {
|
|
1824
|
-
(i -= 3) > -1 &&
|
|
1824
|
+
(i -= 3) > -1 && m.push(239, 191, 189);
|
|
1825
1825
|
continue;
|
|
1826
1826
|
} else if (v + 1 === h) {
|
|
1827
|
-
(i -= 3) > -1 &&
|
|
1827
|
+
(i -= 3) > -1 && m.push(239, 191, 189);
|
|
1828
1828
|
continue;
|
|
1829
1829
|
}
|
|
1830
1830
|
f = r;
|
|
1831
1831
|
continue;
|
|
1832
1832
|
}
|
|
1833
1833
|
if (r < 56320) {
|
|
1834
|
-
(i -= 3) > -1 &&
|
|
1834
|
+
(i -= 3) > -1 && m.push(239, 191, 189), f = r;
|
|
1835
1835
|
continue;
|
|
1836
1836
|
}
|
|
1837
1837
|
r = (f - 55296 << 10 | r - 56320) + 65536;
|
|
1838
|
-
} else f && (i -= 3) > -1 &&
|
|
1838
|
+
} else f && (i -= 3) > -1 && m.push(239, 191, 189);
|
|
1839
1839
|
if (f = null, r < 128) {
|
|
1840
1840
|
if ((i -= 1) < 0) break;
|
|
1841
|
-
|
|
1841
|
+
m.push(r);
|
|
1842
1842
|
} else if (r < 2048) {
|
|
1843
1843
|
if ((i -= 2) < 0) break;
|
|
1844
|
-
|
|
1844
|
+
m.push(
|
|
1845
1845
|
r >> 6 | 192,
|
|
1846
1846
|
r & 63 | 128
|
|
1847
1847
|
);
|
|
1848
1848
|
} else if (r < 65536) {
|
|
1849
1849
|
if ((i -= 3) < 0) break;
|
|
1850
|
-
|
|
1850
|
+
m.push(
|
|
1851
1851
|
r >> 12 | 224,
|
|
1852
1852
|
r >> 6 & 63 | 128,
|
|
1853
1853
|
r & 63 | 128
|
|
1854
1854
|
);
|
|
1855
1855
|
} else if (r < 1114112) {
|
|
1856
1856
|
if ((i -= 4) < 0) break;
|
|
1857
|
-
|
|
1857
|
+
m.push(
|
|
1858
1858
|
r >> 18 | 240,
|
|
1859
1859
|
r >> 12 & 63 | 128,
|
|
1860
1860
|
r >> 6 & 63 | 128,
|
|
@@ -1863,25 +1863,25 @@ function Un() {
|
|
|
1863
1863
|
} else
|
|
1864
1864
|
throw new Error("Invalid code point");
|
|
1865
1865
|
}
|
|
1866
|
-
return
|
|
1866
|
+
return m;
|
|
1867
1867
|
}
|
|
1868
|
-
function
|
|
1868
|
+
function on(s) {
|
|
1869
1869
|
const i = [];
|
|
1870
1870
|
for (let r = 0; r < s.length; ++r)
|
|
1871
1871
|
i.push(s.charCodeAt(r) & 255);
|
|
1872
1872
|
return i;
|
|
1873
1873
|
}
|
|
1874
|
-
function
|
|
1874
|
+
function sn(s, i) {
|
|
1875
1875
|
let r, h, f;
|
|
1876
|
-
const
|
|
1876
|
+
const m = [];
|
|
1877
1877
|
for (let v = 0; v < s.length && !((i -= 2) < 0); ++v)
|
|
1878
|
-
r = s.charCodeAt(v), h = r >> 8, f = r % 256,
|
|
1879
|
-
return
|
|
1878
|
+
r = s.charCodeAt(v), h = r >> 8, f = r % 256, m.push(f), m.push(h);
|
|
1879
|
+
return m;
|
|
1880
1880
|
}
|
|
1881
|
-
function
|
|
1882
|
-
return e.toByteArray(
|
|
1881
|
+
function Ht(s) {
|
|
1882
|
+
return e.toByteArray(rn(s));
|
|
1883
1883
|
}
|
|
1884
|
-
function
|
|
1884
|
+
function Ve(s, i, r, h) {
|
|
1885
1885
|
let f;
|
|
1886
1886
|
for (f = 0; f < h && !(f + r >= i.length || f >= s.length); ++f)
|
|
1887
1887
|
i[f + r] = s[f];
|
|
@@ -1890,10 +1890,10 @@ function Un() {
|
|
|
1890
1890
|
function ee(s, i) {
|
|
1891
1891
|
return s instanceof i || s != null && s.constructor != null && s.constructor.name != null && s.constructor.name === i.name;
|
|
1892
1892
|
}
|
|
1893
|
-
function
|
|
1893
|
+
function lt(s) {
|
|
1894
1894
|
return s !== s;
|
|
1895
1895
|
}
|
|
1896
|
-
const
|
|
1896
|
+
const an = (function() {
|
|
1897
1897
|
const s = "0123456789abcdef", i = new Array(256);
|
|
1898
1898
|
for (let r = 0; r < 16; ++r) {
|
|
1899
1899
|
const h = r * 16;
|
|
@@ -1902,78 +1902,78 @@ function Un() {
|
|
|
1902
1902
|
}
|
|
1903
1903
|
return i;
|
|
1904
1904
|
})();
|
|
1905
|
-
function
|
|
1906
|
-
return typeof BigInt > "u" ?
|
|
1905
|
+
function le(s) {
|
|
1906
|
+
return typeof BigInt > "u" ? ln : s;
|
|
1907
1907
|
}
|
|
1908
|
-
function
|
|
1908
|
+
function ln() {
|
|
1909
1909
|
throw new Error("BigInt not supported");
|
|
1910
1910
|
}
|
|
1911
|
-
})(
|
|
1911
|
+
})(dt)), dt;
|
|
1912
1912
|
}
|
|
1913
|
-
var
|
|
1914
|
-
const Bn = "https://api.anam.ai",
|
|
1913
|
+
var Ln = Un();
|
|
1914
|
+
const Bn = "https://api.anam.ai", Pn = "/v1", Wi = {
|
|
1915
1915
|
client: "js-sdk",
|
|
1916
1916
|
version: "4.8.0"
|
|
1917
1917
|
};
|
|
1918
|
-
var
|
|
1919
|
-
function
|
|
1920
|
-
return a instanceof n ? a : new n(function(
|
|
1921
|
-
|
|
1918
|
+
var Fn = function(t, e, n, o) {
|
|
1919
|
+
function u(a) {
|
|
1920
|
+
return a instanceof n ? a : new n(function(c) {
|
|
1921
|
+
c(a);
|
|
1922
1922
|
});
|
|
1923
1923
|
}
|
|
1924
|
-
return new (n || (n = Promise))(function(a,
|
|
1924
|
+
return new (n || (n = Promise))(function(a, c) {
|
|
1925
1925
|
function l(_) {
|
|
1926
1926
|
try {
|
|
1927
1927
|
p(o.next(_));
|
|
1928
1928
|
} catch (d) {
|
|
1929
|
-
|
|
1929
|
+
c(d);
|
|
1930
1930
|
}
|
|
1931
1931
|
}
|
|
1932
|
-
function
|
|
1932
|
+
function E(_) {
|
|
1933
1933
|
try {
|
|
1934
1934
|
p(o.throw(_));
|
|
1935
1935
|
} catch (d) {
|
|
1936
|
-
|
|
1936
|
+
c(d);
|
|
1937
1937
|
}
|
|
1938
1938
|
}
|
|
1939
1939
|
function p(_) {
|
|
1940
|
-
_.done ? a(_.value) :
|
|
1940
|
+
_.done ? a(_.value) : u(_.value).then(l, E);
|
|
1941
1941
|
}
|
|
1942
1942
|
p((o = o.apply(t, e || [])).next());
|
|
1943
1943
|
});
|
|
1944
1944
|
};
|
|
1945
|
-
const
|
|
1946
|
-
var
|
|
1945
|
+
const zi = "https://api.anam.ai", xt = "/v1";
|
|
1946
|
+
var oe;
|
|
1947
1947
|
(function(t) {
|
|
1948
1948
|
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";
|
|
1949
|
-
})(
|
|
1950
|
-
let St =
|
|
1951
|
-
const
|
|
1952
|
-
St = t,
|
|
1953
|
-
},
|
|
1954
|
-
|
|
1949
|
+
})(oe || (oe = {}));
|
|
1950
|
+
let St = zi, qi = xt, ue, Yi = !1;
|
|
1951
|
+
const $n = (t, e = xt) => {
|
|
1952
|
+
St = t, qi = e;
|
|
1953
|
+
}, Vn = (t) => {
|
|
1954
|
+
ue = t;
|
|
1955
1955
|
}, Gn = (t) => {
|
|
1956
|
-
|
|
1956
|
+
Yi = t;
|
|
1957
1957
|
};
|
|
1958
|
-
let
|
|
1958
|
+
let de = {
|
|
1959
1959
|
sessionId: null,
|
|
1960
1960
|
organizationId: null,
|
|
1961
1961
|
attemptCorrelationId: null
|
|
1962
1962
|
};
|
|
1963
1963
|
const Se = (t) => {
|
|
1964
|
-
|
|
1965
|
-
}, me = (t, e, n) =>
|
|
1966
|
-
if (!
|
|
1964
|
+
de = Object.assign(Object.assign({}, de), t);
|
|
1965
|
+
}, me = (t, e, n) => Fn(void 0, void 0, void 0, function* () {
|
|
1966
|
+
if (!Yi)
|
|
1967
1967
|
try {
|
|
1968
|
-
const o = Object.assign(Object.assign({},
|
|
1969
|
-
|
|
1970
|
-
const
|
|
1971
|
-
let a,
|
|
1968
|
+
const o = Object.assign(Object.assign({}, Wi), n);
|
|
1969
|
+
de.sessionId && (o.sessionId = de.sessionId), de.organizationId && (o.organizationId = de.organizationId), de.attemptCorrelationId && (o.attemptCorrelationId = de.attemptCorrelationId);
|
|
1970
|
+
const u = `${qi}/metrics/client`;
|
|
1971
|
+
let a, c = {
|
|
1972
1972
|
"Content-Type": "application/json"
|
|
1973
1973
|
};
|
|
1974
|
-
|
|
1974
|
+
ue?.enabled && ue?.baseUrl ? (a = `${ue.baseUrl}${u}`, c["X-Anam-Target-Url"] = `${St}${u}`) : a = `${St}${u}`, yield fetch(a, {
|
|
1975
1975
|
method: "POST",
|
|
1976
|
-
headers:
|
|
1976
|
+
headers: c,
|
|
1977
1977
|
body: JSON.stringify({
|
|
1978
1978
|
name: t,
|
|
1979
1979
|
value: e,
|
|
@@ -1983,102 +1983,102 @@ const Se = (t) => {
|
|
|
1983
1983
|
} catch (o) {
|
|
1984
1984
|
console.error("Failed to send error metric:", o);
|
|
1985
1985
|
}
|
|
1986
|
-
}),
|
|
1987
|
-
var n, o,
|
|
1986
|
+
}), jn = (t, e = "console") => {
|
|
1987
|
+
var n, o, u;
|
|
1988
1988
|
const a = {};
|
|
1989
1989
|
t.forEach((d) => {
|
|
1990
1990
|
a[d.type] || (a[d.type] = []), a[d.type].push(d);
|
|
1991
1991
|
});
|
|
1992
|
-
const
|
|
1992
|
+
const c = {
|
|
1993
1993
|
issues: []
|
|
1994
1994
|
}, l = ((n = a["inbound-rtp"]) === null || n === void 0 ? void 0 : n.filter((d) => d.kind === "video")) || [];
|
|
1995
|
-
l.length > 0 && (
|
|
1996
|
-
var
|
|
1995
|
+
l.length > 0 && (c.personaVideoStream = [], l.forEach((d) => {
|
|
1996
|
+
var S, g, y, C, A;
|
|
1997
1997
|
const I = {
|
|
1998
|
-
framesReceived: (
|
|
1998
|
+
framesReceived: (S = d.framesReceived) !== null && S !== void 0 ? S : "unknown",
|
|
1999
1999
|
framesDropped: (g = d.framesDropped) !== null && g !== void 0 ? g : "unknown",
|
|
2000
|
-
framesPerSecond: (
|
|
2000
|
+
framesPerSecond: (y = d.framesPerSecond) !== null && y !== void 0 ? y : "unknown",
|
|
2001
2001
|
packetsReceived: (C = d.packetsReceived) !== null && C !== void 0 ? C : "unknown",
|
|
2002
2002
|
packetsLost: (A = d.packetsLost) !== null && A !== void 0 ? A : "unknown",
|
|
2003
2003
|
resolution: d.frameWidth && d.frameHeight ? `${d.frameWidth}x${d.frameHeight}` : void 0,
|
|
2004
2004
|
jitter: d.jitter !== void 0 ? d.jitter : void 0
|
|
2005
2005
|
};
|
|
2006
|
-
|
|
2006
|
+
c.personaVideoStream.push(I);
|
|
2007
2007
|
}));
|
|
2008
|
-
const
|
|
2009
|
-
|
|
2010
|
-
var
|
|
2008
|
+
const E = ((o = a["inbound-rtp"]) === null || o === void 0 ? void 0 : o.filter((d) => d.kind === "audio")) || [];
|
|
2009
|
+
E.length > 0 && (c.personaAudioStream = [], E.forEach((d) => {
|
|
2010
|
+
var S, g, y;
|
|
2011
2011
|
const C = {
|
|
2012
|
-
packetsReceived: (
|
|
2012
|
+
packetsReceived: (S = d.packetsReceived) !== null && S !== void 0 ? S : "unknown",
|
|
2013
2013
|
packetsLost: (g = d.packetsLost) !== null && g !== void 0 ? g : "unknown",
|
|
2014
|
-
audioLevel: (
|
|
2014
|
+
audioLevel: (y = d.audioLevel) !== null && y !== void 0 ? y : "unknown",
|
|
2015
2015
|
jitter: d.jitter !== void 0 ? d.jitter : void 0,
|
|
2016
2016
|
totalAudioEnergy: d.totalAudioEnergy !== void 0 ? d.totalAudioEnergy : void 0
|
|
2017
2017
|
};
|
|
2018
|
-
|
|
2018
|
+
c.personaAudioStream.push(C);
|
|
2019
2019
|
}));
|
|
2020
|
-
const p = ((
|
|
2021
|
-
p.length > 0 && (
|
|
2022
|
-
var
|
|
2023
|
-
const
|
|
2024
|
-
packetsSent: (
|
|
2020
|
+
const p = ((u = a["outbound-rtp"]) === null || u === void 0 ? void 0 : u.filter((d) => d.kind === "audio")) || [];
|
|
2021
|
+
p.length > 0 && (c.userAudioInput = [], p.forEach((d) => {
|
|
2022
|
+
var S, g;
|
|
2023
|
+
const y = {
|
|
2024
|
+
packetsSent: (S = d.packetsSent) !== null && S !== void 0 ? S : "unknown",
|
|
2025
2025
|
retransmittedPackets: (g = d.retransmittedPacketsSent) !== null && g !== void 0 ? g : void 0,
|
|
2026
2026
|
avgPacketSendDelay: d.totalPacketSendDelay !== void 0 ? d.totalPacketSendDelay / (d.packetsSent || 1) * 1e3 : void 0
|
|
2027
2027
|
};
|
|
2028
|
-
|
|
2029
|
-
})), a.codec && (
|
|
2030
|
-
const
|
|
2028
|
+
c.userAudioInput.push(y);
|
|
2029
|
+
})), a.codec && (c.codecs = [], a.codec.forEach((d) => {
|
|
2030
|
+
const S = {
|
|
2031
2031
|
status: d.payloadType ? "Active" : "Available",
|
|
2032
2032
|
mimeType: d.mimeType || "Unknown",
|
|
2033
2033
|
payloadType: d.payloadType || "N/A",
|
|
2034
2034
|
clockRate: d.clockRate || void 0,
|
|
2035
2035
|
channels: d.channels || void 0
|
|
2036
2036
|
};
|
|
2037
|
-
|
|
2038
|
-
})), a.transport && (
|
|
2039
|
-
const
|
|
2037
|
+
c.codecs.push(S);
|
|
2038
|
+
})), a.transport && (c.transportLayer = [], a.transport.forEach((d) => {
|
|
2039
|
+
const S = {
|
|
2040
2040
|
dtlsState: d.dtlsState || "unknown",
|
|
2041
2041
|
iceState: d.iceState || "unknown",
|
|
2042
2042
|
bytesSent: d.bytesSent || void 0,
|
|
2043
2043
|
bytesReceived: d.bytesReceived || void 0
|
|
2044
2044
|
};
|
|
2045
|
-
|
|
2045
|
+
c.transportLayer.push(S);
|
|
2046
2046
|
}));
|
|
2047
2047
|
const _ = [];
|
|
2048
2048
|
if (l.forEach((d) => {
|
|
2049
2049
|
typeof d.framesDropped == "number" && d.framesDropped > 0 && _.push(`Video: ${d.framesDropped} frames dropped`), typeof d.packetsLost == "number" && d.packetsLost > 0 && _.push(`Video: ${d.packetsLost} packets lost`), typeof d.framesPerSecond == "number" && d.framesPerSecond < 23 && _.push(`Video: Low frame rate (${d.framesPerSecond} fps)`);
|
|
2050
|
-
}),
|
|
2050
|
+
}), E.forEach((d) => {
|
|
2051
2051
|
typeof d.packetsLost == "number" && d.packetsLost > 0 && _.push(`Audio: ${d.packetsLost} packets lost`), typeof d.jitter == "number" && d.jitter > 0.1 && _.push(`Audio: High jitter (${(d.jitter * 1e3).toFixed(1)}ms)`);
|
|
2052
|
-
}),
|
|
2053
|
-
return
|
|
2054
|
-
console.group("📊 WebRTC Session Statistics Report"),
|
|
2052
|
+
}), c.issues = _, e === "json")
|
|
2053
|
+
return c;
|
|
2054
|
+
console.group("📊 WebRTC Session Statistics Report"), c.personaVideoStream && c.personaVideoStream.length > 0 && (console.group("📹 Persona Video Stream (Inbound)"), c.personaVideoStream.forEach((d) => {
|
|
2055
2055
|
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`);
|
|
2056
|
-
}), console.groupEnd()),
|
|
2056
|
+
}), console.groupEnd()), c.personaAudioStream && c.personaAudioStream.length > 0 && (console.group("🔊 Persona Audio Stream (Inbound)"), c.personaAudioStream.forEach((d) => {
|
|
2057
2057
|
console.log(`Packets Received: ${typeof d.packetsReceived == "number" ? d.packetsReceived.toLocaleString() : d.packetsReceived}`), console.log(`Packets Lost: ${d.packetsLost}`), console.log(`Audio Level: ${d.audioLevel}`), d.jitter !== void 0 && console.log(`Jitter: ${d.jitter.toFixed(5)}ms`), d.totalAudioEnergy !== void 0 && console.log(`Total Audio Energy: ${d.totalAudioEnergy.toFixed(6)}`);
|
|
2058
|
-
}), console.groupEnd()),
|
|
2058
|
+
}), console.groupEnd()), c.userAudioInput && c.userAudioInput.length > 0 && (console.group("🎤 User Audio Input (Outbound)"), c.userAudioInput.forEach((d) => {
|
|
2059
2059
|
console.log(`Packets Sent: ${typeof d.packetsSent == "number" ? d.packetsSent.toLocaleString() : d.packetsSent}`), d.retransmittedPackets && console.log(`Retransmitted Packets: ${d.retransmittedPackets}`), d.avgPacketSendDelay !== void 0 && console.log(`Avg Packet Send Delay: ${d.avgPacketSendDelay.toFixed(5)}ms`);
|
|
2060
|
-
}), console.groupEnd()),
|
|
2060
|
+
}), console.groupEnd()), c.codecs && c.codecs.length > 0 && (console.group("🔧 Codecs Used"), c.codecs.forEach((d) => {
|
|
2061
2061
|
console.log(`${d.status} ${d.mimeType} - Payload Type: ${d.payloadType}`), d.clockRate && console.log(` Clock Rate: ${d.clockRate}Hz`), d.channels && console.log(` Channels: ${d.channels}`);
|
|
2062
|
-
}), console.groupEnd()),
|
|
2062
|
+
}), console.groupEnd()), c.transportLayer && c.transportLayer.length > 0 && (console.group("🚚 Transport Layer"), c.transportLayer.forEach((d) => {
|
|
2063
2063
|
console.log(`DTLS State: ${d.dtlsState}`), console.log(`ICE State: ${d.iceState}`), (d.bytesReceived || d.bytesSent) && console.log(`Data Transfer (bytes) - Sent: ${(d.bytesSent || 0).toLocaleString()}, Received: ${(d.bytesReceived || 0).toLocaleString()}`);
|
|
2064
|
-
}), console.groupEnd()),
|
|
2064
|
+
}), console.groupEnd()), c.issues.length > 0 ? (console.group("⚠️ Potential Issues Detected"), c.issues.forEach((d) => console.warn(d)), console.groupEnd()) : console.log("✅ No significant issues detected"), console.groupEnd();
|
|
2065
2065
|
};
|
|
2066
|
-
var
|
|
2066
|
+
var j;
|
|
2067
2067
|
(function(t) {
|
|
2068
2068
|
t.CLIENT_ERROR_CODE_USAGE_LIMIT_REACHED = "CLIENT_ERROR_CODE_USAGE_LIMIT_REACHED", t.CLIENT_ERROR_CODE_SPEND_CAP_REACHED = "CLIENT_ERROR_CODE_SPEND_CAP_REACHED", t.CLIENT_ERROR_CODE_VALIDATION_ERROR = "CLIENT_ERROR_CODE_VALIDATION_ERROR", t.CLIENT_ERROR_CODE_AUTHENTICATION_ERROR = "CLIENT_ERROR_CODE_AUTHENTICATION_ERROR", t.CLIENT_ERROR_CODE_SERVER_ERROR = "CLIENT_ERROR_CODE_SERVER_ERROR", t.CLIENT_ERROR_CODE_MAX_CONCURRENT_SESSIONS_REACHED = "CLIENT_ERROR_CODE_MAX_CONCURRENT_SESSIONS_REACHED", t.CLIENT_ERROR_CODE_SERVICE_BUSY = "CLIENT_ERROR_CODE_SERVICE_BUSY", t.CLIENT_ERROR_CODE_NO_PLAN_FOUND = "CLIENT_ERROR_CODE_NO_PLAN_FOUND", t.CLIENT_ERROR_CODE_UNKNOWN_ERROR = "CLIENT_ERROR_CODE_UNKNOWN_ERROR", t.CLIENT_ERROR_CODE_CONFIGURATION_ERROR = "CLIENT_ERROR_CODE_CONFIGURATION_ERROR";
|
|
2069
|
-
})(
|
|
2069
|
+
})(j || (j = {}));
|
|
2070
2070
|
class $ extends Error {
|
|
2071
|
-
constructor(e, n, o = 500,
|
|
2072
|
-
super(e), this.name = "ClientError", this.code = n, this.statusCode = o, this.details =
|
|
2073
|
-
details:
|
|
2071
|
+
constructor(e, n, o = 500, u) {
|
|
2072
|
+
super(e), this.name = "ClientError", this.code = n, this.statusCode = o, this.details = u, Object.setPrototypeOf(this, $.prototype), me(oe.CLIENT_METRIC_MEASUREMENT_ERROR, n, {
|
|
2073
|
+
details: u,
|
|
2074
2074
|
statusCode: o
|
|
2075
2075
|
});
|
|
2076
2076
|
}
|
|
2077
2077
|
}
|
|
2078
|
-
function
|
|
2078
|
+
function ci() {
|
|
2079
2079
|
return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : Date.now().toString(36) + Math.random().toString(36).substr(2, 9);
|
|
2080
2080
|
}
|
|
2081
|
-
function
|
|
2081
|
+
function Hn(t) {
|
|
2082
2082
|
if (!(!t || !t.enabled)) {
|
|
2083
2083
|
if (!t.baseUrl)
|
|
2084
2084
|
return "API Gateway baseUrl is required when enabled";
|
|
@@ -2101,27 +2101,27 @@ var De;
|
|
|
2101
2101
|
(function(t) {
|
|
2102
2102
|
t.SPEECH_TEXT = "speechText", t.CLIENT_TOOL_EVENT = "clientToolEvent", t.REASONING_TEXT = "reasoningText";
|
|
2103
2103
|
})(De || (De = {}));
|
|
2104
|
-
var
|
|
2104
|
+
var he;
|
|
2105
2105
|
(function(t) {
|
|
2106
2106
|
t.PENDING = "pending", t.GRANTED = "granted", t.DENIED = "denied", t.NOT_REQUESTED = "not_requested";
|
|
2107
|
-
})(
|
|
2108
|
-
var
|
|
2107
|
+
})(he || (he = {}));
|
|
2108
|
+
var Qe;
|
|
2109
2109
|
(function(t) {
|
|
2110
2110
|
t.USER = "user", t.PERSONA = "persona";
|
|
2111
|
-
})(
|
|
2112
|
-
var
|
|
2111
|
+
})(Qe || (Qe = {}));
|
|
2112
|
+
var R;
|
|
2113
2113
|
(function(t) {
|
|
2114
2114
|
t.MESSAGE_HISTORY_UPDATED = "MESSAGE_HISTORY_UPDATED", t.MESSAGE_STREAM_EVENT_RECEIVED = "MESSAGE_STREAM_EVENT_RECEIVED", t.CONNECTION_ESTABLISHED = "CONNECTION_ESTABLISHED", t.CONNECTION_CLOSED = "CONNECTION_CLOSED", t.INPUT_AUDIO_STREAM_STARTED = "INPUT_AUDIO_STREAM_STARTED", t.VIDEO_STREAM_STARTED = "VIDEO_STREAM_STARTED", t.VIDEO_PLAY_STARTED = "VIDEO_PLAY_STARTED", t.AUDIO_STREAM_STARTED = "AUDIO_STREAM_STARTED", t.TALK_STREAM_INTERRUPTED = "TALK_STREAM_INTERRUPTED", t.SESSION_READY = "SESSION_READY", t.SERVER_WARNING = "SERVER_WARNING", t.MIC_PERMISSION_PENDING = "MIC_PERMISSION_PENDING", t.MIC_PERMISSION_GRANTED = "MIC_PERMISSION_GRANTED", t.MIC_PERMISSION_DENIED = "MIC_PERMISSION_DENIED", t.INPUT_AUDIO_DEVICE_CHANGED = "INPUT_AUDIO_DEVICE_CHANGED", t.CLIENT_TOOL_EVENT_RECEIVED = "CLIENT_TOOL_EVENT_RECEIVED", t.REASONING_HISTORY_UPDATED = "REASONING_HISTORY_UPDATED", t.REASONING_STREAM_EVENT_RECEIVED = "REASONING_STREAM_EVENT_RECEIVED";
|
|
2115
|
-
})(
|
|
2115
|
+
})(R || (R = {}));
|
|
2116
2116
|
var J;
|
|
2117
2117
|
(function(t) {
|
|
2118
2118
|
t.WEB_SOCKET_OPEN = "WEB_SOCKET_OPEN", t.SIGNAL_MESSAGE_RECEIVED = "SIGNAL_MESSAGE_RECEIVED", t.WEBRTC_CHAT_MESSAGE_RECEIVED = "WEBRTC_CHAT_MESSAGE_RECEIVED", t.WEBRTC_CLIENT_TOOL_EVENT_RECEIVED = "WEBRTC_CLIENT_TOOL_EVENT_RECEIVED", t.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED = "WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED";
|
|
2119
2119
|
})(J || (J = {}));
|
|
2120
|
-
var
|
|
2120
|
+
var pe;
|
|
2121
2121
|
(function(t) {
|
|
2122
2122
|
t.NORMAL = "CONNECTION_CLOSED_CODE_NORMAL", t.MICROPHONE_PERMISSION_DENIED = "CONNECTION_CLOSED_CODE_MICROPHONE_PERMISSION_DENIED", t.SIGNALLING_CLIENT_CONNECTION_FAILURE = "CONNECTION_CLOSED_CODE_SIGNALLING_CLIENT_CONNECTION_FAILURE", t.WEBRTC_FAILURE = "CONNECTION_CLOSED_CODE_WEBRTC_FAILURE", t.SERVER_CLOSED_CONNECTION = "CONNECTION_CLOSED_CODE_SERVER_CLOSED_CONNECTION";
|
|
2123
|
-
})(
|
|
2124
|
-
class
|
|
2123
|
+
})(pe || (pe = {}));
|
|
2124
|
+
class Wn {
|
|
2125
2125
|
constructor(e, n) {
|
|
2126
2126
|
this.sequenceNumber = 0, this.config = e, this.signallingClient = n;
|
|
2127
2127
|
}
|
|
@@ -2159,52 +2159,52 @@ class Hn {
|
|
|
2159
2159
|
return this.config;
|
|
2160
2160
|
}
|
|
2161
2161
|
arrayBufferToBase64(e) {
|
|
2162
|
-
const n = e instanceof Uint8Array ? e : new Uint8Array(e), o = Array.from(n, (
|
|
2162
|
+
const n = e instanceof Uint8Array ? e : new Uint8Array(e), o = Array.from(n, (u) => String.fromCharCode(u)).join("");
|
|
2163
2163
|
return btoa(o);
|
|
2164
2164
|
}
|
|
2165
2165
|
}
|
|
2166
2166
|
var we = function(t, e, n, o) {
|
|
2167
|
-
function
|
|
2168
|
-
return a instanceof n ? a : new n(function(
|
|
2169
|
-
|
|
2167
|
+
function u(a) {
|
|
2168
|
+
return a instanceof n ? a : new n(function(c) {
|
|
2169
|
+
c(a);
|
|
2170
2170
|
});
|
|
2171
2171
|
}
|
|
2172
|
-
return new (n || (n = Promise))(function(a,
|
|
2172
|
+
return new (n || (n = Promise))(function(a, c) {
|
|
2173
2173
|
function l(_) {
|
|
2174
2174
|
try {
|
|
2175
2175
|
p(o.next(_));
|
|
2176
2176
|
} catch (d) {
|
|
2177
|
-
|
|
2177
|
+
c(d);
|
|
2178
2178
|
}
|
|
2179
2179
|
}
|
|
2180
|
-
function
|
|
2180
|
+
function E(_) {
|
|
2181
2181
|
try {
|
|
2182
2182
|
p(o.throw(_));
|
|
2183
2183
|
} catch (d) {
|
|
2184
|
-
|
|
2184
|
+
c(d);
|
|
2185
2185
|
}
|
|
2186
2186
|
}
|
|
2187
2187
|
function p(_) {
|
|
2188
|
-
_.done ? a(_.value) :
|
|
2188
|
+
_.done ? a(_.value) : u(_.value).then(l, E);
|
|
2189
2189
|
}
|
|
2190
2190
|
p((o = o.apply(t, e || [])).next());
|
|
2191
2191
|
});
|
|
2192
2192
|
};
|
|
2193
|
-
const
|
|
2194
|
-
class
|
|
2195
|
-
constructor(e, n, o,
|
|
2196
|
-
var
|
|
2197
|
-
if (this.stopSignal = !1, this.sendingBuffer = [], this.wsConnectionAttempts = 0, this.socket = null, this.heartBeatIntervalRef = null, this.publicEventEmitter = o, this.internalEventEmitter =
|
|
2193
|
+
const zn = 5, qn = 5;
|
|
2194
|
+
class Yn {
|
|
2195
|
+
constructor(e, n, o, u, a) {
|
|
2196
|
+
var c, l, E, p, _;
|
|
2197
|
+
if (this.stopSignal = !1, this.sendingBuffer = [], this.wsConnectionAttempts = 0, this.socket = null, this.heartBeatIntervalRef = null, this.publicEventEmitter = o, this.internalEventEmitter = u, this.apiGatewayConfig = a, !e)
|
|
2198
2198
|
throw new Error("Signalling Client: sessionId is required");
|
|
2199
2199
|
this.sessionId = e;
|
|
2200
|
-
const { heartbeatIntervalSeconds: d, maxWsReconnectionAttempts:
|
|
2201
|
-
if (this.heartbeatIntervalSeconds = d ||
|
|
2200
|
+
const { heartbeatIntervalSeconds: d, maxWsReconnectionAttempts: S, url: g } = n;
|
|
2201
|
+
if (this.heartbeatIntervalSeconds = d || zn, this.maxWsReconnectionAttempts = S || qn, !g.baseUrl)
|
|
2202
2202
|
throw new Error("Signalling Client: baseUrl is required");
|
|
2203
|
-
if (!((
|
|
2204
|
-
const
|
|
2205
|
-
|
|
2206
|
-
const A = g.protocol || "https", I = A === "http" ? "ws" : "wss", b = `${A}://${g.baseUrl}`,
|
|
2207
|
-
D.protocol = I === "ws" ? "ws:" : "wss:", g.port && (D.port = g.port), D.pathname =
|
|
2203
|
+
if (!((c = this.apiGatewayConfig) === null || c === void 0) && c.enabled && (!((l = this.apiGatewayConfig) === null || l === void 0) && l.baseUrl)) {
|
|
2204
|
+
const y = new URL(this.apiGatewayConfig.baseUrl), C = (E = this.apiGatewayConfig.wsPath) !== null && E !== void 0 ? E : "/ws";
|
|
2205
|
+
y.protocol = y.protocol.replace("http", "ws"), y.pathname = C, this.url = y;
|
|
2206
|
+
const A = g.protocol || "https", I = A === "http" ? "ws" : "wss", b = `${A}://${g.baseUrl}`, N = (p = g.signallingPath) !== null && p !== void 0 ? p : "/ws", D = new URL(b);
|
|
2207
|
+
D.protocol = I === "ws" ? "ws:" : "wss:", g.port && (D.port = g.port), D.pathname = N, D.searchParams.append("session_id", e), this.url.searchParams.append("target_url", D.href);
|
|
2208
2208
|
} else {
|
|
2209
2209
|
const C = `${g.protocol || "https"}://${g.baseUrl}`;
|
|
2210
2210
|
this.url = new URL(C), this.url.protocol = g.protocol === "http" ? "ws:" : "wss:", g.port && (this.url.port = g.port), this.url.pathname = (_ = g.signallingPath) !== null && _ !== void 0 ? _ : "/ws", this.url.searchParams.append("session_id", e);
|
|
@@ -2287,7 +2287,7 @@ class qn {
|
|
|
2287
2287
|
try {
|
|
2288
2288
|
this.wsConnectionAttempts = 0, this.flushSendingBuffer(), this.socket.onmessage = this.onMessage.bind(this), this.startSendingHeartBeats(), this.internalEventEmitter.emit(J.WEB_SOCKET_OPEN);
|
|
2289
2289
|
} catch (e) {
|
|
2290
|
-
console.error("SignallingClient - onOpen: error in onOpen", e), this.publicEventEmitter.emit(
|
|
2290
|
+
console.error("SignallingClient - onOpen: error in onOpen", e), this.publicEventEmitter.emit(R.CONNECTION_CLOSED, pe.SIGNALLING_CLIENT_CONNECTION_FAILURE);
|
|
2291
2291
|
}
|
|
2292
2292
|
});
|
|
2293
2293
|
}
|
|
@@ -2295,7 +2295,7 @@ class qn {
|
|
|
2295
2295
|
return we(this, void 0, void 0, function* () {
|
|
2296
2296
|
this.wsConnectionAttempts += 1, !this.stopSignal && (this.wsConnectionAttempts <= this.maxWsReconnectionAttempts ? (this.socket = null, setTimeout(() => {
|
|
2297
2297
|
this.connect();
|
|
2298
|
-
}, 100 * this.wsConnectionAttempts)) : (this.heartBeatIntervalRef && (clearInterval(this.heartBeatIntervalRef), this.heartBeatIntervalRef = null), this.publicEventEmitter.emit(
|
|
2298
|
+
}, 100 * this.wsConnectionAttempts)) : (this.heartBeatIntervalRef && (clearInterval(this.heartBeatIntervalRef), this.heartBeatIntervalRef = null), this.publicEventEmitter.emit(R.CONNECTION_CLOSED, pe.SIGNALLING_CLIENT_CONNECTION_FAILURE)));
|
|
2299
2299
|
});
|
|
2300
2300
|
}
|
|
2301
2301
|
onError(e) {
|
|
@@ -2324,54 +2324,54 @@ class qn {
|
|
|
2324
2324
|
payload: ""
|
|
2325
2325
|
}, o = JSON.stringify(n);
|
|
2326
2326
|
this.heartBeatIntervalRef = setInterval(() => {
|
|
2327
|
-
var
|
|
2328
|
-
this.stopSignal || ((
|
|
2327
|
+
var u;
|
|
2328
|
+
this.stopSignal || ((u = this.socket) === null || u === void 0 ? void 0 : u.readyState) === WebSocket.OPEN && this.socket.send(o);
|
|
2329
2329
|
}, e);
|
|
2330
2330
|
}
|
|
2331
2331
|
}
|
|
2332
|
-
function
|
|
2332
|
+
function Kn(t) {
|
|
2333
2333
|
return "brainType" in t || "llmId" in t;
|
|
2334
2334
|
}
|
|
2335
|
-
var
|
|
2336
|
-
function
|
|
2337
|
-
return a instanceof n ? a : new n(function(
|
|
2338
|
-
|
|
2335
|
+
var ui = function(t, e, n, o) {
|
|
2336
|
+
function u(a) {
|
|
2337
|
+
return a instanceof n ? a : new n(function(c) {
|
|
2338
|
+
c(a);
|
|
2339
2339
|
});
|
|
2340
2340
|
}
|
|
2341
|
-
return new (n || (n = Promise))(function(a,
|
|
2341
|
+
return new (n || (n = Promise))(function(a, c) {
|
|
2342
2342
|
function l(_) {
|
|
2343
2343
|
try {
|
|
2344
2344
|
p(o.next(_));
|
|
2345
2345
|
} catch (d) {
|
|
2346
|
-
|
|
2346
|
+
c(d);
|
|
2347
2347
|
}
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2349
|
+
function E(_) {
|
|
2350
2350
|
try {
|
|
2351
2351
|
p(o.throw(_));
|
|
2352
2352
|
} catch (d) {
|
|
2353
|
-
|
|
2353
|
+
c(d);
|
|
2354
2354
|
}
|
|
2355
2355
|
}
|
|
2356
2356
|
function p(_) {
|
|
2357
|
-
_.done ? a(_.value) :
|
|
2357
|
+
_.done ? a(_.value) : u(_.value).then(l, E);
|
|
2358
2358
|
}
|
|
2359
2359
|
p((o = o.apply(t, e || [])).next());
|
|
2360
2360
|
});
|
|
2361
2361
|
};
|
|
2362
|
-
class
|
|
2362
|
+
class Jn {
|
|
2363
2363
|
constructor(e, n, o) {
|
|
2364
2364
|
if (!e && !n)
|
|
2365
2365
|
throw new Error("Either sessionToken or apiKey must be provided");
|
|
2366
|
-
this.sessionToken = e || null, this.apiKey = n || null, this.baseUrl = o?.baseUrl || Bn, this.apiVersion = o?.apiVersion ||
|
|
2366
|
+
this.sessionToken = e || null, this.apiKey = n || null, this.baseUrl = o?.baseUrl || Bn, this.apiVersion = o?.apiVersion || Pn, this.apiGatewayConfig = o?.apiGateway || void 0;
|
|
2367
2367
|
}
|
|
2368
2368
|
/**
|
|
2369
2369
|
* Builds URL and headers for a request, applying API Gateway configuration if enabled
|
|
2370
2370
|
*/
|
|
2371
2371
|
buildGatewayUrlAndHeaders(e, n) {
|
|
2372
|
-
var o,
|
|
2373
|
-
if (!((o = this.apiGatewayConfig) === null || o === void 0) && o.enabled && (!((
|
|
2374
|
-
const a = `${this.apiGatewayConfig.baseUrl}${e}`,
|
|
2372
|
+
var o, u;
|
|
2373
|
+
if (!((o = this.apiGatewayConfig) === null || o === void 0) && o.enabled && (!((u = this.apiGatewayConfig) === null || u === void 0) && u.baseUrl)) {
|
|
2374
|
+
const a = `${this.apiGatewayConfig.baseUrl}${e}`, c = new URL(`${this.baseUrl}${e}`), l = Object.assign(Object.assign({}, n), { "X-Anam-Target-Url": c.href });
|
|
2375
2375
|
return { url: a, headers: l };
|
|
2376
2376
|
} else
|
|
2377
2377
|
return {
|
|
@@ -2380,65 +2380,65 @@ class Kn {
|
|
|
2380
2380
|
};
|
|
2381
2381
|
}
|
|
2382
2382
|
startSession(e, n) {
|
|
2383
|
-
return
|
|
2383
|
+
return ui(this, void 0, void 0, function* () {
|
|
2384
2384
|
if (!this.sessionToken) {
|
|
2385
2385
|
if (!e)
|
|
2386
|
-
throw new $("Persona configuration must be provided when using apiKey",
|
|
2386
|
+
throw new $("Persona configuration must be provided when using apiKey", j.CLIENT_ERROR_CODE_VALIDATION_ERROR, 400);
|
|
2387
2387
|
this.sessionToken = yield this.unsafe_getSessionToken(e);
|
|
2388
2388
|
}
|
|
2389
2389
|
e && "brainType" in e && console.warn("Warning: brainType is deprecated and will be removed in a future version. Please use llmId instead.");
|
|
2390
2390
|
try {
|
|
2391
|
-
const o = `${this.apiVersion}/engine/session`, { url:
|
|
2391
|
+
const o = `${this.apiVersion}/engine/session`, { url: u, headers: a } = this.buildGatewayUrlAndHeaders(o, {
|
|
2392
2392
|
"Content-Type": "application/json",
|
|
2393
2393
|
Authorization: `Bearer ${this.sessionToken}`
|
|
2394
|
-
}),
|
|
2394
|
+
}), c = yield fetch(u, {
|
|
2395
2395
|
method: "POST",
|
|
2396
2396
|
headers: a,
|
|
2397
2397
|
body: JSON.stringify({
|
|
2398
2398
|
personaConfig: e,
|
|
2399
2399
|
sessionOptions: n,
|
|
2400
|
-
clientMetadata:
|
|
2400
|
+
clientMetadata: Wi
|
|
2401
2401
|
})
|
|
2402
|
-
}), l = yield
|
|
2403
|
-
switch (
|
|
2402
|
+
}), l = yield c.json(), E = l.error;
|
|
2403
|
+
switch (c.status) {
|
|
2404
2404
|
case 200:
|
|
2405
2405
|
case 201:
|
|
2406
2406
|
return l;
|
|
2407
2407
|
case 400:
|
|
2408
|
-
throw new $("Invalid request to start session",
|
|
2408
|
+
throw new $("Invalid request to start session", j.CLIENT_ERROR_CODE_VALIDATION_ERROR, 400, { cause: l.message });
|
|
2409
2409
|
case 401:
|
|
2410
|
-
throw new $("Authentication failed when starting session",
|
|
2410
|
+
throw new $("Authentication failed when starting session", j.CLIENT_ERROR_CODE_AUTHENTICATION_ERROR, 401, { cause: l.message });
|
|
2411
2411
|
case 402:
|
|
2412
|
-
throw new $("Please sign up for a plan to start a session",
|
|
2412
|
+
throw new $("Please sign up for a plan to start a session", j.CLIENT_ERROR_CODE_NO_PLAN_FOUND, 402, { cause: l.message });
|
|
2413
2413
|
case 403:
|
|
2414
|
-
throw new $("Authentication failed when starting session",
|
|
2414
|
+
throw new $("Authentication failed when starting session", j.CLIENT_ERROR_CODE_AUTHENTICATION_ERROR, 403, { cause: l.message });
|
|
2415
2415
|
case 429:
|
|
2416
|
-
throw
|
|
2416
|
+
throw E === "Concurrent session limit reached" ? new $("Concurrency limit reached, please upgrade your plan", j.CLIENT_ERROR_CODE_MAX_CONCURRENT_SESSIONS_REACHED, 429, { cause: l.message }) : E === "Spend cap reached" ? new $("Spend cap reached, please upgrade your plan", j.CLIENT_ERROR_CODE_SPEND_CAP_REACHED, 429, { cause: l.message }) : new $("Usage limit reached, please upgrade your plan", j.CLIENT_ERROR_CODE_USAGE_LIMIT_REACHED, 429, { cause: l.message });
|
|
2417
2417
|
case 503:
|
|
2418
|
-
throw new $("There are no available personas, please try again later",
|
|
2418
|
+
throw new $("There are no available personas, please try again later", j.CLIENT_ERROR_CODE_SERVICE_BUSY, 503, { cause: l.message });
|
|
2419
2419
|
default:
|
|
2420
|
-
throw new $("Unknown error when starting session",
|
|
2420
|
+
throw new $("Unknown error when starting session", j.CLIENT_ERROR_CODE_SERVER_ERROR, 500, { cause: l.message });
|
|
2421
2421
|
}
|
|
2422
2422
|
} catch (o) {
|
|
2423
|
-
throw o instanceof $ ? o : new $("Failed to start session",
|
|
2423
|
+
throw o instanceof $ ? o : new $("Failed to start session", j.CLIENT_ERROR_CODE_SERVER_ERROR, 500, { cause: o instanceof Error ? o.message : String(o) });
|
|
2424
2424
|
}
|
|
2425
2425
|
});
|
|
2426
2426
|
}
|
|
2427
2427
|
unsafe_getSessionToken(e) {
|
|
2428
|
-
return
|
|
2428
|
+
return ui(this, void 0, void 0, function* () {
|
|
2429
2429
|
if (console.warn("Using unsecure method. This method should not be used in production."), !this.apiKey)
|
|
2430
2430
|
throw new Error("No apiKey provided");
|
|
2431
2431
|
e && "brainType" in e && console.warn("Warning: brainType is deprecated and will be removed in a future version. Please use llmId instead.");
|
|
2432
2432
|
let n = {
|
|
2433
2433
|
clientLabel: "js-sdk-api-key"
|
|
2434
2434
|
};
|
|
2435
|
-
|
|
2435
|
+
Kn(e) && (n = Object.assign(Object.assign({}, n), { personaConfig: e }));
|
|
2436
2436
|
try {
|
|
2437
|
-
const o = `${this.apiVersion}/auth/session-token`, { url:
|
|
2437
|
+
const o = `${this.apiVersion}/auth/session-token`, { url: u, headers: a } = this.buildGatewayUrlAndHeaders(o, {
|
|
2438
2438
|
"Content-Type": "application/json",
|
|
2439
2439
|
Authorization: `Bearer ${this.apiKey}`
|
|
2440
2440
|
});
|
|
2441
|
-
return (yield (yield fetch(
|
|
2441
|
+
return (yield (yield fetch(u, {
|
|
2442
2442
|
method: "POST",
|
|
2443
2443
|
headers: a,
|
|
2444
2444
|
body: JSON.stringify(n)
|
|
@@ -2452,67 +2452,67 @@ class Kn {
|
|
|
2452
2452
|
return `${this.baseUrl}${this.apiVersion}`;
|
|
2453
2453
|
}
|
|
2454
2454
|
}
|
|
2455
|
-
var
|
|
2456
|
-
function
|
|
2457
|
-
return a instanceof n ? a : new n(function(
|
|
2458
|
-
|
|
2455
|
+
var Xn = function(t, e, n, o) {
|
|
2456
|
+
function u(a) {
|
|
2457
|
+
return a instanceof n ? a : new n(function(c) {
|
|
2458
|
+
c(a);
|
|
2459
2459
|
});
|
|
2460
2460
|
}
|
|
2461
|
-
return new (n || (n = Promise))(function(a,
|
|
2461
|
+
return new (n || (n = Promise))(function(a, c) {
|
|
2462
2462
|
function l(_) {
|
|
2463
2463
|
try {
|
|
2464
2464
|
p(o.next(_));
|
|
2465
2465
|
} catch (d) {
|
|
2466
|
-
|
|
2466
|
+
c(d);
|
|
2467
2467
|
}
|
|
2468
2468
|
}
|
|
2469
|
-
function
|
|
2469
|
+
function E(_) {
|
|
2470
2470
|
try {
|
|
2471
2471
|
p(o.throw(_));
|
|
2472
2472
|
} catch (d) {
|
|
2473
|
-
|
|
2473
|
+
c(d);
|
|
2474
2474
|
}
|
|
2475
2475
|
}
|
|
2476
2476
|
function p(_) {
|
|
2477
|
-
_.done ? a(_.value) :
|
|
2477
|
+
_.done ? a(_.value) : u(_.value).then(l, E);
|
|
2478
2478
|
}
|
|
2479
2479
|
p((o = o.apply(t, e || [])).next());
|
|
2480
2480
|
});
|
|
2481
2481
|
};
|
|
2482
|
-
class
|
|
2482
|
+
class Zn {
|
|
2483
2483
|
constructor(e, n, o) {
|
|
2484
2484
|
this.baseUrl = e, this.sessionId = n, this.apiGatewayConfig = o;
|
|
2485
2485
|
}
|
|
2486
2486
|
sendTalkCommand(e) {
|
|
2487
|
-
return
|
|
2487
|
+
return Xn(this, void 0, void 0, function* () {
|
|
2488
2488
|
var n, o;
|
|
2489
2489
|
try {
|
|
2490
|
-
let
|
|
2490
|
+
let u, a = {
|
|
2491
2491
|
"Content-Type": "application/json"
|
|
2492
2492
|
};
|
|
2493
|
-
const
|
|
2493
|
+
const c = "/talk", l = `?session_id=${this.sessionId}`;
|
|
2494
2494
|
if (!((n = this.apiGatewayConfig) === null || n === void 0) && n.enabled && (!((o = this.apiGatewayConfig) === null || o === void 0) && o.baseUrl)) {
|
|
2495
|
-
|
|
2496
|
-
const p = new URL(`${this.baseUrl}${
|
|
2495
|
+
u = `${this.apiGatewayConfig.baseUrl}${c}${l}`;
|
|
2496
|
+
const p = new URL(`${this.baseUrl}${c}${l}`);
|
|
2497
2497
|
a["X-Anam-Target-Url"] = p.href;
|
|
2498
2498
|
} else
|
|
2499
|
-
|
|
2500
|
-
const
|
|
2499
|
+
u = `${this.baseUrl}${c}${l}`;
|
|
2500
|
+
const E = yield fetch(u, {
|
|
2501
2501
|
method: "POST",
|
|
2502
2502
|
headers: a,
|
|
2503
2503
|
body: JSON.stringify({
|
|
2504
2504
|
content: e
|
|
2505
2505
|
})
|
|
2506
2506
|
});
|
|
2507
|
-
if (!
|
|
2508
|
-
throw new Error(`Failed to send talk command: ${
|
|
2509
|
-
} catch (
|
|
2510
|
-
throw console.error(
|
|
2507
|
+
if (!E.ok)
|
|
2508
|
+
throw new Error(`Failed to send talk command: ${E.status} ${E.statusText}`);
|
|
2509
|
+
} catch (u) {
|
|
2510
|
+
throw console.error(u), new Error("EngineApiRestClient - sendTalkCommand: Failed to send talk command");
|
|
2511
2511
|
}
|
|
2512
2512
|
});
|
|
2513
2513
|
}
|
|
2514
2514
|
}
|
|
2515
|
-
class
|
|
2515
|
+
class Qn {
|
|
2516
2516
|
constructor() {
|
|
2517
2517
|
this.listeners = {};
|
|
2518
2518
|
}
|
|
@@ -2528,7 +2528,7 @@ class Zn {
|
|
|
2528
2528
|
});
|
|
2529
2529
|
}
|
|
2530
2530
|
}
|
|
2531
|
-
class
|
|
2531
|
+
class er {
|
|
2532
2532
|
constructor(e, n) {
|
|
2533
2533
|
this.messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(J.WEBRTC_CHAT_MESSAGE_RECEIVED, this.processWebRtcTextMessageEvent.bind(this));
|
|
2534
2534
|
}
|
|
@@ -2556,27 +2556,27 @@ class Qn {
|
|
|
2556
2556
|
content: e.content,
|
|
2557
2557
|
role: e.role,
|
|
2558
2558
|
interrupted: e.interrupted
|
|
2559
|
-
}, o = this.messages.findIndex((
|
|
2559
|
+
}, o = this.messages.findIndex((u) => u.id === n.id);
|
|
2560
2560
|
if (o !== -1) {
|
|
2561
|
-
const
|
|
2562
|
-
this.messages[o] = Object.assign(Object.assign({},
|
|
2561
|
+
const u = this.messages[o];
|
|
2562
|
+
this.messages[o] = Object.assign(Object.assign({}, u), { content: u.content + n.content, interrupted: u.interrupted || n.interrupted });
|
|
2563
2563
|
} else
|
|
2564
2564
|
this.messages.push(n);
|
|
2565
2565
|
}
|
|
2566
2566
|
processWebRtcTextMessageEvent(e) {
|
|
2567
2567
|
const n = this.webRtcTextMessageEventToMessageStreamEvent(e);
|
|
2568
|
-
switch (this.publicEventEmitter.emit(
|
|
2569
|
-
case
|
|
2568
|
+
switch (this.publicEventEmitter.emit(R.MESSAGE_STREAM_EVENT_RECEIVED, n), n.role) {
|
|
2569
|
+
case Qe.USER:
|
|
2570
2570
|
this.processUserMessage(n);
|
|
2571
2571
|
break;
|
|
2572
|
-
case
|
|
2572
|
+
case Qe.PERSONA:
|
|
2573
2573
|
this.processPersonaMessage(n);
|
|
2574
2574
|
break;
|
|
2575
2575
|
}
|
|
2576
|
-
n.endOfSpeech && this.publicEventEmitter.emit(
|
|
2576
|
+
n.endOfSpeech && this.publicEventEmitter.emit(R.MESSAGE_HISTORY_UPDATED, this.messages);
|
|
2577
2577
|
}
|
|
2578
2578
|
}
|
|
2579
|
-
class
|
|
2579
|
+
class tr {
|
|
2580
2580
|
constructor() {
|
|
2581
2581
|
this.listeners = {};
|
|
2582
2582
|
}
|
|
@@ -2587,9 +2587,9 @@ class er {
|
|
|
2587
2587
|
this.listeners[e] && this.listeners[e].delete(n);
|
|
2588
2588
|
}
|
|
2589
2589
|
emit(e, ...n) {
|
|
2590
|
-
if (e ===
|
|
2591
|
-
const [o,
|
|
2592
|
-
me(
|
|
2590
|
+
if (e === R.CONNECTION_ESTABLISHED && me(oe.CLIENT_METRIC_MEASUREMENT_CONNECTION_ESTABLISHED, "1"), e === R.CONNECTION_CLOSED) {
|
|
2591
|
+
const [o, u] = n;
|
|
2592
|
+
me(oe.CLIENT_METRIC_MEASUREMENT_CONNECTION_CLOSED, o, u ? { details: u } : void 0);
|
|
2593
2593
|
}
|
|
2594
2594
|
this.listeners[e] && this.listeners[e].forEach((o) => {
|
|
2595
2595
|
o(...n);
|
|
@@ -2600,34 +2600,34 @@ var z;
|
|
|
2600
2600
|
(function(t) {
|
|
2601
2601
|
t[t.UNSTARTED = 0] = "UNSTARTED", t[t.STREAMING = 1] = "STREAMING", t[t.INTERRUPTED = 2] = "INTERRUPTED", t[t.ENDED = 3] = "ENDED";
|
|
2602
2602
|
})(z || (z = {}));
|
|
2603
|
-
var
|
|
2604
|
-
function
|
|
2605
|
-
return a instanceof n ? a : new n(function(
|
|
2606
|
-
|
|
2603
|
+
var ht = function(t, e, n, o) {
|
|
2604
|
+
function u(a) {
|
|
2605
|
+
return a instanceof n ? a : new n(function(c) {
|
|
2606
|
+
c(a);
|
|
2607
2607
|
});
|
|
2608
2608
|
}
|
|
2609
|
-
return new (n || (n = Promise))(function(a,
|
|
2609
|
+
return new (n || (n = Promise))(function(a, c) {
|
|
2610
2610
|
function l(_) {
|
|
2611
2611
|
try {
|
|
2612
2612
|
p(o.next(_));
|
|
2613
2613
|
} catch (d) {
|
|
2614
|
-
|
|
2614
|
+
c(d);
|
|
2615
2615
|
}
|
|
2616
2616
|
}
|
|
2617
|
-
function
|
|
2617
|
+
function E(_) {
|
|
2618
2618
|
try {
|
|
2619
2619
|
p(o.throw(_));
|
|
2620
2620
|
} catch (d) {
|
|
2621
|
-
|
|
2621
|
+
c(d);
|
|
2622
2622
|
}
|
|
2623
2623
|
}
|
|
2624
2624
|
function p(_) {
|
|
2625
|
-
_.done ? a(_.value) :
|
|
2625
|
+
_.done ? a(_.value) : u(_.value).then(l, E);
|
|
2626
2626
|
}
|
|
2627
2627
|
p((o = o.apply(t, e || [])).next());
|
|
2628
2628
|
});
|
|
2629
2629
|
};
|
|
2630
|
-
class
|
|
2630
|
+
class ir {
|
|
2631
2631
|
constructor(e, n, o) {
|
|
2632
2632
|
this.state = z.UNSTARTED, this.correlationId = e, this.internalEventEmitter = n, this.signallingClient = o, this.internalEventEmitter.addListener(J.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this));
|
|
2633
2633
|
}
|
|
@@ -2635,12 +2635,12 @@ class tr {
|
|
|
2635
2635
|
this.internalEventEmitter.removeListener(J.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this));
|
|
2636
2636
|
}
|
|
2637
2637
|
onSignalMessage(e) {
|
|
2638
|
-
return
|
|
2638
|
+
return ht(this, void 0, void 0, function* () {
|
|
2639
2639
|
e.actionType === W.TALK_STREAM_INTERRUPTED && e.payload.correlationId === this.correlationId && (this.state = z.INTERRUPTED, this.onDeactivate());
|
|
2640
2640
|
});
|
|
2641
2641
|
}
|
|
2642
2642
|
endMessage() {
|
|
2643
|
-
return
|
|
2643
|
+
return ht(this, void 0, void 0, function* () {
|
|
2644
2644
|
if (this.state === z.ENDED) {
|
|
2645
2645
|
console.warn("Talk stream is already ended via end of speech. No need to call endMessage.");
|
|
2646
2646
|
return;
|
|
@@ -2659,7 +2659,7 @@ class tr {
|
|
|
2659
2659
|
});
|
|
2660
2660
|
}
|
|
2661
2661
|
streamMessageChunk(e, n) {
|
|
2662
|
-
return
|
|
2662
|
+
return ht(this, void 0, void 0, function* () {
|
|
2663
2663
|
if (this.state !== z.STREAMING && this.state !== z.UNSTARTED)
|
|
2664
2664
|
throw new Error("Talk stream is not in an active state: " + this.state);
|
|
2665
2665
|
const o = {
|
|
@@ -2682,42 +2682,42 @@ class tr {
|
|
|
2682
2682
|
}
|
|
2683
2683
|
}
|
|
2684
2684
|
var K = function(t, e, n, o) {
|
|
2685
|
-
function
|
|
2686
|
-
return a instanceof n ? a : new n(function(
|
|
2687
|
-
|
|
2685
|
+
function u(a) {
|
|
2686
|
+
return a instanceof n ? a : new n(function(c) {
|
|
2687
|
+
c(a);
|
|
2688
2688
|
});
|
|
2689
2689
|
}
|
|
2690
|
-
return new (n || (n = Promise))(function(a,
|
|
2690
|
+
return new (n || (n = Promise))(function(a, c) {
|
|
2691
2691
|
function l(_) {
|
|
2692
2692
|
try {
|
|
2693
2693
|
p(o.next(_));
|
|
2694
2694
|
} catch (d) {
|
|
2695
|
-
|
|
2695
|
+
c(d);
|
|
2696
2696
|
}
|
|
2697
2697
|
}
|
|
2698
|
-
function
|
|
2698
|
+
function E(_) {
|
|
2699
2699
|
try {
|
|
2700
2700
|
p(o.throw(_));
|
|
2701
2701
|
} catch (d) {
|
|
2702
|
-
|
|
2702
|
+
c(d);
|
|
2703
2703
|
}
|
|
2704
2704
|
}
|
|
2705
2705
|
function p(_) {
|
|
2706
|
-
_.done ? a(_.value) :
|
|
2706
|
+
_.done ? a(_.value) : u(_.value).then(l, E);
|
|
2707
2707
|
}
|
|
2708
2708
|
p((o = o.apply(t, e || [])).next());
|
|
2709
2709
|
});
|
|
2710
2710
|
};
|
|
2711
|
-
const
|
|
2712
|
-
class
|
|
2713
|
-
constructor(e, n, o,
|
|
2714
|
-
var a,
|
|
2711
|
+
const nr = 15e3, rr = 5e3, or = 2;
|
|
2712
|
+
class sr {
|
|
2713
|
+
constructor(e, n, o, u) {
|
|
2714
|
+
var a, c, l, E;
|
|
2715
2715
|
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 = {
|
|
2716
2716
|
isMuted: !1,
|
|
2717
|
-
permissionState:
|
|
2718
|
-
}, this.successMetricPoller = null, this.successMetricFired = !1, this.showPeerConnectionStatsReport = !1, this.peerConnectionStatsReportOutputFormat = "console", this.statsCollectionInterval = null, this.agentAudioInputStream = null, this.publicEventEmitter = o, this.internalEventEmitter =
|
|
2717
|
+
permissionState: he.NOT_REQUESTED
|
|
2718
|
+
}, this.successMetricPoller = null, this.successMetricFired = !1, this.showPeerConnectionStatsReport = !1, this.peerConnectionStatsReportOutputFormat = "console", this.statsCollectionInterval = null, this.agentAudioInputStream = null, this.publicEventEmitter = o, this.internalEventEmitter = u, this.apiGatewayConfig = n.apiGateway;
|
|
2719
2719
|
const { inputAudio: p } = n;
|
|
2720
|
-
this.inputAudioState = p.inputAudioState, n.inputAudio.userProvidedMediaStream && (this.inputAudioStream = n.inputAudio.userProvidedMediaStream), this.disableInputAudio = n.inputAudio.disableInputAudio === !0, this.internalEventEmitter.addListener(J.WEB_SOCKET_OPEN, this.onSignallingClientConnected.bind(this)), this.internalEventEmitter.addListener(J.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this)), this.iceServers = n.iceServers, this.signallingClient = new
|
|
2720
|
+
this.inputAudioState = p.inputAudioState, n.inputAudio.userProvidedMediaStream && (this.inputAudioStream = n.inputAudio.userProvidedMediaStream), this.disableInputAudio = n.inputAudio.disableInputAudio === !0, this.internalEventEmitter.addListener(J.WEB_SOCKET_OPEN, this.onSignallingClientConnected.bind(this)), this.internalEventEmitter.addListener(J.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this)), this.iceServers = n.iceServers, this.signallingClient = new Yn(e, n.signalling, this.publicEventEmitter, this.internalEventEmitter, this.apiGatewayConfig), this.engineApiRestClient = new Zn(n.engine.baseUrl, e, this.apiGatewayConfig), this.audioDeviceId = n.inputAudio.audioDeviceId, this.showPeerConnectionStatsReport = (c = (a = n.metrics) === null || a === void 0 ? void 0 : a.showPeerConnectionStatsReport) !== null && c !== void 0 ? c : !1, this.peerConnectionStatsReportOutputFormat = (E = (l = n.metrics) === null || l === void 0 ? void 0 : l.peerConnectionStatsReportOutputFormat) !== null && E !== void 0 ? E : "console";
|
|
2721
2721
|
}
|
|
2722
2722
|
onInputAudioStateChange(e, n) {
|
|
2723
2723
|
e.isMuted !== n.isMuted && (n.isMuted ? this.muteAllAudioTracks() : this.unmuteAllAudioTracks());
|
|
@@ -2743,7 +2743,7 @@ class or {
|
|
|
2743
2743
|
} catch (e) {
|
|
2744
2744
|
console.error("Failed to collect and send stats:", e);
|
|
2745
2745
|
}
|
|
2746
|
-
}),
|
|
2746
|
+
}), rr));
|
|
2747
2747
|
}
|
|
2748
2748
|
sendClientSideMetrics(e) {
|
|
2749
2749
|
e.forEach((n) => {
|
|
@@ -2761,7 +2761,7 @@ class or {
|
|
|
2761
2761
|
return;
|
|
2762
2762
|
const e = setTimeout(() => {
|
|
2763
2763
|
this.successMetricPoller && (console.warn("No video frames received, there is a problem with the connection."), clearInterval(this.successMetricPoller), this.successMetricPoller = null);
|
|
2764
|
-
},
|
|
2764
|
+
}, nr);
|
|
2765
2765
|
this.successMetricPoller = setInterval(() => K(this, void 0, void 0, function* () {
|
|
2766
2766
|
if (!this.peerConnection || this.successMetricFired) {
|
|
2767
2767
|
this.successMetricPoller && clearInterval(this.successMetricPoller), clearTimeout(e);
|
|
@@ -2769,11 +2769,11 @@ class or {
|
|
|
2769
2769
|
}
|
|
2770
2770
|
try {
|
|
2771
2771
|
const n = yield this.peerConnection.getStats();
|
|
2772
|
-
let o = !1,
|
|
2772
|
+
let o = !1, u = null;
|
|
2773
2773
|
n.forEach((a) => {
|
|
2774
|
-
a.type === "inbound-rtp" && a.kind === "video" && (a.framesDecoded !== void 0 && a.framesDecoded > 0 ? (o = !0,
|
|
2775
|
-
a.bytesReceived > 1e5 && (o = !0,
|
|
2776
|
-
}), o && !this.successMetricFired && (this.successMetricFired = !0, me(
|
|
2774
|
+
a.type === "inbound-rtp" && a.kind === "video" && (a.framesDecoded !== void 0 && a.framesDecoded > 0 ? (o = !0, u = "framesDecoded") : a.framesReceived !== void 0 && a.framesReceived > 0 ? (o = !0, u = "framesReceived") : a.bytesReceived > 0 && a.packetsReceived > 0 && // Additional check: ensure we've received enough data for actual video
|
|
2775
|
+
a.bytesReceived > 1e5 && (o = !0, u = "bytesReceived"));
|
|
2776
|
+
}), o && !this.successMetricFired && (this.successMetricFired = !0, me(oe.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS, "1", u ? { detectionMethod: u } : void 0), this.successMetricPoller && clearInterval(this.successMetricPoller), clearTimeout(e), this.successMetricPoller = null);
|
|
2777
2777
|
} catch {
|
|
2778
2778
|
}
|
|
2779
2779
|
}), 500);
|
|
@@ -2800,8 +2800,8 @@ class or {
|
|
|
2800
2800
|
throw new Error("StreamingClient - changeAudioInputDevice: deviceId is required");
|
|
2801
2801
|
const n = this.inputAudioState.isMuted;
|
|
2802
2802
|
try {
|
|
2803
|
-
this.inputAudioStream && this.inputAudioStream.getAudioTracks().forEach((
|
|
2804
|
-
|
|
2803
|
+
this.inputAudioStream && this.inputAudioStream.getAudioTracks().forEach((u) => {
|
|
2804
|
+
u.stop();
|
|
2805
2805
|
});
|
|
2806
2806
|
const o = {
|
|
2807
2807
|
echoCancellation: !0,
|
|
@@ -2811,7 +2811,7 @@ class or {
|
|
|
2811
2811
|
};
|
|
2812
2812
|
this.inputAudioStream = yield navigator.mediaDevices.getUserMedia({
|
|
2813
2813
|
audio: o
|
|
2814
|
-
}), this.audioDeviceId = e, yield this.setupAudioTrack(), n && this.muteAllAudioTracks(), this.publicEventEmitter.emit(
|
|
2814
|
+
}), this.audioDeviceId = e, yield this.setupAudioTrack(), n && this.muteAllAudioTracks(), this.publicEventEmitter.emit(R.INPUT_AUDIO_DEVICE_CHANGED, e);
|
|
2815
2815
|
} catch (o) {
|
|
2816
2816
|
throw console.error("Failed to change audio input device:", o), new Error(`StreamingClient - changeAudioInputDevice: ${o instanceof Error ? o.message : String(o)}`);
|
|
2817
2817
|
}
|
|
@@ -2861,10 +2861,10 @@ class or {
|
|
|
2861
2861
|
});
|
|
2862
2862
|
}
|
|
2863
2863
|
startTalkMessageStream(e) {
|
|
2864
|
-
return e || (e = Math.random().toString(36).substring(2, 15)), new
|
|
2864
|
+
return e || (e = Math.random().toString(36).substring(2, 15)), new ir(e, this.internalEventEmitter, this.signallingClient);
|
|
2865
2865
|
}
|
|
2866
2866
|
createAgentAudioInputStream(e) {
|
|
2867
|
-
return this.agentAudioInputStream = new
|
|
2867
|
+
return this.agentAudioInputStream = new Wn(e, this.signallingClient), this.agentAudioInputStream;
|
|
2868
2868
|
}
|
|
2869
2869
|
getAgentAudioInputStream() {
|
|
2870
2870
|
return this.agentAudioInputStream;
|
|
@@ -2873,7 +2873,7 @@ class or {
|
|
|
2873
2873
|
return K(this, void 0, void 0, function* () {
|
|
2874
2874
|
this.peerConnection = new RTCPeerConnection({
|
|
2875
2875
|
iceServers: this.iceServers,
|
|
2876
|
-
iceCandidatePoolSize:
|
|
2876
|
+
iceCandidatePoolSize: or
|
|
2877
2877
|
}), 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) => {
|
|
2878
2878
|
console.error("Async microphone permission request failed:", e);
|
|
2879
2879
|
}));
|
|
@@ -2891,24 +2891,24 @@ class or {
|
|
|
2891
2891
|
yield this.peerConnection.setRemoteDescription(n), this.connectionReceivedAnswer = !0, this.flushRemoteIceCandidateBuffer();
|
|
2892
2892
|
break;
|
|
2893
2893
|
case W.ICE_CANDIDATE:
|
|
2894
|
-
const o = e.payload,
|
|
2895
|
-
this.connectionReceivedAnswer ? yield this.peerConnection.addIceCandidate(
|
|
2894
|
+
const o = e.payload, u = new RTCIceCandidate(o);
|
|
2895
|
+
this.connectionReceivedAnswer ? yield this.peerConnection.addIceCandidate(u) : this.remoteIceCandidateBuffer.push(u);
|
|
2896
2896
|
break;
|
|
2897
2897
|
case W.END_SESSION:
|
|
2898
2898
|
const a = e.payload;
|
|
2899
|
-
this.publicEventEmitter.emit(
|
|
2899
|
+
this.publicEventEmitter.emit(R.CONNECTION_CLOSED, pe.SERVER_CLOSED_CONNECTION, a), this.shutdown();
|
|
2900
2900
|
break;
|
|
2901
2901
|
case W.WARNING:
|
|
2902
|
-
const
|
|
2903
|
-
console.warn("Warning received from server: " +
|
|
2902
|
+
const c = e.payload;
|
|
2903
|
+
console.warn("Warning received from server: " + c), this.publicEventEmitter.emit(R.SERVER_WARNING, c);
|
|
2904
2904
|
break;
|
|
2905
2905
|
case W.TALK_STREAM_INTERRUPTED:
|
|
2906
2906
|
const l = e.payload;
|
|
2907
|
-
this.publicEventEmitter.emit(
|
|
2907
|
+
this.publicEventEmitter.emit(R.TALK_STREAM_INTERRUPTED, l.correlationId);
|
|
2908
2908
|
break;
|
|
2909
2909
|
case W.SESSION_READY:
|
|
2910
|
-
const
|
|
2911
|
-
this.publicEventEmitter.emit(
|
|
2910
|
+
const E = e.sessionId;
|
|
2911
|
+
this.publicEventEmitter.emit(R.SESSION_READY, E);
|
|
2912
2912
|
break;
|
|
2913
2913
|
case W.HEARTBEAT:
|
|
2914
2914
|
break;
|
|
@@ -2943,14 +2943,14 @@ class or {
|
|
|
2943
2943
|
}
|
|
2944
2944
|
onIceConnectionStateChange() {
|
|
2945
2945
|
var e, n;
|
|
2946
|
-
(((e = this.peerConnection) === null || e === void 0 ? void 0 : e.iceConnectionState) === "connected" || ((n = this.peerConnection) === null || n === void 0 ? void 0 : n.iceConnectionState) === "completed") && (this.publicEventEmitter.emit(
|
|
2946
|
+
(((e = this.peerConnection) === null || e === void 0 ? void 0 : e.iceConnectionState) === "connected" || ((n = this.peerConnection) === null || n === void 0 ? void 0 : n.iceConnectionState) === "completed") && (this.publicEventEmitter.emit(R.CONNECTION_ESTABLISHED), this.startStatsCollection());
|
|
2947
2947
|
}
|
|
2948
2948
|
onConnectionStateChange() {
|
|
2949
2949
|
var e;
|
|
2950
2950
|
((e = this.peerConnection) === null || e === void 0 ? void 0 : e.connectionState) === "closed" && (console.error("StreamingClient - onConnectionStateChange: Connection closed"), this.handleWebrtcFailure("The connection to our servers was lost. Please try again."));
|
|
2951
2951
|
}
|
|
2952
2952
|
handleWebrtcFailure(e) {
|
|
2953
|
-
console.error({ message: "StreamingClient - handleWebrtcFailure: ", err: e }), e.name === "NotAllowedError" && e.message === "Permission denied" ? this.publicEventEmitter.emit(
|
|
2953
|
+
console.error({ message: "StreamingClient - handleWebrtcFailure: ", err: e }), e.name === "NotAllowedError" && e.message === "Permission denied" ? this.publicEventEmitter.emit(R.CONNECTION_CLOSED, pe.MICROPHONE_PERMISSION_DENIED) : this.publicEventEmitter.emit(R.CONNECTION_CLOSED, pe.WEBRTC_FAILURE);
|
|
2954
2954
|
try {
|
|
2955
2955
|
this.stopConnection();
|
|
2956
2956
|
} catch (n) {
|
|
@@ -2959,14 +2959,14 @@ class or {
|
|
|
2959
2959
|
}
|
|
2960
2960
|
onTrackEventHandler(e) {
|
|
2961
2961
|
if (e.track.kind === "video") {
|
|
2962
|
-
if (this.startSuccessMetricPolling(), this.videoStream = e.streams[0], this.publicEventEmitter.emit(
|
|
2962
|
+
if (this.startSuccessMetricPolling(), this.videoStream = e.streams[0], this.publicEventEmitter.emit(R.VIDEO_STREAM_STARTED, this.videoStream), this.videoElement) {
|
|
2963
2963
|
this.videoElement.srcObject = this.videoStream;
|
|
2964
2964
|
const n = this.videoElement.requestVideoFrameCallback(() => {
|
|
2965
2965
|
var o;
|
|
2966
|
-
(o = this.videoElement) === null || o === void 0 || o.cancelVideoFrameCallback(n), this.publicEventEmitter.emit(
|
|
2966
|
+
(o = this.videoElement) === null || o === void 0 || o.cancelVideoFrameCallback(n), this.publicEventEmitter.emit(R.VIDEO_PLAY_STARTED), this.successMetricFired || (this.successMetricFired = !0, me(oe.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS, "1", { detectionMethod: "videoElement" }));
|
|
2967
2967
|
});
|
|
2968
2968
|
}
|
|
2969
|
-
} else e.track.kind === "audio" && (this.audioStream = e.streams[0], this.publicEventEmitter.emit(
|
|
2969
|
+
} else e.track.kind === "audio" && (this.audioStream = e.streams[0], this.publicEventEmitter.emit(R.AUDIO_STREAM_STARTED, this.audioStream));
|
|
2970
2970
|
}
|
|
2971
2971
|
/**
|
|
2972
2972
|
* Set up the data channels for sending and receiving messages
|
|
@@ -2993,10 +2993,10 @@ class or {
|
|
|
2993
2993
|
this.internalEventEmitter.emit(J.WEBRTC_CHAT_MESSAGE_RECEIVED, o.data);
|
|
2994
2994
|
break;
|
|
2995
2995
|
case De.CLIENT_TOOL_EVENT:
|
|
2996
|
-
const
|
|
2997
|
-
this.internalEventEmitter.emit(J.WEBRTC_CLIENT_TOOL_EVENT_RECEIVED,
|
|
2998
|
-
const a =
|
|
2999
|
-
this.publicEventEmitter.emit(
|
|
2996
|
+
const u = o.data;
|
|
2997
|
+
this.internalEventEmitter.emit(J.WEBRTC_CLIENT_TOOL_EVENT_RECEIVED, u);
|
|
2998
|
+
const a = ar.WebRTCClientToolEventToClientToolEvent(u);
|
|
2999
|
+
this.publicEventEmitter.emit(R.CLIENT_TOOL_EVENT_RECEIVED, a);
|
|
3000
3000
|
break;
|
|
3001
3001
|
case De.REASONING_TEXT:
|
|
3002
3002
|
this.internalEventEmitter.emit(J.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED, o.data);
|
|
@@ -3016,8 +3016,8 @@ class or {
|
|
|
3016
3016
|
*/
|
|
3017
3017
|
requestMicrophonePermissionAsync() {
|
|
3018
3018
|
return K(this, void 0, void 0, function* () {
|
|
3019
|
-
if (this.inputAudioState.permissionState !==
|
|
3020
|
-
this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState:
|
|
3019
|
+
if (this.inputAudioState.permissionState !== he.PENDING) {
|
|
3020
|
+
this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: he.PENDING }), this.publicEventEmitter.emit(R.MIC_PERMISSION_PENDING);
|
|
3021
3021
|
try {
|
|
3022
3022
|
const e = {
|
|
3023
3023
|
echoCancellation: !0
|
|
@@ -3026,11 +3026,11 @@ class or {
|
|
|
3026
3026
|
exact: this.audioDeviceId
|
|
3027
3027
|
}), this.inputAudioStream = yield navigator.mediaDevices.getUserMedia({
|
|
3028
3028
|
audio: e
|
|
3029
|
-
}), this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState:
|
|
3029
|
+
}), this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: he.GRANTED }), this.publicEventEmitter.emit(R.MIC_PERMISSION_GRANTED), yield this.setupAudioTrack();
|
|
3030
3030
|
} catch (e) {
|
|
3031
|
-
console.error("Failed to get microphone permission:", e), this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState:
|
|
3031
|
+
console.error("Failed to get microphone permission:", e), this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: he.DENIED });
|
|
3032
3032
|
const n = e instanceof Error ? e.message : String(e);
|
|
3033
|
-
this.publicEventEmitter.emit(
|
|
3033
|
+
this.publicEventEmitter.emit(R.MIC_PERMISSION_DENIED, n);
|
|
3034
3034
|
}
|
|
3035
3035
|
}
|
|
3036
3036
|
});
|
|
@@ -3047,19 +3047,19 @@ class or {
|
|
|
3047
3047
|
return;
|
|
3048
3048
|
}
|
|
3049
3049
|
this.inputAudioState.isMuted && this.muteAllAudioTracks();
|
|
3050
|
-
const e = this.inputAudioStream.getAudioTracks()[0], o = this.peerConnection.getSenders().find((
|
|
3050
|
+
const e = this.inputAudioStream.getAudioTracks()[0], o = this.peerConnection.getSenders().find((u) => {
|
|
3051
3051
|
var a;
|
|
3052
|
-
return ((a =
|
|
3052
|
+
return ((a = u.track) === null || a === void 0 ? void 0 : a.kind) === "audio" || u.track === null && u.dtmf !== null;
|
|
3053
3053
|
});
|
|
3054
3054
|
if (o)
|
|
3055
3055
|
try {
|
|
3056
3056
|
yield o.replaceTrack(e);
|
|
3057
|
-
} catch (
|
|
3058
|
-
console.error("Failed to replace audio track:",
|
|
3057
|
+
} catch (u) {
|
|
3058
|
+
console.error("Failed to replace audio track:", u), this.peerConnection.addTrack(e, this.inputAudioStream);
|
|
3059
3059
|
}
|
|
3060
3060
|
else
|
|
3061
3061
|
this.peerConnection.addTrack(e, this.inputAudioStream);
|
|
3062
|
-
this.publicEventEmitter.emit(
|
|
3062
|
+
this.publicEventEmitter.emit(R.INPUT_AUDIO_STREAM_STARTED, this.inputAudioStream);
|
|
3063
3063
|
});
|
|
3064
3064
|
}
|
|
3065
3065
|
initPeerConnectionAndSendOffer() {
|
|
@@ -3085,7 +3085,7 @@ class or {
|
|
|
3085
3085
|
if (this.showPeerConnectionStatsReport) {
|
|
3086
3086
|
const n = yield (e = this.peerConnection) === null || e === void 0 ? void 0 : e.getStats();
|
|
3087
3087
|
if (n) {
|
|
3088
|
-
const o =
|
|
3088
|
+
const o = jn(n, this.peerConnectionStatsReportOutputFormat);
|
|
3089
3089
|
o && console.log(o, void 0, 2);
|
|
3090
3090
|
}
|
|
3091
3091
|
}
|
|
@@ -3110,7 +3110,7 @@ class or {
|
|
|
3110
3110
|
});
|
|
3111
3111
|
}
|
|
3112
3112
|
}
|
|
3113
|
-
class
|
|
3113
|
+
class ar {
|
|
3114
3114
|
/**
|
|
3115
3115
|
* Converts a WebRtcClientToolEvent to a ClientToolEvent
|
|
3116
3116
|
*/
|
|
@@ -3126,7 +3126,7 @@ class sr {
|
|
|
3126
3126
|
};
|
|
3127
3127
|
}
|
|
3128
3128
|
}
|
|
3129
|
-
class
|
|
3129
|
+
class lr {
|
|
3130
3130
|
constructor(e, n) {
|
|
3131
3131
|
this.reasoning_messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(J.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED, this.processWebRtcReasoningTextMessageEvent.bind(this));
|
|
3132
3132
|
}
|
|
@@ -3140,85 +3140,85 @@ class ar {
|
|
|
3140
3140
|
}
|
|
3141
3141
|
processWebRtcReasoningTextMessageEvent(e) {
|
|
3142
3142
|
const n = this.webRtcTextMessageEventToReasoningStreamEvent(e);
|
|
3143
|
-
this.publicEventEmitter.emit(
|
|
3143
|
+
this.publicEventEmitter.emit(R.REASONING_STREAM_EVENT_RECEIVED, n);
|
|
3144
3144
|
const o = {
|
|
3145
3145
|
id: n.id,
|
|
3146
3146
|
content: n.content,
|
|
3147
3147
|
role: n.role
|
|
3148
|
-
},
|
|
3149
|
-
if (
|
|
3150
|
-
const a = this.reasoning_messages[
|
|
3151
|
-
a.content += o.content, this.reasoning_messages[
|
|
3148
|
+
}, u = this.reasoning_messages.findIndex((a) => a.id === o.id);
|
|
3149
|
+
if (u !== -1) {
|
|
3150
|
+
const a = this.reasoning_messages[u];
|
|
3151
|
+
a.content += o.content, this.reasoning_messages[u] = a;
|
|
3152
3152
|
} else
|
|
3153
3153
|
this.reasoning_messages.push(o);
|
|
3154
|
-
n.endOfThought && this.publicEventEmitter.emit(
|
|
3154
|
+
n.endOfThought && this.publicEventEmitter.emit(R.REASONING_HISTORY_UPDATED, this.reasoning_messages);
|
|
3155
3155
|
}
|
|
3156
3156
|
}
|
|
3157
|
-
var
|
|
3158
|
-
function
|
|
3159
|
-
return a instanceof n ? a : new n(function(
|
|
3160
|
-
|
|
3157
|
+
var ce = function(t, e, n, o) {
|
|
3158
|
+
function u(a) {
|
|
3159
|
+
return a instanceof n ? a : new n(function(c) {
|
|
3160
|
+
c(a);
|
|
3161
3161
|
});
|
|
3162
3162
|
}
|
|
3163
|
-
return new (n || (n = Promise))(function(a,
|
|
3163
|
+
return new (n || (n = Promise))(function(a, c) {
|
|
3164
3164
|
function l(_) {
|
|
3165
3165
|
try {
|
|
3166
3166
|
p(o.next(_));
|
|
3167
3167
|
} catch (d) {
|
|
3168
|
-
|
|
3168
|
+
c(d);
|
|
3169
3169
|
}
|
|
3170
3170
|
}
|
|
3171
|
-
function
|
|
3171
|
+
function E(_) {
|
|
3172
3172
|
try {
|
|
3173
3173
|
p(o.throw(_));
|
|
3174
3174
|
} catch (d) {
|
|
3175
|
-
|
|
3175
|
+
c(d);
|
|
3176
3176
|
}
|
|
3177
3177
|
}
|
|
3178
3178
|
function p(_) {
|
|
3179
|
-
_.done ? a(_.value) :
|
|
3179
|
+
_.done ? a(_.value) : u(_.value).then(l, E);
|
|
3180
3180
|
}
|
|
3181
3181
|
p((o = o.apply(t, e || [])).next());
|
|
3182
3182
|
});
|
|
3183
3183
|
};
|
|
3184
|
-
class
|
|
3184
|
+
class cr {
|
|
3185
3185
|
constructor(e, n, o) {
|
|
3186
|
-
var
|
|
3186
|
+
var u, a, c, l, E;
|
|
3187
3187
|
this.inputAudioState = {
|
|
3188
3188
|
isMuted: !1,
|
|
3189
|
-
permissionState:
|
|
3189
|
+
permissionState: he.NOT_REQUESTED
|
|
3190
3190
|
}, this.sessionId = null, this.organizationId = null, this.streamingClient = null, this._isStreaming = !1;
|
|
3191
3191
|
const p = this.validateClientConfig(e, n, o);
|
|
3192
3192
|
if (p)
|
|
3193
|
-
throw new $(p,
|
|
3194
|
-
this.personaConfig = n, this.clientOptions = o, (!((
|
|
3193
|
+
throw new $(p, j.CLIENT_ERROR_CODE_CONFIGURATION_ERROR, 400);
|
|
3194
|
+
this.personaConfig = n, this.clientOptions = o, (!((u = o?.api) === null || u === void 0) && u.baseUrl || !((a = o?.api) === null || a === void 0) && a.apiVersion) && $n(o.api.baseUrl || zi, o.api.apiVersion || xt), !((l = (c = o?.api) === null || c === void 0 ? void 0 : c.apiGateway) === null || l === void 0) && l.enabled && Vn(o.api.apiGateway), !((E = o?.metrics) === null || E === void 0) && E.disableClientMetrics && Gn(!0), this.publicEventEmitter = new tr(), this.internalEventEmitter = new Qn(), this.apiClient = new Jn(e, o?.apiKey, o?.api), this.messageHistoryClient = new er(this.publicEventEmitter, this.internalEventEmitter), this.reasoningHistoryClient = new lr(this.publicEventEmitter, this.internalEventEmitter);
|
|
3195
3195
|
}
|
|
3196
3196
|
decodeJwt(e) {
|
|
3197
3197
|
try {
|
|
3198
|
-
const n = e.split(".")[1], o =
|
|
3198
|
+
const n = e.split(".")[1], o = Ln.Buffer.from(n, "base64").toString("utf8");
|
|
3199
3199
|
return JSON.parse(o);
|
|
3200
3200
|
} catch {
|
|
3201
3201
|
throw new Error("Invalid session token format");
|
|
3202
3202
|
}
|
|
3203
3203
|
}
|
|
3204
3204
|
validateClientConfig(e, n, o) {
|
|
3205
|
-
var
|
|
3205
|
+
var u, a;
|
|
3206
3206
|
if (!e && !o?.apiKey)
|
|
3207
3207
|
return "Either sessionToken or apiKey must be provided";
|
|
3208
3208
|
if (o?.apiKey && e)
|
|
3209
3209
|
return "Only one of sessionToken or apiKey should be used";
|
|
3210
|
-
const
|
|
3211
|
-
if (
|
|
3212
|
-
return
|
|
3210
|
+
const c = Hn((u = o?.api) === null || u === void 0 ? void 0 : u.apiGateway);
|
|
3211
|
+
if (c)
|
|
3212
|
+
return c;
|
|
3213
3213
|
if (e) {
|
|
3214
3214
|
const l = this.decodeJwt(e);
|
|
3215
3215
|
this.organizationId = l.accountId, Se({
|
|
3216
3216
|
organizationId: this.organizationId
|
|
3217
3217
|
});
|
|
3218
|
-
const
|
|
3219
|
-
if (
|
|
3218
|
+
const E = (a = l.type) === null || a === void 0 ? void 0 : a.toLowerCase();
|
|
3219
|
+
if (E === "legacy")
|
|
3220
3220
|
return "Legacy session tokens are no longer supported. Please define your persona when creating your session token. See https://docs.anam.ai/resources/migrating-legacy for more information.";
|
|
3221
|
-
if ((
|
|
3221
|
+
if ((E === "ephemeral" || E === "stateful") && n)
|
|
3222
3222
|
return "This session token already contains a persona configuration. Please remove the personaConfig parameter.";
|
|
3223
3223
|
} else if (!n)
|
|
3224
3224
|
return "Missing persona config. Persona configuration must be provided when using apiKey";
|
|
@@ -3240,23 +3240,23 @@ class lr {
|
|
|
3240
3240
|
return n;
|
|
3241
3241
|
}
|
|
3242
3242
|
startSession(e) {
|
|
3243
|
-
return
|
|
3244
|
-
var n, o,
|
|
3245
|
-
const
|
|
3243
|
+
return ce(this, void 0, void 0, function* () {
|
|
3244
|
+
var n, o, u, a, c, l, E, p, _, d, S, g;
|
|
3245
|
+
const y = this.personaConfig, C = this.buildStartSessionOptionsForClient(), A = yield this.apiClient.startSession(y, C), { sessionId: I, clientConfig: b, engineHost: N, engineProtocol: D, signallingEndpoint: x } = A, { heartbeatIntervalSeconds: Z, maxWsReconnectionAttempts: V, iceServers: se } = b;
|
|
3246
3246
|
this.sessionId = I, Se({
|
|
3247
3247
|
sessionId: this.sessionId
|
|
3248
3248
|
});
|
|
3249
|
-
const ne = !((n = this.clientOptions) === null || n === void 0) && n.iceServers ? this.clientOptions.iceServers :
|
|
3249
|
+
const ne = !((n = this.clientOptions) === null || n === void 0) && n.iceServers ? this.clientOptions.iceServers : se;
|
|
3250
3250
|
try {
|
|
3251
|
-
this.streamingClient = new
|
|
3251
|
+
this.streamingClient = new sr(I, {
|
|
3252
3252
|
engine: {
|
|
3253
|
-
baseUrl: `${D}://${
|
|
3253
|
+
baseUrl: `${D}://${N}`
|
|
3254
3254
|
},
|
|
3255
3255
|
signalling: {
|
|
3256
3256
|
heartbeatIntervalSeconds: Z,
|
|
3257
|
-
maxWsReconnectionAttempts:
|
|
3257
|
+
maxWsReconnectionAttempts: V,
|
|
3258
3258
|
url: {
|
|
3259
|
-
baseUrl:
|
|
3259
|
+
baseUrl: N,
|
|
3260
3260
|
protocol: D,
|
|
3261
3261
|
signallingPath: x
|
|
3262
3262
|
}
|
|
@@ -3265,19 +3265,19 @@ class lr {
|
|
|
3265
3265
|
inputAudio: {
|
|
3266
3266
|
inputAudioState: this.inputAudioState,
|
|
3267
3267
|
userProvidedMediaStream: !((o = this.clientOptions) === null || o === void 0) && o.disableInputAudio ? void 0 : e,
|
|
3268
|
-
audioDeviceId: (
|
|
3268
|
+
audioDeviceId: (u = this.clientOptions) === null || u === void 0 ? void 0 : u.audioDeviceId,
|
|
3269
3269
|
disableInputAudio: (a = this.clientOptions) === null || a === void 0 ? void 0 : a.disableInputAudio
|
|
3270
3270
|
},
|
|
3271
|
-
apiGateway: (l = (
|
|
3271
|
+
apiGateway: (l = (c = this.clientOptions) === null || c === void 0 ? void 0 : c.api) === null || l === void 0 ? void 0 : l.apiGateway,
|
|
3272
3272
|
metrics: {
|
|
3273
|
-
showPeerConnectionStatsReport: (_ = (p = (
|
|
3274
|
-
peerConnectionStatsReportOutputFormat: (g = (
|
|
3273
|
+
showPeerConnectionStatsReport: (_ = (p = (E = this.clientOptions) === null || E === void 0 ? void 0 : E.metrics) === null || p === void 0 ? void 0 : p.showPeerConnectionStatsReport) !== null && _ !== void 0 ? _ : !1,
|
|
3274
|
+
peerConnectionStatsReportOutputFormat: (g = (S = (d = this.clientOptions) === null || d === void 0 ? void 0 : d.metrics) === null || S === void 0 ? void 0 : S.peerConnectionStatsReportOutputFormat) !== null && g !== void 0 ? g : "console"
|
|
3275
3275
|
}
|
|
3276
3276
|
}, this.publicEventEmitter, this.internalEventEmitter);
|
|
3277
3277
|
} catch (re) {
|
|
3278
3278
|
throw Se({
|
|
3279
3279
|
sessionId: null
|
|
3280
|
-
}), new $("Failed to initialize streaming client",
|
|
3280
|
+
}), new $("Failed to initialize streaming client", j.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
|
|
3281
3281
|
cause: re instanceof Error ? re.message : String(re),
|
|
3282
3282
|
sessionId: I
|
|
3283
3283
|
});
|
|
@@ -3286,31 +3286,31 @@ class lr {
|
|
|
3286
3286
|
});
|
|
3287
3287
|
}
|
|
3288
3288
|
startSessionIfNeeded(e) {
|
|
3289
|
-
return
|
|
3289
|
+
return ce(this, void 0, void 0, function* () {
|
|
3290
3290
|
if ((!this.sessionId || !this.streamingClient) && (yield this.startSession(e), !this.sessionId || !this.streamingClient))
|
|
3291
|
-
throw new $("Session ID or streaming client is not available after starting session",
|
|
3291
|
+
throw new $("Session ID or streaming client is not available after starting session", j.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
|
|
3292
3292
|
cause: "Failed to initialize session properly"
|
|
3293
3293
|
});
|
|
3294
3294
|
});
|
|
3295
3295
|
}
|
|
3296
3296
|
stream(e) {
|
|
3297
|
-
return
|
|
3297
|
+
return ce(this, void 0, void 0, function* () {
|
|
3298
3298
|
var n;
|
|
3299
3299
|
if (this._isStreaming)
|
|
3300
3300
|
throw new Error("Already streaming");
|
|
3301
|
-
const o =
|
|
3301
|
+
const o = ci();
|
|
3302
3302
|
return Se({
|
|
3303
3303
|
attemptCorrelationId: o,
|
|
3304
3304
|
sessionId: null
|
|
3305
3305
|
// reset sessionId
|
|
3306
|
-
}), me(
|
|
3306
|
+
}), me(oe.CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT, "1"), !((n = this.clientOptions) === null || n === void 0) && n.disableInputAudio && e && console.warn("AnamClient:Input audio is disabled. User provided audio stream will be ignored."), yield this.startSessionIfNeeded(e), this._isStreaming = !0, new Promise((u) => {
|
|
3307
3307
|
var a;
|
|
3308
|
-
const
|
|
3309
|
-
let l = !1,
|
|
3310
|
-
this.publicEventEmitter.addListener(
|
|
3311
|
-
|
|
3312
|
-
}), this.publicEventEmitter.addListener(
|
|
3313
|
-
|
|
3308
|
+
const c = [];
|
|
3309
|
+
let l = !1, E = !1;
|
|
3310
|
+
this.publicEventEmitter.addListener(R.VIDEO_STREAM_STARTED, (p) => {
|
|
3311
|
+
c.push(p), l = !0, E && u(c);
|
|
3312
|
+
}), this.publicEventEmitter.addListener(R.AUDIO_STREAM_STARTED, (p) => {
|
|
3313
|
+
c.push(p), E = !0, l && u(c);
|
|
3314
3314
|
}), (a = this.streamingClient) === null || a === void 0 || a.startConnection();
|
|
3315
3315
|
});
|
|
3316
3316
|
});
|
|
@@ -3319,23 +3319,23 @@ class lr {
|
|
|
3319
3319
|
* @deprecated This method is deprecated. Please use streamToVideoElement instead.
|
|
3320
3320
|
*/
|
|
3321
3321
|
streamToVideoAndAudioElements(e, n, o) {
|
|
3322
|
-
return
|
|
3322
|
+
return ce(this, void 0, void 0, function* () {
|
|
3323
3323
|
console.warn("AnamClient: streamToVideoAndAudioElements is deprecated. To avoid possible audio issues, please use streamToVideoElement instead."), yield this.streamToVideoElement(e, o);
|
|
3324
3324
|
});
|
|
3325
3325
|
}
|
|
3326
3326
|
streamToVideoElement(e, n) {
|
|
3327
|
-
return
|
|
3327
|
+
return ce(this, void 0, void 0, function* () {
|
|
3328
3328
|
var o;
|
|
3329
|
-
const
|
|
3329
|
+
const u = ci();
|
|
3330
3330
|
Se({
|
|
3331
|
-
attemptCorrelationId:
|
|
3331
|
+
attemptCorrelationId: u,
|
|
3332
3332
|
sessionId: null
|
|
3333
3333
|
// reset sessionId
|
|
3334
|
-
}), me(
|
|
3334
|
+
}), me(oe.CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT, "1"), !((o = this.clientOptions) === null || o === void 0) && o.disableInputAudio && n && console.warn("AnamClient:Input audio is disabled. User provided audio stream will be ignored.");
|
|
3335
3335
|
try {
|
|
3336
3336
|
yield this.startSessionIfNeeded(n);
|
|
3337
3337
|
} catch (a) {
|
|
3338
|
-
throw a instanceof $ ? a : new $("Failed to start session",
|
|
3338
|
+
throw a instanceof $ ? a : new $("Failed to start session", j.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
|
|
3339
3339
|
cause: a instanceof Error ? a.message : String(a),
|
|
3340
3340
|
sessionId: this.sessionId
|
|
3341
3341
|
});
|
|
@@ -3353,7 +3353,7 @@ class lr {
|
|
|
3353
3353
|
* @throws Error if session is not started or not currently streaming
|
|
3354
3354
|
*/
|
|
3355
3355
|
talk(e) {
|
|
3356
|
-
return
|
|
3356
|
+
return ce(this, void 0, void 0, function* () {
|
|
3357
3357
|
if (!this.streamingClient)
|
|
3358
3358
|
throw new Error("Failed to send talk command: session is not started. Have you called startSession?");
|
|
3359
3359
|
if (!this._isStreaming)
|
|
@@ -3383,13 +3383,13 @@ class lr {
|
|
|
3383
3383
|
const n = this.getActiveSessionId();
|
|
3384
3384
|
if (!n)
|
|
3385
3385
|
throw new Error("Failed to send user message: no active session");
|
|
3386
|
-
const o = (/* @__PURE__ */ new Date()).toISOString().replace("Z", ""),
|
|
3386
|
+
const o = (/* @__PURE__ */ new Date()).toISOString().replace("Z", ""), u = JSON.stringify({
|
|
3387
3387
|
content: e,
|
|
3388
3388
|
timestamp: o,
|
|
3389
3389
|
session_id: n,
|
|
3390
3390
|
message_type: "speech"
|
|
3391
3391
|
});
|
|
3392
|
-
this.sendDataMessage(
|
|
3392
|
+
this.sendDataMessage(u);
|
|
3393
3393
|
}
|
|
3394
3394
|
interruptPersona() {
|
|
3395
3395
|
if (!this._isStreaming)
|
|
@@ -3406,8 +3406,8 @@ class lr {
|
|
|
3406
3406
|
this.sendDataMessage(n);
|
|
3407
3407
|
}
|
|
3408
3408
|
stopStreaming() {
|
|
3409
|
-
return
|
|
3410
|
-
this.streamingClient && (this.publicEventEmitter.emit(
|
|
3409
|
+
return ce(this, void 0, void 0, function* () {
|
|
3410
|
+
this.streamingClient && (this.publicEventEmitter.emit(R.CONNECTION_CLOSED, pe.NORMAL), yield this.streamingClient.stopConnection(), this.streamingClient = null, this.sessionId = null, Se({
|
|
3411
3411
|
attemptCorrelationId: null,
|
|
3412
3412
|
sessionId: null,
|
|
3413
3413
|
organizationId: this.organizationId
|
|
@@ -3436,7 +3436,7 @@ class lr {
|
|
|
3436
3436
|
return !((e = this.clientOptions) === null || e === void 0) && e.disableInputAudio && console.warn("AnamClient: Input audio is disabled. Unmuting input audio will have no effect."), this.streamingClient && !(!((n = this.clientOptions) === null || n === void 0) && n.disableInputAudio) ? this.inputAudioState = this.streamingClient.unmuteInputAudio() : this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { isMuted: !1 }), this.inputAudioState;
|
|
3437
3437
|
}
|
|
3438
3438
|
changeAudioInputDevice(e) {
|
|
3439
|
-
return
|
|
3439
|
+
return ce(this, void 0, void 0, function* () {
|
|
3440
3440
|
var n;
|
|
3441
3441
|
if (!((n = this.clientOptions) === null || n === void 0) && n.disableInputAudio)
|
|
3442
3442
|
throw new Error("AnamClient: Cannot change audio input device because input audio is disabled.");
|
|
@@ -3472,8 +3472,8 @@ class lr {
|
|
|
3472
3472
|
return this.sessionId;
|
|
3473
3473
|
}
|
|
3474
3474
|
}
|
|
3475
|
-
const
|
|
3476
|
-
function
|
|
3475
|
+
const ur = (t, e) => new cr(t, void 0, e), dr = "https://api.anam.ai";
|
|
3476
|
+
function hr(t) {
|
|
3477
3477
|
try {
|
|
3478
3478
|
const e = t.split(".")[1];
|
|
3479
3479
|
return JSON.parse(atob(e));
|
|
@@ -3481,159 +3481,157 @@ function dr(t) {
|
|
|
3481
3481
|
return {};
|
|
3482
3482
|
}
|
|
3483
3483
|
}
|
|
3484
|
-
const X =
|
|
3485
|
-
function
|
|
3484
|
+
const X = q(null), te = q("idle"), Be = q(!1), Ye = q(!1), ot = q([]), Pe = q(null), et = q(null), Ot = q(null), kt = q(null), Dt = q(null), Mt = q(null), di = q(!1), tt = q(!1);
|
|
3485
|
+
function fr(t, e) {
|
|
3486
3486
|
return e === 401 || e === 403 ? "This agent is not authorized. Check your agent ID." : e === 404 ? "Agent not found. Check your agent ID." : e === 429 ? "Too many requests. Please wait a moment." : e && e >= 500 ? "Server error. Please try again later." : t instanceof TypeError && t.message === "Failed to fetch" ? "Unable to connect. Check your network connection." : t instanceof Error && t.message.length < 80 ? t.message : "Something went wrong. Please try again.";
|
|
3487
3487
|
}
|
|
3488
|
-
async function
|
|
3489
|
-
|
|
3488
|
+
async function pr(t, e) {
|
|
3489
|
+
tt.value = !1;
|
|
3490
3490
|
try {
|
|
3491
3491
|
const n = await fetch(`${e}/v1/personas/${t}/widget`);
|
|
3492
3492
|
if (!n.ok) return;
|
|
3493
3493
|
const o = await n.json();
|
|
3494
|
-
Ot.value = o.persona?.avatarImageUrl || null, kt.value = o.persona?.
|
|
3494
|
+
Ot.value = o.persona?.avatarImageUrl || null, kt.value = o.persona?.avatarVideoUrl || null, Dt.value = o.persona?.name || null, Mt.value = o.widgetConfig || null;
|
|
3495
3495
|
} catch {
|
|
3496
3496
|
} finally {
|
|
3497
|
-
|
|
3497
|
+
tt.value = !0;
|
|
3498
3498
|
}
|
|
3499
3499
|
}
|
|
3500
|
-
async function
|
|
3500
|
+
async function _r(t, e, n, o) {
|
|
3501
3501
|
if (te.value === "connecting" || te.value === "connected")
|
|
3502
3502
|
return;
|
|
3503
3503
|
te.value = "connecting", Pe.value = null;
|
|
3504
|
-
let
|
|
3504
|
+
let u;
|
|
3505
3505
|
try {
|
|
3506
3506
|
let a;
|
|
3507
3507
|
if (o)
|
|
3508
3508
|
console.log("[AnamWidget] Using pre-created session token"), a = o;
|
|
3509
3509
|
else {
|
|
3510
3510
|
console.log("[AnamWidget] Fetching session for agent:", t);
|
|
3511
|
-
const
|
|
3511
|
+
const E = await fetch(`${e}/v1/auth/widget`, {
|
|
3512
3512
|
method: "POST",
|
|
3513
3513
|
headers: { "Content-Type": "application/json" },
|
|
3514
3514
|
body: JSON.stringify({ agentId: t })
|
|
3515
3515
|
});
|
|
3516
|
-
if (
|
|
3517
|
-
const _ = await
|
|
3518
|
-
throw new Error(_.error || `HTTP ${
|
|
3516
|
+
if (u = E.status, !E.ok) {
|
|
3517
|
+
const _ = await E.json().catch(() => ({}));
|
|
3518
|
+
throw new Error(_.error || `HTTP ${E.status}`);
|
|
3519
3519
|
}
|
|
3520
|
-
const p = await
|
|
3520
|
+
const p = await E.json();
|
|
3521
3521
|
console.log("[AnamWidget] Got session from agent-id:", {
|
|
3522
3522
|
hasToken: !!p.sessionToken
|
|
3523
3523
|
}), a = p.sessionToken;
|
|
3524
3524
|
}
|
|
3525
|
-
const
|
|
3525
|
+
const c = ur(a, {
|
|
3526
3526
|
api: e ? { baseUrl: e } : void 0,
|
|
3527
3527
|
metrics: { disableClientMetrics: !0 }
|
|
3528
3528
|
});
|
|
3529
|
-
|
|
3529
|
+
c.addListener(R.CONNECTION_ESTABLISHED, () => {
|
|
3530
3530
|
console.log("[AnamWidget] Connection established"), te.value = "connected";
|
|
3531
|
-
}),
|
|
3532
|
-
console.log("[AnamWidget] Video stream started"),
|
|
3533
|
-
}),
|
|
3531
|
+
}), c.addListener(R.VIDEO_STREAM_STARTED, () => {
|
|
3532
|
+
console.log("[AnamWidget] Video stream started"), Be.value = !0;
|
|
3533
|
+
}), c.addListener(R.AUDIO_STREAM_STARTED, () => {
|
|
3534
3534
|
console.log("[AnamWidget] Audio stream started");
|
|
3535
|
-
}),
|
|
3536
|
-
|
|
3537
|
-
}),
|
|
3538
|
-
console.log("[AnamWidget] Connection closed:",
|
|
3539
|
-
}),
|
|
3540
|
-
console.log("[AnamWidget] Session ready:",
|
|
3541
|
-
}), X.value =
|
|
3542
|
-
const l = await
|
|
3535
|
+
}), c.addListener(R.MESSAGE_HISTORY_UPDATED, (E) => {
|
|
3536
|
+
ot.value = [...E];
|
|
3537
|
+
}), c.addListener(R.CONNECTION_CLOSED, (E, p) => {
|
|
3538
|
+
console.log("[AnamWidget] Connection closed:", E, p), te.value = "idle", Be.value = !1, et.value = null;
|
|
3539
|
+
}), c.addListener(R.SESSION_READY, (E) => {
|
|
3540
|
+
console.log("[AnamWidget] Session ready:", E), et.value = E;
|
|
3541
|
+
}), X.value = c;
|
|
3542
|
+
const l = await c.stream();
|
|
3543
3543
|
if (n && l.length > 0) {
|
|
3544
|
-
const
|
|
3545
|
-
|
|
3544
|
+
const E = l.find((p) => p.getVideoTracks().length > 0);
|
|
3545
|
+
E && (n.srcObject = E);
|
|
3546
3546
|
}
|
|
3547
3547
|
} catch (a) {
|
|
3548
|
-
console.error("[AnamWidget] Failed to start session:", a), Pe.value =
|
|
3548
|
+
console.error("[AnamWidget] Failed to start session:", a), Pe.value = fr(a, u), te.value = "error", X.value = null;
|
|
3549
3549
|
}
|
|
3550
3550
|
}
|
|
3551
|
-
async function
|
|
3551
|
+
async function Er() {
|
|
3552
3552
|
if (X.value)
|
|
3553
3553
|
try {
|
|
3554
3554
|
await X.value.stopStreaming();
|
|
3555
3555
|
} catch (t) {
|
|
3556
3556
|
console.error("[AnamWidget] Failed to stop session:", t);
|
|
3557
3557
|
}
|
|
3558
|
-
X.value = null, te.value = "idle",
|
|
3558
|
+
X.value = null, te.value = "idle", Be.value = !1, ot.value = [];
|
|
3559
3559
|
}
|
|
3560
|
-
function
|
|
3560
|
+
function mr(t) {
|
|
3561
3561
|
!X.value || te.value !== "connected" || X.value.sendUserMessage(t);
|
|
3562
3562
|
}
|
|
3563
|
-
function mr() {
|
|
3564
|
-
X.value && (Ke.value ? (X.value.unmuteInputAudio(), Ke.value = !1) : (X.value.muteInputAudio(), Ke.value = !0));
|
|
3565
|
-
}
|
|
3566
3563
|
function gr() {
|
|
3567
|
-
X.value
|
|
3564
|
+
X.value && (Ye.value ? (X.value.unmuteInputAudio(), Ye.value = !1) : (X.value.muteInputAudio(), Ye.value = !0));
|
|
3565
|
+
}
|
|
3566
|
+
function vr() {
|
|
3567
|
+
X.value?.isStreaming() && X.value.stopStreaming(), X.value = null, te.value = "idle", Be.value = !1, ot.value = [], Pe.value = null, et.value = null, Ot.value = null, kt.value = null, Dt.value = null, Mt.value = null;
|
|
3568
3568
|
}
|
|
3569
|
-
function
|
|
3570
|
-
const o = t || (n ?
|
|
3571
|
-
|
|
3572
|
-
const
|
|
3569
|
+
function yr(t, e, n) {
|
|
3570
|
+
const o = t || (n ? hr(n).personaId : void 0);
|
|
3571
|
+
di.value = !!o || !!n;
|
|
3572
|
+
const u = e || dr;
|
|
3573
3573
|
return {
|
|
3574
3574
|
connectionStatus: te,
|
|
3575
|
-
isStreaming:
|
|
3576
|
-
isMuted:
|
|
3577
|
-
messages:
|
|
3575
|
+
isStreaming: Be,
|
|
3576
|
+
isMuted: Ye,
|
|
3577
|
+
messages: ot,
|
|
3578
3578
|
error: Pe,
|
|
3579
|
-
sessionId:
|
|
3580
|
-
isConfigured:
|
|
3581
|
-
isReady:
|
|
3579
|
+
sessionId: et,
|
|
3580
|
+
isConfigured: di,
|
|
3581
|
+
isReady: tt,
|
|
3582
3582
|
avatarThumbnailUrl: Ot,
|
|
3583
|
-
|
|
3584
|
-
|
|
3583
|
+
avatarVideoUrl: kt,
|
|
3584
|
+
personaName: Dt,
|
|
3585
|
+
serverConfig: Mt,
|
|
3585
3586
|
fetchWidgetConfig: () => {
|
|
3586
3587
|
if (!o) {
|
|
3587
|
-
|
|
3588
|
+
tt.value = !0;
|
|
3588
3589
|
return;
|
|
3589
3590
|
}
|
|
3590
|
-
|
|
3591
|
+
pr(o, u);
|
|
3591
3592
|
},
|
|
3592
|
-
startSession: (l) => !o && !n ? (Pe.value = "No agent ID or session token configured", Promise.resolve()) :
|
|
3593
|
-
stopSession:
|
|
3594
|
-
sendMessage:
|
|
3595
|
-
toggleMute:
|
|
3596
|
-
cleanup:
|
|
3593
|
+
startSession: (l) => !o && !n ? (Pe.value = "No agent ID or session token configured", Promise.resolve()) : _r(o || "", u, l, n),
|
|
3594
|
+
stopSession: Er,
|
|
3595
|
+
sendMessage: mr,
|
|
3596
|
+
toggleMute: gr,
|
|
3597
|
+
cleanup: vr
|
|
3597
3598
|
};
|
|
3598
3599
|
}
|
|
3599
|
-
const di = '@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.block{display:block}.flex{display:flex}.inline{display:inline}.flex-shrink{flex-shrink:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.border{border-style:var(--tw-border-style);border-width:1px}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}}:host{--anam-trigger-size:80px;--anam-sheet-width:400px;--anam-sheet-height:640px;all:initial;color:#18181b;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:DM Sans,system-ui,-apple-system,sans-serif;font-size:15px;line-height:1.5}@media(max-width:640px){:host{--anam-trigger-size:72px;--anam-sheet-width: calc(100vw - 24px) ;--anam-sheet-height: calc(100dvh - 100px) }}.anam-widget{z-index:9999;font-family:inherit}.anam-widget[data-inline=false]{position:fixed}.anam-widget[data-inline=true]{position:relative}.anam-trigger{width:var(--anam-trigger-size);height:var(--anam-trigger-size);cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:all .25s cubic-bezier(.4,0,.2,1);display:flex;overflow:hidden;box-shadow:0 2px 8px #00000014,0 8px 24px -4px #0000002e}.anam-trigger:hover{transform:scale(1.06);box-shadow:0 4px 12px #0000001a,0 12px 32px -4px #00000040}.anam-trigger:active{transform:scale(.97)}.anam-trigger img{object-fit:cover;width:100%;height:100%;display:block}.anam-sheet{width:var(--anam-sheet-width);aspect-ratio:16/10;max-height:var(--anam-sheet-height);border-radius:8px;animation:.25s cubic-bezier(.16,1,.3,1) sheetIn;position:relative;overflow:hidden;box-shadow:0 32px 64px -16px #00000040,0 0 0 1px #00000014}.anam-widget[data-inline=true][data-layout=expanded] .anam-sheet{aspect-ratio:3/2;border-radius:8px;width:100%;max-height:none;animation:none}@keyframes sheetIn{0%{opacity:0;transform:translateY(8px)scale(.97)}to{opacity:1;transform:translateY(0)scale(1)}}.anam-video{object-fit:cover;background:#000;width:100%;height:100%;display:block;position:absolute;inset:0}.anam-video[data-hidden=true]{visibility:hidden}.anam-overlay-idle{z-index:2;position:absolute;inset:0}.anam-overlay-idle img{object-fit:cover;width:100%;height:100%;display:block}.anam-cta-pill{-webkit-backdrop-filter:blur(16px);color:#fff;letter-spacing:-.01em;cursor:pointer;white-space:nowrap;background:#00000080;border:1px solid #ffffff1a;border-radius:999px;align-items:center;gap:10px;padding:12px 28px;font-family:inherit;font-size:15px;font-weight:500;transition:all .2s;display:flex;position:absolute;bottom:40px;left:50%;transform:translate(-50%)}.anam-cta-pill:hover{background:#000000a6;transform:translate(-50%)scale(1.03)}.anam-cta-pill:active{transform:translate(-50%)scale(.98)}.anam-cta-pill svg{flex-shrink:0}.anam-overlay-unconfigured{z-index:2;background:#111;flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex;position:absolute;inset:0}.anam-overlay-unconfigured span{color:#ffffff59;letter-spacing:-.01em;font-size:14px;font-weight:400}.anam-overlay-loading{z-index:3;background:#000;flex-direction:column;justify-content:center;align-items:center;gap:20px;display:flex;position:absolute;inset:0}.anam-overlay-loading span{color:#fffc;letter-spacing:-.01em;font-size:15px;font-weight:400}.anam-overlay-error{z-index:3;background:#000;flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex;position:absolute;inset:0}.anam-overlay-error-text{color:#fff9;text-align:center;max-width:260px;font-size:14px;line-height:1.5}.anam-overlay-error .anam-retry-btn{-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#ffffff1f;border:1px solid #ffffff1a;border-radius:999px;padding:10px 24px;font-family:inherit;font-size:14px;font-weight:500;transition:background .15s}.anam-overlay-error .anam-retry-btn:hover{background:#fff3}.anam-spinner{border:2.5px solid #ffffff1f;border-top-color:#fff;border-radius:50%;width:32px;height:32px;animation:.75s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.anam-close-btn{z-index:10;-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#00000073;border:1px solid #ffffff14;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;padding:0;transition:background .15s;display:flex;position:absolute;top:12px;right:12px}.anam-close-btn:hover{background:#0009}.anam-toast{z-index:10;-webkit-backdrop-filter:blur(16px);color:#fff;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;background:#0009;border:1px solid #ffffff0f;border-radius:999px;max-width:85%;padding:10px 22px;font-size:14px;font-weight:400;animation:.25s cubic-bezier(.16,1,.3,1) toastIn;position:absolute;bottom:80px;left:50%;overflow:hidden;transform:translate(-50%)}.anam-toast-out{animation:.4s forwards toastOut}@keyframes toastIn{0%{opacity:0;transform:translate(-50%)translateY(6px)}to{opacity:1;transform:translate(-50%)translateY(0)}}@keyframes toastOut{0%{opacity:1}to{opacity:0}}.anam-control-bar{z-index:10;background:linear-gradient(#0000,#00000040 40%,#0000008c);align-items:center;gap:8px;padding:48px 16px 16px;display:flex;position:absolute;bottom:0;left:0;right:0}.anam-ctl-btn{-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff0f;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:44px;height:44px;padding:0;transition:background .15s;display:flex}.anam-ctl-btn:hover{background:#ffffff38}.anam-ctl-btn:disabled{opacity:.35;cursor:not-allowed}.anam-ctl-btn-muted{background:#dc26268c;border-color:#dc262633}.anam-ctl-btn-muted:hover{background:#dc2626b3}.anam-ctl-end{background:#dc262699;border-color:#dc262626}.anam-ctl-end:hover{background:#dc2626cc}.anam-ctl-input{-webkit-backdrop-filter:blur(8px);color:#fff;background:#ffffff1a;border:1px solid #ffffff14;border-radius:999px;outline:none;flex:1;min-width:0;padding:11px 18px;font-family:inherit;font-size:14px;transition:background .15s,border-color .15s}.anam-ctl-input::placeholder{color:#fff6}.anam-ctl-input:focus{background:#ffffff26;border-color:#ffffff2e}.anam-ctl-input:disabled{opacity:.35;cursor:not-allowed}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}';
|
|
3600
|
+
const hi = '@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.block{display:block}.flex{display:flex}.inline{display:inline}.flex-shrink{flex-shrink:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.border{border-style:var(--tw-border-style);border-width:1px}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}}:host{--anam-trigger-size:80px;--anam-sheet-width:400px;--anam-sheet-height:640px;all:initial;color:#18181b;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:DM Sans,system-ui,-apple-system,sans-serif;font-size:15px;line-height:1.5}@media(max-width:640px){:host{--anam-trigger-size:72px;--anam-sheet-width: calc(100vw - 24px) ;--anam-sheet-height: calc(100dvh - 100px) }}.anam-widget{z-index:9999;font-family:inherit}.anam-widget[data-layout=floating]{position:fixed}.anam-widget[data-layout=inline]{position:relative}.anam-trigger{width:var(--anam-trigger-size);height:var(--anam-trigger-size);cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:all .25s cubic-bezier(.4,0,.2,1);display:flex;overflow:hidden;box-shadow:0 2px 8px #00000014,0 8px 24px -4px #0000002e}.anam-trigger:hover{transform:scale(1.06);box-shadow:0 4px 12px #0000001a,0 12px 32px -4px #00000040}.anam-trigger:active{transform:scale(.97)}.anam-trigger img{object-fit:cover;width:100%;height:100%;display:block}.anam-sheet{width:var(--anam-sheet-width);aspect-ratio:16/10;max-height:var(--anam-sheet-height);border-radius:8px;animation:.25s cubic-bezier(.16,1,.3,1) sheetIn;position:relative;overflow:hidden;box-shadow:0 32px 64px -16px #00000040,0 0 0 1px #00000014}.anam-widget[data-layout=inline] .anam-sheet{aspect-ratio:3/2;border-radius:8px;width:100%;max-height:none;animation:none}@keyframes sheetIn{0%{opacity:0;transform:translateY(8px)scale(.97)}to{opacity:1;transform:translateY(0)scale(1)}}.anam-video{object-fit:cover;background:#000;width:100%;height:100%;display:block;position:absolute;inset:0}.anam-video[data-hidden=true]{visibility:hidden}.anam-overlay-idle{z-index:2;position:absolute;inset:0}.anam-overlay-idle img{object-fit:cover;width:100%;height:100%;display:block}.anam-preview-video{object-fit:cover;z-index:1;width:100%;height:100%;display:block;position:absolute;inset:0}.anam-preview-fallback{z-index:0;position:absolute;inset:0}.anam-cta-pill{z-index:2;-webkit-backdrop-filter:blur(8px);color:#fff;letter-spacing:-.01em;cursor:pointer;white-space:nowrap;background:#ffffff24;border:1px solid #ffffff38;border-radius:999px;align-items:center;gap:12px;min-width:200px;padding:12px 26px;font-family:inherit;font-size:16px;font-weight:600;transition:all .2s;display:flex;position:absolute;bottom:20px;left:50%;transform:translate(-50%)}.anam-cta-pill:hover{background:#ffffff38;transform:translate(-50%)scale(1.03)}.anam-cta-pill:active{transform:translate(-50%)scale(.98)}.anam-cta-pill svg{flex-shrink:0}.anam-overlay-unconfigured{z-index:2;background:#111;flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex;position:absolute;inset:0}.anam-overlay-unconfigured span{color:#ffffff59;letter-spacing:-.01em;font-size:14px;font-weight:400}.anam-overlay-loading{z-index:3;background:#000;flex-direction:column;justify-content:center;align-items:center;gap:20px;display:flex;position:absolute;inset:0}.anam-overlay-loading span{color:#fffc;letter-spacing:-.01em;font-size:15px;font-weight:400}.anam-overlay-error{z-index:3;background:#000;flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex;position:absolute;inset:0}.anam-overlay-error-text{color:#fff9;text-align:center;max-width:260px;font-size:14px;line-height:1.5}.anam-overlay-error .anam-retry-btn{-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#ffffff1f;border:1px solid #ffffff1a;border-radius:999px;padding:10px 24px;font-family:inherit;font-size:14px;font-weight:500;transition:background .15s}.anam-overlay-error .anam-retry-btn:hover{background:#fff3}.anam-spinner{border:2.5px solid #ffffff1f;border-top-color:#fff;border-radius:50%;width:32px;height:32px;animation:.75s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.anam-close-btn{z-index:10;-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#00000073;border:1px solid #ffffff38;border-radius:50%;justify-content:center;align-items:center;width:44px;height:44px;padding:0;transition:background .15s;display:flex;position:absolute;top:12px;right:12px}.anam-close-btn:hover{background:#0009}.anam-toast{z-index:10;-webkit-backdrop-filter:blur(16px);color:#fff;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;background:#0009;border:1px solid #ffffff0f;border-radius:999px;max-width:85%;padding:10px 22px;font-size:14px;font-weight:400;animation:.25s cubic-bezier(.16,1,.3,1) toastIn;position:absolute;bottom:80px;left:50%;overflow:hidden;transform:translate(-50%)}.anam-toast-out{animation:.4s forwards toastOut}@keyframes toastIn{0%{opacity:0;transform:translate(-50%)translateY(6px)}to{opacity:1;transform:translate(-50%)translateY(0)}}@keyframes toastOut{0%{opacity:1}to{opacity:0}}.anam-control-bar{z-index:10;background:linear-gradient(#0000,#00000040 40%,#0000008c);justify-content:center;align-items:center;gap:8px;padding:48px 16px 16px;display:flex;position:absolute;bottom:0;left:0;right:0}.anam-ctl-btn{-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff38;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:44px;height:44px;padding:0;transition:background .15s;display:flex}.anam-ctl-btn:hover{background:#ffffff38}.anam-ctl-btn:disabled{opacity:.35;cursor:not-allowed}.anam-ctl-input-wrap{flex:1;align-items:center;min-width:0;margin-right:56px;display:flex;position:relative}.anam-ctl-input{-webkit-backdrop-filter:blur(8px);color:#fff;background:#ffffff1a;border:1px solid #ffffff38;border-radius:999px;outline:none;width:100%;padding:11px 44px 11px 18px;font-family:inherit;font-size:14px;transition:background .15s,border-color .15s}.anam-ctl-input::placeholder{color:#fff6}.anam-ctl-input:focus{background:#ffffff26;border-color:#ffffff2e}.anam-ctl-input:disabled{opacity:.35;cursor:not-allowed}.anam-ctl-send{color:#ffffff80;cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;padding:0;transition:color .15s;display:flex;position:absolute;right:6px}.anam-ctl-send:hover{color:#fff}.anam-ctl-send:disabled{opacity:.35;cursor:not-allowed}.anam-watermark{z-index:11;opacity:.5;line-height:0;text-decoration:none;transition:opacity .15s;position:absolute;top:16px;left:16px}.anam-watermark:hover{opacity:.8}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}';
|
|
3600
3601
|
function wt(t, e) {
|
|
3601
3602
|
const n = { ...t };
|
|
3602
3603
|
for (const o of Object.keys(e)) {
|
|
3603
|
-
const
|
|
3604
|
-
|
|
3604
|
+
const u = e[o];
|
|
3605
|
+
u !== void 0 && (u !== null && typeof u == "object" && !Array.isArray(u) && typeof n[o] == "object" && n[o] !== null && !Array.isArray(n[o]) ? n[o] = wt(n[o], u) : n[o] = u);
|
|
3605
3606
|
}
|
|
3606
3607
|
return n;
|
|
3607
3608
|
}
|
|
3608
|
-
function
|
|
3609
|
+
function ft(t) {
|
|
3609
3610
|
if (t !== void 0)
|
|
3610
3611
|
return t === "true";
|
|
3611
3612
|
}
|
|
3612
|
-
function
|
|
3613
|
-
const e = {}
|
|
3614
|
-
|
|
3615
|
-
const
|
|
3616
|
-
|
|
3617
|
-
const
|
|
3618
|
-
|
|
3619
|
-
const
|
|
3620
|
-
return
|
|
3621
|
-
}
|
|
3622
|
-
const
|
|
3613
|
+
function Sr(t) {
|
|
3614
|
+
const e = {};
|
|
3615
|
+
t.layout && (e.layout = t.layout), t["initial-state"] && (e.initialState = t["initial-state"]), t.position && (e.position = t.position);
|
|
3616
|
+
const n = ft(t["ui-mute-button"]);
|
|
3617
|
+
n !== void 0 && (e.showMuteButton = n);
|
|
3618
|
+
const o = ft(t["ui-text-input"]);
|
|
3619
|
+
o !== void 0 && (e.showTextInput = o);
|
|
3620
|
+
const u = ft(t["ui-captions"]);
|
|
3621
|
+
return u !== void 0 && (e.showCaptions = u), t["call-to-action"] && (e.callToAction = t["call-to-action"]), e;
|
|
3622
|
+
}
|
|
3623
|
+
const wr = () => /* @__PURE__ */ w("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2.5", "stroke-linecap": "round", children: /* @__PURE__ */ w("path", { d: "M18 6L6 18M6 6l12 12" }) }), Cr = () => /* @__PURE__ */ w("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ w("path", { d: "M8 5.14v13.72a1 1 0 0 0 1.5.86l11.04-6.86a1 1 0 0 0 0-1.72L9.5 4.28A1 1 0 0 0 8 5.14Z" }) }), Ir = () => /* @__PURE__ */ w("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
3623
3624
|
/* @__PURE__ */ w("path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" }),
|
|
3624
3625
|
/* @__PURE__ */ w("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
3625
3626
|
/* @__PURE__ */ w("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
|
|
3626
|
-
] }),
|
|
3627
|
+
] }), br = () => /* @__PURE__ */ w("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
3627
3628
|
/* @__PURE__ */ w("line", { x1: "1", y1: "1", x2: "23", y2: "23" }),
|
|
3628
3629
|
/* @__PURE__ */ w("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V5a3 3 0 0 0-5.94-.6" }),
|
|
3629
3630
|
/* @__PURE__ */ w("path", { d: "M17 16.95A7 7 0 0 1 5 12v-2m14 0v2c0 .87-.16 1.71-.46 2.49" }),
|
|
3630
3631
|
/* @__PURE__ */ w("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
|
|
3631
|
-
] }),
|
|
3632
|
+
] }), Ar = () => /* @__PURE__ */ w("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
3632
3633
|
/* @__PURE__ */ w("line", { x1: "22", y1: "2", x2: "11", y2: "13" }),
|
|
3633
3634
|
/* @__PURE__ */ w("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
|
|
3634
|
-
] }), Ar = () => /* @__PURE__ */ w("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
3635
|
-
/* @__PURE__ */ w("path", { d: "M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 2.59 3.4z" }),
|
|
3636
|
-
/* @__PURE__ */ w("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
3637
3635
|
] }), Ct = () => /* @__PURE__ */ w("svg", { width: "48", height: "48", viewBox: "0 0 48 48", fill: "none", style: { opacity: 0.3 }, children: [
|
|
3638
3636
|
/* @__PURE__ */ w("circle", { cx: "24", cy: "18", r: "8", stroke: "white", "stroke-width": "2", fill: "none" }),
|
|
3639
3637
|
/* @__PURE__ */ w("path", { d: "M8 42c0-8.837 7.163-16 16-16s16 7.163 16 16", stroke: "white", "stroke-width": "2", fill: "none" })
|
|
@@ -3643,26 +3641,29 @@ function Tr({
|
|
|
3643
3641
|
session: e,
|
|
3644
3642
|
videoRef: n,
|
|
3645
3643
|
avatarSrc: o,
|
|
3646
|
-
|
|
3647
|
-
|
|
3644
|
+
avatarVideoSrc: u,
|
|
3645
|
+
displayCta: a,
|
|
3646
|
+
onCollapse: c
|
|
3648
3647
|
}) {
|
|
3649
|
-
const
|
|
3648
|
+
const l = gt(null), [E, p] = ze(""), [_, d] = ze(null), [S, g] = ze(!1), y = gt(null), C = e.connectionStatus.value === "connected", A = e.connectionStatus.value === "connecting", I = e.connectionStatus.value === "error", b = e.isStreaming.value, N = !A && !C && !I, D = je(async () => {
|
|
3650
3649
|
n.current && await e.startSession(n.current);
|
|
3651
|
-
}, [e.startSession])
|
|
3650
|
+
}, [e.startSession]);
|
|
3651
|
+
je(async () => {
|
|
3652
3652
|
await e.stopSession();
|
|
3653
|
-
}, [e.stopSession])
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3653
|
+
}, [e.stopSession]);
|
|
3654
|
+
const x = je(() => {
|
|
3655
|
+
if (!E.trim()) return;
|
|
3656
|
+
const V = E.trim();
|
|
3657
|
+
e.sendMessage(V), p(""), l.current?.focus(), y.current && clearTimeout(y.current), g(!1), d(V), y.current = window.setTimeout(() => {
|
|
3658
|
+
g(!0), y.current = window.setTimeout(() => {
|
|
3659
|
+
d(null), g(!1);
|
|
3659
3660
|
}, 400);
|
|
3660
3661
|
}, 2600);
|
|
3661
|
-
}, [
|
|
3662
|
-
|
|
3662
|
+
}, [E]), Z = je((V) => {
|
|
3663
|
+
V.key === "Enter" && !V.shiftKey && (V.preventDefault(), x());
|
|
3663
3664
|
}, [x]);
|
|
3664
|
-
return
|
|
3665
|
-
|
|
3665
|
+
return mt(() => () => {
|
|
3666
|
+
y.current && clearTimeout(y.current);
|
|
3666
3667
|
}, []), /* @__PURE__ */ w("div", { class: "anam-sheet", children: [
|
|
3667
3668
|
/* @__PURE__ */ w(
|
|
3668
3669
|
"video",
|
|
@@ -3671,16 +3672,37 @@ function Tr({
|
|
|
3671
3672
|
class: "anam-video",
|
|
3672
3673
|
autoplay: !0,
|
|
3673
3674
|
playsinline: !0,
|
|
3674
|
-
"data-hidden":
|
|
3675
|
+
"data-hidden": b ? void 0 : "true"
|
|
3675
3676
|
}
|
|
3676
3677
|
),
|
|
3677
|
-
|
|
3678
|
+
N && (e.isConfigured.value ? (
|
|
3678
3679
|
/* Has agent-id: show avatar or placeholder + CTA pill */
|
|
3679
3680
|
/* @__PURE__ */ w("div", { class: "anam-overlay-idle", children: [
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3681
|
+
u ? /* @__PURE__ */ w(
|
|
3682
|
+
"video",
|
|
3683
|
+
{
|
|
3684
|
+
src: u,
|
|
3685
|
+
autoplay: !0,
|
|
3686
|
+
loop: !0,
|
|
3687
|
+
muted: !0,
|
|
3688
|
+
playsinline: !0,
|
|
3689
|
+
class: "anam-preview-video",
|
|
3690
|
+
onError: (V) => {
|
|
3691
|
+
V.target.style.display = "none";
|
|
3692
|
+
}
|
|
3693
|
+
}
|
|
3694
|
+
) : null,
|
|
3695
|
+
o ? /* @__PURE__ */ w(
|
|
3696
|
+
"img",
|
|
3697
|
+
{
|
|
3698
|
+
src: o,
|
|
3699
|
+
alt: "Avatar",
|
|
3700
|
+
class: u ? "anam-preview-fallback" : void 0
|
|
3701
|
+
}
|
|
3702
|
+
) : /* @__PURE__ */ w(Ct, {}),
|
|
3703
|
+
/* @__PURE__ */ w("button", { class: "anam-cta-pill", onClick: D, children: [
|
|
3704
|
+
/* @__PURE__ */ w(Cr, {}),
|
|
3705
|
+
a
|
|
3684
3706
|
] })
|
|
3685
3707
|
] })
|
|
3686
3708
|
) : (
|
|
@@ -3690,17 +3712,25 @@ function Tr({
|
|
|
3690
3712
|
/* @__PURE__ */ w("span", { children: "Agent not configured" })
|
|
3691
3713
|
] })
|
|
3692
3714
|
)),
|
|
3693
|
-
|
|
3715
|
+
A && /* @__PURE__ */ w("div", { class: "anam-overlay-loading", children: [
|
|
3694
3716
|
/* @__PURE__ */ w("span", { class: "anam-spinner" }),
|
|
3695
3717
|
/* @__PURE__ */ w("span", { children: "Starting your conversation..." })
|
|
3696
3718
|
] }),
|
|
3697
|
-
|
|
3719
|
+
I && /* @__PURE__ */ w("div", { class: "anam-overlay-error", children: [
|
|
3698
3720
|
/* @__PURE__ */ w("div", { class: "anam-overlay-error-text", children: e.error.value || "Something went wrong" }),
|
|
3699
|
-
/* @__PURE__ */ w("button", { class: "anam-retry-btn", onClick:
|
|
3721
|
+
/* @__PURE__ */ w("button", { class: "anam-retry-btn", onClick: D, children: "Try Again" })
|
|
3700
3722
|
] }),
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3723
|
+
c && /* @__PURE__ */ w(
|
|
3724
|
+
"button",
|
|
3725
|
+
{
|
|
3726
|
+
class: "anam-close-btn",
|
|
3727
|
+
onClick: c,
|
|
3728
|
+
"aria-label": "Close",
|
|
3729
|
+
children: /* @__PURE__ */ w(wr, {})
|
|
3730
|
+
}
|
|
3731
|
+
),
|
|
3732
|
+
(C || b) && /* @__PURE__ */ w(_e, { children: [
|
|
3733
|
+
_ && /* @__PURE__ */ w("div", { class: `anam-toast ${S ? "anam-toast-out" : ""}`, children: _ }),
|
|
3704
3734
|
/* @__PURE__ */ w("div", { class: "anam-control-bar", children: [
|
|
3705
3735
|
t.showMuteButton && /* @__PURE__ */ w(
|
|
3706
3736
|
"button",
|
|
@@ -3708,109 +3738,114 @@ function Tr({
|
|
|
3708
3738
|
class: `anam-ctl-btn ${e.isMuted.value ? "anam-ctl-btn-muted" : ""}`,
|
|
3709
3739
|
onClick: () => e.toggleMute(),
|
|
3710
3740
|
"aria-label": e.isMuted.value ? "Unmute" : "Mute",
|
|
3711
|
-
children: e.isMuted.value ? /* @__PURE__ */ w(
|
|
3741
|
+
children: e.isMuted.value ? /* @__PURE__ */ w(br, {}) : /* @__PURE__ */ w(Ir, {})
|
|
3712
3742
|
}
|
|
3713
3743
|
),
|
|
3714
|
-
t.showTextInput && /* @__PURE__ */ w(
|
|
3744
|
+
t.showTextInput && /* @__PURE__ */ w("div", { class: "anam-ctl-input-wrap", children: [
|
|
3715
3745
|
/* @__PURE__ */ w(
|
|
3716
3746
|
"input",
|
|
3717
3747
|
{
|
|
3718
|
-
ref:
|
|
3748
|
+
ref: l,
|
|
3719
3749
|
type: "text",
|
|
3720
3750
|
class: "anam-ctl-input",
|
|
3721
3751
|
placeholder: "Type a message...",
|
|
3722
|
-
value:
|
|
3723
|
-
onInput: (
|
|
3752
|
+
value: E,
|
|
3753
|
+
onInput: (V) => p(V.target.value),
|
|
3724
3754
|
onKeyDown: Z,
|
|
3725
|
-
disabled: !
|
|
3755
|
+
disabled: !C
|
|
3726
3756
|
}
|
|
3727
3757
|
),
|
|
3728
3758
|
/* @__PURE__ */ w(
|
|
3729
3759
|
"button",
|
|
3730
3760
|
{
|
|
3731
|
-
class: "anam-ctl-
|
|
3761
|
+
class: "anam-ctl-send",
|
|
3732
3762
|
onClick: x,
|
|
3733
|
-
disabled: !
|
|
3763
|
+
disabled: !C || !E.trim(),
|
|
3734
3764
|
"aria-label": "Send message",
|
|
3735
|
-
children: /* @__PURE__ */ w(
|
|
3765
|
+
children: /* @__PURE__ */ w(Ar, {})
|
|
3736
3766
|
}
|
|
3737
3767
|
)
|
|
3738
|
-
] })
|
|
3739
|
-
/* @__PURE__ */ w(
|
|
3740
|
-
"button",
|
|
3741
|
-
{
|
|
3742
|
-
class: "anam-ctl-btn anam-ctl-end",
|
|
3743
|
-
onClick: D,
|
|
3744
|
-
"aria-label": "End call",
|
|
3745
|
-
children: /* @__PURE__ */ w(Ar, {})
|
|
3746
|
-
}
|
|
3747
|
-
)
|
|
3768
|
+
] })
|
|
3748
3769
|
] })
|
|
3749
|
-
] })
|
|
3770
|
+
] }),
|
|
3771
|
+
/* @__PURE__ */ w(
|
|
3772
|
+
"a",
|
|
3773
|
+
{
|
|
3774
|
+
class: "anam-watermark",
|
|
3775
|
+
href: "https://anam.ai",
|
|
3776
|
+
target: "_blank",
|
|
3777
|
+
rel: "noopener noreferrer",
|
|
3778
|
+
children: /* @__PURE__ */ w("svg", { width: "48", height: "16", viewBox: "0 0 86 29", fill: "white", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
3779
|
+
/* @__PURE__ */ w("path", { d: "M18.1491 28.1986L16.2127 21.63L6.3408 21.63L4.40439 28.1986H0L9.03659 -1.79687L13.4789 -1.79687L22.5535 28.1986H18.1491ZM7.47986 17.8331L15.0736 17.8331L11.2767 4.96161L7.47986 17.8331Z" }),
|
|
3780
|
+
/* @__PURE__ */ w("path", { d: "M24.7666 28.1984L24.7666 7.69518L39.5745 7.69518V28.1984L35.3979 28.1984V11.4921L28.9432 11.4921L28.9432 28.1984H24.7666Z" }),
|
|
3781
|
+
/* @__PURE__ */ w("path", { d: "M61.0239 28.1984V7.69518L85.7037 7.69518V28.1984H81.5271V11.4921L75.4521 11.4921V28.1984L71.2755 28.1984V11.4921L65.2005 11.4921V28.1984H61.0239Z" }),
|
|
3782
|
+
/* @__PURE__ */ w("path", { d: "M42.8948 7.69518L57.7026 7.69518V28.1984L53.5261 28.1984V27.1353C52.4629 28.0466 51.0201 28.5781 49.3495 28.5781C45.4007 28.5781 42.8948 25.7305 42.8948 21.2501C42.8948 16.8457 45.4007 14.074 49.3495 14.074C51.0201 14.074 52.4629 14.5676 53.5261 15.4788V11.3022L42.8948 11.3022V7.69518ZM50.4885 24.7812C52.6148 24.7812 53.9437 23.4143 53.9057 21.2501C53.8678 19.0859 52.5389 17.681 50.4885 17.681C48.4003 17.681 47.0713 19.0859 47.0713 21.2501C47.0713 23.4143 48.4003 24.7812 50.4885 24.7812Z" })
|
|
3783
|
+
] })
|
|
3784
|
+
}
|
|
3785
|
+
)
|
|
3750
3786
|
] });
|
|
3751
3787
|
}
|
|
3752
3788
|
function Rr(t) {
|
|
3753
|
-
const e =
|
|
3789
|
+
const e = gt(null);
|
|
3754
3790
|
t["agent-id"] && t["session-token"] && console.warn("[AnamWidget] Both agent-id and session-token are set. Use one or the other. Ignoring agent-id.");
|
|
3755
|
-
const
|
|
3756
|
-
() =>
|
|
3757
|
-
[t.
|
|
3758
|
-
),
|
|
3759
|
-
const
|
|
3760
|
-
return
|
|
3761
|
-
}, [
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
},
|
|
3774
|
-
c.
|
|
3775
|
-
}, C =
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
return c.isReady.value ? /* @__PURE__ */ w(oe, { children: [
|
|
3781
|
-
/* @__PURE__ */ w("style", { children: di }),
|
|
3791
|
+
const n = t["session-token"] ? void 0 : t["agent-id"], o = yr(n, t["api-base-url"], t["session-token"]), u = Ie(
|
|
3792
|
+
() => Sr(t),
|
|
3793
|
+
[t.layout, t["initial-state"], t.position, t["ui-mute-button"], t["ui-text-input"], t["ui-captions"], t["call-to-action"]]
|
|
3794
|
+
), a = Ie(() => {
|
|
3795
|
+
const I = o.serverConfig.value;
|
|
3796
|
+
return wt(wt({ ...oi }, I ?? {}), u);
|
|
3797
|
+
}, [o.serverConfig.value, u]), c = ji(
|
|
3798
|
+
a.layout === "floating" ? a.initialState : "expanded"
|
|
3799
|
+
);
|
|
3800
|
+
mt(() => {
|
|
3801
|
+
a.layout === "inline" ? c.value = "expanded" : c.value = a.initialState;
|
|
3802
|
+
}, [a.layout, a.initialState]), mt(() => {
|
|
3803
|
+
o.fetchWidgetConfig();
|
|
3804
|
+
}, [n, t["api-base-url"], t["session-token"]]);
|
|
3805
|
+
const l = t["avatar-url"] || o.avatarThumbnailUrl.value || null, E = o.avatarVideoUrl.value || null, _ = t["agent-name"] || o.personaName.value, d = a.callToAction === oi.callToAction && _ ? `Talk to ${_}` : a.callToAction, S = Ie(() => {
|
|
3806
|
+
if (a.layout === "inline") return "";
|
|
3807
|
+
const I = kn(a.position);
|
|
3808
|
+
return Object.entries(I).map(([b, N]) => `${b}: ${N}`).join("; ");
|
|
3809
|
+
}, [a.layout, a.position]), g = a.layout === "floating", y = () => {
|
|
3810
|
+
c.value = "expanded";
|
|
3811
|
+
}, C = async () => {
|
|
3812
|
+
o.connectionStatus.value !== "idle" && await o.stopSession(), c.value = "minimized";
|
|
3813
|
+
}, A = g ? c.value === "expanded" : !0;
|
|
3814
|
+
return o.isReady.value ? /* @__PURE__ */ w(_e, { children: [
|
|
3815
|
+
/* @__PURE__ */ w("style", { children: hi }),
|
|
3782
3816
|
/* @__PURE__ */ w(
|
|
3783
3817
|
"div",
|
|
3784
3818
|
{
|
|
3785
3819
|
class: "anam-widget",
|
|
3786
|
-
"data-
|
|
3787
|
-
"data-
|
|
3788
|
-
style:
|
|
3820
|
+
"data-layout": a.layout,
|
|
3821
|
+
"data-state": c.value,
|
|
3822
|
+
style: S,
|
|
3789
3823
|
children: [
|
|
3790
|
-
|
|
3824
|
+
g && c.value === "minimized" && /* @__PURE__ */ w(
|
|
3791
3825
|
"button",
|
|
3792
3826
|
{
|
|
3793
3827
|
class: "anam-trigger",
|
|
3794
|
-
onClick:
|
|
3795
|
-
"aria-label":
|
|
3828
|
+
onClick: y,
|
|
3829
|
+
"aria-label": d,
|
|
3796
3830
|
children: l ? /* @__PURE__ */ w("img", { src: l, alt: "Avatar" }) : /* @__PURE__ */ w(Ct, {})
|
|
3797
3831
|
}
|
|
3798
3832
|
),
|
|
3799
|
-
|
|
3833
|
+
A && /* @__PURE__ */ w(
|
|
3800
3834
|
Tr,
|
|
3801
3835
|
{
|
|
3802
|
-
config:
|
|
3803
|
-
session:
|
|
3836
|
+
config: a,
|
|
3837
|
+
session: o,
|
|
3804
3838
|
videoRef: e,
|
|
3805
3839
|
avatarSrc: l,
|
|
3806
|
-
|
|
3807
|
-
|
|
3840
|
+
avatarVideoSrc: E,
|
|
3841
|
+
displayCta: d,
|
|
3842
|
+
onCollapse: g ? C : null
|
|
3808
3843
|
}
|
|
3809
3844
|
)
|
|
3810
3845
|
]
|
|
3811
3846
|
}
|
|
3812
3847
|
)
|
|
3813
|
-
] }) : /* @__PURE__ */ w("style", { children:
|
|
3848
|
+
] }) : /* @__PURE__ */ w("style", { children: hi });
|
|
3814
3849
|
}
|
|
3815
3850
|
const Nr = [
|
|
3816
3851
|
"agent-id",
|
|
@@ -3819,10 +3854,10 @@ const Nr = [
|
|
|
3819
3854
|
// API URL override (default: https://api.anam.ai)
|
|
3820
3855
|
"session-token",
|
|
3821
3856
|
// Pre-created session token -- skips /v1/auth/widget call when set
|
|
3822
|
-
"inline",
|
|
3823
|
-
// "true" | "false" -- render inline vs fixed position
|
|
3824
3857
|
"layout",
|
|
3825
|
-
// "
|
|
3858
|
+
// "inline" | "floating"
|
|
3859
|
+
"initial-state",
|
|
3860
|
+
// "minimized" | "expanded" (floating only, default: "expanded")
|
|
3826
3861
|
"position",
|
|
3827
3862
|
// "bottom-right" | "bottom-left" | "top-right" | "top-left" | custom
|
|
3828
3863
|
"ui-mute-button",
|
|
@@ -3831,6 +3866,8 @@ const Nr = [
|
|
|
3831
3866
|
// "true" | "false" -- show text input
|
|
3832
3867
|
"ui-captions",
|
|
3833
3868
|
// "true" | "false" -- show captions
|
|
3869
|
+
"call-to-action",
|
|
3870
|
+
// Custom CTA text for the start button
|
|
3834
3871
|
"avatar-url",
|
|
3835
3872
|
// Override avatar thumbnail (Lab preview)
|
|
3836
3873
|
"agent-name"
|
|
@@ -3846,14 +3883,14 @@ const Nr = [
|
|
|
3846
3883
|
MIC_MUTED: "anam-agent:mic-muted",
|
|
3847
3884
|
MIC_UNMUTED: "anam-agent:mic-unmuted"
|
|
3848
3885
|
};
|
|
3849
|
-
function
|
|
3850
|
-
|
|
3886
|
+
function fi(t = "anam-agent") {
|
|
3887
|
+
En(Rr, t, [...Nr], {
|
|
3851
3888
|
shadow: !0
|
|
3852
3889
|
});
|
|
3853
3890
|
}
|
|
3854
|
-
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () =>
|
|
3891
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => fi()) : fi());
|
|
3855
3892
|
export {
|
|
3856
|
-
|
|
3893
|
+
oi as DefaultConfig,
|
|
3857
3894
|
Or as WidgetEventNames,
|
|
3858
|
-
|
|
3895
|
+
fi as registerWidget
|
|
3859
3896
|
};
|