@anam-ai/agent-widget 0.1.0-alpha.11 → 0.1.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +644 -661
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Fe,
|
|
1
|
+
var Fe, k, fi, pi, Ee, Ht, _i, Ei, mi, It, _t, Et, Ue = {}, gi = [], ln = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, rt = Array.isArray;
|
|
2
2
|
function ie(t, e) {
|
|
3
3
|
for (var n in e) t[n] = e[n];
|
|
4
4
|
return t;
|
|
@@ -6,15 +6,15 @@ function ie(t, e) {
|
|
|
6
6
|
function bt(t) {
|
|
7
7
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
var o,
|
|
11
|
-
for (a in e) a == "key" ? o = e[a] : a == "ref" ?
|
|
12
|
-
if (arguments.length > 2 && (
|
|
13
|
-
return xe(t,
|
|
9
|
+
function Ce(t, e, n) {
|
|
10
|
+
var o, c, a, u = {};
|
|
11
|
+
for (a in e) a == "key" ? o = e[a] : a == "ref" ? c = e[a] : u[a] = e[a];
|
|
12
|
+
if (arguments.length > 2 && (u.children = arguments.length > 3 ? Fe.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (a in t.defaultProps) u[a] === void 0 && (u[a] = t.defaultProps[a]);
|
|
13
|
+
return xe(t, u, o, c, 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, c) {
|
|
16
|
+
var a = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: c ?? ++fi, __i: -1, __u: 0 };
|
|
17
|
+
return c == null && k.vnode != null && k.vnode(a), a;
|
|
18
18
|
}
|
|
19
19
|
function oe(t) {
|
|
20
20
|
return t.children;
|
|
@@ -38,27 +38,27 @@ function vi(t) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
function Wt(t) {
|
|
41
|
-
(!t.__d && (t.__d = !0) && Ee.push(t) && !Je.__r++ || Ht !=
|
|
41
|
+
(!t.__d && (t.__d = !0) && Ee.push(t) && !Je.__r++ || Ht != k.debounceRendering) && ((Ht = k.debounceRendering) || _i)(Je);
|
|
42
42
|
}
|
|
43
43
|
function Je() {
|
|
44
|
-
for (var t, e, n, o,
|
|
44
|
+
for (var t, e, n, o, c, a, u, l = 1; Ee.length; ) Ee.length > l && Ee.sort(Ei), t = Ee.shift(), l = Ee.length, t.__d && (n = void 0, o = void 0, c = (o = (e = t).__v).__e, a = [], u = [], 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 ? [c] : null, a, c ?? be(o), !!(32 & o.__u), u), n.__v = o.__v, n.__.__k[n.__i] = n, wi(a, n, u), o.__e = o.__ = null, n.__e != c && vi(n)));
|
|
45
45
|
Je.__r = 0;
|
|
46
46
|
}
|
|
47
|
-
function yi(t, e, n, o,
|
|
48
|
-
var d,
|
|
49
|
-
for (m = cn(n, e,
|
|
50
|
-
return n.__e =
|
|
47
|
+
function yi(t, e, n, o, c, a, u, l, m, p, _) {
|
|
48
|
+
var d, y, g, S, C, A, I, b = o && o.__k || gi, T = e.length;
|
|
49
|
+
for (m = cn(n, e, b, m, T), d = 0; d < T; d++) (g = n.__k[d]) != null && (y = g.__i == -1 ? Ue : b[g.__i] || Ue, g.__i = d, A = At(t, g, y, c, a, u, l, m, p, _), S = g.__e, g.ref && y.ref != g.ref && (y.ref && Tt(y.ref, null, g), _.push(g.ref, g.__c || S, g)), C == null && S != null && (C = S), (I = !!(4 & g.__u)) || y.__k === g.__k ? m = Si(g, m, t, I) : typeof g.type == "function" && A !== void 0 ? m = A : S && (m = S.nextSibling), g.__u &= -7);
|
|
50
|
+
return n.__e = C, m;
|
|
51
51
|
}
|
|
52
|
-
function cn(t, e, n, o,
|
|
53
|
-
var a,
|
|
54
|
-
for (t.__k = new Array(
|
|
52
|
+
function cn(t, e, n, o, c) {
|
|
53
|
+
var a, u, l, m, p, _ = n.length, d = _, y = 0;
|
|
54
|
+
for (t.__k = new Array(c), a = 0; a < c; a++) (u = e[a]) != null && typeof u != "boolean" && typeof u != "function" ? (typeof u == "string" || typeof u == "number" || typeof u == "bigint" || u.constructor == String ? u = t.__k[a] = xe(null, u, null, null, null) : rt(u) ? u = t.__k[a] = xe(oe, { children: u }, null, null, null) : u.constructor === void 0 && u.__b > 0 ? u = t.__k[a] = xe(u.type, u.props, u.key, u.ref ? u.ref : null, u.__v) : t.__k[a] = u, m = a + y, u.__ = t, u.__b = t.__b + 1, l = null, (p = u.__i = un(u, n, m, d)) != -1 && (d--, (l = n[p]) && (l.__u |= 2)), l == null || l.__v == null ? (p == -1 && (c > _ ? y-- : c < _ && y++), typeof u.type != "function" && (u.__u |= 4)) : p != m && (p == m - 1 ? y-- : p == m + 1 ? y++ : (p > m ? y-- : y++, u.__u |= 4))) : t.__k[a] = null;
|
|
55
55
|
if (d) for (a = 0; a < _; a++) (l = n[a]) != null && (2 & l.__u) == 0 && (l.__e == o && (o = be(l)), Ii(l, l));
|
|
56
56
|
return o;
|
|
57
57
|
}
|
|
58
58
|
function Si(t, e, n, o) {
|
|
59
|
-
var
|
|
59
|
+
var c, a;
|
|
60
60
|
if (typeof t.type == "function") {
|
|
61
|
-
for (
|
|
61
|
+
for (c = t.__k, a = 0; c && a < c.length; a++) c[a] && (c[a].__ = t, e = Si(c[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);
|
|
@@ -68,26 +68,26 @@ function Si(t, e, n, o) {
|
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
70
|
function un(t, e, n, o) {
|
|
71
|
-
var
|
|
71
|
+
var c, a, u, l = t.key, m = t.type, p = e[n], _ = p != null && (2 & p.__u) == 0;
|
|
72
72
|
if (p === null && l == null || _ && l == p.key && m == p.type) return n;
|
|
73
73
|
if (o > (_ ? 1 : 0)) {
|
|
74
|
-
for (
|
|
74
|
+
for (c = n - 1, a = n + 1; c >= 0 || a < e.length; ) if ((p = e[u = c >= 0 ? c-- : a++]) != null && (2 & p.__u) == 0 && l == p.key && m == p.type) return u;
|
|
75
75
|
}
|
|
76
76
|
return -1;
|
|
77
77
|
}
|
|
78
78
|
function zt(t, e, n) {
|
|
79
79
|
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || ln.test(e) ? n : n + "px";
|
|
80
80
|
}
|
|
81
|
-
function Ve(t, e, n, o,
|
|
82
|
-
var a,
|
|
81
|
+
function Ve(t, e, n, o, c) {
|
|
82
|
+
var a, u;
|
|
83
83
|
e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
|
|
84
84
|
else {
|
|
85
85
|
if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || zt(t.style, e, "");
|
|
86
86
|
if (n) for (e in n) o && n[e] == o[e] || zt(t.style, e, n[e]);
|
|
87
87
|
}
|
|
88
|
-
else if (e[0] == "o" && e[1] == "n") a = e != (e = e.replace(mi, "$1")),
|
|
88
|
+
else if (e[0] == "o" && e[1] == "n") a = e != (e = e.replace(mi, "$1")), u = e.toLowerCase(), e = u in t || e == "onFocusOut" || e == "onFocusIn" ? u.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + a] = n, n ? o ? n.u = o.u : (n.u = It, t.addEventListener(e, a ? Et : _t, a)) : t.removeEventListener(e, a ? Et : _t, a);
|
|
89
89
|
else {
|
|
90
|
-
if (
|
|
90
|
+
if (c == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
91
91
|
else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
|
|
92
92
|
t[e] = n ?? "";
|
|
93
93
|
break e;
|
|
@@ -102,35 +102,35 @@ function qt(t) {
|
|
|
102
102
|
var n = this.l[e.type + t];
|
|
103
103
|
if (e.t == null) e.t = It++;
|
|
104
104
|
else if (e.t < n.u) return;
|
|
105
|
-
return n(
|
|
105
|
+
return n(k.event ? k.event(e) : e);
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function At(t, e, n, o,
|
|
110
|
-
var _, d,
|
|
109
|
+
function At(t, e, n, o, c, a, u, l, m, p) {
|
|
110
|
+
var _, d, y, g, S, C, A, I, b, T, D, x, Z, H, ae, ne, re, Q = e.type;
|
|
111
111
|
if (e.constructor !== void 0) return null;
|
|
112
|
-
128 & n.__u && (m = !!(32 & n.__u), a = [l = e.__e = n.__e]), (_ =
|
|
112
|
+
128 & n.__u && (m = !!(32 & n.__u), a = [l = e.__e = n.__e]), (_ = k.__b) && _(e);
|
|
113
113
|
e: if (typeof Q == "function") try {
|
|
114
|
-
if (
|
|
114
|
+
if (I = e.props, b = "prototype" in Q && Q.prototype.render, T = (_ = Q.contextType) && o[_.__c], D = _ ? T ? T.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 = hn), T && T.sub(d), d.state || (d.state = {}), d.__n = o, y = d.__d = !0, d.__h = [], d._sb = []), b && d.__s == null && (d.__s = d.state), b && Q.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = ie({}, d.__s)), ie(d.__s, Q.getDerivedStateFromProps(I, d.__s))), g = d.props, S = d.state, d.__v = e, y) b && Q.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), b && d.componentDidMount != null && d.__h.push(d.componentDidMount);
|
|
115
115
|
else {
|
|
116
|
-
if (
|
|
117
|
-
for (e.__v != n.__v && (d.props =
|
|
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(le) {
|
|
118
118
|
le && (le.__ = e);
|
|
119
|
-
}),
|
|
120
|
-
d._sb = [], d.__h.length &&
|
|
119
|
+
}), x = 0; x < d._sb.length; x++) d.__h.push(d._sb[x]);
|
|
120
|
+
d._sb = [], d.__h.length && u.push(d);
|
|
121
121
|
break e;
|
|
122
122
|
}
|
|
123
|
-
d.componentWillUpdate != null && d.componentWillUpdate(
|
|
124
|
-
d.componentDidUpdate(g,
|
|
123
|
+
d.componentWillUpdate != null && d.componentWillUpdate(I, d.__s, D), b && d.componentDidUpdate != null && d.__h.push(function() {
|
|
124
|
+
d.componentDidUpdate(g, S, C);
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
if (d.context =
|
|
128
|
-
for (d.state = d.__s, d.__d = !1,
|
|
127
|
+
if (d.context = D, d.props = I, d.__P = t, d.__e = !1, Z = k.__r, H = 0, b) {
|
|
128
|
+
for (d.state = d.__s, d.__d = !1, Z && Z(e), _ = d.render(d.props, d.state, d.context), ae = 0; ae < d._sb.length; ae++) d.__h.push(d._sb[ae]);
|
|
129
129
|
d._sb = [];
|
|
130
130
|
} else do
|
|
131
|
-
d.__d = !1,
|
|
131
|
+
d.__d = !1, Z && Z(e), _ = d.render(d.props, d.state, d.context), d.state = d.__s;
|
|
132
132
|
while (d.__d && ++H < 25);
|
|
133
|
-
d.state = d.__s, d.getChildContext != null && (o = ie(ie({}, o), d.getChildContext())),
|
|
133
|
+
d.state = d.__s, d.getChildContext != null && (o = ie(ie({}, o), d.getChildContext())), b && !y && d.getSnapshotBeforeUpdate != null && (C = d.getSnapshotBeforeUpdate(g, S)), ne = _, _ != null && _.type === oe && _.key == null && (ne = Ci(_.props.children)), l = yi(t, rt(ne) ? ne : [ne], e, n, o, c, a, u, l, m, p), d.base = e.__e, e.__u &= -161, d.__h.length && u.push(d), A && (d.__E = d.__ = null);
|
|
134
134
|
} catch (le) {
|
|
135
135
|
if (e.__v = null, m || a != null) if (le.then) {
|
|
136
136
|
for (e.__u |= m ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
@@ -140,55 +140,55 @@ function At(t, e, n, o, u, a, c, l, m, p) {
|
|
|
140
140
|
mt(e);
|
|
141
141
|
}
|
|
142
142
|
else e.__e = n.__e, e.__k = n.__k, le.then || mt(e);
|
|
143
|
-
|
|
143
|
+
k.__e(le, e, n);
|
|
144
144
|
}
|
|
145
|
-
else a == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = dn(n.__e, e, n, o,
|
|
146
|
-
return (_ =
|
|
145
|
+
else a == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = dn(n.__e, e, n, o, c, a, u, m, p);
|
|
146
|
+
return (_ = k.diffed) && _(e), 128 & e.__u ? void 0 : l;
|
|
147
147
|
}
|
|
148
148
|
function mt(t) {
|
|
149
149
|
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(mt);
|
|
150
150
|
}
|
|
151
151
|
function wi(t, e, n) {
|
|
152
152
|
for (var o = 0; o < n.length; o++) Tt(n[o], n[++o], n[++o]);
|
|
153
|
-
|
|
153
|
+
k.__c && k.__c(e, t), t.some(function(c) {
|
|
154
154
|
try {
|
|
155
|
-
t =
|
|
156
|
-
a.call(
|
|
155
|
+
t = c.__h, c.__h = [], t.some(function(a) {
|
|
156
|
+
a.call(c);
|
|
157
157
|
});
|
|
158
158
|
} catch (a) {
|
|
159
|
-
|
|
159
|
+
k.__e(a, c.__v);
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
function Ci(t) {
|
|
164
164
|
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : rt(t) ? t.map(Ci) : ie({}, t);
|
|
165
165
|
}
|
|
166
|
-
function dn(t, e, n, o,
|
|
167
|
-
var p, _, d,
|
|
168
|
-
if (
|
|
169
|
-
for (p = 0; p < a.length; p++) if ((g = a[p]) && "setAttribute" in g == !!
|
|
166
|
+
function dn(t, e, n, o, c, a, u, l, m) {
|
|
167
|
+
var p, _, d, y, g, S, C, A = n.props || Ue, I = e.props, b = e.type;
|
|
168
|
+
if (b == "svg" ? c = "http://www.w3.org/2000/svg" : b == "math" ? c = "http://www.w3.org/1998/Math/MathML" : c || (c = "http://www.w3.org/1999/xhtml"), a != null) {
|
|
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;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
if (t == null) {
|
|
175
|
-
if (
|
|
176
|
-
t = document.createElementNS(
|
|
175
|
+
if (b == null) return document.createTextNode(I);
|
|
176
|
+
t = document.createElementNS(c, b, I.is && I), l && (k.__m && k.__m(e, a), l = !1), a = null;
|
|
177
177
|
}
|
|
178
|
-
if (
|
|
178
|
+
if (b == null) A === I || l && t.data == I || (t.data = I);
|
|
179
179
|
else {
|
|
180
180
|
if (a = a && Fe.call(t.childNodes), !l && a != null) for (A = {}, p = 0; p < t.attributes.length; p++) A[(g = t.attributes[p]).name] = g.value;
|
|
181
181
|
for (p in A) if (g = A[p], p != "children") {
|
|
182
182
|
if (p == "dangerouslySetInnerHTML") d = g;
|
|
183
|
-
else if (!(p in
|
|
184
|
-
if (p == "value" && "defaultValue" in
|
|
185
|
-
Ve(t, p, null, g,
|
|
183
|
+
else if (!(p in I)) {
|
|
184
|
+
if (p == "value" && "defaultValue" in I || p == "checked" && "defaultChecked" in I) continue;
|
|
185
|
+
Ve(t, p, null, g, c);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
for (p in
|
|
188
|
+
for (p in I) g = I[p], p == "children" ? y = g : p == "dangerouslySetInnerHTML" ? _ = g : p == "value" ? S = g : p == "checked" ? C = g : l && typeof g != "function" || A[p] === g || Ve(t, p, g, A[p], c);
|
|
189
189
|
if (_) l || d && (_.__html == d.__html || _.__html == t.innerHTML) || (t.innerHTML = _.__html), e.__k = [];
|
|
190
|
-
else if (d && (t.innerHTML = ""), yi(e.type == "template" ? t.content : t, rt(
|
|
191
|
-
l || (p = "value",
|
|
190
|
+
else if (d && (t.innerHTML = ""), yi(e.type == "template" ? t.content : t, rt(y) ? y : [y], e, n, o, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : c, a, u, a ? a[0] : n.__k && be(n, 0), l, m), a != null) for (p = a.length; p--; ) bt(a[p]);
|
|
191
|
+
l || (p = "value", b == "progress" && S == null ? t.removeAttribute("value") : S != null && (S !== t[p] || b == "progress" && !S || b == "option" && S != A[p]) && Ve(t, p, S, A[p], c), p = "checked", C != null && C != t[p] && Ve(t, p, C, A[p], c));
|
|
192
192
|
}
|
|
193
193
|
return t;
|
|
194
194
|
}
|
|
@@ -198,41 +198,41 @@ 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
|
-
|
|
201
|
+
} catch (c) {
|
|
202
|
+
k.__e(c, n);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
function Ii(t, e, n) {
|
|
206
|
-
var o,
|
|
207
|
-
if (
|
|
206
|
+
var o, c;
|
|
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();
|
|
210
210
|
} catch (a) {
|
|
211
|
-
|
|
211
|
+
k.__e(a, e);
|
|
212
212
|
}
|
|
213
213
|
o.base = o.__P = null;
|
|
214
214
|
}
|
|
215
|
-
if (o = t.__k) for (
|
|
215
|
+
if (o = t.__k) for (c = 0; c < o.length; c++) o[c] && Ii(o[c], e, n || typeof t.type != "function");
|
|
216
216
|
n || bt(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
217
217
|
}
|
|
218
218
|
function hn(t, e, n) {
|
|
219
219
|
return this.constructor(t, n);
|
|
220
220
|
}
|
|
221
221
|
function ot(t, e, n) {
|
|
222
|
-
var o,
|
|
223
|
-
e == document && (e = document.documentElement),
|
|
222
|
+
var o, c, a, u;
|
|
223
|
+
e == document && (e = document.documentElement), k.__ && k.__(t, e), c = (o = typeof n == "function") ? null : n && n.__k || e.__k, a = [], u = [], At(e, t = (!o && n || e).__k = Ce(oe, null, [t]), c || Ue, Ue, e.namespaceURI, !o && n ? [n] : c ? null : e.firstChild ? Fe.call(e.childNodes) : null, a, !o && n ? n : c ? c.__e : e.firstChild, o, u), wi(a, t, u);
|
|
224
224
|
}
|
|
225
225
|
function bi(t, e) {
|
|
226
226
|
ot(t, e, bi);
|
|
227
227
|
}
|
|
228
228
|
function Ai(t, e, n) {
|
|
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,
|
|
229
|
+
var o, c, a, u, l = ie({}, t.props);
|
|
230
|
+
for (a in t.type && t.type.defaultProps && (u = t.type.defaultProps), e) a == "key" ? o = e[a] : a == "ref" ? c = e[a] : l[a] = e[a] === void 0 && u != null ? u[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, c || t.ref, null);
|
|
232
232
|
}
|
|
233
|
-
Fe = gi.slice,
|
|
234
|
-
for (var
|
|
235
|
-
if ((a =
|
|
233
|
+
Fe = gi.slice, k = { __e: function(t, e, n, o) {
|
|
234
|
+
for (var c, a, u; e = e.__; ) if ((c = e.__c) && !c.__) try {
|
|
235
|
+
if ((a = c.constructor) && a.getDerivedStateFromError != null && (c.setState(a.getDerivedStateFromError(t)), u = c.__d), c.componentDidCatch != null && (c.componentDidCatch(t, o || {}), u = c.__d), u) return c.__E = c;
|
|
236
236
|
} catch (l) {
|
|
237
237
|
t = l;
|
|
238
238
|
}
|
|
@@ -258,27 +258,27 @@ function Xe() {
|
|
|
258
258
|
}
|
|
259
259
|
function Ti(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
|
|
261
|
+
var n, o, c = {}, a = Object.keys(t);
|
|
262
|
+
for (o = 0; o < a.length; o++) e.indexOf(n = a[o]) >= 0 || (c[n] = t[n]);
|
|
263
|
+
return c;
|
|
264
264
|
}
|
|
265
265
|
var fn = ["context", "children"], pn = ["useFragment"];
|
|
266
266
|
function _n(t, e, n, o) {
|
|
267
|
-
function
|
|
268
|
-
var a,
|
|
269
|
-
return
|
|
267
|
+
function c() {
|
|
268
|
+
var a, u = Reflect.construct(HTMLElement, [], c);
|
|
269
|
+
return u._vdomComponent = t, o && o.shadow ? (u._root = u.attachShadow({ mode: o.mode || "open", serializable: (a = o.serializable) != null && a }), o.adoptedStyleSheets && (u._root.adoptedStyleSheets = o.adoptedStyleSheets)) : u._root = u, u;
|
|
270
270
|
}
|
|
271
|
-
return (
|
|
271
|
+
return (c.prototype = Object.create(HTMLElement.prototype)).constructor = c, c.prototype.connectedCallback = function() {
|
|
272
272
|
mn.call(this, o);
|
|
273
|
-
},
|
|
274
|
-
Object.defineProperty(
|
|
273
|
+
}, c.prototype.attributeChangedCallback = gn, c.prototype.disconnectedCallback = vn, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), c.observedAttributes = n, t.formAssociated && (c.formAssociated = !0), n.forEach(function(a) {
|
|
274
|
+
Object.defineProperty(c.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(u) {
|
|
277
|
+
this._vdom ? this.attributeChangedCallback(a, null, u) : (this._props || (this._props = {}), this._props[a] = u);
|
|
278
|
+
var l = typeof u;
|
|
279
|
+
u != null && l !== "string" && l !== "boolean" && l !== "number" || this.setAttribute(a, u);
|
|
280
280
|
} });
|
|
281
|
-
}), customElements.define(e || t.tagName || t.displayName || t.name,
|
|
281
|
+
}), customElements.define(e || t.tagName || t.displayName || t.name, c), c;
|
|
282
282
|
}
|
|
283
283
|
function En(t) {
|
|
284
284
|
this.getChildContext = function() {
|
|
@@ -289,7 +289,7 @@ function En(t) {
|
|
|
289
289
|
}
|
|
290
290
|
function mn(t) {
|
|
291
291
|
var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
|
|
292
|
-
this.dispatchEvent(e), this._vdom =
|
|
292
|
+
this.dispatchEvent(e), this._vdom = Ce(En, Xe({}, this._props, { context: e.detail.context }), Ni(this, this._vdomComponent, t)), (this.hasAttribute("hydrate") ? bi : ot)(this._vdom, this._root);
|
|
293
293
|
}
|
|
294
294
|
function Ri(t) {
|
|
295
295
|
return t.replace(/-(\w)/g, function(e, n) {
|
|
@@ -306,35 +306,35 @@ function vn() {
|
|
|
306
306
|
ot(this._vdom = null, this._root);
|
|
307
307
|
}
|
|
308
308
|
function Yt(t, e) {
|
|
309
|
-
var n = this, o = t.useFragment,
|
|
310
|
-
return
|
|
311
|
-
a ? (n.ref = a, n._listener || (n._listener = function(
|
|
312
|
-
|
|
309
|
+
var n = this, o = t.useFragment, c = Ti(t, pn);
|
|
310
|
+
return Ce(o ? oe : "slot", Xe({}, c, { ref: function(a) {
|
|
311
|
+
a ? (n.ref = a, n._listener || (n._listener = function(u) {
|
|
312
|
+
u.stopPropagation(), u.detail.context = e;
|
|
313
313
|
}, a.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
|
|
314
314
|
} }));
|
|
315
315
|
}
|
|
316
316
|
function Ni(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 = [], c = {}, a = 0, u = t.attributes, l = t.childNodes;
|
|
320
|
+
for (a = u.length; a--; ) u[a].name !== "slot" && (c[u[a].name] = u[a].value, c[Ri(u[a].name)] = u[a].value);
|
|
321
321
|
for (a = l.length; a--; ) {
|
|
322
322
|
var m = Ni(l[a], null, n), p = l[a].slot;
|
|
323
|
-
p ?
|
|
323
|
+
p ? c[p] = Ce(Yt, { name: p }, m) : o[a] = m;
|
|
324
324
|
}
|
|
325
|
-
var _ = !(!n || !n.shadow), d = e ?
|
|
326
|
-
return !_ && e && (t.innerHTML = ""),
|
|
325
|
+
var _ = !(!n || !n.shadow), d = e ? Ce(Yt, { useFragment: !_ }, o) : o;
|
|
326
|
+
return !_ && e && (t.innerHTML = ""), Ce(e || t.nodeName.toLowerCase(), c, d);
|
|
327
327
|
}
|
|
328
328
|
var yn = 0;
|
|
329
|
-
function w(t, e, n, o,
|
|
329
|
+
function w(t, e, n, o, c, a) {
|
|
330
330
|
e || (e = {});
|
|
331
|
-
var
|
|
332
|
-
if ("ref" in m) for (l in m = {}, e) l == "ref" ?
|
|
333
|
-
var p = { type: t, props: m, key: n, ref:
|
|
334
|
-
if (typeof t == "function" && (
|
|
335
|
-
return
|
|
331
|
+
var u, l, m = e;
|
|
332
|
+
if ("ref" in m) for (l in m = {}, e) l == "ref" ? u = e[l] : m[l] = e[l];
|
|
333
|
+
var p = { type: t, props: m, key: n, ref: u, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --yn, __i: -1, __u: 0, __source: c, __self: a };
|
|
334
|
+
if (typeof t == "function" && (u = t.defaultProps)) for (l in u) m[l] === void 0 && (m[l] = u[l]);
|
|
335
|
+
return k.vnode && k.vnode(p), p;
|
|
336
336
|
}
|
|
337
|
-
var
|
|
337
|
+
var Me, P, dt, Kt, Be = 0, xi = [], F = k, Jt = F.__b, Xt = F.__r, Zt = F.diffed, Qt = F.__c, ei = F.unmount, ti = F.__;
|
|
338
338
|
function Rt(t, e) {
|
|
339
339
|
F.__h && F.__h(P, t, Be || e), Be = 0;
|
|
340
340
|
var n = P.__H || (P.__H = { __: [], __h: [] });
|
|
@@ -344,54 +344,54 @@ function qe(t) {
|
|
|
344
344
|
return Be = 1, Sn(ki, t);
|
|
345
345
|
}
|
|
346
346
|
function Sn(t, e, n) {
|
|
347
|
-
var o = Rt(
|
|
347
|
+
var o = Rt(Me++, 2);
|
|
348
348
|
if (o.t = t, !o.__c && (o.__ = [ki(void 0, e), function(l) {
|
|
349
349
|
var m = o.__N ? o.__N[0] : o.__[0], p = o.t(m, l);
|
|
350
350
|
m !== p && (o.__N = [p, o.__[1]], o.__c.setState({}));
|
|
351
351
|
}], o.__c = P, !P.__f)) {
|
|
352
|
-
var
|
|
352
|
+
var c = function(l, m, 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(y) {
|
|
355
|
+
return !!y.__c;
|
|
356
356
|
});
|
|
357
|
-
if (_.every(function(
|
|
358
|
-
return !
|
|
357
|
+
if (_.every(function(y) {
|
|
358
|
+
return !y.__N;
|
|
359
359
|
})) return !a || a.call(this, l, m, p);
|
|
360
360
|
var d = o.__c.props !== l;
|
|
361
|
-
return _.forEach(function(
|
|
362
|
-
if (
|
|
363
|
-
var g =
|
|
364
|
-
|
|
361
|
+
return _.forEach(function(y) {
|
|
362
|
+
if (y.__N) {
|
|
363
|
+
var g = y.__[0];
|
|
364
|
+
y.__ = y.__N, y.__N = void 0, g !== y.__[0] && (d = !0);
|
|
365
365
|
}
|
|
366
366
|
}), a && a.call(this, l, m, p) || d;
|
|
367
367
|
};
|
|
368
368
|
P.__f = !0;
|
|
369
|
-
var a = P.shouldComponentUpdate,
|
|
369
|
+
var a = P.shouldComponentUpdate, u = P.componentWillUpdate;
|
|
370
370
|
P.componentWillUpdate = function(l, m, p) {
|
|
371
371
|
if (this.__e) {
|
|
372
372
|
var _ = a;
|
|
373
|
-
a = void 0,
|
|
373
|
+
a = void 0, c(l, m, p), a = _;
|
|
374
374
|
}
|
|
375
|
-
|
|
376
|
-
}, P.shouldComponentUpdate =
|
|
375
|
+
u && u.call(this, l, m, p);
|
|
376
|
+
}, P.shouldComponentUpdate = c;
|
|
377
377
|
}
|
|
378
378
|
return o.__N || o.__;
|
|
379
379
|
}
|
|
380
380
|
function gt(t, e) {
|
|
381
|
-
var n = Rt(
|
|
381
|
+
var n = Rt(Me++, 3);
|
|
382
382
|
!F.__s && Oi(n.__H, e) && (n.__ = t, n.u = e, P.__H.__h.push(n));
|
|
383
383
|
}
|
|
384
384
|
function Ze(t) {
|
|
385
|
-
return Be = 5,
|
|
385
|
+
return Be = 5, Ie(function() {
|
|
386
386
|
return { current: t };
|
|
387
387
|
}, []);
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
var n = Rt(
|
|
389
|
+
function Ie(t, e) {
|
|
390
|
+
var n = Rt(Me++, 7);
|
|
391
391
|
return Oi(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
|
|
392
392
|
}
|
|
393
393
|
function je(t, e) {
|
|
394
|
-
return Be = 8,
|
|
394
|
+
return Be = 8, Ie(function() {
|
|
395
395
|
return t;
|
|
396
396
|
}, e);
|
|
397
397
|
}
|
|
@@ -407,11 +407,11 @@ F.__b = function(t) {
|
|
|
407
407
|
}, F.__ = function(t, e) {
|
|
408
408
|
t && e.__k && e.__k.__m && (t.__m = e.__k.__m), ti && ti(t, e);
|
|
409
409
|
}, F.__r = function(t) {
|
|
410
|
-
Xt && Xt(t),
|
|
410
|
+
Xt && Xt(t), Me = 0;
|
|
411
411
|
var e = (P = t.__c).__H;
|
|
412
412
|
e && (dt === 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(Ye), e.__h.forEach(vt), e.__h = [],
|
|
414
|
+
})) : (e.__h.forEach(Ye), e.__h.forEach(vt), e.__h = [], Me = 0)), dt = P;
|
|
415
415
|
}, F.diffed = function(t) {
|
|
416
416
|
Zt && Zt(t);
|
|
417
417
|
var e = t.__c;
|
|
@@ -425,8 +425,8 @@ F.__b = function(t) {
|
|
|
425
425
|
return !o.__ || vt(o);
|
|
426
426
|
});
|
|
427
427
|
} catch (o) {
|
|
428
|
-
e.some(function(
|
|
429
|
-
|
|
428
|
+
e.some(function(c) {
|
|
429
|
+
c.__h && (c.__h = []);
|
|
430
430
|
}), e = [], F.__e(o, n.__v);
|
|
431
431
|
}
|
|
432
432
|
}), Qt && Qt(t, e);
|
|
@@ -436,8 +436,8 @@ F.__b = function(t) {
|
|
|
436
436
|
n && n.__H && (n.__H.__.forEach(function(o) {
|
|
437
437
|
try {
|
|
438
438
|
Ye(o);
|
|
439
|
-
} catch (
|
|
440
|
-
e =
|
|
439
|
+
} catch (c) {
|
|
440
|
+
e = c;
|
|
441
441
|
}
|
|
442
442
|
}), n.__H = void 0, e && F.__e(e, n.__v));
|
|
443
443
|
};
|
|
@@ -473,10 +473,10 @@ function st() {
|
|
|
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) && Mi(n)) try {
|
|
477
477
|
n.c();
|
|
478
|
-
} catch (
|
|
479
|
-
e || (t =
|
|
478
|
+
} catch (c) {
|
|
479
|
+
e || (t = c, e = !0);
|
|
480
480
|
}
|
|
481
481
|
n = o;
|
|
482
482
|
}
|
|
@@ -493,24 +493,24 @@ function bn(t) {
|
|
|
493
493
|
st();
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
var
|
|
496
|
+
var O = void 0;
|
|
497
497
|
function Di(t) {
|
|
498
|
-
var e =
|
|
499
|
-
|
|
498
|
+
var e = O;
|
|
499
|
+
O = void 0;
|
|
500
500
|
try {
|
|
501
501
|
return t();
|
|
502
502
|
} finally {
|
|
503
|
-
|
|
503
|
+
O = e;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
var ke = void 0, pe = 0, yt = 0, Qe = 0;
|
|
507
|
-
function
|
|
508
|
-
if (
|
|
507
|
+
function Ui(t) {
|
|
508
|
+
if (O !== void 0) {
|
|
509
509
|
var e = t.n;
|
|
510
|
-
if (e === void 0 || e.t !==
|
|
511
|
-
return e = { i: 0, S: t, p:
|
|
510
|
+
if (e === void 0 || e.t !== O)
|
|
511
|
+
return e = { i: 0, S: t, p: O.s, n: void 0, t: O, e: void 0, x: void 0, r: e }, O.s !== void 0 && (O.s.n = e), O.s = e, t.n = e, 32 & O.f && t.S(e), e;
|
|
512
512
|
if (e.i === -1)
|
|
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 =
|
|
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
516
|
function j(t, e) {
|
|
@@ -532,20 +532,20 @@ j.prototype.U = function(t) {
|
|
|
532
532
|
if (this.t !== void 0) {
|
|
533
533
|
var n = t.e, o = t.x;
|
|
534
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 && Di(function() {
|
|
535
|
-
var
|
|
536
|
-
(
|
|
535
|
+
var c;
|
|
536
|
+
(c = e.Z) == null || c.call(e);
|
|
537
537
|
}));
|
|
538
538
|
}
|
|
539
539
|
};
|
|
540
540
|
j.prototype.subscribe = function(t) {
|
|
541
541
|
var e = this;
|
|
542
542
|
return $e(function() {
|
|
543
|
-
var n = e.value, o =
|
|
544
|
-
|
|
543
|
+
var n = e.value, o = O;
|
|
544
|
+
O = void 0;
|
|
545
545
|
try {
|
|
546
546
|
t(n);
|
|
547
547
|
} finally {
|
|
548
|
-
|
|
548
|
+
O = o;
|
|
549
549
|
}
|
|
550
550
|
}, { name: "sub" });
|
|
551
551
|
};
|
|
@@ -559,16 +559,16 @@ j.prototype.toJSON = function() {
|
|
|
559
559
|
return this.value;
|
|
560
560
|
};
|
|
561
561
|
j.prototype.peek = function() {
|
|
562
|
-
var t =
|
|
563
|
-
|
|
562
|
+
var t = O;
|
|
563
|
+
O = void 0;
|
|
564
564
|
try {
|
|
565
565
|
return this.value;
|
|
566
566
|
} finally {
|
|
567
|
-
|
|
567
|
+
O = t;
|
|
568
568
|
}
|
|
569
569
|
};
|
|
570
570
|
Object.defineProperty(j.prototype, "value", { get: function() {
|
|
571
|
-
var t =
|
|
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) {
|
|
@@ -581,10 +581,10 @@ Object.defineProperty(j.prototype, "value", { get: function() {
|
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
} });
|
|
584
|
-
function
|
|
584
|
+
function Y(t, e) {
|
|
585
585
|
return new j(t, e);
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Mi(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
|
}
|
|
@@ -604,65 +604,65 @@ function Li(t) {
|
|
|
604
604
|
}
|
|
605
605
|
t.s = n;
|
|
606
606
|
}
|
|
607
|
-
function
|
|
607
|
+
function ge(t, e) {
|
|
608
608
|
j.call(this, void 0), this.x = t, this.s = void 0, this.g = Qe - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
|
|
609
609
|
}
|
|
610
|
-
|
|
611
|
-
|
|
610
|
+
ge.prototype = new j();
|
|
611
|
+
ge.prototype.h = function() {
|
|
612
612
|
if (this.f &= -3, 1 & this.f) return !1;
|
|
613
613
|
if ((36 & this.f) == 32 || (this.f &= -5, this.g === Qe)) return !0;
|
|
614
|
-
if (this.g = Qe, this.f |= 1, this.i > 0 && !
|
|
614
|
+
if (this.g = Qe, this.f |= 1, this.i > 0 && !Mi(this))
|
|
615
615
|
return this.f &= -2, !0;
|
|
616
|
-
var t =
|
|
616
|
+
var t = O;
|
|
617
617
|
try {
|
|
618
|
-
Bi(this),
|
|
618
|
+
Bi(this), O = this;
|
|
619
619
|
var e = this.x();
|
|
620
620
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
621
621
|
} catch (n) {
|
|
622
622
|
this.v = n, this.f |= 16, this.i++;
|
|
623
623
|
}
|
|
624
|
-
return
|
|
624
|
+
return O = t, Li(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
|
j.prototype.S.call(this, t);
|
|
632
632
|
};
|
|
633
|
-
|
|
633
|
+
ge.prototype.U = function(t) {
|
|
634
634
|
if (this.t !== void 0 && (j.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
|
}
|
|
638
638
|
};
|
|
639
|
-
|
|
639
|
+
ge.prototype.N = function() {
|
|
640
640
|
if (!(2 & this.f)) {
|
|
641
641
|
this.f |= 6;
|
|
642
642
|
for (var t = this.t; t !== void 0; t = t.x) t.t.N();
|
|
643
643
|
}
|
|
644
644
|
};
|
|
645
|
-
Object.defineProperty(
|
|
645
|
+
Object.defineProperty(ge.prototype, "value", { get: function() {
|
|
646
646
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
647
|
-
var t =
|
|
647
|
+
var t = Ui(this);
|
|
648
648
|
if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v;
|
|
649
649
|
return this.v;
|
|
650
650
|
} });
|
|
651
651
|
function ni(t, e) {
|
|
652
|
-
return new
|
|
652
|
+
return new ge(t, e);
|
|
653
653
|
}
|
|
654
654
|
function Pi(t) {
|
|
655
655
|
var e = t.u;
|
|
656
656
|
if (t.u = void 0, typeof e == "function") {
|
|
657
657
|
pe++;
|
|
658
|
-
var n =
|
|
659
|
-
|
|
658
|
+
var n = O;
|
|
659
|
+
O = void 0;
|
|
660
660
|
try {
|
|
661
661
|
e();
|
|
662
662
|
} catch (o) {
|
|
663
663
|
throw t.f &= -2, t.f |= 8, Nt(t), o;
|
|
664
664
|
} finally {
|
|
665
|
-
|
|
665
|
+
O = n, st();
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
}
|
|
@@ -671,8 +671,8 @@ function Nt(t) {
|
|
|
671
671
|
t.x = void 0, t.s = void 0, Pi(t);
|
|
672
672
|
}
|
|
673
673
|
function An(t) {
|
|
674
|
-
if (
|
|
675
|
-
Li(this),
|
|
674
|
+
if (O !== this) throw new Error("Out-of-order effect");
|
|
675
|
+
Li(this), O = t, this.f &= -2, 8 & this.f && Nt(this), st();
|
|
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;
|
|
@@ -690,8 +690,8 @@ Ae.prototype.c = function() {
|
|
|
690
690
|
Ae.prototype.S = function() {
|
|
691
691
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
692
692
|
this.f |= 1, this.f &= -9, Pi(this), Bi(this), pe++;
|
|
693
|
-
var t =
|
|
694
|
-
return
|
|
693
|
+
var t = O;
|
|
694
|
+
return O = this, An.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,8 +706,8 @@ 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 (c) {
|
|
710
|
+
throw n.d(), c;
|
|
711
711
|
}
|
|
712
712
|
var o = n.d.bind(n);
|
|
713
713
|
return o[Symbol.dispose] = o, o;
|
|
@@ -717,7 +717,7 @@ $e(function() {
|
|
|
717
717
|
Fi = 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
723
|
function et(t) {
|
|
@@ -726,7 +726,7 @@ function et(t) {
|
|
|
726
726
|
function Gi(t) {
|
|
727
727
|
var e = this, n = t.data, o = Vi(n);
|
|
728
728
|
o.value = n;
|
|
729
|
-
var
|
|
729
|
+
var c = Ie(function() {
|
|
730
730
|
for (var l = e, m = e.__v; m = m.__; ) if (m.__c) {
|
|
731
731
|
m.__c.__$f |= 4;
|
|
732
732
|
break;
|
|
@@ -741,12 +741,12 @@ function Gi(t) {
|
|
|
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
|
+
}), y = e.__$u.d;
|
|
745
745
|
return e.__$u.d = function() {
|
|
746
|
-
d(),
|
|
746
|
+
d(), y.call(this);
|
|
747
747
|
}, [_, p];
|
|
748
|
-
}, []), a =
|
|
749
|
-
return a.value ?
|
|
748
|
+
}, []), a = c[0], u = c[1];
|
|
749
|
+
return a.value ? u.peek() : u.value;
|
|
750
750
|
}
|
|
751
751
|
Gi.displayName = "ReactiveTextNode";
|
|
752
752
|
Object.defineProperties(j.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Gi }, props: { configurable: !0, get: function() {
|
|
@@ -755,9 +755,9 @@ Object.defineProperties(j.prototype, { constructor: { configurable: !0, value: v
|
|
|
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 j && (n || (e.__np = n = {}), n[
|
|
758
|
+
for (var c in o) if (c !== "children") {
|
|
759
|
+
var a = o[c];
|
|
760
|
+
a instanceof j && (n || (e.__np = n = {}), n[c] = a, o[c] = a.peek());
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
763
|
t(e);
|
|
@@ -766,14 +766,14 @@ Te("__r", function(t, e) {
|
|
|
766
766
|
if (e.type !== oe) {
|
|
767
767
|
et();
|
|
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(c, a) {
|
|
770
|
+
var u;
|
|
771
771
|
return $e(function() {
|
|
772
|
-
|
|
773
|
-
}, { name: a }),
|
|
772
|
+
u = this;
|
|
773
|
+
}, { name: a }), u.c = c, u;
|
|
774
774
|
})(function() {
|
|
775
|
-
var
|
|
776
|
-
Tn && ((
|
|
775
|
+
var c;
|
|
776
|
+
Tn && ((c = n.y) == null || c.call(n)), o.__$f |= 1, o.setState({});
|
|
777
777
|
}, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), et(n);
|
|
778
778
|
}
|
|
779
779
|
t(e);
|
|
@@ -785,31 +785,31 @@ Te("diffed", function(t, e) {
|
|
|
785
785
|
et();
|
|
786
786
|
var n;
|
|
787
787
|
if (typeof e.type == "string" && (n = e.__e)) {
|
|
788
|
-
var o = e.__np,
|
|
788
|
+
var o = e.__np, c = 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 u in a) {
|
|
792
|
+
var l = a[u];
|
|
793
|
+
l !== void 0 && !(u in o) && (l.d(), a[u] = void 0);
|
|
794
794
|
}
|
|
795
795
|
else
|
|
796
796
|
a = {}, n.U = a;
|
|
797
797
|
for (var m in o) {
|
|
798
798
|
var p = a[m], _ = o[m];
|
|
799
|
-
p === void 0 ? (p = Rn(n, m, _,
|
|
799
|
+
p === void 0 ? (p = Rn(n, m, _, c), a[m] = p) : p.o(_, c);
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
t(e);
|
|
804
804
|
});
|
|
805
805
|
function Rn(t, e, n, o) {
|
|
806
|
-
var
|
|
807
|
-
return { o: function(
|
|
808
|
-
a.value =
|
|
806
|
+
var c = e in t && t.ownerSVGElement === void 0, a = Y(n);
|
|
807
|
+
return { o: function(u, l) {
|
|
808
|
+
a.value = u, o = l;
|
|
809
809
|
}, d: $e(function() {
|
|
810
810
|
this.N = ji;
|
|
811
|
-
var
|
|
812
|
-
o[e] !==
|
|
811
|
+
var u = a.value.value;
|
|
812
|
+
o[e] !== u && (o[e] = u, c ? t[e] = u : u != null && (u !== !1 || e[4] === "-") ? t.setAttribute(e, u) : t.removeAttribute(e));
|
|
813
813
|
}) };
|
|
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 c in o) {
|
|
823
|
+
var a = o[c];
|
|
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 u = e.__c;
|
|
830
|
+
if (u) {
|
|
831
|
+
var l = u.__$u;
|
|
832
|
+
l && (u.__$u = void 0, l.d());
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
t(e);
|
|
@@ -840,18 +840,18 @@ 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 c 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 u in t) if (u !== "__source" && t[u] !== this.props[u]) return !0;
|
|
849
849
|
for (var l in this.props) if (!(l in t)) return !0;
|
|
850
850
|
return !1;
|
|
851
851
|
};
|
|
852
852
|
function Vi(t, e) {
|
|
853
853
|
return qe(function() {
|
|
854
|
-
return
|
|
854
|
+
return Y(t, e);
|
|
855
855
|
})[0];
|
|
856
856
|
}
|
|
857
857
|
var Nn = function(t) {
|
|
@@ -865,30 +865,16 @@ function xn() {
|
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
867
|
function ji() {
|
|
868
|
-
$i.push(this) === 1 && (
|
|
868
|
+
$i.push(this) === 1 && (k.requestAnimationFrame || Nn)(xn);
|
|
869
869
|
}
|
|
870
870
|
const ri = {
|
|
871
871
|
inline: !1,
|
|
872
872
|
layout: "expanded",
|
|
873
873
|
position: "bottom-right",
|
|
874
|
-
styles: {
|
|
875
|
-
backgroundColor: "#ffffff",
|
|
876
|
-
textColor: "#1f2937"
|
|
877
|
-
},
|
|
878
874
|
showCaptions: !1,
|
|
879
875
|
showTextInput: !1,
|
|
880
876
|
showMuteButton: !0,
|
|
881
|
-
|
|
882
|
-
startExpanded: !1,
|
|
883
|
-
textContents: {
|
|
884
|
-
callToAction: "Talk to our assistant",
|
|
885
|
-
connecting: "Connecting...",
|
|
886
|
-
listening: "Listening...",
|
|
887
|
-
speaking: "Speaking...",
|
|
888
|
-
endCall: "End",
|
|
889
|
-
sendMessage: "Send",
|
|
890
|
-
placeholder: "Type a message..."
|
|
891
|
-
}
|
|
877
|
+
callToAction: "Talk to our assistant"
|
|
892
878
|
}, He = {
|
|
893
879
|
"bottom-right": { bottom: "24px", right: "24px" },
|
|
894
880
|
"bottom-left": { bottom: "24px", left: "24px" },
|
|
@@ -902,94 +888,94 @@ function On(t) {
|
|
|
902
888
|
if (!e) return He["bottom-right"];
|
|
903
889
|
const n = {};
|
|
904
890
|
for (const o of e[1].split(",")) {
|
|
905
|
-
const
|
|
891
|
+
const c = o.trim(), a = c.lastIndexOf("-");
|
|
906
892
|
if (a <= 0) continue;
|
|
907
|
-
const
|
|
908
|
-
n[
|
|
893
|
+
const u = c.slice(0, a), l = c.slice(a + 1);
|
|
894
|
+
n[u] = /^\d+$/.test(l) ? `${l}px` : l;
|
|
909
895
|
}
|
|
910
896
|
return Object.keys(n).length > 0 ? n : He["bottom-right"];
|
|
911
897
|
}
|
|
912
898
|
var ft = {}, Ne = {}, oi;
|
|
913
899
|
function kn() {
|
|
914
900
|
if (oi) return Ne;
|
|
915
|
-
oi = 1, Ne.byteLength = l, Ne.toByteArray = p, Ne.fromByteArray =
|
|
916
|
-
for (var t = [], e = [], n = typeof Uint8Array < "u" ? Uint8Array : Array, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
|
|
917
|
-
t[
|
|
901
|
+
oi = 1, Ne.byteLength = l, Ne.toByteArray = p, Ne.fromByteArray = y;
|
|
902
|
+
for (var t = [], e = [], n = typeof Uint8Array < "u" ? Uint8Array : Array, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = 0, a = o.length; c < a; ++c)
|
|
903
|
+
t[c] = o[c], e[o.charCodeAt(c)] = c;
|
|
918
904
|
e[45] = 62, e[95] = 63;
|
|
919
|
-
function
|
|
920
|
-
var
|
|
921
|
-
if (
|
|
905
|
+
function u(g) {
|
|
906
|
+
var S = g.length;
|
|
907
|
+
if (S % 4 > 0)
|
|
922
908
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
923
|
-
var
|
|
924
|
-
|
|
925
|
-
var A =
|
|
926
|
-
return [
|
|
909
|
+
var C = g.indexOf("=");
|
|
910
|
+
C === -1 && (C = S);
|
|
911
|
+
var A = C === S ? 0 : 4 - C % 4;
|
|
912
|
+
return [C, A];
|
|
927
913
|
}
|
|
928
914
|
function l(g) {
|
|
929
|
-
var
|
|
930
|
-
return (
|
|
915
|
+
var S = u(g), C = S[0], A = S[1];
|
|
916
|
+
return (C + A) * 3 / 4 - A;
|
|
931
917
|
}
|
|
932
|
-
function m(g,
|
|
933
|
-
return (
|
|
918
|
+
function m(g, S, C) {
|
|
919
|
+
return (S + C) * 3 / 4 - C;
|
|
934
920
|
}
|
|
935
921
|
function p(g) {
|
|
936
|
-
var
|
|
937
|
-
for (
|
|
938
|
-
|
|
939
|
-
return
|
|
922
|
+
var S, C = u(g), A = C[0], I = C[1], b = new n(m(g, A, I)), T = 0, D = I > 0 ? A - 4 : A, x;
|
|
923
|
+
for (x = 0; x < D; x += 4)
|
|
924
|
+
S = e[g.charCodeAt(x)] << 18 | e[g.charCodeAt(x + 1)] << 12 | e[g.charCodeAt(x + 2)] << 6 | e[g.charCodeAt(x + 3)], b[T++] = S >> 16 & 255, b[T++] = S >> 8 & 255, b[T++] = S & 255;
|
|
925
|
+
return I === 2 && (S = e[g.charCodeAt(x)] << 2 | e[g.charCodeAt(x + 1)] >> 4, b[T++] = S & 255), I === 1 && (S = e[g.charCodeAt(x)] << 10 | e[g.charCodeAt(x + 1)] << 4 | e[g.charCodeAt(x + 2)] >> 2, b[T++] = S >> 8 & 255, b[T++] = S & 255), b;
|
|
940
926
|
}
|
|
941
927
|
function _(g) {
|
|
942
928
|
return t[g >> 18 & 63] + t[g >> 12 & 63] + t[g >> 6 & 63] + t[g & 63];
|
|
943
929
|
}
|
|
944
|
-
function d(g,
|
|
945
|
-
for (var A,
|
|
946
|
-
A = (g[
|
|
947
|
-
return
|
|
930
|
+
function d(g, S, C) {
|
|
931
|
+
for (var A, I = [], b = S; b < C; b += 3)
|
|
932
|
+
A = (g[b] << 16 & 16711680) + (g[b + 1] << 8 & 65280) + (g[b + 2] & 255), I.push(_(A));
|
|
933
|
+
return I.join("");
|
|
948
934
|
}
|
|
949
|
-
function
|
|
950
|
-
for (var
|
|
951
|
-
|
|
952
|
-
return A === 1 ? (
|
|
953
|
-
t[
|
|
954
|
-
)) : A === 2 && (
|
|
955
|
-
t[
|
|
956
|
-
)),
|
|
935
|
+
function y(g) {
|
|
936
|
+
for (var S, C = g.length, A = C % 3, I = [], b = 16383, T = 0, D = C - A; T < D; T += b)
|
|
937
|
+
I.push(d(g, T, T + b > D ? D : T + b));
|
|
938
|
+
return A === 1 ? (S = g[C - 1], I.push(
|
|
939
|
+
t[S >> 2] + t[S << 4 & 63] + "=="
|
|
940
|
+
)) : A === 2 && (S = (g[C - 2] << 8) + g[C - 1], I.push(
|
|
941
|
+
t[S >> 10] + t[S >> 4 & 63] + t[S << 2 & 63] + "="
|
|
942
|
+
)), I.join("");
|
|
957
943
|
}
|
|
958
944
|
return Ne;
|
|
959
945
|
}
|
|
960
946
|
var We = {};
|
|
961
947
|
var si;
|
|
962
948
|
function Dn() {
|
|
963
|
-
return si || (si = 1, We.read = function(t, e, n, o,
|
|
964
|
-
var a,
|
|
965
|
-
for (d +=
|
|
949
|
+
return si || (si = 1, We.read = function(t, e, n, o, c) {
|
|
950
|
+
var a, u, l = c * 8 - o - 1, m = (1 << l) - 1, p = m >> 1, _ = -7, d = n ? c - 1 : 0, y = n ? -1 : 1, g = t[e + d];
|
|
951
|
+
for (d += y, a = g & (1 << -_) - 1, g >>= -_, _ += l; _ > 0; a = a * 256 + t[e + d], d += y, _ -= 8)
|
|
966
952
|
;
|
|
967
|
-
for (
|
|
953
|
+
for (u = a & (1 << -_) - 1, a >>= -_, _ += o; _ > 0; u = u * 256 + t[e + d], d += y, _ -= 8)
|
|
968
954
|
;
|
|
969
955
|
if (a === 0)
|
|
970
956
|
a = 1 - p;
|
|
971
957
|
else {
|
|
972
958
|
if (a === m)
|
|
973
|
-
return
|
|
974
|
-
|
|
959
|
+
return u ? NaN : (g ? -1 : 1) * (1 / 0);
|
|
960
|
+
u = u + Math.pow(2, o), a = a - p;
|
|
975
961
|
}
|
|
976
|
-
return (g ? -1 : 1) *
|
|
977
|
-
}, We.write = function(t, e, n, o,
|
|
978
|
-
var
|
|
979
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (l = isNaN(e) ? 1 : 0,
|
|
962
|
+
return (g ? -1 : 1) * u * Math.pow(2, a - o);
|
|
963
|
+
}, We.write = function(t, e, n, o, c, a) {
|
|
964
|
+
var u, l, m, p = a * 8 - c - 1, _ = (1 << p) - 1, d = _ >> 1, y = c === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = o ? 0 : a - 1, S = 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, u = _) : (u = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -u)) < 1 && (u--, m *= 2), u + d >= 1 ? e += y / m : e += y * Math.pow(2, 1 - d), e * m >= 2 && (u++, m /= 2), u + d >= _ ? (l = 0, u = _) : u + d >= 1 ? (l = (e * m - 1) * Math.pow(2, c), u = u + d) : (l = e * Math.pow(2, d - 1) * Math.pow(2, c), u = 0)); c >= 8; t[n + g] = l & 255, g += S, l /= 256, c -= 8)
|
|
980
966
|
;
|
|
981
|
-
for (
|
|
967
|
+
for (u = u << c | l, p += c; p > 0; t[n + g] = u & 255, g += S, u /= 256, p -= 8)
|
|
982
968
|
;
|
|
983
|
-
t[n + g -
|
|
969
|
+
t[n + g - S] |= C * 128;
|
|
984
970
|
}), We;
|
|
985
971
|
}
|
|
986
972
|
var ai;
|
|
987
|
-
function
|
|
973
|
+
function Un() {
|
|
988
974
|
return ai || (ai = 1, (function(t) {
|
|
989
975
|
const e = kn(), n = Dn(), o = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
|
|
990
|
-
t.Buffer = l, t.SlowBuffer =
|
|
991
|
-
const
|
|
992
|
-
t.kMaxLength =
|
|
976
|
+
t.Buffer = l, t.SlowBuffer = b, t.INSPECT_MAX_BYTES = 50;
|
|
977
|
+
const c = 2147483647;
|
|
978
|
+
t.kMaxLength = c, l.TYPED_ARRAY_SUPPORT = a(), !l.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
993
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."
|
|
994
980
|
);
|
|
995
981
|
function a() {
|
|
@@ -1015,8 +1001,8 @@ function Mn() {
|
|
|
1015
1001
|
return this.byteOffset;
|
|
1016
1002
|
}
|
|
1017
1003
|
});
|
|
1018
|
-
function
|
|
1019
|
-
if (s >
|
|
1004
|
+
function u(s) {
|
|
1005
|
+
if (s > c)
|
|
1020
1006
|
throw new RangeError('The value "' + s + '" is invalid for option "size"');
|
|
1021
1007
|
const i = new Uint8Array(s);
|
|
1022
1008
|
return Object.setPrototypeOf(i, l.prototype), i;
|
|
@@ -1034,15 +1020,15 @@ function Mn() {
|
|
|
1034
1020
|
l.poolSize = 8192;
|
|
1035
1021
|
function m(s, i, r) {
|
|
1036
1022
|
if (typeof s == "string")
|
|
1037
|
-
return
|
|
1023
|
+
return y(s, i);
|
|
1038
1024
|
if (ArrayBuffer.isView(s))
|
|
1039
|
-
return
|
|
1025
|
+
return S(s);
|
|
1040
1026
|
if (s == null)
|
|
1041
1027
|
throw new TypeError(
|
|
1042
1028
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof s
|
|
1043
1029
|
);
|
|
1044
1030
|
if (ee(s, ArrayBuffer) || s && ee(s.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (ee(s, SharedArrayBuffer) || s && ee(s.buffer, SharedArrayBuffer)))
|
|
1045
|
-
return
|
|
1031
|
+
return C(s, i, r);
|
|
1046
1032
|
if (typeof s == "number")
|
|
1047
1033
|
throw new TypeError(
|
|
1048
1034
|
'The "value" argument must not be of type number. Received type number'
|
|
@@ -1068,41 +1054,41 @@ function Mn() {
|
|
|
1068
1054
|
throw new RangeError('The value "' + s + '" is invalid for option "size"');
|
|
1069
1055
|
}
|
|
1070
1056
|
function _(s, i, r) {
|
|
1071
|
-
return p(s), s <= 0 ?
|
|
1057
|
+
return p(s), s <= 0 ? u(s) : i !== void 0 ? typeof r == "string" ? u(s).fill(i, r) : u(s).fill(i) : u(s);
|
|
1072
1058
|
}
|
|
1073
1059
|
l.alloc = function(s, i, r) {
|
|
1074
1060
|
return _(s, i, r);
|
|
1075
1061
|
};
|
|
1076
1062
|
function d(s) {
|
|
1077
|
-
return p(s),
|
|
1063
|
+
return p(s), u(s < 0 ? 0 : I(s) | 0);
|
|
1078
1064
|
}
|
|
1079
1065
|
l.allocUnsafe = function(s) {
|
|
1080
1066
|
return d(s);
|
|
1081
1067
|
}, l.allocUnsafeSlow = function(s) {
|
|
1082
1068
|
return d(s);
|
|
1083
1069
|
};
|
|
1084
|
-
function
|
|
1070
|
+
function y(s, i) {
|
|
1085
1071
|
if ((typeof i != "string" || i === "") && (i = "utf8"), !l.isEncoding(i))
|
|
1086
1072
|
throw new TypeError("Unknown encoding: " + i);
|
|
1087
|
-
const r =
|
|
1088
|
-
let h =
|
|
1073
|
+
const r = T(s, i) | 0;
|
|
1074
|
+
let h = u(r);
|
|
1089
1075
|
const f = h.write(s, i);
|
|
1090
1076
|
return f !== r && (h = h.slice(0, f)), h;
|
|
1091
1077
|
}
|
|
1092
1078
|
function g(s) {
|
|
1093
|
-
const i = s.length < 0 ? 0 :
|
|
1079
|
+
const i = s.length < 0 ? 0 : I(s.length) | 0, r = u(i);
|
|
1094
1080
|
for (let h = 0; h < i; h += 1)
|
|
1095
1081
|
r[h] = s[h] & 255;
|
|
1096
1082
|
return r;
|
|
1097
1083
|
}
|
|
1098
|
-
function
|
|
1084
|
+
function S(s) {
|
|
1099
1085
|
if (ee(s, Uint8Array)) {
|
|
1100
1086
|
const i = new Uint8Array(s);
|
|
1101
|
-
return
|
|
1087
|
+
return C(i.buffer, i.byteOffset, i.byteLength);
|
|
1102
1088
|
}
|
|
1103
1089
|
return g(s);
|
|
1104
1090
|
}
|
|
1105
|
-
function
|
|
1091
|
+
function C(s, i, r) {
|
|
1106
1092
|
if (i < 0 || s.byteLength < i)
|
|
1107
1093
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
1108
1094
|
if (s.byteLength < i + (r || 0))
|
|
@@ -1112,20 +1098,20 @@ function Mn() {
|
|
|
1112
1098
|
}
|
|
1113
1099
|
function A(s) {
|
|
1114
1100
|
if (l.isBuffer(s)) {
|
|
1115
|
-
const i =
|
|
1101
|
+
const i = I(s.length) | 0, r = u(i);
|
|
1116
1102
|
return r.length === 0 || s.copy(r, 0, 0, i), r;
|
|
1117
1103
|
}
|
|
1118
1104
|
if (s.length !== void 0)
|
|
1119
|
-
return typeof s.length != "number" || ut(s.length) ?
|
|
1105
|
+
return typeof s.length != "number" || ut(s.length) ? u(0) : g(s);
|
|
1120
1106
|
if (s.type === "Buffer" && Array.isArray(s.data))
|
|
1121
1107
|
return g(s.data);
|
|
1122
1108
|
}
|
|
1123
|
-
function
|
|
1124
|
-
if (s >=
|
|
1125
|
-
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" +
|
|
1109
|
+
function I(s) {
|
|
1110
|
+
if (s >= c)
|
|
1111
|
+
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + c.toString(16) + " bytes");
|
|
1126
1112
|
return s | 0;
|
|
1127
1113
|
}
|
|
1128
|
-
function
|
|
1114
|
+
function b(s) {
|
|
1129
1115
|
return +s != s && (s = 0), l.alloc(+s);
|
|
1130
1116
|
}
|
|
1131
1117
|
l.isBuffer = function(i) {
|
|
@@ -1187,7 +1173,7 @@ function Mn() {
|
|
|
1187
1173
|
}
|
|
1188
1174
|
return f;
|
|
1189
1175
|
};
|
|
1190
|
-
function
|
|
1176
|
+
function T(s, i) {
|
|
1191
1177
|
if (l.isBuffer(s))
|
|
1192
1178
|
return s.length;
|
|
1193
1179
|
if (ArrayBuffer.isView(s) || ee(s, ArrayBuffer))
|
|
@@ -1223,8 +1209,8 @@ function Mn() {
|
|
|
1223
1209
|
i = ("" + i).toLowerCase(), f = !0;
|
|
1224
1210
|
}
|
|
1225
1211
|
}
|
|
1226
|
-
l.byteLength =
|
|
1227
|
-
function
|
|
1212
|
+
l.byteLength = T;
|
|
1213
|
+
function D(s, i, r) {
|
|
1228
1214
|
let h = !1;
|
|
1229
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))
|
|
1230
1216
|
return "";
|
|
@@ -1234,7 +1220,7 @@ function Mn() {
|
|
|
1234
1220
|
return Zi(this, i, r);
|
|
1235
1221
|
case "utf8":
|
|
1236
1222
|
case "utf-8":
|
|
1237
|
-
return
|
|
1223
|
+
return Ut(this, i, r);
|
|
1238
1224
|
case "ascii":
|
|
1239
1225
|
return Ji(this, i, r);
|
|
1240
1226
|
case "latin1":
|
|
@@ -1253,7 +1239,7 @@ function Mn() {
|
|
|
1253
1239
|
}
|
|
1254
1240
|
}
|
|
1255
1241
|
l.prototype._isBuffer = !0;
|
|
1256
|
-
function
|
|
1242
|
+
function x(s, i, r) {
|
|
1257
1243
|
const h = s[i];
|
|
1258
1244
|
s[i] = s[r], s[r] = h;
|
|
1259
1245
|
}
|
|
@@ -1262,25 +1248,25 @@ function Mn() {
|
|
|
1262
1248
|
if (i % 2 !== 0)
|
|
1263
1249
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
1264
1250
|
for (let r = 0; r < i; r += 2)
|
|
1265
|
-
|
|
1251
|
+
x(this, r, r + 1);
|
|
1266
1252
|
return this;
|
|
1267
1253
|
}, l.prototype.swap32 = function() {
|
|
1268
1254
|
const i = this.length;
|
|
1269
1255
|
if (i % 4 !== 0)
|
|
1270
1256
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
1271
1257
|
for (let r = 0; r < i; r += 4)
|
|
1272
|
-
|
|
1258
|
+
x(this, r, r + 3), x(this, r + 1, r + 2);
|
|
1273
1259
|
return this;
|
|
1274
1260
|
}, l.prototype.swap64 = function() {
|
|
1275
1261
|
const i = this.length;
|
|
1276
1262
|
if (i % 8 !== 0)
|
|
1277
1263
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
1278
1264
|
for (let r = 0; r < i; r += 8)
|
|
1279
|
-
|
|
1265
|
+
x(this, r, r + 7), x(this, r + 1, r + 6), x(this, r + 2, r + 5), x(this, r + 3, r + 4);
|
|
1280
1266
|
return this;
|
|
1281
1267
|
}, l.prototype.toString = function() {
|
|
1282
1268
|
const i = this.length;
|
|
1283
|
-
return i === 0 ? "" : arguments.length === 0 ?
|
|
1269
|
+
return i === 0 ? "" : arguments.length === 0 ? Ut(this, 0, i) : D.apply(this, arguments);
|
|
1284
1270
|
}, l.prototype.toLocaleString = l.prototype.toString, l.prototype.equals = function(i) {
|
|
1285
1271
|
if (!l.isBuffer(i)) throw new TypeError("Argument must be a Buffer");
|
|
1286
1272
|
return this === i ? !0 : l.compare(this, i) === 0;
|
|
@@ -1303,15 +1289,15 @@ function Mn() {
|
|
|
1303
1289
|
return 1;
|
|
1304
1290
|
if (r >>>= 0, h >>>= 0, f >>>= 0, E >>>= 0, this === i) return 0;
|
|
1305
1291
|
let v = E - f, R = h - r;
|
|
1306
|
-
const B = Math.min(v, R),
|
|
1307
|
-
for (let
|
|
1308
|
-
if (U
|
|
1309
|
-
v = U
|
|
1292
|
+
const B = Math.min(v, R), M = this.slice(f, E), L = i.slice(r, h);
|
|
1293
|
+
for (let U = 0; U < B; ++U)
|
|
1294
|
+
if (M[U] !== L[U]) {
|
|
1295
|
+
v = M[U], R = L[U];
|
|
1310
1296
|
break;
|
|
1311
1297
|
}
|
|
1312
1298
|
return v < R ? -1 : R < v ? 1 : 0;
|
|
1313
1299
|
};
|
|
1314
|
-
function
|
|
1300
|
+
function Z(s, i, r, h, f) {
|
|
1315
1301
|
if (s.length === 0) return -1;
|
|
1316
1302
|
if (typeof r == "string" ? (h = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, ut(r) && (r = f ? 0 : s.length - 1), r < 0 && (r = s.length + r), r >= s.length) {
|
|
1317
1303
|
if (f) return -1;
|
|
@@ -1332,35 +1318,35 @@ function Mn() {
|
|
|
1332
1318
|
return -1;
|
|
1333
1319
|
E = 2, v /= 2, R /= 2, r /= 2;
|
|
1334
1320
|
}
|
|
1335
|
-
function B(L,
|
|
1336
|
-
return E === 1 ? L[
|
|
1321
|
+
function B(L, U) {
|
|
1322
|
+
return E === 1 ? L[U] : L.readUInt16BE(U * E);
|
|
1337
1323
|
}
|
|
1338
|
-
let
|
|
1324
|
+
let M;
|
|
1339
1325
|
if (f) {
|
|
1340
1326
|
let L = -1;
|
|
1341
|
-
for (
|
|
1342
|
-
if (B(s,
|
|
1343
|
-
if (L === -1 && (L =
|
|
1327
|
+
for (M = r; M < v; M++)
|
|
1328
|
+
if (B(s, M) === B(i, L === -1 ? 0 : M - L)) {
|
|
1329
|
+
if (L === -1 && (L = M), M - L + 1 === R) return L * E;
|
|
1344
1330
|
} else
|
|
1345
|
-
L !== -1 && (
|
|
1331
|
+
L !== -1 && (M -= M - L), L = -1;
|
|
1346
1332
|
} else
|
|
1347
|
-
for (r + R > v && (r = v - R),
|
|
1333
|
+
for (r + R > v && (r = v - R), M = r; M >= 0; M--) {
|
|
1348
1334
|
let L = !0;
|
|
1349
|
-
for (let
|
|
1350
|
-
if (B(s,
|
|
1335
|
+
for (let U = 0; U < R; U++)
|
|
1336
|
+
if (B(s, M + U) !== B(i, U)) {
|
|
1351
1337
|
L = !1;
|
|
1352
1338
|
break;
|
|
1353
1339
|
}
|
|
1354
|
-
if (L) return
|
|
1340
|
+
if (L) return M;
|
|
1355
1341
|
}
|
|
1356
1342
|
return -1;
|
|
1357
1343
|
}
|
|
1358
1344
|
l.prototype.includes = function(i, r, h) {
|
|
1359
1345
|
return this.indexOf(i, r, h) !== -1;
|
|
1360
1346
|
}, l.prototype.indexOf = function(i, r, h) {
|
|
1361
|
-
return
|
|
1347
|
+
return Z(this, i, r, h, !0);
|
|
1362
1348
|
}, l.prototype.lastIndexOf = function(i, r, h) {
|
|
1363
|
-
return
|
|
1349
|
+
return Z(this, i, r, h, !1);
|
|
1364
1350
|
};
|
|
1365
1351
|
function ae(s, i, r, h) {
|
|
1366
1352
|
r = Number(r) || 0;
|
|
@@ -1435,7 +1421,7 @@ function Mn() {
|
|
|
1435
1421
|
function Yi(s, i, r) {
|
|
1436
1422
|
return i === 0 && r === s.length ? e.fromByteArray(s) : e.fromByteArray(s.slice(i, r));
|
|
1437
1423
|
}
|
|
1438
|
-
function
|
|
1424
|
+
function Ut(s, i, r) {
|
|
1439
1425
|
r = Math.min(s.length, r);
|
|
1440
1426
|
const h = [];
|
|
1441
1427
|
let f = i;
|
|
@@ -1443,35 +1429,35 @@ function Mn() {
|
|
|
1443
1429
|
const E = s[f];
|
|
1444
1430
|
let v = null, R = E > 239 ? 4 : E > 223 ? 3 : E > 191 ? 2 : 1;
|
|
1445
1431
|
if (f + R <= r) {
|
|
1446
|
-
let B,
|
|
1432
|
+
let B, M, L, U;
|
|
1447
1433
|
switch (R) {
|
|
1448
1434
|
case 1:
|
|
1449
1435
|
E < 128 && (v = E);
|
|
1450
1436
|
break;
|
|
1451
1437
|
case 2:
|
|
1452
|
-
B = s[f + 1], (B & 192) === 128 && (
|
|
1438
|
+
B = s[f + 1], (B & 192) === 128 && (U = (E & 31) << 6 | B & 63, U > 127 && (v = U));
|
|
1453
1439
|
break;
|
|
1454
1440
|
case 3:
|
|
1455
|
-
B = s[f + 1],
|
|
1441
|
+
B = s[f + 1], M = s[f + 2], (B & 192) === 128 && (M & 192) === 128 && (U = (E & 15) << 12 | (B & 63) << 6 | M & 63, U > 2047 && (U < 55296 || U > 57343) && (v = U));
|
|
1456
1442
|
break;
|
|
1457
1443
|
case 4:
|
|
1458
|
-
B = s[f + 1],
|
|
1444
|
+
B = s[f + 1], M = s[f + 2], L = s[f + 3], (B & 192) === 128 && (M & 192) === 128 && (L & 192) === 128 && (U = (E & 15) << 18 | (B & 63) << 12 | (M & 63) << 6 | L & 63, U > 65535 && U < 1114112 && (v = U));
|
|
1459
1445
|
}
|
|
1460
1446
|
}
|
|
1461
1447
|
v === null ? (v = 65533, R = 1) : v > 65535 && (v -= 65536, h.push(v >>> 10 & 1023 | 55296), v = 56320 | v & 1023), h.push(v), f += R;
|
|
1462
1448
|
}
|
|
1463
1449
|
return Ki(h);
|
|
1464
1450
|
}
|
|
1465
|
-
const
|
|
1451
|
+
const Mt = 4096;
|
|
1466
1452
|
function Ki(s) {
|
|
1467
1453
|
const i = s.length;
|
|
1468
|
-
if (i <=
|
|
1454
|
+
if (i <= Mt)
|
|
1469
1455
|
return String.fromCharCode.apply(String, s);
|
|
1470
1456
|
let r = "", h = 0;
|
|
1471
1457
|
for (; h < i; )
|
|
1472
1458
|
r += String.fromCharCode.apply(
|
|
1473
1459
|
String,
|
|
1474
|
-
s.slice(h, h +=
|
|
1460
|
+
s.slice(h, h += Mt)
|
|
1475
1461
|
);
|
|
1476
1462
|
return r;
|
|
1477
1463
|
}
|
|
@@ -1537,13 +1523,13 @@ function Mn() {
|
|
|
1537
1523
|
}, l.prototype.readUint32BE = l.prototype.readUInt32BE = function(i, r) {
|
|
1538
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]);
|
|
1539
1525
|
}, l.prototype.readBigUInt64LE = ce(function(i) {
|
|
1540
|
-
i = i >>> 0,
|
|
1526
|
+
i = i >>> 0, ye(i, "offset");
|
|
1541
1527
|
const r = this[i], h = this[i + 7];
|
|
1542
1528
|
(r === void 0 || h === void 0) && Re(i, this.length - 8);
|
|
1543
1529
|
const f = r + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + this[++i] * 2 ** 24, E = this[++i] + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + h * 2 ** 24;
|
|
1544
1530
|
return BigInt(f) + (BigInt(E) << BigInt(32));
|
|
1545
1531
|
}), l.prototype.readBigUInt64BE = ce(function(i) {
|
|
1546
|
-
i = i >>> 0,
|
|
1532
|
+
i = i >>> 0, ye(i, "offset");
|
|
1547
1533
|
const r = this[i], h = this[i + 7];
|
|
1548
1534
|
(r === void 0 || h === void 0) && Re(i, this.length - 8);
|
|
1549
1535
|
const f = r * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + this[++i], E = this[++i] * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + h;
|
|
@@ -1575,13 +1561,13 @@ function Mn() {
|
|
|
1575
1561
|
}, l.prototype.readInt32BE = function(i, r) {
|
|
1576
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];
|
|
1577
1563
|
}, l.prototype.readBigInt64LE = ce(function(i) {
|
|
1578
|
-
i = i >>> 0,
|
|
1564
|
+
i = i >>> 0, ye(i, "offset");
|
|
1579
1565
|
const r = this[i], h = this[i + 7];
|
|
1580
1566
|
(r === void 0 || h === void 0) && Re(i, this.length - 8);
|
|
1581
1567
|
const f = this[i + 4] + this[i + 5] * 2 ** 8 + this[i + 6] * 2 ** 16 + (h << 24);
|
|
1582
1568
|
return (BigInt(f) << BigInt(32)) + BigInt(r + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + this[++i] * 2 ** 24);
|
|
1583
1569
|
}), l.prototype.readBigInt64BE = ce(function(i) {
|
|
1584
|
-
i = i >>> 0,
|
|
1570
|
+
i = i >>> 0, ye(i, "offset");
|
|
1585
1571
|
const r = this[i], h = this[i + 7];
|
|
1586
1572
|
(r === void 0 || h === void 0) && Re(i, this.length - 8);
|
|
1587
1573
|
const f = (r << 24) + // Overflow
|
|
@@ -1596,7 +1582,7 @@ function Mn() {
|
|
|
1596
1582
|
}, l.prototype.readDoubleBE = function(i, r) {
|
|
1597
1583
|
return i = i >>> 0, r || G(i, 8, this.length), n.read(this, i, !1, 52, 8);
|
|
1598
1584
|
};
|
|
1599
|
-
function
|
|
1585
|
+
function q(s, i, r, h, f, E) {
|
|
1600
1586
|
if (!l.isBuffer(s)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
1601
1587
|
if (i > f || i < E) throw new RangeError('"value" argument is out of bounds');
|
|
1602
1588
|
if (r + h > s.length) throw new RangeError("Index out of range");
|
|
@@ -1604,7 +1590,7 @@ function Mn() {
|
|
|
1604
1590
|
l.prototype.writeUintLE = l.prototype.writeUIntLE = function(i, r, h, f) {
|
|
1605
1591
|
if (i = +i, r = r >>> 0, h = h >>> 0, !f) {
|
|
1606
1592
|
const R = Math.pow(2, 8 * h) - 1;
|
|
1607
|
-
|
|
1593
|
+
q(this, i, r, h, R, 0);
|
|
1608
1594
|
}
|
|
1609
1595
|
let E = 1, v = 0;
|
|
1610
1596
|
for (this[r] = i & 255; ++v < h && (E *= 256); )
|
|
@@ -1613,22 +1599,22 @@ function Mn() {
|
|
|
1613
1599
|
}, l.prototype.writeUintBE = l.prototype.writeUIntBE = function(i, r, h, f) {
|
|
1614
1600
|
if (i = +i, r = r >>> 0, h = h >>> 0, !f) {
|
|
1615
1601
|
const R = Math.pow(2, 8 * h) - 1;
|
|
1616
|
-
|
|
1602
|
+
q(this, i, r, h, R, 0);
|
|
1617
1603
|
}
|
|
1618
1604
|
let E = h - 1, v = 1;
|
|
1619
1605
|
for (this[r + E] = i & 255; --E >= 0 && (v *= 256); )
|
|
1620
1606
|
this[r + E] = i / v & 255;
|
|
1621
1607
|
return r + h;
|
|
1622
1608
|
}, l.prototype.writeUint8 = l.prototype.writeUInt8 = function(i, r, h) {
|
|
1623
|
-
return i = +i, r = r >>> 0, h ||
|
|
1609
|
+
return i = +i, r = r >>> 0, h || q(this, i, r, 1, 255, 0), this[r] = i & 255, r + 1;
|
|
1624
1610
|
}, l.prototype.writeUint16LE = l.prototype.writeUInt16LE = function(i, r, h) {
|
|
1625
|
-
return i = +i, r = r >>> 0, h ||
|
|
1611
|
+
return i = +i, r = r >>> 0, h || q(this, i, r, 2, 65535, 0), this[r] = i & 255, this[r + 1] = i >>> 8, r + 2;
|
|
1626
1612
|
}, l.prototype.writeUint16BE = l.prototype.writeUInt16BE = function(i, r, h) {
|
|
1627
|
-
return i = +i, r = r >>> 0, h ||
|
|
1613
|
+
return i = +i, r = r >>> 0, h || q(this, i, r, 2, 65535, 0), this[r] = i >>> 8, this[r + 1] = i & 255, r + 2;
|
|
1628
1614
|
}, l.prototype.writeUint32LE = l.prototype.writeUInt32LE = function(i, r, h) {
|
|
1629
|
-
return i = +i, r = r >>> 0, h ||
|
|
1615
|
+
return i = +i, r = r >>> 0, h || q(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;
|
|
1630
1616
|
}, l.prototype.writeUint32BE = l.prototype.writeUInt32BE = function(i, r, h) {
|
|
1631
|
-
return i = +i, r = r >>> 0, h ||
|
|
1617
|
+
return i = +i, r = r >>> 0, h || q(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;
|
|
1632
1618
|
};
|
|
1633
1619
|
function Bt(s, i, r, h, f) {
|
|
1634
1620
|
Vt(i, h, f, s, r, 7);
|
|
@@ -1651,7 +1637,7 @@ function Mn() {
|
|
|
1651
1637
|
}), l.prototype.writeIntLE = function(i, r, h, f) {
|
|
1652
1638
|
if (i = +i, r = r >>> 0, !f) {
|
|
1653
1639
|
const B = Math.pow(2, 8 * h - 1);
|
|
1654
|
-
|
|
1640
|
+
q(this, i, r, h, B - 1, -B);
|
|
1655
1641
|
}
|
|
1656
1642
|
let E = 0, v = 1, R = 0;
|
|
1657
1643
|
for (this[r] = i & 255; ++E < h && (v *= 256); )
|
|
@@ -1660,22 +1646,22 @@ function Mn() {
|
|
|
1660
1646
|
}, l.prototype.writeIntBE = function(i, r, h, f) {
|
|
1661
1647
|
if (i = +i, r = r >>> 0, !f) {
|
|
1662
1648
|
const B = Math.pow(2, 8 * h - 1);
|
|
1663
|
-
|
|
1649
|
+
q(this, i, r, h, B - 1, -B);
|
|
1664
1650
|
}
|
|
1665
1651
|
let E = h - 1, v = 1, R = 0;
|
|
1666
1652
|
for (this[r + E] = i & 255; --E >= 0 && (v *= 256); )
|
|
1667
1653
|
i < 0 && R === 0 && this[r + E + 1] !== 0 && (R = 1), this[r + E] = (i / v >> 0) - R & 255;
|
|
1668
1654
|
return r + h;
|
|
1669
1655
|
}, l.prototype.writeInt8 = function(i, r, h) {
|
|
1670
|
-
return i = +i, r = r >>> 0, h ||
|
|
1656
|
+
return i = +i, r = r >>> 0, h || q(this, i, r, 1, 127, -128), i < 0 && (i = 255 + i + 1), this[r] = i & 255, r + 1;
|
|
1671
1657
|
}, l.prototype.writeInt16LE = function(i, r, h) {
|
|
1672
|
-
return i = +i, r = r >>> 0, h ||
|
|
1658
|
+
return i = +i, r = r >>> 0, h || q(this, i, r, 2, 32767, -32768), this[r] = i & 255, this[r + 1] = i >>> 8, r + 2;
|
|
1673
1659
|
}, l.prototype.writeInt16BE = function(i, r, h) {
|
|
1674
|
-
return i = +i, r = r >>> 0, h ||
|
|
1660
|
+
return i = +i, r = r >>> 0, h || q(this, i, r, 2, 32767, -32768), this[r] = i >>> 8, this[r + 1] = i & 255, r + 2;
|
|
1675
1661
|
}, l.prototype.writeInt32LE = function(i, r, h) {
|
|
1676
|
-
return i = +i, r = r >>> 0, h ||
|
|
1662
|
+
return i = +i, r = r >>> 0, h || q(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;
|
|
1677
1663
|
}, l.prototype.writeInt32BE = function(i, r, h) {
|
|
1678
|
-
return i = +i, r = r >>> 0, h ||
|
|
1664
|
+
return i = +i, r = r >>> 0, h || q(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;
|
|
1679
1665
|
}, l.prototype.writeBigInt64LE = ce(function(i, r = 0) {
|
|
1680
1666
|
return Bt(this, i, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1681
1667
|
}), l.prototype.writeBigInt64BE = ce(function(i, r = 0) {
|
|
@@ -1743,9 +1729,9 @@ function Mn() {
|
|
|
1743
1729
|
}
|
|
1744
1730
|
return this;
|
|
1745
1731
|
};
|
|
1746
|
-
const
|
|
1732
|
+
const ve = {};
|
|
1747
1733
|
function lt(s, i, r) {
|
|
1748
|
-
|
|
1734
|
+
ve[s] = class extends r {
|
|
1749
1735
|
constructor() {
|
|
1750
1736
|
super(), Object.defineProperty(this, "message", {
|
|
1751
1737
|
value: i.apply(this, arguments),
|
|
@@ -1797,22 +1783,22 @@ function Mn() {
|
|
|
1797
1783
|
return `${s.slice(0, r)}${i}`;
|
|
1798
1784
|
}
|
|
1799
1785
|
function en(s, i, r) {
|
|
1800
|
-
|
|
1786
|
+
ye(i, "offset"), (s[i] === void 0 || s[i + r] === void 0) && Re(i, s.length - (r + 1));
|
|
1801
1787
|
}
|
|
1802
1788
|
function Vt(s, i, r, h, f, E) {
|
|
1803
1789
|
if (s > r || s < i) {
|
|
1804
1790
|
const v = typeof i == "bigint" ? "n" : "";
|
|
1805
1791
|
let R;
|
|
1806
|
-
throw i === 0 || i === BigInt(0) ? R = `>= 0${v} and < 2${v} ** ${(E + 1) * 8}${v}` : R = `>= -(2${v} ** ${(E + 1) * 8 - 1}${v}) and < 2 ** ${(E + 1) * 8 - 1}${v}`, new
|
|
1792
|
+
throw i === 0 || i === BigInt(0) ? R = `>= 0${v} and < 2${v} ** ${(E + 1) * 8}${v}` : R = `>= -(2${v} ** ${(E + 1) * 8 - 1}${v}) and < 2 ** ${(E + 1) * 8 - 1}${v}`, new ve.ERR_OUT_OF_RANGE("value", R, s);
|
|
1807
1793
|
}
|
|
1808
1794
|
en(h, f, E);
|
|
1809
1795
|
}
|
|
1810
|
-
function
|
|
1796
|
+
function ye(s, i) {
|
|
1811
1797
|
if (typeof s != "number")
|
|
1812
|
-
throw new
|
|
1798
|
+
throw new ve.ERR_INVALID_ARG_TYPE(i, "number", s);
|
|
1813
1799
|
}
|
|
1814
1800
|
function Re(s, i, r) {
|
|
1815
|
-
throw Math.floor(s) !== s ? (
|
|
1801
|
+
throw Math.floor(s) !== s ? (ye(s, r), new ve.ERR_OUT_OF_RANGE("offset", "an integer", s)) : i < 0 ? new ve.ERR_BUFFER_OUT_OF_BOUNDS() : new ve.ERR_OUT_OF_RANGE(
|
|
1816
1802
|
"offset",
|
|
1817
1803
|
`>= 0 and <= ${i}`,
|
|
1818
1804
|
s
|
|
@@ -1924,34 +1910,34 @@ function Mn() {
|
|
|
1924
1910
|
}
|
|
1925
1911
|
})(ft)), ft;
|
|
1926
1912
|
}
|
|
1927
|
-
var
|
|
1913
|
+
var Mn = Un();
|
|
1928
1914
|
const Bn = "https://api.anam.ai", Ln = "/v1", Hi = {
|
|
1929
1915
|
client: "js-sdk",
|
|
1930
1916
|
version: "4.8.0"
|
|
1931
1917
|
};
|
|
1932
1918
|
var Pn = function(t, e, n, o) {
|
|
1933
|
-
function
|
|
1934
|
-
return a instanceof n ? a : new n(function(
|
|
1935
|
-
|
|
1919
|
+
function c(a) {
|
|
1920
|
+
return a instanceof n ? a : new n(function(u) {
|
|
1921
|
+
u(a);
|
|
1936
1922
|
});
|
|
1937
1923
|
}
|
|
1938
|
-
return new (n || (n = Promise))(function(a,
|
|
1924
|
+
return new (n || (n = Promise))(function(a, u) {
|
|
1939
1925
|
function l(_) {
|
|
1940
1926
|
try {
|
|
1941
1927
|
p(o.next(_));
|
|
1942
1928
|
} catch (d) {
|
|
1943
|
-
|
|
1929
|
+
u(d);
|
|
1944
1930
|
}
|
|
1945
1931
|
}
|
|
1946
1932
|
function m(_) {
|
|
1947
1933
|
try {
|
|
1948
1934
|
p(o.throw(_));
|
|
1949
1935
|
} catch (d) {
|
|
1950
|
-
|
|
1936
|
+
u(d);
|
|
1951
1937
|
}
|
|
1952
1938
|
}
|
|
1953
1939
|
function p(_) {
|
|
1954
|
-
_.done ? a(_.value) :
|
|
1940
|
+
_.done ? a(_.value) : c(_.value).then(l, m);
|
|
1955
1941
|
}
|
|
1956
1942
|
p((o = o.apply(t, e || [])).next());
|
|
1957
1943
|
});
|
|
@@ -1974,20 +1960,20 @@ let he = {
|
|
|
1974
1960
|
organizationId: null,
|
|
1975
1961
|
attemptCorrelationId: null
|
|
1976
1962
|
};
|
|
1977
|
-
const
|
|
1963
|
+
const Se = (t) => {
|
|
1978
1964
|
he = Object.assign(Object.assign({}, he), t);
|
|
1979
|
-
},
|
|
1965
|
+
}, me = (t, e, n) => Pn(void 0, void 0, void 0, function* () {
|
|
1980
1966
|
if (!qi)
|
|
1981
1967
|
try {
|
|
1982
1968
|
const o = Object.assign(Object.assign({}, Hi), n);
|
|
1983
1969
|
he.sessionId && (o.sessionId = he.sessionId), he.organizationId && (o.organizationId = he.organizationId), he.attemptCorrelationId && (o.attemptCorrelationId = he.attemptCorrelationId);
|
|
1984
|
-
const
|
|
1985
|
-
let a,
|
|
1970
|
+
const c = `${zi}/metrics/client`;
|
|
1971
|
+
let a, u = {
|
|
1986
1972
|
"Content-Type": "application/json"
|
|
1987
1973
|
};
|
|
1988
|
-
de?.enabled && de?.baseUrl ? (a = `${de.baseUrl}${
|
|
1974
|
+
de?.enabled && de?.baseUrl ? (a = `${de.baseUrl}${c}`, u["X-Anam-Target-Url"] = `${St}${c}`) : a = `${St}${c}`, yield fetch(a, {
|
|
1989
1975
|
method: "POST",
|
|
1990
|
-
headers:
|
|
1976
|
+
headers: u,
|
|
1991
1977
|
body: JSON.stringify({
|
|
1992
1978
|
name: t,
|
|
1993
1979
|
value: e,
|
|
@@ -1998,93 +1984,93 @@ const we = (t) => {
|
|
|
1998
1984
|
console.error("Failed to send error metric:", o);
|
|
1999
1985
|
}
|
|
2000
1986
|
}), Vn = (t, e = "console") => {
|
|
2001
|
-
var n, o,
|
|
1987
|
+
var n, o, c;
|
|
2002
1988
|
const a = {};
|
|
2003
1989
|
t.forEach((d) => {
|
|
2004
1990
|
a[d.type] || (a[d.type] = []), a[d.type].push(d);
|
|
2005
1991
|
});
|
|
2006
|
-
const
|
|
1992
|
+
const u = {
|
|
2007
1993
|
issues: []
|
|
2008
1994
|
}, l = ((n = a["inbound-rtp"]) === null || n === void 0 ? void 0 : n.filter((d) => d.kind === "video")) || [];
|
|
2009
|
-
l.length > 0 && (
|
|
2010
|
-
var
|
|
2011
|
-
const
|
|
2012
|
-
framesReceived: (
|
|
1995
|
+
l.length > 0 && (u.personaVideoStream = [], l.forEach((d) => {
|
|
1996
|
+
var y, g, S, C, A;
|
|
1997
|
+
const I = {
|
|
1998
|
+
framesReceived: (y = d.framesReceived) !== null && y !== void 0 ? y : "unknown",
|
|
2013
1999
|
framesDropped: (g = d.framesDropped) !== null && g !== void 0 ? g : "unknown",
|
|
2014
|
-
framesPerSecond: (
|
|
2015
|
-
packetsReceived: (
|
|
2000
|
+
framesPerSecond: (S = d.framesPerSecond) !== null && S !== void 0 ? S : "unknown",
|
|
2001
|
+
packetsReceived: (C = d.packetsReceived) !== null && C !== void 0 ? C : "unknown",
|
|
2016
2002
|
packetsLost: (A = d.packetsLost) !== null && A !== void 0 ? A : "unknown",
|
|
2017
2003
|
resolution: d.frameWidth && d.frameHeight ? `${d.frameWidth}x${d.frameHeight}` : void 0,
|
|
2018
2004
|
jitter: d.jitter !== void 0 ? d.jitter : void 0
|
|
2019
2005
|
};
|
|
2020
|
-
|
|
2006
|
+
u.personaVideoStream.push(I);
|
|
2021
2007
|
}));
|
|
2022
2008
|
const m = ((o = a["inbound-rtp"]) === null || o === void 0 ? void 0 : o.filter((d) => d.kind === "audio")) || [];
|
|
2023
|
-
m.length > 0 && (
|
|
2024
|
-
var
|
|
2025
|
-
const
|
|
2026
|
-
packetsReceived: (
|
|
2009
|
+
m.length > 0 && (u.personaAudioStream = [], m.forEach((d) => {
|
|
2010
|
+
var y, g, S;
|
|
2011
|
+
const C = {
|
|
2012
|
+
packetsReceived: (y = d.packetsReceived) !== null && y !== void 0 ? y : "unknown",
|
|
2027
2013
|
packetsLost: (g = d.packetsLost) !== null && g !== void 0 ? g : "unknown",
|
|
2028
|
-
audioLevel: (
|
|
2014
|
+
audioLevel: (S = d.audioLevel) !== null && S !== void 0 ? S : "unknown",
|
|
2029
2015
|
jitter: d.jitter !== void 0 ? d.jitter : void 0,
|
|
2030
2016
|
totalAudioEnergy: d.totalAudioEnergy !== void 0 ? d.totalAudioEnergy : void 0
|
|
2031
2017
|
};
|
|
2032
|
-
|
|
2018
|
+
u.personaAudioStream.push(C);
|
|
2033
2019
|
}));
|
|
2034
|
-
const p = ((
|
|
2035
|
-
p.length > 0 && (
|
|
2036
|
-
var
|
|
2037
|
-
const
|
|
2038
|
-
packetsSent: (
|
|
2020
|
+
const p = ((c = a["outbound-rtp"]) === null || c === void 0 ? void 0 : c.filter((d) => d.kind === "audio")) || [];
|
|
2021
|
+
p.length > 0 && (u.userAudioInput = [], p.forEach((d) => {
|
|
2022
|
+
var y, g;
|
|
2023
|
+
const S = {
|
|
2024
|
+
packetsSent: (y = d.packetsSent) !== null && y !== void 0 ? y : "unknown",
|
|
2039
2025
|
retransmittedPackets: (g = d.retransmittedPacketsSent) !== null && g !== void 0 ? g : void 0,
|
|
2040
2026
|
avgPacketSendDelay: d.totalPacketSendDelay !== void 0 ? d.totalPacketSendDelay / (d.packetsSent || 1) * 1e3 : void 0
|
|
2041
2027
|
};
|
|
2042
|
-
|
|
2043
|
-
})), a.codec && (
|
|
2044
|
-
const
|
|
2028
|
+
u.userAudioInput.push(S);
|
|
2029
|
+
})), a.codec && (u.codecs = [], a.codec.forEach((d) => {
|
|
2030
|
+
const y = {
|
|
2045
2031
|
status: d.payloadType ? "Active" : "Available",
|
|
2046
2032
|
mimeType: d.mimeType || "Unknown",
|
|
2047
2033
|
payloadType: d.payloadType || "N/A",
|
|
2048
2034
|
clockRate: d.clockRate || void 0,
|
|
2049
2035
|
channels: d.channels || void 0
|
|
2050
2036
|
};
|
|
2051
|
-
|
|
2052
|
-
})), a.transport && (
|
|
2053
|
-
const
|
|
2037
|
+
u.codecs.push(y);
|
|
2038
|
+
})), a.transport && (u.transportLayer = [], a.transport.forEach((d) => {
|
|
2039
|
+
const y = {
|
|
2054
2040
|
dtlsState: d.dtlsState || "unknown",
|
|
2055
2041
|
iceState: d.iceState || "unknown",
|
|
2056
2042
|
bytesSent: d.bytesSent || void 0,
|
|
2057
2043
|
bytesReceived: d.bytesReceived || void 0
|
|
2058
2044
|
};
|
|
2059
|
-
|
|
2045
|
+
u.transportLayer.push(y);
|
|
2060
2046
|
}));
|
|
2061
2047
|
const _ = [];
|
|
2062
2048
|
if (l.forEach((d) => {
|
|
2063
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)`);
|
|
2064
2050
|
}), m.forEach((d) => {
|
|
2065
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)`);
|
|
2066
|
-
}),
|
|
2067
|
-
return
|
|
2068
|
-
console.group("📊 WebRTC Session Statistics Report"),
|
|
2052
|
+
}), u.issues = _, e === "json")
|
|
2053
|
+
return u;
|
|
2054
|
+
console.group("📊 WebRTC Session Statistics Report"), u.personaVideoStream && u.personaVideoStream.length > 0 && (console.group("📹 Persona Video Stream (Inbound)"), u.personaVideoStream.forEach((d) => {
|
|
2069
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`);
|
|
2070
|
-
}), console.groupEnd()),
|
|
2056
|
+
}), console.groupEnd()), u.personaAudioStream && u.personaAudioStream.length > 0 && (console.group("🔊 Persona Audio Stream (Inbound)"), u.personaAudioStream.forEach((d) => {
|
|
2071
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)}`);
|
|
2072
|
-
}), console.groupEnd()),
|
|
2058
|
+
}), console.groupEnd()), u.userAudioInput && u.userAudioInput.length > 0 && (console.group("🎤 User Audio Input (Outbound)"), u.userAudioInput.forEach((d) => {
|
|
2073
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`);
|
|
2074
|
-
}), console.groupEnd()),
|
|
2060
|
+
}), console.groupEnd()), u.codecs && u.codecs.length > 0 && (console.group("🔧 Codecs Used"), u.codecs.forEach((d) => {
|
|
2075
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}`);
|
|
2076
|
-
}), console.groupEnd()),
|
|
2062
|
+
}), console.groupEnd()), u.transportLayer && u.transportLayer.length > 0 && (console.group("🚚 Transport Layer"), u.transportLayer.forEach((d) => {
|
|
2077
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()}`);
|
|
2078
|
-
}), console.groupEnd()),
|
|
2064
|
+
}), console.groupEnd()), u.issues.length > 0 ? (console.group("⚠️ Potential Issues Detected"), u.issues.forEach((d) => console.warn(d)), console.groupEnd()) : console.log("✅ No significant issues detected"), console.groupEnd();
|
|
2079
2065
|
};
|
|
2080
2066
|
var V;
|
|
2081
2067
|
(function(t) {
|
|
2082
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";
|
|
2083
2069
|
})(V || (V = {}));
|
|
2084
2070
|
class $ extends Error {
|
|
2085
|
-
constructor(e, n, o = 500,
|
|
2086
|
-
super(e), this.name = "ClientError", this.code = n, this.statusCode = o, this.details =
|
|
2087
|
-
details:
|
|
2071
|
+
constructor(e, n, o = 500, c) {
|
|
2072
|
+
super(e), this.name = "ClientError", this.code = n, this.statusCode = o, this.details = c, Object.setPrototypeOf(this, $.prototype), me(se.CLIENT_METRIC_MEASUREMENT_ERROR, n, {
|
|
2073
|
+
details: c,
|
|
2088
2074
|
statusCode: o
|
|
2089
2075
|
});
|
|
2090
2076
|
}
|
|
@@ -2127,10 +2113,10 @@ var N;
|
|
|
2127
2113
|
(function(t) {
|
|
2128
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";
|
|
2129
2115
|
})(N || (N = {}));
|
|
2130
|
-
var
|
|
2116
|
+
var J;
|
|
2131
2117
|
(function(t) {
|
|
2132
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";
|
|
2133
|
-
})(
|
|
2119
|
+
})(J || (J = {}));
|
|
2134
2120
|
var _e;
|
|
2135
2121
|
(function(t) {
|
|
2136
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";
|
|
@@ -2173,55 +2159,55 @@ class Hn {
|
|
|
2173
2159
|
return this.config;
|
|
2174
2160
|
}
|
|
2175
2161
|
arrayBufferToBase64(e) {
|
|
2176
|
-
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, (c) => String.fromCharCode(c)).join("");
|
|
2177
2163
|
return btoa(o);
|
|
2178
2164
|
}
|
|
2179
2165
|
}
|
|
2180
|
-
var
|
|
2181
|
-
function
|
|
2182
|
-
return a instanceof n ? a : new n(function(
|
|
2183
|
-
|
|
2166
|
+
var we = function(t, e, n, o) {
|
|
2167
|
+
function c(a) {
|
|
2168
|
+
return a instanceof n ? a : new n(function(u) {
|
|
2169
|
+
u(a);
|
|
2184
2170
|
});
|
|
2185
2171
|
}
|
|
2186
|
-
return new (n || (n = Promise))(function(a,
|
|
2172
|
+
return new (n || (n = Promise))(function(a, u) {
|
|
2187
2173
|
function l(_) {
|
|
2188
2174
|
try {
|
|
2189
2175
|
p(o.next(_));
|
|
2190
2176
|
} catch (d) {
|
|
2191
|
-
|
|
2177
|
+
u(d);
|
|
2192
2178
|
}
|
|
2193
2179
|
}
|
|
2194
2180
|
function m(_) {
|
|
2195
2181
|
try {
|
|
2196
2182
|
p(o.throw(_));
|
|
2197
2183
|
} catch (d) {
|
|
2198
|
-
|
|
2184
|
+
u(d);
|
|
2199
2185
|
}
|
|
2200
2186
|
}
|
|
2201
2187
|
function p(_) {
|
|
2202
|
-
_.done ? a(_.value) :
|
|
2188
|
+
_.done ? a(_.value) : c(_.value).then(l, m);
|
|
2203
2189
|
}
|
|
2204
2190
|
p((o = o.apply(t, e || [])).next());
|
|
2205
2191
|
});
|
|
2206
2192
|
};
|
|
2207
2193
|
const Wn = 5, zn = 5;
|
|
2208
2194
|
class qn {
|
|
2209
|
-
constructor(e, n, o,
|
|
2210
|
-
var
|
|
2211
|
-
if (this.stopSignal = !1, this.sendingBuffer = [], this.wsConnectionAttempts = 0, this.socket = null, this.heartBeatIntervalRef = null, this.publicEventEmitter = o, this.internalEventEmitter =
|
|
2195
|
+
constructor(e, n, o, c, a) {
|
|
2196
|
+
var u, l, m, p, _;
|
|
2197
|
+
if (this.stopSignal = !1, this.sendingBuffer = [], this.wsConnectionAttempts = 0, this.socket = null, this.heartBeatIntervalRef = null, this.publicEventEmitter = o, this.internalEventEmitter = c, this.apiGatewayConfig = a, !e)
|
|
2212
2198
|
throw new Error("Signalling Client: sessionId is required");
|
|
2213
2199
|
this.sessionId = e;
|
|
2214
|
-
const { heartbeatIntervalSeconds: d, maxWsReconnectionAttempts:
|
|
2215
|
-
if (this.heartbeatIntervalSeconds = d || Wn, this.maxWsReconnectionAttempts =
|
|
2200
|
+
const { heartbeatIntervalSeconds: d, maxWsReconnectionAttempts: y, url: g } = n;
|
|
2201
|
+
if (this.heartbeatIntervalSeconds = d || Wn, this.maxWsReconnectionAttempts = y || zn, !g.baseUrl)
|
|
2216
2202
|
throw new Error("Signalling Client: baseUrl is required");
|
|
2217
|
-
if (!((
|
|
2218
|
-
const
|
|
2219
|
-
|
|
2220
|
-
const A = g.protocol || "https",
|
|
2221
|
-
|
|
2203
|
+
if (!((u = this.apiGatewayConfig) === null || u === void 0) && u.enabled && (!((l = this.apiGatewayConfig) === null || l === void 0) && l.baseUrl)) {
|
|
2204
|
+
const S = new URL(this.apiGatewayConfig.baseUrl), C = (m = this.apiGatewayConfig.wsPath) !== null && m !== void 0 ? m : "/ws";
|
|
2205
|
+
S.protocol = S.protocol.replace("http", "ws"), S.pathname = C, this.url = S;
|
|
2206
|
+
const A = g.protocol || "https", I = A === "http" ? "ws" : "wss", b = `${A}://${g.baseUrl}`, T = (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 = T, D.searchParams.append("session_id", e), this.url.searchParams.append("target_url", D.href);
|
|
2222
2208
|
} else {
|
|
2223
|
-
const
|
|
2224
|
-
this.url = new URL(
|
|
2209
|
+
const C = `${g.protocol || "https"}://${g.baseUrl}`;
|
|
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);
|
|
2225
2211
|
}
|
|
2226
2212
|
}
|
|
2227
2213
|
stop() {
|
|
@@ -2231,7 +2217,7 @@ class qn {
|
|
|
2231
2217
|
return this.socket = new WebSocket(this.url.href), this.socket.onopen = this.onOpen.bind(this), this.socket.onclose = this.onClose.bind(this), this.socket.onerror = this.onError.bind(this), this.socket;
|
|
2232
2218
|
}
|
|
2233
2219
|
sendOffer(e) {
|
|
2234
|
-
return
|
|
2220
|
+
return we(this, void 0, void 0, function* () {
|
|
2235
2221
|
const n = {
|
|
2236
2222
|
connectionDescription: e,
|
|
2237
2223
|
userUid: this.sessionId
|
|
@@ -2245,7 +2231,7 @@ class qn {
|
|
|
2245
2231
|
});
|
|
2246
2232
|
}
|
|
2247
2233
|
sendIceCandidate(e) {
|
|
2248
|
-
return
|
|
2234
|
+
return we(this, void 0, void 0, function* () {
|
|
2249
2235
|
const n = {
|
|
2250
2236
|
actionType: W.ICE_CANDIDATE,
|
|
2251
2237
|
sessionId: this.sessionId,
|
|
@@ -2266,7 +2252,7 @@ class qn {
|
|
|
2266
2252
|
this.sendingBuffer.push(e);
|
|
2267
2253
|
}
|
|
2268
2254
|
sendTalkMessage(e) {
|
|
2269
|
-
return
|
|
2255
|
+
return we(this, void 0, void 0, function* () {
|
|
2270
2256
|
const n = {
|
|
2271
2257
|
actionType: W.TALK_STREAM_INPUT,
|
|
2272
2258
|
sessionId: this.sessionId,
|
|
@@ -2295,18 +2281,18 @@ class qn {
|
|
|
2295
2281
|
this.socket && (this.socket.close(), this.socket = null), this.heartBeatIntervalRef && (clearInterval(this.heartBeatIntervalRef), this.heartBeatIntervalRef = null);
|
|
2296
2282
|
}
|
|
2297
2283
|
onOpen() {
|
|
2298
|
-
return
|
|
2284
|
+
return we(this, void 0, void 0, function* () {
|
|
2299
2285
|
if (!this.socket)
|
|
2300
2286
|
throw new Error("SignallingClient - onOpen: socket is null");
|
|
2301
2287
|
try {
|
|
2302
|
-
this.wsConnectionAttempts = 0, this.flushSendingBuffer(), this.socket.onmessage = this.onMessage.bind(this), this.startSendingHeartBeats(), this.internalEventEmitter.emit(
|
|
2288
|
+
this.wsConnectionAttempts = 0, this.flushSendingBuffer(), this.socket.onmessage = this.onMessage.bind(this), this.startSendingHeartBeats(), this.internalEventEmitter.emit(J.WEB_SOCKET_OPEN);
|
|
2303
2289
|
} catch (e) {
|
|
2304
2290
|
console.error("SignallingClient - onOpen: error in onOpen", e), this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.SIGNALLING_CLIENT_CONNECTION_FAILURE);
|
|
2305
2291
|
}
|
|
2306
2292
|
});
|
|
2307
2293
|
}
|
|
2308
2294
|
onClose() {
|
|
2309
|
-
return
|
|
2295
|
+
return we(this, void 0, void 0, function* () {
|
|
2310
2296
|
this.wsConnectionAttempts += 1, !this.stopSignal && (this.wsConnectionAttempts <= this.maxWsReconnectionAttempts ? (this.socket = null, setTimeout(() => {
|
|
2311
2297
|
this.connect();
|
|
2312
2298
|
}, 100 * this.wsConnectionAttempts)) : (this.heartBeatIntervalRef && (clearInterval(this.heartBeatIntervalRef), this.heartBeatIntervalRef = null), this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.SIGNALLING_CLIENT_CONNECTION_FAILURE)));
|
|
@@ -2323,9 +2309,9 @@ class qn {
|
|
|
2323
2309
|
}), this.sendingBuffer = e;
|
|
2324
2310
|
}
|
|
2325
2311
|
onMessage(e) {
|
|
2326
|
-
return
|
|
2312
|
+
return we(this, void 0, void 0, function* () {
|
|
2327
2313
|
const n = JSON.parse(e.data);
|
|
2328
|
-
this.internalEventEmitter.emit(
|
|
2314
|
+
this.internalEventEmitter.emit(J.SIGNAL_MESSAGE_RECEIVED, n);
|
|
2329
2315
|
});
|
|
2330
2316
|
}
|
|
2331
2317
|
startSendingHeartBeats() {
|
|
@@ -2338,8 +2324,8 @@ class qn {
|
|
|
2338
2324
|
payload: ""
|
|
2339
2325
|
}, o = JSON.stringify(n);
|
|
2340
2326
|
this.heartBeatIntervalRef = setInterval(() => {
|
|
2341
|
-
var
|
|
2342
|
-
this.stopSignal || ((
|
|
2327
|
+
var c;
|
|
2328
|
+
this.stopSignal || ((c = this.socket) === null || c === void 0 ? void 0 : c.readyState) === WebSocket.OPEN && this.socket.send(o);
|
|
2343
2329
|
}, e);
|
|
2344
2330
|
}
|
|
2345
2331
|
}
|
|
@@ -2347,28 +2333,28 @@ function Yn(t) {
|
|
|
2347
2333
|
return "brainType" in t || "llmId" in t;
|
|
2348
2334
|
}
|
|
2349
2335
|
var ci = function(t, e, n, o) {
|
|
2350
|
-
function
|
|
2351
|
-
return a instanceof n ? a : new n(function(
|
|
2352
|
-
|
|
2336
|
+
function c(a) {
|
|
2337
|
+
return a instanceof n ? a : new n(function(u) {
|
|
2338
|
+
u(a);
|
|
2353
2339
|
});
|
|
2354
2340
|
}
|
|
2355
|
-
return new (n || (n = Promise))(function(a,
|
|
2341
|
+
return new (n || (n = Promise))(function(a, u) {
|
|
2356
2342
|
function l(_) {
|
|
2357
2343
|
try {
|
|
2358
2344
|
p(o.next(_));
|
|
2359
2345
|
} catch (d) {
|
|
2360
|
-
|
|
2346
|
+
u(d);
|
|
2361
2347
|
}
|
|
2362
2348
|
}
|
|
2363
2349
|
function m(_) {
|
|
2364
2350
|
try {
|
|
2365
2351
|
p(o.throw(_));
|
|
2366
2352
|
} catch (d) {
|
|
2367
|
-
|
|
2353
|
+
u(d);
|
|
2368
2354
|
}
|
|
2369
2355
|
}
|
|
2370
2356
|
function p(_) {
|
|
2371
|
-
_.done ? a(_.value) :
|
|
2357
|
+
_.done ? a(_.value) : c(_.value).then(l, m);
|
|
2372
2358
|
}
|
|
2373
2359
|
p((o = o.apply(t, e || [])).next());
|
|
2374
2360
|
});
|
|
@@ -2383,9 +2369,9 @@ class Kn {
|
|
|
2383
2369
|
* Builds URL and headers for a request, applying API Gateway configuration if enabled
|
|
2384
2370
|
*/
|
|
2385
2371
|
buildGatewayUrlAndHeaders(e, n) {
|
|
2386
|
-
var o,
|
|
2387
|
-
if (!((o = this.apiGatewayConfig) === null || o === void 0) && o.enabled && (!((
|
|
2388
|
-
const a = `${this.apiGatewayConfig.baseUrl}${e}`,
|
|
2372
|
+
var o, c;
|
|
2373
|
+
if (!((o = this.apiGatewayConfig) === null || o === void 0) && o.enabled && (!((c = this.apiGatewayConfig) === null || c === void 0) && c.baseUrl)) {
|
|
2374
|
+
const a = `${this.apiGatewayConfig.baseUrl}${e}`, u = new URL(`${this.baseUrl}${e}`), l = Object.assign(Object.assign({}, n), { "X-Anam-Target-Url": u.href });
|
|
2389
2375
|
return { url: a, headers: l };
|
|
2390
2376
|
} else
|
|
2391
2377
|
return {
|
|
@@ -2402,10 +2388,10 @@ class Kn {
|
|
|
2402
2388
|
}
|
|
2403
2389
|
e && "brainType" in e && console.warn("Warning: brainType is deprecated and will be removed in a future version. Please use llmId instead.");
|
|
2404
2390
|
try {
|
|
2405
|
-
const o = `${this.apiVersion}/engine/session`, { url:
|
|
2391
|
+
const o = `${this.apiVersion}/engine/session`, { url: c, headers: a } = this.buildGatewayUrlAndHeaders(o, {
|
|
2406
2392
|
"Content-Type": "application/json",
|
|
2407
2393
|
Authorization: `Bearer ${this.sessionToken}`
|
|
2408
|
-
}),
|
|
2394
|
+
}), u = yield fetch(c, {
|
|
2409
2395
|
method: "POST",
|
|
2410
2396
|
headers: a,
|
|
2411
2397
|
body: JSON.stringify({
|
|
@@ -2413,8 +2399,8 @@ class Kn {
|
|
|
2413
2399
|
sessionOptions: n,
|
|
2414
2400
|
clientMetadata: Hi
|
|
2415
2401
|
})
|
|
2416
|
-
}), l = yield
|
|
2417
|
-
switch (
|
|
2402
|
+
}), l = yield u.json(), m = l.error;
|
|
2403
|
+
switch (u.status) {
|
|
2418
2404
|
case 200:
|
|
2419
2405
|
case 201:
|
|
2420
2406
|
return l;
|
|
@@ -2448,11 +2434,11 @@ class Kn {
|
|
|
2448
2434
|
};
|
|
2449
2435
|
Yn(e) && (n = Object.assign(Object.assign({}, n), { personaConfig: e }));
|
|
2450
2436
|
try {
|
|
2451
|
-
const o = `${this.apiVersion}/auth/session-token`, { url:
|
|
2437
|
+
const o = `${this.apiVersion}/auth/session-token`, { url: c, headers: a } = this.buildGatewayUrlAndHeaders(o, {
|
|
2452
2438
|
"Content-Type": "application/json",
|
|
2453
2439
|
Authorization: `Bearer ${this.apiKey}`
|
|
2454
2440
|
});
|
|
2455
|
-
return (yield (yield fetch(
|
|
2441
|
+
return (yield (yield fetch(c, {
|
|
2456
2442
|
method: "POST",
|
|
2457
2443
|
headers: a,
|
|
2458
2444
|
body: JSON.stringify(n)
|
|
@@ -2467,28 +2453,28 @@ class Kn {
|
|
|
2467
2453
|
}
|
|
2468
2454
|
}
|
|
2469
2455
|
var Jn = function(t, e, n, o) {
|
|
2470
|
-
function
|
|
2471
|
-
return a instanceof n ? a : new n(function(
|
|
2472
|
-
|
|
2456
|
+
function c(a) {
|
|
2457
|
+
return a instanceof n ? a : new n(function(u) {
|
|
2458
|
+
u(a);
|
|
2473
2459
|
});
|
|
2474
2460
|
}
|
|
2475
|
-
return new (n || (n = Promise))(function(a,
|
|
2461
|
+
return new (n || (n = Promise))(function(a, u) {
|
|
2476
2462
|
function l(_) {
|
|
2477
2463
|
try {
|
|
2478
2464
|
p(o.next(_));
|
|
2479
2465
|
} catch (d) {
|
|
2480
|
-
|
|
2466
|
+
u(d);
|
|
2481
2467
|
}
|
|
2482
2468
|
}
|
|
2483
2469
|
function m(_) {
|
|
2484
2470
|
try {
|
|
2485
2471
|
p(o.throw(_));
|
|
2486
2472
|
} catch (d) {
|
|
2487
|
-
|
|
2473
|
+
u(d);
|
|
2488
2474
|
}
|
|
2489
2475
|
}
|
|
2490
2476
|
function p(_) {
|
|
2491
|
-
_.done ? a(_.value) :
|
|
2477
|
+
_.done ? a(_.value) : c(_.value).then(l, m);
|
|
2492
2478
|
}
|
|
2493
2479
|
p((o = o.apply(t, e || [])).next());
|
|
2494
2480
|
});
|
|
@@ -2501,17 +2487,17 @@ class Xn {
|
|
|
2501
2487
|
return Jn(this, void 0, void 0, function* () {
|
|
2502
2488
|
var n, o;
|
|
2503
2489
|
try {
|
|
2504
|
-
let
|
|
2490
|
+
let c, a = {
|
|
2505
2491
|
"Content-Type": "application/json"
|
|
2506
2492
|
};
|
|
2507
|
-
const
|
|
2493
|
+
const u = "/talk", l = `?session_id=${this.sessionId}`;
|
|
2508
2494
|
if (!((n = this.apiGatewayConfig) === null || n === void 0) && n.enabled && (!((o = this.apiGatewayConfig) === null || o === void 0) && o.baseUrl)) {
|
|
2509
|
-
|
|
2510
|
-
const p = new URL(`${this.baseUrl}${
|
|
2495
|
+
c = `${this.apiGatewayConfig.baseUrl}${u}${l}`;
|
|
2496
|
+
const p = new URL(`${this.baseUrl}${u}${l}`);
|
|
2511
2497
|
a["X-Anam-Target-Url"] = p.href;
|
|
2512
2498
|
} else
|
|
2513
|
-
|
|
2514
|
-
const m = yield fetch(
|
|
2499
|
+
c = `${this.baseUrl}${u}${l}`;
|
|
2500
|
+
const m = yield fetch(c, {
|
|
2515
2501
|
method: "POST",
|
|
2516
2502
|
headers: a,
|
|
2517
2503
|
body: JSON.stringify({
|
|
@@ -2520,8 +2506,8 @@ class Xn {
|
|
|
2520
2506
|
});
|
|
2521
2507
|
if (!m.ok)
|
|
2522
2508
|
throw new Error(`Failed to send talk command: ${m.status} ${m.statusText}`);
|
|
2523
|
-
} catch (
|
|
2524
|
-
throw console.error(
|
|
2509
|
+
} catch (c) {
|
|
2510
|
+
throw console.error(c), new Error("EngineApiRestClient - sendTalkCommand: Failed to send talk command");
|
|
2525
2511
|
}
|
|
2526
2512
|
});
|
|
2527
2513
|
}
|
|
@@ -2544,7 +2530,7 @@ class Zn {
|
|
|
2544
2530
|
}
|
|
2545
2531
|
class Qn {
|
|
2546
2532
|
constructor(e, n) {
|
|
2547
|
-
this.messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(
|
|
2533
|
+
this.messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(J.WEBRTC_CHAT_MESSAGE_RECEIVED, this.processWebRtcTextMessageEvent.bind(this));
|
|
2548
2534
|
}
|
|
2549
2535
|
webRtcTextMessageEventToMessageStreamEvent(e) {
|
|
2550
2536
|
return {
|
|
@@ -2570,10 +2556,10 @@ class Qn {
|
|
|
2570
2556
|
content: e.content,
|
|
2571
2557
|
role: e.role,
|
|
2572
2558
|
interrupted: e.interrupted
|
|
2573
|
-
}, o = this.messages.findIndex((
|
|
2559
|
+
}, o = this.messages.findIndex((c) => c.id === n.id);
|
|
2574
2560
|
if (o !== -1) {
|
|
2575
|
-
const
|
|
2576
|
-
this.messages[o] = Object.assign(Object.assign({},
|
|
2561
|
+
const c = this.messages[o];
|
|
2562
|
+
this.messages[o] = Object.assign(Object.assign({}, c), { content: c.content + n.content, interrupted: c.interrupted || n.interrupted });
|
|
2577
2563
|
} else
|
|
2578
2564
|
this.messages.push(n);
|
|
2579
2565
|
}
|
|
@@ -2601,9 +2587,9 @@ class er {
|
|
|
2601
2587
|
this.listeners[e] && this.listeners[e].delete(n);
|
|
2602
2588
|
}
|
|
2603
2589
|
emit(e, ...n) {
|
|
2604
|
-
if (e === N.CONNECTION_ESTABLISHED &&
|
|
2605
|
-
const [o,
|
|
2606
|
-
|
|
2590
|
+
if (e === N.CONNECTION_ESTABLISHED && me(se.CLIENT_METRIC_MEASUREMENT_CONNECTION_ESTABLISHED, "1"), e === N.CONNECTION_CLOSED) {
|
|
2591
|
+
const [o, c] = n;
|
|
2592
|
+
me(se.CLIENT_METRIC_MEASUREMENT_CONNECTION_CLOSED, o, c ? { details: c } : void 0);
|
|
2607
2593
|
}
|
|
2608
2594
|
this.listeners[e] && this.listeners[e].forEach((o) => {
|
|
2609
2595
|
o(...n);
|
|
@@ -2615,38 +2601,38 @@ var z;
|
|
|
2615
2601
|
t[t.UNSTARTED = 0] = "UNSTARTED", t[t.STREAMING = 1] = "STREAMING", t[t.INTERRUPTED = 2] = "INTERRUPTED", t[t.ENDED = 3] = "ENDED";
|
|
2616
2602
|
})(z || (z = {}));
|
|
2617
2603
|
var pt = function(t, e, n, o) {
|
|
2618
|
-
function
|
|
2619
|
-
return a instanceof n ? a : new n(function(
|
|
2620
|
-
|
|
2604
|
+
function c(a) {
|
|
2605
|
+
return a instanceof n ? a : new n(function(u) {
|
|
2606
|
+
u(a);
|
|
2621
2607
|
});
|
|
2622
2608
|
}
|
|
2623
|
-
return new (n || (n = Promise))(function(a,
|
|
2609
|
+
return new (n || (n = Promise))(function(a, u) {
|
|
2624
2610
|
function l(_) {
|
|
2625
2611
|
try {
|
|
2626
2612
|
p(o.next(_));
|
|
2627
2613
|
} catch (d) {
|
|
2628
|
-
|
|
2614
|
+
u(d);
|
|
2629
2615
|
}
|
|
2630
2616
|
}
|
|
2631
2617
|
function m(_) {
|
|
2632
2618
|
try {
|
|
2633
2619
|
p(o.throw(_));
|
|
2634
2620
|
} catch (d) {
|
|
2635
|
-
|
|
2621
|
+
u(d);
|
|
2636
2622
|
}
|
|
2637
2623
|
}
|
|
2638
2624
|
function p(_) {
|
|
2639
|
-
_.done ? a(_.value) :
|
|
2625
|
+
_.done ? a(_.value) : c(_.value).then(l, m);
|
|
2640
2626
|
}
|
|
2641
2627
|
p((o = o.apply(t, e || [])).next());
|
|
2642
2628
|
});
|
|
2643
2629
|
};
|
|
2644
2630
|
class tr {
|
|
2645
2631
|
constructor(e, n, o) {
|
|
2646
|
-
this.state = z.UNSTARTED, this.correlationId = e, this.internalEventEmitter = n, this.signallingClient = o, this.internalEventEmitter.addListener(
|
|
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));
|
|
2647
2633
|
}
|
|
2648
2634
|
onDeactivate() {
|
|
2649
|
-
this.internalEventEmitter.removeListener(
|
|
2635
|
+
this.internalEventEmitter.removeListener(J.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this));
|
|
2650
2636
|
}
|
|
2651
2637
|
onSignalMessage(e) {
|
|
2652
2638
|
return pt(this, void 0, void 0, function* () {
|
|
@@ -2695,43 +2681,43 @@ class tr {
|
|
|
2695
2681
|
return this.state;
|
|
2696
2682
|
}
|
|
2697
2683
|
}
|
|
2698
|
-
var
|
|
2699
|
-
function
|
|
2700
|
-
return a instanceof n ? a : new n(function(
|
|
2701
|
-
|
|
2684
|
+
var K = function(t, e, n, o) {
|
|
2685
|
+
function c(a) {
|
|
2686
|
+
return a instanceof n ? a : new n(function(u) {
|
|
2687
|
+
u(a);
|
|
2702
2688
|
});
|
|
2703
2689
|
}
|
|
2704
|
-
return new (n || (n = Promise))(function(a,
|
|
2690
|
+
return new (n || (n = Promise))(function(a, u) {
|
|
2705
2691
|
function l(_) {
|
|
2706
2692
|
try {
|
|
2707
2693
|
p(o.next(_));
|
|
2708
2694
|
} catch (d) {
|
|
2709
|
-
|
|
2695
|
+
u(d);
|
|
2710
2696
|
}
|
|
2711
2697
|
}
|
|
2712
2698
|
function m(_) {
|
|
2713
2699
|
try {
|
|
2714
2700
|
p(o.throw(_));
|
|
2715
2701
|
} catch (d) {
|
|
2716
|
-
|
|
2702
|
+
u(d);
|
|
2717
2703
|
}
|
|
2718
2704
|
}
|
|
2719
2705
|
function p(_) {
|
|
2720
|
-
_.done ? a(_.value) :
|
|
2706
|
+
_.done ? a(_.value) : c(_.value).then(l, m);
|
|
2721
2707
|
}
|
|
2722
2708
|
p((o = o.apply(t, e || [])).next());
|
|
2723
2709
|
});
|
|
2724
2710
|
};
|
|
2725
2711
|
const ir = 15e3, nr = 5e3, rr = 2;
|
|
2726
2712
|
class or {
|
|
2727
|
-
constructor(e, n, o,
|
|
2728
|
-
var a,
|
|
2713
|
+
constructor(e, n, o, c) {
|
|
2714
|
+
var a, u, l, m;
|
|
2729
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 = {
|
|
2730
2716
|
isMuted: !1,
|
|
2731
2717
|
permissionState: fe.NOT_REQUESTED
|
|
2732
|
-
}, this.successMetricPoller = null, this.successMetricFired = !1, this.showPeerConnectionStatsReport = !1, this.peerConnectionStatsReportOutputFormat = "console", this.statsCollectionInterval = null, this.agentAudioInputStream = null, this.publicEventEmitter = o, this.internalEventEmitter =
|
|
2718
|
+
}, this.successMetricPoller = null, this.successMetricFired = !1, this.showPeerConnectionStatsReport = !1, this.peerConnectionStatsReportOutputFormat = "console", this.statsCollectionInterval = null, this.agentAudioInputStream = null, this.publicEventEmitter = o, this.internalEventEmitter = c, this.apiGatewayConfig = n.apiGateway;
|
|
2733
2719
|
const { inputAudio: p } = n;
|
|
2734
|
-
this.inputAudioState = p.inputAudioState, n.inputAudio.userProvidedMediaStream && (this.inputAudioStream = n.inputAudio.userProvidedMediaStream), this.disableInputAudio = n.inputAudio.disableInputAudio === !0, this.internalEventEmitter.addListener(
|
|
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 qn(e, n.signalling, this.publicEventEmitter, this.internalEventEmitter, this.apiGatewayConfig), this.engineApiRestClient = new Xn(n.engine.baseUrl, e, this.apiGatewayConfig), this.audioDeviceId = n.inputAudio.audioDeviceId, this.showPeerConnectionStatsReport = (u = (a = n.metrics) === null || a === void 0 ? void 0 : a.showPeerConnectionStatsReport) !== null && u !== void 0 ? u : !1, this.peerConnectionStatsReportOutputFormat = (m = (l = n.metrics) === null || l === void 0 ? void 0 : l.peerConnectionStatsReportOutputFormat) !== null && m !== void 0 ? m : "console";
|
|
2735
2721
|
}
|
|
2736
2722
|
onInputAudioStateChange(e, n) {
|
|
2737
2723
|
e.isMuted !== n.isMuted && (n.isMuted ? this.muteAllAudioTracks() : this.unmuteAllAudioTracks());
|
|
@@ -2749,7 +2735,7 @@ class or {
|
|
|
2749
2735
|
});
|
|
2750
2736
|
}
|
|
2751
2737
|
startStatsCollection() {
|
|
2752
|
-
this.statsCollectionInterval || (this.statsCollectionInterval = setInterval(() =>
|
|
2738
|
+
this.statsCollectionInterval || (this.statsCollectionInterval = setInterval(() => K(this, void 0, void 0, function* () {
|
|
2753
2739
|
if (!(!this.peerConnection || !this.dataChannel || this.dataChannel.readyState !== "open"))
|
|
2754
2740
|
try {
|
|
2755
2741
|
const e = yield this.peerConnection.getStats();
|
|
@@ -2776,18 +2762,18 @@ class or {
|
|
|
2776
2762
|
const e = setTimeout(() => {
|
|
2777
2763
|
this.successMetricPoller && (console.warn("No video frames received, there is a problem with the connection."), clearInterval(this.successMetricPoller), this.successMetricPoller = null);
|
|
2778
2764
|
}, ir);
|
|
2779
|
-
this.successMetricPoller = setInterval(() =>
|
|
2765
|
+
this.successMetricPoller = setInterval(() => K(this, void 0, void 0, function* () {
|
|
2780
2766
|
if (!this.peerConnection || this.successMetricFired) {
|
|
2781
2767
|
this.successMetricPoller && clearInterval(this.successMetricPoller), clearTimeout(e);
|
|
2782
2768
|
return;
|
|
2783
2769
|
}
|
|
2784
2770
|
try {
|
|
2785
2771
|
const n = yield this.peerConnection.getStats();
|
|
2786
|
-
let o = !1,
|
|
2772
|
+
let o = !1, c = null;
|
|
2787
2773
|
n.forEach((a) => {
|
|
2788
|
-
a.type === "inbound-rtp" && a.kind === "video" && (a.framesDecoded !== void 0 && a.framesDecoded > 0 ? (o = !0,
|
|
2789
|
-
a.bytesReceived > 1e5 && (o = !0,
|
|
2790
|
-
}), o && !this.successMetricFired && (this.successMetricFired = !0,
|
|
2774
|
+
a.type === "inbound-rtp" && a.kind === "video" && (a.framesDecoded !== void 0 && a.framesDecoded > 0 ? (o = !0, c = "framesDecoded") : a.framesReceived !== void 0 && a.framesReceived > 0 ? (o = !0, c = "framesReceived") : a.bytesReceived > 0 && a.packetsReceived > 0 && // Additional check: ensure we've received enough data for actual video
|
|
2775
|
+
a.bytesReceived > 1e5 && (o = !0, c = "bytesReceived"));
|
|
2776
|
+
}), o && !this.successMetricFired && (this.successMetricFired = !0, me(se.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS, "1", c ? { detectionMethod: c } : void 0), this.successMetricPoller && clearInterval(this.successMetricPoller), clearTimeout(e), this.successMetricPoller = null);
|
|
2791
2777
|
} catch {
|
|
2792
2778
|
}
|
|
2793
2779
|
}), 500);
|
|
@@ -2807,15 +2793,15 @@ class or {
|
|
|
2807
2793
|
return this.peerConnection;
|
|
2808
2794
|
}
|
|
2809
2795
|
changeAudioInputDevice(e) {
|
|
2810
|
-
return
|
|
2796
|
+
return K(this, void 0, void 0, function* () {
|
|
2811
2797
|
if (!this.peerConnection)
|
|
2812
2798
|
throw new Error("StreamingClient - changeAudioInputDevice: peer connection is not initialized. Start streaming first.");
|
|
2813
2799
|
if (e == null)
|
|
2814
2800
|
throw new Error("StreamingClient - changeAudioInputDevice: deviceId is required");
|
|
2815
2801
|
const n = this.inputAudioState.isMuted;
|
|
2816
2802
|
try {
|
|
2817
|
-
this.inputAudioStream && this.inputAudioStream.getAudioTracks().forEach((
|
|
2818
|
-
|
|
2803
|
+
this.inputAudioStream && this.inputAudioStream.getAudioTracks().forEach((c) => {
|
|
2804
|
+
c.stop();
|
|
2819
2805
|
});
|
|
2820
2806
|
const o = {
|
|
2821
2807
|
echoCancellation: !0,
|
|
@@ -2863,12 +2849,12 @@ class or {
|
|
|
2863
2849
|
}
|
|
2864
2850
|
}
|
|
2865
2851
|
stopConnection() {
|
|
2866
|
-
return
|
|
2852
|
+
return K(this, void 0, void 0, function* () {
|
|
2867
2853
|
yield this.shutdown();
|
|
2868
2854
|
});
|
|
2869
2855
|
}
|
|
2870
2856
|
sendTalkCommand(e) {
|
|
2871
|
-
return
|
|
2857
|
+
return K(this, void 0, void 0, function* () {
|
|
2872
2858
|
if (!this.peerConnection)
|
|
2873
2859
|
throw new Error("StreamingClient - sendTalkCommand: peer connection is null");
|
|
2874
2860
|
yield this.engineApiRestClient.sendTalkCommand(e);
|
|
@@ -2884,7 +2870,7 @@ class or {
|
|
|
2884
2870
|
return this.agentAudioInputStream;
|
|
2885
2871
|
}
|
|
2886
2872
|
initPeerConnection() {
|
|
2887
|
-
return
|
|
2873
|
+
return K(this, void 0, void 0, function* () {
|
|
2888
2874
|
this.peerConnection = new RTCPeerConnection({
|
|
2889
2875
|
iceServers: this.iceServers,
|
|
2890
2876
|
iceCandidatePoolSize: rr
|
|
@@ -2894,7 +2880,7 @@ class or {
|
|
|
2894
2880
|
});
|
|
2895
2881
|
}
|
|
2896
2882
|
onSignalMessage(e) {
|
|
2897
|
-
return
|
|
2883
|
+
return K(this, void 0, void 0, function* () {
|
|
2898
2884
|
if (!this.peerConnection) {
|
|
2899
2885
|
console.error("StreamingClient - onSignalMessage: peerConnection is not initialized");
|
|
2900
2886
|
return;
|
|
@@ -2905,16 +2891,16 @@ class or {
|
|
|
2905
2891
|
yield this.peerConnection.setRemoteDescription(n), this.connectionReceivedAnswer = !0, this.flushRemoteIceCandidateBuffer();
|
|
2906
2892
|
break;
|
|
2907
2893
|
case W.ICE_CANDIDATE:
|
|
2908
|
-
const o = e.payload,
|
|
2909
|
-
this.connectionReceivedAnswer ? yield this.peerConnection.addIceCandidate(
|
|
2894
|
+
const o = e.payload, c = new RTCIceCandidate(o);
|
|
2895
|
+
this.connectionReceivedAnswer ? yield this.peerConnection.addIceCandidate(c) : this.remoteIceCandidateBuffer.push(c);
|
|
2910
2896
|
break;
|
|
2911
2897
|
case W.END_SESSION:
|
|
2912
2898
|
const a = e.payload;
|
|
2913
2899
|
this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.SERVER_CLOSED_CONNECTION, a), this.shutdown();
|
|
2914
2900
|
break;
|
|
2915
2901
|
case W.WARNING:
|
|
2916
|
-
const
|
|
2917
|
-
console.warn("Warning received from server: " +
|
|
2902
|
+
const u = e.payload;
|
|
2903
|
+
console.warn("Warning received from server: " + u), this.publicEventEmitter.emit(N.SERVER_WARNING, u);
|
|
2918
2904
|
break;
|
|
2919
2905
|
case W.TALK_STREAM_INTERRUPTED:
|
|
2920
2906
|
const l = e.payload;
|
|
@@ -2932,7 +2918,7 @@ class or {
|
|
|
2932
2918
|
});
|
|
2933
2919
|
}
|
|
2934
2920
|
onSignallingClientConnected() {
|
|
2935
|
-
return
|
|
2921
|
+
return K(this, void 0, void 0, function* () {
|
|
2936
2922
|
if (!this.peerConnection)
|
|
2937
2923
|
try {
|
|
2938
2924
|
yield this.initPeerConnectionAndSendOffer();
|
|
@@ -2977,7 +2963,7 @@ class or {
|
|
|
2977
2963
|
this.videoElement.srcObject = this.videoStream;
|
|
2978
2964
|
const n = this.videoElement.requestVideoFrameCallback(() => {
|
|
2979
2965
|
var o;
|
|
2980
|
-
(o = this.videoElement) === null || o === void 0 || o.cancelVideoFrameCallback(n), this.publicEventEmitter.emit(N.VIDEO_PLAY_STARTED), this.successMetricFired || (this.successMetricFired = !0,
|
|
2966
|
+
(o = this.videoElement) === null || o === void 0 || o.cancelVideoFrameCallback(n), this.publicEventEmitter.emit(N.VIDEO_PLAY_STARTED), this.successMetricFired || (this.successMetricFired = !0, me(se.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS, "1", { detectionMethod: "videoElement" }));
|
|
2981
2967
|
});
|
|
2982
2968
|
}
|
|
2983
2969
|
} else e.track.kind === "audio" && (this.audioStream = e.streams[0], this.publicEventEmitter.emit(N.AUDIO_STREAM_STARTED, this.audioStream));
|
|
@@ -2986,7 +2972,7 @@ class or {
|
|
|
2986
2972
|
* Set up the data channels for sending and receiving messages
|
|
2987
2973
|
*/
|
|
2988
2974
|
setupDataChannels() {
|
|
2989
|
-
return
|
|
2975
|
+
return K(this, void 0, void 0, function* () {
|
|
2990
2976
|
if (!this.peerConnection) {
|
|
2991
2977
|
console.error("StreamingClient - setupDataChannels: peer connection is not initialized");
|
|
2992
2978
|
return;
|
|
@@ -3004,16 +2990,16 @@ class or {
|
|
|
3004
2990
|
const o = JSON.parse(n.data);
|
|
3005
2991
|
switch (o.messageType) {
|
|
3006
2992
|
case De.SPEECH_TEXT:
|
|
3007
|
-
this.internalEventEmitter.emit(
|
|
2993
|
+
this.internalEventEmitter.emit(J.WEBRTC_CHAT_MESSAGE_RECEIVED, o.data);
|
|
3008
2994
|
break;
|
|
3009
2995
|
case De.CLIENT_TOOL_EVENT:
|
|
3010
|
-
const
|
|
3011
|
-
this.internalEventEmitter.emit(
|
|
3012
|
-
const a = sr.WebRTCClientToolEventToClientToolEvent(
|
|
2996
|
+
const c = o.data;
|
|
2997
|
+
this.internalEventEmitter.emit(J.WEBRTC_CLIENT_TOOL_EVENT_RECEIVED, c);
|
|
2998
|
+
const a = sr.WebRTCClientToolEventToClientToolEvent(c);
|
|
3013
2999
|
this.publicEventEmitter.emit(N.CLIENT_TOOL_EVENT_RECEIVED, a);
|
|
3014
3000
|
break;
|
|
3015
3001
|
case De.REASONING_TEXT:
|
|
3016
|
-
this.internalEventEmitter.emit(
|
|
3002
|
+
this.internalEventEmitter.emit(J.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED, o.data);
|
|
3017
3003
|
break;
|
|
3018
3004
|
// Unknown message types are silently ignored to maintain forward compatibility
|
|
3019
3005
|
default:
|
|
@@ -3029,7 +3015,7 @@ class or {
|
|
|
3029
3015
|
* Request microphone permission asynchronously without blocking connection
|
|
3030
3016
|
*/
|
|
3031
3017
|
requestMicrophonePermissionAsync() {
|
|
3032
|
-
return
|
|
3018
|
+
return K(this, void 0, void 0, function* () {
|
|
3033
3019
|
if (this.inputAudioState.permissionState !== fe.PENDING) {
|
|
3034
3020
|
this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: fe.PENDING }), this.publicEventEmitter.emit(N.MIC_PERMISSION_PENDING);
|
|
3035
3021
|
try {
|
|
@@ -3053,7 +3039,7 @@ class or {
|
|
|
3053
3039
|
* Set up audio track and add it to the peer connection using replaceTrack
|
|
3054
3040
|
*/
|
|
3055
3041
|
setupAudioTrack() {
|
|
3056
|
-
return
|
|
3042
|
+
return K(this, void 0, void 0, function* () {
|
|
3057
3043
|
if (!this.peerConnection || !this.inputAudioStream)
|
|
3058
3044
|
return;
|
|
3059
3045
|
if (!this.inputAudioStream.getAudioTracks().length) {
|
|
@@ -3061,15 +3047,15 @@ class or {
|
|
|
3061
3047
|
return;
|
|
3062
3048
|
}
|
|
3063
3049
|
this.inputAudioState.isMuted && this.muteAllAudioTracks();
|
|
3064
|
-
const e = this.inputAudioStream.getAudioTracks()[0], o = this.peerConnection.getSenders().find((
|
|
3050
|
+
const e = this.inputAudioStream.getAudioTracks()[0], o = this.peerConnection.getSenders().find((c) => {
|
|
3065
3051
|
var a;
|
|
3066
|
-
return ((a =
|
|
3052
|
+
return ((a = c.track) === null || a === void 0 ? void 0 : a.kind) === "audio" || c.track === null && c.dtmf !== null;
|
|
3067
3053
|
});
|
|
3068
3054
|
if (o)
|
|
3069
3055
|
try {
|
|
3070
3056
|
yield o.replaceTrack(e);
|
|
3071
|
-
} catch (
|
|
3072
|
-
console.error("Failed to replace audio track:",
|
|
3057
|
+
} catch (c) {
|
|
3058
|
+
console.error("Failed to replace audio track:", c), this.peerConnection.addTrack(e, this.inputAudioStream);
|
|
3073
3059
|
}
|
|
3074
3060
|
else
|
|
3075
3061
|
this.peerConnection.addTrack(e, this.inputAudioStream);
|
|
@@ -3077,7 +3063,7 @@ class or {
|
|
|
3077
3063
|
});
|
|
3078
3064
|
}
|
|
3079
3065
|
initPeerConnectionAndSendOffer() {
|
|
3080
|
-
return
|
|
3066
|
+
return K(this, void 0, void 0, function* () {
|
|
3081
3067
|
if (yield this.initPeerConnection(), !this.peerConnection) {
|
|
3082
3068
|
console.error("StreamingClient - initPeerConnectionAndSendOffer: peer connection is not initialized");
|
|
3083
3069
|
return;
|
|
@@ -3094,7 +3080,7 @@ class or {
|
|
|
3094
3080
|
});
|
|
3095
3081
|
}
|
|
3096
3082
|
shutdown() {
|
|
3097
|
-
return
|
|
3083
|
+
return K(this, void 0, void 0, function* () {
|
|
3098
3084
|
var e;
|
|
3099
3085
|
if (this.showPeerConnectionStatsReport) {
|
|
3100
3086
|
const n = yield (e = this.peerConnection) === null || e === void 0 ? void 0 : e.getStats();
|
|
@@ -3142,7 +3128,7 @@ class sr {
|
|
|
3142
3128
|
}
|
|
3143
3129
|
class ar {
|
|
3144
3130
|
constructor(e, n) {
|
|
3145
|
-
this.reasoning_messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(
|
|
3131
|
+
this.reasoning_messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(J.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED, this.processWebRtcReasoningTextMessageEvent.bind(this));
|
|
3146
3132
|
}
|
|
3147
3133
|
webRtcTextMessageEventToReasoningStreamEvent(e) {
|
|
3148
3134
|
return {
|
|
@@ -3159,45 +3145,45 @@ class ar {
|
|
|
3159
3145
|
id: n.id,
|
|
3160
3146
|
content: n.content,
|
|
3161
3147
|
role: n.role
|
|
3162
|
-
},
|
|
3163
|
-
if (
|
|
3164
|
-
const a = this.reasoning_messages[
|
|
3165
|
-
a.content += o.content, this.reasoning_messages[
|
|
3148
|
+
}, c = this.reasoning_messages.findIndex((a) => a.id === o.id);
|
|
3149
|
+
if (c !== -1) {
|
|
3150
|
+
const a = this.reasoning_messages[c];
|
|
3151
|
+
a.content += o.content, this.reasoning_messages[c] = a;
|
|
3166
3152
|
} else
|
|
3167
3153
|
this.reasoning_messages.push(o);
|
|
3168
3154
|
n.endOfThought && this.publicEventEmitter.emit(N.REASONING_HISTORY_UPDATED, this.reasoning_messages);
|
|
3169
3155
|
}
|
|
3170
3156
|
}
|
|
3171
3157
|
var ue = function(t, e, n, o) {
|
|
3172
|
-
function
|
|
3173
|
-
return a instanceof n ? a : new n(function(
|
|
3174
|
-
|
|
3158
|
+
function c(a) {
|
|
3159
|
+
return a instanceof n ? a : new n(function(u) {
|
|
3160
|
+
u(a);
|
|
3175
3161
|
});
|
|
3176
3162
|
}
|
|
3177
|
-
return new (n || (n = Promise))(function(a,
|
|
3163
|
+
return new (n || (n = Promise))(function(a, u) {
|
|
3178
3164
|
function l(_) {
|
|
3179
3165
|
try {
|
|
3180
3166
|
p(o.next(_));
|
|
3181
3167
|
} catch (d) {
|
|
3182
|
-
|
|
3168
|
+
u(d);
|
|
3183
3169
|
}
|
|
3184
3170
|
}
|
|
3185
3171
|
function m(_) {
|
|
3186
3172
|
try {
|
|
3187
3173
|
p(o.throw(_));
|
|
3188
3174
|
} catch (d) {
|
|
3189
|
-
|
|
3175
|
+
u(d);
|
|
3190
3176
|
}
|
|
3191
3177
|
}
|
|
3192
3178
|
function p(_) {
|
|
3193
|
-
_.done ? a(_.value) :
|
|
3179
|
+
_.done ? a(_.value) : c(_.value).then(l, m);
|
|
3194
3180
|
}
|
|
3195
3181
|
p((o = o.apply(t, e || [])).next());
|
|
3196
3182
|
});
|
|
3197
3183
|
};
|
|
3198
3184
|
class lr {
|
|
3199
3185
|
constructor(e, n, o) {
|
|
3200
|
-
var
|
|
3186
|
+
var c, a, u, l, m;
|
|
3201
3187
|
this.inputAudioState = {
|
|
3202
3188
|
isMuted: !1,
|
|
3203
3189
|
permissionState: fe.NOT_REQUESTED
|
|
@@ -3205,28 +3191,28 @@ class lr {
|
|
|
3205
3191
|
const p = this.validateClientConfig(e, n, o);
|
|
3206
3192
|
if (p)
|
|
3207
3193
|
throw new $(p, V.CLIENT_ERROR_CODE_CONFIGURATION_ERROR, 400);
|
|
3208
|
-
this.personaConfig = n, this.clientOptions = o, (!((
|
|
3194
|
+
this.personaConfig = n, this.clientOptions = o, (!((c = o?.api) === null || c === void 0) && c.baseUrl || !((a = o?.api) === null || a === void 0) && a.apiVersion) && Fn(o.api.baseUrl || Wi, o.api.apiVersion || xt), !((l = (u = o?.api) === null || u === void 0 ? void 0 : u.apiGateway) === null || l === void 0) && l.enabled && $n(o.api.apiGateway), !((m = o?.metrics) === null || m === void 0) && m.disableClientMetrics && Gn(!0), this.publicEventEmitter = new er(), this.internalEventEmitter = new Zn(), this.apiClient = new Kn(e, o?.apiKey, o?.api), this.messageHistoryClient = new Qn(this.publicEventEmitter, this.internalEventEmitter), this.reasoningHistoryClient = new ar(this.publicEventEmitter, this.internalEventEmitter);
|
|
3209
3195
|
}
|
|
3210
3196
|
decodeJwt(e) {
|
|
3211
3197
|
try {
|
|
3212
|
-
const n = e.split(".")[1], o =
|
|
3198
|
+
const n = e.split(".")[1], o = Mn.Buffer.from(n, "base64").toString("utf8");
|
|
3213
3199
|
return JSON.parse(o);
|
|
3214
3200
|
} catch {
|
|
3215
3201
|
throw new Error("Invalid session token format");
|
|
3216
3202
|
}
|
|
3217
3203
|
}
|
|
3218
3204
|
validateClientConfig(e, n, o) {
|
|
3219
|
-
var
|
|
3205
|
+
var c, a;
|
|
3220
3206
|
if (!e && !o?.apiKey)
|
|
3221
3207
|
return "Either sessionToken or apiKey must be provided";
|
|
3222
3208
|
if (o?.apiKey && e)
|
|
3223
3209
|
return "Only one of sessionToken or apiKey should be used";
|
|
3224
|
-
const
|
|
3225
|
-
if (
|
|
3226
|
-
return
|
|
3210
|
+
const u = jn((c = o?.api) === null || c === void 0 ? void 0 : c.apiGateway);
|
|
3211
|
+
if (u)
|
|
3212
|
+
return u;
|
|
3227
3213
|
if (e) {
|
|
3228
3214
|
const l = this.decodeJwt(e);
|
|
3229
|
-
this.organizationId = l.accountId,
|
|
3215
|
+
this.organizationId = l.accountId, Se({
|
|
3230
3216
|
organizationId: this.organizationId
|
|
3231
3217
|
});
|
|
3232
3218
|
const m = (a = l.type) === null || a === void 0 ? void 0 : a.toLowerCase();
|
|
@@ -3255,48 +3241,48 @@ class lr {
|
|
|
3255
3241
|
}
|
|
3256
3242
|
startSession(e) {
|
|
3257
3243
|
return ue(this, void 0, void 0, function* () {
|
|
3258
|
-
var n, o,
|
|
3259
|
-
const
|
|
3260
|
-
this.sessionId =
|
|
3244
|
+
var n, o, c, a, u, l, m, p, _, d, y, g;
|
|
3245
|
+
const S = this.personaConfig, C = this.buildStartSessionOptionsForClient(), A = yield this.apiClient.startSession(S, C), { sessionId: I, clientConfig: b, engineHost: T, engineProtocol: D, signallingEndpoint: x } = A, { heartbeatIntervalSeconds: Z, maxWsReconnectionAttempts: H, iceServers: ae } = b;
|
|
3246
|
+
this.sessionId = I, Se({
|
|
3261
3247
|
sessionId: this.sessionId
|
|
3262
3248
|
});
|
|
3263
3249
|
const ne = !((n = this.clientOptions) === null || n === void 0) && n.iceServers ? this.clientOptions.iceServers : ae;
|
|
3264
3250
|
try {
|
|
3265
|
-
this.streamingClient = new or(
|
|
3251
|
+
this.streamingClient = new or(I, {
|
|
3266
3252
|
engine: {
|
|
3267
|
-
baseUrl: `${
|
|
3253
|
+
baseUrl: `${D}://${T}`
|
|
3268
3254
|
},
|
|
3269
3255
|
signalling: {
|
|
3270
|
-
heartbeatIntervalSeconds:
|
|
3256
|
+
heartbeatIntervalSeconds: Z,
|
|
3271
3257
|
maxWsReconnectionAttempts: H,
|
|
3272
3258
|
url: {
|
|
3273
|
-
baseUrl:
|
|
3274
|
-
protocol:
|
|
3275
|
-
signallingPath:
|
|
3259
|
+
baseUrl: T,
|
|
3260
|
+
protocol: D,
|
|
3261
|
+
signallingPath: x
|
|
3276
3262
|
}
|
|
3277
3263
|
},
|
|
3278
3264
|
iceServers: ne,
|
|
3279
3265
|
inputAudio: {
|
|
3280
3266
|
inputAudioState: this.inputAudioState,
|
|
3281
3267
|
userProvidedMediaStream: !((o = this.clientOptions) === null || o === void 0) && o.disableInputAudio ? void 0 : e,
|
|
3282
|
-
audioDeviceId: (
|
|
3268
|
+
audioDeviceId: (c = this.clientOptions) === null || c === void 0 ? void 0 : c.audioDeviceId,
|
|
3283
3269
|
disableInputAudio: (a = this.clientOptions) === null || a === void 0 ? void 0 : a.disableInputAudio
|
|
3284
3270
|
},
|
|
3285
|
-
apiGateway: (l = (
|
|
3271
|
+
apiGateway: (l = (u = this.clientOptions) === null || u === void 0 ? void 0 : u.api) === null || l === void 0 ? void 0 : l.apiGateway,
|
|
3286
3272
|
metrics: {
|
|
3287
3273
|
showPeerConnectionStatsReport: (_ = (p = (m = this.clientOptions) === null || m === void 0 ? void 0 : m.metrics) === null || p === void 0 ? void 0 : p.showPeerConnectionStatsReport) !== null && _ !== void 0 ? _ : !1,
|
|
3288
|
-
peerConnectionStatsReportOutputFormat: (g = (
|
|
3274
|
+
peerConnectionStatsReportOutputFormat: (g = (y = (d = this.clientOptions) === null || d === void 0 ? void 0 : d.metrics) === null || y === void 0 ? void 0 : y.peerConnectionStatsReportOutputFormat) !== null && g !== void 0 ? g : "console"
|
|
3289
3275
|
}
|
|
3290
3276
|
}, this.publicEventEmitter, this.internalEventEmitter);
|
|
3291
3277
|
} catch (re) {
|
|
3292
|
-
throw
|
|
3278
|
+
throw Se({
|
|
3293
3279
|
sessionId: null
|
|
3294
3280
|
}), new $("Failed to initialize streaming client", V.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
|
|
3295
3281
|
cause: re instanceof Error ? re.message : String(re),
|
|
3296
|
-
sessionId:
|
|
3282
|
+
sessionId: I
|
|
3297
3283
|
});
|
|
3298
3284
|
}
|
|
3299
|
-
return
|
|
3285
|
+
return I;
|
|
3300
3286
|
});
|
|
3301
3287
|
}
|
|
3302
3288
|
startSessionIfNeeded(e) {
|
|
@@ -3313,18 +3299,18 @@ class lr {
|
|
|
3313
3299
|
if (this._isStreaming)
|
|
3314
3300
|
throw new Error("Already streaming");
|
|
3315
3301
|
const o = li();
|
|
3316
|
-
return
|
|
3302
|
+
return Se({
|
|
3317
3303
|
attemptCorrelationId: o,
|
|
3318
3304
|
sessionId: null
|
|
3319
3305
|
// reset sessionId
|
|
3320
|
-
}),
|
|
3306
|
+
}), me(se.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((c) => {
|
|
3321
3307
|
var a;
|
|
3322
|
-
const
|
|
3308
|
+
const u = [];
|
|
3323
3309
|
let l = !1, m = !1;
|
|
3324
3310
|
this.publicEventEmitter.addListener(N.VIDEO_STREAM_STARTED, (p) => {
|
|
3325
|
-
|
|
3311
|
+
u.push(p), l = !0, m && c(u);
|
|
3326
3312
|
}), this.publicEventEmitter.addListener(N.AUDIO_STREAM_STARTED, (p) => {
|
|
3327
|
-
|
|
3313
|
+
u.push(p), m = !0, l && c(u);
|
|
3328
3314
|
}), (a = this.streamingClient) === null || a === void 0 || a.startConnection();
|
|
3329
3315
|
});
|
|
3330
3316
|
});
|
|
@@ -3340,12 +3326,12 @@ class lr {
|
|
|
3340
3326
|
streamToVideoElement(e, n) {
|
|
3341
3327
|
return ue(this, void 0, void 0, function* () {
|
|
3342
3328
|
var o;
|
|
3343
|
-
const
|
|
3344
|
-
|
|
3345
|
-
attemptCorrelationId:
|
|
3329
|
+
const c = li();
|
|
3330
|
+
Se({
|
|
3331
|
+
attemptCorrelationId: c,
|
|
3346
3332
|
sessionId: null
|
|
3347
3333
|
// reset sessionId
|
|
3348
|
-
}),
|
|
3334
|
+
}), me(se.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.");
|
|
3349
3335
|
try {
|
|
3350
3336
|
yield this.startSessionIfNeeded(n);
|
|
3351
3337
|
} catch (a) {
|
|
@@ -3397,13 +3383,13 @@ class lr {
|
|
|
3397
3383
|
const n = this.getActiveSessionId();
|
|
3398
3384
|
if (!n)
|
|
3399
3385
|
throw new Error("Failed to send user message: no active session");
|
|
3400
|
-
const o = (/* @__PURE__ */ new Date()).toISOString().replace("Z", ""),
|
|
3386
|
+
const o = (/* @__PURE__ */ new Date()).toISOString().replace("Z", ""), c = JSON.stringify({
|
|
3401
3387
|
content: e,
|
|
3402
3388
|
timestamp: o,
|
|
3403
3389
|
session_id: n,
|
|
3404
3390
|
message_type: "speech"
|
|
3405
3391
|
});
|
|
3406
|
-
this.sendDataMessage(
|
|
3392
|
+
this.sendDataMessage(c);
|
|
3407
3393
|
}
|
|
3408
3394
|
interruptPersona() {
|
|
3409
3395
|
if (!this._isStreaming)
|
|
@@ -3421,7 +3407,7 @@ class lr {
|
|
|
3421
3407
|
}
|
|
3422
3408
|
stopStreaming() {
|
|
3423
3409
|
return ue(this, void 0, void 0, function* () {
|
|
3424
|
-
this.streamingClient && (this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.NORMAL), yield this.streamingClient.stopConnection(), this.streamingClient = null, this.sessionId = null,
|
|
3410
|
+
this.streamingClient && (this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.NORMAL), yield this.streamingClient.stopConnection(), this.streamingClient = null, this.sessionId = null, Se({
|
|
3425
3411
|
attemptCorrelationId: null,
|
|
3426
3412
|
sessionId: null,
|
|
3427
3413
|
organizationId: this.organizationId
|
|
@@ -3495,7 +3481,7 @@ function dr(t) {
|
|
|
3495
3481
|
return {};
|
|
3496
3482
|
}
|
|
3497
3483
|
}
|
|
3498
|
-
const
|
|
3484
|
+
const X = Y(null), te = Y("idle"), Le = Y(!1), Ke = Y(!1), at = Y([]), Pe = Y(null), it = Y(null), Ot = Y(null), kt = Y(null), Dt = Y(null), ui = Y(!1), nt = Y(!1);
|
|
3499
3485
|
function hr(t, e) {
|
|
3500
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.";
|
|
3501
3487
|
}
|
|
@@ -3515,7 +3501,7 @@ async function pr(t, e, n, o) {
|
|
|
3515
3501
|
if (te.value === "connecting" || te.value === "connected")
|
|
3516
3502
|
return;
|
|
3517
3503
|
te.value = "connecting", Pe.value = null;
|
|
3518
|
-
let
|
|
3504
|
+
let c;
|
|
3519
3505
|
try {
|
|
3520
3506
|
let a;
|
|
3521
3507
|
if (o)
|
|
@@ -3527,7 +3513,7 @@ async function pr(t, e, n, o) {
|
|
|
3527
3513
|
headers: { "Content-Type": "application/json" },
|
|
3528
3514
|
body: JSON.stringify({ agentId: t })
|
|
3529
3515
|
});
|
|
3530
|
-
if (
|
|
3516
|
+
if (c = m.status, !m.ok) {
|
|
3531
3517
|
const _ = await m.json().catch(() => ({}));
|
|
3532
3518
|
throw new Error(_.error || `HTTP ${m.status}`);
|
|
3533
3519
|
}
|
|
@@ -3536,54 +3522,54 @@ async function pr(t, e, n, o) {
|
|
|
3536
3522
|
hasToken: !!p.sessionToken
|
|
3537
3523
|
}), a = p.sessionToken;
|
|
3538
3524
|
}
|
|
3539
|
-
const
|
|
3525
|
+
const u = cr(a, {
|
|
3540
3526
|
api: e ? { baseUrl: e } : void 0,
|
|
3541
3527
|
metrics: { disableClientMetrics: !0 }
|
|
3542
3528
|
});
|
|
3543
|
-
|
|
3529
|
+
u.addListener(N.CONNECTION_ESTABLISHED, () => {
|
|
3544
3530
|
console.log("[AnamWidget] Connection established"), te.value = "connected";
|
|
3545
|
-
}),
|
|
3531
|
+
}), u.addListener(N.VIDEO_STREAM_STARTED, () => {
|
|
3546
3532
|
console.log("[AnamWidget] Video stream started"), Le.value = !0;
|
|
3547
|
-
}),
|
|
3533
|
+
}), u.addListener(N.AUDIO_STREAM_STARTED, () => {
|
|
3548
3534
|
console.log("[AnamWidget] Audio stream started");
|
|
3549
|
-
}),
|
|
3535
|
+
}), u.addListener(N.MESSAGE_HISTORY_UPDATED, (m) => {
|
|
3550
3536
|
at.value = [...m];
|
|
3551
|
-
}),
|
|
3537
|
+
}), u.addListener(N.CONNECTION_CLOSED, (m, p) => {
|
|
3552
3538
|
console.log("[AnamWidget] Connection closed:", m, p), te.value = "idle", Le.value = !1, it.value = null;
|
|
3553
|
-
}),
|
|
3539
|
+
}), u.addListener(N.SESSION_READY, (m) => {
|
|
3554
3540
|
console.log("[AnamWidget] Session ready:", m), it.value = m;
|
|
3555
|
-
}),
|
|
3556
|
-
const l = await
|
|
3541
|
+
}), X.value = u;
|
|
3542
|
+
const l = await u.stream();
|
|
3557
3543
|
if (n && l.length > 0) {
|
|
3558
3544
|
const m = l.find((p) => p.getVideoTracks().length > 0);
|
|
3559
3545
|
m && (n.srcObject = m);
|
|
3560
3546
|
}
|
|
3561
3547
|
} catch (a) {
|
|
3562
|
-
console.error("[AnamWidget] Failed to start session:", a), Pe.value = hr(a,
|
|
3548
|
+
console.error("[AnamWidget] Failed to start session:", a), Pe.value = hr(a, c), te.value = "error", X.value = null;
|
|
3563
3549
|
}
|
|
3564
3550
|
}
|
|
3565
3551
|
async function _r() {
|
|
3566
|
-
if (
|
|
3552
|
+
if (X.value)
|
|
3567
3553
|
try {
|
|
3568
|
-
await
|
|
3554
|
+
await X.value.stopStreaming();
|
|
3569
3555
|
} catch (t) {
|
|
3570
3556
|
console.error("[AnamWidget] Failed to stop session:", t);
|
|
3571
3557
|
}
|
|
3572
|
-
|
|
3558
|
+
X.value = null, te.value = "idle", Le.value = !1, at.value = [];
|
|
3573
3559
|
}
|
|
3574
3560
|
function Er(t) {
|
|
3575
|
-
!
|
|
3561
|
+
!X.value || te.value !== "connected" || X.value.sendUserMessage(t);
|
|
3576
3562
|
}
|
|
3577
3563
|
function mr() {
|
|
3578
|
-
|
|
3564
|
+
X.value && (Ke.value ? (X.value.unmuteInputAudio(), Ke.value = !1) : (X.value.muteInputAudio(), Ke.value = !0));
|
|
3579
3565
|
}
|
|
3580
3566
|
function gr() {
|
|
3581
|
-
|
|
3567
|
+
X.value?.isStreaming() && X.value.stopStreaming(), X.value = null, te.value = "idle", Le.value = !1, at.value = [], Pe.value = null, it.value = null, Ot.value = null, kt.value = null, Dt.value = null;
|
|
3582
3568
|
}
|
|
3583
3569
|
function vr(t, e, n) {
|
|
3584
3570
|
const o = t || (n ? dr(n).personaId : void 0);
|
|
3585
3571
|
ui.value = !!o || !!n;
|
|
3586
|
-
const
|
|
3572
|
+
const c = e || ur;
|
|
3587
3573
|
return {
|
|
3588
3574
|
connectionStatus: te,
|
|
3589
3575
|
isStreaming: Le,
|
|
@@ -3601,21 +3587,21 @@ function vr(t, e, n) {
|
|
|
3601
3587
|
nt.value = !0;
|
|
3602
3588
|
return;
|
|
3603
3589
|
}
|
|
3604
|
-
fr(o,
|
|
3590
|
+
fr(o, c);
|
|
3605
3591
|
},
|
|
3606
|
-
startSession: (l) => !o && !n ? (Pe.value = "No agent ID or session token configured", Promise.resolve()) : pr(o || "",
|
|
3592
|
+
startSession: (l) => !o && !n ? (Pe.value = "No agent ID or session token configured", Promise.resolve()) : pr(o || "", c, l, n),
|
|
3607
3593
|
stopSession: _r,
|
|
3608
3594
|
sendMessage: Er,
|
|
3609
3595
|
toggleMute: mr,
|
|
3610
3596
|
cleanup: gr
|
|
3611
3597
|
};
|
|
3612
3598
|
}
|
|
3613
|
-
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-background:#fff;--anam-text:#18181b;--anam-trigger-size:80px;--anam-sheet-width:400px;--anam-sheet-height:640px;all:initial;color:var(--anam-text);-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}';
|
|
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}';
|
|
3614
3600
|
function wt(t, e) {
|
|
3615
3601
|
const n = { ...t };
|
|
3616
3602
|
for (const o of Object.keys(e)) {
|
|
3617
|
-
const
|
|
3618
|
-
|
|
3603
|
+
const c = e[o];
|
|
3604
|
+
c !== void 0 && (c !== null && typeof c == "object" && !Array.isArray(c) && typeof n[o] == "object" && n[o] !== null && !Array.isArray(n[o]) ? n[o] = wt(n[o], c) : n[o] = c);
|
|
3619
3605
|
}
|
|
3620
3606
|
return n;
|
|
3621
3607
|
}
|
|
@@ -3628,8 +3614,8 @@ function yr(t) {
|
|
|
3628
3614
|
n !== void 0 && (e.inline = n), t.layout && (e.layout = t.layout), t.position && (e.position = t.position);
|
|
3629
3615
|
const o = ze(t["ui-mute-button"]);
|
|
3630
3616
|
o !== void 0 && (e.showMuteButton = o);
|
|
3631
|
-
const
|
|
3632
|
-
|
|
3617
|
+
const c = ze(t["ui-text-input"]);
|
|
3618
|
+
c !== void 0 && (e.showTextInput = c);
|
|
3633
3619
|
const a = ze(t["ui-captions"]);
|
|
3634
3620
|
return a !== void 0 && (e.showCaptions = a), e;
|
|
3635
3621
|
}
|
|
@@ -3657,24 +3643,24 @@ function Tr({
|
|
|
3657
3643
|
session: e,
|
|
3658
3644
|
videoRef: n,
|
|
3659
3645
|
avatarSrc: o,
|
|
3660
|
-
displayCta:
|
|
3646
|
+
displayCta: c,
|
|
3661
3647
|
onCollapse: a
|
|
3662
3648
|
}) {
|
|
3663
|
-
const
|
|
3649
|
+
const u = Ze(null), [l, m] = qe(""), [p, _] = qe(null), [d, y] = qe(!1), g = Ze(null), S = e.connectionStatus.value === "connected", C = e.connectionStatus.value === "connecting", A = e.connectionStatus.value === "error", I = e.isStreaming.value, b = !C && !S && !A, T = je(async () => {
|
|
3664
3650
|
n.current && await e.startSession(n.current);
|
|
3665
|
-
}, [e.startSession]),
|
|
3651
|
+
}, [e.startSession]), D = je(async () => {
|
|
3666
3652
|
await e.stopSession();
|
|
3667
|
-
}, [e.stopSession]),
|
|
3653
|
+
}, [e.stopSession]), x = je(() => {
|
|
3668
3654
|
if (!l.trim()) return;
|
|
3669
3655
|
const H = l.trim();
|
|
3670
|
-
e.sendMessage(H), m(""),
|
|
3671
|
-
|
|
3672
|
-
_(null),
|
|
3656
|
+
e.sendMessage(H), m(""), u.current?.focus(), g.current && clearTimeout(g.current), y(!1), _(H), g.current = window.setTimeout(() => {
|
|
3657
|
+
y(!0), g.current = window.setTimeout(() => {
|
|
3658
|
+
_(null), y(!1);
|
|
3673
3659
|
}, 400);
|
|
3674
3660
|
}, 2600);
|
|
3675
|
-
}, [l]),
|
|
3676
|
-
H.key === "Enter" && !H.shiftKey && (H.preventDefault(),
|
|
3677
|
-
}, [
|
|
3661
|
+
}, [l]), Z = je((H) => {
|
|
3662
|
+
H.key === "Enter" && !H.shiftKey && (H.preventDefault(), x());
|
|
3663
|
+
}, [x]);
|
|
3678
3664
|
return gt(() => () => {
|
|
3679
3665
|
g.current && clearTimeout(g.current);
|
|
3680
3666
|
}, []), /* @__PURE__ */ w("div", { class: "anam-sheet", children: [
|
|
@@ -3685,16 +3671,16 @@ function Tr({
|
|
|
3685
3671
|
class: "anam-video",
|
|
3686
3672
|
autoplay: !0,
|
|
3687
3673
|
playsinline: !0,
|
|
3688
|
-
"data-hidden":
|
|
3674
|
+
"data-hidden": I ? void 0 : "true"
|
|
3689
3675
|
}
|
|
3690
3676
|
),
|
|
3691
|
-
|
|
3677
|
+
b && (e.isConfigured.value ? (
|
|
3692
3678
|
/* Has agent-id: show avatar or placeholder + CTA pill */
|
|
3693
3679
|
/* @__PURE__ */ w("div", { class: "anam-overlay-idle", children: [
|
|
3694
3680
|
o ? /* @__PURE__ */ w("img", { src: o, alt: "Avatar" }) : /* @__PURE__ */ w(Ct, {}),
|
|
3695
|
-
/* @__PURE__ */ w("button", { class: "anam-cta-pill", onClick:
|
|
3681
|
+
/* @__PURE__ */ w("button", { class: "anam-cta-pill", onClick: T, children: [
|
|
3696
3682
|
/* @__PURE__ */ w(wr, {}),
|
|
3697
|
-
|
|
3683
|
+
c
|
|
3698
3684
|
] })
|
|
3699
3685
|
] })
|
|
3700
3686
|
) : (
|
|
@@ -3704,15 +3690,15 @@ function Tr({
|
|
|
3704
3690
|
/* @__PURE__ */ w("span", { children: "Agent not configured" })
|
|
3705
3691
|
] })
|
|
3706
3692
|
)),
|
|
3707
|
-
|
|
3693
|
+
C && /* @__PURE__ */ w("div", { class: "anam-overlay-loading", children: [
|
|
3708
3694
|
/* @__PURE__ */ w("span", { class: "anam-spinner" }),
|
|
3709
3695
|
/* @__PURE__ */ w("span", { children: "Starting your conversation..." })
|
|
3710
3696
|
] }),
|
|
3711
3697
|
A && /* @__PURE__ */ w("div", { class: "anam-overlay-error", children: [
|
|
3712
3698
|
/* @__PURE__ */ w("div", { class: "anam-overlay-error-text", children: e.error.value || "Something went wrong" }),
|
|
3713
|
-
/* @__PURE__ */ w("button", { class: "anam-retry-btn", onClick:
|
|
3699
|
+
/* @__PURE__ */ w("button", { class: "anam-retry-btn", onClick: T, children: "Try Again" })
|
|
3714
3700
|
] }),
|
|
3715
|
-
(
|
|
3701
|
+
(S || I) && /* @__PURE__ */ w(oe, { children: [
|
|
3716
3702
|
a && /* @__PURE__ */ w("button", { class: "anam-close-btn", onClick: a, "aria-label": "Close", children: /* @__PURE__ */ w(Sr, {}) }),
|
|
3717
3703
|
p && /* @__PURE__ */ w("div", { class: `anam-toast ${d ? "anam-toast-out" : ""}`, children: p }),
|
|
3718
3704
|
/* @__PURE__ */ w("div", { class: "anam-control-bar", children: [
|
|
@@ -3729,22 +3715,22 @@ function Tr({
|
|
|
3729
3715
|
/* @__PURE__ */ w(
|
|
3730
3716
|
"input",
|
|
3731
3717
|
{
|
|
3732
|
-
ref:
|
|
3718
|
+
ref: u,
|
|
3733
3719
|
type: "text",
|
|
3734
3720
|
class: "anam-ctl-input",
|
|
3735
|
-
placeholder:
|
|
3721
|
+
placeholder: "Type a message...",
|
|
3736
3722
|
value: l,
|
|
3737
3723
|
onInput: (H) => m(H.target.value),
|
|
3738
|
-
onKeyDown:
|
|
3739
|
-
disabled: !
|
|
3724
|
+
onKeyDown: Z,
|
|
3725
|
+
disabled: !S
|
|
3740
3726
|
}
|
|
3741
3727
|
),
|
|
3742
3728
|
/* @__PURE__ */ w(
|
|
3743
3729
|
"button",
|
|
3744
3730
|
{
|
|
3745
3731
|
class: "anam-ctl-btn",
|
|
3746
|
-
onClick:
|
|
3747
|
-
disabled: !
|
|
3732
|
+
onClick: x,
|
|
3733
|
+
disabled: !S || !l.trim(),
|
|
3748
3734
|
"aria-label": "Send message",
|
|
3749
3735
|
children: /* @__PURE__ */ w(br, {})
|
|
3750
3736
|
}
|
|
@@ -3754,7 +3740,7 @@ function Tr({
|
|
|
3754
3740
|
"button",
|
|
3755
3741
|
{
|
|
3756
3742
|
class: "anam-ctl-btn anam-ctl-end",
|
|
3757
|
-
onClick:
|
|
3743
|
+
onClick: D,
|
|
3758
3744
|
"aria-label": "End call",
|
|
3759
3745
|
children: /* @__PURE__ */ w(Ar, {})
|
|
3760
3746
|
}
|
|
@@ -3766,62 +3752,59 @@ function Tr({
|
|
|
3766
3752
|
function Rr(t) {
|
|
3767
3753
|
const e = Ze(null), n = Vi(!1);
|
|
3768
3754
|
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.");
|
|
3769
|
-
const o = t["session-token"] ? void 0 : t["agent-id"],
|
|
3755
|
+
const o = t["session-token"] ? void 0 : t["agent-id"], c = vr(o, t["api-base-url"], t["session-token"]), a = Ie(
|
|
3770
3756
|
() => yr(t),
|
|
3771
3757
|
[t.inline, t.layout, t.position, t["ui-mute-button"], t["ui-text-input"], t["ui-captions"]]
|
|
3772
|
-
),
|
|
3773
|
-
const
|
|
3758
|
+
), u = Ie(() => {
|
|
3759
|
+
const b = c.serverConfig.value, T = wt(wt({ ...ri }, b ?? {}), a);
|
|
3774
3760
|
return T.layout === "orb" && (T.inline = !1), T;
|
|
3775
|
-
}, [
|
|
3761
|
+
}, [c.serverConfig.value, a]);
|
|
3776
3762
|
gt(() => {
|
|
3777
|
-
|
|
3763
|
+
c.fetchWidgetConfig();
|
|
3778
3764
|
}, [o, t["api-base-url"], t["session-token"]]);
|
|
3779
|
-
const l = t["avatar-url"] ||
|
|
3780
|
-
()
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
const O = On(c.position);
|
|
3785
|
-
return Object.entries(O).map(([T, q]) => `${T}: ${q}`).join("; ");
|
|
3786
|
-
}, [c.inline, c.position]), g = [d, S].filter(Boolean).join("; "), y = Ze(!1), b = () => {
|
|
3765
|
+
const l = t["avatar-url"] || c.avatarThumbnailUrl.value || null, p = t["agent-name"] || c.personaName.value, _ = u.callToAction === ri.callToAction && p ? `Talk to ${p}` : u.callToAction, d = Ie(() => {
|
|
3766
|
+
if (u.inline) return "";
|
|
3767
|
+
const b = On(u.position);
|
|
3768
|
+
return Object.entries(b).map(([T, D]) => `${T}: ${D}`).join("; ");
|
|
3769
|
+
}, [u.inline, u.position]), y = Ze(!1), g = () => {
|
|
3787
3770
|
n.value = !0, y.current = !1, setTimeout(() => {
|
|
3788
|
-
e.current &&
|
|
3771
|
+
e.current && c.startSession(e.current);
|
|
3789
3772
|
}, 50);
|
|
3790
|
-
},
|
|
3791
|
-
|
|
3792
|
-
}, C =
|
|
3793
|
-
(
|
|
3794
|
-
C && n.value &&
|
|
3795
|
-
}, [
|
|
3796
|
-
const
|
|
3797
|
-
return
|
|
3773
|
+
}, S = async () => {
|
|
3774
|
+
c.connectionStatus.value !== "idle" && await c.stopSession(), y.current = !1, n.value = !1;
|
|
3775
|
+
}, C = u.layout === "orb", A = c.connectionStatus.value;
|
|
3776
|
+
(A === "connecting" || A === "connected") && (y.current = !0), gt(() => {
|
|
3777
|
+
C && n.value && A === "idle" && y.current && (y.current = !1, n.value = !1);
|
|
3778
|
+
}, [A]);
|
|
3779
|
+
const I = C ? n.value : !0;
|
|
3780
|
+
return c.isReady.value ? /* @__PURE__ */ w(oe, { children: [
|
|
3798
3781
|
/* @__PURE__ */ w("style", { children: di }),
|
|
3799
3782
|
/* @__PURE__ */ w(
|
|
3800
3783
|
"div",
|
|
3801
3784
|
{
|
|
3802
3785
|
class: "anam-widget",
|
|
3803
|
-
"data-inline":
|
|
3804
|
-
"data-layout":
|
|
3805
|
-
style:
|
|
3786
|
+
"data-inline": u.inline ? "true" : "false",
|
|
3787
|
+
"data-layout": u.layout,
|
|
3788
|
+
style: d,
|
|
3806
3789
|
children: [
|
|
3807
3790
|
C && !n.value && /* @__PURE__ */ w(
|
|
3808
3791
|
"button",
|
|
3809
3792
|
{
|
|
3810
3793
|
class: "anam-trigger",
|
|
3811
|
-
onClick:
|
|
3794
|
+
onClick: g,
|
|
3812
3795
|
"aria-label": _,
|
|
3813
3796
|
children: l ? /* @__PURE__ */ w("img", { src: l, alt: "Avatar" }) : /* @__PURE__ */ w(Ct, {})
|
|
3814
3797
|
}
|
|
3815
3798
|
),
|
|
3816
|
-
|
|
3799
|
+
I && /* @__PURE__ */ w(
|
|
3817
3800
|
Tr,
|
|
3818
3801
|
{
|
|
3819
|
-
config:
|
|
3820
|
-
session:
|
|
3802
|
+
config: u,
|
|
3803
|
+
session: c,
|
|
3821
3804
|
videoRef: e,
|
|
3822
3805
|
avatarSrc: l,
|
|
3823
3806
|
displayCta: _,
|
|
3824
|
-
onCollapse: C ?
|
|
3807
|
+
onCollapse: C ? S : null
|
|
3825
3808
|
}
|
|
3826
3809
|
)
|
|
3827
3810
|
]
|