@streamoji/avatar-widget 0.2.7 → 0.2.8
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/avatar-widget.cjs +5 -5
- package/dist/avatar-widget.cjs.map +1 -1
- package/dist/avatar-widget.css +1 -1
- package/dist/avatar-widget.js +635 -621
- package/dist/avatar-widget.js.map +1 -1
- package/dist/avatar-widget.umd.js +41 -41
- package/dist/avatar-widget.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/avatar-widget.js
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { useGLTF as
|
|
3
|
-
import { useFrame as
|
|
4
|
-
import { memo as
|
|
1
|
+
import { jsx as l, jsxs as ae } from "react/jsx-runtime";
|
|
2
|
+
import { useGLTF as lt, Environment as Yt } from "@react-three/drei";
|
|
3
|
+
import { useFrame as Qt, Canvas as Xt, useThree as Kt } from "@react-three/fiber";
|
|
4
|
+
import { memo as Zt, useMemo as ft, useRef as a, useState as g, useEffect as $, useCallback as Ye, useLayoutEffect as en, Suspense as tn } from "react";
|
|
5
5
|
import * as Ve from "three";
|
|
6
|
-
import { GLTFLoader as
|
|
7
|
-
const
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
16
|
-
let
|
|
17
|
-
f && (f.fftSize = 128,
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
(!w.current || w.current.length !==
|
|
26
|
-
const
|
|
27
|
-
f &&
|
|
28
|
-
const
|
|
29
|
-
for (let M = 0; M <
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
32
|
-
const
|
|
33
|
-
for (let
|
|
34
|
-
const
|
|
35
|
-
|
|
6
|
+
import { GLTFLoader as nn } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
7
|
+
const ut = "https://ai.streamoji.com", V = (...f) => {
|
|
8
|
+
}, rn = (...f) => {
|
|
9
|
+
}, Et = ({ analyser: f }) => {
|
|
10
|
+
const T = a(null), w = a(null);
|
|
11
|
+
return $(() => {
|
|
12
|
+
const p = T.current;
|
|
13
|
+
if (!p) return;
|
|
14
|
+
const b = p.getContext("2d", { alpha: !0 });
|
|
15
|
+
if (!b) return;
|
|
16
|
+
let O, H = null;
|
|
17
|
+
f && (f.fftSize = 128, H = new Uint8Array(f.frequencyBinCount));
|
|
18
|
+
const he = () => {
|
|
19
|
+
O = requestAnimationFrame(he), (p.width !== p.offsetWidth || p.height !== p.offsetHeight) && (p.width = p.offsetWidth, p.height = p.offsetHeight);
|
|
20
|
+
const X = p.width, D = p.height;
|
|
21
|
+
if (X === 0 || D === 0) return;
|
|
22
|
+
const me = D / 2;
|
|
23
|
+
b.clearRect(0, 0, X, D), b.fillStyle = "#1e293b";
|
|
24
|
+
const I = 2, k = I + 2, E = X * 0.95, U = Math.floor(E / k);
|
|
25
|
+
(!w.current || w.current.length !== U) && (w.current = new Float32Array(U).fill(2));
|
|
26
|
+
const be = U * k, y = (X - be) / 2;
|
|
27
|
+
f && H && f.getByteFrequencyData(H);
|
|
28
|
+
const Ie = H ? H.length : 0, G = Math.floor(Ie * 0.7) / U, ce = new Float32Array(U);
|
|
29
|
+
for (let M = 0; M < U; M++) {
|
|
30
|
+
let B = 0;
|
|
31
|
+
if (H && G > 0) {
|
|
32
|
+
const ne = Math.floor(M * G), P = Math.floor((M + 1) * G);
|
|
33
|
+
for (let S = ne; S < P; S++) {
|
|
34
|
+
const x = H[S] || 0;
|
|
35
|
+
x > B && (B = x);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
38
|
+
B < 10 && (B = 0);
|
|
39
|
+
const j = B / 255, N = B > 0 ? Math.max(2, Math.pow(j, 1.4) * D * 0.25) : 2;
|
|
40
|
+
ce[M] = N;
|
|
41
41
|
}
|
|
42
|
-
for (let M = 0; M <
|
|
43
|
-
const
|
|
44
|
-
w.current[M] =
|
|
45
|
-
const
|
|
46
|
-
|
|
42
|
+
for (let M = 0; M < U; M++) {
|
|
43
|
+
const B = U - 1 - M, j = Math.max(ce[M], ce[B]), N = w.current[M] + (j - w.current[M]) * 0.3;
|
|
44
|
+
w.current[M] = N;
|
|
45
|
+
const ne = y + M * k, P = me - N / 2;
|
|
46
|
+
b.beginPath(), b.roundRect ? b.roundRect(ne, P, I, N, 4) : b.fillRect(ne, P, I, N), b.fill();
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
return
|
|
50
|
-
cancelAnimationFrame(
|
|
49
|
+
return he(), () => {
|
|
50
|
+
cancelAnimationFrame(O);
|
|
51
51
|
};
|
|
52
52
|
}, [f]), /* @__PURE__ */ l(
|
|
53
53
|
"canvas",
|
|
54
54
|
{
|
|
55
|
-
ref:
|
|
55
|
+
ref: T,
|
|
56
56
|
style: { width: "100%", height: "100%", display: "block" }
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
|
-
},
|
|
60
|
-
async function
|
|
61
|
-
const
|
|
59
|
+
}, sn = "https://pub-48df6f7d60d6440bbd01676ea5d90e55.r2.dev", It = "https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/default-models/fullbodyavatarmale.glb";
|
|
60
|
+
async function on(f) {
|
|
61
|
+
const T = await crypto.subtle.digest(
|
|
62
62
|
"SHA-256",
|
|
63
63
|
new TextEncoder().encode(f)
|
|
64
64
|
);
|
|
65
|
-
return Array.from(new Uint8Array(
|
|
65
|
+
return Array.from(new Uint8Array(T)).map((w) => w.toString(16).padStart(2, "0")).join("");
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const [
|
|
69
|
-
return
|
|
67
|
+
function an(f) {
|
|
68
|
+
const [T, w] = g(null);
|
|
69
|
+
return $(() => {
|
|
70
70
|
if (!f) {
|
|
71
71
|
w(null);
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
let
|
|
75
|
-
return
|
|
76
|
-
if (
|
|
77
|
-
const
|
|
78
|
-
fetch(
|
|
79
|
-
|
|
74
|
+
let p = !1;
|
|
75
|
+
return on(f).then((b) => {
|
|
76
|
+
if (p) return;
|
|
77
|
+
const O = `${sn}/${b}.glb`;
|
|
78
|
+
fetch(O, { method: "HEAD" }).then((H) => {
|
|
79
|
+
p || w(H.ok ? O : It);
|
|
80
80
|
}).catch(() => {
|
|
81
|
-
|
|
81
|
+
p || w(It);
|
|
82
82
|
});
|
|
83
83
|
}), () => {
|
|
84
|
-
|
|
84
|
+
p = !0;
|
|
85
85
|
};
|
|
86
|
-
}, [f]),
|
|
86
|
+
}, [f]), T;
|
|
87
87
|
}
|
|
88
|
-
const
|
|
88
|
+
const cn = [
|
|
89
89
|
"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_001.glb",
|
|
90
90
|
"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_002.glb",
|
|
91
91
|
"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_002.glb",
|
|
92
92
|
"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_005.glb"
|
|
93
|
-
],
|
|
93
|
+
], ln = [
|
|
94
94
|
"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_001.glb",
|
|
95
95
|
"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_003.glb",
|
|
96
96
|
"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_003.glb"
|
|
97
|
-
],
|
|
97
|
+
], un = [
|
|
98
98
|
{
|
|
99
99
|
id: "m_expr_01",
|
|
100
100
|
name: "Friendly Wave",
|
|
@@ -260,17 +260,17 @@ const an = [
|
|
|
260
260
|
name: "Take It Easy",
|
|
261
261
|
url: "https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_006.glb"
|
|
262
262
|
}
|
|
263
|
-
],
|
|
263
|
+
], dn = [
|
|
264
264
|
"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_005.glb",
|
|
265
265
|
"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_007.glb"
|
|
266
|
-
],
|
|
266
|
+
], fn = {
|
|
267
267
|
zoom: 0.85,
|
|
268
268
|
position: [0.15, -0.8, 0],
|
|
269
269
|
scale: 1.5,
|
|
270
270
|
rotation: [0.15, 0.02, 0]
|
|
271
|
-
},
|
|
271
|
+
}, hn = [-0.45, 1.9, 0.1], mn = {
|
|
272
272
|
browInnerUp: 0.2
|
|
273
|
-
},
|
|
273
|
+
}, dt = 0.18, pn = 1, Mt = "__branding__", Qe = {
|
|
274
274
|
neutral: { eyeLookDownLeft: 0.1, eyeLookDownRight: 0.1 },
|
|
275
275
|
happy: {
|
|
276
276
|
mouthSmileLeft: 0.2,
|
|
@@ -352,7 +352,7 @@ const an = [
|
|
|
352
352
|
mouthUpperUpLeft: 0.1,
|
|
353
353
|
mouthUpperUpRight: 0.1
|
|
354
354
|
}
|
|
355
|
-
},
|
|
355
|
+
}, gn = [
|
|
356
356
|
{ key: "viseme_aa", mix: { jawOpen: 0.6 } },
|
|
357
357
|
{
|
|
358
358
|
key: "viseme_E",
|
|
@@ -448,7 +448,7 @@ const an = [
|
|
|
448
448
|
}
|
|
449
449
|
},
|
|
450
450
|
{ key: "viseme_sil", mix: {} }
|
|
451
|
-
],
|
|
451
|
+
], bn = {
|
|
452
452
|
aei: [
|
|
453
453
|
{ v: "E", w: 0.8 },
|
|
454
454
|
{ v: "I", w: 0.2 }
|
|
@@ -477,333 +477,336 @@ const an = [
|
|
|
477
477
|
],
|
|
478
478
|
sil: [{ v: "sil", w: 1 }]
|
|
479
479
|
};
|
|
480
|
-
function
|
|
480
|
+
function _n(f) {
|
|
481
481
|
if (!f) return [{ v: "sil", w: 1 }];
|
|
482
|
-
const
|
|
483
|
-
return
|
|
482
|
+
const T = f.toLowerCase();
|
|
483
|
+
return bn[T] ?? [{ v: "sil", w: 1 }];
|
|
484
484
|
}
|
|
485
|
-
function
|
|
486
|
-
const { camera:
|
|
487
|
-
return
|
|
488
|
-
|
|
489
|
-
}, [
|
|
485
|
+
function wn({ target: f }) {
|
|
486
|
+
const { camera: T } = Kt();
|
|
487
|
+
return $(() => {
|
|
488
|
+
T.lookAt(...f);
|
|
489
|
+
}, [T, f]), null;
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function Q(f, T, w) {
|
|
492
492
|
if (!f || !f.morphTargetDictionary)
|
|
493
493
|
return;
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
496
|
-
for (const
|
|
497
|
-
|
|
494
|
+
const p = f, b = p.morphTargetDictionary, O = p.morphTargetInfluences;
|
|
495
|
+
if (O)
|
|
496
|
+
for (const H in b)
|
|
497
|
+
H.toLowerCase() === T.toLowerCase() && (O[b[H]] = w);
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function Ct(f, T = 0.97) {
|
|
500
500
|
if (!f) return;
|
|
501
501
|
const w = f;
|
|
502
502
|
if (w.morphTargetInfluences)
|
|
503
|
-
for (let
|
|
504
|
-
w.morphTargetInfluences[
|
|
503
|
+
for (let p = 0; p < w.morphTargetInfluences.length; p++)
|
|
504
|
+
w.morphTargetInfluences[p] *= T;
|
|
505
505
|
}
|
|
506
|
-
const
|
|
506
|
+
const vn = Zt(
|
|
507
507
|
({
|
|
508
508
|
avatarUrl: f,
|
|
509
|
-
isPlayingRef:
|
|
509
|
+
isPlayingRef: T,
|
|
510
510
|
visemeQueueRef: w,
|
|
511
|
-
audioContextRef:
|
|
512
|
-
responseAudioStartTimeRef:
|
|
513
|
-
adjustments:
|
|
514
|
-
mood:
|
|
515
|
-
expression:
|
|
516
|
-
agentResponse:
|
|
517
|
-
isSpeaking:
|
|
518
|
-
nextStartTimeRef:
|
|
519
|
-
stopPlayback:
|
|
520
|
-
setIsSpeaking:
|
|
521
|
-
expressionUrl:
|
|
522
|
-
onExpressionFinished:
|
|
523
|
-
isNudgeResponse:
|
|
524
|
-
avatarGender:
|
|
511
|
+
audioContextRef: p,
|
|
512
|
+
responseAudioStartTimeRef: b,
|
|
513
|
+
adjustments: O,
|
|
514
|
+
mood: H,
|
|
515
|
+
expression: he,
|
|
516
|
+
agentResponse: X,
|
|
517
|
+
isSpeaking: D,
|
|
518
|
+
nextStartTimeRef: me,
|
|
519
|
+
stopPlayback: I,
|
|
520
|
+
setIsSpeaking: v,
|
|
521
|
+
expressionUrl: k,
|
|
522
|
+
onExpressionFinished: E,
|
|
523
|
+
isNudgeResponse: U,
|
|
524
|
+
avatarGender: be
|
|
525
525
|
}) => {
|
|
526
|
-
const { scene:
|
|
527
|
-
() =>
|
|
528
|
-
[
|
|
529
|
-
),
|
|
530
|
-
() =>
|
|
531
|
-
[
|
|
532
|
-
),
|
|
533
|
-
|
|
534
|
-
if (!(!
|
|
535
|
-
if (
|
|
536
|
-
const
|
|
537
|
-
if (!
|
|
538
|
-
const r =
|
|
539
|
-
r.name =
|
|
526
|
+
const { scene: y } = lt(f), Ne = lt(be === "female" ? ln : cn), G = ft(
|
|
527
|
+
() => Ne.flatMap((u) => u.animations),
|
|
528
|
+
[Ne]
|
|
529
|
+
), ce = lt(dn), M = ft(
|
|
530
|
+
() => ce.flatMap((u) => u.animations),
|
|
531
|
+
[ce]
|
|
532
|
+
), B = a(null), j = a(null), N = a(null), ne = a([]), [P] = g(() => new Ve.AnimationMixer(y)), S = a({}), x = a(null), ye = a(0), le = a(!1), $e = a(0), re = a(null);
|
|
533
|
+
$(() => {
|
|
534
|
+
if (!(!G || !y)) {
|
|
535
|
+
if (G.forEach((u, d) => {
|
|
536
|
+
const s = `idle_${d}`;
|
|
537
|
+
if (!S.current[s]) {
|
|
538
|
+
const r = P.clipAction(u, y);
|
|
539
|
+
r.name = s, r.setLoop(Ve.LoopOnce, 1), r.clampWhenFinished = !0, S.current[s] = r;
|
|
540
540
|
}
|
|
541
|
-
}), M.forEach((
|
|
542
|
-
const
|
|
543
|
-
if (!
|
|
544
|
-
const r =
|
|
545
|
-
r.name =
|
|
541
|
+
}), M.forEach((u, d) => {
|
|
542
|
+
const s = `talk_${d}`;
|
|
543
|
+
if (!S.current[s]) {
|
|
544
|
+
const r = P.clipAction(u, y);
|
|
545
|
+
r.name = s, r.setLoop(Ve.LoopOnce, 1), r.clampWhenFinished = !0, S.current[s] = r;
|
|
546
546
|
}
|
|
547
|
-
}),
|
|
548
|
-
const
|
|
549
|
-
|
|
547
|
+
}), G.length > 0) {
|
|
548
|
+
const u = S.current.idle_0, d = x.current && P.existingAction(x.current.getClip());
|
|
549
|
+
u && !d && (u.reset().fadeIn(0.5).play(), x.current = u);
|
|
550
550
|
}
|
|
551
551
|
return () => {
|
|
552
|
-
|
|
552
|
+
P.stopAllAction(), S.current = {}, x.current = null;
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
}, [
|
|
556
|
-
const
|
|
557
|
-
|
|
558
|
-
if (!
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
(
|
|
562
|
-
if (
|
|
563
|
-
const
|
|
564
|
-
if (r.name = `EXPR_${
|
|
565
|
-
const
|
|
566
|
-
r.reset().fadeIn(0.3).play(),
|
|
555
|
+
}, [G, M, y, P]);
|
|
556
|
+
const Se = a("");
|
|
557
|
+
$(() => {
|
|
558
|
+
if (!k || !y || k === Se.current) return;
|
|
559
|
+
Se.current = k, re.current = k, new nn().load(
|
|
560
|
+
k,
|
|
561
|
+
(d) => {
|
|
562
|
+
if (d.animations && d.animations.length > 0) {
|
|
563
|
+
const s = d.animations[0], r = P.clipAction(s, y);
|
|
564
|
+
if (r.name = `EXPR_${k}`, r.setLoop(Ve.LoopOnce, 1), r.clampWhenFinished = !0, S.current[`EXPR_${k}`] = r, D && re.current === k) {
|
|
565
|
+
const m = x.current;
|
|
566
|
+
r.reset().fadeIn(0.3).play(), m && m !== r && m.crossFadeTo(r, 0.3, !0), x.current = r, re.current = null;
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
},
|
|
570
570
|
void 0,
|
|
571
|
-
(
|
|
572
|
-
console.error(`[ANIMATION] Failed to load ${
|
|
571
|
+
(d) => {
|
|
572
|
+
console.error(`[ANIMATION] Failed to load ${k}`, d);
|
|
573
573
|
}
|
|
574
574
|
);
|
|
575
|
-
}, [
|
|
576
|
-
const
|
|
577
|
-
const
|
|
575
|
+
}, [k, y, P, D]), $(() => {
|
|
576
|
+
const u = (d) => {
|
|
577
|
+
const s = d.action, r = s.name || "";
|
|
578
578
|
if (r.startsWith("idle_")) {
|
|
579
|
-
const
|
|
580
|
-
|
|
579
|
+
const z = (parseInt(r.split("_")[1]) + 1) % G.length, K = S.current[`idle_${z}`];
|
|
580
|
+
K && (K.reset().fadeIn(0.5).play(), s.crossFadeTo(K, 0.5, !0), x.current = K);
|
|
581
581
|
} else if (r.startsWith("EXPR_")) {
|
|
582
|
-
if (
|
|
583
|
-
const
|
|
584
|
-
|
|
582
|
+
if (D) {
|
|
583
|
+
const m = S.current.talk_0;
|
|
584
|
+
m && (m.reset().fadeIn(0.5).play(), s.crossFadeTo(m, 0.5, !0), x.current = m);
|
|
585
585
|
} else {
|
|
586
|
-
const
|
|
587
|
-
|
|
586
|
+
const m = S.current.idle_0;
|
|
587
|
+
m && (m.reset().fadeIn(0.5).play(), s.crossFadeTo(m, 0.5, !0), x.current = m);
|
|
588
588
|
}
|
|
589
|
-
|
|
589
|
+
E && E();
|
|
590
590
|
} else if (r.startsWith("talk_"))
|
|
591
|
-
if (
|
|
592
|
-
const
|
|
593
|
-
|
|
591
|
+
if (D && !U) {
|
|
592
|
+
const z = (parseInt(r.split("_")[1]) + 1) % M.length, K = S.current[`talk_${z}`];
|
|
593
|
+
K && (K.reset().fadeIn(0.3).play(), s.crossFadeTo(K, 0.3, !0), x.current = K);
|
|
594
594
|
} else {
|
|
595
|
-
const
|
|
596
|
-
|
|
595
|
+
const m = S.current.idle_0;
|
|
596
|
+
m && (m.reset().fadeIn(0.5).play(), s.crossFadeTo(m, 0.5, !0), x.current = m);
|
|
597
597
|
}
|
|
598
598
|
};
|
|
599
|
-
return
|
|
599
|
+
return P.addEventListener("finished", u), () => P.removeEventListener("finished", u);
|
|
600
600
|
}, [
|
|
601
|
-
|
|
602
|
-
|
|
601
|
+
P,
|
|
602
|
+
G,
|
|
603
603
|
M,
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
]),
|
|
608
|
-
if (
|
|
609
|
-
const
|
|
610
|
-
if (
|
|
611
|
-
const
|
|
612
|
-
if (
|
|
613
|
-
const r =
|
|
604
|
+
D,
|
|
605
|
+
U,
|
|
606
|
+
E
|
|
607
|
+
]), $(() => {
|
|
608
|
+
if (D && y) {
|
|
609
|
+
const u = x.current, d = u?.name || "";
|
|
610
|
+
if (d.startsWith("idle_") || d.startsWith("talk_") || d === "") {
|
|
611
|
+
const s = re.current;
|
|
612
|
+
if (s) {
|
|
613
|
+
const r = S.current[`EXPR_${s}`];
|
|
614
614
|
if (r) {
|
|
615
|
-
r.reset().fadeIn(0.3).play(),
|
|
615
|
+
r.reset().fadeIn(0.3).play(), u && u !== r && u.crossFadeTo(r, 0.3, !0), x.current = r, re.current = null;
|
|
616
616
|
return;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
if (
|
|
620
|
-
const r =
|
|
621
|
-
r && (r.reset().fadeIn(0.5).play(),
|
|
619
|
+
if (d.startsWith("idle_") || d === "") {
|
|
620
|
+
const r = S.current.talk_0;
|
|
621
|
+
r && (r.reset().fadeIn(0.5).play(), u && u.crossFadeTo(r, 0.5, !0), x.current = r);
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
} else if (!
|
|
625
|
-
const
|
|
626
|
-
if (
|
|
627
|
-
const
|
|
628
|
-
|
|
624
|
+
} else if (!D && y) {
|
|
625
|
+
const u = x.current, d = u?.name || "";
|
|
626
|
+
if (d.startsWith("talk_") || d.startsWith("EXPR_")) {
|
|
627
|
+
const s = S.current.idle_0;
|
|
628
|
+
s && (s.reset().fadeIn(0.5).play(), u && u.crossFadeTo(s, 0.5, !0), x.current = s);
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
}, [
|
|
632
|
-
if (!
|
|
633
|
-
|
|
634
|
-
if (
|
|
635
|
-
const r =
|
|
636
|
-
(r.includes("head") || r.includes("avatar")) && (
|
|
631
|
+
}, [D, y, k]), $(() => {
|
|
632
|
+
if (!y) return;
|
|
633
|
+
y.traverse((s) => {
|
|
634
|
+
if (s.isMesh && s.morphTargetDictionary) {
|
|
635
|
+
const r = s.name.toLowerCase();
|
|
636
|
+
(r.includes("head") || r.includes("avatar")) && (j.current = s, V(`[ANIMATION] Found head mesh: ${s.name}`)), r.includes("teeth") && (N.current = s, V(`[ANIMATION] Found teeth mesh: ${s.name}`));
|
|
637
637
|
}
|
|
638
638
|
});
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
(
|
|
639
|
+
const u = j.current?.morphTargetDictionary;
|
|
640
|
+
u && Object.keys(u).filter(
|
|
641
|
+
(s) => s.toLowerCase().includes("brow")
|
|
642
642
|
);
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
if (
|
|
646
|
-
const
|
|
647
|
-
|
|
643
|
+
const d = [];
|
|
644
|
+
y.traverse((s) => {
|
|
645
|
+
if (s.isMesh) {
|
|
646
|
+
const m = s.morphTargetDictionary;
|
|
647
|
+
m && Object.keys(m).some((z) => z.toLowerCase().includes("brow")) && d.push(s);
|
|
648
648
|
}
|
|
649
|
-
}),
|
|
650
|
-
}, [
|
|
651
|
-
const
|
|
652
|
-
const
|
|
649
|
+
}), ne.current = d, d.length > 0 && V("[ANIMATION] Meshes with brow morphs:", d.length);
|
|
650
|
+
}, [y]);
|
|
651
|
+
const xe = (u, d = 1) => {
|
|
652
|
+
const s = `viseme_${u}`.toLowerCase(), r = gn.find((m) => m.key.toLowerCase() === s);
|
|
653
653
|
if (r)
|
|
654
|
-
for (const
|
|
655
|
-
const
|
|
656
|
-
|
|
654
|
+
for (const m in r.mix) {
|
|
655
|
+
const z = r.mix[m] * d;
|
|
656
|
+
Q(j.current, m, z), Q(N.current, m, z);
|
|
657
657
|
}
|
|
658
|
-
},
|
|
659
|
-
const
|
|
660
|
-
for (const
|
|
661
|
-
|
|
658
|
+
}, Fe = (u) => {
|
|
659
|
+
const d = Qe[u] ?? Qe.neutral;
|
|
660
|
+
for (const s in d)
|
|
661
|
+
Q(j.current, s, d[s]), Q(N.current, s, d[s]);
|
|
662
662
|
};
|
|
663
|
-
return
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
const r =
|
|
667
|
-
let
|
|
668
|
-
if (Math.floor(r) % 5 === 0 && Math.floor((r -
|
|
669
|
-
let
|
|
670
|
-
|
|
671
|
-
|
|
663
|
+
return Qt((u, d) => {
|
|
664
|
+
const s = Math.pow(0.88, 60 * d);
|
|
665
|
+
Ct(j.current, s), Ct(N.current, s), Fe(H);
|
|
666
|
+
const r = u.clock.elapsedTime;
|
|
667
|
+
let m = 0;
|
|
668
|
+
if (Math.floor(r) % 5 === 0 && Math.floor((r - d) % 5) !== 0) {
|
|
669
|
+
let J = null;
|
|
670
|
+
y.traverse((te) => {
|
|
671
|
+
te.name.toLowerCase().includes("hips") && (J = te);
|
|
672
672
|
});
|
|
673
|
-
const
|
|
674
|
-
|
|
673
|
+
const ie = J ? `Hips Y: ${J.position.y.toFixed(4)}` : "Hips not found";
|
|
674
|
+
V(`[ANIMATION] Mixer Time: ${P.time.toFixed(2)}, ${ie}`);
|
|
675
675
|
}
|
|
676
|
-
if (
|
|
677
|
-
const
|
|
678
|
-
if (
|
|
679
|
-
|
|
680
|
-
const
|
|
681
|
-
|
|
676
|
+
if (P.update(d), r > ye.current && !le.current && (le.current = !0, $e.current = r), le.current) {
|
|
677
|
+
const J = D ? 0.2 : 0.3, ie = (r - $e.current) / J;
|
|
678
|
+
if (ie >= 1) {
|
|
679
|
+
le.current = !1;
|
|
680
|
+
const te = D ? 1 : 2.5;
|
|
681
|
+
ye.current = r + te;
|
|
682
682
|
} else {
|
|
683
|
-
const
|
|
684
|
-
|
|
683
|
+
const te = ie < 0.5 ? ie * 2 : (1 - ie) * 2;
|
|
684
|
+
Q(j.current, "eyeBlinkLeft", te), Q(j.current, "eyeBlinkRight", te), Q(N.current, "eyeBlinkLeft", te), Q(N.current, "eyeBlinkRight", te), m = te * mn.browInnerUp;
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
|
-
const
|
|
688
|
-
if (
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
687
|
+
const z = Qe[H] ?? Qe.neutral, K = z.browInnerUp ?? 0, Xe = z.browOuterUpLeft ?? 0, Ke = z.browOuterUpRight ?? 0, Me = r * pn, Ze = dt * Math.sin(Me), ke = dt * 0.7 * Math.sin(Me + 0.7), ee = dt * 0.7 * Math.sin(Me + 1.3), Ae = (J) => Math.max(0, Math.min(1, J)), _e = Ae(K + Ze), we = Ae(Xe + ke), Re = Ae(Ke + ee), Ue = Ae(_e + m);
|
|
688
|
+
if (Q(j.current, "browInnerUp", Ue), Q(N.current, "browInnerUp", Ue), Q(j.current, "browOuterUpLeft", we), Q(N.current, "browOuterUpLeft", we), Q(j.current, "browOuterUpRight", Re), Q(N.current, "browOuterUpRight", Re), B.current) {
|
|
689
|
+
const J = T.current ? 0 : O.rotation[1];
|
|
690
|
+
B.current.rotation.y = Ve.MathUtils.lerp(
|
|
691
|
+
B.current.rotation.y,
|
|
692
|
+
J,
|
|
693
693
|
0.1
|
|
694
|
-
),
|
|
694
|
+
), B.current.position.set(...O.position), B.current.scale.setScalar(O.scale), B.current.rotation.x = O.rotation[0], B.current.rotation.z = O.rotation[2];
|
|
695
695
|
}
|
|
696
|
-
if (
|
|
697
|
-
const
|
|
698
|
-
for (let
|
|
699
|
-
const
|
|
700
|
-
|
|
696
|
+
if (T.current && p.current) {
|
|
697
|
+
const J = p.current.currentTime, He = (J - b.current) * 1e3 - -150;
|
|
698
|
+
for (let Le = 0; Le < w.current.length; Le++) {
|
|
699
|
+
const Y = w.current[Le];
|
|
700
|
+
He >= Y.vtime && He < Y.vtime + Y.vduration && xe(Y.viseme, Y.weight ?? 1);
|
|
701
701
|
}
|
|
702
|
-
|
|
702
|
+
J > me.current + 0.5 && (I(), v(!1));
|
|
703
703
|
}
|
|
704
|
-
}), /* @__PURE__ */ l("group", { ref:
|
|
704
|
+
}), /* @__PURE__ */ l("group", { ref: B, children: /* @__PURE__ */ l("primitive", { object: y }) });
|
|
705
705
|
}
|
|
706
706
|
);
|
|
707
|
-
function
|
|
707
|
+
function yn(f) {
|
|
708
708
|
return f ? f.charAt(0).toUpperCase() + f.slice(1).toLowerCase() : "";
|
|
709
709
|
}
|
|
710
|
-
const
|
|
710
|
+
const Sn = ({
|
|
711
711
|
token: f,
|
|
712
|
-
agentToken:
|
|
712
|
+
agentToken: T,
|
|
713
713
|
onNavigationRequested: w,
|
|
714
|
-
avatarGender:
|
|
714
|
+
avatarGender: p,
|
|
715
|
+
presetUserDetails: b
|
|
715
716
|
} = {}) => {
|
|
716
|
-
const
|
|
717
|
+
const O = f ?? T ?? "", H = an(O || void 0), [he, X] = g(""), [D, me] = g(""), [I, v] = g("Ready"), [k, E] = g(!1), [U, be] = g(!1), [y, Ie] = g([]), [Ne, G] = g(""), ce = a(null), [M, B] = g(
|
|
717
718
|
() => typeof window < "u" ? window.matchMedia("(max-width: 480px)").matches : !1
|
|
718
719
|
);
|
|
719
|
-
|
|
720
|
-
const e = window.matchMedia("(max-width: 480px)"), t = () =>
|
|
720
|
+
$(() => {
|
|
721
|
+
const e = window.matchMedia("(max-width: 480px)"), t = () => B(e.matches);
|
|
721
722
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
722
723
|
}, []);
|
|
723
|
-
const
|
|
724
|
-
|
|
725
|
-
const
|
|
724
|
+
const j = M ? 80 : 600, N = a(!1), ne = a([]), P = a(0), S = a(!1), x = a([]), ye = a(null), le = a([]);
|
|
725
|
+
a([]);
|
|
726
|
+
const $e = a([]), re = a(0), Se = a(0), xe = a(0), Fe = a(0), u = a(!1), [d, s] = g(
|
|
726
727
|
null
|
|
727
|
-
),
|
|
728
|
+
), r = a(null), [m, z] = g("neutral"), [K, Xe] = g(""), [Ke, Me] = g(""), [Ze, ke] = g("Chat with us"), [ee, Ae] = g(
|
|
728
729
|
null
|
|
729
|
-
), [
|
|
730
|
-
|
|
731
|
-
const [
|
|
732
|
-
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
if (ue !== "hidden" || !
|
|
736
|
-
|
|
730
|
+
), [_e, we] = g("hidden"), [Re, Ue] = g(""), J = a(null), ie = a(_e);
|
|
731
|
+
ie.current = _e;
|
|
732
|
+
const [te, He] = g(null), Le = a(null), Y = a(null), [Be, ht] = g(!1), mt = a(null), [ue, je] = g("hidden"), [pt, Ot] = g(""), et = a(ue);
|
|
733
|
+
et.current = ue;
|
|
734
|
+
const pe = a(""), Ce = a(!1), Oe = a(""), gt = a(Date.now()), tt = a([]), Pe = a(!1), [nt, We] = g(!1), [bt, _t] = g(!1), ve = a(null), De = ft(() => Be ? "Try again" : I === "Busy" ? "Busy" : I === "Thinking..." || I === "Processing Voice..." ? I : ee != null && ee !== "" && ee !== "none" && ee !== "<none>" ? `Enter ${yn(ee)}` : ue !== "hidden" || !bt ? null : Mt, [I, ee, Be, ue, bt]), wt = !Be && I !== "Busy" && I !== "Thinking..." && I !== "Processing Voice..." && (ee == null || ee === "" || ee === "none" || ee === "<none>");
|
|
735
|
+
$(() => {
|
|
736
|
+
if (ue !== "hidden" || !wt) {
|
|
737
|
+
_t(!1), ve.current != null && (clearTimeout(ve.current), ve.current = null);
|
|
737
738
|
return;
|
|
738
739
|
}
|
|
739
|
-
return
|
|
740
|
-
|
|
740
|
+
return ve.current = setTimeout(() => {
|
|
741
|
+
ve.current = null, _t(!0);
|
|
741
742
|
}, 400), () => {
|
|
742
|
-
|
|
743
|
+
ve.current != null && (clearTimeout(ve.current), ve.current = null);
|
|
743
744
|
};
|
|
744
|
-
}, [ue,
|
|
745
|
-
const
|
|
746
|
-
|
|
747
|
-
const e =
|
|
745
|
+
}, [ue, wt]);
|
|
746
|
+
const Je = De != null && De !== "";
|
|
747
|
+
$(() => {
|
|
748
|
+
const e = ie.current;
|
|
748
749
|
if (!(e === "exiting" || e === "entering")) {
|
|
749
750
|
if (e === "hidden") {
|
|
750
|
-
|
|
751
|
+
Je && (Ue(De ?? ""), we("entering"));
|
|
751
752
|
return;
|
|
752
753
|
}
|
|
753
|
-
e === "visible" && (!
|
|
754
|
+
e === "visible" && (!Je || De !== Re) && (J.current = Je ? De : null, we("exiting"));
|
|
754
755
|
}
|
|
755
756
|
}, [
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
]),
|
|
761
|
-
if (
|
|
762
|
-
|
|
757
|
+
Je,
|
|
758
|
+
De,
|
|
759
|
+
_e,
|
|
760
|
+
Re
|
|
761
|
+
]), $(() => {
|
|
762
|
+
if (I !== "Busy") {
|
|
763
|
+
Y.current != null && (clearTimeout(Y.current), Y.current = null);
|
|
763
764
|
return;
|
|
764
765
|
}
|
|
765
|
-
return
|
|
766
|
-
|
|
766
|
+
return Y.current = setTimeout(() => {
|
|
767
|
+
Y.current = null, v("Ready"), ht(!0);
|
|
767
768
|
}, 12e3), () => {
|
|
768
|
-
|
|
769
|
+
Y.current != null && (clearTimeout(Y.current), Y.current = null);
|
|
769
770
|
};
|
|
770
|
-
}, [
|
|
771
|
-
if (!
|
|
772
|
-
const e = setTimeout(() =>
|
|
771
|
+
}, [I]), $(() => {
|
|
772
|
+
if (!Be) return;
|
|
773
|
+
const e = setTimeout(() => ht(!1), 2500);
|
|
773
774
|
return () => clearTimeout(e);
|
|
774
|
-
}, [
|
|
775
|
-
const
|
|
776
|
-
const e =
|
|
775
|
+
}, [Be]);
|
|
776
|
+
const Dt = Ye(() => {
|
|
777
|
+
const e = ie.current;
|
|
777
778
|
if (e === "exiting") {
|
|
778
|
-
|
|
779
|
-
const t =
|
|
780
|
-
|
|
781
|
-
} else e === "entering" &&
|
|
782
|
-
}, []),
|
|
779
|
+
we("hidden");
|
|
780
|
+
const t = J.current;
|
|
781
|
+
J.current = null, t != null && t !== "" && (Ue(t), we("entering"));
|
|
782
|
+
} else e === "entering" && we("visible");
|
|
783
|
+
}, []), Nt = (e) => {
|
|
783
784
|
if (!e) return;
|
|
784
785
|
if (e.mood != null) {
|
|
785
786
|
const n = String(e.mood).toLowerCase();
|
|
786
|
-
|
|
787
|
+
z(n);
|
|
787
788
|
}
|
|
788
789
|
if (e.expression != null) {
|
|
789
790
|
const n = String(e.expression).trim();
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
(
|
|
791
|
+
Xe(n);
|
|
792
|
+
const c = un.find(
|
|
793
|
+
(h) => h.name.toLowerCase() === n.toLowerCase()
|
|
793
794
|
);
|
|
794
|
-
|
|
795
|
-
`[STREAM] Animation match for "${n}": ${
|
|
796
|
-
),
|
|
795
|
+
V(
|
|
796
|
+
`[STREAM] Animation match for "${n}": ${c ? c.name : "NONE"}`
|
|
797
|
+
), Me(c?.url ?? "");
|
|
797
798
|
}
|
|
798
799
|
if (e.navigation != null) {
|
|
799
800
|
const n = String(e.navigation).trim();
|
|
800
801
|
n !== "" && (w ? w(n) : window.open(n, "_blank"));
|
|
801
802
|
}
|
|
802
|
-
const t = e.ask_for || e.lead_capture?.ask_for,
|
|
803
|
+
const t = e.ask_for || e.lead_capture?.ask_for, i = t ? String(t).trim().toLowerCase() : "", o = i === "none" || i === "<none>";
|
|
803
804
|
if (t && !o) {
|
|
804
|
-
const n =
|
|
805
|
-
|
|
806
|
-
|
|
805
|
+
const n = i;
|
|
806
|
+
if (b && (n === "email" && b.email || n === "name" && b.name || n === "phone" && b.phone))
|
|
807
|
+
return;
|
|
808
|
+
Ae(n || null), ke(n === "email" ? "Enter your email" : n === "name" ? "Enter your name" : n === "phone" ? "Enter your phone number" : "Chat with us");
|
|
809
|
+
} else (o || e.ask_for === null || e.lead_capture && e.lead_capture.ask_for === null || e.ask_for === "none") && (Ae(null), Ze !== "Chat with us" && ke("Chat with us"));
|
|
807
810
|
e.collected, e.valid;
|
|
808
811
|
}, Ft = (e) => {
|
|
809
812
|
const t = e.trim();
|
|
@@ -815,81 +818,92 @@ const yn = ({
|
|
|
815
818
|
return null;
|
|
816
819
|
}
|
|
817
820
|
if (t.includes(":")) {
|
|
818
|
-
const
|
|
821
|
+
const i = t.split(":"), o = i[0].trim().toLowerCase(), n = i.slice(1).join(":").trim();
|
|
819
822
|
return { [o]: n };
|
|
820
823
|
}
|
|
821
824
|
return null;
|
|
822
|
-
},
|
|
823
|
-
}, []),
|
|
825
|
+
}, Ut = Ye(() => {
|
|
826
|
+
}, []), vt = (e) => {
|
|
824
827
|
if (Ce.current)
|
|
825
|
-
e === "§" ? Ce.current = !1 : (Oe.current += e,
|
|
828
|
+
e === "§" ? Ce.current = !1 : (Oe.current += e, me((t) => t + e));
|
|
826
829
|
else if (e === "§") {
|
|
827
830
|
Ce.current = !0;
|
|
828
831
|
return;
|
|
829
832
|
} else
|
|
830
|
-
for (
|
|
833
|
+
for (pe.current += e; pe.current.includes(`
|
|
831
834
|
`); ) {
|
|
832
|
-
const t =
|
|
833
|
-
`),
|
|
834
|
-
|
|
835
|
-
const o = Ft(
|
|
836
|
-
o &&
|
|
835
|
+
const t = pe.current.indexOf(`
|
|
836
|
+
`), i = pe.current.slice(0, t).trim();
|
|
837
|
+
pe.current = pe.current.slice(t + 1);
|
|
838
|
+
const o = Ft(i);
|
|
839
|
+
o && Nt(o);
|
|
837
840
|
}
|
|
838
841
|
};
|
|
839
|
-
|
|
842
|
+
$(() => {
|
|
840
843
|
(async () => {
|
|
841
844
|
if (!sessionStorage.getItem(
|
|
842
845
|
"STREAMOJI_LEADS_SESSION_LEAD_ID"
|
|
843
846
|
)) {
|
|
844
|
-
const
|
|
847
|
+
const n = "secret", c = Math.floor(Date.now() / 1e3).toString();
|
|
845
848
|
try {
|
|
846
|
-
const
|
|
849
|
+
const h = new TextEncoder(), _ = await crypto.subtle.importKey(
|
|
847
850
|
"raw",
|
|
848
|
-
|
|
851
|
+
h.encode(n),
|
|
849
852
|
{ name: "HMAC", hash: "SHA-256" },
|
|
850
853
|
!1,
|
|
851
854
|
["sign"]
|
|
852
|
-
),
|
|
855
|
+
), A = await crypto.subtle.sign(
|
|
853
856
|
"HMAC",
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
),
|
|
857
|
-
sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID",
|
|
858
|
-
} catch (
|
|
859
|
-
console.error("[SESSION] HMAC generation failed:",
|
|
860
|
-
const
|
|
861
|
-
sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID",
|
|
857
|
+
_,
|
|
858
|
+
h.encode(c)
|
|
859
|
+
), L = Array.from(new Uint8Array(A)).map((W) => W.toString(16).padStart(2, "0")).join("");
|
|
860
|
+
sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID", L), V("[SESSION] New HMAC UID generated and saved:", L);
|
|
861
|
+
} catch (h) {
|
|
862
|
+
console.error("[SESSION] HMAC generation failed:", h);
|
|
863
|
+
const _ = Math.random().toString(36) + Date.now().toString();
|
|
864
|
+
sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID", _);
|
|
862
865
|
}
|
|
863
866
|
}
|
|
864
|
-
sessionStorage.getItem("STREAMOJI_LEADS_SESSION_MESSAGES")
|
|
867
|
+
const i = sessionStorage.getItem("STREAMOJI_LEADS_SESSION_MESSAGES");
|
|
868
|
+
let o = [];
|
|
869
|
+
if (i)
|
|
870
|
+
try {
|
|
871
|
+
o = JSON.parse(i);
|
|
872
|
+
} catch {
|
|
873
|
+
o = [];
|
|
874
|
+
}
|
|
875
|
+
o.length === 0 && b && (b.name || b.email) ? (o = [{ role: "user", content: `PRESET_USER_DETAILS: Name is "${b.name || ""}" , Email is "${b.email || ""}"` }], sessionStorage.setItem(
|
|
876
|
+
"STREAMOJI_LEADS_SESSION_MESSAGES",
|
|
877
|
+
JSON.stringify(o)
|
|
878
|
+
)) : i || sessionStorage.setItem(
|
|
865
879
|
"STREAMOJI_LEADS_SESSION_MESSAGES",
|
|
866
880
|
JSON.stringify([])
|
|
867
881
|
);
|
|
868
882
|
})();
|
|
869
|
-
}, []),
|
|
883
|
+
}, [b]), $(() => {
|
|
870
884
|
const e = () => {
|
|
871
|
-
|
|
885
|
+
gt.current = Date.now(), Pe.current && (Pe.current = !1, We(!1), Ie([]), G(""), me(""), be(!1));
|
|
872
886
|
};
|
|
873
887
|
window.addEventListener("mousemove", e), window.addEventListener("keydown", e), window.addEventListener("mousedown", e), window.addEventListener("touchstart", e);
|
|
874
888
|
const t = setInterval(async () => {
|
|
875
|
-
if (Date.now() -
|
|
876
|
-
if (Pe.current = !0,
|
|
877
|
-
We(!0),
|
|
889
|
+
if (Date.now() - gt.current >= 3e4 && !U && !k && I === "Ready" && !Pe.current)
|
|
890
|
+
if (Pe.current = !0, tt.current.length > 0)
|
|
891
|
+
We(!0), Ie(tt.current);
|
|
878
892
|
else
|
|
879
893
|
try {
|
|
880
|
-
const n = `${
|
|
894
|
+
const n = `${ut}/nudgeUser`, c = {
|
|
881
895
|
navigationUrl: window.location.href,
|
|
882
|
-
token:
|
|
883
|
-
},
|
|
896
|
+
token: O
|
|
897
|
+
}, h = await fetch(n, {
|
|
884
898
|
method: "POST",
|
|
885
899
|
headers: {
|
|
886
900
|
"Content-Type": "application/json"
|
|
887
901
|
},
|
|
888
|
-
body: JSON.stringify(
|
|
902
|
+
body: JSON.stringify(c)
|
|
889
903
|
});
|
|
890
|
-
if (
|
|
891
|
-
const
|
|
892
|
-
|
|
904
|
+
if (h.ok) {
|
|
905
|
+
const A = (await h.json()).nudge_questions;
|
|
906
|
+
A && A.length > 0 && (V("[NUDGE] Received nudge questions from API:", A), tt.current = A, We(!0), Ie(A));
|
|
893
907
|
}
|
|
894
908
|
} catch (n) {
|
|
895
909
|
console.error("[NUDGE] Error calling /nudgeUser:", n), Pe.current = !1;
|
|
@@ -898,25 +912,25 @@ const yn = ({
|
|
|
898
912
|
return () => {
|
|
899
913
|
window.removeEventListener("mousemove", e), window.removeEventListener("keydown", e), window.removeEventListener("mousedown", e), window.removeEventListener("touchstart", e), clearInterval(t);
|
|
900
914
|
};
|
|
901
|
-
}, [
|
|
902
|
-
if (
|
|
903
|
-
let e = 0, t = 0,
|
|
915
|
+
}, [O, U, k, I]), $(() => {
|
|
916
|
+
if (y.length === 0) return;
|
|
917
|
+
let e = 0, t = 0, i = !1, o = 100;
|
|
904
918
|
const n = () => {
|
|
905
|
-
const
|
|
906
|
-
if (
|
|
907
|
-
const
|
|
908
|
-
|
|
919
|
+
const c = y[e];
|
|
920
|
+
if (i) {
|
|
921
|
+
const h = c.substring(0, t - 1);
|
|
922
|
+
G(h), t--, o = 50;
|
|
909
923
|
} else {
|
|
910
|
-
const
|
|
911
|
-
|
|
924
|
+
const h = c.substring(0, t + 1);
|
|
925
|
+
G(h), t++, o = 100;
|
|
912
926
|
}
|
|
913
|
-
!
|
|
927
|
+
!i && t === c.length ? (i = !0, o = 3e3) : i && t === 0 && (i = !1, e = (e + 1) % y.length, o = 500), ce.current = setTimeout(n, o);
|
|
914
928
|
};
|
|
915
929
|
return n(), () => {
|
|
916
|
-
|
|
930
|
+
ce.current && clearTimeout(ce.current);
|
|
917
931
|
};
|
|
918
|
-
}, [
|
|
919
|
-
const
|
|
932
|
+
}, [y]);
|
|
933
|
+
const yt = () => {
|
|
920
934
|
try {
|
|
921
935
|
return JSON.parse(
|
|
922
936
|
sessionStorage.getItem("STREAMOJI_LEADS_SESSION_MESSAGES") || "[]"
|
|
@@ -924,194 +938,194 @@ const yn = ({
|
|
|
924
938
|
} catch {
|
|
925
939
|
return [];
|
|
926
940
|
}
|
|
927
|
-
},
|
|
941
|
+
}, Bt = (e) => {
|
|
928
942
|
sessionStorage.setItem(
|
|
929
943
|
"STREAMOJI_LEADS_SESSION_MESSAGES",
|
|
930
944
|
JSON.stringify(e)
|
|
931
945
|
);
|
|
932
|
-
}, [
|
|
946
|
+
}, [rt, it] = g(!1), [St, st] = g(0), de = a(null), qe = a([]), xt = a(0), [kt, Pt] = g(
|
|
933
947
|
null
|
|
934
|
-
), [
|
|
948
|
+
), [Wt, ot] = g(
|
|
935
949
|
null
|
|
936
|
-
),
|
|
950
|
+
), ge = a(null), Te = a(
|
|
937
951
|
null
|
|
938
|
-
),
|
|
939
|
-
e && (
|
|
952
|
+
), Ge = Ye((e = !1) => {
|
|
953
|
+
e && (u.current = !0, E(!1), v("Ready")), x.current = [], ne.current = [], S.current = !1, be(!1), re.current = 0, Se.current = 0, xe.current = 0, le.current.forEach((t) => {
|
|
940
954
|
try {
|
|
941
955
|
t.stop();
|
|
942
956
|
} catch {
|
|
943
957
|
}
|
|
944
|
-
}),
|
|
945
|
-
}, []),
|
|
958
|
+
}), Le.current && (clearTimeout(Le.current), Le.current = null), He(null), Me(""), le.current = [];
|
|
959
|
+
}, []), Vt = async () => {
|
|
946
960
|
try {
|
|
947
|
-
const e = await navigator.mediaDevices.getUserMedia({ audio: !0 }), t = window.AudioContext || window.webkitAudioContext,
|
|
948
|
-
n.fftSize = 64, o.connect(n),
|
|
949
|
-
const
|
|
950
|
-
de.current =
|
|
951
|
-
|
|
952
|
-
},
|
|
953
|
-
const
|
|
954
|
-
if (
|
|
955
|
-
|
|
961
|
+
const e = await navigator.mediaDevices.getUserMedia({ audio: !0 }), t = window.AudioContext || window.webkitAudioContext, i = new t(), o = i.createMediaStreamSource(e), n = i.createAnalyser();
|
|
962
|
+
n.fftSize = 64, o.connect(n), ge.current = i, Te.current = o, ot(n);
|
|
963
|
+
const c = new MediaRecorder(e);
|
|
964
|
+
de.current = c, qe.current = [], c.ondataavailable = (h) => {
|
|
965
|
+
h.data.size > 0 && qe.current.push(h.data);
|
|
966
|
+
}, c.onstop = async () => {
|
|
967
|
+
const h = Date.now() - xt.current;
|
|
968
|
+
if (ot(null), Te.current && (Te.current.disconnect(), Te.current = null), ge.current && ge.current.state !== "closed" && (ge.current.close(), ge.current = null), h < 1e3) {
|
|
969
|
+
v("Recording too short. Hold or click longer."), E(!1);
|
|
956
970
|
return;
|
|
957
971
|
}
|
|
958
|
-
const
|
|
972
|
+
const _ = new Blob(qe.current, {
|
|
959
973
|
type: "audio/wav"
|
|
960
974
|
});
|
|
961
|
-
await
|
|
962
|
-
},
|
|
975
|
+
await Jt(_);
|
|
976
|
+
}, xt.current = Date.now(), c.start(100), it(!0), v("Listening...");
|
|
963
977
|
} catch (e) {
|
|
964
|
-
console.error("Error accessing microphone:", e),
|
|
978
|
+
console.error("Error accessing microphone:", e), v("Mic Access Error");
|
|
965
979
|
}
|
|
966
|
-
},
|
|
967
|
-
de.current && de.current.state !== "inactive" && (de.current.stop(), de.current.stream.getTracks().forEach((e) => e.stop()),
|
|
980
|
+
}, $t = () => {
|
|
981
|
+
de.current && de.current.state !== "inactive" && (de.current.stop(), de.current.stream.getTracks().forEach((e) => e.stop()), it(!1));
|
|
968
982
|
}, Ht = () => {
|
|
969
|
-
de.current && de.current.state !== "inactive" && (de.current.onstop = null, de.current.stop(), de.current.stream.getTracks().forEach((e) => e.stop()),
|
|
983
|
+
de.current && de.current.state !== "inactive" && (de.current.onstop = null, de.current.stop(), de.current.stream.getTracks().forEach((e) => e.stop()), ot(null), Te.current && (Te.current.disconnect(), Te.current = null), ge.current && ge.current.state !== "closed" && (ge.current.close(), ge.current = null), it(!1), qe.current = [], v("Ready"));
|
|
970
984
|
};
|
|
971
|
-
|
|
972
|
-
if (!
|
|
985
|
+
$(() => {
|
|
986
|
+
if (!U) return;
|
|
973
987
|
const e = () => {
|
|
974
|
-
const t =
|
|
988
|
+
const t = xe.current;
|
|
975
989
|
if (t <= 0) return;
|
|
976
|
-
const
|
|
977
|
-
if (!
|
|
978
|
-
const n =
|
|
979
|
-
if (
|
|
980
|
-
const
|
|
981
|
-
Math.round(
|
|
982
|
-
|
|
990
|
+
const i = ye.current, o = re.current;
|
|
991
|
+
if (!i) return;
|
|
992
|
+
const n = i.currentTime - o, c = Math.min(Math.max(0, n), t), h = D.trim().length;
|
|
993
|
+
if (h <= 0) return;
|
|
994
|
+
const _ = Math.min(
|
|
995
|
+
Math.round(c / t * h),
|
|
996
|
+
h
|
|
983
997
|
);
|
|
984
|
-
|
|
998
|
+
s(_);
|
|
985
999
|
};
|
|
986
|
-
return clearInterval(
|
|
987
|
-
}, [
|
|
1000
|
+
return clearInterval(r.current ?? void 0), r.current = setInterval(e, 90), () => clearInterval(r.current ?? void 0);
|
|
1001
|
+
}, [U, D, xe.current]), $(() => {
|
|
988
1002
|
let e;
|
|
989
|
-
return
|
|
1003
|
+
return rt ? (st(0), e = window.setInterval(() => {
|
|
990
1004
|
st((t) => t + 1);
|
|
991
1005
|
}, 1e3)) : st(0), () => clearInterval(e);
|
|
992
|
-
}, [
|
|
993
|
-
const
|
|
994
|
-
const t = e.numberOfChannels,
|
|
995
|
-
let
|
|
996
|
-
const
|
|
997
|
-
n.setUint16(
|
|
998
|
-
},
|
|
999
|
-
n.setUint32(
|
|
1006
|
+
}, [rt]);
|
|
1007
|
+
const jt = (e) => {
|
|
1008
|
+
const t = e.numberOfChannels, i = e.length * t * 2 + 44, o = new ArrayBuffer(i), n = new DataView(o);
|
|
1009
|
+
let c = 0;
|
|
1010
|
+
const h = (L) => {
|
|
1011
|
+
n.setUint16(c, L, !0), c += 2;
|
|
1012
|
+
}, _ = (L) => {
|
|
1013
|
+
n.setUint32(c, L, !0), c += 4;
|
|
1000
1014
|
};
|
|
1001
|
-
|
|
1002
|
-
const
|
|
1003
|
-
for (let
|
|
1004
|
-
let
|
|
1005
|
-
for (;
|
|
1006
|
-
for (let
|
|
1007
|
-
let
|
|
1008
|
-
|
|
1015
|
+
_(1179011410), _(i - 8), _(1163280727), _(544501094), _(16), h(1), h(t), _(e.sampleRate), _(e.sampleRate * 2 * t), h(t * 2), h(16), _(1635017060), _(i - c - 4);
|
|
1016
|
+
const A = [];
|
|
1017
|
+
for (let L = 0; L < t; L++) A.push(e.getChannelData(L));
|
|
1018
|
+
let R = 0;
|
|
1019
|
+
for (; c < i; ) {
|
|
1020
|
+
for (let L = 0; L < t; L++) {
|
|
1021
|
+
let W = Math.max(-1, Math.min(1, A[L][R]));
|
|
1022
|
+
W = W < 0 ? W * 32768 : W * 32767, n.setInt16(c, W, !0), c += 2;
|
|
1009
1023
|
}
|
|
1010
|
-
|
|
1024
|
+
R++;
|
|
1011
1025
|
}
|
|
1012
1026
|
return new Blob([o], { type: "audio/wav" });
|
|
1013
|
-
},
|
|
1014
|
-
if (!
|
|
1015
|
-
if (
|
|
1016
|
-
|
|
1027
|
+
}, at = async (e, t, i = !1) => {
|
|
1028
|
+
if (!u.current) {
|
|
1029
|
+
if (N.current) {
|
|
1030
|
+
ne.current.push({
|
|
1017
1031
|
audio: e,
|
|
1018
1032
|
visemes: t,
|
|
1019
|
-
isNewSegment:
|
|
1033
|
+
isNewSegment: i
|
|
1020
1034
|
});
|
|
1021
1035
|
return;
|
|
1022
1036
|
}
|
|
1023
|
-
|
|
1037
|
+
N.current = !0;
|
|
1024
1038
|
try {
|
|
1025
|
-
const o = window.AudioContext || window.webkitAudioContext, n =
|
|
1026
|
-
n.state === "suspended" && await n.resume(),
|
|
1027
|
-
const
|
|
1028
|
-
for (let
|
|
1029
|
-
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
const
|
|
1033
|
-
let
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1038
|
-
let
|
|
1039
|
-
if ((!
|
|
1040
|
-
|
|
1039
|
+
const o = window.AudioContext || window.webkitAudioContext, n = ye.current ?? new o();
|
|
1040
|
+
n.state === "suspended" && await n.resume(), ye.current = n;
|
|
1041
|
+
const c = window.atob(e), h = new Uint8Array(c.length);
|
|
1042
|
+
for (let F = 0; F < c.length; F++)
|
|
1043
|
+
h[F] = c.charCodeAt(F);
|
|
1044
|
+
const _ = await n.decodeAudioData(h.buffer.slice(0));
|
|
1045
|
+
xe.current += _.duration;
|
|
1046
|
+
const A = n.currentTime;
|
|
1047
|
+
let R = Se.current;
|
|
1048
|
+
const L = !S.current;
|
|
1049
|
+
R < A && (R = A + 0.1), Se.current = R + _.duration;
|
|
1050
|
+
const W = n.createBufferSource();
|
|
1051
|
+
W.buffer = _;
|
|
1052
|
+
let q = kt;
|
|
1053
|
+
if ((!q || q.context !== n) && (q = n.createAnalyser(), q.fftSize = 64, q.connect(n.destination), Pt(q)), W.connect(q), le.current.push(W), u.current) {
|
|
1054
|
+
le.current = le.current.filter((F) => F !== W);
|
|
1041
1055
|
return;
|
|
1042
1056
|
}
|
|
1043
|
-
if (
|
|
1044
|
-
|
|
1045
|
-
`[AUDIO] setIsSpeaking(true) - First chunk starting at ${
|
|
1057
|
+
if (L) {
|
|
1058
|
+
S.current = !0, be(!0), V(
|
|
1059
|
+
`[AUDIO] setIsSpeaking(true) - First chunk starting at ${R.toFixed(
|
|
1046
1060
|
3
|
|
1047
1061
|
)}`
|
|
1048
|
-
),
|
|
1049
|
-
const
|
|
1050
|
-
|
|
1051
|
-
`[AUDIO] Response started. Initial startTime: ${
|
|
1062
|
+
), re.current = R;
|
|
1063
|
+
const F = (R - A) * 1e3;
|
|
1064
|
+
P.current = performance.now() + F, V(
|
|
1065
|
+
`[AUDIO] Response started. Initial startTime: ${R.toFixed(
|
|
1052
1066
|
3
|
|
1053
|
-
)}, CT: ${
|
|
1067
|
+
)}, CT: ${A.toFixed(3)}`
|
|
1054
1068
|
);
|
|
1055
1069
|
}
|
|
1056
|
-
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1059
|
-
`[AUDIO] New segment detected at +${
|
|
1070
|
+
W.start(R);
|
|
1071
|
+
const Z = (R - re.current) * 1e3;
|
|
1072
|
+
i && (Fe.current = Z, V(
|
|
1073
|
+
`[AUDIO] New segment detected at +${Z.toFixed(
|
|
1060
1074
|
0
|
|
1061
1075
|
)}ms. Resetting segment offset.`
|
|
1062
|
-
)), t.forEach((
|
|
1063
|
-
const C =
|
|
1076
|
+
)), t.forEach((F, se) => {
|
|
1077
|
+
const C = F.symbol ?? "";
|
|
1064
1078
|
if (C) {
|
|
1065
|
-
const
|
|
1066
|
-
se < 3 &&
|
|
1067
|
-
`[AUDIO] Viseme "${C}": segment_relative=${fe}ms, segment_offset=${
|
|
1079
|
+
const oe = _n(C), fe = Math.round(F.start * 1e3), Ee = Math.round((F.duration ?? 0) * 1e3), Lt = Fe.current + fe;
|
|
1080
|
+
se < 3 && V(
|
|
1081
|
+
`[AUDIO] Viseme "${C}": segment_relative=${fe}ms, segment_offset=${Fe.current.toFixed(
|
|
1068
1082
|
0
|
|
1069
|
-
)}ms => vtime=${
|
|
1070
|
-
),
|
|
1071
|
-
|
|
1072
|
-
viseme:
|
|
1073
|
-
weight:
|
|
1074
|
-
vtime:
|
|
1083
|
+
)}ms => vtime=${Lt}ms`
|
|
1084
|
+
), oe.forEach((Tt) => {
|
|
1085
|
+
x.current.push({
|
|
1086
|
+
viseme: Tt.v,
|
|
1087
|
+
weight: Tt.w,
|
|
1088
|
+
vtime: Lt,
|
|
1075
1089
|
vduration: Ee
|
|
1076
1090
|
});
|
|
1077
1091
|
});
|
|
1078
1092
|
}
|
|
1079
|
-
}),
|
|
1093
|
+
}), v("Speaking...");
|
|
1080
1094
|
} finally {
|
|
1081
|
-
if (
|
|
1082
|
-
const o =
|
|
1083
|
-
o &&
|
|
1095
|
+
if (N.current = !1, ne.current.length > 0) {
|
|
1096
|
+
const o = ne.current.shift();
|
|
1097
|
+
o && at(o.audio, o.visemes, o.isNewSegment);
|
|
1084
1098
|
}
|
|
1085
1099
|
}
|
|
1086
1100
|
}
|
|
1087
|
-
},
|
|
1101
|
+
}, Jt = async (e) => {
|
|
1088
1102
|
try {
|
|
1089
|
-
|
|
1090
|
-
const t = await e.arrayBuffer(), o = await new (window.AudioContext || window.webkitAudioContext)().decodeAudioData(t), n =
|
|
1091
|
-
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1096
|
-
)}`,
|
|
1103
|
+
E(!0), We(!1), Oe.current = "", me(""), v("Processing Voice...");
|
|
1104
|
+
const t = await e.arrayBuffer(), o = await new (window.AudioContext || window.webkitAudioContext)().decodeAudioData(t), n = jt(o), c = new FileReader();
|
|
1105
|
+
c.readAsDataURL(n), c.onloadend = async () => {
|
|
1106
|
+
const h = c.result.split(",")[1];
|
|
1107
|
+
Ge(), X(""), pe.current = "", Ce.current = !1;
|
|
1108
|
+
const _ = `${ut}/stt?token=${encodeURIComponent(
|
|
1109
|
+
O
|
|
1110
|
+
)}`, A = await fetch(_, {
|
|
1097
1111
|
method: "POST",
|
|
1098
1112
|
headers: { "Content-Type": "application/json" },
|
|
1099
1113
|
body: JSON.stringify({
|
|
1100
|
-
audio_base64:
|
|
1114
|
+
audio_base64: h,
|
|
1101
1115
|
audio_format: "wav"
|
|
1102
1116
|
})
|
|
1103
1117
|
});
|
|
1104
|
-
if (
|
|
1118
|
+
if (A.status === 429) {
|
|
1105
1119
|
try {
|
|
1106
|
-
const se = await
|
|
1107
|
-
|
|
1120
|
+
const se = await A.text(), C = JSON.parse(se);
|
|
1121
|
+
V("[STT] 429 agent at capacity:", C?.detail);
|
|
1108
1122
|
} catch {
|
|
1109
1123
|
}
|
|
1110
|
-
|
|
1124
|
+
X(""), v("Busy"), E(!1);
|
|
1111
1125
|
return;
|
|
1112
1126
|
}
|
|
1113
|
-
if (!
|
|
1114
|
-
const se = await
|
|
1127
|
+
if (!A.ok) {
|
|
1128
|
+
const se = await A.text();
|
|
1115
1129
|
let C = "STT Failed";
|
|
1116
1130
|
try {
|
|
1117
1131
|
C = JSON.parse(se).error || C;
|
|
@@ -1120,36 +1134,36 @@ const yn = ({
|
|
|
1120
1134
|
}
|
|
1121
1135
|
throw new Error(C);
|
|
1122
1136
|
}
|
|
1123
|
-
const
|
|
1124
|
-
if (
|
|
1125
|
-
|
|
1137
|
+
const R = A.body;
|
|
1138
|
+
if (V("this is body" + R), !R) {
|
|
1139
|
+
v("STT Failed"), E(!1);
|
|
1126
1140
|
return;
|
|
1127
1141
|
}
|
|
1128
|
-
const
|
|
1129
|
-
|
|
1130
|
-
const
|
|
1131
|
-
let
|
|
1132
|
-
const
|
|
1142
|
+
const L = R.getReader();
|
|
1143
|
+
u.current = !1;
|
|
1144
|
+
const W = new TextDecoder();
|
|
1145
|
+
let q = "", Z = !1;
|
|
1146
|
+
const F = async (se, C) => {
|
|
1133
1147
|
switch (se) {
|
|
1134
1148
|
case "transcript":
|
|
1135
|
-
C.transcript != null &&
|
|
1149
|
+
C.transcript != null && X(String(C.transcript));
|
|
1136
1150
|
break;
|
|
1137
1151
|
case "text": {
|
|
1138
|
-
const
|
|
1139
|
-
|
|
1152
|
+
const oe = C.delta ?? C.text ?? "";
|
|
1153
|
+
oe && vt(oe);
|
|
1140
1154
|
break;
|
|
1141
1155
|
}
|
|
1142
1156
|
case "audio": {
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1157
|
+
const oe = C.chunk, fe = C.visemes ?? [], Ee = !!C.is_new_segment;
|
|
1158
|
+
oe && await at(oe, fe, Ee);
|
|
1145
1159
|
break;
|
|
1146
1160
|
}
|
|
1147
1161
|
case "done": {
|
|
1148
|
-
|
|
1162
|
+
Z = !0, v("Ready"), E(!1);
|
|
1149
1163
|
break;
|
|
1150
1164
|
}
|
|
1151
1165
|
case "error": {
|
|
1152
|
-
|
|
1166
|
+
Z = !0, v("STT Failed"), E(!1);
|
|
1153
1167
|
break;
|
|
1154
1168
|
}
|
|
1155
1169
|
default:
|
|
@@ -1157,37 +1171,37 @@ const yn = ({
|
|
|
1157
1171
|
}
|
|
1158
1172
|
};
|
|
1159
1173
|
for (; ; ) {
|
|
1160
|
-
const { done: se, value: C } = await
|
|
1161
|
-
C && (
|
|
1162
|
-
const
|
|
1174
|
+
const { done: se, value: C } = await L.read();
|
|
1175
|
+
C && (q += W.decode(C, { stream: !0 }));
|
|
1176
|
+
const oe = q.split(`
|
|
1163
1177
|
|
|
1164
1178
|
`);
|
|
1165
|
-
|
|
1166
|
-
for (const fe of
|
|
1167
|
-
const Ee =
|
|
1168
|
-
Ee && await
|
|
1179
|
+
q = oe.pop() ?? "";
|
|
1180
|
+
for (const fe of oe) {
|
|
1181
|
+
const Ee = ze(fe);
|
|
1182
|
+
Ee && await F(Ee.event, Ee.data);
|
|
1169
1183
|
}
|
|
1170
1184
|
if (se) {
|
|
1171
|
-
if (
|
|
1172
|
-
const fe =
|
|
1173
|
-
fe && await
|
|
1185
|
+
if (q.trim()) {
|
|
1186
|
+
const fe = ze(q.trim());
|
|
1187
|
+
fe && await F(fe.event, fe.data);
|
|
1174
1188
|
}
|
|
1175
|
-
|
|
1189
|
+
Z || (v("Ready"), E(!1));
|
|
1176
1190
|
break;
|
|
1177
1191
|
}
|
|
1178
1192
|
}
|
|
1179
1193
|
};
|
|
1180
1194
|
} catch (t) {
|
|
1181
|
-
console.error("Audio Submission Error:", t),
|
|
1195
|
+
console.error("Audio Submission Error:", t), v("STT Failed"), E(!1);
|
|
1182
1196
|
}
|
|
1183
|
-
},
|
|
1184
|
-
e && e.preventDefault(), We(!1), Oe.current = "",
|
|
1185
|
-
},
|
|
1197
|
+
}, qt = async (e) => {
|
|
1198
|
+
e && e.preventDefault(), We(!1), Oe.current = "", me(""), !(!he || k) && await Gt(he);
|
|
1199
|
+
}, ze = (e) => {
|
|
1186
1200
|
const t = e.split(/\r?\n/);
|
|
1187
|
-
let
|
|
1188
|
-
for (const
|
|
1189
|
-
|
|
1190
|
-
if (!
|
|
1201
|
+
let i = "", o = "";
|
|
1202
|
+
for (const c of t)
|
|
1203
|
+
c.startsWith("event:") ? i = c.slice(6).trim() : c.startsWith("data:") && (o = c.slice(5).trim());
|
|
1204
|
+
if (!i) return null;
|
|
1191
1205
|
let n = {};
|
|
1192
1206
|
if (o)
|
|
1193
1207
|
try {
|
|
@@ -1195,55 +1209,55 @@ const yn = ({
|
|
|
1195
1209
|
} catch {
|
|
1196
1210
|
n = { raw: o };
|
|
1197
1211
|
}
|
|
1198
|
-
return { event:
|
|
1199
|
-
},
|
|
1212
|
+
return { event: i, data: n };
|
|
1213
|
+
}, At = (e, t) => {
|
|
1200
1214
|
switch (e) {
|
|
1201
1215
|
case "connected":
|
|
1202
|
-
|
|
1216
|
+
pe.current = "", Ce.current = !1;
|
|
1203
1217
|
break;
|
|
1204
1218
|
case "text": {
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1219
|
+
const i = t.delta ?? "";
|
|
1220
|
+
i && vt(i);
|
|
1207
1221
|
break;
|
|
1208
1222
|
}
|
|
1209
1223
|
case "audio": {
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1224
|
+
const i = t.chunk, o = t.visemes ?? [];
|
|
1225
|
+
i && at(i, o);
|
|
1212
1226
|
break;
|
|
1213
1227
|
}
|
|
1214
1228
|
case "done": {
|
|
1215
|
-
const
|
|
1216
|
-
...
|
|
1217
|
-
{ role: "user", content:
|
|
1229
|
+
const i = yt(), o = Oe.current.trim(), n = [
|
|
1230
|
+
...i,
|
|
1231
|
+
{ role: "user", content: he || "..." },
|
|
1218
1232
|
{ role: "assistant", content: o }
|
|
1219
1233
|
];
|
|
1220
|
-
|
|
1234
|
+
Bt(n), $e.current = [...x.current], v("Ready"), E(!1), X("");
|
|
1221
1235
|
break;
|
|
1222
1236
|
}
|
|
1223
1237
|
case "error": {
|
|
1224
|
-
const
|
|
1225
|
-
Oe.current =
|
|
1238
|
+
const i = t.message ?? "Unknown error";
|
|
1239
|
+
Oe.current = i, me(i), v("Agent Failed"), E(!1);
|
|
1226
1240
|
break;
|
|
1227
1241
|
}
|
|
1228
1242
|
}
|
|
1229
|
-
},
|
|
1230
|
-
|
|
1231
|
-
const t = `${
|
|
1232
|
-
|
|
1243
|
+
}, Gt = async (e) => {
|
|
1244
|
+
E(!0), v("Thinking..."), Oe.current = "", pe.current = "", Ce.current = !1, Ge(), xe.current = 0, s(0);
|
|
1245
|
+
const t = `${ut}/agent/chat?token=${encodeURIComponent(
|
|
1246
|
+
O
|
|
1233
1247
|
)}`;
|
|
1234
1248
|
try {
|
|
1235
|
-
const
|
|
1249
|
+
const i = yt();
|
|
1236
1250
|
let o = sessionStorage.getItem("STREAMOJI_LEADS_SESSION_LEAD_ID");
|
|
1237
|
-
o || (
|
|
1251
|
+
o || (rn(
|
|
1238
1252
|
"[CHAT] Session UID missing at send time! Generating emergency backup."
|
|
1239
1253
|
), o = "emergency-" + Math.random().toString(36).substring(7), sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID", o));
|
|
1240
1254
|
const n = {
|
|
1241
|
-
history:
|
|
1255
|
+
history: i,
|
|
1242
1256
|
question: e,
|
|
1243
1257
|
lead_id: o
|
|
1244
1258
|
};
|
|
1245
|
-
|
|
1246
|
-
const
|
|
1259
|
+
V("[CHAT] Sending payload:", n);
|
|
1260
|
+
const c = await fetch(t, {
|
|
1247
1261
|
method: "POST",
|
|
1248
1262
|
headers: {
|
|
1249
1263
|
"Content-Type": "application/json"
|
|
@@ -1251,75 +1265,75 @@ const yn = ({
|
|
|
1251
1265
|
body: JSON.stringify(n),
|
|
1252
1266
|
cache: "default"
|
|
1253
1267
|
});
|
|
1254
|
-
if (
|
|
1268
|
+
if (c.status === 429) {
|
|
1255
1269
|
try {
|
|
1256
|
-
const
|
|
1257
|
-
|
|
1270
|
+
const L = await c.json();
|
|
1271
|
+
V("[CHAT] 429 agent at capacity:", L?.detail);
|
|
1258
1272
|
} catch {
|
|
1259
1273
|
}
|
|
1260
|
-
|
|
1274
|
+
X(""), v("Busy"), E(!1);
|
|
1261
1275
|
return;
|
|
1262
1276
|
}
|
|
1263
|
-
if (!
|
|
1277
|
+
if (!c.ok)
|
|
1264
1278
|
throw new Error("Agent request failed");
|
|
1265
|
-
const
|
|
1266
|
-
if (!
|
|
1267
|
-
|
|
1279
|
+
const h = c.body;
|
|
1280
|
+
if (!h) {
|
|
1281
|
+
v("Agent Failed"), E(!1);
|
|
1268
1282
|
return;
|
|
1269
1283
|
}
|
|
1270
|
-
const
|
|
1271
|
-
|
|
1272
|
-
const
|
|
1273
|
-
let
|
|
1284
|
+
const _ = h.getReader();
|
|
1285
|
+
u.current = !1;
|
|
1286
|
+
const A = new TextDecoder();
|
|
1287
|
+
let R = "";
|
|
1274
1288
|
for (; ; ) {
|
|
1275
|
-
const { done:
|
|
1276
|
-
|
|
1277
|
-
`[SSE] Chunk received. done=${
|
|
1278
|
-
),
|
|
1279
|
-
const
|
|
1289
|
+
const { done: L, value: W } = await _.read();
|
|
1290
|
+
V(
|
|
1291
|
+
`[SSE] Chunk received. done=${L}, length=${W?.length || 0}`
|
|
1292
|
+
), W && (R += A.decode(W, { stream: !0 }));
|
|
1293
|
+
const q = R.split(`
|
|
1280
1294
|
|
|
1281
1295
|
`);
|
|
1282
|
-
|
|
1283
|
-
for (const
|
|
1284
|
-
|
|
1285
|
-
const
|
|
1286
|
-
|
|
1296
|
+
R = q.pop() ?? "";
|
|
1297
|
+
for (const Z of q) {
|
|
1298
|
+
V(`[SSE] Processing block: ${Z.slice(0, 50)}...`);
|
|
1299
|
+
const F = ze(Z);
|
|
1300
|
+
F && (V(`[SSE] Event: ${F.event}`), At(F.event, F.data));
|
|
1287
1301
|
}
|
|
1288
|
-
if (
|
|
1289
|
-
if (
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1302
|
+
if (L) {
|
|
1303
|
+
if (V("[SSE] Stream finished"), R.trim()) {
|
|
1304
|
+
const Z = ze(R.trim());
|
|
1305
|
+
Z && At(Z.event, Z.data);
|
|
1292
1306
|
}
|
|
1293
|
-
|
|
1307
|
+
v("Ready"), E(!1), X("");
|
|
1294
1308
|
break;
|
|
1295
1309
|
}
|
|
1296
1310
|
}
|
|
1297
|
-
} catch (
|
|
1298
|
-
console.error("Chat Error:",
|
|
1311
|
+
} catch (i) {
|
|
1312
|
+
console.error("Chat Error:", i), v("Agent Failed"), E(!1);
|
|
1299
1313
|
}
|
|
1300
|
-
}, Rt =
|
|
1314
|
+
}, Rt = D.trim(), ct = Rt && U ? Rt.slice(
|
|
1301
1315
|
0,
|
|
1302
1316
|
d != null && d > 0 ? d : 0
|
|
1303
1317
|
) : "";
|
|
1304
|
-
|
|
1305
|
-
const e =
|
|
1306
|
-
e !== "exiting" && (
|
|
1307
|
-
}, [
|
|
1308
|
-
const
|
|
1309
|
-
const e =
|
|
1310
|
-
e === "entering" ?
|
|
1318
|
+
$(() => {
|
|
1319
|
+
const e = et.current;
|
|
1320
|
+
e !== "exiting" && (ct ? (Ot(ct), e === "hidden" && je("entering")) : (e === "visible" || e === "entering") && je("exiting"));
|
|
1321
|
+
}, [ct, ue]);
|
|
1322
|
+
const zt = Ye(() => {
|
|
1323
|
+
const e = et.current;
|
|
1324
|
+
e === "entering" ? je("visible") : e === "exiting" && je("hidden");
|
|
1311
1325
|
}, []);
|
|
1312
|
-
return
|
|
1313
|
-
const e =
|
|
1326
|
+
return en(() => {
|
|
1327
|
+
const e = mt.current;
|
|
1314
1328
|
e && (e.scrollTop = e.scrollHeight);
|
|
1315
|
-
}, [
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
|
|
1329
|
+
}, [pt]), /* @__PURE__ */ ae("div", { className: "avatar-widget-container", children: [
|
|
1330
|
+
/* @__PURE__ */ ae("div", { className: "avatar-input-area", children: [
|
|
1331
|
+
_e !== "hidden" ? /* @__PURE__ */ l(
|
|
1318
1332
|
"div",
|
|
1319
1333
|
{
|
|
1320
|
-
className: `avatar-thinking-tab${
|
|
1321
|
-
onAnimationEnd:
|
|
1322
|
-
children:
|
|
1334
|
+
className: `avatar-thinking-tab${_e === "exiting" ? " avatar-thinking-tab--exiting" : _e === "entering" ? " avatar-thinking-tab--entering" : ""}`,
|
|
1335
|
+
onAnimationEnd: Dt,
|
|
1336
|
+
children: Re === Mt ? /* @__PURE__ */ l(
|
|
1323
1337
|
"a",
|
|
1324
1338
|
{
|
|
1325
1339
|
href: "https://leads.streamoji.com",
|
|
@@ -1327,7 +1341,7 @@ const yn = ({
|
|
|
1327
1341
|
rel: "noopener noreferrer",
|
|
1328
1342
|
children: "Made by Streamoji Leads"
|
|
1329
1343
|
}
|
|
1330
|
-
) :
|
|
1344
|
+
) : Re
|
|
1331
1345
|
}
|
|
1332
1346
|
) : null,
|
|
1333
1347
|
/* @__PURE__ */ l("div", { className: "avatar-input-container", children: /* @__PURE__ */ l(
|
|
@@ -1339,7 +1353,7 @@ const yn = ({
|
|
|
1339
1353
|
width: "100%",
|
|
1340
1354
|
height: "100%"
|
|
1341
1355
|
},
|
|
1342
|
-
children:
|
|
1356
|
+
children: rt ? /* @__PURE__ */ ae("div", { className: "avatar-input-recording", children: [
|
|
1343
1357
|
/* @__PURE__ */ l(
|
|
1344
1358
|
"button",
|
|
1345
1359
|
{
|
|
@@ -1347,7 +1361,7 @@ const yn = ({
|
|
|
1347
1361
|
className: "avatar-recording-cancel",
|
|
1348
1362
|
onClick: Ht,
|
|
1349
1363
|
title: "Cancel",
|
|
1350
|
-
children: /* @__PURE__ */
|
|
1364
|
+
children: /* @__PURE__ */ ae(
|
|
1351
1365
|
"svg",
|
|
1352
1366
|
{
|
|
1353
1367
|
width: "18",
|
|
@@ -1367,7 +1381,7 @@ const yn = ({
|
|
|
1367
1381
|
)
|
|
1368
1382
|
}
|
|
1369
1383
|
),
|
|
1370
|
-
/* @__PURE__ */
|
|
1384
|
+
/* @__PURE__ */ ae(
|
|
1371
1385
|
"div",
|
|
1372
1386
|
{
|
|
1373
1387
|
style: {
|
|
@@ -1379,8 +1393,8 @@ const yn = ({
|
|
|
1379
1393
|
minWidth: 0
|
|
1380
1394
|
},
|
|
1381
1395
|
children: [
|
|
1382
|
-
/* @__PURE__ */ l("div", { style: { flex: 1, height: "100%" }, children: /* @__PURE__ */ l(
|
|
1383
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ l("div", { style: { flex: 1, height: "100%" }, children: /* @__PURE__ */ l(Et, { analyser: Wt }) }),
|
|
1397
|
+
/* @__PURE__ */ ae(
|
|
1384
1398
|
"span",
|
|
1385
1399
|
{
|
|
1386
1400
|
style: {
|
|
@@ -1393,9 +1407,9 @@ const yn = ({
|
|
|
1393
1407
|
fontVariantNumeric: "tabular-nums"
|
|
1394
1408
|
},
|
|
1395
1409
|
children: [
|
|
1396
|
-
Math.floor(
|
|
1410
|
+
Math.floor(St / 60),
|
|
1397
1411
|
":",
|
|
1398
|
-
String(
|
|
1412
|
+
String(St % 60).padStart(2, "0")
|
|
1399
1413
|
]
|
|
1400
1414
|
}
|
|
1401
1415
|
)
|
|
@@ -1407,7 +1421,7 @@ const yn = ({
|
|
|
1407
1421
|
{
|
|
1408
1422
|
type: "button",
|
|
1409
1423
|
className: "avatar-recording-confirm",
|
|
1410
|
-
onClick:
|
|
1424
|
+
onClick: $t,
|
|
1411
1425
|
title: "Send",
|
|
1412
1426
|
children: /* @__PURE__ */ l(
|
|
1413
1427
|
"svg",
|
|
@@ -1426,7 +1440,7 @@ const yn = ({
|
|
|
1426
1440
|
)
|
|
1427
1441
|
}
|
|
1428
1442
|
)
|
|
1429
|
-
] }) :
|
|
1443
|
+
] }) : U && !nt ? /* @__PURE__ */ ae("div", { className: "avatar-input-speaking", children: [
|
|
1430
1444
|
/* @__PURE__ */ l(
|
|
1431
1445
|
"div",
|
|
1432
1446
|
{
|
|
@@ -1437,7 +1451,7 @@ const yn = ({
|
|
|
1437
1451
|
alignItems: "center",
|
|
1438
1452
|
paddingRight: "8px"
|
|
1439
1453
|
},
|
|
1440
|
-
children: /* @__PURE__ */ l(
|
|
1454
|
+
children: /* @__PURE__ */ l(Et, { analyser: kt })
|
|
1441
1455
|
}
|
|
1442
1456
|
),
|
|
1443
1457
|
/* @__PURE__ */ l(
|
|
@@ -1445,12 +1459,12 @@ const yn = ({
|
|
|
1445
1459
|
{
|
|
1446
1460
|
type: "button",
|
|
1447
1461
|
className: "avatar-speaking-stop",
|
|
1448
|
-
onClick: () =>
|
|
1462
|
+
onClick: () => Ge(!0),
|
|
1449
1463
|
title: "Stop",
|
|
1450
1464
|
children: /* @__PURE__ */ l("span", { className: "avatar-speaking-stop__icon", "aria-hidden": !0 })
|
|
1451
1465
|
}
|
|
1452
1466
|
)
|
|
1453
|
-
] }) :
|
|
1467
|
+
] }) : k ? /* @__PURE__ */ l(
|
|
1454
1468
|
"div",
|
|
1455
1469
|
{
|
|
1456
1470
|
style: {
|
|
@@ -1462,10 +1476,10 @@ const yn = ({
|
|
|
1462
1476
|
},
|
|
1463
1477
|
children: /* @__PURE__ */ l("div", { className: "avatar-input-loader" })
|
|
1464
1478
|
}
|
|
1465
|
-
) : /* @__PURE__ */
|
|
1479
|
+
) : /* @__PURE__ */ ae(
|
|
1466
1480
|
"form",
|
|
1467
1481
|
{
|
|
1468
|
-
onSubmit:
|
|
1482
|
+
onSubmit: qt,
|
|
1469
1483
|
style: {
|
|
1470
1484
|
flex: 1,
|
|
1471
1485
|
display: "flex",
|
|
@@ -1478,15 +1492,15 @@ const yn = ({
|
|
|
1478
1492
|
{
|
|
1479
1493
|
id: "avatar-text-input",
|
|
1480
1494
|
type: "text",
|
|
1481
|
-
value:
|
|
1482
|
-
onChange: (e) =>
|
|
1483
|
-
placeholder:
|
|
1484
|
-
disabled:
|
|
1495
|
+
value: he,
|
|
1496
|
+
onChange: (e) => X(e.target.value),
|
|
1497
|
+
placeholder: I === "Busy" ? "Assisting another user" : Ne || "Ask me anything",
|
|
1498
|
+
disabled: k || I === "Busy",
|
|
1485
1499
|
autoComplete: "off",
|
|
1486
1500
|
style: { width: "100%", height: "100%" }
|
|
1487
1501
|
}
|
|
1488
1502
|
),
|
|
1489
|
-
|
|
1503
|
+
I === "Busy" ? /* @__PURE__ */ l(
|
|
1490
1504
|
"button",
|
|
1491
1505
|
{
|
|
1492
1506
|
type: "button",
|
|
@@ -1513,15 +1527,15 @@ const yn = ({
|
|
|
1513
1527
|
}
|
|
1514
1528
|
)
|
|
1515
1529
|
}
|
|
1516
|
-
) :
|
|
1530
|
+
) : he.trim() === "" ? /* @__PURE__ */ l(
|
|
1517
1531
|
"button",
|
|
1518
1532
|
{
|
|
1519
1533
|
type: "button",
|
|
1520
1534
|
className: "mic-button",
|
|
1521
|
-
onClick:
|
|
1522
|
-
disabled:
|
|
1535
|
+
onClick: Vt,
|
|
1536
|
+
disabled: k,
|
|
1523
1537
|
style: { backgroundColor: "#1e4a5e" },
|
|
1524
|
-
children: /* @__PURE__ */
|
|
1538
|
+
children: /* @__PURE__ */ ae(
|
|
1525
1539
|
"svg",
|
|
1526
1540
|
{
|
|
1527
1541
|
width: "28",
|
|
@@ -1553,7 +1567,7 @@ const yn = ({
|
|
|
1553
1567
|
{
|
|
1554
1568
|
type: "submit",
|
|
1555
1569
|
className: "mic-button",
|
|
1556
|
-
disabled:
|
|
1570
|
+
disabled: k,
|
|
1557
1571
|
style: { backgroundColor: "#1e4a5e" },
|
|
1558
1572
|
title: "Send",
|
|
1559
1573
|
children: /* @__PURE__ */ l(
|
|
@@ -1584,22 +1598,22 @@ const yn = ({
|
|
|
1584
1598
|
}
|
|
1585
1599
|
) })
|
|
1586
1600
|
] }),
|
|
1587
|
-
/* @__PURE__ */ l("div", { className: "avatar-wrapper", children: /* @__PURE__ */
|
|
1601
|
+
/* @__PURE__ */ l("div", { className: "avatar-wrapper", children: /* @__PURE__ */ ae("div", { className: "avatar-scene-wrapper", children: [
|
|
1588
1602
|
ue !== "hidden" && /* @__PURE__ */ l(
|
|
1589
1603
|
"div",
|
|
1590
1604
|
{
|
|
1591
1605
|
className: `avatar-bubble${ue === "entering" ? " avatar-bubble--entering" : ue === "exiting" ? " avatar-bubble--exiting" : ""}`,
|
|
1592
|
-
onAnimationEnd:
|
|
1593
|
-
children: /* @__PURE__ */ l("div", { ref:
|
|
1606
|
+
onAnimationEnd: zt,
|
|
1607
|
+
children: /* @__PURE__ */ l("div", { ref: mt, className: `avatar-bubble__content${nt ? " avatar-bubble__content--nudge" : ""}`, children: pt })
|
|
1594
1608
|
}
|
|
1595
1609
|
),
|
|
1596
1610
|
/* @__PURE__ */ l(
|
|
1597
1611
|
"div",
|
|
1598
1612
|
{
|
|
1599
1613
|
className: "avatar-canvas-layer",
|
|
1600
|
-
style: { width:
|
|
1601
|
-
children: /* @__PURE__ */
|
|
1602
|
-
|
|
1614
|
+
style: { width: j, height: j },
|
|
1615
|
+
children: /* @__PURE__ */ ae(
|
|
1616
|
+
Xt,
|
|
1603
1617
|
{
|
|
1604
1618
|
shadows: !0,
|
|
1605
1619
|
camera: { position: [0.2, 1.4, 3], fov: 42 },
|
|
@@ -1607,30 +1621,30 @@ const yn = ({
|
|
|
1607
1621
|
dpr: 1.8,
|
|
1608
1622
|
style: { pointerEvents: "none", width: "100%", height: "100%" },
|
|
1609
1623
|
children: [
|
|
1610
|
-
/* @__PURE__ */ l(
|
|
1624
|
+
/* @__PURE__ */ l(wn, { target: hn }),
|
|
1611
1625
|
/* @__PURE__ */ l("ambientLight", { intensity: 0.7 }),
|
|
1612
1626
|
/* @__PURE__ */ l("directionalLight", { position: [0, 2, 2], intensity: 1 }),
|
|
1613
|
-
/* @__PURE__ */ l(
|
|
1614
|
-
/* @__PURE__ */ l(
|
|
1615
|
-
|
|
1627
|
+
/* @__PURE__ */ l(Yt, { preset: "city" }),
|
|
1628
|
+
/* @__PURE__ */ l(tn, { fallback: null, children: H !== null && /* @__PURE__ */ l(
|
|
1629
|
+
vn,
|
|
1616
1630
|
{
|
|
1617
|
-
avatarUrl:
|
|
1618
|
-
isPlayingRef:
|
|
1619
|
-
visemeQueueRef:
|
|
1620
|
-
audioContextRef:
|
|
1621
|
-
responseAudioStartTimeRef:
|
|
1622
|
-
adjustments:
|
|
1623
|
-
mood:
|
|
1624
|
-
expression:
|
|
1625
|
-
agentResponse:
|
|
1626
|
-
isSpeaking:
|
|
1627
|
-
nextStartTimeRef:
|
|
1628
|
-
stopPlayback:
|
|
1629
|
-
setIsSpeaking:
|
|
1631
|
+
avatarUrl: H,
|
|
1632
|
+
isPlayingRef: S,
|
|
1633
|
+
visemeQueueRef: x,
|
|
1634
|
+
audioContextRef: ye,
|
|
1635
|
+
responseAudioStartTimeRef: re,
|
|
1636
|
+
adjustments: fn,
|
|
1637
|
+
mood: m,
|
|
1638
|
+
expression: K,
|
|
1639
|
+
agentResponse: D,
|
|
1640
|
+
isSpeaking: U,
|
|
1641
|
+
nextStartTimeRef: Se,
|
|
1642
|
+
stopPlayback: Ge,
|
|
1643
|
+
setIsSpeaking: be,
|
|
1630
1644
|
expressionUrl: Ke,
|
|
1631
|
-
onExpressionFinished:
|
|
1632
|
-
isNudgeResponse:
|
|
1633
|
-
avatarGender:
|
|
1645
|
+
onExpressionFinished: Ut,
|
|
1646
|
+
isNudgeResponse: nt,
|
|
1647
|
+
avatarGender: p
|
|
1634
1648
|
}
|
|
1635
1649
|
) })
|
|
1636
1650
|
]
|
|
@@ -1640,17 +1654,17 @@ const yn = ({
|
|
|
1640
1654
|
)
|
|
1641
1655
|
] }) })
|
|
1642
1656
|
] });
|
|
1643
|
-
},
|
|
1657
|
+
}, Tn = ({
|
|
1644
1658
|
token: f,
|
|
1645
|
-
onNavigationRequested:
|
|
1659
|
+
onNavigationRequested: T
|
|
1646
1660
|
}) => /* @__PURE__ */ l(
|
|
1647
|
-
|
|
1661
|
+
Sn,
|
|
1648
1662
|
{
|
|
1649
1663
|
token: f,
|
|
1650
|
-
onNavigationRequested:
|
|
1664
|
+
onNavigationRequested: T
|
|
1651
1665
|
}
|
|
1652
1666
|
);
|
|
1653
1667
|
export {
|
|
1654
|
-
|
|
1668
|
+
Tn as AvatarWidget
|
|
1655
1669
|
};
|
|
1656
1670
|
//# sourceMappingURL=avatar-widget.js.map
|