@davi-ai/react-bodyengine-three 1.0.9 → 1.0.10
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/contexts/headStore.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +759 -701
- package/dist/stats.html +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import tg, { useState as
|
|
1
|
+
import tg, { useState as Dg, useMemo as ql, useEffect as ug, useRef as Kt, Suspense as zA } from "react";
|
|
2
2
|
import * as d from "three/webgpu";
|
|
3
3
|
import { Vector3 as fA, WebGPURenderer as MA } from "three/webgpu";
|
|
4
|
-
import { Object3D as
|
|
4
|
+
import { Object3D as UV } from "three/webgpu";
|
|
5
5
|
import { ShaderChunk as RC } from "three";
|
|
6
6
|
import { FBXLoader as _l } from "three/examples/jsm/loaders/FBXLoader.js";
|
|
7
7
|
import { DRACOLoader as UA } from "three/examples/jsm/loaders/DRACOLoader.js";
|
|
@@ -10,7 +10,7 @@ import { MeshoptDecoder as TA } from "three/examples/jsm/libs/meshopt_decoder.mo
|
|
|
10
10
|
import * as DA from "three/examples/jsm/utils/SkeletonUtils.js";
|
|
11
11
|
import { useDetectGPU as EA, AdaptiveDpr as xA, PerspectiveCamera as PA, CameraControls as jA, Environment as OA } from "@react-three/drei";
|
|
12
12
|
import { Canvas as qA, useThree as _A, useFrame as $A } from "@react-three/fiber";
|
|
13
|
-
var gh = Object.defineProperty, Ih = (i, g, I) => g in i ? gh(i, g, { enumerable: !0, configurable: !0, writable: !0, value: I }) : i[g] = I, h = (i, g, I) => Ih(i, typeof g != "symbol" ? g + "" : g, I),
|
|
13
|
+
var gh = Object.defineProperty, Ih = (i, g, I) => g in i ? gh(i, g, { enumerable: !0, configurable: !0, writable: !0, value: I }) : i[g] = I, h = (i, g, I) => Ih(i, typeof g != "symbol" ? g + "" : g, I), KI = /* @__PURE__ */ ((i) => (i.none = "none", i.mixamo = "mixamo", i.actorcore = "actorcore", i.cc4 = "cc4", i))(KI || {}), ze = /* @__PURE__ */ ((i) => (i.frequently = "frequently", i.often = "often", i.sometimes = "sometimes", i.occasionaly = "occasionaly", i.rarely = "rarely", i))(ze || {}), yg = /* @__PURE__ */ ((i) => (i[i.idle = 1] = "idle", i[i.waiting = 2] = "waiting", i[i.listening = 3] = "listening", i[i.speaking = 4] = "speaking", i))(yg || {}), dg = /* @__PURE__ */ ((i) => (i[i.cc3 = 1] = "cc3", i[i.rpm = 2] = "rpm", i[i.avatarsdk = 3] = "avatarsdk", i[i.avaturn = 4] = "avaturn", i))(dg || {});
|
|
14
14
|
const $l = {
|
|
15
15
|
attributes: [
|
|
16
16
|
"id",
|
|
@@ -418,12 +418,12 @@ class Ni extends d.MeshPhysicalMaterial {
|
|
|
418
418
|
updateRenderTargets() {
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
class
|
|
421
|
+
class ag {
|
|
422
422
|
}
|
|
423
|
-
h(
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
423
|
+
h(ag, "gltfLoader", new QA()), h(ag, "fbxLoader", new _l()), h(ag, "dracoLoader", new UA()), h(ag, "textureLoader", new d.TextureLoader());
|
|
424
|
+
ag.dracoLoader.setDecoderPath("https://cdn.retorik.ai/bodyengine-three/draco/");
|
|
425
|
+
ag.gltfLoader.setDRACOLoader(ag.dracoLoader);
|
|
426
|
+
ag.gltfLoader.setMeshoptDecoder(TA);
|
|
427
427
|
const KC = class kg extends d.Loader {
|
|
428
428
|
constructor(g) {
|
|
429
429
|
super(g), h(this, "textureLoader", null);
|
|
@@ -469,11 +469,11 @@ const KC = class kg extends d.Loader {
|
|
|
469
469
|
const l = I[n].Materials;
|
|
470
470
|
if (Object.keys(l).length > 1)
|
|
471
471
|
for (const a in l) {
|
|
472
|
-
const c = s.material.findIndex((
|
|
472
|
+
const c = s.material.findIndex((G) => G.name == a);
|
|
473
473
|
C.push(
|
|
474
|
-
new Promise((
|
|
474
|
+
new Promise((G, u) => {
|
|
475
475
|
this.setupMaterial(s.material[c], l[a]).then((m) => {
|
|
476
|
-
s.material[c] = m, (a.toUpperCase().includes("HAIR") || a.toUpperCase().includes("FRONT")) && this.setDoublePassForHairForMultiMaterial(s, c),
|
|
476
|
+
s.material[c] = m, (a.toUpperCase().includes("HAIR") || a.toUpperCase().includes("FRONT")) && this.setDoublePassForHairForMultiMaterial(s, c), G();
|
|
477
477
|
});
|
|
478
478
|
})
|
|
479
479
|
);
|
|
@@ -481,8 +481,8 @@ const KC = class kg extends d.Loader {
|
|
|
481
481
|
else
|
|
482
482
|
C.push(
|
|
483
483
|
new Promise((a, c) => {
|
|
484
|
-
this.setupMaterial(s.material, l[Object.keys(l)[0]]).then((
|
|
485
|
-
s.material =
|
|
484
|
+
this.setupMaterial(s.material, l[Object.keys(l)[0]]).then((G) => {
|
|
485
|
+
s.material = G;
|
|
486
486
|
const u = Object.keys(l)[0];
|
|
487
487
|
(u.toUpperCase().includes("HAIR") || u.toUpperCase().includes("FRONT")) && this.setDoublePassForHairForSimpleMaterial(s), a();
|
|
488
488
|
});
|
|
@@ -493,12 +493,12 @@ const KC = class kg extends d.Loader {
|
|
|
493
493
|
await Promise.all(C);
|
|
494
494
|
}
|
|
495
495
|
async setSkinMaterial(g) {
|
|
496
|
-
kg.cavityMap === void 0 && (kg.cavityMap = await
|
|
496
|
+
kg.cavityMap === void 0 && (kg.cavityMap = await ag.textureLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/characters/common/cavity.jpg").catch((I) => {
|
|
497
497
|
console.warn("Can't load cavity map :", I);
|
|
498
498
|
}), kg.cavityMap && (kg.cavityMap.wrapS = kg.cavityMap.wrapT = d.RepeatWrapping, kg.cavityMap = kg.cavityMap)), g.cavityMap = kg.cavityMap, g.reflectivity = 0.25, g.transmissionMap && (g.transmission = 0.5), g.attenuationDistance = 1e-3, g.thickness = 0.02, g.attenuationColor = new d.Color(0.8, 0.4, 0.3), g.microNormalScale = new d.Vector2(28, 28), g.cavityScale = new d.Vector2(20, 20), g.cavityStrength = 0.5;
|
|
499
499
|
}
|
|
500
500
|
async setSkinBodyMaterial(g) {
|
|
501
|
-
kg.cavityMap === void 0 && (kg.cavityMap = await
|
|
501
|
+
kg.cavityMap === void 0 && (kg.cavityMap = await ag.textureLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/characters/common/cavity.jpg").catch((I) => {
|
|
502
502
|
console.warn("Can't load cavity map :", I);
|
|
503
503
|
}), kg.cavityMap && (kg.cavityMap.wrapS = kg.cavityMap.wrapT = d.RepeatWrapping, kg.cavityMap = kg.cavityMap)), g.cavityMap = kg.cavityMap, g.reflectivity = 0.25, g.transmissionMap && (g.transmission = 0.5), g.attenuationDistance = 1e-3, g.thickness = 0.02, g.attenuationColor = new d.Color(0.8, 0.4, 0.3), g.microNormalScale = new d.Vector2(45, 45), g.cavityScale = new d.Vector2(33, 33), g.cavityStrength = 0.5;
|
|
504
504
|
}
|
|
@@ -525,23 +525,23 @@ const KC = class kg extends d.Loader {
|
|
|
525
525
|
e.opacity = 0.33, o.opacity = 1, g.renderOrder = 1, t.renderOrder = 2, I.add(t);
|
|
526
526
|
}
|
|
527
527
|
async setupMaterial(g, I) {
|
|
528
|
-
var e, t, o, C, n, s, l, a, c,
|
|
529
|
-
let
|
|
530
|
-
if (g.name.includes("Skin_Arm") || g.name.includes("Skin_Leg") || g.name.includes("Skin_Body") ?
|
|
528
|
+
var e, t, o, C, n, s, l, a, c, G, u, m;
|
|
529
|
+
let B;
|
|
530
|
+
if (g.name.includes("Skin_Arm") || g.name.includes("Skin_Leg") || g.name.includes("Skin_Body") ? B = new Ni({ side: d.DoubleSide }) : g.name.includes("Skin_Head") ? B = new Ni({ side: d.DoubleSide }) : B = new d.MeshPhysicalMaterial(), B.name = g.name, B.ior = 1.45, B.sheen = 0.5, B.sheenRoughness = 1, I["Two Side"] ? B.side = d.DoubleSide : B.side = d.FrontSide, I["Diffuse Color"]) {
|
|
531
531
|
const p = I["Diffuse Color"];
|
|
532
|
-
|
|
532
|
+
B.color.setRGB(1 * p[0] / 255, 1 * p[1] / 255, 1 * p[2] / 255);
|
|
533
533
|
}
|
|
534
534
|
if (I.Textures["Base Color"] && I.Textures["Base Color"]["Base Path"] !== "") {
|
|
535
535
|
const p = I.Textures["Base Color"], b = await ((e = this.textureLoader) == null ? void 0 : e.loadAsync(p["Texture Path"]).catch((Z) => {
|
|
536
536
|
console.warn("Can't load Base Color map :", Z);
|
|
537
537
|
}));
|
|
538
|
-
b && (b.anisotropy = 4, b.colorSpace = d.SRGBColorSpace, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping,
|
|
538
|
+
b && (b.anisotropy = 4, b.colorSpace = d.SRGBColorSpace, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping, B.map = b);
|
|
539
539
|
}
|
|
540
540
|
if (I.Textures.Metallic && I.Textures.Metallic["Texture Path"] !== "") {
|
|
541
541
|
const p = I.Textures.Metallic, b = await ((t = this.textureLoader) == null ? void 0 : t.loadAsync(p["Texture Path"]).catch((Z) => {
|
|
542
542
|
console.warn("Can't load Metallic map :", Z);
|
|
543
543
|
}));
|
|
544
|
-
b ? (b.anisotropy = 4, b.colorSpace = d.NoColorSpace, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping,
|
|
544
|
+
b ? (b.anisotropy = 4, b.colorSpace = d.NoColorSpace, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping, B.name.includes("Cornea") && (B.clearcoat = 1, B.clearcoatRoughness = 0.15), B.name.includes("Std_Eye_") && (B.clearcoatRoughness = 0.03), B.metalnessMap = b, B.metalness = p.Strength / 100) : B.metalness = 0;
|
|
545
545
|
}
|
|
546
546
|
if (I.Textures.Specular && I.Textures.Specular["Texture Path"] !== "") {
|
|
547
547
|
const p = I.Textures.Specular, b = await ((o = this.textureLoader) == null ? void 0 : o.loadAsync(p["Texture Path"]).catch((Z) => {
|
|
@@ -550,64 +550,64 @@ const KC = class kg extends d.Loader {
|
|
|
550
550
|
if (b) {
|
|
551
551
|
if (b.anisotropy = 4, b.colorSpace = d.NoColorSpace, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping, I["Specular Color"]) {
|
|
552
552
|
const Z = I["Specular Color"];
|
|
553
|
-
|
|
553
|
+
B.specularColor.setRGB(1 * Z[0] / 255, 1 * Z[1] / 255, 1 * Z[2] / 255);
|
|
554
554
|
}
|
|
555
|
-
|
|
555
|
+
B.specularColorMap = b, B.specularIntensity = p.Strength / 100, B.specularIntensityMap = b;
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
558
|
if (I.Textures.Opacity && I.Textures.Opacity["Texture Path"] !== "") {
|
|
559
559
|
const p = I.Textures.Opacity, b = await ((C = this.textureLoader) == null ? void 0 : C.loadAsync(p["Texture Path"]).catch((gg) => {
|
|
560
560
|
console.warn("Can't load Alpha map :", gg);
|
|
561
561
|
}));
|
|
562
|
-
b && (b.anisotropy = 4, b.colorSpace = d.NoColorSpace, b.format = d.RGBAFormat, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping,
|
|
562
|
+
b && (b.anisotropy = 4, b.colorSpace = d.NoColorSpace, b.format = d.RGBAFormat, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping, B.alphaMap = b);
|
|
563
563
|
let Z = 0, H = g.opacity, R = !0;
|
|
564
|
-
(
|
|
564
|
+
(B.name.toUpperCase().includes("SCALP") || B.name.toUpperCase().includes("BASE")) && (Z = 0, B.alphaToCoverage = !1), (B.name.toUpperCase().includes("HAIR") || B.name.toUpperCase().includes("FRONT")) && (Z = 0, B.alphaToCoverage = !1, R = !0, B.alphaHash = !1, B.depthWrite = !1, H = 1), B.name.toUpperCase().includes("EYELASH") && (B.depthWrite = !1), B.name.includes("Brow_Transparency") && (Z = 0, B.alphaToCoverage = !0, R = !1, B.alphaHash = !0, B.depthWrite = !0, H = 1), B.name.includes("Brow_Base_Transparency") && (Z = 0, B.alphaToCoverage = !0, H = 1), B.name.includes("Eyelash") && (Z = 0, H = 0.75, R = !0), B.name.includes("Eye_Occlusion") && (B.visible = !1), B.alphaTest = Z, B.opacity = H * p.Strength / 100, B.transparent = R;
|
|
565
565
|
}
|
|
566
566
|
if (I.Textures.Displacement && I.Textures.Displacement["Texture Path"] !== "") {
|
|
567
567
|
const p = I.Textures.Displacement, b = await ((n = this.textureLoader) == null ? void 0 : n.loadAsync(p["Texture Path"]).catch((Z) => {
|
|
568
568
|
console.warn("Can't load Displacement map :", Z);
|
|
569
569
|
}));
|
|
570
|
-
b && (b.anisotropy = 4, b.colorSpace = d.NoColorSpace, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping,
|
|
570
|
+
b && (b.anisotropy = 4, b.colorSpace = d.NoColorSpace, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping, B.displacementMap = b, B.displacementBias = 0, B.displacementScale = 0.5);
|
|
571
571
|
}
|
|
572
572
|
if (I.Textures.Roughness && I.Textures.Roughness["Texture Path"] !== "") {
|
|
573
573
|
const p = I.Textures.Roughness, b = await ((s = this.textureLoader) == null ? void 0 : s.loadAsync(p["Texture Path"]).catch((Z) => {
|
|
574
574
|
console.warn("Can't load Roughness map :", Z);
|
|
575
575
|
}));
|
|
576
|
-
b ? (b.anisotropy = 4, b.format = d.RGBAFormat, b.colorSpace = d.NoColorSpace, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping,
|
|
576
|
+
b ? (b.anisotropy = 4, b.format = d.RGBAFormat, b.colorSpace = d.NoColorSpace, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping, B.roughnessMap = b, B.roughness = p.Strength / 100) : B.roughness = 1;
|
|
577
577
|
}
|
|
578
578
|
if (I.Textures.Normal && I.Textures.Normal["Texture Path"] !== "") {
|
|
579
579
|
const p = I.Textures.Normal, b = await ((l = this.textureLoader) == null ? void 0 : l.loadAsync(p["Texture Path"]).catch((Z) => {
|
|
580
580
|
console.warn("Can't load Normal map :", Z);
|
|
581
581
|
}));
|
|
582
|
-
b && (b.anisotropy = 4, b.colorSpace = d.NoColorSpace, b.format = d.RGBAFormat, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping,
|
|
582
|
+
b && (b.anisotropy = 4, b.colorSpace = d.NoColorSpace, b.format = d.RGBAFormat, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping, B.normalScale = new d.Vector2(p.Strength / 100, -p.Strength / 100), B.normalMap = b);
|
|
583
583
|
}
|
|
584
584
|
if (I.Textures.AO && I.Textures.AO["Texture Path"] !== "") {
|
|
585
585
|
const p = I.Textures.AO, b = await ((a = this.textureLoader) == null ? void 0 : a.loadAsync(p["Texture Path"]).catch((Z) => {
|
|
586
586
|
console.warn("Can't load AO map :", Z);
|
|
587
587
|
}));
|
|
588
|
-
b && (b.anisotropy = 4, b.colorSpace = d.SRGBColorSpace, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping, b.channel = 1,
|
|
588
|
+
b && (b.anisotropy = 4, b.colorSpace = d.SRGBColorSpace, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping, b.channel = 1, B.aoMap = b, B.aoMapIntensity = 0.5 * p.Strength / 100);
|
|
589
589
|
}
|
|
590
590
|
if (I.Textures.Glow && I.Textures.Glow["Texture Path"] !== "") {
|
|
591
591
|
const p = I.Textures.Glow, b = await ((c = this.textureLoader) == null ? void 0 : c.loadAsync(p["Texture Path"]).catch((Z) => {
|
|
592
592
|
console.warn("Can't load Glow map :", Z);
|
|
593
593
|
}));
|
|
594
|
-
b && (b.anisotropy = 4, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping,
|
|
594
|
+
b && (b.anisotropy = 4, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping, B.emissiveMap = b, B.emissiveIntensity = 1 * p.Strength / 100, B.emissive = new d.Color(16777215));
|
|
595
595
|
}
|
|
596
596
|
if (I["Custom Shader"] && (I["Custom Shader"]["Shader Name"] === "RLHead" || I["Custom Shader"]["Shader Name"] === "RLSkin")) {
|
|
597
|
-
const p = await ((
|
|
597
|
+
const p = await ((G = this.textureLoader) == null ? void 0 : G.loadAsync(I["Custom Shader"].Image["Transmission Map"]["Texture Path"]).catch((H) => {
|
|
598
598
|
console.warn("Can't load Transmission map :", H);
|
|
599
599
|
}));
|
|
600
|
-
p && (p.anisotropy = 4, p.wrapS = d.RepeatWrapping, p.wrapT = d.RepeatWrapping,
|
|
600
|
+
p && (p.anisotropy = 4, p.wrapS = d.RepeatWrapping, p.wrapT = d.RepeatWrapping, B.transmissionMap = p, B.transmission = 1, B.reflectivity = 0.5);
|
|
601
601
|
const b = await ((u = this.textureLoader) == null ? void 0 : u.loadAsync(I["Custom Shader"].Image.MicroNormalMask["Texture Path"]).catch((H) => {
|
|
602
602
|
console.warn("Can't load Transmission map :", H);
|
|
603
603
|
}));
|
|
604
|
-
b && (b.anisotropy = 4, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping,
|
|
604
|
+
b && (b.anisotropy = 4, b.wrapS = d.RepeatWrapping, b.wrapT = d.RepeatWrapping, B.microMaskNormalMap = b);
|
|
605
605
|
const Z = await ((m = this.textureLoader) == null ? void 0 : m.loadAsync(I["Custom Shader"].Image.MicroNormal["Texture Path"]).catch((H) => {
|
|
606
606
|
console.warn("Can't load Transmission map :", H);
|
|
607
607
|
}));
|
|
608
|
-
Z && (Z.anisotropy = 4, Z.wrapS = d.RepeatWrapping, Z.wrapT = d.RepeatWrapping,
|
|
608
|
+
Z && (Z.anisotropy = 4, Z.wrapS = d.RepeatWrapping, Z.wrapT = d.RepeatWrapping, B.microNormalMap = Z);
|
|
609
609
|
}
|
|
610
|
-
return (g.name.includes("Skin_Arm") || g.name.includes("Skin_Leg") || g.name.includes("Skin_Body")) && this.setSkinBodyMaterial(
|
|
610
|
+
return (g.name.includes("Skin_Arm") || g.name.includes("Skin_Leg") || g.name.includes("Skin_Body")) && this.setSkinBodyMaterial(B), g.name.includes("Skin_Head") && this.setSkinMaterial(B), B;
|
|
611
611
|
}
|
|
612
612
|
setupPhysics(g, I) {
|
|
613
613
|
}
|
|
@@ -652,7 +652,7 @@ const bi = class tI extends d.Loader {
|
|
|
652
652
|
super(g);
|
|
653
653
|
}
|
|
654
654
|
load(g, I, e, t) {
|
|
655
|
-
|
|
655
|
+
ag.gltfLoader.load(g, (o) => {
|
|
656
656
|
this.setMaterial(o.scene).then(() => {
|
|
657
657
|
I(o.scene);
|
|
658
658
|
});
|
|
@@ -671,7 +671,7 @@ const bi = class tI extends d.Loader {
|
|
|
671
671
|
});
|
|
672
672
|
const e = I.find((t) => t.name.includes("Head_Mesh"));
|
|
673
673
|
if (e) {
|
|
674
|
-
tI.cavityMap || (tI.cavityMap = await
|
|
674
|
+
tI.cavityMap || (tI.cavityMap = await ag.textureLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/cavity.png")), tI.microMap || (tI.microMap = await ag.textureLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/cavity.png")), tI.microNormalMaskMap || (tI.microNormalMaskMap = await ag.textureLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/cavity.png")), tI.transMap || (tI.transMap = await ag.textureLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/cavity.png"));
|
|
675
675
|
const t = new Ni({
|
|
676
676
|
color: e.material.color,
|
|
677
677
|
metalness: e.material.metalness,
|
|
@@ -694,7 +694,7 @@ const Yt = class Og extends d.Loader {
|
|
|
694
694
|
super(g);
|
|
695
695
|
}
|
|
696
696
|
load(g, I, e, t) {
|
|
697
|
-
|
|
697
|
+
ag.gltfLoader.load(
|
|
698
698
|
g,
|
|
699
699
|
(o) => {
|
|
700
700
|
this.setMaterial(o.scene).then(() => {
|
|
@@ -755,7 +755,7 @@ const Yt = class Og extends d.Loader {
|
|
|
755
755
|
C.name = "HairMaterial2Clone", I.opacity = 0.3, o.opacity = 0.5, C.transparent = C.alphaToCoverage = !0, C.alphaHash = !1, C.depthWrite = !1, C.alphaTest = 0, g.renderOrder = 1, e.renderOrder = 3, t.renderOrder = 2, g.parent.add(e), g.parent.add(t);
|
|
756
756
|
}
|
|
757
757
|
async setHead(g) {
|
|
758
|
-
Og.cavityMap || (Og.cavityMap = await
|
|
758
|
+
Og.cavityMap || (Og.cavityMap = await ag.textureLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/characters/common/cavity.jpg"), Og.cavityMap.wrapS = Og.cavityMap.wrapT = d.RepeatWrapping), Og.microMap || (Og.microMap = await ag.textureLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/characters/common/micro.jpg"), Og.microMap.wrapS = Og.microMap.wrapT = d.RepeatWrapping), Og.microNormalMaskMap || (Og.microNormalMaskMap = await ag.textureLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/characters/common/normalMask.jpg"), Og.microNormalMaskMap.flipY = !0);
|
|
759
759
|
const I = new Ni({
|
|
760
760
|
color: g.material.color,
|
|
761
761
|
metalness: g.material.metalness,
|
|
@@ -786,7 +786,7 @@ const wt = class qg extends d.Loader {
|
|
|
786
786
|
super(g);
|
|
787
787
|
}
|
|
788
788
|
load(g, I, e, t) {
|
|
789
|
-
|
|
789
|
+
ag.gltfLoader.load(g, (o) => {
|
|
790
790
|
this.setMaterial(o.scene).then(() => {
|
|
791
791
|
I(o.scene);
|
|
792
792
|
});
|
|
@@ -803,8 +803,8 @@ const wt = class qg extends d.Loader {
|
|
|
803
803
|
g.castShadow = g.receiveShadow = !0, g.traverse((a) => {
|
|
804
804
|
var c;
|
|
805
805
|
a.castShadow = a.receiveShadow = !0, a.isMesh && (I.push(a), a.material.premultipliedAlpha = !1);
|
|
806
|
-
for (const
|
|
807
|
-
|
|
806
|
+
for (const G in a.material)
|
|
807
|
+
G.toUpperCase().includes("MAP") && (c = a.material[G]) != null && c.anisotropy && (a.material[G].anisotropy = 8);
|
|
808
808
|
});
|
|
809
809
|
const e = I.filter((a) => a.name.includes("Cornea")), t = I.find((a) => a.name.includes("AvatarHead")), o = I.find((a) => a.name.includes("haircut")), C = I.find((a) => a.name.includes("AvatarLeftEyeball")), n = I.find((a) => a.name.includes("AvatarRightEyeball")), s = I.find((a) => a.name.includes("AvatarEyelashes")), l = I.find((a) => a.name.includes("glasses"));
|
|
810
810
|
e.forEach((a) => {
|
|
@@ -865,7 +865,7 @@ const wt = class qg extends d.Loader {
|
|
|
865
865
|
t.side = d.FrontSide, t.alphaToCoverage = !0, t.depthWrite = !0, g.renderOrder = 1, e.renderOrder = 3, g.parent.add(e);
|
|
866
866
|
}
|
|
867
867
|
async setHead(g) {
|
|
868
|
-
qg.cavityMap || (qg.cavityMap = await
|
|
868
|
+
qg.cavityMap || (qg.cavityMap = await ag.textureLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/characters/common/cavity.jpg"), qg.cavityMap.wrapS = qg.cavityMap.wrapT = d.RepeatWrapping), qg.microMap || (qg.microMap = await ag.textureLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/characters/common/micro.jpg"), qg.microMap.wrapS = qg.microMap.wrapT = d.RepeatWrapping), qg.microNormalMaskMap || (qg.microNormalMaskMap = await ag.textureLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/characters/common/normalMask.jpg"), qg.microNormalMaskMap.flipY = !0);
|
|
869
869
|
const I = new Ni({
|
|
870
870
|
color: g.material.color,
|
|
871
871
|
metalness: g.material.metalness,
|
|
@@ -981,24 +981,24 @@ function Xc(i) {
|
|
|
981
981
|
}
|
|
982
982
|
function Rc(i, g) {
|
|
983
983
|
var I = Xc(i), e = LI(F.und(I[0]) ? 1 : I[0], 0.1, 100), t = LI(F.und(I[1]) ? 100 : I[1], 0.1, 100), o = LI(F.und(I[2]) ? 10 : I[2], 0.1, 100), C = LI(F.und(I[3]) ? 0 : I[3], 0.1, 100), n = Math.sqrt(t / e), s = o / (2 * Math.sqrt(t * e)), l = s < 1 ? n * Math.sqrt(1 - s * s) : 0, a = 1, c = s < 1 ? (s * n + -C) / l : -C + n;
|
|
984
|
-
function
|
|
985
|
-
var
|
|
986
|
-
return s < 1 ?
|
|
984
|
+
function G(m) {
|
|
985
|
+
var B = g ? g * m / 1e3 : m;
|
|
986
|
+
return s < 1 ? B = Math.exp(-B * s * n) * (a * Math.cos(l * B) + c * Math.sin(l * B)) : B = (a + c * B) * Math.exp(-B * n), m === 0 || m === 1 ? m : 1 - B;
|
|
987
987
|
}
|
|
988
988
|
function u() {
|
|
989
989
|
var m = Ut.springs[i];
|
|
990
990
|
if (m)
|
|
991
991
|
return m;
|
|
992
|
-
for (var
|
|
993
|
-
if (p +=
|
|
992
|
+
for (var B = 1 / 6, p = 0, b = 0; ; )
|
|
993
|
+
if (p += B, G(p) === 1) {
|
|
994
994
|
if (b++, b >= 16)
|
|
995
995
|
break;
|
|
996
996
|
} else
|
|
997
997
|
b = 0;
|
|
998
|
-
var Z = p *
|
|
998
|
+
var Z = p * B * 1e3;
|
|
999
999
|
return Ut.springs[i] = Z, Z;
|
|
1000
1000
|
}
|
|
1001
|
-
return g ?
|
|
1001
|
+
return g ? G : u;
|
|
1002
1002
|
}
|
|
1003
1003
|
function sh(i) {
|
|
1004
1004
|
return i === void 0 && (i = 10), function(g) {
|
|
@@ -1016,45 +1016,45 @@ var ah = function() {
|
|
|
1016
1016
|
function t(a) {
|
|
1017
1017
|
return 3 * a;
|
|
1018
1018
|
}
|
|
1019
|
-
function o(a, c,
|
|
1020
|
-
return ((I(c,
|
|
1019
|
+
function o(a, c, G) {
|
|
1020
|
+
return ((I(c, G) * a + e(c, G)) * a + t(c)) * a;
|
|
1021
1021
|
}
|
|
1022
|
-
function C(a, c,
|
|
1023
|
-
return 3 * I(c,
|
|
1022
|
+
function C(a, c, G) {
|
|
1023
|
+
return 3 * I(c, G) * a * a + 2 * e(c, G) * a + t(c);
|
|
1024
1024
|
}
|
|
1025
|
-
function n(a, c,
|
|
1026
|
-
var
|
|
1025
|
+
function n(a, c, G, u, m) {
|
|
1026
|
+
var B, p, b = 0;
|
|
1027
1027
|
do
|
|
1028
|
-
p = c + (
|
|
1029
|
-
while (Math.abs(
|
|
1028
|
+
p = c + (G - c) / 2, B = o(p, u, m) - a, B > 0 ? G = p : c = p;
|
|
1029
|
+
while (Math.abs(B) > 1e-7 && ++b < 10);
|
|
1030
1030
|
return p;
|
|
1031
1031
|
}
|
|
1032
|
-
function s(a, c,
|
|
1032
|
+
function s(a, c, G, u) {
|
|
1033
1033
|
for (var m = 0; m < 4; ++m) {
|
|
1034
|
-
var
|
|
1035
|
-
if (
|
|
1034
|
+
var B = C(c, G, u);
|
|
1035
|
+
if (B === 0)
|
|
1036
1036
|
return c;
|
|
1037
|
-
var p = o(c,
|
|
1038
|
-
c -= p /
|
|
1037
|
+
var p = o(c, G, u) - a;
|
|
1038
|
+
c -= p / B;
|
|
1039
1039
|
}
|
|
1040
1040
|
return c;
|
|
1041
1041
|
}
|
|
1042
|
-
function l(a, c,
|
|
1043
|
-
if (!(0 <= a && a <= 1 && 0 <=
|
|
1042
|
+
function l(a, c, G, u) {
|
|
1043
|
+
if (!(0 <= a && a <= 1 && 0 <= G && G <= 1))
|
|
1044
1044
|
return;
|
|
1045
1045
|
var m = new Float32Array(i);
|
|
1046
|
-
if (a !== c ||
|
|
1047
|
-
for (var
|
|
1048
|
-
m[
|
|
1046
|
+
if (a !== c || G !== u)
|
|
1047
|
+
for (var B = 0; B < i; ++B)
|
|
1048
|
+
m[B] = o(B * g, a, G);
|
|
1049
1049
|
function p(b) {
|
|
1050
1050
|
for (var Z = 0, H = 1, R = i - 1; H !== R && m[H] <= b; ++H)
|
|
1051
1051
|
Z += g;
|
|
1052
1052
|
--H;
|
|
1053
|
-
var gg = (b - m[H]) / (m[H + 1] - m[H]), q = Z + gg * g, ig = C(q, a,
|
|
1054
|
-
return ig >= 1e-3 ? s(b, q, a,
|
|
1053
|
+
var gg = (b - m[H]) / (m[H + 1] - m[H]), q = Z + gg * g, ig = C(q, a, G);
|
|
1054
|
+
return ig >= 1e-3 ? s(b, q, a, G) : ig === 0 ? q : n(b, Z, Z + g, a, G);
|
|
1055
1055
|
}
|
|
1056
1056
|
return function(b) {
|
|
1057
|
-
return a === c &&
|
|
1057
|
+
return a === c && G === u || b === 0 || b === 1 ? b : o(p(b), c, u);
|
|
1058
1058
|
};
|
|
1059
1059
|
}
|
|
1060
1060
|
return l;
|
|
@@ -1196,8 +1196,8 @@ function ch(i) {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
function rh(i) {
|
|
1198
1198
|
var g = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(i) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(i), I = parseInt(g[1], 10) / 360, e = parseInt(g[2], 10) / 100, t = parseInt(g[3], 10) / 100, o = g[4] || 1;
|
|
1199
|
-
function C(
|
|
1200
|
-
return m < 0 && (m += 1), m > 1 && (m -= 1), m < 1 / 6 ?
|
|
1199
|
+
function C(G, u, m) {
|
|
1200
|
+
return m < 0 && (m += 1), m > 1 && (m -= 1), m < 1 / 6 ? G + (u - G) * 6 * m : m < 1 / 2 ? u : m < 2 / 3 ? G + (u - G) * (2 / 3 - m) * 6 : G;
|
|
1201
1201
|
}
|
|
1202
1202
|
var n, s, l;
|
|
1203
1203
|
if (e == 0)
|
|
@@ -1474,8 +1474,8 @@ function Hh(i, g) {
|
|
|
1474
1474
|
function Vh(i, g) {
|
|
1475
1475
|
var I;
|
|
1476
1476
|
return i.tweens.map(function(e) {
|
|
1477
|
-
var t = Hh(e, g), o = t.value, C = F.arr(o) ? o[1] : o, n = xI(C), s = Wn(g.target, i.name, n, g), l = I ? I.to.original : s, a = F.arr(o) ? o[0] : l, c = xI(a) || xI(s),
|
|
1478
|
-
return F.und(C) && (C = l), t.from = Es(a,
|
|
1477
|
+
var t = Hh(e, g), o = t.value, C = F.arr(o) ? o[1] : o, n = xI(C), s = Wn(g.target, i.name, n, g), l = I ? I.to.original : s, a = F.arr(o) ? o[0] : l, c = xI(a) || xI(s), G = n || c;
|
|
1478
|
+
return F.und(C) && (C = l), t.from = Es(a, G), t.to = Es(vn(C, a), G), t.start = I ? I.end : 0, t.end = t.start + t.delay + t.duration + t.endDelay, t.easing = bn(t.easing, t.duration), t.isPath = F.pth(o), t.isPathTargetInsideSVG = t.isPath && F.svg(g.target), t.isColor = F.col(t.from.original), t.isColor && (t.round = 1), I = t, t;
|
|
1479
1479
|
});
|
|
1480
1480
|
}
|
|
1481
1481
|
var fc = {
|
|
@@ -1558,7 +1558,7 @@ function Kh(i) {
|
|
|
1558
1558
|
var bI = [], Qc = function() {
|
|
1559
1559
|
var i;
|
|
1560
1560
|
function g() {
|
|
1561
|
-
!i && (!Ps() || !
|
|
1561
|
+
!i && (!Ps() || !Q.suspendWhenDocumentHidden) && bI.length > 0 && (i = requestAnimationFrame(I));
|
|
1562
1562
|
}
|
|
1563
1563
|
function I(t) {
|
|
1564
1564
|
for (var o = bI.length, C = 0; C < o; ) {
|
|
@@ -1568,7 +1568,7 @@ var bI = [], Qc = function() {
|
|
|
1568
1568
|
i = C > 0 ? requestAnimationFrame(I) : void 0;
|
|
1569
1569
|
}
|
|
1570
1570
|
function e() {
|
|
1571
|
-
|
|
1571
|
+
Q.suspendWhenDocumentHidden && (Ps() ? i = cancelAnimationFrame(i) : (bI.forEach(
|
|
1572
1572
|
function(t) {
|
|
1573
1573
|
return t._onDocumentVisibility();
|
|
1574
1574
|
}
|
|
@@ -1579,7 +1579,7 @@ var bI = [], Qc = function() {
|
|
|
1579
1579
|
function Ps() {
|
|
1580
1580
|
return !!document && document.hidden;
|
|
1581
1581
|
}
|
|
1582
|
-
function
|
|
1582
|
+
function Q(i) {
|
|
1583
1583
|
i === void 0 && (i = {});
|
|
1584
1584
|
var g = 0, I = 0, e = 0, t, o = 0, C = null;
|
|
1585
1585
|
function n(Z) {
|
|
@@ -1600,28 +1600,28 @@ function E(i) {
|
|
|
1600
1600
|
return s.reversed ? s.duration - Z : Z;
|
|
1601
1601
|
}
|
|
1602
1602
|
function c() {
|
|
1603
|
-
g = 0, I = a(s.currentTime) * (1 /
|
|
1603
|
+
g = 0, I = a(s.currentTime) * (1 / Q.speed);
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1605
|
+
function G(Z, H) {
|
|
1606
1606
|
H && H.seek(Z - H.timelineOffset);
|
|
1607
1607
|
}
|
|
1608
1608
|
function u(Z) {
|
|
1609
1609
|
if (s.reversePlayback)
|
|
1610
1610
|
for (var H = o; H--; )
|
|
1611
|
-
|
|
1611
|
+
G(Z, t[H]);
|
|
1612
1612
|
else
|
|
1613
1613
|
for (var R = 0; R < o; R++)
|
|
1614
|
-
|
|
1614
|
+
G(Z, t[R]);
|
|
1615
1615
|
}
|
|
1616
1616
|
function m(Z) {
|
|
1617
1617
|
for (var H = 0, R = s.animations, gg = R.length; H < gg; ) {
|
|
1618
1618
|
var q = R[H], ig = q.animatable, Jg = q.tweens, eI = Jg.length - 1, Ig = Jg[eI];
|
|
1619
|
-
eI && (Ig = io(Jg, function(
|
|
1620
|
-
return Z <
|
|
1619
|
+
eI && (Ig = io(Jg, function(lg) {
|
|
1620
|
+
return Z < lg.end;
|
|
1621
1621
|
})[0] || Ig);
|
|
1622
1622
|
for (var Vg = LI(Z - Ig.start - Ig.delay, 0, Ig.duration) / Ig.duration, Ce = isNaN(Vg) ? 1 : Ig.easing(Vg), Pg = Ig.to.strings, K = Ig.round, y = [], S = Ig.to.numbers.length, v = void 0, W = 0; W < S; W++) {
|
|
1623
|
-
var z = void 0, j = Ig.to.numbers[W],
|
|
1624
|
-
Ig.isPath ? z = yh(Ig.value, Ce * j, Ig.isPathTargetInsideSVG) : z =
|
|
1623
|
+
var z = void 0, j = Ig.to.numbers[W], D = Ig.from.numbers[W] || 0;
|
|
1624
|
+
Ig.isPath ? z = yh(Ig.value, Ce * j, Ig.isPathTargetInsideSVG) : z = D + Ce * (j - D), K && (Ig.isColor && W > 2 || (z = Math.round(z * K) / K)), y.push(z);
|
|
1625
1625
|
}
|
|
1626
1626
|
var Xg = Pg.length;
|
|
1627
1627
|
if (!Xg)
|
|
@@ -1637,7 +1637,7 @@ function E(i) {
|
|
|
1637
1637
|
fc[q.type](ig.target, q.property, v, ig.transforms), q.currentValue = v, H++;
|
|
1638
1638
|
}
|
|
1639
1639
|
}
|
|
1640
|
-
function
|
|
1640
|
+
function B(Z) {
|
|
1641
1641
|
s[Z] && !s.passThrough && s[Z](s);
|
|
1642
1642
|
}
|
|
1643
1643
|
function p() {
|
|
@@ -1645,7 +1645,7 @@ function E(i) {
|
|
|
1645
1645
|
}
|
|
1646
1646
|
function b(Z) {
|
|
1647
1647
|
var H = s.duration, R = s.delay, gg = H - s.endDelay, q = a(Z);
|
|
1648
|
-
s.progress = LI(q / H * 100, 0, 100), s.reversePlayback = q < s.currentTime, t && u(q), !s.began && s.currentTime > 0 && (s.began = !0,
|
|
1648
|
+
s.progress = LI(q / H * 100, 0, 100), s.reversePlayback = q < s.currentTime, t && u(q), !s.began && s.currentTime > 0 && (s.began = !0, B("begin")), !s.loopBegan && s.currentTime > 0 && (s.loopBegan = !0, B("loopBegin")), q <= R && s.currentTime !== 0 && m(0), (q >= gg && s.currentTime !== H || !H) && m(H), q > R && q < gg ? (s.changeBegan || (s.changeBegan = !0, s.changeCompleted = !1, B("changeBegin")), B("change"), m(q)) : s.changeBegan && (s.changeCompleted = !0, s.changeBegan = !1, B("changeComplete")), s.currentTime = LI(q, 0, H), s.began && B("update"), Z >= H && (I = 0, p(), s.remaining ? (g = e, B("loopComplete"), s.loopBegan = !1, s.direction === "alternate" && l()) : (s.paused = !0, s.completed || (s.completed = !0, B("loopComplete"), B("complete"), !s.passThrough && "Promise" in window && (C(), n(s)))));
|
|
1649
1649
|
}
|
|
1650
1650
|
return s.reset = function() {
|
|
1651
1651
|
var Z = s.direction;
|
|
@@ -1656,7 +1656,7 @@ function E(i) {
|
|
|
1656
1656
|
}, s._onDocumentVisibility = c, s.set = function(Z, H) {
|
|
1657
1657
|
return Mc(Z, H), s;
|
|
1658
1658
|
}, s.tick = function(Z) {
|
|
1659
|
-
e = Z, g || (g = e), b((e + (I - g)) *
|
|
1659
|
+
e = Z, g || (g = e), b((e + (I - g)) * Q.speed);
|
|
1660
1660
|
}, s.seek = function(Z) {
|
|
1661
1661
|
b(a(Z));
|
|
1662
1662
|
}, s.pause = function() {
|
|
@@ -1693,36 +1693,36 @@ function Yh(i) {
|
|
|
1693
1693
|
}
|
|
1694
1694
|
function wh(i, g) {
|
|
1695
1695
|
g === void 0 && (g = {});
|
|
1696
|
-
var I = g.direction || "normal", e = g.easing ? bn(g.easing) : null, t = g.grid, o = g.axis, C = g.from || 0, n = C === "first", s = C === "center", l = C === "last", a = F.arr(i), c = parseFloat(a ? i[0] : i),
|
|
1696
|
+
var I = g.direction || "normal", e = g.easing ? bn(g.easing) : null, t = g.grid, o = g.axis, C = g.from || 0, n = C === "first", s = C === "center", l = C === "last", a = F.arr(i), c = parseFloat(a ? i[0] : i), G = a ? parseFloat(i[1]) : 0, u = xI(a ? i[1] : i) || 0, m = g.start || 0 + (a ? c : 0), B = [], p = 0;
|
|
1697
1697
|
return function(b, Z, H) {
|
|
1698
|
-
if (n && (C = 0), s && (C = (H - 1) / 2), l && (C = H - 1), !
|
|
1698
|
+
if (n && (C = 0), s && (C = (H - 1) / 2), l && (C = H - 1), !B.length) {
|
|
1699
1699
|
for (var R = 0; R < H; R++) {
|
|
1700
1700
|
if (!t)
|
|
1701
|
-
|
|
1701
|
+
B.push(Math.abs(C - R));
|
|
1702
1702
|
else {
|
|
1703
1703
|
var gg = s ? (t[0] - 1) / 2 : C % t[0], q = s ? (t[1] - 1) / 2 : Math.floor(C / t[0]), ig = R % t[0], Jg = Math.floor(R / t[0]), eI = gg - ig, Ig = q - Jg, Vg = Math.sqrt(eI * eI + Ig * Ig);
|
|
1704
|
-
o === "x" && (Vg = -eI), o === "y" && (Vg = -Ig),
|
|
1704
|
+
o === "x" && (Vg = -eI), o === "y" && (Vg = -Ig), B.push(Vg);
|
|
1705
1705
|
}
|
|
1706
|
-
p = Math.max.apply(Math,
|
|
1706
|
+
p = Math.max.apply(Math, B);
|
|
1707
1707
|
}
|
|
1708
|
-
e && (
|
|
1708
|
+
e && (B = B.map(function(Pg) {
|
|
1709
1709
|
return e(Pg / p) * p;
|
|
1710
|
-
})), I === "reverse" && (
|
|
1710
|
+
})), I === "reverse" && (B = B.map(function(Pg) {
|
|
1711
1711
|
return o ? Pg < 0 ? Pg * -1 : -Pg : Math.abs(p - Pg);
|
|
1712
1712
|
}));
|
|
1713
1713
|
}
|
|
1714
|
-
var Ce = a ? (
|
|
1715
|
-
return m + Ce * (Math.round(
|
|
1714
|
+
var Ce = a ? (G - c) / p : c;
|
|
1715
|
+
return m + Ce * (Math.round(B[Z] * 100) / 100) + u;
|
|
1716
1716
|
};
|
|
1717
1717
|
}
|
|
1718
1718
|
function Lh(i) {
|
|
1719
1719
|
i === void 0 && (i = {});
|
|
1720
|
-
var g =
|
|
1720
|
+
var g = Q(i);
|
|
1721
1721
|
return g.duration = 0, g.add = function(I, e) {
|
|
1722
1722
|
var t = bI.indexOf(g), o = g.children;
|
|
1723
1723
|
t > -1 && bI.splice(t, 1);
|
|
1724
|
-
function C(
|
|
1725
|
-
|
|
1724
|
+
function C(G) {
|
|
1725
|
+
G.passThrough = !0;
|
|
1726
1726
|
}
|
|
1727
1727
|
for (var n = 0; n < o.length; n++)
|
|
1728
1728
|
C(o[n]);
|
|
@@ -1730,27 +1730,27 @@ function Lh(i) {
|
|
|
1730
1730
|
s.targets = s.targets || i.targets;
|
|
1731
1731
|
var l = g.duration;
|
|
1732
1732
|
s.autoplay = !1, s.direction = g.direction, s.timelineOffset = F.und(e) ? l : vn(e, l), C(g), g.seek(s.timelineOffset);
|
|
1733
|
-
var a =
|
|
1733
|
+
var a = Q(s);
|
|
1734
1734
|
C(a), o.push(a);
|
|
1735
1735
|
var c = Uc(o, i);
|
|
1736
1736
|
return g.delay = c.delay, g.endDelay = c.endDelay, g.duration = c.duration, g.seek(0), g.reset(), g.autoplay && g.play(), g;
|
|
1737
1737
|
}, g;
|
|
1738
1738
|
}
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1739
|
+
Q.version = "3.2.1";
|
|
1740
|
+
Q.speed = 1;
|
|
1741
|
+
Q.suspendWhenDocumentHidden = !0;
|
|
1742
|
+
Q.running = bI;
|
|
1743
|
+
Q.remove = Yh;
|
|
1744
|
+
Q.get = Wn;
|
|
1745
|
+
Q.set = Mc;
|
|
1746
|
+
Q.convertPx = yn;
|
|
1747
|
+
Q.path = Zh;
|
|
1748
|
+
Q.setDashoffset = bh;
|
|
1749
|
+
Q.stagger = wh;
|
|
1750
|
+
Q.timeline = Lh;
|
|
1751
|
+
Q.easing = bn;
|
|
1752
|
+
Q.penner = Kc;
|
|
1753
|
+
Q.random = function(i, g) {
|
|
1754
1754
|
return Math.floor(Math.random() * (g - i + 1)) + i;
|
|
1755
1755
|
};
|
|
1756
1756
|
const Nh = {
|
|
@@ -1768,7 +1768,7 @@ class zh {
|
|
|
1768
1768
|
const g = this;
|
|
1769
1769
|
function I() {
|
|
1770
1770
|
const e = 0.75 + Math.random() * 0.2, t = g.duration * 0.75 + Math.random() * (g.duration * 0.5);
|
|
1771
|
-
g._blinkAnime =
|
|
1771
|
+
g._blinkAnime = Q({
|
|
1772
1772
|
targets: [g._blink],
|
|
1773
1773
|
keyframes: [
|
|
1774
1774
|
{ value: e, duration: t * 1 / 2, easing: "easeInQuad" },
|
|
@@ -1894,7 +1894,7 @@ class fh {
|
|
|
1894
1894
|
if (c < this._durationThreshold)
|
|
1895
1895
|
this._visemeDataArray.pop();
|
|
1896
1896
|
else {
|
|
1897
|
-
const
|
|
1897
|
+
const G = c > 1 && g === "sil", u = await this._createAnimationClip(`${g}${I}`, [a, l, n], c, G), m = this._animationMixer.clipAction(u);
|
|
1898
1898
|
m.setLoop(d.LoopOnce, 1), m.clampWhenFinished = !0, this._animationActionArray.push({ startAt: this._startTime + l.offset, action: m });
|
|
1899
1899
|
}
|
|
1900
1900
|
}
|
|
@@ -1909,20 +1909,20 @@ class fh {
|
|
|
1909
1909
|
if (l.type == "SkinnedMesh" && l.morphTargetDictionary !== void 0) {
|
|
1910
1910
|
const a = l;
|
|
1911
1911
|
for (let c = 0; c < I[1].data.length; c++) {
|
|
1912
|
-
const
|
|
1913
|
-
if ("morphTargetName" in
|
|
1912
|
+
const G = I[1].data[c];
|
|
1913
|
+
if ("morphTargetName" in G && a.morphTargetDictionary && G.morphTargetName in a.morphTargetDictionary) {
|
|
1914
1914
|
const u = t ? [
|
|
1915
|
-
(I[0].data[c].value +
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
(
|
|
1915
|
+
(I[0].data[c].value + G.value) / 2,
|
|
1916
|
+
G.value,
|
|
1917
|
+
G.value,
|
|
1918
|
+
(G.value + I[2].data[c].value) / 2
|
|
1919
1919
|
] : [
|
|
1920
|
-
(I[0].data[c].value +
|
|
1921
|
-
|
|
1922
|
-
(
|
|
1920
|
+
(I[0].data[c].value + G.value) / 2,
|
|
1921
|
+
G.value,
|
|
1922
|
+
(G.value + I[2].data[c].value) / 2
|
|
1923
1923
|
];
|
|
1924
1924
|
if (Math.max(...u) === 0) continue;
|
|
1925
|
-
const m = new d.NumberKeyframeTrack(`${l.name}.morphTargetInfluences[${
|
|
1925
|
+
const m = new d.NumberKeyframeTrack(`${l.name}.morphTargetInfluences[${G.morphTargetName}]`, o, u, d.InterpolateSmooth);
|
|
1926
1926
|
C.push(m);
|
|
1927
1927
|
}
|
|
1928
1928
|
}
|
|
@@ -2834,12 +2834,12 @@ class sG {
|
|
|
2834
2834
|
const g = this;
|
|
2835
2835
|
g._lipsAnimeStopped = !1;
|
|
2836
2836
|
const I = () => {
|
|
2837
|
-
g._lipsAnime =
|
|
2837
|
+
g._lipsAnime = Q({
|
|
2838
2838
|
targets: g._randomLipsData,
|
|
2839
2839
|
emotion: () => 0,
|
|
2840
2840
|
intensity: () => Math.round(g._randomSmileMinIntensity + Math.random() * (g._randomSmileMaxIntensity - g._randomSmileMinIntensity)),
|
|
2841
2841
|
delay: () => (0.5 + Math.random() * 2.5) * 1e3,
|
|
2842
|
-
duration:
|
|
2842
|
+
duration: Q.random(250, 750),
|
|
2843
2843
|
autoplay: !0,
|
|
2844
2844
|
complete: I,
|
|
2845
2845
|
easing: "linear"
|
|
@@ -2850,7 +2850,7 @@ class sG {
|
|
|
2850
2850
|
_stopLipsAnimation() {
|
|
2851
2851
|
var g;
|
|
2852
2852
|
const I = this;
|
|
2853
|
-
I._lipsAnimeStopped = !0, (g = I._lipsAnime) == null || g.pause(), I._lipsAnime = null, I._lipsAnime =
|
|
2853
|
+
I._lipsAnimeStopped = !0, (g = I._lipsAnime) == null || g.pause(), I._lipsAnime = null, I._lipsAnime = Q({
|
|
2854
2854
|
targets: I._randomLipsData,
|
|
2855
2855
|
emotion: () => 0,
|
|
2856
2856
|
intensity: () => 0,
|
|
@@ -2866,12 +2866,12 @@ class sG {
|
|
|
2866
2866
|
const g = this;
|
|
2867
2867
|
g._eyeBrowsAnimeStopped = !1;
|
|
2868
2868
|
const I = () => {
|
|
2869
|
-
g._eyeBrowsAnime =
|
|
2869
|
+
g._eyeBrowsAnime = Q({
|
|
2870
2870
|
targets: g._randomEyeBrowsData,
|
|
2871
2871
|
inner: () => Math.round(Math.random() * 50),
|
|
2872
2872
|
outer: () => Math.round(Math.random() * 50),
|
|
2873
2873
|
delay: () => (0.5 + Math.random() * 1.5) * 1e3,
|
|
2874
|
-
duration:
|
|
2874
|
+
duration: Q.random(150, 300),
|
|
2875
2875
|
autoplay: !0,
|
|
2876
2876
|
complete: I,
|
|
2877
2877
|
easing: "linear"
|
|
@@ -2882,7 +2882,7 @@ class sG {
|
|
|
2882
2882
|
_stopEyeBrowsAnimation() {
|
|
2883
2883
|
var g;
|
|
2884
2884
|
const I = this;
|
|
2885
|
-
I._eyeBrowsAnimeStopped = !0, (g = I._eyeBrowsAnime) == null || g.pause(), I._eyeBrowsAnime = null, I._eyeBrowsAnime =
|
|
2885
|
+
I._eyeBrowsAnimeStopped = !0, (g = I._eyeBrowsAnime) == null || g.pause(), I._eyeBrowsAnime = null, I._eyeBrowsAnime = Q({
|
|
2886
2886
|
targets: I._randomEyeBrowsData,
|
|
2887
2887
|
inner: () => 0,
|
|
2888
2888
|
outer: () => 0,
|
|
@@ -2902,18 +2902,18 @@ class sG {
|
|
|
2902
2902
|
if (s.type === "SkinnedMesh" && s.morphTargetDictionary !== void 0) {
|
|
2903
2903
|
const l = s.morphTargetDictionary, a = s.morphTargetInfluences;
|
|
2904
2904
|
l && a != null && a.length && Array.from(Object.keys(l)).forEach((c) => {
|
|
2905
|
-
const
|
|
2906
|
-
!this._eyesRelatedMorphTargets.includes(c) && n.set(c,
|
|
2905
|
+
const G = a[l[c]];
|
|
2906
|
+
!this._eyesRelatedMorphTargets.includes(c) && n.set(c, G);
|
|
2907
2907
|
});
|
|
2908
2908
|
}
|
|
2909
2909
|
}), I != null && I.length)
|
|
2910
2910
|
!this._lipsAnimeStopped && this._stopLipsAnimation(), !this._eyeBrowsAnimeStopped && this._stopEyeBrowsAnimation(), I.forEach((s) => {
|
|
2911
2911
|
const l = this._actionUnitToMorphTarget[s.index], a = s.side && l[s.side] || l.both;
|
|
2912
2912
|
a == null || a.forEach((c) => {
|
|
2913
|
-
const
|
|
2913
|
+
const G = n.has(c) && n.get(c) || 0;
|
|
2914
2914
|
let u = 0;
|
|
2915
2915
|
const m = s.index === 45 ? 1.5 : 1;
|
|
2916
|
-
s.index === 45 ? u = Math.min(m, s.strength) : u = Math.min(m, this._alpha * s.strength + (1 - this._alpha) *
|
|
2916
|
+
s.index === 45 ? u = Math.min(m, s.strength) : u = Math.min(m, this._alpha * s.strength + (1 - this._alpha) * G), C.push({
|
|
2917
2917
|
name: c,
|
|
2918
2918
|
value: u
|
|
2919
2919
|
});
|
|
@@ -2935,9 +2935,9 @@ class sG {
|
|
|
2935
2935
|
const l = this._randomLipsData.intensity / 100;
|
|
2936
2936
|
(this._randomLipsData.emotion === 0 ? Ec : xc).forEach((a) => {
|
|
2937
2937
|
if (oG.includes(a.index)) {
|
|
2938
|
-
const c = this._actionUnitToMorphTarget[a.index],
|
|
2939
|
-
|
|
2940
|
-
const m = this._baseMorphTargetData.get(u) || 0,
|
|
2938
|
+
const c = this._actionUnitToMorphTarget[a.index], G = a.side && c[a.side] || c.both;
|
|
2939
|
+
G == null || G.forEach((u) => {
|
|
2940
|
+
const m = this._baseMorphTargetData.get(u) || 0, B = n.get(u) || 0, p = (this._alpha * a.strength + (1 - this._alpha) * B) * l;
|
|
2941
2941
|
s.set(u, Math.max(p, m));
|
|
2942
2942
|
});
|
|
2943
2943
|
}
|
|
@@ -2945,9 +2945,9 @@ class sG {
|
|
|
2945
2945
|
}
|
|
2946
2946
|
tG.forEach((l) => {
|
|
2947
2947
|
const a = this._actionUnitToMorphTarget[l].both, c = (l === 1 ? this._randomEyeBrowsData.inner : this._randomEyeBrowsData.outer) / 100;
|
|
2948
|
-
a == null || a.forEach((
|
|
2949
|
-
const u = this._baseMorphTargetData.get(
|
|
2950
|
-
s.set(
|
|
2948
|
+
a == null || a.forEach((G) => {
|
|
2949
|
+
const u = this._baseMorphTargetData.get(G) || 0, m = n.get(G) || 0, B = this._alpha * c + (1 - this._alpha) * m;
|
|
2950
|
+
s.set(G, Math.max(B, u));
|
|
2951
2951
|
});
|
|
2952
2952
|
}), Array.from(s).forEach(([l, a]) => {
|
|
2953
2953
|
C.push({
|
|
@@ -2980,10 +2980,10 @@ class sG {
|
|
|
2980
2980
|
if (s.morphTargetDictionary && s.morphTargetInfluences && l in s.morphTargetDictionary) {
|
|
2981
2981
|
const a = s.morphTargetInfluences[s.morphTargetDictionary[l]], c = [0, (g.fadeInDuration || this._defaultFadeInDuration) / 1e3];
|
|
2982
2982
|
if (g.releaseAfterDuration) {
|
|
2983
|
-
const m = (g.fadeInDuration || this._defaultFadeInDuration) / 1e3 + (g.releaseAfterDuration || 0) / 1e3,
|
|
2984
|
-
c.push(m,
|
|
2983
|
+
const m = (g.fadeInDuration || this._defaultFadeInDuration) / 1e3 + (g.releaseAfterDuration || 0) / 1e3, B = (g.fadeInDuration || this._defaultFadeInDuration) / 1e3 + (g.fadeOutDuration || this._defaultFadeOutDuration) / 1e3 + (g.releaseAfterDuration || 0) / 1e3;
|
|
2984
|
+
c.push(m, B);
|
|
2985
2985
|
}
|
|
2986
|
-
const
|
|
2986
|
+
const G = o.strength * (g.intensity || this._defaultIntensity) / 100, u = g.releaseAfterDuration ? [a, G, G, a] : [a, G];
|
|
2987
2987
|
e.push(new d.NumberKeyframeTrack(`${t.name}.morphTargetInfluences[${l}]`, c, u, d.InterpolateLinear));
|
|
2988
2988
|
}
|
|
2989
2989
|
});
|
|
@@ -3012,19 +3012,19 @@ class sG {
|
|
|
3012
3012
|
s.forEach((a) => {
|
|
3013
3013
|
if (l.morphTargetDictionary && l.morphTargetInfluences && a in l.morphTargetDictionary) {
|
|
3014
3014
|
const c = l.morphTargetInfluences[l.morphTargetDictionary[a]];
|
|
3015
|
-
let
|
|
3015
|
+
let G = [], u = [];
|
|
3016
3016
|
if (C.shift)
|
|
3017
3017
|
if (C.timeline) {
|
|
3018
|
-
const { processedTimes: m, processedValues:
|
|
3019
|
-
m.length ? (
|
|
3018
|
+
const { processedTimes: m, processedValues: B } = this._processTimeline(C.timeline, C.strength);
|
|
3019
|
+
m.length ? (G = [0, ...m, C.duration || I], u = [c, ...B, C.strength]) : (G = [0, C.duration || I], u = [c, C.strength]);
|
|
3020
3020
|
} else
|
|
3021
|
-
|
|
3021
|
+
G = [0, C.duration || I], u = [c, C.strength];
|
|
3022
3022
|
else if (C.timeline) {
|
|
3023
|
-
const { processedTimes: m, processedValues:
|
|
3024
|
-
m.length ? (
|
|
3023
|
+
const { processedTimes: m, processedValues: B } = this._processTimeline(C.timeline, C.strength);
|
|
3024
|
+
m.length ? (G = [0, ...m, C.duration || I], u = [c, ...B, c]) : (G = [0, this._defaultFadeInDuration / 1e3, (C.duration || I) - this._defaultFadeOutDuration / 1e3, C.duration || I], u = [c, C.strength, C.strength, c]);
|
|
3025
3025
|
} else
|
|
3026
|
-
|
|
3027
|
-
t.push(new d.NumberKeyframeTrack(`${o.name}.morphTargetInfluences[${a}]`,
|
|
3026
|
+
G = [0, I / 2, I], u = [c, C.strength, c];
|
|
3027
|
+
t.push(new d.NumberKeyframeTrack(`${o.name}.morphTargetInfluences[${a}]`, G, u, d.InterpolateLinear));
|
|
3028
3028
|
}
|
|
3029
3029
|
});
|
|
3030
3030
|
});
|
|
@@ -3343,16 +3343,16 @@ class GG extends d.AnimationMixer {
|
|
|
3343
3343
|
return null;
|
|
3344
3344
|
}
|
|
3345
3345
|
if (this._commonFrequencyData) {
|
|
3346
|
-
const c = (this._commonFrequencyData.maxCumulativeWeight || 1) * Math.random(),
|
|
3346
|
+
const c = (this._commonFrequencyData.maxCumulativeWeight || 1) * Math.random(), G = this._commonFrequencyData.cumulativeWeights.filter((m, B) => {
|
|
3347
3347
|
var p;
|
|
3348
|
-
return this._commonFrequencyData && ((p = a.get(this._commonFrequencyData.weights[
|
|
3349
|
-
}), u =
|
|
3348
|
+
return this._commonFrequencyData && ((p = a.get(this._commonFrequencyData.weights[B])) == null ? void 0 : p.length);
|
|
3349
|
+
}), u = G.find((m) => m >= c) || G.reverse().find((m) => m < c);
|
|
3350
3350
|
if (u !== void 0) {
|
|
3351
3351
|
const m = this._commonFrequencyData.weights[this._commonFrequencyData.cumulativeWeights.indexOf(u)];
|
|
3352
|
-
let
|
|
3353
|
-
if (
|
|
3354
|
-
n != null && n.length &&
|
|
3355
|
-
const p =
|
|
3352
|
+
let B = a.get(m);
|
|
3353
|
+
if (B != null && B.length) {
|
|
3354
|
+
n != null && n.length && B.length > n.length && (B = B.filter((b) => !n.includes(b)));
|
|
3355
|
+
const p = B[Math.floor(Math.random() * (B.length - 1))];
|
|
3356
3356
|
return this._animationActions.get(p) || null;
|
|
3357
3357
|
}
|
|
3358
3358
|
}
|
|
@@ -3406,7 +3406,7 @@ class GG extends d.AnimationMixer {
|
|
|
3406
3406
|
case Zi.isIdle:
|
|
3407
3407
|
default:
|
|
3408
3408
|
const a = [];
|
|
3409
|
-
this._currentAnimationActions.forEach((c,
|
|
3409
|
+
this._currentAnimationActions.forEach((c, G) => a.push(G.toLowerCase())), l = this.getRandom(this._state === yg.speaking ? 1 : 0, a);
|
|
3410
3410
|
break;
|
|
3411
3411
|
}
|
|
3412
3412
|
l && (this._currentAnimationActions.has(l == null ? void 0 : l.getClip().name) ? l == null || l.reset().play() : (l == null || l.reset().fadeIn(this._fadeDuration).play(), this.stopAnimations(), this._currentAnimationActions.set(l == null ? void 0 : l.getClip().name, l)));
|
|
@@ -3670,16 +3670,16 @@ class bG {
|
|
|
3670
3670
|
e.name = "breathing";
|
|
3671
3671
|
const t = e.tracks;
|
|
3672
3672
|
switch (e.tracks = t.filter((o) => o.name.split(".")[0].match(uG)), I) {
|
|
3673
|
-
case
|
|
3673
|
+
case KI.cc4:
|
|
3674
3674
|
e.tracks.forEach((o) => {
|
|
3675
3675
|
o.name.toLowerCase().includes("rightshoulder") ? o.name = o.name.replace("mixamorigRightShoulder", "CC_Base_R_Clavicle") : o.name.toLowerCase().includes("leftshoulder") ? o.name = o.name.replace("mixamorigLeftShoulder", "CC_Base_L_Clavicle") : o.name.toLowerCase().includes("spine2") ? o.name = o.name.replace("mixamorigSpine2", "CC_Base_Spine02") : o.name.toLowerCase().includes("spine1") ? o.name = o.name.replace("mixamorigSpine1", "CC_Base_Spine02") : o.name.toLowerCase().includes("spine") && (o.name = o.name.replace("mixamorigSpine", "CC_Base_Waist"));
|
|
3676
3676
|
});
|
|
3677
3677
|
break;
|
|
3678
|
-
case
|
|
3678
|
+
case KI.mixamo:
|
|
3679
3679
|
this._needsRetargeting || e.tracks.forEach((o) => {
|
|
3680
3680
|
o.name = o.name.replace("mixamorig", "");
|
|
3681
3681
|
});
|
|
3682
|
-
case
|
|
3682
|
+
case KI.none:
|
|
3683
3683
|
}
|
|
3684
3684
|
d.AnimationUtils.makeClipAdditive(e);
|
|
3685
3685
|
}
|
|
@@ -3734,8 +3734,8 @@ class pG {
|
|
|
3734
3734
|
}
|
|
3735
3735
|
_initAnimation() {
|
|
3736
3736
|
const g = this, I = () => {
|
|
3737
|
-
const e = d.MathUtils.degToRad(-5 + Math.random() * 10) / g._nbBones, t = d.MathUtils.degToRad(-25 + Math.random() * 50) / g._nbBones, o = d.MathUtils.degToRad(-25 + Math.random() * 50) / g._nbBones, C =
|
|
3738
|
-
g._movementAnime =
|
|
3737
|
+
const e = d.MathUtils.degToRad(-5 + Math.random() * 10) / g._nbBones, t = d.MathUtils.degToRad(-25 + Math.random() * 50) / g._nbBones, o = d.MathUtils.degToRad(-25 + Math.random() * 50) / g._nbBones, C = Q.random(2e3, 2500), n = Q.random(2e3, 3e3);
|
|
3738
|
+
g._movementAnime = Q({
|
|
3739
3739
|
targets: g._boneRotation,
|
|
3740
3740
|
keyframes: [
|
|
3741
3741
|
{ x: e, y: t, z: o, duration: C * 0.5 },
|
|
@@ -3754,8 +3754,8 @@ class pG {
|
|
|
3754
3754
|
const g = this;
|
|
3755
3755
|
g._lookAt = !0;
|
|
3756
3756
|
const I = () => {
|
|
3757
|
-
const e = d.MathUtils.degToRad(-2 + Math.random() * 5) / g._nbBones, t = d.MathUtils.degToRad(-5 + Math.random() * 10) / g._nbBones, o = d.MathUtils.degToRad(-5 + Math.random() * 10) / g._nbBones, C =
|
|
3758
|
-
g._movementAnime =
|
|
3757
|
+
const e = d.MathUtils.degToRad(-2 + Math.random() * 5) / g._nbBones, t = d.MathUtils.degToRad(-5 + Math.random() * 10) / g._nbBones, o = d.MathUtils.degToRad(-5 + Math.random() * 10) / g._nbBones, C = Q.random(2e3, 2500), n = Q.random(2e3, 3e3);
|
|
3758
|
+
g._movementAnime = Q({
|
|
3759
3759
|
targets: g._boneRotation,
|
|
3760
3760
|
keyframes: [
|
|
3761
3761
|
{ x: e, y: t, z: o, duration: C * 0.5 },
|
|
@@ -3772,7 +3772,7 @@ class pG {
|
|
|
3772
3772
|
}
|
|
3773
3773
|
_initReleaseLookAt(g) {
|
|
3774
3774
|
const I = this, e = (C) => {
|
|
3775
|
-
I._lookAt = !1, I._movementAnime =
|
|
3775
|
+
I._lookAt = !1, I._movementAnime = Q({
|
|
3776
3776
|
targets: I._boneRotation,
|
|
3777
3777
|
x: [C.x, 0],
|
|
3778
3778
|
y: [C.y, 0],
|
|
@@ -3791,6 +3791,25 @@ class pG {
|
|
|
3791
3791
|
t.z - o.z
|
|
3792
3792
|
));
|
|
3793
3793
|
}
|
|
3794
|
+
_initLookAtAndSteady(g) {
|
|
3795
|
+
const I = this, e = (C) => {
|
|
3796
|
+
I._lookAt = !1, I._movementAnime = Q({
|
|
3797
|
+
targets: I._boneRotation,
|
|
3798
|
+
x: [C.x, 0],
|
|
3799
|
+
y: [C.y, 0],
|
|
3800
|
+
z: [C.z, 0],
|
|
3801
|
+
duration: g,
|
|
3802
|
+
autoplay: !0,
|
|
3803
|
+
complete: () => I._movementAnime = null,
|
|
3804
|
+
easing: "easeInOutSine"
|
|
3805
|
+
});
|
|
3806
|
+
}, t = I._previousRotations.get(I._bones[0].name), o = I._baseBoneRotations.get(I._bones[0].name);
|
|
3807
|
+
t && o && e(new d.Vector3(
|
|
3808
|
+
t.x - o.x,
|
|
3809
|
+
t.y - o.y,
|
|
3810
|
+
t.z - o.z
|
|
3811
|
+
));
|
|
3812
|
+
}
|
|
3794
3813
|
addHeadPoseSequence(g) {
|
|
3795
3814
|
const I = g.fps || 25, e = (g.duration || g.data.length / I) / g.data.length, t = [];
|
|
3796
3815
|
for (let C = 0; C < g.data.length; C++)
|
|
@@ -3800,9 +3819,9 @@ class pG {
|
|
|
3800
3819
|
this._bones.forEach((n) => {
|
|
3801
3820
|
const s = this._previousRotations.get(n.name);
|
|
3802
3821
|
if (s) {
|
|
3803
|
-
const l = this._alpha * (C.x / this._bones.length) + (1 - this._alpha) * s.x, a = -this._alpha * (C.y / this._bones.length) + (1 - this._alpha) * s.y, c = -this._alpha * (C.z / this._bones.length) + (1 - this._alpha) * s.z,
|
|
3804
|
-
u.setFromEuler(s), m.setFromEuler(new d.Euler((s.x + l) / 2, (s.y + a) / 2, (s.z + c) / 2, "XYZ")),
|
|
3805
|
-
const p = new d.QuaternionKeyframeTrack(`${n.name}.quaternion`, t, [...u.toArray(), ...m.toArray(), ...
|
|
3822
|
+
const l = this._alpha * (C.x / this._bones.length) + (1 - this._alpha) * s.x, a = -this._alpha * (C.y / this._bones.length) + (1 - this._alpha) * s.y, c = -this._alpha * (C.z / this._bones.length) + (1 - this._alpha) * s.z, G = new d.Euler(l, a, c, "XYZ"), u = new d.Quaternion(), m = new d.Quaternion(), B = new d.Quaternion();
|
|
3823
|
+
u.setFromEuler(s), m.setFromEuler(new d.Euler((s.x + l) / 2, (s.y + a) / 2, (s.z + c) / 2, "XYZ")), B.setFromEuler(G);
|
|
3824
|
+
const p = new d.QuaternionKeyframeTrack(`${n.name}.quaternion`, t, [...u.toArray(), ...m.toArray(), ...B.toArray()], d.InterpolateLinear);
|
|
3806
3825
|
o.push(p), this._previousRotations.set(n.name, new d.Euler(l, a, c, "XYZ"));
|
|
3807
3826
|
}
|
|
3808
3827
|
});
|
|
@@ -3824,10 +3843,10 @@ class pG {
|
|
|
3824
3843
|
this._bones.forEach((C) => {
|
|
3825
3844
|
const n = this._previousRotations.get(C.name), s = this._baseBoneRotations.get(C.name);
|
|
3826
3845
|
if (n && s) {
|
|
3827
|
-
const l = this._alpha * (s.x + I.x / this._bones.length) + (1 - this._alpha) * n.x, a = -(this._alpha * (s.y + I.y / this._bones.length) + (1 - this._alpha) * n.y), c = -(this._alpha * (s.z + I.z / this._bones.length) + (1 - this._alpha) * n.z),
|
|
3846
|
+
const l = this._alpha * (s.x + I.x / this._bones.length) + (1 - this._alpha) * n.x, a = -(this._alpha * (s.y + I.y / this._bones.length) + (1 - this._alpha) * n.y), c = -(this._alpha * (s.z + I.z / this._bones.length) + (1 - this._alpha) * n.z), G = new d.Quaternion().setFromEuler(n), u = new d.Quaternion().setFromEuler(new d.Euler(l, a, c, "XYZ"));
|
|
3828
3847
|
o.push({
|
|
3829
3848
|
name: C.name,
|
|
3830
|
-
value: [...
|
|
3849
|
+
value: [...G.toArray(), ...u.toArray()]
|
|
3831
3850
|
}), this._previousRotations.set(C.name, new d.Euler(l, a, c, "XYZ"));
|
|
3832
3851
|
}
|
|
3833
3852
|
});
|
|
@@ -3858,17 +3877,17 @@ class pG {
|
|
|
3858
3877
|
}
|
|
3859
3878
|
}
|
|
3860
3879
|
this._bones.forEach((a) => {
|
|
3861
|
-
const c = this._previousRotations.get(a.name),
|
|
3862
|
-
if (c &&
|
|
3880
|
+
const c = this._previousRotations.get(a.name), G = this._baseBoneRotations.get(a.name);
|
|
3881
|
+
if (c && G) {
|
|
3863
3882
|
const u = new d.Vector3(
|
|
3864
|
-
this._alpha * (
|
|
3865
|
-
this._alpha * (
|
|
3866
|
-
this._alpha * (
|
|
3867
|
-
), m = this._calculateRotationWithLimits(u,
|
|
3883
|
+
this._alpha * (G.x + n.x) + (1 - this._alpha) * c.x,
|
|
3884
|
+
this._alpha * (G.y + n.y) + (1 - this._alpha) * c.y,
|
|
3885
|
+
this._alpha * (G.z + n.z) + (1 - this._alpha) * c.z
|
|
3886
|
+
), m = this._calculateRotationWithLimits(u, G), B = new d.Euler(m.x, m.y, m.z, "XYZ"), p = new d.Quaternion().setFromEuler(c), b = new d.Quaternion().setFromEuler(B);
|
|
3868
3887
|
o.push({
|
|
3869
3888
|
name: a.name,
|
|
3870
3889
|
value: [...p.toArray(), ...b.toArray()]
|
|
3871
|
-
}), this._previousRotations.set(a.name,
|
|
3890
|
+
}), this._previousRotations.set(a.name, B);
|
|
3872
3891
|
}
|
|
3873
3892
|
});
|
|
3874
3893
|
}
|
|
@@ -3908,13 +3927,17 @@ class pG {
|
|
|
3908
3927
|
var I;
|
|
3909
3928
|
this._camera = g, (I = this._movementAnime) == null || I.pause(), this._initLookAtCamera();
|
|
3910
3929
|
}
|
|
3930
|
+
lookAtAndSteady(g) {
|
|
3931
|
+
var I;
|
|
3932
|
+
this._camera = g, (I = this._movementAnime) == null || I.pause(), this._initLookAtAndSteady(this._defaultFadeDuration);
|
|
3933
|
+
}
|
|
3911
3934
|
_processTimeline(g, I, e, t) {
|
|
3912
3935
|
var o, C, n;
|
|
3913
3936
|
const s = new d.Quaternion().setFromEuler(I), l = new d.Quaternion().setFromEuler(new d.Euler(I.x + 1e-3, I.y + 1e-3, I.z, "XYZ")), a = [0];
|
|
3914
3937
|
let c = [...s.toArray()];
|
|
3915
|
-
const
|
|
3916
|
-
max: I.x + d.MathUtils.degToRad(g.upperlimit[
|
|
3917
|
-
min: (o = g.lowerlimit) != null && o.length ? I.x + d.MathUtils.degToRad(g.lowerlimit[
|
|
3938
|
+
const G = g.planes.indexOf("x"), u = g.planes.indexOf("y"), m = g.planes.indexOf("z"), B = G > -1 ? {
|
|
3939
|
+
max: I.x + d.MathUtils.degToRad(g.upperlimit[G] / this._nbBones),
|
|
3940
|
+
min: (o = g.lowerlimit) != null && o.length ? I.x + d.MathUtils.degToRad(g.lowerlimit[G]) : 0
|
|
3918
3941
|
} : void 0, p = u > -1 ? {
|
|
3919
3942
|
max: I.y + d.MathUtils.degToRad(g.upperlimit[u] / this._nbBones),
|
|
3920
3943
|
min: (C = g.lowerlimit) != null && C.length ? I.y + d.MathUtils.degToRad(g.lowerlimit[u]) : 0
|
|
@@ -3923,14 +3946,14 @@ class pG {
|
|
|
3923
3946
|
min: (n = g.lowerlimit) != null && n.length ? I.z + d.MathUtils.degToRad(g.lowerlimit[m]) : 0
|
|
3924
3947
|
} : void 0, Z = this._calculateRotationWithLimits(
|
|
3925
3948
|
new d.Vector3(
|
|
3926
|
-
(
|
|
3949
|
+
(B == null ? void 0 : B.max) === void 0 ? I.x : B.max,
|
|
3927
3950
|
(p == null ? void 0 : p.max) === void 0 ? I.y : p.max,
|
|
3928
3951
|
(b == null ? void 0 : b.max) === void 0 ? I.z : b.max
|
|
3929
3952
|
),
|
|
3930
3953
|
e
|
|
3931
3954
|
), H = new d.Quaternion().setFromEuler(new d.Euler(Z.x, Z.y, Z.z, "XYZ")), R = this._calculateRotationWithLimits(
|
|
3932
3955
|
new d.Vector3(
|
|
3933
|
-
(
|
|
3956
|
+
(B == null ? void 0 : B.min) === void 0 ? I.x : B.min,
|
|
3934
3957
|
(p == null ? void 0 : p.min) === void 0 ? I.y : p.min,
|
|
3935
3958
|
(b == null ? void 0 : b.min) === void 0 ? I.z : b.min
|
|
3936
3959
|
),
|
|
@@ -3999,8 +4022,8 @@ class ZG {
|
|
|
3999
4022
|
_initAnimation() {
|
|
4000
4023
|
const g = this;
|
|
4001
4024
|
function I() {
|
|
4002
|
-
const e =
|
|
4003
|
-
g._saccadeAnime =
|
|
4025
|
+
const e = Q.random(1500, 2e3), t = Q.random(3e3, 3500), o = g._eyeRotation.x, C = d.MathUtils.degToRad(-Ge / 2 + Math.random() * Ge), n = Math.abs(o - C) > d.MathUtils.degToRad(Ge / 2) ? (o + C) / 2 : C, s = g._eyeRotation.y, l = d.MathUtils.degToRad(-Be / 2 + Math.random() * Be), a = Math.abs(s - l) > d.MathUtils.degToRad(Be / 2) ? (s + l) / 2 : l;
|
|
4026
|
+
g._saccadeAnime = Q({
|
|
4004
4027
|
targets: [g._eyeRotation],
|
|
4005
4028
|
keyframes: [
|
|
4006
4029
|
{ x: n, y: a, duration: e * 0.05 },
|
|
@@ -4019,6 +4042,24 @@ class ZG {
|
|
|
4019
4042
|
}
|
|
4020
4043
|
I();
|
|
4021
4044
|
}
|
|
4045
|
+
_initLookAtAndSteady() {
|
|
4046
|
+
const g = this;
|
|
4047
|
+
function I() {
|
|
4048
|
+
g._saccadeAnime = Q({
|
|
4049
|
+
targets: [g._eyeRotation],
|
|
4050
|
+
keyframes: [
|
|
4051
|
+
{ x: 0, y: 0, duration: 100 }
|
|
4052
|
+
// Reset positions in 100ms
|
|
4053
|
+
],
|
|
4054
|
+
autoplay: !0,
|
|
4055
|
+
easing: "easeInOutQuad",
|
|
4056
|
+
complete: () => {
|
|
4057
|
+
g._saccadeAnime = null;
|
|
4058
|
+
}
|
|
4059
|
+
});
|
|
4060
|
+
}
|
|
4061
|
+
I();
|
|
4062
|
+
}
|
|
4022
4063
|
updateRotations(g, I) {
|
|
4023
4064
|
const e = [], t = new d.Vector3(g.left.x, g.left.y, g.left.z), o = new d.Vector3(g.right.x, g.right.y, g.right.z), C = new d.Quaternion().setFromEuler(this._leftEyePreviousRotation), n = new d.Quaternion().setFromEuler(new d.Euler(t.x, t.y, t.z, "XYZ"));
|
|
4024
4065
|
return e.push({
|
|
@@ -4082,15 +4123,15 @@ class ZG {
|
|
|
4082
4123
|
right: new d.Euler(this._eyeRotation.x + this._rightEyeOriginRotation.x, this._eyeRotation.y + this._rightEyeOriginRotation.y, this._eyeRotation.z + this._rightEyeOriginRotation.z)
|
|
4083
4124
|
};
|
|
4084
4125
|
if (this._lookAt && (this._camera || t)) {
|
|
4085
|
-
const
|
|
4086
|
-
|
|
4087
|
-
const u = t || (this._camera ? this._camera :
|
|
4126
|
+
const G = new d.Object3D();
|
|
4127
|
+
G.position.set(0, 1.6, 2);
|
|
4128
|
+
const u = t || (this._camera ? this._camera : G), m = u.position.clone();
|
|
4088
4129
|
if (this._lastTarget !== u) {
|
|
4089
4130
|
if (this._timeTransitionTarget = performance.now() + this._durationTransitionTarget, !this._lastTarget) {
|
|
4090
4131
|
const Ig = new d.Vector3();
|
|
4091
4132
|
this._bones.left.getWorldPosition(Ig);
|
|
4092
4133
|
const Vg = new d.Vector3();
|
|
4093
|
-
this._bones.left.getWorldDirection(Vg), Vg.add(Ig),
|
|
4134
|
+
this._bones.left.getWorldDirection(Vg), Vg.add(Ig), G.position.set(Vg.x, Vg.y, Vg.z), this._lastTarget = G;
|
|
4094
4135
|
}
|
|
4095
4136
|
m.copy(this._lastTarget.position.clone().lerp(u.position.clone(), 1 / this._durationTransitionTarget)), this._oldTarget = this._lastTarget, this._lastTarget = u;
|
|
4096
4137
|
}
|
|
@@ -4098,7 +4139,7 @@ class ZG {
|
|
|
4098
4139
|
const Ig = this._easeInOutSine();
|
|
4099
4140
|
m.copy(this._oldTarget.position.clone().lerp(u.position.clone(), Ig));
|
|
4100
4141
|
}
|
|
4101
|
-
const
|
|
4142
|
+
const B = new d.Euler(), p = new d.Euler(), b = new d.Quaternion();
|
|
4102
4143
|
e.forEach((Ig) => {
|
|
4103
4144
|
b.multiply(new d.Quaternion().fromArray(Ig.value).invert());
|
|
4104
4145
|
});
|
|
@@ -4117,8 +4158,8 @@ class ZG {
|
|
|
4117
4158
|
this._bones.left.rotation.x += Math.PI / 16, this._bones.right.rotation.x += Math.PI / 16, this._bones.left.rotation.x = Math.max(Math.min(this._bones.left.rotation.x, Math.PI / 6), -Math.PI / 6), this._bones.right.rotation.x = Math.max(Math.min(this._bones.right.rotation.x, Math.PI / 6), -Math.PI / 6), this._bones.left.rotation.y = Math.max(Math.min(this._bones.left.rotation.y, Math.PI / 6), -Math.PI / 6), this._bones.right.rotation.y = Math.max(Math.min(this._bones.right.rotation.y, Math.PI / 6), -Math.PI / 6);
|
|
4118
4159
|
}
|
|
4119
4160
|
const Jg = this._bones.left.quaternion.clone(), eI = this._bones.right.quaternion.clone();
|
|
4120
|
-
this._bones.left.quaternion.copy(s), this._bones.right.quaternion.copy(l),
|
|
4121
|
-
left:
|
|
4161
|
+
this._bones.left.quaternion.copy(s), this._bones.right.quaternion.copy(l), B.setFromQuaternion(Jg), B.x += this._eyeRotation.x, B.y += this._eyeRotation.y, B.z += this._eyeRotation.z, p.setFromQuaternion(eI), p.x += this._eyeRotation.x, p.y += this._eyeRotation.y, p.z += this._eyeRotation.z, a = {
|
|
4162
|
+
left: B,
|
|
4122
4163
|
right: p
|
|
4123
4164
|
};
|
|
4124
4165
|
} else I && (a = {
|
|
@@ -4133,11 +4174,15 @@ class ZG {
|
|
|
4133
4174
|
return -(Math.cos(Math.PI * e) - 1) / 2;
|
|
4134
4175
|
}
|
|
4135
4176
|
releaseLookAt() {
|
|
4136
|
-
this._lastTarget = null, this._oldTarget = null, this._timeTransitionTarget = 0, this._lookAt = !1;
|
|
4177
|
+
this._lastTarget = null, this._oldTarget = null, this._timeTransitionTarget = 0, this._lookAt = !1, this._saccadeAnime === null && this._initAnimation();
|
|
4137
4178
|
}
|
|
4138
4179
|
lookAtAndKeep(g) {
|
|
4139
4180
|
this._lookAt = !0, this._camera = g;
|
|
4140
4181
|
}
|
|
4182
|
+
lookAtAndSteady(g) {
|
|
4183
|
+
var I;
|
|
4184
|
+
this._camera = g, (I = this._saccadeAnime) == null || I.pause(), this._initLookAtAndSteady();
|
|
4185
|
+
}
|
|
4141
4186
|
}
|
|
4142
4187
|
class jc {
|
|
4143
4188
|
constructor(g, I) {
|
|
@@ -5061,12 +5106,12 @@ class OG {
|
|
|
5061
5106
|
const t = [];
|
|
5062
5107
|
g.forEach((o) => {
|
|
5063
5108
|
var C, n, s, l, a, c;
|
|
5064
|
-
const
|
|
5065
|
-
if (
|
|
5066
|
-
const u =
|
|
5067
|
-
switch (u > e && (e = u),
|
|
5109
|
+
const G = (C = this._realizer) == null ? void 0 : C.bmlBlocks.find((u) => u.id === o.blockId);
|
|
5110
|
+
if (G) {
|
|
5111
|
+
const u = G.timeline.start !== void 0 && G.timeline.end !== void 0 && G.timeline.end > G.timeline.start ? G.timeline.end - G.timeline.start : 0;
|
|
5112
|
+
switch (u > e && (e = u), G.type) {
|
|
5068
5113
|
case P.FACEFACS: {
|
|
5069
|
-
const m =
|
|
5114
|
+
const m = G;
|
|
5070
5115
|
t.push({
|
|
5071
5116
|
index: m.au,
|
|
5072
5117
|
strength: m.amount || 0,
|
|
@@ -5077,7 +5122,7 @@ class OG {
|
|
|
5077
5122
|
break;
|
|
5078
5123
|
}
|
|
5079
5124
|
case bg.FACS: {
|
|
5080
|
-
const m =
|
|
5125
|
+
const m = G;
|
|
5081
5126
|
t.push({
|
|
5082
5127
|
index: m.au,
|
|
5083
5128
|
strength: m.amount || 0,
|
|
@@ -5089,13 +5134,13 @@ class OG {
|
|
|
5089
5134
|
break;
|
|
5090
5135
|
}
|
|
5091
5136
|
case P.FACELEXEME: {
|
|
5092
|
-
const m =
|
|
5093
|
-
(l =
|
|
5137
|
+
const m = G, B = _s[m.lexeme];
|
|
5138
|
+
(l = B == null ? void 0 : B.au) != null && l.length && B.au.forEach((p) => {
|
|
5094
5139
|
var b;
|
|
5095
5140
|
t.push({
|
|
5096
5141
|
index: p,
|
|
5097
5142
|
strength: m.amount || 0,
|
|
5098
|
-
side: ((b =
|
|
5143
|
+
side: ((b = B.side) == null ? void 0 : b.toLowerCase()) || void 0,
|
|
5099
5144
|
duration: u,
|
|
5100
5145
|
timeline: m.timeline
|
|
5101
5146
|
});
|
|
@@ -5103,15 +5148,15 @@ class OG {
|
|
|
5103
5148
|
break;
|
|
5104
5149
|
}
|
|
5105
5150
|
case bg.LEXEME: {
|
|
5106
|
-
const m =
|
|
5107
|
-
if ((a =
|
|
5151
|
+
const m = G, B = _s[m.lexeme];
|
|
5152
|
+
if ((a = B == null ? void 0 : B.au) != null && a.length) {
|
|
5108
5153
|
const p = (c = m.parentAttributes.find((b) => b.name === "amount")) == null ? void 0 : c.value;
|
|
5109
|
-
|
|
5154
|
+
B.au.forEach((b) => {
|
|
5110
5155
|
var Z;
|
|
5111
5156
|
t.push({
|
|
5112
5157
|
index: b,
|
|
5113
5158
|
strength: typeof p == "number" ? p : 0,
|
|
5114
|
-
side: ((Z =
|
|
5159
|
+
side: ((Z = B.side) == null ? void 0 : Z.toLowerCase()) || void 0,
|
|
5115
5160
|
duration: u,
|
|
5116
5161
|
timeline: m.timeline,
|
|
5117
5162
|
shift: m.shift
|
|
@@ -5145,61 +5190,61 @@ class OG {
|
|
|
5145
5190
|
}
|
|
5146
5191
|
}
|
|
5147
5192
|
_handlePointing(g, I, e, t) {
|
|
5148
|
-
var o, C, n, s, l, a, c,
|
|
5149
|
-
let
|
|
5193
|
+
var o, C, n, s, l, a, c, G, u, m;
|
|
5194
|
+
let B = "";
|
|
5150
5195
|
if (e)
|
|
5151
5196
|
switch (e.toLowerCase()) {
|
|
5152
5197
|
case "up":
|
|
5153
|
-
|
|
5198
|
+
B = "bml_gestureup";
|
|
5154
5199
|
break;
|
|
5155
5200
|
case "upright":
|
|
5156
|
-
|
|
5201
|
+
B = "bml_gestureupright";
|
|
5157
5202
|
break;
|
|
5158
5203
|
case "upleft":
|
|
5159
|
-
|
|
5204
|
+
B = "bml_gestureupleft";
|
|
5160
5205
|
break;
|
|
5161
5206
|
case "down":
|
|
5162
|
-
|
|
5207
|
+
B = "bml_gesturedown";
|
|
5163
5208
|
break;
|
|
5164
5209
|
case "downright":
|
|
5165
|
-
|
|
5210
|
+
B = "bml_gesturedownright";
|
|
5166
5211
|
break;
|
|
5167
5212
|
case "downleft":
|
|
5168
|
-
|
|
5213
|
+
B = "bml_gesturedownleft";
|
|
5169
5214
|
break;
|
|
5170
5215
|
case "left":
|
|
5171
|
-
|
|
5216
|
+
B = "bml_gestureleft";
|
|
5172
5217
|
break;
|
|
5173
5218
|
case "right":
|
|
5174
|
-
|
|
5219
|
+
B = "bml_gestureright";
|
|
5175
5220
|
break;
|
|
5176
5221
|
case "user":
|
|
5177
|
-
|
|
5222
|
+
B = "bml_gestureuser2";
|
|
5178
5223
|
break;
|
|
5179
5224
|
case "me":
|
|
5180
|
-
|
|
5225
|
+
B = "bml_gestureme2";
|
|
5181
5226
|
break;
|
|
5182
5227
|
}
|
|
5183
|
-
if (
|
|
5228
|
+
if (B) {
|
|
5184
5229
|
let p;
|
|
5185
5230
|
switch (I == null ? void 0 : I.toLowerCase()) {
|
|
5186
5231
|
case "left_hand":
|
|
5187
|
-
p = (o = this._animationClipMap.get(
|
|
5232
|
+
p = (o = this._animationClipMap.get(B + "_BG")) == null ? void 0 : o.clone();
|
|
5188
5233
|
break;
|
|
5189
5234
|
case "right_hand":
|
|
5190
|
-
p = (C = this._animationClipMap.get(
|
|
5235
|
+
p = (C = this._animationClipMap.get(B + "_BD")) == null ? void 0 : C.clone();
|
|
5191
5236
|
break;
|
|
5192
5237
|
case "both_hands":
|
|
5193
|
-
const b = (n = this._animationClipMap.get(
|
|
5194
|
-
b && Z && (p = new d.AnimationClip(
|
|
5238
|
+
const b = (n = this._animationClipMap.get(B + "_BG")) == null ? void 0 : n.clone(), Z = (s = this._animationClipMap.get(B + "_BD")) == null ? void 0 : s.clone();
|
|
5239
|
+
b && Z && (p = new d.AnimationClip(B + "_BOTH", Math.max(b.duration, Z.duration), [...b.tracks, ...Z.tracks], d.NormalAnimationBlendMode));
|
|
5195
5240
|
break;
|
|
5196
5241
|
default:
|
|
5197
|
-
p = (l = this._animationClipMap.get(
|
|
5242
|
+
p = (l = this._animationClipMap.get(B + "_BD")) == null ? void 0 : l.clone();
|
|
5198
5243
|
break;
|
|
5199
5244
|
}
|
|
5200
5245
|
if (p) {
|
|
5201
5246
|
this._playingAnimations.size && d.AnimationUtils.makeClipAdditive(p);
|
|
5202
|
-
const b = (
|
|
5247
|
+
const b = (G = (c = (a = this._globalManager) == null ? void 0 : a.animationManager) == null ? void 0 : c.animationMixer) == null ? void 0 : G.clipAction(p);
|
|
5203
5248
|
b && (b.setLoop(d.LoopPingPong, 2), b.clampWhenFinished = !0, t && b.setDuration(t), (m = (u = this._globalManager) == null ? void 0 : u.animationManager.animationMixer) == null || m.playAnimationAction(b, !!this._playingAnimations.size), this._playingAnimations.set(g, b.getClip().name));
|
|
5204
5249
|
}
|
|
5205
5250
|
}
|
|
@@ -5330,7 +5375,7 @@ class IB {
|
|
|
5330
5375
|
_initAnimation() {
|
|
5331
5376
|
const g = this;
|
|
5332
5377
|
function I() {
|
|
5333
|
-
g.duration =
|
|
5378
|
+
g.duration = Q.random(3e3, 4e3), g._breathAnime = Q({
|
|
5334
5379
|
targets: [g._breath],
|
|
5335
5380
|
keyframes: [
|
|
5336
5381
|
{ x: 1 + 0.1 / g.BreathingMeshs.length, y: 1 + 0.05 / g.BreathingMeshs.length, z: 1 + 0.2 / g.BreathingMeshs.length, duration: g.duration * (1 / 3 * 0.75) },
|
|
@@ -5402,26 +5447,30 @@ class eB {
|
|
|
5402
5447
|
var I, e;
|
|
5403
5448
|
(I = this.headPoseManager) == null || I.lookAtAndKeep(g), (e = this.gazeManager) == null || e.lookAtAndKeep(g);
|
|
5404
5449
|
}
|
|
5405
|
-
|
|
5450
|
+
lookAtAndSteady(g) {
|
|
5406
5451
|
var I, e;
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5452
|
+
(I = this.headPoseManager) == null || I.lookAtAndSteady(g), (e = this.gazeManager) == null || e.lookAtAndSteady(g);
|
|
5453
|
+
}
|
|
5454
|
+
update(g) {
|
|
5455
|
+
var I, e, t;
|
|
5456
|
+
const o = g.characterState || yg.idle;
|
|
5457
|
+
(I = this.bmlManager) == null || I.update(g.deltaTime), this.lipSyncManager.update(g.deltaTime), this.animationManager.update(g.deltaTime, o), (e = g.targets) != null && e.length && performance.now() - this._lastTargetChangeTimestamp > this._durationTargetChange && (this._lastTargetChangeTimestamp = performance.now(), this._durationTargetChange = 3e3 + Math.random() * 2e3, this._target = g.targets[Math.floor(Math.random() * g.targets.length)]);
|
|
5458
|
+
const C = [], n = !this.animationOverride || (t = g.AU) != null && t.length ? [] : this.eyeBlinkManager.update(g.timestamp), s = this.animationOverride ? this.breathingManager.update(g.timestamp) : [], l = this.animationOverride ? this.FACSManager.update(g.timestamp, g.AU, o) : [], a = this.animationOverride ? this.headPoseManager.update(g.timestamp, g.headPose || null, this._target) : [], c = this.animationOverride ? this.gazeManager.update(g.timestamp, g.gaze || null, a, this._target) : [[], []], G = [...n, ...c[0], ...l], u = [...c[1], ...a], m = [...s], B = (g.timestamp - this._lastTimestamp) / 1e3;
|
|
5459
|
+
this._lastTimestamp = g.timestamp, (G.length || u.length) && this._mesh.traverse((p) => {
|
|
5460
|
+
if (p.type === "SkinnedMesh" && p.morphTargetDictionary !== void 0) {
|
|
5461
|
+
const b = p;
|
|
5462
|
+
G.forEach((Z) => {
|
|
5463
|
+
if (!(p.name === "Eye_Mesh" && qG.includes(Z.name)) && b.morphTargetDictionary && b.morphTargetInfluences && Z.name in b.morphTargetDictionary) {
|
|
5464
|
+
const H = b.morphTargetInfluences[b.morphTargetDictionary[Z.name]];
|
|
5465
|
+
C.push(new d.NumberKeyframeTrack(`${p.name}.morphTargetInfluences[${Z.name}]`, [0, B], [H, Z.value], d.InterpolateLinear));
|
|
5417
5466
|
}
|
|
5418
5467
|
});
|
|
5419
5468
|
}
|
|
5420
|
-
}),
|
|
5421
|
-
|
|
5422
|
-
}),
|
|
5423
|
-
|
|
5424
|
-
}), this.animationMixer.uncacheClip(this._animationClip), this.animationMixer.uncacheAction(this._animationClip), this._animationClip.tracks =
|
|
5469
|
+
}), u.forEach((p) => {
|
|
5470
|
+
C.push(new d.QuaternionKeyframeTrack(`${p.name}.quaternion`, this._times, p.value, d.InterpolateLinear));
|
|
5471
|
+
}), m.forEach((p) => {
|
|
5472
|
+
C.push(new d.VectorKeyframeTrack(`${p.name}.scale`, this._times, p.value, d.InterpolateLinear));
|
|
5473
|
+
}), this.animationMixer.uncacheClip(this._animationClip), this.animationMixer.uncacheAction(this._animationClip), this._animationClip.tracks = C, this._animationClip.duration = B, this._animationAction = this.animationMixer.clipAction(this._animationClip), this._animationAction.setLoop(d.LoopOnce, 1), this._animationAction.clampWhenFinished = !0, this._animationAction.reset().play(), this.animationMixer.update(g.deltaTime);
|
|
5425
5474
|
}
|
|
5426
5475
|
}
|
|
5427
5476
|
const ai = new d.Vector3(1, 0, 0), iB = new d.Vector3(-1, 0, 0), dt = new d.Vector3(0, 1, 0), ea = new d.Vector3(0, -1, 0), At = new d.Vector3(0, 0, 1), ia = new d.Vector3(0, 0, -1), li = class ae {
|
|
@@ -5666,7 +5715,7 @@ class Rn {
|
|
|
5666
5715
|
}
|
|
5667
5716
|
// #endregion
|
|
5668
5717
|
}
|
|
5669
|
-
class
|
|
5718
|
+
class XI extends d.SkeletonHelper {
|
|
5670
5719
|
constructor(g) {
|
|
5671
5720
|
var I;
|
|
5672
5721
|
super(g), h(this, "_boneMap"), h(this, "object"), h(this, "_skeleton"), this.object = g, this._skeleton = new d.Skeleton(this.bones);
|
|
@@ -5682,7 +5731,7 @@ class VI extends d.SkeletonHelper {
|
|
|
5682
5731
|
}
|
|
5683
5732
|
clone(g) {
|
|
5684
5733
|
const I = DA.clone(this.object);
|
|
5685
|
-
return console.log("clone", I), new
|
|
5734
|
+
return console.log("clone", I), new XI(I);
|
|
5686
5735
|
}
|
|
5687
5736
|
newPose(g = !1) {
|
|
5688
5737
|
const I = new Rn(this.skeleton);
|
|
@@ -7177,7 +7226,7 @@ class Gg extends d.Object3D {
|
|
|
7177
7226
|
}), n.forEach((s) => {
|
|
7178
7227
|
o.push({
|
|
7179
7228
|
url: `${C}${s[0]}`,
|
|
7180
|
-
from:
|
|
7229
|
+
from: KI[s[1]],
|
|
7181
7230
|
frequency: s.length > 2 ? s[2] : void 0
|
|
7182
7231
|
});
|
|
7183
7232
|
});
|
|
@@ -7185,14 +7234,14 @@ class Gg extends d.Object3D {
|
|
|
7185
7234
|
I && Gg.logDebug({
|
|
7186
7235
|
text: "array of animations to load",
|
|
7187
7236
|
value: o
|
|
7188
|
-
}), o.length ? await this.addAnimationsFromUrls(o,
|
|
7237
|
+
}), o.length ? await this.addAnimationsFromUrls(o, KI.none) : (e = this.onAnimationsLoaded) == null || e.call(this), this._controller && ((t = this._globalManager.animationManager.controllableManager) == null || t.init(this._controller));
|
|
7189
7238
|
}
|
|
7190
7239
|
update(g) {
|
|
7191
7240
|
this._globalManager.update(g);
|
|
7192
7241
|
}
|
|
7193
7242
|
static async loadArmatures() {
|
|
7194
7243
|
return {
|
|
7195
|
-
armature: await
|
|
7244
|
+
armature: await ag.gltfLoader.loadAsync("https://cdn.retorik.ai/bodyengine-three/armatures/armaturetest.glb")
|
|
7196
7245
|
};
|
|
7197
7246
|
}
|
|
7198
7247
|
static async fromCharacterCreator(g) {
|
|
@@ -7206,8 +7255,8 @@ class Gg extends d.Object3D {
|
|
|
7206
7255
|
try {
|
|
7207
7256
|
const o = new Gg({
|
|
7208
7257
|
...g,
|
|
7209
|
-
sourceMesh: new
|
|
7210
|
-
targetMesh: new
|
|
7258
|
+
sourceMesh: new XI(t.scene.children[0]),
|
|
7259
|
+
targetMesh: new XI(g.mesh),
|
|
7211
7260
|
animationsUrl: I,
|
|
7212
7261
|
...BB,
|
|
7213
7262
|
type: dg.cc3
|
|
@@ -7234,8 +7283,8 @@ class Gg extends d.Object3D {
|
|
|
7234
7283
|
const o = new Gg({
|
|
7235
7284
|
...g,
|
|
7236
7285
|
mesh: g.mesh,
|
|
7237
|
-
sourceMesh: new
|
|
7238
|
-
targetMesh: new
|
|
7286
|
+
sourceMesh: new XI(t.scene.children[0]),
|
|
7287
|
+
targetMesh: new XI(g.mesh),
|
|
7239
7288
|
animationsUrl: I,
|
|
7240
7289
|
...mB,
|
|
7241
7290
|
type: dg.rpm
|
|
@@ -7260,8 +7309,8 @@ class Gg extends d.Object3D {
|
|
|
7260
7309
|
try {
|
|
7261
7310
|
const o = new Gg({
|
|
7262
7311
|
...g,
|
|
7263
|
-
sourceMesh: new
|
|
7264
|
-
targetMesh: new
|
|
7312
|
+
sourceMesh: new XI(t.scene),
|
|
7313
|
+
targetMesh: new XI(g.mesh),
|
|
7265
7314
|
animationsUrl: I,
|
|
7266
7315
|
...GB,
|
|
7267
7316
|
type: dg.avatarsdk
|
|
@@ -7285,8 +7334,8 @@ class Gg extends d.Object3D {
|
|
|
7285
7334
|
});
|
|
7286
7335
|
const o = new Gg({
|
|
7287
7336
|
...g,
|
|
7288
|
-
sourceMesh: new
|
|
7289
|
-
targetMesh: new
|
|
7337
|
+
sourceMesh: new XI(t.scene),
|
|
7338
|
+
targetMesh: new XI(g.mesh),
|
|
7290
7339
|
animationsUrl: I,
|
|
7291
7340
|
...uB,
|
|
7292
7341
|
type: dg.avaturn
|
|
@@ -7316,22 +7365,22 @@ class Gg extends d.Object3D {
|
|
|
7316
7365
|
frequency: g.frequency
|
|
7317
7366
|
};
|
|
7318
7367
|
switch (g.from) {
|
|
7319
|
-
case
|
|
7368
|
+
case KI.mixamo:
|
|
7320
7369
|
await this._globalManager.animationManager.addMixamoAnimation(o);
|
|
7321
7370
|
break;
|
|
7322
|
-
case
|
|
7323
|
-
case
|
|
7371
|
+
case KI.actorcore:
|
|
7372
|
+
case KI.cc4:
|
|
7324
7373
|
await this._globalManager.animationManager.addCC4Animation(o);
|
|
7325
7374
|
break;
|
|
7326
|
-
case
|
|
7375
|
+
case KI.none:
|
|
7327
7376
|
default:
|
|
7328
7377
|
switch (e[1]) {
|
|
7329
7378
|
case "fbx": {
|
|
7330
|
-
t = await
|
|
7379
|
+
t = await ag.fbxLoader.loadAsync(g.url);
|
|
7331
7380
|
break;
|
|
7332
7381
|
}
|
|
7333
7382
|
case "glb": {
|
|
7334
|
-
const C = await
|
|
7383
|
+
const C = await ag.gltfLoader.loadAsync(g.url);
|
|
7335
7384
|
C.scene.animations = C.animations, t = C.scene;
|
|
7336
7385
|
break;
|
|
7337
7386
|
}
|
|
@@ -7345,17 +7394,17 @@ class Gg extends d.Object3D {
|
|
|
7345
7394
|
}
|
|
7346
7395
|
static async overrideArmatureAvatarSDK(g, I, e) {
|
|
7347
7396
|
var t, o, C;
|
|
7348
|
-
const n = (await
|
|
7349
|
-
for (const
|
|
7350
|
-
n.getObjectByName(
|
|
7397
|
+
const n = (await ag.gltfLoader.loadAsync(g)).scene, s = [], l = I.getObjectByName("AvatarBody").skeleton.bones.map((B) => B.name);
|
|
7398
|
+
for (const B of l)
|
|
7399
|
+
n.getObjectByName(B) && s.push(n.getObjectByName(B));
|
|
7351
7400
|
I.updateMatrixWorld();
|
|
7352
7401
|
let a = new d.Box3().setFromObject(I), c = new d.Vector3();
|
|
7353
7402
|
a.getSize(c);
|
|
7354
|
-
const
|
|
7403
|
+
const G = new d.Skeleton(s), u = I.getObjectByName("Hips");
|
|
7355
7404
|
u && ((t = I.getObjectByName("AvatarRoot")) == null || t.remove(u));
|
|
7356
7405
|
const m = (o = n.getObjectByName("AvatarRoot")) == null ? void 0 : o.children[0];
|
|
7357
|
-
m && ((C = I.getObjectByName("AvatarRoot")) == null || C.attach(m)), I.traverse((
|
|
7358
|
-
|
|
7406
|
+
m && ((C = I.getObjectByName("AvatarRoot")) == null || C.attach(m)), I.traverse((B) => {
|
|
7407
|
+
B.type === "SkinnedMesh" && (B.skeleton = G, B.bind(G));
|
|
7359
7408
|
}), a = new d.Box3().setFromObject(I), c = new d.Vector3(), a.getSize(c);
|
|
7360
7409
|
}
|
|
7361
7410
|
static setTPose(g, I, e) {
|
|
@@ -7380,16 +7429,16 @@ class Gg extends d.Object3D {
|
|
|
7380
7429
|
g = g.filter((l) => !n.includes(l) && !s.includes(l));
|
|
7381
7430
|
for (const l of n)
|
|
7382
7431
|
await new Promise((a, c) => {
|
|
7383
|
-
this.addAnimationFromUrl(l).then(() => a()).catch((
|
|
7432
|
+
this.addAnimationFromUrl(l).then(() => a()).catch((G) => c(G));
|
|
7384
7433
|
});
|
|
7385
7434
|
for (const l of s)
|
|
7386
7435
|
await new Promise((a, c) => {
|
|
7387
|
-
this.addAnimationFromUrl(l).then(() => a()).catch((
|
|
7436
|
+
this.addAnimationFromUrl(l).then(() => a()).catch((G) => c(G));
|
|
7388
7437
|
});
|
|
7389
7438
|
(e = this._globalManager) != null && e.bmlManager && await ((o = (t = this._globalManager) == null ? void 0 : t.bmlManager) == null ? void 0 : o.loadAnimations(this.addAnimationFromUrl)), (C = this.onAnimationsLoaded) == null || C.call(this);
|
|
7390
7439
|
for (const l of g)
|
|
7391
7440
|
await new Promise((a, c) => {
|
|
7392
|
-
this.addAnimationFromUrl(l).then(() => a()).catch((
|
|
7441
|
+
this.addAnimationFromUrl(l).then(() => a()).catch((G) => c(G));
|
|
7393
7442
|
});
|
|
7394
7443
|
}
|
|
7395
7444
|
playDefaultIdleAnimation() {
|
|
@@ -7423,8 +7472,8 @@ const ta = (i) => {
|
|
|
7423
7472
|
const I = /* @__PURE__ */ new Set(), e = (l, a) => {
|
|
7424
7473
|
const c = typeof l == "function" ? l(g) : l;
|
|
7425
7474
|
if (!Object.is(c, g)) {
|
|
7426
|
-
const
|
|
7427
|
-
g = a ?? (typeof c != "object" || c === null) ? c : Object.assign({}, g, c), I.forEach((u) => u(g,
|
|
7475
|
+
const G = g;
|
|
7476
|
+
g = a ?? (typeof c != "object" || c === null) ? c : Object.assign({}, g, c), I.forEach((u) => u(g, G));
|
|
7428
7477
|
}
|
|
7429
7478
|
}, t = () => g, n = { setState: e, getState: t, getInitialState: () => s, subscribe: (l) => (I.add(l), () => I.delete(l)) }, s = g = i(e, t, n);
|
|
7430
7479
|
return n;
|
|
@@ -7440,7 +7489,7 @@ function yB(i, g = ZB) {
|
|
|
7440
7489
|
const SB = (i) => {
|
|
7441
7490
|
const g = pB(i), I = (e) => yB(g, e);
|
|
7442
7491
|
return Object.assign(I, g), I;
|
|
7443
|
-
}, Ii = (i) => SB,
|
|
7492
|
+
}, Ii = (i) => SB, sg = Ii()(() => ({
|
|
7444
7493
|
character: null,
|
|
7445
7494
|
managers: [],
|
|
7446
7495
|
globalManager: null,
|
|
@@ -7457,18 +7506,18 @@ const SB = (i) => {
|
|
|
7457
7506
|
characterDepth: 0,
|
|
7458
7507
|
characterState: yg.idle
|
|
7459
7508
|
})), WB = (i) => {
|
|
7460
|
-
|
|
7509
|
+
sg.setState({ character: i }), sg.setState({ managers: {
|
|
7461
7510
|
lipSyncManager: (i == null ? void 0 : i.lipSyncManager) || null,
|
|
7462
7511
|
eyeBlinkManager: (i == null ? void 0 : i.eyeBlinkManager) || null,
|
|
7463
7512
|
animationManager: (i == null ? void 0 : i.animationManager) || null
|
|
7464
|
-
} }),
|
|
7513
|
+
} }), sg.setState({ globalManager: (i == null ? void 0 : i.globalManager) || null }), sg.setState({ lipSyncManager: (i == null ? void 0 : i.lipSyncManager) || null }), sg.setState({ eyeBlinkManager: (i == null ? void 0 : i.eyeBlinkManager) || null }), sg.setState({ animationManager: (i == null ? void 0 : i.animationManager) || null }), sg.setState({ FACSManager: (i == null ? void 0 : i.FACSManager) || null }), sg.setState({ headPoseManager: (i == null ? void 0 : i.headPoseManager) || null }), sg.setState({ gazeManager: (i == null ? void 0 : i.gazeManager) || null }), sg.setState({ bmlManager: (i == null ? void 0 : i.bmlManager) || null });
|
|
7465
7514
|
}, oa = (i) => {
|
|
7466
|
-
|
|
7515
|
+
sg.setState({ animationsLoaded: i });
|
|
7467
7516
|
}, vB = (i) => {
|
|
7468
|
-
|
|
7469
|
-
}, BV = () =>
|
|
7470
|
-
|
|
7471
|
-
},
|
|
7517
|
+
sg.setState({ characterWidth: i.x }), sg.setState({ characterHeight: i.y }), sg.setState({ characterDepth: i.z });
|
|
7518
|
+
}, BV = () => sg.getState().characterHeight, Ca = (i) => {
|
|
7519
|
+
sg.setState({ characterState: i });
|
|
7520
|
+
}, Ug = Ii()(() => ({
|
|
7472
7521
|
cameraRef: null,
|
|
7473
7522
|
cameraPosition: new fA(0, 0, 5),
|
|
7474
7523
|
bodyCenter: null,
|
|
@@ -7477,46 +7526,54 @@ const SB = (i) => {
|
|
|
7477
7526
|
lookAt: null,
|
|
7478
7527
|
movable: !0
|
|
7479
7528
|
})), HB = (i) => {
|
|
7480
|
-
|
|
7529
|
+
Ug.setState({ cameraRef: i });
|
|
7481
7530
|
}, na = (i) => {
|
|
7482
|
-
|
|
7483
|
-
}, mV = () =>
|
|
7484
|
-
|
|
7531
|
+
Ug.setState({ cameraPosition: i });
|
|
7532
|
+
}, mV = () => Ug.getState().cameraPosition, VB = (i) => {
|
|
7533
|
+
Ug.setState({ bodyCenter: i });
|
|
7485
7534
|
}, XB = (i) => {
|
|
7486
|
-
|
|
7535
|
+
Ug.setState({ defaultPositions: i });
|
|
7487
7536
|
}, RB = (i) => {
|
|
7488
|
-
|
|
7537
|
+
Ug.setState({ defaultDistances: i });
|
|
7489
7538
|
}, sa = (i) => {
|
|
7490
|
-
|
|
7491
|
-
}, uV = () =>
|
|
7492
|
-
|
|
7493
|
-
},
|
|
7539
|
+
Ug.setState({ lookAt: i });
|
|
7540
|
+
}, uV = () => Ug.getState().lookAt, KB = (i) => {
|
|
7541
|
+
Ug.setState({ movable: i });
|
|
7542
|
+
}, pI = Ii()(() => ({
|
|
7494
7543
|
currentAUs: null,
|
|
7495
7544
|
currentGaze: null,
|
|
7496
7545
|
currentHeadPose: null,
|
|
7497
7546
|
lookAtCamera: !1,
|
|
7498
7547
|
targets: []
|
|
7499
7548
|
})), YB = (i) => {
|
|
7500
|
-
|
|
7549
|
+
pI.setState({ targets: i });
|
|
7501
7550
|
}, bV = (i) => {
|
|
7502
|
-
|
|
7551
|
+
pI.setState({ currentAUs: i });
|
|
7503
7552
|
}, pV = (i) => {
|
|
7504
|
-
|
|
7553
|
+
pI.setState({ currentGaze: i });
|
|
7505
7554
|
}, ZV = (i) => {
|
|
7506
|
-
|
|
7555
|
+
pI.setState({ currentHeadPose: i });
|
|
7507
7556
|
}, Fo = (i) => {
|
|
7508
|
-
|
|
7557
|
+
pI.setState({ lookAtCamera: i }), i ? wB() : LB();
|
|
7558
|
+
}, yV = (i) => {
|
|
7559
|
+
pI.setState({ lookAtCamera: i });
|
|
7560
|
+
const g = sg.getState().globalManager;
|
|
7561
|
+
if (i) {
|
|
7562
|
+
const I = Ug.getState().cameraRef;
|
|
7563
|
+
g == null || g.lookAtAndSteady(I);
|
|
7564
|
+
} else
|
|
7565
|
+
g == null || g.releaseLookAt();
|
|
7509
7566
|
}, wB = (i) => {
|
|
7510
|
-
const g =
|
|
7567
|
+
const g = sg.getState().globalManager;
|
|
7511
7568
|
if (i)
|
|
7512
7569
|
g == null || g.lookAtAndKeep(i);
|
|
7513
7570
|
else {
|
|
7514
|
-
const I =
|
|
7571
|
+
const I = Ug.getState().cameraRef;
|
|
7515
7572
|
g == null || g.lookAtAndKeep(I);
|
|
7516
7573
|
}
|
|
7517
7574
|
}, LB = () => {
|
|
7518
7575
|
var i;
|
|
7519
|
-
(i =
|
|
7576
|
+
(i = sg.getState().globalManager) == null || i.releaseLookAt();
|
|
7520
7577
|
}, Pe = Ii()(() => ({
|
|
7521
7578
|
animationsNames: [],
|
|
7522
7579
|
animations: /* @__PURE__ */ new Map(),
|
|
@@ -7526,15 +7583,15 @@ const SB = (i) => {
|
|
|
7526
7583
|
Pe.setState({ animationsNames: i });
|
|
7527
7584
|
}, FB = (i) => {
|
|
7528
7585
|
Pe.setState({ animations: i });
|
|
7529
|
-
},
|
|
7586
|
+
}, SV = () => Pe.getState().animations, WV = (i) => {
|
|
7530
7587
|
Pe.setState({ autoPlay: i });
|
|
7531
|
-
},
|
|
7588
|
+
}, vV = (i) => {
|
|
7532
7589
|
if (Pe.setState({ autoPlay: !1 }), Pe.getState().animationsNames.includes(i)) {
|
|
7533
|
-
const I =
|
|
7590
|
+
const I = sg.getState().animationManager;
|
|
7534
7591
|
I == null || I.playAnimation(i);
|
|
7535
7592
|
}
|
|
7536
7593
|
};
|
|
7537
|
-
var gI = /* @__PURE__ */ ((i) => (i.eye = "eye", i.mouth = "mouth", i.neck = "neck", i.clavicle = "clavicle", i.torso = "torso", i.belly = "belly", i.lowerbelly = "lowerbelly", i.hips = "hips", i.higherthigh = "higherthigh", i.thigh = "thigh", i.knee = "knee", i.leg = "leg", i.feet = "feet", i))(gI || {}),
|
|
7594
|
+
var gI = /* @__PURE__ */ ((i) => (i.eye = "eye", i.mouth = "mouth", i.neck = "neck", i.clavicle = "clavicle", i.torso = "torso", i.belly = "belly", i.lowerbelly = "lowerbelly", i.hips = "hips", i.higherthigh = "higherthigh", i.thigh = "thigh", i.knee = "knee", i.leg = "leg", i.feet = "feet", i))(gI || {}), VI = /* @__PURE__ */ ((i) => (i[i.face = 1] = "face", i[i.eighthleft = 2] = "eighthleft", i[i.thirdleft = 3] = "thirdleft", i[i.quarterleft = 4] = "quarterleft", i[i.halfleft = 5] = "halfleft", i[i.eighthright = 6] = "eighthright", i[i.thirdright = 7] = "thirdright", i[i.quarterright = 8] = "quarterright", i[i.halfright = 9] = "halfright", i))(VI || {}), Tg = /* @__PURE__ */ ((i) => (i[i.veryclose = 1] = "veryclose", i[i.closer = 2] = "closer", i[i.close = 3] = "close", i[i.midclose = 4] = "midclose", i[i.medium = 5] = "medium", i[i.midfar = 6] = "midfar", i[i.far = 7] = "far", i[i.farther = 8] = "farther", i[i.veryfar = 9] = "veryfar", i))(Tg || {}), Si = /* @__PURE__ */ ((i) => (i.cc3 = "CC_Base_Body", i.rpm = "Wolf3D_Body", i.avatarsdk = "AvatarBody", i.avaturn = "Body_Mesh", i))(Si || {}), Kn = /* @__PURE__ */ ((i) => (i.Jay = "joy", i.Anger = "anger", i.Contempt = "contempt", i.Disgust = "disgust", i.Dislike = "dislike", i.Distress = "distress", i.Fear = "fear", i.Frustration = "frustration", i.Guilt = "guilt", i.Hope = "hope", i.Love = "love", i.Pride = "pride", i.Regret = "regret", i.Relief = "relief", i.Sadness = "sadness", i.Shame = "shame", i.Smile = "smile", i.Surprise = "surprise", i.Neutral = "neutral", i))(Kn || {});
|
|
7538
7595
|
const aa = /* @__PURE__ */ new Map([
|
|
7539
7596
|
[0, "sil"],
|
|
7540
7597
|
[1, "aa"],
|
|
@@ -7650,29 +7707,29 @@ const aa = /* @__PURE__ */ new Map([
|
|
|
7650
7707
|
["m", 21]
|
|
7651
7708
|
]), zB = {
|
|
7652
7709
|
position: gI.mouth,
|
|
7653
|
-
distance:
|
|
7710
|
+
distance: Tg.farther,
|
|
7654
7711
|
lookAt: gI.lowerbelly
|
|
7655
7712
|
}, fB = {
|
|
7656
7713
|
position: gI.mouth,
|
|
7657
|
-
distance:
|
|
7714
|
+
distance: Tg.close,
|
|
7658
7715
|
lookAt: gI.mouth
|
|
7659
7716
|
}, MB = {
|
|
7660
7717
|
position: gI.mouth,
|
|
7661
|
-
distance:
|
|
7718
|
+
distance: Tg.midclose,
|
|
7662
7719
|
lookAt: gI.mouth
|
|
7663
7720
|
}, UB = {
|
|
7664
7721
|
position: gI.neck,
|
|
7665
|
-
distance:
|
|
7722
|
+
distance: Tg.close,
|
|
7666
7723
|
lookAt: gI.neck
|
|
7667
7724
|
}, QB = {
|
|
7668
7725
|
position: gI.eye,
|
|
7669
|
-
distance:
|
|
7726
|
+
distance: Tg.medium,
|
|
7670
7727
|
lookAt: gI.neck
|
|
7671
7728
|
}, TB = {
|
|
7672
7729
|
position: gI.eye,
|
|
7673
|
-
distance:
|
|
7730
|
+
distance: Tg.medium,
|
|
7674
7731
|
lookAt: gI.clavicle
|
|
7675
|
-
},
|
|
7732
|
+
}, HV = {
|
|
7676
7733
|
default: zB,
|
|
7677
7734
|
head: fB,
|
|
7678
7735
|
neck: MB,
|
|
@@ -7697,11 +7754,11 @@ const aa = /* @__PURE__ */ new Map([
|
|
|
7697
7754
|
g && (i.voice = g);
|
|
7698
7755
|
}
|
|
7699
7756
|
Sg.setState({ currentUtterance: i }), Sg.setState({ textToSpeak: null });
|
|
7700
|
-
},
|
|
7757
|
+
}, VV = (i) => {
|
|
7701
7758
|
Sg.setState({ visemes: i });
|
|
7702
7759
|
}, Sr = (i) => {
|
|
7703
7760
|
Sg.setState({ visemes: [...Sg.getState().visemes, i] });
|
|
7704
|
-
},
|
|
7761
|
+
}, XV = (i, g) => {
|
|
7705
7762
|
const I = JB.get(i.name);
|
|
7706
7763
|
if (I) {
|
|
7707
7764
|
const e = kB.get(I);
|
|
@@ -7714,14 +7771,14 @@ const aa = /* @__PURE__ */ new Map([
|
|
|
7714
7771
|
Sg.setState({
|
|
7715
7772
|
visemes: [],
|
|
7716
7773
|
currentVisemeIndex: 0
|
|
7717
|
-
}), (i =
|
|
7774
|
+
}), (i = sg.getState().lipSyncManager) == null || i.stop();
|
|
7718
7775
|
}, jB = (i) => {
|
|
7719
7776
|
Sg.setState({ voice: i });
|
|
7720
7777
|
}, la = (i) => {
|
|
7721
7778
|
Sg.setState({ voices: i });
|
|
7722
|
-
},
|
|
7779
|
+
}, RV = (i) => {
|
|
7723
7780
|
Sg.setState({ textToSpeak: i });
|
|
7724
|
-
},
|
|
7781
|
+
}, KV = () => Sg.getState().voices, YV = (i) => {
|
|
7725
7782
|
Sg.setState({ visemeIntensity: i });
|
|
7726
7783
|
}, OB = (i, g, I) => {
|
|
7727
7784
|
let e = I[i.position || gI.eye].getComponent(0);
|
|
@@ -7729,64 +7786,64 @@ const aa = /* @__PURE__ */ new Map([
|
|
|
7729
7786
|
let o = 0;
|
|
7730
7787
|
const C = typeof i.distance == "string" ? parseInt(i.distance) : i.distance, n = typeof i.rotation == "string" ? parseInt(i.rotation) : i.rotation;
|
|
7731
7788
|
switch (C) {
|
|
7732
|
-
case
|
|
7789
|
+
case Tg.veryclose:
|
|
7733
7790
|
o = g.veryclose;
|
|
7734
7791
|
break;
|
|
7735
|
-
case
|
|
7792
|
+
case Tg.closer:
|
|
7736
7793
|
o = g.closer;
|
|
7737
7794
|
break;
|
|
7738
|
-
case
|
|
7795
|
+
case Tg.close:
|
|
7739
7796
|
o = g.close;
|
|
7740
7797
|
break;
|
|
7741
|
-
case
|
|
7798
|
+
case Tg.midclose:
|
|
7742
7799
|
o = g.midclose;
|
|
7743
7800
|
break;
|
|
7744
|
-
case
|
|
7801
|
+
case Tg.medium:
|
|
7745
7802
|
o = g.medium;
|
|
7746
7803
|
break;
|
|
7747
|
-
case
|
|
7804
|
+
case Tg.midfar:
|
|
7748
7805
|
o = g.midfar;
|
|
7749
7806
|
break;
|
|
7750
|
-
case
|
|
7807
|
+
case Tg.far:
|
|
7751
7808
|
o = g.far;
|
|
7752
7809
|
break;
|
|
7753
|
-
case
|
|
7810
|
+
case Tg.farther:
|
|
7754
7811
|
case void 0:
|
|
7755
7812
|
default:
|
|
7756
7813
|
o = g.farther;
|
|
7757
7814
|
break;
|
|
7758
|
-
case
|
|
7815
|
+
case Tg.veryfar:
|
|
7759
7816
|
o = g.veryfar;
|
|
7760
7817
|
break;
|
|
7761
7818
|
}
|
|
7762
|
-
if (n && n !==
|
|
7819
|
+
if (n && n !== VI.face)
|
|
7763
7820
|
switch (n) {
|
|
7764
|
-
case
|
|
7821
|
+
case VI.eighthleft: {
|
|
7765
7822
|
const s = 0.2588190451;
|
|
7766
7823
|
e = e - o * s, o = o * Math.sqrt(1 - Math.pow(s, 2));
|
|
7767
7824
|
break;
|
|
7768
7825
|
}
|
|
7769
|
-
case
|
|
7826
|
+
case VI.thirdleft:
|
|
7770
7827
|
e = e - o * (1 / 2), o = o * (Math.sqrt(3) / 2);
|
|
7771
7828
|
break;
|
|
7772
|
-
case
|
|
7829
|
+
case VI.quarterleft:
|
|
7773
7830
|
e = e - o * (Math.SQRT2 / 2), o = o * (Math.SQRT2 / 2);
|
|
7774
7831
|
break;
|
|
7775
|
-
case
|
|
7832
|
+
case VI.halfleft:
|
|
7776
7833
|
e = e - o, o = I.eye.getComponent(2);
|
|
7777
7834
|
break;
|
|
7778
|
-
case
|
|
7835
|
+
case VI.eighthright: {
|
|
7779
7836
|
const s = 0.2588190451;
|
|
7780
7837
|
e = e + o * s, o = o * Math.sqrt(1 - Math.pow(s, 2));
|
|
7781
7838
|
break;
|
|
7782
7839
|
}
|
|
7783
|
-
case
|
|
7840
|
+
case VI.thirdright:
|
|
7784
7841
|
e = e + o * (1 / 2), o = o * (Math.sqrt(3) / 2);
|
|
7785
7842
|
break;
|
|
7786
|
-
case
|
|
7843
|
+
case VI.quarterright:
|
|
7787
7844
|
e = e + o * (Math.SQRT2 / 2), o = o * (Math.SQRT2 / 2);
|
|
7788
7845
|
break;
|
|
7789
|
-
case
|
|
7846
|
+
case VI.halfright:
|
|
7790
7847
|
e = e + o, o = I.eye.getComponent(2);
|
|
7791
7848
|
break;
|
|
7792
7849
|
}
|
|
@@ -8135,7 +8192,7 @@ class lm extends am {
|
|
|
8135
8192
|
return this.privAgentConfig;
|
|
8136
8193
|
}
|
|
8137
8194
|
}
|
|
8138
|
-
class
|
|
8195
|
+
class yI {
|
|
8139
8196
|
constructor(g) {
|
|
8140
8197
|
this.privEventListeners = {}, this.privIsDisposed = !1, this.privConsoleListener = void 0, this.privMetadata = g;
|
|
8141
8198
|
}
|
|
@@ -8180,12 +8237,12 @@ class hg {
|
|
|
8180
8237
|
return hg.privInstance;
|
|
8181
8238
|
}
|
|
8182
8239
|
}
|
|
8183
|
-
hg.privInstance = new
|
|
8240
|
+
hg.privInstance = new yI();
|
|
8184
8241
|
var pg;
|
|
8185
8242
|
(function(i) {
|
|
8186
8243
|
i[i.None = 0] = "None", i[i.Connected = 1] = "Connected", i[i.Connecting = 2] = "Connecting", i[i.Disconnected = 3] = "Disconnected";
|
|
8187
8244
|
})(pg || (pg = {}));
|
|
8188
|
-
class
|
|
8245
|
+
class YI {
|
|
8189
8246
|
constructor(g) {
|
|
8190
8247
|
if (this.privSubscriptionIdCounter = 0, this.privAddSubscriptions = {}, this.privRemoveSubscriptions = {}, this.privDisposedSubscriptions = {}, this.privDisposeReason = null, this.privList = [], g)
|
|
8191
8248
|
for (const I of g)
|
|
@@ -8272,11 +8329,11 @@ class KI {
|
|
|
8272
8329
|
const I = [];
|
|
8273
8330
|
for (let e = 0; e < this.privList.length; e++)
|
|
8274
8331
|
I.push(g(this.privList[e], e));
|
|
8275
|
-
return new
|
|
8332
|
+
return new YI(I);
|
|
8276
8333
|
}
|
|
8277
8334
|
where(g) {
|
|
8278
8335
|
this.throwIfDisposed();
|
|
8279
|
-
const I = new
|
|
8336
|
+
const I = new YI();
|
|
8280
8337
|
for (let e = 0; e < this.privList.length; e++)
|
|
8281
8338
|
g(this.privList[e], e) && I.add(this.privList[e]);
|
|
8282
8339
|
return I;
|
|
@@ -8284,19 +8341,19 @@ class KI {
|
|
|
8284
8341
|
orderBy(g) {
|
|
8285
8342
|
this.throwIfDisposed();
|
|
8286
8343
|
const e = this.toArray().sort(g);
|
|
8287
|
-
return new
|
|
8344
|
+
return new YI(e);
|
|
8288
8345
|
}
|
|
8289
8346
|
orderByDesc(g) {
|
|
8290
8347
|
return this.throwIfDisposed(), this.orderBy((I, e) => g(e, I));
|
|
8291
8348
|
}
|
|
8292
8349
|
clone() {
|
|
8293
|
-
return this.throwIfDisposed(), new
|
|
8350
|
+
return this.throwIfDisposed(), new YI(this.toArray());
|
|
8294
8351
|
}
|
|
8295
8352
|
concat(g) {
|
|
8296
|
-
return this.throwIfDisposed(), new
|
|
8353
|
+
return this.throwIfDisposed(), new YI(this.privList.concat(g.toArray()));
|
|
8297
8354
|
}
|
|
8298
8355
|
concatArray(g) {
|
|
8299
|
-
return this.throwIfDisposed(), new
|
|
8356
|
+
return this.throwIfDisposed(), new YI(this.privList.concat(g));
|
|
8300
8357
|
}
|
|
8301
8358
|
isDisposed() {
|
|
8302
8359
|
return this.privList == null;
|
|
@@ -8387,7 +8444,7 @@ var da = function(i, g, I, e) {
|
|
|
8387
8444
|
})(Xi || (Xi = {}));
|
|
8388
8445
|
let ki = class {
|
|
8389
8446
|
constructor(g) {
|
|
8390
|
-
this.privPromiseStore = new
|
|
8447
|
+
this.privPromiseStore = new YI(), this.privIsDrainInProgress = !1, this.privIsDisposing = !1, this.privDisposeReason = null, this.privList = g || new YI(), this.privDetachables = [], this.privSubscribers = new YI(), this.privDetachables.push(this.privList.onAdded(() => this.drain()));
|
|
8391
8448
|
}
|
|
8392
8449
|
enqueue(g) {
|
|
8393
8450
|
this.throwIfDispose(), this.enqueueFromPromise(new Promise((I) => I(g)));
|
|
@@ -9019,7 +9076,7 @@ var Bt = function(i, g, I, e) {
|
|
|
9019
9076
|
const Am = "MICROPHONE-WorkletSourceUrl";
|
|
9020
9077
|
class mI {
|
|
9021
9078
|
constructor(g, I, e, t) {
|
|
9022
|
-
this.privRecorder = g, this.deviceId = I, this.privStreams = {}, this.privOutputChunkSize = mI.AUDIOFORMAT.avgBytesPerSec / 10, this.privId = e || Cg(), this.privEvents = new
|
|
9079
|
+
this.privRecorder = g, this.deviceId = I, this.privStreams = {}, this.privOutputChunkSize = mI.AUDIOFORMAT.avgBytesPerSec / 10, this.privId = e || Cg(), this.privEvents = new yI(), this.privMediaStream = t || null, this.privIsClosing = !1;
|
|
9023
9080
|
}
|
|
9024
9081
|
get format() {
|
|
9025
9082
|
return Promise.resolve(mI.AUDIOFORMAT);
|
|
@@ -9187,7 +9244,7 @@ var zo = function(i, g, I, e) {
|
|
|
9187
9244
|
};
|
|
9188
9245
|
class hm {
|
|
9189
9246
|
constructor(g, I, e) {
|
|
9190
|
-
this.privStreams = {}, this.privHeaderEnd = 44, this.privId = e || Cg(), this.privEvents = new
|
|
9247
|
+
this.privStreams = {}, this.privHeaderEnd = 44, this.privId = e || Cg(), this.privEvents = new yI(), this.privSource = g, typeof window < "u" && typeof Blob < "u" && this.privSource instanceof Blob ? this.privFilename = g.name : this.privFilename = I || "unknown.wav", this.privAudioFormatPromise = this.readHeader();
|
|
9191
9248
|
}
|
|
9192
9249
|
get format() {
|
|
9193
9250
|
return this.privAudioFormatPromise;
|
|
@@ -9252,13 +9309,13 @@ class hm {
|
|
|
9252
9309
|
return;
|
|
9253
9310
|
}
|
|
9254
9311
|
const s = C.getInt32(16, !0), l = C.getUint16(22, !0), a = C.getUint32(24, !0), c = C.getUint16(34, !0);
|
|
9255
|
-
let
|
|
9256
|
-
for (; n(
|
|
9257
|
-
if (
|
|
9312
|
+
let G = 36 + Math.max(s - 16, 0);
|
|
9313
|
+
for (; n(G) !== "data"; G += 2)
|
|
9314
|
+
if (G > 4288) {
|
|
9258
9315
|
e.reject("Invalid WAV header in file, data block was not found");
|
|
9259
9316
|
return;
|
|
9260
9317
|
}
|
|
9261
|
-
this.privHeaderEnd =
|
|
9318
|
+
this.privHeaderEnd = G + 8, e.resolve(ei.getWaveFormatPCM(a, c, l));
|
|
9262
9319
|
};
|
|
9263
9320
|
if (typeof window < "u" && typeof Blob < "u" && I instanceof Blob) {
|
|
9264
9321
|
const o = new FileReader();
|
|
@@ -9328,9 +9385,9 @@ class fo {
|
|
|
9328
9385
|
}
|
|
9329
9386
|
})();
|
|
9330
9387
|
a.onaudioprocess = (c) => {
|
|
9331
|
-
const
|
|
9388
|
+
const G = c.inputBuffer.getChannelData(0);
|
|
9332
9389
|
if (e && !e.isClosed) {
|
|
9333
|
-
const u = o.encode(
|
|
9390
|
+
const u = o.encode(G);
|
|
9334
9391
|
u && e.writeStreamChunk({
|
|
9335
9392
|
buffer: u,
|
|
9336
9393
|
isEnd: !1,
|
|
@@ -9344,8 +9401,8 @@ class fo {
|
|
|
9344
9401
|
};
|
|
9345
9402
|
}, s = (a) => {
|
|
9346
9403
|
const c = new AudioWorkletNode(a, "speech-processor");
|
|
9347
|
-
c.port.onmessage = (
|
|
9348
|
-
const u =
|
|
9404
|
+
c.port.onmessage = (G) => {
|
|
9405
|
+
const u = G.data;
|
|
9349
9406
|
if (e && !e.isClosed) {
|
|
9350
9407
|
const m = o.encode(u);
|
|
9351
9408
|
m && e.writeStreamChunk({
|
|
@@ -9432,7 +9489,7 @@ class Mi {
|
|
|
9432
9489
|
throw new Rg("uri");
|
|
9433
9490
|
if (!e)
|
|
9434
9491
|
throw new Rg("messageFormatter");
|
|
9435
|
-
this.proxyInfo = t, this.privConnectionEvents = new
|
|
9492
|
+
this.proxyInfo = t, this.privConnectionEvents = new yI(), this.privConnectionId = I, this.privMessageFormatter = e, this.privConnectionState = pg.None, this.privUri = g, this.privHeaders = o, this.privEnableCompression = C, this.privHeaders[O.ConnectionId] = this.privConnectionId, this.privLastErrorReceived = "";
|
|
9436
9493
|
}
|
|
9437
9494
|
get state() {
|
|
9438
9495
|
return this.privConnectionState;
|
|
@@ -9634,8 +9691,8 @@ class zI {
|
|
|
9634
9691
|
s += l === 0 && g.indexOf("?") === -1 ? "?" : "&";
|
|
9635
9692
|
const c = encodeURIComponent(a);
|
|
9636
9693
|
s += c;
|
|
9637
|
-
let
|
|
9638
|
-
|
|
9694
|
+
let G = I[a];
|
|
9695
|
+
G && (G = encodeURIComponent(G), s += `=${G}`), l++;
|
|
9639
9696
|
}
|
|
9640
9697
|
}
|
|
9641
9698
|
if (e) {
|
|
@@ -9849,7 +9906,7 @@ class mm extends Fn {
|
|
|
9849
9906
|
* @param {AudioStreamFormat} format - The audio stream format.
|
|
9850
9907
|
*/
|
|
9851
9908
|
constructor(g) {
|
|
9852
|
-
super(), g === void 0 ? this.privFormat = jI.getDefaultInputFormat() : this.privFormat = g, this.privEvents = new
|
|
9909
|
+
super(), g === void 0 ? this.privFormat = jI.getDefaultInputFormat() : this.privFormat = g, this.privEvents = new yI(), this.privId = Cg(), this.privStream = new Nn(this.privFormat.avgBytesPerSec / 10);
|
|
9853
9910
|
}
|
|
9854
9911
|
/**
|
|
9855
9912
|
* Format information for the audio
|
|
@@ -9963,7 +10020,7 @@ class Yr extends Jn {
|
|
|
9963
10020
|
* returned from the callback's read() method (Required if format is not 16 kHz 16bit mono PCM).
|
|
9964
10021
|
*/
|
|
9965
10022
|
constructor(g, I) {
|
|
9966
|
-
super(), I === void 0 ? this.privFormat = ei.getDefaultInputFormat() : this.privFormat = I, this.privEvents = new
|
|
10023
|
+
super(), I === void 0 ? this.privFormat = ei.getDefaultInputFormat() : this.privFormat = I, this.privEvents = new yI(), this.privId = Cg(), this.privCallback = g, this.privIsClosed = !1, this.privBufferSize = this.privFormat.avgBytesPerSec / 10;
|
|
9967
10024
|
}
|
|
9968
10025
|
/**
|
|
9969
10026
|
* Format information for the audio
|
|
@@ -10739,7 +10796,7 @@ class Fg {
|
|
|
10739
10796
|
return this.privSessionId;
|
|
10740
10797
|
}
|
|
10741
10798
|
}
|
|
10742
|
-
class
|
|
10799
|
+
class SI extends Fg {
|
|
10743
10800
|
/**
|
|
10744
10801
|
* Creates and initializes an instance of this class.
|
|
10745
10802
|
* @constructor
|
|
@@ -10759,11 +10816,11 @@ class yI extends Fg {
|
|
|
10759
10816
|
return this.privOffset;
|
|
10760
10817
|
}
|
|
10761
10818
|
}
|
|
10762
|
-
var
|
|
10819
|
+
var E;
|
|
10763
10820
|
(function(i) {
|
|
10764
10821
|
i[i.Simple = 0] = "Simple", i[i.Detailed = 1] = "Detailed";
|
|
10765
|
-
})(
|
|
10766
|
-
class Me extends
|
|
10822
|
+
})(E || (E = {}));
|
|
10823
|
+
class Me extends SI {
|
|
10767
10824
|
/**
|
|
10768
10825
|
* Creates and initializes an instance of this class.
|
|
10769
10826
|
* @constructor
|
|
@@ -11028,7 +11085,7 @@ class Lr {
|
|
|
11028
11085
|
}
|
|
11029
11086
|
class Mo extends Lr {
|
|
11030
11087
|
}
|
|
11031
|
-
class OI extends
|
|
11088
|
+
class OI extends SI {
|
|
11032
11089
|
/**
|
|
11033
11090
|
* Creates and initializes an instance of this class.
|
|
11034
11091
|
* @constructor
|
|
@@ -11050,7 +11107,7 @@ class OI extends yI {
|
|
|
11050
11107
|
return this.privResult;
|
|
11051
11108
|
}
|
|
11052
11109
|
}
|
|
11053
|
-
class kC extends
|
|
11110
|
+
class kC extends SI {
|
|
11054
11111
|
/**
|
|
11055
11112
|
* Creates and initializes an instance of this class.
|
|
11056
11113
|
* @constructor
|
|
@@ -11074,7 +11131,7 @@ class kC extends yI {
|
|
|
11074
11131
|
}
|
|
11075
11132
|
class pm extends OI {
|
|
11076
11133
|
}
|
|
11077
|
-
class ro extends
|
|
11134
|
+
class ro extends SI {
|
|
11078
11135
|
/**
|
|
11079
11136
|
* Creates and initializes an instance of this class.
|
|
11080
11137
|
* @constructor
|
|
@@ -11116,7 +11173,7 @@ class ro extends yI {
|
|
|
11116
11173
|
}
|
|
11117
11174
|
class Un extends ro {
|
|
11118
11175
|
}
|
|
11119
|
-
class Wi extends
|
|
11176
|
+
class Wi extends SI {
|
|
11120
11177
|
/**
|
|
11121
11178
|
* Creates and initializes an instance of this class.
|
|
11122
11179
|
* @constructor
|
|
@@ -11329,7 +11386,7 @@ class Qn {
|
|
|
11329
11386
|
}
|
|
11330
11387
|
class ce extends Qn {
|
|
11331
11388
|
constructor() {
|
|
11332
|
-
super(), this.privProperties = new x(), this.speechRecognitionLanguage = "en-US", this.outputFormat =
|
|
11389
|
+
super(), this.privProperties = new x(), this.speechRecognitionLanguage = "en-US", this.outputFormat = E.Simple;
|
|
11333
11390
|
}
|
|
11334
11391
|
get properties() {
|
|
11335
11392
|
return this.privProperties;
|
|
@@ -11362,10 +11419,10 @@ class ce extends Qn {
|
|
|
11362
11419
|
this.privProperties.setProperty(r.SpeechServiceConnection_AutoDetectSourceLanguages, g);
|
|
11363
11420
|
}
|
|
11364
11421
|
get outputFormat() {
|
|
11365
|
-
return
|
|
11422
|
+
return E[this.privProperties.getProperty(sI, void 0)];
|
|
11366
11423
|
}
|
|
11367
11424
|
set outputFormat(g) {
|
|
11368
|
-
this.privProperties.setProperty(sI,
|
|
11425
|
+
this.privProperties.setProperty(sI, E[g]);
|
|
11369
11426
|
}
|
|
11370
11427
|
get endpointId() {
|
|
11371
11428
|
return this.privProperties.getProperty(r.SpeechServiceConnection_EndpointId);
|
|
@@ -11510,7 +11567,7 @@ class Tn extends Qn {
|
|
|
11510
11567
|
}
|
|
11511
11568
|
class vi extends Tn {
|
|
11512
11569
|
constructor() {
|
|
11513
|
-
super(), this.privSpeechProperties = new x(), this.outputFormat =
|
|
11570
|
+
super(), this.privSpeechProperties = new x(), this.outputFormat = E.Simple;
|
|
11514
11571
|
}
|
|
11515
11572
|
/**
|
|
11516
11573
|
* Gets/Sets the authorization token.
|
|
@@ -11559,7 +11616,7 @@ class vi extends Tn {
|
|
|
11559
11616
|
* @public
|
|
11560
11617
|
*/
|
|
11561
11618
|
get outputFormat() {
|
|
11562
|
-
return
|
|
11619
|
+
return E[this.privSpeechProperties.getProperty(sI, void 0)];
|
|
11563
11620
|
}
|
|
11564
11621
|
/**
|
|
11565
11622
|
* Gets/Sets the output format
|
|
@@ -11568,7 +11625,7 @@ class vi extends Tn {
|
|
|
11568
11625
|
* @public
|
|
11569
11626
|
*/
|
|
11570
11627
|
set outputFormat(g) {
|
|
11571
|
-
this.privSpeechProperties.setProperty(sI,
|
|
11628
|
+
this.privSpeechProperties.setProperty(sI, E[g]);
|
|
11572
11629
|
}
|
|
11573
11630
|
/**
|
|
11574
11631
|
* Gets the endpoint id.
|
|
@@ -12036,7 +12093,7 @@ class Dn extends AI {
|
|
|
12036
12093
|
* @returns {OutputFormat} The output format of recognition.
|
|
12037
12094
|
*/
|
|
12038
12095
|
get outputFormat() {
|
|
12039
|
-
return A.throwIfDisposed(this.privDisposedRecognizer), this.properties.getProperty(sI,
|
|
12096
|
+
return A.throwIfDisposed(this.privDisposedRecognizer), this.properties.getProperty(sI, E[E.Simple]) === E[E.Simple] ? E.Simple : E.Detailed;
|
|
12040
12097
|
}
|
|
12041
12098
|
/**
|
|
12042
12099
|
* The collection of properties and their values defined for this SpeechRecognizer.
|
|
@@ -13401,17 +13458,17 @@ class Kg {
|
|
|
13401
13458
|
class je extends Kg {
|
|
13402
13459
|
create(g, I, e) {
|
|
13403
13460
|
const t = g.parameters.getProperty(r.Conversation_ApplicationId, ""), o = g.parameters.getProperty(r.Conversation_DialogType), C = g.parameters.getProperty(r.SpeechServiceConnection_Region), n = g.parameters.getProperty(r.SpeechServiceConnection_RecoLanguage, "en-US"), s = g.parameters.getProperty(r.Conversation_Request_Bot_Status_Messages, "true"), l = {};
|
|
13404
|
-
l[O.ConnectionId] = e, l[V.Format] = g.parameters.getProperty(sI,
|
|
13405
|
-
const a = o === CI.DialogTypes.CustomCommands ? "commands/" : "", c = o === CI.DialogTypes.CustomCommands ? "v1" : o === CI.DialogTypes.BotFramework ? "v3" : "v0",
|
|
13406
|
-
I.token != null && I.token !== "" && (
|
|
13461
|
+
l[O.ConnectionId] = e, l[V.Format] = g.parameters.getProperty(sI, E[E.Simple]).toLowerCase(), l[V.Language] = n, l[V.RequestBotStatusMessages] = s, t && (l[V.BotId] = t, o === CI.DialogTypes.CustomCommands && (l[O.CustomCommandsAppId] = t));
|
|
13462
|
+
const a = o === CI.DialogTypes.CustomCommands ? "commands/" : "", c = o === CI.DialogTypes.CustomCommands ? "v1" : o === CI.DialogTypes.BotFramework ? "v3" : "v0", G = {};
|
|
13463
|
+
I.token != null && I.token !== "" && (G[I.headerName] = I.token);
|
|
13407
13464
|
let u = g.parameters.getProperty(r.SpeechServiceConnection_Endpoint, "");
|
|
13408
13465
|
if (!u) {
|
|
13409
|
-
const
|
|
13466
|
+
const B = Kg.getHostSuffix(C), p = g.parameters.getProperty(r.SpeechServiceConnection_Host, `wss://${C}.${je.BaseUrl}${B}`);
|
|
13410
13467
|
u = `${p.endsWith("/") ? p : p + "/"}${a}${je.ApiKey}/${c}`;
|
|
13411
13468
|
}
|
|
13412
13469
|
this.setCommonUrlParams(g, l, u);
|
|
13413
13470
|
const m = g.parameters.getProperty("SPEECH-EnableWebsocketCompression", "false") === "true";
|
|
13414
|
-
return new zI(u, l,
|
|
13471
|
+
return new zI(u, l, G, new ee(), hI.fromRecognizerConfig(g), m, e);
|
|
13415
13472
|
}
|
|
13416
13473
|
}
|
|
13417
13474
|
je.ApiKey = "api";
|
|
@@ -14553,7 +14610,7 @@ class fr {
|
|
|
14553
14610
|
* @param err
|
|
14554
14611
|
*/
|
|
14555
14612
|
static createConversationAsync(g, I, e, t) {
|
|
14556
|
-
A.throwIfNullOrUndefined(g,
|
|
14613
|
+
A.throwIfNullOrUndefined(g, T.restErrors.invalidArgs.replace("{arg}", "config")), A.throwIfNullOrUndefined(g.region, T.restErrors.invalidArgs.replace("{arg}", "SpeechServiceConnection_Region")), !g.subscriptionKey && !g.getProperty(r[r.SpeechServiceAuthorization_Token]) && A.throwIfNullOrUndefined(g.subscriptionKey, T.restErrors.invalidArgs.replace("{arg}", "SpeechServiceConnection_Key"));
|
|
14557
14614
|
let o, C, n;
|
|
14558
14615
|
return typeof I == "string" ? (o = new DC(g, I), M(Ft(this, void 0, void 0, function* () {
|
|
14559
14616
|
}), e, t)) : (o = new DC(g), C = I, n = e, o.createConversationAsync(() => {
|
|
@@ -14570,7 +14627,7 @@ class DC extends fr {
|
|
|
14570
14627
|
* @param {string} id - optional conversationId
|
|
14571
14628
|
*/
|
|
14572
14629
|
constructor(g, I) {
|
|
14573
|
-
if (super(), this.privErrors =
|
|
14630
|
+
if (super(), this.privErrors = T.restErrors, this.onConnected = (o) => {
|
|
14574
14631
|
var C;
|
|
14575
14632
|
this.privIsConnected = !0;
|
|
14576
14633
|
try {
|
|
@@ -14612,26 +14669,26 @@ class DC extends fr {
|
|
|
14612
14669
|
n.translateToLanguages = C.value;
|
|
14613
14670
|
break;
|
|
14614
14671
|
}
|
|
14615
|
-
this.privParticipants.addOrUpdateParticipant(n), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new
|
|
14672
|
+
this.privParticipants.addOrUpdateParticipant(n), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new ZI(oI.Updated, [this.toParticipant(n)], C.sessionId));
|
|
14616
14673
|
}
|
|
14617
14674
|
} catch {
|
|
14618
14675
|
}
|
|
14619
14676
|
}, this.onLockRoomCommandReceived = () => {
|
|
14620
14677
|
}, this.onMuteAllCommandReceived = (o, C) => {
|
|
14621
14678
|
try {
|
|
14622
|
-
this.privParticipants.participants.forEach((n) => n.isMuted = n.isHost ? !1 : C.isMuted), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new
|
|
14679
|
+
this.privParticipants.participants.forEach((n) => n.isMuted = n.isHost ? !1 : C.isMuted), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new ZI(oI.Updated, this.toParticipants(!1), C.sessionId));
|
|
14623
14680
|
} catch {
|
|
14624
14681
|
}
|
|
14625
14682
|
}, this.onParticipantJoinCommandReceived = (o, C) => {
|
|
14626
14683
|
try {
|
|
14627
14684
|
const n = this.privParticipants.addOrUpdateParticipant(C.participant);
|
|
14628
|
-
n !== void 0 && this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new
|
|
14685
|
+
n !== void 0 && this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new ZI(oI.JoinedConversation, [this.toParticipant(n)], C.sessionId));
|
|
14629
14686
|
} catch {
|
|
14630
14687
|
}
|
|
14631
14688
|
}, this.onParticipantLeaveCommandReceived = (o, C) => {
|
|
14632
14689
|
try {
|
|
14633
14690
|
const n = this.privParticipants.getParticipant(C.participant.id);
|
|
14634
|
-
n !== void 0 && (this.privParticipants.deleteParticipant(C.participant.id), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new
|
|
14691
|
+
n !== void 0 && (this.privParticipants.deleteParticipant(C.participant.id), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new ZI(oI.LeftConversation, [this.toParticipant(n)], C.sessionId)));
|
|
14635
14692
|
} catch {
|
|
14636
14693
|
}
|
|
14637
14694
|
}, this.onTranslationReceived = (o, C) => {
|
|
@@ -14652,7 +14709,7 @@ class DC extends fr {
|
|
|
14652
14709
|
}, this.onParticipantsListReceived = (o, C) => {
|
|
14653
14710
|
var n;
|
|
14654
14711
|
try {
|
|
14655
|
-
if (C.sessionToken !== void 0 && C.sessionToken !== null && (this.privRoom.token = C.sessionToken), this.privParticipants.participants = [...C.participants], this.privParticipants.me !== void 0 && (this.privIsReady = !0), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new
|
|
14712
|
+
if (C.sessionToken !== void 0 && C.sessionToken !== null && (this.privRoom.token = C.sessionToken), this.privParticipants.participants = [...C.participants], this.privParticipants.me !== void 0 && (this.privIsReady = !0), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new ZI(oI.JoinedConversation, this.toParticipants(!0), C.sessionId)), this.me.isHost) {
|
|
14656
14713
|
const s = (n = this.privConversationTranslator) === null || n === void 0 ? void 0 : n.properties.getProperty(r.ConversationTranslator_Name);
|
|
14657
14714
|
s !== void 0 && s.length > 0 && s !== this.me.displayName && this.changeNicknameAsync(s);
|
|
14658
14715
|
}
|
|
@@ -14663,7 +14720,7 @@ class DC extends fr {
|
|
|
14663
14720
|
this.privConversationTranslator && this.privConversationTranslator.conversationExpiration(this.privConversationTranslator, C);
|
|
14664
14721
|
} catch {
|
|
14665
14722
|
}
|
|
14666
|
-
}, this.privIsConnected = !1, this.privIsDisposed = !1, this.privConversationId = "", this.privProperties = new x(), this.privManager = new nd(), g.getProperty(r[r.SpeechServiceConnection_RecoLanguage]) || g.setProperty(r[r.SpeechServiceConnection_RecoLanguage],
|
|
14723
|
+
}, this.privIsConnected = !1, this.privIsDisposed = !1, this.privConversationId = "", this.privProperties = new x(), this.privManager = new nd(), g.getProperty(r[r.SpeechServiceConnection_RecoLanguage]) || g.setProperty(r[r.SpeechServiceConnection_RecoLanguage], T.defaultLanguageCode), this.privLanguage = g.getProperty(r[r.SpeechServiceConnection_RecoLanguage]), I)
|
|
14667
14724
|
this.privConversationId = I;
|
|
14668
14725
|
else {
|
|
14669
14726
|
g.targetLanguages.length === 0 && g.addTargetLanguage(this.privLanguage), g.getProperty(r[r.SpeechServiceResponse_ProfanityOption]) || g.setProfanity(ve.Masked);
|
|
@@ -14723,7 +14780,7 @@ class DC extends fr {
|
|
|
14723
14780
|
preferredLanguage: o.preferredLanguage,
|
|
14724
14781
|
voice: o.voice
|
|
14725
14782
|
})), e = {};
|
|
14726
|
-
for (const o of
|
|
14783
|
+
for (const o of T.transcriptionEventKeys) {
|
|
14727
14784
|
const C = this.properties.getProperty(o, "");
|
|
14728
14785
|
C !== "" && (e[o] = C);
|
|
14729
14786
|
}
|
|
@@ -15175,7 +15232,7 @@ class Mr extends Fg {
|
|
|
15175
15232
|
return this.privExpirationTime;
|
|
15176
15233
|
}
|
|
15177
15234
|
}
|
|
15178
|
-
class
|
|
15235
|
+
class ZI extends Fg {
|
|
15179
15236
|
constructor(g, I, e) {
|
|
15180
15237
|
super(e), this.privReason = g, this.privParticipant = I;
|
|
15181
15238
|
}
|
|
@@ -15188,7 +15245,7 @@ class pI extends Fg {
|
|
|
15188
15245
|
}
|
|
15189
15246
|
class is extends ro {
|
|
15190
15247
|
}
|
|
15191
|
-
class Ze extends
|
|
15248
|
+
class Ze extends SI {
|
|
15192
15249
|
/**
|
|
15193
15250
|
* Creates and initializes an instance of this class.
|
|
15194
15251
|
* @constructor
|
|
@@ -15276,15 +15333,15 @@ class Go extends Kg {
|
|
|
15276
15333
|
const l = {}, a = {};
|
|
15277
15334
|
if (t) {
|
|
15278
15335
|
s = g.parameters.getProperty(r.SpeechServiceConnection_Endpoint), s || (s = "wss://" + g.parameters.getProperty(r.SpeechServiceConnection_Host, "transcribe.{region}.cts.speech{hostSuffix}") + "{path}"), s = xC.formatString(s, n);
|
|
15279
|
-
const
|
|
15280
|
-
|
|
15281
|
-
l[
|
|
15282
|
-
}), new td().setQueryParams(l, g, s), l[V.CtsMeetingId] = n[V.CtsMeetingId], l[V.CtsDeviceId] = n[V.CtsDeviceId], o.isHost || (l[V.CtsIsParticipant] = ""), V.Format in l || (l[V.Format] = "simple"),
|
|
15283
|
-
|
|
15284
|
-
}), s =
|
|
15336
|
+
const G = new URL(s);
|
|
15337
|
+
G.searchParams.forEach((m, B) => {
|
|
15338
|
+
l[B] = m;
|
|
15339
|
+
}), new td().setQueryParams(l, g, s), l[V.CtsMeetingId] = n[V.CtsMeetingId], l[V.CtsDeviceId] = n[V.CtsDeviceId], o.isHost || (l[V.CtsIsParticipant] = ""), V.Format in l || (l[V.Format] = "simple"), G.searchParams.forEach((m, B) => {
|
|
15340
|
+
G.searchParams.set(B, l[B]), delete l[B];
|
|
15341
|
+
}), s = G.toString();
|
|
15285
15342
|
} else {
|
|
15286
|
-
const
|
|
15287
|
-
s =
|
|
15343
|
+
const G = new od();
|
|
15344
|
+
s = G.getEndpointUrl(g, !0), s = xC.formatString(s, n), G.setQueryParams(l, g, s);
|
|
15288
15345
|
}
|
|
15289
15346
|
a[O.ConnectionId] = e, a[kI.configParams.token] = o.token, I.token && (a[I.headerName] = I.token);
|
|
15290
15347
|
const c = g.parameters.getProperty("SPEECH-EnableWebsocketCompression", "").toUpperCase() === "TRUE";
|
|
@@ -15292,7 +15349,7 @@ class Go extends Kg {
|
|
|
15292
15349
|
}
|
|
15293
15350
|
}
|
|
15294
15351
|
Go.CTS_VIRT_MIC_PATH = "/speech/recognition/dynamicaudio";
|
|
15295
|
-
var
|
|
15352
|
+
var wI = function(i, g, I, e) {
|
|
15296
15353
|
function t(o) {
|
|
15297
15354
|
return o instanceof I ? o : new I(function(C) {
|
|
15298
15355
|
C(o);
|
|
@@ -15330,10 +15387,10 @@ class Nm extends Ao {
|
|
|
15330
15387
|
this.privSpeechState = dI.Inactive;
|
|
15331
15388
|
}, this.recognizing = (o, C) => {
|
|
15332
15389
|
this.privTranslator.recognizing && this.privTranslator.recognizing(this.privTranslator, C);
|
|
15333
|
-
}, this.recognized = (o, C) =>
|
|
15390
|
+
}, this.recognized = (o, C) => wI(this, void 0, void 0, function* () {
|
|
15334
15391
|
var n;
|
|
15335
15392
|
!((n = C.result) === null || n === void 0) && n.errorDetails ? (yield this.cancelSpeech(), this.fireCancelEvent(C.result.errorDetails)) : this.privTranslator.recognized && this.privTranslator.recognized(this.privTranslator, C);
|
|
15336
|
-
}), this.canceled = () =>
|
|
15393
|
+
}), this.canceled = () => wI(this, void 0, void 0, function* () {
|
|
15337
15394
|
if (this.privSpeechState !== dI.Inactive)
|
|
15338
15395
|
try {
|
|
15339
15396
|
yield this.cancelSpeech();
|
|
@@ -15355,7 +15412,7 @@ class Nm extends Ao {
|
|
|
15355
15412
|
this.privSpeechState = dI.Connected;
|
|
15356
15413
|
}
|
|
15357
15414
|
onCancelSpeech() {
|
|
15358
|
-
return
|
|
15415
|
+
return wI(this, void 0, void 0, function* () {
|
|
15359
15416
|
this.privSpeechState = dI.Inactive, yield this.cancelSpeech();
|
|
15360
15417
|
});
|
|
15361
15418
|
}
|
|
@@ -15374,7 +15431,7 @@ class Nm extends Ao {
|
|
|
15374
15431
|
}
|
|
15375
15432
|
cancelSpeech() {
|
|
15376
15433
|
var g;
|
|
15377
|
-
return
|
|
15434
|
+
return wI(this, void 0, void 0, function* () {
|
|
15378
15435
|
try {
|
|
15379
15436
|
this.stopContinuousRecognitionAsync(), yield (g = this.privReco) === null || g === void 0 ? void 0 : g.disconnect(), this.privSpeechState = dI.Inactive;
|
|
15380
15437
|
} catch {
|
|
@@ -15384,7 +15441,7 @@ class Nm extends Ao {
|
|
|
15384
15441
|
}
|
|
15385
15442
|
class Fm extends Lm {
|
|
15386
15443
|
constructor(g) {
|
|
15387
|
-
super(g), this.privErrors =
|
|
15444
|
+
super(g), this.privErrors = T.restErrors, this.privIsDisposed = !1, this.privIsSpeaking = !1, this.privPlaceholderKey = "abcdefghijklmnopqrstuvwxyz012345", this.privPlaceholderRegion = "westus", this.privProperties = new x();
|
|
15388
15445
|
}
|
|
15389
15446
|
get properties() {
|
|
15390
15447
|
return this.privProperties;
|
|
@@ -15411,7 +15468,7 @@ class Fm extends Lm {
|
|
|
15411
15468
|
if (typeof g == "string") {
|
|
15412
15469
|
A.throwIfNullOrUndefined(g, this.privErrors.invalidArgs.replace("{arg}", "conversation id")), A.throwIfNullOrWhitespace(I, this.privErrors.invalidArgs.replace("{arg}", "nickname")), this.privConversation && this.handleError(new Error(this.privErrors.permissionDeniedStart), o);
|
|
15413
15470
|
let C = e;
|
|
15414
|
-
(C == null || C === "") && (C =
|
|
15471
|
+
(C == null || C === "") && (C = T.defaultLanguageCode), this.privSpeechTranslationConfig = Tn.fromSubscription(this.privPlaceholderKey, this.privPlaceholderRegion), this.privSpeechTranslationConfig.setProfanity(ve.Masked), this.privSpeechTranslationConfig.addTargetLanguage(C), this.privSpeechTranslationConfig.setProperty(r[r.SpeechServiceConnection_RecoLanguage], C), this.privSpeechTranslationConfig.setProperty(r[r.ConversationTranslator_Name], I);
|
|
15415
15472
|
const n = [
|
|
15416
15473
|
r.SpeechServiceConnection_Host,
|
|
15417
15474
|
r.ConversationTranslator_Host,
|
|
@@ -15453,7 +15510,7 @@ class Fm extends Lm {
|
|
|
15453
15510
|
* @param err
|
|
15454
15511
|
*/
|
|
15455
15512
|
leaveConversationAsync(g, I) {
|
|
15456
|
-
M(
|
|
15513
|
+
M(wI(this, void 0, void 0, function* () {
|
|
15457
15514
|
yield this.cancelSpeech(), yield this.privConversation.endConversationImplAsync(), yield this.privConversation.deleteConversationImplAsync(), this.dispose();
|
|
15458
15515
|
}), g, I);
|
|
15459
15516
|
}
|
|
@@ -15476,7 +15533,7 @@ class Fm extends Lm {
|
|
|
15476
15533
|
* @param err
|
|
15477
15534
|
*/
|
|
15478
15535
|
startTranscribingAsync(g, I) {
|
|
15479
|
-
M(
|
|
15536
|
+
M(wI(this, void 0, void 0, function* () {
|
|
15480
15537
|
try {
|
|
15481
15538
|
A.throwIfNullOrUndefined(this.privConversation, this.privErrors.permissionDeniedSend), A.throwIfNullOrUndefined(this.privConversation.room.token, this.privErrors.permissionDeniedConnect), this.privCTRecognizer === void 0 && (yield this.connectTranslatorRecognizer()), A.throwIfNullOrUndefined(this.privCTRecognizer, this.privErrors.permissionDeniedSend), this.canSpeak || this.handleError(new Error(this.privErrors.permissionDeniedSend), I), yield this.startContinuousRecognition(), this.privIsSpeaking = !0;
|
|
15482
15539
|
} catch (e) {
|
|
@@ -15490,7 +15547,7 @@ class Fm extends Lm {
|
|
|
15490
15547
|
* @param err
|
|
15491
15548
|
*/
|
|
15492
15549
|
stopTranscribingAsync(g, I) {
|
|
15493
|
-
M(
|
|
15550
|
+
M(wI(this, void 0, void 0, function* () {
|
|
15494
15551
|
try {
|
|
15495
15552
|
if (!this.privIsSpeaking) {
|
|
15496
15553
|
yield this.cancelSpeech();
|
|
@@ -15508,7 +15565,7 @@ class Fm extends Lm {
|
|
|
15508
15565
|
return this.privIsDisposed;
|
|
15509
15566
|
}
|
|
15510
15567
|
dispose(g, I, e) {
|
|
15511
|
-
M(
|
|
15568
|
+
M(wI(this, void 0, void 0, function* () {
|
|
15512
15569
|
this.isDisposed && !this.privIsSpeaking || (yield this.cancelSpeech(), this.privIsDisposed = !0, this.privSpeechTranslationConfig.close(), this.privSpeechRecognitionLanguage = void 0, this.privProperties = void 0, this.privAudioConfig = void 0, this.privSpeechTranslationConfig = void 0, this.privConversation.dispose(), this.privConversation = void 0);
|
|
15513
15570
|
}), I, e);
|
|
15514
15571
|
}
|
|
@@ -15517,7 +15574,7 @@ class Fm extends Lm {
|
|
|
15517
15574
|
*/
|
|
15518
15575
|
cancelSpeech() {
|
|
15519
15576
|
var g;
|
|
15520
|
-
return
|
|
15577
|
+
return wI(this, void 0, void 0, function* () {
|
|
15521
15578
|
try {
|
|
15522
15579
|
this.privIsSpeaking = !1, yield (g = this.privCTRecognizer) === null || g === void 0 ? void 0 : g.onCancelSpeech(), this.privCTRecognizer = void 0;
|
|
15523
15580
|
} catch {
|
|
@@ -15531,7 +15588,7 @@ class Fm extends Lm {
|
|
|
15531
15588
|
* e.g. pass in 'fr' instead of 'fr-FR', or a text-only language 'cy'
|
|
15532
15589
|
*/
|
|
15533
15590
|
connectTranslatorRecognizer() {
|
|
15534
|
-
return
|
|
15591
|
+
return wI(this, void 0, void 0, function* () {
|
|
15535
15592
|
try {
|
|
15536
15593
|
this.privAudioConfig === void 0 && (this.privAudioConfig = ge.fromDefaultMicrophoneInput()), this.privSpeechTranslationConfig.getProperty(r[r.SpeechServiceConnection_Key]) === this.privPlaceholderKey && this.privSpeechTranslationConfig.setProperty(r[r.SpeechServiceConnection_Key], "");
|
|
15537
15594
|
const g = () => this.privConversation;
|
|
@@ -15647,7 +15704,7 @@ class ts extends AI {
|
|
|
15647
15704
|
* @returns {OutputFormat} The output format of transcription.
|
|
15648
15705
|
*/
|
|
15649
15706
|
get outputFormat() {
|
|
15650
|
-
return A.throwIfDisposed(this.privDisposedRecognizer), this.properties.getProperty(sI,
|
|
15707
|
+
return A.throwIfDisposed(this.privDisposedRecognizer), this.properties.getProperty(sI, E[E.Simple]) === E[E.Simple] ? E.Simple : E.Detailed;
|
|
15651
15708
|
}
|
|
15652
15709
|
/**
|
|
15653
15710
|
* The collection of properties and their values defined for this conversation transcriber.
|
|
@@ -15799,9 +15856,9 @@ class Ur {
|
|
|
15799
15856
|
* @param err
|
|
15800
15857
|
*/
|
|
15801
15858
|
static createMeetingAsync(g, I, e, t) {
|
|
15802
|
-
if (A.throwIfNullOrUndefined(g,
|
|
15859
|
+
if (A.throwIfNullOrUndefined(g, T.restErrors.invalidArgs.replace("{arg}", "config")), A.throwIfNullOrUndefined(g.region, T.restErrors.invalidArgs.replace("{arg}", "SpeechServiceConnection_Region")), A.throwIfNull(I, "meetingId"), I.length === 0)
|
|
15803
15860
|
throw new Error("meetingId cannot be empty");
|
|
15804
|
-
!g.subscriptionKey && !g.getProperty(r[r.SpeechServiceAuthorization_Token]) && A.throwIfNullOrUndefined(g.subscriptionKey,
|
|
15861
|
+
!g.subscriptionKey && !g.getProperty(r[r.SpeechServiceAuthorization_Token]) && A.throwIfNullOrUndefined(g.subscriptionKey, T.restErrors.invalidArgs.replace("{arg}", "SpeechServiceConnection_Key"));
|
|
15805
15862
|
const o = new Qr(g, I);
|
|
15806
15863
|
return M(Jt(this, void 0, void 0, function* () {
|
|
15807
15864
|
}), e, t), o;
|
|
@@ -15814,7 +15871,7 @@ class Qr extends Ur {
|
|
|
15814
15871
|
* @param {string} id - optional conversationId
|
|
15815
15872
|
*/
|
|
15816
15873
|
constructor(g, I) {
|
|
15817
|
-
super(), this.privErrors =
|
|
15874
|
+
super(), this.privErrors = T.restErrors, this.onConnected = (o) => {
|
|
15818
15875
|
var C;
|
|
15819
15876
|
this.privIsConnected = !0;
|
|
15820
15877
|
try {
|
|
@@ -15856,26 +15913,26 @@ class Qr extends Ur {
|
|
|
15856
15913
|
n.translateToLanguages = C.value;
|
|
15857
15914
|
break;
|
|
15858
15915
|
}
|
|
15859
|
-
this.privParticipants.addOrUpdateParticipant(n), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new
|
|
15916
|
+
this.privParticipants.addOrUpdateParticipant(n), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new ZI(oI.Updated, [this.toParticipant(n)], C.sessionId));
|
|
15860
15917
|
}
|
|
15861
15918
|
} catch {
|
|
15862
15919
|
}
|
|
15863
15920
|
}, this.onLockRoomCommandReceived = () => {
|
|
15864
15921
|
}, this.onMuteAllCommandReceived = (o, C) => {
|
|
15865
15922
|
try {
|
|
15866
|
-
this.privParticipants.participants.forEach((n) => n.isMuted = n.isHost ? !1 : C.isMuted), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new
|
|
15923
|
+
this.privParticipants.participants.forEach((n) => n.isMuted = n.isHost ? !1 : C.isMuted), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new ZI(oI.Updated, this.toParticipants(!1), C.sessionId));
|
|
15867
15924
|
} catch {
|
|
15868
15925
|
}
|
|
15869
15926
|
}, this.onParticipantJoinCommandReceived = (o, C) => {
|
|
15870
15927
|
try {
|
|
15871
15928
|
const n = this.privParticipants.addOrUpdateParticipant(C.participant);
|
|
15872
|
-
n !== void 0 && this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new
|
|
15929
|
+
n !== void 0 && this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new ZI(oI.JoinedConversation, [this.toParticipant(n)], C.sessionId));
|
|
15873
15930
|
} catch {
|
|
15874
15931
|
}
|
|
15875
15932
|
}, this.onParticipantLeaveCommandReceived = (o, C) => {
|
|
15876
15933
|
try {
|
|
15877
15934
|
const n = this.privParticipants.getParticipant(C.participant.id);
|
|
15878
|
-
n !== void 0 && (this.privParticipants.deleteParticipant(C.participant.id), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new
|
|
15935
|
+
n !== void 0 && (this.privParticipants.deleteParticipant(C.participant.id), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new ZI(oI.LeftConversation, [this.toParticipant(n)], C.sessionId)));
|
|
15879
15936
|
} catch {
|
|
15880
15937
|
}
|
|
15881
15938
|
}, this.onTranslationReceived = (o, C) => {
|
|
@@ -15896,7 +15953,7 @@ class Qr extends Ur {
|
|
|
15896
15953
|
}, this.onParticipantsListReceived = (o, C) => {
|
|
15897
15954
|
var n;
|
|
15898
15955
|
try {
|
|
15899
|
-
if (C.sessionToken !== void 0 && C.sessionToken !== null && (this.privRoom.token = C.sessionToken), this.privParticipants.participants = [...C.participants], this.privParticipants.me !== void 0 && (this.privIsReady = !0), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new
|
|
15956
|
+
if (C.sessionToken !== void 0 && C.sessionToken !== null && (this.privRoom.token = C.sessionToken), this.privParticipants.participants = [...C.participants], this.privParticipants.me !== void 0 && (this.privIsReady = !0), this.privConversationTranslator && this.privConversationTranslator.participantsChanged(this.privConversationTranslator, new ZI(oI.JoinedConversation, this.toParticipants(!0), C.sessionId)), this.me.isHost) {
|
|
15900
15957
|
const s = (n = this.privConversationTranslator) === null || n === void 0 ? void 0 : n.properties.getProperty(r.ConversationTranslator_Name);
|
|
15901
15958
|
s !== void 0 && s.length > 0 && s !== this.me.displayName && this.changeNicknameAsync(s);
|
|
15902
15959
|
}
|
|
@@ -15907,7 +15964,7 @@ class Qr extends Ur {
|
|
|
15907
15964
|
this.privConversationTranslator && this.privConversationTranslator.conversationExpiration(this.privConversationTranslator, C);
|
|
15908
15965
|
} catch {
|
|
15909
15966
|
}
|
|
15910
|
-
}, this.privIsConnected = !1, this.privIsDisposed = !1, this.privConversationId = "", this.privProperties = new x(), this.privManager = new nd(), g.getProperty(r[r.SpeechServiceConnection_RecoLanguage]) || g.setProperty(r[r.SpeechServiceConnection_RecoLanguage],
|
|
15967
|
+
}, this.privIsConnected = !1, this.privIsDisposed = !1, this.privConversationId = "", this.privProperties = new x(), this.privManager = new nd(), g.getProperty(r[r.SpeechServiceConnection_RecoLanguage]) || g.setProperty(r[r.SpeechServiceConnection_RecoLanguage], T.defaultLanguageCode), this.privLanguage = g.getProperty(r[r.SpeechServiceConnection_RecoLanguage]), this.privConversationId = I, this.privConfig = g;
|
|
15911
15968
|
const t = g;
|
|
15912
15969
|
A.throwIfNull(t, "speechConfig"), this.privProperties = t.properties.clone(), this.privIsConnected = !1, this.privParticipants = new sd(), this.privIsReady = !1, this.privTextMessageMaxLength = 1e3;
|
|
15913
15970
|
}
|
|
@@ -15960,7 +16017,7 @@ class Qr extends Ur {
|
|
|
15960
16017
|
preferredLanguage: o.preferredLanguage,
|
|
15961
16018
|
voice: o.voice
|
|
15962
16019
|
})), e = {};
|
|
15963
|
-
for (const o of
|
|
16020
|
+
for (const o of T.transcriptionEventKeys) {
|
|
15964
16021
|
const C = this.properties.getProperty(o, "");
|
|
15965
16022
|
C !== "" && (e[o] = C);
|
|
15966
16023
|
}
|
|
@@ -17855,8 +17912,8 @@ class qr {
|
|
|
17855
17912
|
let t = g.parameters.getProperty(r.SpeechServiceConnection_Endpoint, void 0);
|
|
17856
17913
|
const o = g.parameters.getProperty(r.SpeechServiceConnection_Region, void 0), C = Kg.getHostSuffix(o), n = g.parameters.getProperty(r.SpeechServiceConnection_EndpointId, void 0), s = n === void 0 ? "tts" : "voice", l = g.parameters.getProperty(r.SpeechServiceConnection_Host, "wss://" + o + "." + s + ".speech" + C), a = {}, c = {};
|
|
17857
17914
|
I.token !== void 0 && I.token !== "" && (c[I.headerName] = I.token), c[O.ConnectionId] = e, n !== void 0 && n !== "" && (!t || t.search(V.CustomVoiceDeploymentId) === -1) && (a[V.CustomVoiceDeploymentId] = n), g.avatarEnabled && (!t || t.search(V.EnableAvatar) === -1) && (a[V.EnableAvatar] = "true"), t || (t = l + this.synthesisUri), g.parameters.setProperty(r.SpeechServiceConnection_Url, t);
|
|
17858
|
-
const
|
|
17859
|
-
return new zI(t, a, c, new ee(), hI.fromParameters(g.parameters),
|
|
17915
|
+
const G = g.parameters.getProperty("SPEECH-EnableWebsocketCompression", "false") === "true";
|
|
17916
|
+
return new zI(t, a, c, new ee(), hI.fromParameters(g.parameters), G, e);
|
|
17860
17917
|
}
|
|
17861
17918
|
}
|
|
17862
17919
|
var me = function(i, g, I, e) {
|
|
@@ -18232,18 +18289,18 @@ class qC {
|
|
|
18232
18289
|
};
|
|
18233
18290
|
}, s = (l) => {
|
|
18234
18291
|
const a = qm(I, C, this.privHeaders, 200, 201, 202, 204, 400, 401, 402, 403, 404), c = this.queryParams(e) === "" ? "" : `?${this.queryParams(e)}`;
|
|
18235
|
-
a(c, l).then((
|
|
18236
|
-
if (g === de.Delete ||
|
|
18237
|
-
o.resolve(n(
|
|
18292
|
+
a(c, l).then((G) => _m(this, void 0, void 0, function* () {
|
|
18293
|
+
if (g === de.Delete || G.statusCode === 204)
|
|
18294
|
+
o.resolve(n(G));
|
|
18238
18295
|
else
|
|
18239
18296
|
try {
|
|
18240
|
-
const u = yield
|
|
18241
|
-
o.resolve(n(
|
|
18297
|
+
const u = yield G.json();
|
|
18298
|
+
o.resolve(n(G, u));
|
|
18242
18299
|
} catch {
|
|
18243
|
-
o.resolve(n(
|
|
18300
|
+
o.resolve(n(G));
|
|
18244
18301
|
}
|
|
18245
|
-
})).catch((
|
|
18246
|
-
o.reject(
|
|
18302
|
+
})).catch((G) => {
|
|
18303
|
+
o.reject(G);
|
|
18247
18304
|
});
|
|
18248
18305
|
};
|
|
18249
18306
|
return this.privIgnoreCache && (this.privHeaders["Cache-Control"] = "no-cache"), g === de.Post && t && (this.privHeaders["content-type"] = "application/json", this.privHeaders["Content-Type"] = "application/json"), s(t), o.promise;
|
|
@@ -18374,8 +18431,8 @@ class gd extends Kg {
|
|
|
18374
18431
|
create(g, I, e, t) {
|
|
18375
18432
|
let o = g.parameters.getProperty(r.SpeechServiceConnection_Endpoint);
|
|
18376
18433
|
if (!o) {
|
|
18377
|
-
const l = g.parameters.getProperty(r.SpeechServiceConnection_Region), a = Kg.getHostSuffix(l), c = g.parameters.getProperty(r.SpeechServiceConnection_Host, `wss://${l}.spr-frontend.speech${a}`),
|
|
18378
|
-
o = `${c}/speaker/ws/${this.scenarioToPath(
|
|
18434
|
+
const l = g.parameters.getProperty(r.SpeechServiceConnection_Region), a = Kg.getHostSuffix(l), c = g.parameters.getProperty(r.SpeechServiceConnection_Host, `wss://${l}.spr-frontend.speech${a}`), G = g.parameters.getProperty(r.SpeechServiceConnection_SpeakerIdMode, "TextIndependentIdentification");
|
|
18435
|
+
o = `${c}/speaker/ws/${this.scenarioToPath(G)}/${e}`;
|
|
18379
18436
|
}
|
|
18380
18437
|
const C = {
|
|
18381
18438
|
format: "simple",
|
|
@@ -18542,7 +18599,7 @@ class Mg {
|
|
|
18542
18599
|
throw new Rg("audioSource");
|
|
18543
18600
|
if (!t)
|
|
18544
18601
|
throw new Rg("recognizerConfig");
|
|
18545
|
-
this.privEnableSpeakerId = t.isSpeakerDiarizationEnabled, this.privMustReportEndOfStream = !1, this.privAuthentication = g, this.privConnectionFactory = I, this.privAudioSource = e, this.privRecognizerConfig = t, this.privIsDisposed = !1, this.privRecognizer = o, this.privRequestSession = new Au(this.privAudioSource.id()), this.privConnectionEvents = new
|
|
18602
|
+
this.privEnableSpeakerId = t.isSpeakerDiarizationEnabled, this.privMustReportEndOfStream = !1, this.privAuthentication = g, this.privConnectionFactory = I, this.privAudioSource = e, this.privRecognizerConfig = t, this.privIsDisposed = !1, this.privRecognizer = o, this.privRequestSession = new Au(this.privAudioSource.id()), this.privConnectionEvents = new yI(), this.privServiceEvents = new yI(), this.privDynamicGrammar = new Gu(), this.privSpeechContext = new hu(this.privDynamicGrammar), this.privAgentConfig = new Cd(), this.privRecognizerConfig.parameters.getProperty(r.WebWorkerLoadType, "on").toLowerCase() === "on" && typeof Blob < "u" && typeof Worker < "u" ? this.privSetTimeout = Ng.setTimeout : typeof window < "u" && (this.privSetTimeout = window.setTimeout.bind(window)), this.connectionEvents.attach((n) => {
|
|
18546
18603
|
if (n.name === "ConnectionClosedEvent") {
|
|
18547
18604
|
const s = n;
|
|
18548
18605
|
(s.statusCode === 1003 || s.statusCode === 1007 || s.statusCode === 1002 || s.statusCode === 4e3 || this.privRequestSession.numConnectionAttempts > this.privRecognizerConfig.maxRetryCount) && this.cancelRecognitionLocal(og.Error, s.statusCode === 1007 ? w.BadRequestParameters : w.ConnectionFailure, `${s.reason} websocket error code: ${s.statusCode}`);
|
|
@@ -18611,7 +18668,7 @@ class Mg {
|
|
|
18611
18668
|
})), this.privSpeechContext.setSection("phraseDetection", g);
|
|
18612
18669
|
}
|
|
18613
18670
|
setOutputDetailLevelJson() {
|
|
18614
|
-
this.privEnableSpeakerId && (this.privRecognizerConfig.parameters.getProperty(r.SpeechServiceResponse_RequestWordLevelTimestamps, "false").toLowerCase() === "true" ? this.privSpeechContext.setWordLevelTimings() : this.privRecognizerConfig.parameters.getProperty(sI,
|
|
18671
|
+
this.privEnableSpeakerId && (this.privRecognizerConfig.parameters.getProperty(r.SpeechServiceResponse_RequestWordLevelTimestamps, "false").toLowerCase() === "true" ? this.privSpeechContext.setWordLevelTimings() : this.privRecognizerConfig.parameters.getProperty(sI, E[E.Simple]).toLowerCase() === E[E.Detailed].toLocaleLowerCase() && this.privSpeechContext.setDetailedOutputFormat());
|
|
18615
18672
|
}
|
|
18616
18673
|
get isSpeakerDiarizationEnabled() {
|
|
18617
18674
|
return this.privEnableSpeakerId;
|
|
@@ -18778,13 +18835,13 @@ class Mg {
|
|
|
18778
18835
|
this.privMustReportEndOfStream = !0, this.privRequestSession.onServiceTurnStartResponse();
|
|
18779
18836
|
break;
|
|
18780
18837
|
case "speech.startdetected":
|
|
18781
|
-
const t = qe.fromJSON(e.textBody), o = new
|
|
18838
|
+
const t = qe.fromJSON(e.textBody), o = new SI(t.Offset, this.privRequestSession.sessionId);
|
|
18782
18839
|
this.privRecognizer.speechStartDetected && this.privRecognizer.speechStartDetected(this.privRecognizer, o);
|
|
18783
18840
|
break;
|
|
18784
18841
|
case "speech.enddetected":
|
|
18785
18842
|
let C;
|
|
18786
18843
|
e.textBody.length > 0 ? C = e.textBody : C = "{ Offset: 0 }";
|
|
18787
|
-
const n = qe.fromJSON(C), s = new
|
|
18844
|
+
const n = qe.fromJSON(C), s = new SI(n.Offset + this.privRequestSession.currentTurnAudioOffset, this.privRequestSession.sessionId);
|
|
18788
18845
|
this.privRecognizer.speechEndDetected && this.privRecognizer.speechEndDetected(this.privRecognizer, s);
|
|
18789
18846
|
break;
|
|
18790
18847
|
case "turn.end":
|
|
@@ -19001,7 +19058,7 @@ class id extends Mg {
|
|
|
19001
19058
|
const s = Wg.implTranslateCancelResult(I.RecognitionStatus), l = Wg.implTranslateCancelErrorCode(I.RecognitionStatus);
|
|
19002
19059
|
yield this.cancelRecognitionLocal(s, l, Wg.implTranslateErrorDetails(l));
|
|
19003
19060
|
} else if (!(this.privRequestSession.isSpeechEnded && e === X.NoMatch && I.RecognitionStatus !== _.InitialSilenceTimeout)) {
|
|
19004
|
-
if (this.privRecognizerConfig.parameters.getProperty(sI) ===
|
|
19061
|
+
if (this.privRecognizerConfig.parameters.getProperty(sI) === E[E.Simple])
|
|
19005
19062
|
t = new $g(this.privRequestSession.requestId, e, I.DisplayText, I.Duration, C, I.Language, I.LanguageDetectionConfidence, I.SpeakerId, void 0, g, o);
|
|
19006
19063
|
else {
|
|
19007
19064
|
const s = tt.fromJSON(g), l = s.Offset + this.privRequestSession.currentTurnAudioOffset, a = s.getJsonWithCorrectedOffsets(l);
|
|
@@ -19166,7 +19223,7 @@ class tu extends Kg {
|
|
|
19166
19223
|
create(g, I, e) {
|
|
19167
19224
|
let t = g.parameters.getProperty(r.SpeechServiceConnection_Endpoint, void 0);
|
|
19168
19225
|
const o = g.parameters.getProperty(r.SpeechServiceConnection_Region, void 0), C = Kg.getHostSuffix(o), n = g.parameters.getProperty(r.SpeechServiceConnection_Host, "wss://" + o + ".stt.speech" + C), s = {}, l = g.parameters.getProperty(r.SpeechServiceConnection_EndpointId, void 0), a = g.parameters.getProperty(r.SpeechServiceConnection_RecoLanguage, void 0);
|
|
19169
|
-
if (l ? (!t || t.search(V.CustomSpeechDeploymentId) === -1) && (s[V.CustomSpeechDeploymentId] = l) : a && (!t || t.search(V.Language) === -1) && (s[V.Language] = a), (!t || t.search(V.Format) === -1) && (s[V.Format] = g.parameters.getProperty(sI,
|
|
19226
|
+
if (l ? (!t || t.search(V.CustomSpeechDeploymentId) === -1) && (s[V.CustomSpeechDeploymentId] = l) : a && (!t || t.search(V.Language) === -1) && (s[V.Language] = a), (!t || t.search(V.Format) === -1) && (s[V.Format] = g.parameters.getProperty(sI, E[E.Simple]).toLowerCase()), g.autoDetectSourceLanguages !== void 0 && (s[V.EnableLanguageId] = "true"), this.setCommonUrlParams(g, s, t), !t)
|
|
19170
19227
|
switch (g.recognitionMode) {
|
|
19171
19228
|
case vg.Conversation:
|
|
19172
19229
|
g.parameters.getProperty(ps, "false") === "true" ? t = n + this.dictationRelativeUri : g.recognitionEndpointVersion !== void 0 && parseInt(g.recognitionEndpointVersion, 10) > 1 ? t = `${n}${this.universalUri}${g.recognitionEndpointVersion}` : t = n + this.conversationRelativeUri;
|
|
@@ -19180,7 +19237,7 @@ class tu extends Kg {
|
|
|
19180
19237
|
}
|
|
19181
19238
|
const c = {};
|
|
19182
19239
|
I.token !== void 0 && I.token !== "" && (c[I.headerName] = I.token), c[O.ConnectionId] = e;
|
|
19183
|
-
const
|
|
19240
|
+
const G = g.parameters.getProperty("SPEECH-EnableWebsocketCompression", "false") === "true", u = new zI(t, s, c, new ee(), hI.fromRecognizerConfig(g), G, e), m = u.uri;
|
|
19184
19241
|
return g.parameters.setProperty(r.SpeechServiceConnection_Url, m), u;
|
|
19185
19242
|
}
|
|
19186
19243
|
}
|
|
@@ -19194,7 +19251,7 @@ class ou extends Kg {
|
|
|
19194
19251
|
l ? (!t || t.search(V.CustomSpeechDeploymentId) === -1) && (s[V.CustomSpeechDeploymentId] = l) : a && (!t || t.search(V.Language) === -1) && (s[V.Language] = a), g.autoDetectSourceLanguages !== void 0 && (s[V.EnableLanguageId] = "true"), this.setV2UrlParams(g, s, t), t || (t = `${n}${this.universalUri}`);
|
|
19195
19252
|
const c = {};
|
|
19196
19253
|
I.token !== void 0 && I.token !== "" && (c[I.headerName] = I.token), c[O.ConnectionId] = e;
|
|
19197
|
-
const
|
|
19254
|
+
const G = g.parameters.getProperty("SPEECH-EnableWebsocketCompression", "false") === "true", u = new zI(t, s, c, new ee(), hI.fromRecognizerConfig(g), G, e), m = u.uri;
|
|
19198
19255
|
return g.parameters.setProperty(r.SpeechServiceConnection_Url, m), u;
|
|
19199
19256
|
}
|
|
19200
19257
|
setV2UrlParams(g, I, e) {
|
|
@@ -19231,8 +19288,8 @@ class td extends Kg {
|
|
|
19231
19288
|
setQueryParams(g, I, e) {
|
|
19232
19289
|
const t = I.parameters.getProperty(r.SpeechServiceConnection_EndpointId, void 0), o = I.parameters.getProperty(r.SpeechServiceConnection_RecoLanguage, void 0);
|
|
19233
19290
|
t && !(V.CustomSpeechDeploymentId in g) && (g[V.CustomSpeechDeploymentId] = t), o && !(V.Language in g) && (g[V.Language] = o);
|
|
19234
|
-
const C = I.parameters.getProperty(r.SpeechServiceResponse_RequestWordLevelTimestamps, "false").toLowerCase() === "true", n = I.parameters.getProperty(sI,
|
|
19235
|
-
(C || n) && (g[V.Format] =
|
|
19291
|
+
const C = I.parameters.getProperty(r.SpeechServiceResponse_RequestWordLevelTimestamps, "false").toLowerCase() === "true", n = I.parameters.getProperty(sI, E[E.Simple]) !== E[E.Simple];
|
|
19292
|
+
(C || n) && (g[V.Format] = E[E.Detailed].toLowerCase()), this.setCommonUrlParams(I, g, e);
|
|
19236
19293
|
}
|
|
19237
19294
|
}
|
|
19238
19295
|
class od extends Kg {
|
|
@@ -19757,7 +19814,7 @@ class su extends Mg {
|
|
|
19757
19814
|
yield this.cancelRecognitionLocal(a, c, Wg.implTranslateErrorDetails(c));
|
|
19758
19815
|
} else {
|
|
19759
19816
|
if (!(this.privRequestSession.isSpeechEnded && l === X.NoMatch && s.RecognitionStatus !== _.InitialSilenceTimeout)) {
|
|
19760
|
-
if (this.privRecognizerConfig.parameters.getProperty(sI) ===
|
|
19817
|
+
if (this.privRecognizerConfig.parameters.getProperty(sI) === E[E.Simple])
|
|
19761
19818
|
I = new $g(
|
|
19762
19819
|
this.privRequestSession.requestId,
|
|
19763
19820
|
l,
|
|
@@ -19773,13 +19830,13 @@ class su extends Mg {
|
|
|
19773
19830
|
e
|
|
19774
19831
|
);
|
|
19775
19832
|
else {
|
|
19776
|
-
const c = tt.fromJSON(g.textBody),
|
|
19833
|
+
const c = tt.fromJSON(g.textBody), G = c.Offset + this.privRequestSession.currentTurnAudioOffset, u = c.getJsonWithCorrectedOffsets(G);
|
|
19777
19834
|
I = new $g(
|
|
19778
19835
|
this.privRequestSession.requestId,
|
|
19779
19836
|
l,
|
|
19780
19837
|
c.RecognitionStatus === _.Success ? c.NBest[0].Display : void 0,
|
|
19781
19838
|
c.Duration,
|
|
19782
|
-
|
|
19839
|
+
G,
|
|
19783
19840
|
c.Language,
|
|
19784
19841
|
c.LanguageDetectionConfidence,
|
|
19785
19842
|
void 0,
|
|
@@ -19926,11 +19983,11 @@ class lu extends Mg {
|
|
|
19926
19983
|
const a = Wg.implTranslateCancelResult(s.RecognitionStatus), c = Wg.implTranslateCancelErrorCode(s.RecognitionStatus);
|
|
19927
19984
|
yield this.cancelRecognitionLocal(a, c, Wg.implTranslateErrorDetails(c));
|
|
19928
19985
|
} else if (!(this.privRequestSession.isSpeechEnded && l === X.NoMatch && s.RecognitionStatus !== _.InitialSilenceTimeout)) {
|
|
19929
|
-
if (this.privRecognizerConfig.parameters.getProperty(sI) ===
|
|
19986
|
+
if (this.privRecognizerConfig.parameters.getProperty(sI) === E[E.Simple])
|
|
19930
19987
|
I = new kt(this.privRequestSession.requestId, l, s.DisplayText, s.Duration, s.Offset + this.privRequestSession.currentTurnAudioOffset, s.Language, s.LanguageDetectionConfidence, s.SpeakerId, void 0, g.textBody, e);
|
|
19931
19988
|
else {
|
|
19932
|
-
const c = tt.fromJSON(g.textBody),
|
|
19933
|
-
I = new kt(this.privRequestSession.requestId, l, c.RecognitionStatus === _.Success ? c.NBest[0].Display : void 0, c.Duration,
|
|
19989
|
+
const c = tt.fromJSON(g.textBody), G = c.Offset + this.privRequestSession.currentTurnAudioOffset, u = c.getJsonWithCorrectedOffsets(G);
|
|
19990
|
+
I = new kt(this.privRequestSession.requestId, l, c.RecognitionStatus === _.Success ? c.NBest[0].Display : void 0, c.Duration, G, c.Language, c.LanguageDetectionConfidence, s.SpeakerId, void 0, u, e);
|
|
19934
19991
|
}
|
|
19935
19992
|
const a = new kC(I, I.offset, this.privRequestSession.sessionId);
|
|
19936
19993
|
if (this.privConversationTranscriber.transcribed)
|
|
@@ -20243,11 +20300,11 @@ class ru extends Mg {
|
|
|
20243
20300
|
if (a !== null && a.topScoringIntent && a.topScoringIntent.intent) {
|
|
20244
20301
|
let c = this.privAddedLmIntents[a.topScoringIntent.intent];
|
|
20245
20302
|
if (this.privUmbrellaIntent !== void 0 && (c = this.privUmbrellaIntent), c) {
|
|
20246
|
-
const
|
|
20303
|
+
const G = c === void 0 || c.intentName === void 0 ? a.topScoringIntent.intent : c.intentName;
|
|
20247
20304
|
let u = e.result.reason;
|
|
20248
|
-
|
|
20305
|
+
G !== void 0 && (u = X.RecognizedIntent);
|
|
20249
20306
|
const m = e.result.properties !== void 0 ? e.result.properties : new x();
|
|
20250
|
-
m.setProperty(r.LanguageUnderstandingServiceResponse_JsonResult, g.textBody), e = new Me(new fe(
|
|
20307
|
+
m.setProperty(r.LanguageUnderstandingServiceResponse_JsonResult, g.textBody), e = new Me(new fe(G, e.result.resultId, u, e.result.text, e.result.duration, e.result.offset, void 0, void 0, e.result.errorDetails, e.result.json, m), e.offset, e.sessionId);
|
|
20251
20308
|
}
|
|
20252
20309
|
}
|
|
20253
20310
|
if (this.privRequestSession.onPhraseRecognized(e.offset + e.result.duration), this.privIntentRecognizer.recognized)
|
|
@@ -20768,7 +20825,7 @@ var TI = function(i, g, I, e) {
|
|
|
20768
20825
|
};
|
|
20769
20826
|
class uu extends Mg {
|
|
20770
20827
|
constructor(g, I, e, t, o) {
|
|
20771
|
-
super(g, I, e, t, o), this.privEvents = new
|
|
20828
|
+
super(g, I, e, t, o), this.privEvents = new yI(), this.privDialogServiceConnector = o, this.receiveMessageOverride = () => this.receiveDialogMessageOverride(), this.privTurnStateManager = new mu(), this.recognizeOverride = (C, n, s) => this.listenOnce(C, n, s), this.postConnectImplOverride = (C) => this.dialogConnectImpl(C), this.configConnectionOverride = (C) => this.configConnection(C), this.disconnectOverride = () => this.privDisconnect(), this.privDialogAudioSource = e, this.agentConfigSent = !1, this.privLastResult = null, this.connectionEvents.attach((C) => {
|
|
20772
20829
|
C.name === "ConnectionClosedEvent" && (this.terminateMessageLoop = !0);
|
|
20773
20830
|
});
|
|
20774
20831
|
}
|
|
@@ -20798,10 +20855,10 @@ class uu extends Mg {
|
|
|
20798
20855
|
case "speech.phrase":
|
|
20799
20856
|
const C = ie.fromJSON(g.textBody);
|
|
20800
20857
|
if (this.privRequestSession.onPhraseRecognized(this.privRequestSession.currentTurnAudioOffset + C.Offset + C.Duration), C.RecognitionStatus !== _.TooManyRequests && C.RecognitionStatus !== _.Error) {
|
|
20801
|
-
const
|
|
20802
|
-
if (this.privLastResult =
|
|
20858
|
+
const G = this.fireEventForResult(C, I);
|
|
20859
|
+
if (this.privLastResult = G.result, this.privDialogServiceConnector.recognized)
|
|
20803
20860
|
try {
|
|
20804
|
-
this.privDialogServiceConnector.recognized(this.privDialogServiceConnector,
|
|
20861
|
+
this.privDialogServiceConnector.recognized(this.privDialogServiceConnector, G);
|
|
20805
20862
|
} catch {
|
|
20806
20863
|
}
|
|
20807
20864
|
}
|
|
@@ -20831,7 +20888,7 @@ class uu extends Mg {
|
|
|
20831
20888
|
break;
|
|
20832
20889
|
case "audio":
|
|
20833
20890
|
{
|
|
20834
|
-
const
|
|
20891
|
+
const G = g.requestId.toUpperCase(), u = this.privTurnStateManager.GetTurn(G);
|
|
20835
20892
|
try {
|
|
20836
20893
|
g.binaryBody ? u.audioStream.write(g.binaryBody) : u.endAudioStream();
|
|
20837
20894
|
} catch {
|
|
@@ -20894,13 +20951,13 @@ class uu extends Mg {
|
|
|
20894
20951
|
yield this.privRequestSession.onAudioSourceAttachCompleted(l, !1), this.privRecognizerConfig.SpeechServiceConfig.Context.audio = { source: s };
|
|
20895
20952
|
try {
|
|
20896
20953
|
yield t, yield o;
|
|
20897
|
-
} catch (
|
|
20898
|
-
return yield this.cancelRecognition(this.privRequestSession.sessionId, this.privRequestSession.requestId, og.Error, w.ConnectionFailure,
|
|
20954
|
+
} catch (G) {
|
|
20955
|
+
return yield this.cancelRecognition(this.privRequestSession.sessionId, this.privRequestSession.requestId, og.Error, w.ConnectionFailure, G), Promise.resolve();
|
|
20899
20956
|
}
|
|
20900
20957
|
const a = new Fg(this.privRequestSession.sessionId);
|
|
20901
20958
|
this.privRecognizer.sessionStarted && this.privRecognizer.sessionStarted(this.privRecognizer, a), this.sendAudio(l).then(() => {
|
|
20902
|
-
}, (
|
|
20903
|
-
yield this.cancelRecognition(this.privRequestSession.sessionId, this.privRequestSession.requestId, og.Error, w.RuntimeError,
|
|
20959
|
+
}, (G) => TI(this, void 0, void 0, function* () {
|
|
20960
|
+
yield this.cancelRecognition(this.privRequestSession.sessionId, this.privRequestSession.requestId, og.Error, w.RuntimeError, G);
|
|
20904
20961
|
}));
|
|
20905
20962
|
});
|
|
20906
20963
|
}
|
|
@@ -20923,26 +20980,26 @@ class uu extends Mg {
|
|
|
20923
20980
|
switch (n.path.toLowerCase()) {
|
|
20924
20981
|
case "turn.start":
|
|
20925
20982
|
{
|
|
20926
|
-
const m = n.requestId.toUpperCase(),
|
|
20927
|
-
m !==
|
|
20983
|
+
const m = n.requestId.toUpperCase(), B = this.privRequestSession.requestId.toUpperCase();
|
|
20984
|
+
m !== B ? this.privTurnStateManager.StartTurn(m) : this.privRequestSession.onServiceTurnStartResponse();
|
|
20928
20985
|
}
|
|
20929
20986
|
break;
|
|
20930
20987
|
case "speech.startdetected":
|
|
20931
|
-
const l = qe.fromJSON(n.textBody), a = new
|
|
20988
|
+
const l = qe.fromJSON(n.textBody), a = new SI(l.Offset, this.privRequestSession.sessionId);
|
|
20932
20989
|
this.privRecognizer.speechStartDetected && this.privRecognizer.speechStartDetected(this.privRecognizer, a);
|
|
20933
20990
|
break;
|
|
20934
20991
|
case "speech.enddetected":
|
|
20935
20992
|
let c;
|
|
20936
20993
|
n.textBody.length > 0 ? c = n.textBody : c = "{ Offset: 0 }";
|
|
20937
|
-
const
|
|
20938
|
-
this.privRequestSession.onServiceRecognized(
|
|
20939
|
-
const u = new
|
|
20994
|
+
const G = qe.fromJSON(c);
|
|
20995
|
+
this.privRequestSession.onServiceRecognized(G.Offset + this.privRequestSession.currentTurnAudioOffset);
|
|
20996
|
+
const u = new SI(G.Offset + this.privRequestSession.currentTurnAudioOffset, this.privRequestSession.sessionId);
|
|
20940
20997
|
this.privRecognizer.speechEndDetected && this.privRecognizer.speechEndDetected(this.privRecognizer, u);
|
|
20941
20998
|
break;
|
|
20942
20999
|
case "turn.end":
|
|
20943
21000
|
{
|
|
20944
|
-
const m = n.requestId.toUpperCase(),
|
|
20945
|
-
if (m !==
|
|
21001
|
+
const m = n.requestId.toUpperCase(), B = this.privRequestSession.requestId.toUpperCase();
|
|
21002
|
+
if (m !== B)
|
|
20946
21003
|
this.privTurnStateManager.CompleteTurn(m);
|
|
20947
21004
|
else {
|
|
20948
21005
|
const p = new Fg(this.privRequestSession.sessionId);
|
|
@@ -21083,39 +21140,39 @@ class Cd {
|
|
|
21083
21140
|
this.iPrivConfig = g;
|
|
21084
21141
|
}
|
|
21085
21142
|
}
|
|
21086
|
-
class
|
|
21143
|
+
class T extends kI {
|
|
21087
21144
|
static get host() {
|
|
21088
|
-
return
|
|
21145
|
+
return T.privHost;
|
|
21089
21146
|
}
|
|
21090
21147
|
static get apiVersion() {
|
|
21091
|
-
return
|
|
21148
|
+
return T.privApiVersion;
|
|
21092
21149
|
}
|
|
21093
21150
|
static get clientAppId() {
|
|
21094
|
-
return
|
|
21151
|
+
return T.privClientAppId;
|
|
21095
21152
|
}
|
|
21096
21153
|
static get defaultLanguageCode() {
|
|
21097
|
-
return
|
|
21154
|
+
return T.privDefaultLanguageCode;
|
|
21098
21155
|
}
|
|
21099
21156
|
static get restPath() {
|
|
21100
|
-
return
|
|
21157
|
+
return T.privRestPath;
|
|
21101
21158
|
}
|
|
21102
21159
|
static get webSocketPath() {
|
|
21103
|
-
return
|
|
21160
|
+
return T.privWebSocketPath;
|
|
21104
21161
|
}
|
|
21105
21162
|
static get transcriptionEventKeys() {
|
|
21106
|
-
return
|
|
21163
|
+
return T.privTranscriptionEventKeys;
|
|
21107
21164
|
}
|
|
21108
21165
|
}
|
|
21109
|
-
|
|
21110
|
-
|
|
21111
|
-
|
|
21112
|
-
|
|
21113
|
-
|
|
21114
|
-
|
|
21115
|
-
|
|
21166
|
+
T.privHost = "dev.microsofttranslator.com";
|
|
21167
|
+
T.privRestPath = "/capito/room";
|
|
21168
|
+
T.privApiVersion = "2.0";
|
|
21169
|
+
T.privDefaultLanguageCode = "en-US";
|
|
21170
|
+
T.privClientAppId = "FC539C22-1767-4F1F-84BC-B4D811114F15";
|
|
21171
|
+
T.privWebSocketPath = "/capito/translate";
|
|
21172
|
+
T.privTranscriptionEventKeys = ["iCalUid", "callId", "organizer", "FLAC", "MTUri", "DifferentiateGuestSpeakers", "audiorecording", "Threadid", "OrganizerMri", "OrganizerTenantId", "UserToken"];
|
|
21116
21173
|
class nd {
|
|
21117
21174
|
constructor() {
|
|
21118
|
-
this.privRequestParams =
|
|
21175
|
+
this.privRequestParams = T.configParams, this.privErrors = T.restErrors, this.privHost = T.host, this.privApiVersion = T.apiVersion, this.privRestPath = T.restPath, this.privRestAdapter = new qC({});
|
|
21119
21176
|
}
|
|
21120
21177
|
/**
|
|
21121
21178
|
* Make a POST request to the Conversation Manager service endpoint to create or join a conversation.
|
|
@@ -21127,16 +21184,16 @@ class nd {
|
|
|
21127
21184
|
createOrJoin(g, I, e, t) {
|
|
21128
21185
|
try {
|
|
21129
21186
|
A.throwIfNullOrUndefined(g, "args");
|
|
21130
|
-
const o = g.getProperty(r.SpeechServiceConnection_RecoLanguage,
|
|
21187
|
+
const o = g.getProperty(r.SpeechServiceConnection_RecoLanguage, T.defaultLanguageCode), C = g.getProperty(r.ConversationTranslator_Name, "conversation_host"), n = g.getProperty(r.ConversationTranslator_Host, this.privHost), s = g.getProperty(r.ConversationTranslator_CorrelationId), l = g.getProperty(r.SpeechServiceConnection_Key), a = g.getProperty(r.SpeechServiceConnection_Region), c = g.getProperty(r.SpeechServiceAuthorization_Token);
|
|
21131
21188
|
A.throwIfNullOrWhitespace(o, "languageCode"), A.throwIfNullOrWhitespace(C, "nickname"), A.throwIfNullOrWhitespace(n, "endpointHost");
|
|
21132
|
-
const
|
|
21133
|
-
|
|
21189
|
+
const G = {};
|
|
21190
|
+
G[this.privRequestParams.apiVersion] = this.privApiVersion, G[this.privRequestParams.languageCode] = o, G[this.privRequestParams.nickname] = C;
|
|
21134
21191
|
const u = {};
|
|
21135
|
-
s && (u[this.privRequestParams.correlationId] = s), u[this.privRequestParams.clientAppId] =
|
|
21192
|
+
s && (u[this.privRequestParams.correlationId] = s), u[this.privRequestParams.clientAppId] = T.clientAppId, I !== void 0 ? G[this.privRequestParams.roomId] = I : (A.throwIfNullOrUndefined(a, this.privErrors.authInvalidSubscriptionRegion), u[this.privRequestParams.subscriptionRegion] = a, l ? u[this.privRequestParams.subscriptionKey] = l : c ? u[this.privRequestParams.authorization] = `Bearer ${c}` : A.throwIfNullOrUndefined(l, this.privErrors.authInvalidSubscriptionKey));
|
|
21136
21193
|
const m = {};
|
|
21137
21194
|
m.headers = u, this.privRestAdapter.options = m;
|
|
21138
|
-
const
|
|
21139
|
-
this.privRestAdapter.request(de.Post,
|
|
21195
|
+
const B = `https://${n}${this.privRestPath}`;
|
|
21196
|
+
this.privRestAdapter.request(de.Post, B, G, null).then((p) => {
|
|
21140
21197
|
const b = qC.extractHeaderValue(this.privRequestParams.requestId, p.headers);
|
|
21141
21198
|
if (!p.ok) {
|
|
21142
21199
|
if (t) {
|
|
@@ -21245,10 +21302,10 @@ class bu {
|
|
|
21245
21302
|
}
|
|
21246
21303
|
class pu extends Kg {
|
|
21247
21304
|
create(g, I, e) {
|
|
21248
|
-
const t = g.parameters.getProperty(r.ConversationTranslator_Host,
|
|
21305
|
+
const t = g.parameters.getProperty(r.ConversationTranslator_Host, T.host), o = g.parameters.getProperty(r.ConversationTranslator_CorrelationId, Qt()), C = `wss://${t}${T.webSocketPath}`, n = g.parameters.getProperty(r.ConversationTranslator_Token, void 0);
|
|
21249
21306
|
A.throwIfNullOrUndefined(n, "token");
|
|
21250
21307
|
const s = {};
|
|
21251
|
-
s[
|
|
21308
|
+
s[T.configParams.apiVersion] = T.apiVersion, s[T.configParams.token] = n, s[T.configParams.correlationId] = o;
|
|
21252
21309
|
const l = g.parameters.getProperty("SPEECH-EnableWebsocketCompression", "false") === "true";
|
|
21253
21310
|
return new zI(C, s, {}, new bu(), hI.fromRecognizerConfig(g), l, e);
|
|
21254
21311
|
}
|
|
@@ -21786,14 +21843,14 @@ class Yu extends Mg {
|
|
|
21786
21843
|
this.privConversationServiceConnector.participantUpdateCommandReceived && this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector, new di(n.participantId, ng.changeNickname, n.value, t));
|
|
21787
21844
|
break;
|
|
21788
21845
|
case "joinsession":
|
|
21789
|
-
const
|
|
21790
|
-
avatar:
|
|
21791
|
-
displayName:
|
|
21792
|
-
id:
|
|
21793
|
-
isHost:
|
|
21794
|
-
isMuted:
|
|
21795
|
-
isUsingTts:
|
|
21796
|
-
preferredLanguage:
|
|
21846
|
+
const B = Gs.fromJSON(e.textBody), p = {
|
|
21847
|
+
avatar: B.avatar,
|
|
21848
|
+
displayName: B.nickname,
|
|
21849
|
+
id: B.participantId,
|
|
21850
|
+
isHost: B.ishost,
|
|
21851
|
+
isMuted: B.ismuted,
|
|
21852
|
+
isUsingTts: B.usetts,
|
|
21853
|
+
preferredLanguage: B.locale
|
|
21797
21854
|
};
|
|
21798
21855
|
this.privConversationServiceConnector.participantJoinCommandReceived && this.privConversationServiceConnector.participantJoinCommandReceived(this.privConversationServiceConnector, new Ha(p, t));
|
|
21799
21856
|
break;
|
|
@@ -21828,8 +21885,8 @@ class Yu extends Mg {
|
|
|
21828
21885
|
s.isFinal ? ((a.text !== void 0 && a.text.length > 0 || s.id === this.privLastPartialUtteranceId) && (C = !0), C && this.privConversationServiceConnector.translationReceived && this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector, new Do(rg.final, a, t))) : a.text !== void 0 && (this.privLastPartialUtteranceId = s.id, this.privConversationServiceConnector.translationReceived && this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector, new Do(rg.partial, a, t)));
|
|
21829
21886
|
break;
|
|
21830
21887
|
case "translated_message":
|
|
21831
|
-
const c = ms.fromJSON(e.textBody),
|
|
21832
|
-
this.privConversationServiceConnector.translationReceived && this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector, new Do(rg.instantMessage,
|
|
21888
|
+
const c = ms.fromJSON(e.textBody), G = new EC(c.participantId, this.getTranslations(c.translations), c.language, void 0, void 0, c.originalText, void 0, void 0, void 0, e.textBody, void 0);
|
|
21889
|
+
this.privConversationServiceConnector.translationReceived && this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector, new Do(rg.instantMessage, G, t));
|
|
21833
21890
|
break;
|
|
21834
21891
|
default:
|
|
21835
21892
|
break;
|
|
@@ -22198,10 +22255,10 @@ class Nu extends AI {
|
|
|
22198
22255
|
return new cu(g, I, o, t, this);
|
|
22199
22256
|
}
|
|
22200
22257
|
}
|
|
22201
|
-
var
|
|
22258
|
+
var RI;
|
|
22202
22259
|
(function(i) {
|
|
22203
22260
|
i.WordBoundary = "WordBoundary", i.Bookmark = "Bookmark", i.Viseme = "Viseme", i.SentenceBoundary = "SentenceBoundary", i.SessionEnd = "SessionEnd", i.AvatarSignal = "TalkingAvatarSignal";
|
|
22204
|
-
})(
|
|
22261
|
+
})(RI || (RI = {}));
|
|
22205
22262
|
class us {
|
|
22206
22263
|
constructor(g) {
|
|
22207
22264
|
this.privSynthesisAudioMetadata = JSON.parse(g);
|
|
@@ -22412,7 +22469,7 @@ class Ot {
|
|
|
22412
22469
|
return g.length >= 2 && g[0] === "<" && g[g.length - 1] === ">";
|
|
22413
22470
|
}
|
|
22414
22471
|
updateTextOffset(g, I) {
|
|
22415
|
-
I ===
|
|
22472
|
+
I === RI.WordBoundary ? (this.privTextOffset = this.privRawText.indexOf(g, this.privNextSearchTextIndex), this.privTextOffset >= 0 && (this.privNextSearchTextIndex = this.privTextOffset + g.length, this.privIsSSML && this.withinXmlTag(this.privTextOffset) && !Ot.isXmlTag(g) && this.updateTextOffset(g, I))) : (this.privSentenceOffset = this.privRawText.indexOf(g, this.privNextSearchSentenceIndex), this.privSentenceOffset >= 0 && (this.privNextSearchSentenceIndex = this.privSentenceOffset + g.length, this.privIsSSML && this.withinXmlTag(this.privSentenceOffset) && !Ot.isXmlTag(g) && this.updateTextOffset(g, I)));
|
|
22416
22473
|
}
|
|
22417
22474
|
onComplete() {
|
|
22418
22475
|
this.privIsSynthesizing && (this.privIsSynthesizing = !1, this.privIsSynthesisEnded = !0, this.privAudioOutputStream.close(), this.privInTurn = !1, this.privTurnAudioDestination !== void 0 && (this.privTurnAudioDestination.close(), this.privTurnAudioDestination = void 0));
|
|
@@ -22473,7 +22530,7 @@ class xi {
|
|
|
22473
22530
|
throw new Rg("connectionFactory");
|
|
22474
22531
|
if (!e)
|
|
22475
22532
|
throw new Rg("synthesizerConfig");
|
|
22476
|
-
this.privAuthentication = g, this.privConnectionFactory = I, this.privSynthesizerConfig = e, this.privIsDisposed = !1, this.privSessionAudioDestination = t, this.privSynthesisTurn = new Ot(), this.privConnectionEvents = new
|
|
22533
|
+
this.privAuthentication = g, this.privConnectionFactory = I, this.privSynthesizerConfig = e, this.privIsDisposed = !1, this.privSessionAudioDestination = t, this.privSynthesisTurn = new Ot(), this.privConnectionEvents = new yI(), this.privServiceEvents = new yI(), this.privSynthesisContext = new Qu(), this.privAgentConfig = new Cd(), this.connectionEvents.attach((o) => {
|
|
22477
22534
|
if (o.name === "ConnectionClosedEvent") {
|
|
22478
22535
|
const C = o;
|
|
22479
22536
|
C.statusCode !== 1e3 && this.cancelSynthesisLocal(og.Error, C.statusCode === 1007 ? w.BadRequestParameters : w.ConnectionFailure, `${C.reason} websocket error code: ${C.statusCode}`);
|
|
@@ -22587,26 +22644,26 @@ class xi {
|
|
|
22587
22644
|
const t = us.fromJSON(e.textBody).Metadata;
|
|
22588
22645
|
for (const C of t)
|
|
22589
22646
|
switch (C.Type) {
|
|
22590
|
-
case
|
|
22591
|
-
case
|
|
22647
|
+
case RI.WordBoundary:
|
|
22648
|
+
case RI.SentenceBoundary:
|
|
22592
22649
|
this.privSynthesisTurn.onTextBoundaryEvent(C);
|
|
22593
|
-
const n = new Dr(C.Data.Offset, C.Data.Duration, C.Data.text.Text, C.Data.text.Length, C.Type ===
|
|
22650
|
+
const n = new Dr(C.Data.Offset, C.Data.Duration, C.Data.text.Text, C.Data.text.Length, C.Type === RI.WordBoundary ? this.privSynthesisTurn.currentTextOffset : this.privSynthesisTurn.currentSentenceOffset, C.Data.text.BoundaryType);
|
|
22594
22651
|
this.onWordBoundary(n);
|
|
22595
22652
|
break;
|
|
22596
|
-
case
|
|
22653
|
+
case RI.Bookmark:
|
|
22597
22654
|
const s = new Er(C.Data.Offset, C.Data.Bookmark);
|
|
22598
22655
|
this.onBookmarkReached(s);
|
|
22599
22656
|
break;
|
|
22600
|
-
case
|
|
22657
|
+
case RI.Viseme:
|
|
22601
22658
|
if (this.privSynthesisTurn.onVisemeMetadataReceived(C), C.Data.IsLastAnimation) {
|
|
22602
22659
|
const l = new xr(C.Data.Offset, C.Data.VisemeId, this.privSynthesisTurn.getAndClearVisemeAnimation());
|
|
22603
22660
|
this.onVisemeReceived(l);
|
|
22604
22661
|
}
|
|
22605
22662
|
break;
|
|
22606
|
-
case
|
|
22663
|
+
case RI.AvatarSignal:
|
|
22607
22664
|
this.onAvatarEvent(C);
|
|
22608
22665
|
break;
|
|
22609
|
-
case
|
|
22666
|
+
case RI.SessionEnd:
|
|
22610
22667
|
this.privSynthesisTurn.onSessionEnd(C);
|
|
22611
22668
|
break;
|
|
22612
22669
|
}
|
|
@@ -22700,7 +22757,7 @@ class zu extends xi {
|
|
|
22700
22757
|
this.privSynthesisContext.setSynthesisSection(void 0);
|
|
22701
22758
|
}
|
|
22702
22759
|
setSpeechConfigSynthesisSection() {
|
|
22703
|
-
var g, I, e, t, o, C, n, s, l, a, c,
|
|
22760
|
+
var g, I, e, t, o, C, n, s, l, a, c, G, u, m, B, p;
|
|
22704
22761
|
this.privSynthesizerConfig.synthesisVideoSection = {
|
|
22705
22762
|
format: {
|
|
22706
22763
|
bitrate: (g = this.privAvatarConfig.videoFormat) === null || g === void 0 ? void 0 : g.bitrate,
|
|
@@ -22712,11 +22769,11 @@ class zu extends xi {
|
|
|
22712
22769
|
},
|
|
22713
22770
|
topLeft: {
|
|
22714
22771
|
x: (c = (a = (l = this.privAvatarConfig.videoFormat) === null || l === void 0 ? void 0 : l.cropRange) === null || a === void 0 ? void 0 : a.topLeft) === null || c === void 0 ? void 0 : c.x,
|
|
22715
|
-
y: (m = (u = (
|
|
22772
|
+
y: (m = (u = (G = this.privAvatarConfig.videoFormat) === null || G === void 0 ? void 0 : G.cropRange) === null || u === void 0 ? void 0 : u.topLeft) === null || m === void 0 ? void 0 : m.y
|
|
22716
22773
|
}
|
|
22717
22774
|
},
|
|
22718
22775
|
resolution: {
|
|
22719
|
-
height: (
|
|
22776
|
+
height: (B = this.privAvatarConfig.videoFormat) === null || B === void 0 ? void 0 : B.height,
|
|
22720
22777
|
width: (p = this.privAvatarConfig.videoFormat) === null || p === void 0 ? void 0 : p.width
|
|
22721
22778
|
}
|
|
22722
22779
|
},
|
|
@@ -23344,7 +23401,7 @@ const sI = "OutputFormat", xg = "CancellationErrorCode", qI = "ServiceProperties
|
|
|
23344
23401
|
ConnectionMessageEventArgs: QC,
|
|
23345
23402
|
Conversation: fr,
|
|
23346
23403
|
ConversationExpirationEventArgs: Mr,
|
|
23347
|
-
ConversationParticipantsChangedEventArgs:
|
|
23404
|
+
ConversationParticipantsChangedEventArgs: ZI,
|
|
23348
23405
|
ConversationTranscriber: ts,
|
|
23349
23406
|
ConversationTranscriptionCanceledEventArgs: Cs,
|
|
23350
23407
|
ConversationTranscriptionEventArgs: kC,
|
|
@@ -23379,7 +23436,7 @@ const sI = "OutputFormat", xg = "CancellationErrorCode", qI = "ServiceProperties
|
|
|
23379
23436
|
return pe;
|
|
23380
23437
|
},
|
|
23381
23438
|
get OutputFormat() {
|
|
23382
|
-
return
|
|
23439
|
+
return E;
|
|
23383
23440
|
},
|
|
23384
23441
|
Participant: et,
|
|
23385
23442
|
get ParticipantChangedReason() {
|
|
@@ -23407,7 +23464,7 @@ const sI = "OutputFormat", xg = "CancellationErrorCode", qI = "ServiceProperties
|
|
|
23407
23464
|
PushAudioInputStream: Fn,
|
|
23408
23465
|
PushAudioOutputStream: zn,
|
|
23409
23466
|
PushAudioOutputStreamCallback: Mn,
|
|
23410
|
-
RecognitionEventArgs:
|
|
23467
|
+
RecognitionEventArgs: SI,
|
|
23411
23468
|
RecognitionResult: co,
|
|
23412
23469
|
Recognizer: AI,
|
|
23413
23470
|
get ResultReason() {
|
|
@@ -23510,7 +23567,7 @@ var ju = cd.exports, hi = function(i) {
|
|
|
23510
23567
|
return gb($u(i), 8, -1);
|
|
23511
23568
|
}, Ib = po, eb = II, Gd = function(i) {
|
|
23512
23569
|
if (Ib(i) === "Function") return eb(i);
|
|
23513
|
-
}, xo = typeof document == "object" && document.all,
|
|
23570
|
+
}, xo = typeof document == "object" && document.all, Qg = typeof xo > "u" && xo !== void 0 ? function(i) {
|
|
23514
23571
|
return typeof i == "function" || i === xo;
|
|
23515
23572
|
} : function(i) {
|
|
23516
23573
|
return typeof i == "function";
|
|
@@ -23543,9 +23600,9 @@ var ot = function(i, g) {
|
|
|
23543
23600
|
return i;
|
|
23544
23601
|
}, db = lb, Ab = yo, Ct = function(i) {
|
|
23545
23602
|
return db(Ab(i));
|
|
23546
|
-
}, hb =
|
|
23603
|
+
}, hb = Qg, WI = function(i) {
|
|
23547
23604
|
return typeof i == "object" ? i !== null : hb(i);
|
|
23548
|
-
}, So = {}, jo = So, Oo = Hg, Gb =
|
|
23605
|
+
}, So = {}, jo = So, Oo = Hg, Gb = Qg, Ka = function(i) {
|
|
23549
23606
|
return Gb(i) ? i : void 0;
|
|
23550
23607
|
}, he = function(i, g) {
|
|
23551
23608
|
return arguments.length < 2 ? Ka(jo[i]) || Ka(Oo[i]) : jo[i] && jo[i][g] || Oo[i] && Oo[i][g];
|
|
@@ -23556,7 +23613,7 @@ var pd = qt, ka = pd, ub = aI, bb = Hg, pb = bb.String, Zd = !!Object.getOwnProp
|
|
|
23556
23613
|
var i = Symbol("symbol detection");
|
|
23557
23614
|
return !pb(i) || !(Object(i) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
23558
23615
|
!Symbol.sham && ka && ka < 41;
|
|
23559
|
-
}), Zb = Zd, yd = Zb && !Symbol.sham && typeof Symbol.iterator == "symbol", yb = he, Sb =
|
|
23616
|
+
}), Zb = Zd, yd = Zb && !Symbol.sham && typeof Symbol.iterator == "symbol", yb = he, Sb = Qg, Wb = Wo, vb = yd, Hb = Object, Sd = vb ? function(i) {
|
|
23560
23617
|
return typeof i == "symbol";
|
|
23561
23618
|
} : function(i) {
|
|
23562
23619
|
var g = yb("Symbol");
|
|
@@ -23567,13 +23624,13 @@ var pd = qt, ka = pd, ub = aI, bb = Hg, pb = bb.String, Zd = !!Object.getOwnProp
|
|
|
23567
23624
|
} catch {
|
|
23568
23625
|
return "Object";
|
|
23569
23626
|
}
|
|
23570
|
-
}, Xb =
|
|
23627
|
+
}, Xb = Qg, Rb = vo, Kb = TypeError, vI = function(i) {
|
|
23571
23628
|
if (Xb(i)) return i;
|
|
23572
23629
|
throw new Kb(Rb(i) + " is not a function");
|
|
23573
|
-
}, Yb =
|
|
23630
|
+
}, Yb = vI, wb = Zo, Ss = function(i, g) {
|
|
23574
23631
|
var I = i[g];
|
|
23575
23632
|
return wb(I) ? void 0 : Yb(I);
|
|
23576
|
-
}, _o = GI, $o =
|
|
23633
|
+
}, _o = GI, $o = Qg, gC = WI, Lb = TypeError, Nb = function(i, g) {
|
|
23577
23634
|
var I, e;
|
|
23578
23635
|
if (g === "string" && $o(I = i.toString) && !gC(e = _o(I, i)) || $o(I = i.valueOf) && !gC(e = _o(I, i)) || g !== "string" && $o(I = i.toString) && !gC(e = _o(I, i))) return e;
|
|
23579
23636
|
throw new Lb("Can't convert object to primitive value");
|
|
@@ -23602,7 +23659,7 @@ var Ws = Wd.exports, Ua = Ws, vd = function(i, g) {
|
|
|
23602
23659
|
return "Symbol(" + (i === void 0 ? "" : i) + ")_" + jb(++xb + Pb, 36);
|
|
23603
23660
|
}, Ob = Hg, qb = vd, Qa = fI, _b = Vd, $b = Zd, gp = yd, Ue = Ob.Symbol, IC = qb("wks"), Ip = gp ? Ue.for || Ue : Ue && Ue.withoutSetter || _b, lI = function(i) {
|
|
23604
23661
|
return Qa(IC, i) || (IC[i] = $b && Qa(Ue, i) ? Ue[i] : Ip("Symbol." + i)), IC[i];
|
|
23605
|
-
}, ep = GI, Ta =
|
|
23662
|
+
}, ep = GI, Ta = WI, Da = Sd, ip = Ss, tp = Nb, op = lI, Cp = TypeError, np = op("toPrimitive"), sp = function(i, g) {
|
|
23606
23663
|
if (!Ta(i) || Da(i)) return i;
|
|
23607
23664
|
var I = ip(i, np), e;
|
|
23608
23665
|
if (I) {
|
|
@@ -23613,7 +23670,7 @@ var Ws = Wd.exports, Ua = Ws, vd = function(i, g) {
|
|
|
23613
23670
|
}, ap = sp, lp = Sd, Xd = function(i) {
|
|
23614
23671
|
var g = ap(i, "string");
|
|
23615
23672
|
return lp(g) ? g : g + "";
|
|
23616
|
-
}, cp = Hg, Ea =
|
|
23673
|
+
}, cp = Hg, Ea = WI, In = cp.document, rp = Ea(In) && Ea(In.createElement), vs = function(i) {
|
|
23617
23674
|
return rp ? In.createElement(i) : {};
|
|
23618
23675
|
}, dp = te, Ap = aI, hp = vs, Rd = !dp && !Ap(function() {
|
|
23619
23676
|
return Object.defineProperty(hp("div"), "a", {
|
|
@@ -23629,12 +23686,12 @@ ys.f = Gp ? xa : function(g, I) {
|
|
|
23629
23686
|
}
|
|
23630
23687
|
if (Zp(g, I)) return up(!Bp(mp.f, g, I), g[I]);
|
|
23631
23688
|
};
|
|
23632
|
-
var Sp = aI, Wp =
|
|
23689
|
+
var Sp = aI, Wp = Qg, vp = /#|\.prototype\./, st = function(i, g) {
|
|
23633
23690
|
var I = Vp[Hp(i)];
|
|
23634
23691
|
return I === Rp ? !0 : I === Xp ? !1 : Wp(g) ? Sp(g) : !!g;
|
|
23635
23692
|
}, Hp = st.normalize = function(i) {
|
|
23636
23693
|
return String(i).replace(vp, ".").toLowerCase();
|
|
23637
|
-
}, Vp = st.data = {}, Xp = st.NATIVE = "N", Rp = st.POLYFILL = "P", Kd = st, Pa = Gd, Kp =
|
|
23694
|
+
}, Vp = st.data = {}, Xp = st.NATIVE = "N", Rp = st.POLYFILL = "P", Kd = st, Pa = Gd, Kp = vI, Yp = bo, wp = Pa(Pa.bind), Ho = function(i, g) {
|
|
23638
23695
|
return Kp(i), g === void 0 ? i : Yp ? wp(i, g) : function() {
|
|
23639
23696
|
return i.apply(g, arguments);
|
|
23640
23697
|
};
|
|
@@ -23644,7 +23701,7 @@ var Sp = aI, Wp = Ug, vp = /#|\.prototype\./, st = function(i, g) {
|
|
|
23644
23701
|
value: 42,
|
|
23645
23702
|
writable: !1
|
|
23646
23703
|
}).prototype !== 42;
|
|
23647
|
-
}), Fp =
|
|
23704
|
+
}), Fp = WI, Jp = String, kp = TypeError, oe = function(i) {
|
|
23648
23705
|
if (Fp(i)) return i;
|
|
23649
23706
|
throw new kp(Jp(i) + " is not an object");
|
|
23650
23707
|
}, zp = te, fp = Rd, Mp = Yd, bt = oe, ja = Xd, Up = TypeError, eC = Object.defineProperty, Qp = Object.getOwnPropertyDescriptor, iC = "enumerable", tC = "configurable", oC = "writable";
|
|
@@ -23670,7 +23727,7 @@ var Tp = te, Dp = Re, Ep = ot, Ke = Tp ? function(i, g, I) {
|
|
|
23670
23727
|
return Dp.f(i, g, Ep(1, I));
|
|
23671
23728
|
} : function(i, g, I) {
|
|
23672
23729
|
return i[g] = I, i;
|
|
23673
|
-
}, Gi = Hg, xp = Zs, Pp = Gd, jp =
|
|
23730
|
+
}, Gi = Hg, xp = Zs, Pp = Gd, jp = Qg, Op = ys.f, qp = Kd, Ne = So, _p = Ho, Fe = Ke, Oa = fI, $p = function(i) {
|
|
23674
23731
|
var g = function(I, e, t) {
|
|
23675
23732
|
if (this instanceof g) {
|
|
23676
23733
|
switch (arguments.length) {
|
|
@@ -23687,31 +23744,31 @@ var Tp = te, Dp = Re, Ep = ot, Ke = Tp ? function(i, g, I) {
|
|
|
23687
23744
|
};
|
|
23688
23745
|
return g.prototype = i.prototype, g;
|
|
23689
23746
|
}, cI = function(i, g) {
|
|
23690
|
-
var I = i.target, e = i.global, t = i.stat, o = i.proto, C = e ? Gi : t ? Gi[I] : Gi[I] && Gi[I].prototype, n = e ? Ne : Ne[I] || Fe(Ne, I, {})[I], s = n.prototype, l, a, c,
|
|
23691
|
-
for (
|
|
23692
|
-
l = qp(e ?
|
|
23747
|
+
var I = i.target, e = i.global, t = i.stat, o = i.proto, C = e ? Gi : t ? Gi[I] : Gi[I] && Gi[I].prototype, n = e ? Ne : Ne[I] || Fe(Ne, I, {})[I], s = n.prototype, l, a, c, G, u, m, B, p, b;
|
|
23748
|
+
for (G in g)
|
|
23749
|
+
l = qp(e ? G : I + (t ? "." : "#") + G, i.forced), a = !l && C && Oa(C, G), m = n[G], a && (i.dontCallGetSet ? (b = Op(C, G), B = b && b.value) : B = C[G]), u = a && B ? B : g[G], !(!l && !o && typeof m == typeof u) && (i.bind && a ? p = _p(u, Gi) : i.wrap && a ? p = $p(u) : o && jp(u) ? p = Pp(u) : p = u, (i.sham || u && u.sham || m && m.sham) && Fe(p, "sham", !0), Fe(n, G, p), o && (c = I + "Prototype", Oa(Ne, c) || Fe(Ne, c, {}), Fe(Ne[c], G, u), i.real && s && (l || !s[G]) && Fe(s, G, u)));
|
|
23693
23750
|
}, g0 = vd, I0 = Vd, qa = g0("keys"), Hs = function(i) {
|
|
23694
23751
|
return qa[i] || (qa[i] = I0(i));
|
|
23695
23752
|
}, e0 = aI, i0 = !e0(function() {
|
|
23696
23753
|
function i() {
|
|
23697
23754
|
}
|
|
23698
23755
|
return i.prototype.constructor = null, Object.getPrototypeOf(new i()) !== i.prototype;
|
|
23699
|
-
}), t0 = fI, o0 =
|
|
23756
|
+
}), t0 = fI, o0 = Qg, C0 = Hd, n0 = Hs, s0 = i0, _a = n0("IE_PROTO"), en = Object, a0 = en.prototype, Vs = s0 ? en.getPrototypeOf : function(i) {
|
|
23700
23757
|
var g = C0(i);
|
|
23701
23758
|
if (t0(g, _a)) return g[_a];
|
|
23702
23759
|
var I = g.constructor;
|
|
23703
23760
|
return o0(I) && g instanceof I ? I.prototype : g instanceof en ? a0 : null;
|
|
23704
|
-
}, l0 = II, c0 =
|
|
23761
|
+
}, l0 = II, c0 = vI, r0 = function(i, g, I) {
|
|
23705
23762
|
try {
|
|
23706
23763
|
return l0(c0(Object.getOwnPropertyDescriptor(i, g)[I]));
|
|
23707
23764
|
} catch {
|
|
23708
23765
|
}
|
|
23709
|
-
}, d0 =
|
|
23766
|
+
}, d0 = WI, A0 = function(i) {
|
|
23710
23767
|
return d0(i) || i === null;
|
|
23711
23768
|
}, h0 = A0, G0 = String, B0 = TypeError, m0 = function(i) {
|
|
23712
23769
|
if (h0(i)) return i;
|
|
23713
23770
|
throw new B0("Can't set " + G0(i) + " as a prototype");
|
|
23714
|
-
}, u0 = r0, b0 =
|
|
23771
|
+
}, u0 = r0, b0 = WI, p0 = yo, Z0 = m0, y0 = Object.setPrototypeOf || ("__proto__" in {} ? function() {
|
|
23715
23772
|
var i = !1, g = {}, I;
|
|
23716
23773
|
try {
|
|
23717
23774
|
I = u0(Object.prototype, "__proto__", "set"), I(g, []), i = g instanceof Array;
|
|
@@ -23808,7 +23865,7 @@ BZ[zd] = !0;
|
|
|
23808
23865
|
var Ys = Object.create || function(g, I) {
|
|
23809
23866
|
var e;
|
|
23810
23867
|
return g !== null ? (nC[tn] = hZ(g), e = new nC(), nC[tn] = null, e[zd] = g) : e = zt(), I === void 0 ? e : GZ.f(e, I);
|
|
23811
|
-
}, ZZ =
|
|
23868
|
+
}, ZZ = WI, yZ = Ke, SZ = function(i, g) {
|
|
23812
23869
|
ZZ(g) && "cause" in g && yZ(i, "cause", g.cause);
|
|
23813
23870
|
}, WZ = II, Md = Error, vZ = WZ("".replace), HZ = function(i) {
|
|
23814
23871
|
return String(new Md(i).stack);
|
|
@@ -23825,7 +23882,7 @@ var Ys = Object.create || function(g, I) {
|
|
|
23825
23882
|
return i !== void 0 && (kZ.Array === i || fZ[zZ] === i);
|
|
23826
23883
|
}, UZ = lI, QZ = UZ("toStringTag"), Qd = {};
|
|
23827
23884
|
Qd[QZ] = "z";
|
|
23828
|
-
var ws = String(Qd) === "[object z]", TZ = ws, DZ =
|
|
23885
|
+
var ws = String(Qd) === "[object z]", TZ = ws, DZ = Qg, ft = po, EZ = lI, xZ = EZ("toStringTag"), PZ = Object, jZ = ft(/* @__PURE__ */ function() {
|
|
23829
23886
|
return arguments;
|
|
23830
23887
|
}()) === "Arguments", OZ = function(i, g) {
|
|
23831
23888
|
try {
|
|
@@ -23837,7 +23894,7 @@ var ws = String(Qd) === "[object z]", TZ = ws, DZ = Ug, ft = po, EZ = lI, xZ = E
|
|
|
23837
23894
|
return i === void 0 ? "Undefined" : i === null ? "Null" : typeof (I = OZ(g = PZ(i), xZ)) == "string" ? I : jZ ? ft(g) : (e = ft(g)) === "Object" && DZ(g.callee) ? "Arguments" : e;
|
|
23838
23895
|
}, qZ = Vo, Cl = Ss, _Z = Zo, $Z = ii, gy = lI, Iy = gy("iterator"), Td = function(i) {
|
|
23839
23896
|
if (!_Z(i)) return Cl(i, Iy) || Cl(i, "@@iterator") || $Z[qZ(i)];
|
|
23840
|
-
}, ey = GI, iy =
|
|
23897
|
+
}, ey = GI, iy = vI, ty = oe, oy = vo, Cy = Td, ny = TypeError, sy = function(i, g) {
|
|
23841
23898
|
var I = arguments.length < 2 ? Cy(i) : g;
|
|
23842
23899
|
if (iy(I)) return ty(ey(I, i));
|
|
23843
23900
|
throw new ny(oy(i) + " is not iterable");
|
|
@@ -23859,7 +23916,7 @@ var ws = String(Qd) === "[object z]", TZ = ws, DZ = Ug, ft = po, EZ = lI, xZ = E
|
|
|
23859
23916
|
}, ry = Ho, dy = GI, Ay = oe, hy = vo, Gy = MZ, By = Ld, sl = Wo, my = sy, uy = Td, al = cy, by = TypeError, Mt = function(i, g) {
|
|
23860
23917
|
this.stopped = i, this.result = g;
|
|
23861
23918
|
}, ll = Mt.prototype, at = function(i, g, I) {
|
|
23862
|
-
var e = I && I.that, t = !!(I && I.AS_ENTRIES), o = !!(I && I.IS_RECORD), C = !!(I && I.IS_ITERATOR), n = !!(I && I.INTERRUPTED), s = ry(g, e), l, a, c,
|
|
23919
|
+
var e = I && I.that, t = !!(I && I.AS_ENTRIES), o = !!(I && I.IS_RECORD), C = !!(I && I.IS_ITERATOR), n = !!(I && I.INTERRUPTED), s = ry(g, e), l, a, c, G, u, m, B, p = function(Z) {
|
|
23863
23920
|
return l && al(l, "normal"), new Mt(!0, Z);
|
|
23864
23921
|
}, b = function(Z) {
|
|
23865
23922
|
return t ? (Ay(Z), n ? s(Z[0], Z[1], p) : s(Z[0], Z[1])) : n ? s(Z, p) : s(Z);
|
|
@@ -23871,15 +23928,15 @@ var ws = String(Qd) === "[object z]", TZ = ws, DZ = Ug, ft = po, EZ = lI, xZ = E
|
|
|
23871
23928
|
else {
|
|
23872
23929
|
if (a = uy(i), !a) throw new by(hy(i) + " is not iterable");
|
|
23873
23930
|
if (Gy(a)) {
|
|
23874
|
-
for (c = 0,
|
|
23931
|
+
for (c = 0, G = By(i); G > c; c++)
|
|
23875
23932
|
if (u = b(i[c]), u && sl(ll, u)) return u;
|
|
23876
23933
|
return new Mt(!1);
|
|
23877
23934
|
}
|
|
23878
23935
|
l = my(i, a);
|
|
23879
23936
|
}
|
|
23880
|
-
for (m = o ? i.next : l.next; !(
|
|
23937
|
+
for (m = o ? i.next : l.next; !(B = dy(m, l)).done; ) {
|
|
23881
23938
|
try {
|
|
23882
|
-
u = b(
|
|
23939
|
+
u = b(B.value);
|
|
23883
23940
|
} catch (Z) {
|
|
23884
23941
|
al(l, "throw", Z);
|
|
23885
23942
|
}
|
|
@@ -23906,7 +23963,7 @@ var lC = $e.prototype = Dd($t.prototype, {
|
|
|
23906
23963
|
Wy({ global: !0 }, {
|
|
23907
23964
|
AggregateError: $e
|
|
23908
23965
|
});
|
|
23909
|
-
var Fy = Hg, Jy =
|
|
23966
|
+
var Fy = Hg, Jy = Qg, cl = Fy.WeakMap, ky = Jy(cl) && /native code/.test(String(cl)), zy = ky, Ed = Hg, fy = WI, My = Ke, cC = fI, rC = Ws, Uy = Hs, Qy = Rs, rl = "Object already initialized", Cn = Ed.TypeError, Ty = Ed.WeakMap, go, Pi, Io, Dy = function(i) {
|
|
23910
23967
|
return Io(i) ? Pi(i) : go(i, {});
|
|
23911
23968
|
}, Ey = function(i) {
|
|
23912
23969
|
return function(g) {
|
|
@@ -23917,14 +23974,14 @@ var Fy = Hg, Jy = Ug, cl = Fy.WeakMap, ky = Jy(cl) && /native code/.test(String(
|
|
|
23917
23974
|
};
|
|
23918
23975
|
};
|
|
23919
23976
|
if (zy || rC.state) {
|
|
23920
|
-
var
|
|
23921
|
-
|
|
23922
|
-
if (
|
|
23923
|
-
return g.facade = i,
|
|
23977
|
+
var HI = rC.state || (rC.state = new Ty());
|
|
23978
|
+
HI.get = HI.get, HI.has = HI.has, HI.set = HI.set, go = function(i, g) {
|
|
23979
|
+
if (HI.has(i)) throw new Cn(rl);
|
|
23980
|
+
return g.facade = i, HI.set(i, g), g;
|
|
23924
23981
|
}, Pi = function(i) {
|
|
23925
|
-
return
|
|
23982
|
+
return HI.get(i) || {};
|
|
23926
23983
|
}, Io = function(i) {
|
|
23927
|
-
return
|
|
23984
|
+
return HI.has(i);
|
|
23928
23985
|
};
|
|
23929
23986
|
} else {
|
|
23930
23987
|
var Je = Uy("state");
|
|
@@ -23949,7 +24006,7 @@ var Ns = {
|
|
|
23949
24006
|
CONFIGURABLE: Oy
|
|
23950
24007
|
}, _y = Ke, Fs = function(i, g, I, e) {
|
|
23951
24008
|
return e && e.enumerable ? i[g] = I : _y(i, g, I), i;
|
|
23952
|
-
}, $y = aI, gS =
|
|
24009
|
+
}, $y = aI, gS = Qg, IS = WI, eS = Ys, dl = Vs, iS = Fs, tS = lI, sn = tS("iterator"), jd = !1, _I, dC, AC;
|
|
23953
24010
|
[].keys && (AC = [].keys(), "next" in AC ? (dC = dl(dl(AC)), dC !== Object.prototype && (_I = dC)) : jd = !0);
|
|
23954
24011
|
var oS = !IS(_I) || $y(function() {
|
|
23955
24012
|
var i = {};
|
|
@@ -23980,7 +24037,7 @@ var Zt = _d.BUGGY_SAFARI_ITERATORS, hC = HS("iterator"), Bl = "keys", yt = "valu
|
|
|
23980
24037
|
}, $d = function(i, g, I, e, t, o, C) {
|
|
23981
24038
|
SS(I, g, e);
|
|
23982
24039
|
var n = function(b) {
|
|
23983
|
-
if (b === t &&
|
|
24040
|
+
if (b === t && G) return G;
|
|
23984
24041
|
if (!Zt && b && b in a) return a[b];
|
|
23985
24042
|
switch (b) {
|
|
23986
24043
|
case Bl:
|
|
@@ -23999,18 +24056,18 @@ var Zt = _d.BUGGY_SAFARI_ITERATORS, hC = HS("iterator"), Bl = "keys", yt = "valu
|
|
|
23999
24056
|
return function() {
|
|
24000
24057
|
return new I(this);
|
|
24001
24058
|
};
|
|
24002
|
-
}, s = g + " Iterator", l = !1, a = i.prototype, c = a[hC] || a["@@iterator"] || t && a[t],
|
|
24003
|
-
if (u && (m = WS(u.call(new i())), m !== Object.prototype && m.next && (vS(m, s, !0, !0), Gl[s] = XS)), VS && t === yt && c && c.name !== yt && (l = !0,
|
|
24059
|
+
}, s = g + " Iterator", l = !1, a = i.prototype, c = a[hC] || a["@@iterator"] || t && a[t], G = !Zt && c || n(t), u = g === "Array" && a.entries || c, m, B, p;
|
|
24060
|
+
if (u && (m = WS(u.call(new i())), m !== Object.prototype && m.next && (vS(m, s, !0, !0), Gl[s] = XS)), VS && t === yt && c && c.name !== yt && (l = !0, G = function() {
|
|
24004
24061
|
return yS(c, this);
|
|
24005
24062
|
}), t)
|
|
24006
|
-
if (
|
|
24063
|
+
if (B = {
|
|
24007
24064
|
values: n(yt),
|
|
24008
|
-
keys: o ?
|
|
24065
|
+
keys: o ? G : n(Bl),
|
|
24009
24066
|
entries: n(ml)
|
|
24010
|
-
}, C) for (p in
|
|
24011
|
-
(Zt || l || !(p in a)) && hl(a, p,
|
|
24012
|
-
else ZS({ target: g, proto: !0, forced: Zt || l },
|
|
24013
|
-
return C && a[hC] !==
|
|
24067
|
+
}, C) for (p in B)
|
|
24068
|
+
(Zt || l || !(p in a)) && hl(a, p, B[p]);
|
|
24069
|
+
else ZS({ target: g, proto: !0, forced: Zt || l }, B);
|
|
24070
|
+
return C && a[hC] !== G && hl(a, hC, G, {}), Gl[g] = G, B;
|
|
24014
24071
|
}, gA = function(i, g) {
|
|
24015
24072
|
return { value: i, done: g };
|
|
24016
24073
|
}, RS = Ct, ul = ii, IA = Ns;
|
|
@@ -24056,11 +24113,11 @@ var Bi = Hg, LS = nt, NS = po, Wt = function(i) {
|
|
|
24056
24113
|
}, TS = Wo, DS = TypeError, ES = function(i, g) {
|
|
24057
24114
|
if (TS(g, i)) return i;
|
|
24058
24115
|
throw new DS("Incorrect invocation");
|
|
24059
|
-
}, xS = II, PS =
|
|
24116
|
+
}, xS = II, PS = Qg, an = Ws, jS = xS(Function.toString);
|
|
24060
24117
|
PS(an.inspectSource) || (an.inspectSource = function(i) {
|
|
24061
24118
|
return jS(i);
|
|
24062
24119
|
});
|
|
24063
|
-
var tA = an.inspectSource, OS = II, qS = aI, oA =
|
|
24120
|
+
var tA = an.inspectSource, OS = II, qS = aI, oA = Qg, _S = Vo, $S = he, gW = tA, CA = function() {
|
|
24064
24121
|
}, nA = $S("Reflect", "construct"), ks = /^\s*(?:class|function)\b/, IW = OS(ks.exec), eW = !ks.test(CA), mi = function(g) {
|
|
24065
24122
|
if (!oA(g)) return !1;
|
|
24066
24123
|
try {
|
|
@@ -24097,7 +24154,7 @@ var iW = !nA || qS(function() {
|
|
|
24097
24154
|
}, rW = II, lA = rW([].slice), dW = TypeError, AW = function(i, g) {
|
|
24098
24155
|
if (i < g) throw new dW("Not enough arguments");
|
|
24099
24156
|
return i;
|
|
24100
|
-
}, hW = nt, cA = /(?:ipad|iphone|ipod).*applewebkit/i.test(hW), nI = Hg, GW = Zs, BW = Ho, Zl =
|
|
24157
|
+
}, hW = nt, cA = /(?:ipad|iphone|ipod).*applewebkit/i.test(hW), nI = Hg, GW = Zs, BW = Ho, Zl = Qg, mW = fI, rA = aI, yl = kd, uW = lA, Sl = vs, bW = AW, pW = cA, ZW = Js, ln = nI.setImmediate, Wl = nI.clearImmediate, yW = nI.process, GC = nI.Dispatch, SW = nI.Function, vl = nI.MessageChannel, WW = nI.String, BC = 0, Yi = {}, Hl = "onreadystatechange", ji, be, mC, uC;
|
|
24101
24158
|
rA(function() {
|
|
24102
24159
|
ji = nI.location;
|
|
24103
24160
|
});
|
|
@@ -24190,7 +24247,7 @@ var kW = cn, zW = function(i, g) {
|
|
|
24190
24247
|
} catch (g) {
|
|
24191
24248
|
return { error: !0, value: g };
|
|
24192
24249
|
}
|
|
24193
|
-
}, fW = Hg, oi = fW.Promise, MW = Hg, wi = oi, UW =
|
|
24250
|
+
}, fW = Hg, oi = fW.Promise, MW = Hg, wi = oi, UW = Qg, QW = Kd, TW = tA, DW = lI, Fl = iA, WC = pd, Jl = wi && wi.prototype, EW = DW("species"), rn = !1, GA = UW(MW.PromiseRejectionEvent), xW = QW("Promise", function() {
|
|
24194
24251
|
var i = TW(wi), g = i !== String(wi);
|
|
24195
24252
|
if (!g && WC === 66 || !(Jl.catch && Jl.finally)) return !0;
|
|
24196
24253
|
if (!WC || WC < 51 || !/native code/.test(i)) {
|
|
@@ -24209,7 +24266,7 @@ var kW = cn, zW = function(i, g) {
|
|
|
24209
24266
|
CONSTRUCTOR: xW,
|
|
24210
24267
|
REJECTION_EVENT: GA,
|
|
24211
24268
|
SUBCLASSING: rn
|
|
24212
|
-
}, MI = {}, kl =
|
|
24269
|
+
}, MI = {}, kl = vI, PW = TypeError, jW = function(i) {
|
|
24213
24270
|
var g, I;
|
|
24214
24271
|
this.promise = new i(function(e, t) {
|
|
24215
24272
|
if (g !== void 0 || I !== void 0) throw new PW("Bad Promise constructor");
|
|
@@ -24219,7 +24276,7 @@ var kW = cn, zW = function(i, g) {
|
|
|
24219
24276
|
MI.f = function(i) {
|
|
24220
24277
|
return new jW(i);
|
|
24221
24278
|
};
|
|
24222
|
-
var OW = cI, eo = Js, Ae = Hg, qW = So, ct = GI, _W = Fs, $W = Xo, gv = QS, Iv =
|
|
24279
|
+
var OW = cI, eo = Js, Ae = Hg, qW = So, ct = GI, _W = Fs, $W = Xo, gv = QS, Iv = vI, dn = Qg, ev = WI, iv = ES, tv = aA, BA = dA.set, fs = kW, ov = zW, Cv = ti, nv = hA, mA = Ns, An = oi, Ms = lt, uA = MI, Ro = "Promise", bA = Ms.CONSTRUCTOR, sv = Ms.REJECTION_EVENT;
|
|
24223
24280
|
Ms.SUBCLASSING;
|
|
24224
24281
|
var vC = mA.getterFor(Ro), av = mA.set, lv = An && An.prototype, Qe = An, HC = lv, pA = Ae.TypeError, hn = Ae.document, Us = Ae.process, Gn = uA.f, cv = Gn, rv = !!(hn && hn.createEvent && Ae.dispatchEvent), ZA = "unhandledrejection", dv = "rejectionhandled", zl = 0, yA = 1, Av = 2, Qs = 1, SA = 2, Rt, fl, WA, vA = function(i) {
|
|
24225
24282
|
var g;
|
|
@@ -24360,15 +24417,15 @@ var uv = function(i, g) {
|
|
|
24360
24417
|
}, bv = oi, pv = uv, Zv = lt.CONSTRUCTOR, Ko = Zv || !pv(function(i) {
|
|
24361
24418
|
bv.all(i).then(void 0, function() {
|
|
24362
24419
|
});
|
|
24363
|
-
}), yv = cI, Sv = GI, Wv =
|
|
24420
|
+
}), yv = cI, Sv = GI, Wv = vI, vv = MI, Hv = ti, Vv = at, Xv = Ko;
|
|
24364
24421
|
yv({ target: "Promise", stat: !0, forced: Xv }, {
|
|
24365
24422
|
all: function(g) {
|
|
24366
24423
|
var I = this, e = vv.f(I), t = e.resolve, o = e.reject, C = Hv(function() {
|
|
24367
24424
|
var n = Wv(I.resolve), s = [], l = 0, a = 1;
|
|
24368
24425
|
Vv(g, function(c) {
|
|
24369
|
-
var
|
|
24426
|
+
var G = l++, u = !1;
|
|
24370
24427
|
a++, Sv(n, I, c).then(function(m) {
|
|
24371
|
-
u || (u = !0, s[
|
|
24428
|
+
u || (u = !0, s[G] = m, --a || t(s));
|
|
24372
24429
|
}, o);
|
|
24373
24430
|
}), --a || t(s);
|
|
24374
24431
|
});
|
|
@@ -24382,7 +24439,7 @@ Rv({ target: "Promise", proto: !0, forced: Kv, real: !0 }, {
|
|
|
24382
24439
|
return this.then(void 0, i);
|
|
24383
24440
|
}
|
|
24384
24441
|
});
|
|
24385
|
-
var Yv = cI, wv = GI, Lv =
|
|
24442
|
+
var Yv = cI, wv = GI, Lv = vI, Nv = MI, Fv = ti, Jv = at, kv = Ko;
|
|
24386
24443
|
Yv({ target: "Promise", stat: !0, forced: kv }, {
|
|
24387
24444
|
race: function(g) {
|
|
24388
24445
|
var I = this, e = Nv.f(I), t = e.reject, o = Fv(function() {
|
|
@@ -24401,7 +24458,7 @@ zv({ target: "Promise", stat: !0, forced: Mv }, {
|
|
|
24401
24458
|
return e(g), I.promise;
|
|
24402
24459
|
}
|
|
24403
24460
|
});
|
|
24404
|
-
var Uv = oe, Qv =
|
|
24461
|
+
var Uv = oe, Qv = WI, Tv = MI, YA = function(i, g) {
|
|
24405
24462
|
if (Uv(i), Qv(g) && g.constructor === i) return g;
|
|
24406
24463
|
var I = Tv.f(i), e = I.resolve;
|
|
24407
24464
|
return e(g), I.promise;
|
|
@@ -24411,41 +24468,41 @@ Dv({ target: "Promise", stat: !0, forced: xv }, {
|
|
|
24411
24468
|
return Ov(_v && this === qv ? Pv : this, g);
|
|
24412
24469
|
}
|
|
24413
24470
|
});
|
|
24414
|
-
var $v = cI, gH = GI, IH =
|
|
24471
|
+
var $v = cI, gH = GI, IH = vI, eH = MI, iH = ti, tH = at, oH = Ko;
|
|
24415
24472
|
$v({ target: "Promise", stat: !0, forced: oH }, {
|
|
24416
24473
|
allSettled: function(g) {
|
|
24417
24474
|
var I = this, e = eH.f(I), t = e.resolve, o = e.reject, C = iH(function() {
|
|
24418
24475
|
var n = IH(I.resolve), s = [], l = 0, a = 1;
|
|
24419
24476
|
tH(g, function(c) {
|
|
24420
|
-
var
|
|
24477
|
+
var G = l++, u = !1;
|
|
24421
24478
|
a++, gH(n, I, c).then(function(m) {
|
|
24422
|
-
u || (u = !0, s[
|
|
24479
|
+
u || (u = !0, s[G] = { status: "fulfilled", value: m }, --a || t(s));
|
|
24423
24480
|
}, function(m) {
|
|
24424
|
-
u || (u = !0, s[
|
|
24481
|
+
u || (u = !0, s[G] = { status: "rejected", reason: m }, --a || t(s));
|
|
24425
24482
|
});
|
|
24426
24483
|
}), --a || t(s);
|
|
24427
24484
|
});
|
|
24428
24485
|
return C.error && o(C.value), e.promise;
|
|
24429
24486
|
}
|
|
24430
24487
|
});
|
|
24431
|
-
var CH = cI, nH = GI, sH =
|
|
24488
|
+
var CH = cI, nH = GI, sH = vI, aH = he, lH = MI, cH = ti, rH = at, dH = Ko, Tl = "No one promise resolved";
|
|
24432
24489
|
CH({ target: "Promise", stat: !0, forced: dH }, {
|
|
24433
24490
|
any: function(g) {
|
|
24434
24491
|
var I = this, e = aH("AggregateError"), t = lH.f(I), o = t.resolve, C = t.reject, n = cH(function() {
|
|
24435
|
-
var s = sH(I.resolve), l = [], a = 0, c = 1,
|
|
24492
|
+
var s = sH(I.resolve), l = [], a = 0, c = 1, G = !1;
|
|
24436
24493
|
rH(g, function(u) {
|
|
24437
|
-
var m = a++,
|
|
24494
|
+
var m = a++, B = !1;
|
|
24438
24495
|
c++, nH(s, I, u).then(function(p) {
|
|
24439
|
-
|
|
24496
|
+
B || G || (G = !0, o(p));
|
|
24440
24497
|
}, function(p) {
|
|
24441
|
-
|
|
24498
|
+
B || G || (B = !0, l[m] = p, --c || C(new e(l, Tl)));
|
|
24442
24499
|
});
|
|
24443
24500
|
}), --c || C(new e(l, Tl));
|
|
24444
24501
|
});
|
|
24445
24502
|
return n.error && C(n.value), t.promise;
|
|
24446
24503
|
}
|
|
24447
24504
|
});
|
|
24448
|
-
var AH = cI, hH = Hg, GH = Zs, BH = lA, mH = MI, uH =
|
|
24505
|
+
var AH = cI, hH = Hg, GH = Zs, BH = lA, mH = MI, uH = vI, wA = ti, VC = hH.Promise, Dl = !1, bH = !VC || !VC.try || wA(function() {
|
|
24449
24506
|
VC.try(function(i) {
|
|
24450
24507
|
Dl = i === 8;
|
|
24451
24508
|
}, 8);
|
|
@@ -24469,7 +24526,7 @@ pH({ target: "Promise", stat: !0 }, {
|
|
|
24469
24526
|
};
|
|
24470
24527
|
}
|
|
24471
24528
|
});
|
|
24472
|
-
var yH = cI, mn = oi, SH = aI, WH = he, vH =
|
|
24529
|
+
var yH = cI, mn = oi, SH = aI, WH = he, vH = Qg, HH = aA, El = YA, VH = mn && mn.prototype, XH = !!mn && SH(function() {
|
|
24473
24530
|
VH.finally.call({ then: function() {
|
|
24474
24531
|
} }, function() {
|
|
24475
24532
|
});
|
|
@@ -24565,7 +24622,7 @@ var gV = $H;
|
|
|
24565
24622
|
function o(K) {
|
|
24566
24623
|
return K && K.__esModule ? K.default : K;
|
|
24567
24624
|
}
|
|
24568
|
-
e(i.exports), t(i.exports, "default", () => Pg), t(i.exports, "createSpeechRecognitionPonyfill", () => gg), t(i.exports, "createSpeechSynthesisPonyfill", () => Ig), t(i.exports, "fetchAuthorizationToken", () => Ce), t(i.exports, "SpeechSynthesisUtterance", () => ig), t(i.exports, "SpeechSynthesis", () => eI), t(i.exports, "SpeechGrammarList", () =>
|
|
24625
|
+
e(i.exports), t(i.exports, "default", () => Pg), t(i.exports, "createSpeechRecognitionPonyfill", () => gg), t(i.exports, "createSpeechSynthesisPonyfill", () => Ig), t(i.exports, "fetchAuthorizationToken", () => Ce), t(i.exports, "SpeechSynthesisUtterance", () => ig), t(i.exports, "SpeechSynthesis", () => eI), t(i.exports, "SpeechGrammarList", () => B);
|
|
24569
24626
|
function C(K, y) {
|
|
24570
24627
|
const S = {
|
|
24571
24628
|
// @ts-ignore
|
|
@@ -24595,9 +24652,9 @@ var gV = $H;
|
|
|
24595
24652
|
];
|
|
24596
24653
|
return K.reason === l && (v.isFinal = !0), v;
|
|
24597
24654
|
} else if (K.reason === l)
|
|
24598
|
-
return C((K.json.NBest || []).slice(0, y).map(({ Confidence: W, Display: z, ITN: j, Lexical:
|
|
24655
|
+
return C((K.json.NBest || []).slice(0, y).map(({ Confidence: W, Display: z, ITN: j, Lexical: D, MaskedITN: Xg }) => ({
|
|
24599
24656
|
confidence: W,
|
|
24600
|
-
transcript: S === "itn" ? j : S === "lexical" ?
|
|
24657
|
+
transcript: S === "itn" ? j : S === "lexical" ? D : S === "maskeditn" ? Xg : z
|
|
24601
24658
|
})), {
|
|
24602
24659
|
isFinal: !0
|
|
24603
24660
|
});
|
|
@@ -24616,7 +24673,7 @@ var gV = $H;
|
|
|
24616
24673
|
shift: () => y.length ? Promise.resolve(y.shift()) : (K || (K = o(I)())).promise
|
|
24617
24674
|
};
|
|
24618
24675
|
}
|
|
24619
|
-
function
|
|
24676
|
+
function G(K) {
|
|
24620
24677
|
return typeof K == "function" ? K() : K;
|
|
24621
24678
|
}
|
|
24622
24679
|
let u = !0;
|
|
@@ -24625,10 +24682,10 @@ var gV = $H;
|
|
|
24625
24682
|
return {
|
|
24626
24683
|
...S,
|
|
24627
24684
|
fetchCredentials: async () => {
|
|
24628
|
-
const { authorizationToken: v, customVoiceHostname: W, region: z, speechRecognitionHostname: j, speechSynthesisHostname:
|
|
24685
|
+
const { authorizationToken: v, customVoiceHostname: W, region: z, speechRecognitionHostname: j, speechSynthesisHostname: D, subscriptionKey: Xg } = await G(K);
|
|
24629
24686
|
if (!v && !Xg || v && Xg) throw new Error('web-speech-cognitive-services: Either "authorizationToken" or "subscriptionKey" must be provided.');
|
|
24630
|
-
if (!z && !(j &&
|
|
24631
|
-
if (z && (W || j ||
|
|
24687
|
+
if (!z && !(j && D)) throw new Error('web-speech-cognitive-services: Either "region" or "speechRecognitionHostname" and "speechSynthesisHostname" must be set.');
|
|
24688
|
+
if (z && (W || j || D)) throw new Error('web-speech-cognitive-services: Only either "region" or "customVoiceHostname", "speechRecognitionHostname" and "speechSynthesisHostname" can be set.');
|
|
24632
24689
|
if (v) {
|
|
24633
24690
|
if (typeof v != "string") throw new Error('web-speech-cognitive-services: "authorizationToken" must be a string.');
|
|
24634
24691
|
} else if (typeof Xg != "string") throw new Error('web-speech-cognitive-services: "subscriptionKey" must be a string.');
|
|
@@ -24638,13 +24695,13 @@ var gV = $H;
|
|
|
24638
24695
|
subscriptionKey: Xg,
|
|
24639
24696
|
customVoiceHostname: W,
|
|
24640
24697
|
speechRecognitionHostname: j,
|
|
24641
|
-
speechSynthesisHostname:
|
|
24698
|
+
speechSynthesisHostname: D
|
|
24642
24699
|
};
|
|
24643
24700
|
},
|
|
24644
24701
|
looseEvents: y
|
|
24645
24702
|
};
|
|
24646
24703
|
}
|
|
24647
|
-
class
|
|
24704
|
+
class B {
|
|
24648
24705
|
addFromString() {
|
|
24649
24706
|
throw new Error("JSGF is not supported");
|
|
24650
24707
|
}
|
|
@@ -24662,7 +24719,7 @@ var gV = $H;
|
|
|
24662
24719
|
this._phrases = [];
|
|
24663
24720
|
}
|
|
24664
24721
|
}
|
|
24665
|
-
function p({ duration: K, errorDetails: y, json: S, offset: v, properties: W, reason: z, resultId: j, text:
|
|
24722
|
+
function p({ duration: K, errorDetails: y, json: S, offset: v, properties: W, reason: z, resultId: j, text: D }) {
|
|
24666
24723
|
return {
|
|
24667
24724
|
duration: K,
|
|
24668
24725
|
errorDetails: y,
|
|
@@ -24671,7 +24728,7 @@ var gV = $H;
|
|
|
24671
24728
|
properties: W,
|
|
24672
24729
|
reason: z,
|
|
24673
24730
|
resultId: j,
|
|
24674
|
-
text:
|
|
24731
|
+
text: D
|
|
24675
24732
|
};
|
|
24676
24733
|
}
|
|
24677
24734
|
function b(K) {
|
|
@@ -24711,7 +24768,7 @@ var gV = $H;
|
|
|
24711
24768
|
}
|
|
24712
24769
|
class R {
|
|
24713
24770
|
constructor(y, S) {
|
|
24714
|
-
this.audioConfig = null, this.speechConfig = null, this.recognizer = null, this.enableTelemetry = !0, this.looseEvents = !1, this.textNormalization = "display", this.started = !1, this._autoStart = !1, this._passive = !1, this._continuous = !1, this._interimResults = !0, this._grammars = new
|
|
24771
|
+
this.audioConfig = null, this.speechConfig = null, this.recognizer = null, this.enableTelemetry = !0, this.looseEvents = !1, this.textNormalization = "display", this.started = !1, this._autoStart = !1, this._passive = !1, this._continuous = !1, this._interimResults = !0, this._grammars = new B(), this._maxAlternatives = 1, this._debug = !1, this.onstart = () => {
|
|
24715
24772
|
}, this.onend = () => {
|
|
24716
24773
|
}, this.onpassivestart = () => {
|
|
24717
24774
|
}, this.onpassiveend = () => {
|
|
@@ -24736,13 +24793,13 @@ var gV = $H;
|
|
|
24736
24793
|
new Error(`error : ${L.message}
|
|
24737
24794
|
callstack : ${L.stack}`);
|
|
24738
24795
|
});
|
|
24739
|
-
}, this.abort = void 0, this.stop = void 0, this.initRecognizer = async (L, Bg,
|
|
24796
|
+
}, this.abort = void 0, this.stop = void 0, this.initRecognizer = async (L, Bg, lg) => {
|
|
24740
24797
|
const { authorizationToken: cg, region: jg = "westus", speechRecognitionHostname: iI, subscriptionKey: ne } = await L();
|
|
24741
24798
|
if (iI) {
|
|
24742
24799
|
const Ci = iI.startsWith("ws://") || iI.startsWith("wss://") ? iI : `wss://${iI}`;
|
|
24743
24800
|
cg ? (this.speechConfig = g.SpeechConfig.fromHost(new URL(Ci)), this.speechConfig.authorizationToken = cg) : this.speechConfig = g.SpeechConfig.fromHost(new URL(Ci), ne);
|
|
24744
24801
|
} else jg && (cg || ne) && (this.speechConfig = cg ? g.SpeechConfig.fromAuthorizationToken(cg, jg) : ne ? g.SpeechConfig.fromSubscription(ne, jg) : null);
|
|
24745
|
-
this.speechConfig && (Bg && this.speechConfig && (this.speechConfig.endpointId = Bg), this.speechConfig.outputFormat = g.OutputFormat.Detailed, this.speechConfig.speechRecognitionLanguage = this._lang || "en-US",
|
|
24802
|
+
this.speechConfig && (Bg && this.speechConfig && (this.speechConfig.endpointId = Bg), this.speechConfig.outputFormat = g.OutputFormat.Detailed, this.speechConfig.speechRecognitionLanguage = this._lang || "en-US", lg && this.speechConfig.setProperty(g.PropertyId[g.PropertyId.Speech_SegmentationSilenceTimeoutMs], `${lg}`), this._autoStart && this.start());
|
|
24746
24803
|
}, this.createRecognizer = async () => {
|
|
24747
24804
|
if (this.audioConfig && this.speechConfig) {
|
|
24748
24805
|
this.speechConfig.speechRecognitionLanguage = this._lang, this.recognizer = new g.SpeechRecognizer(this.speechConfig, this.audioConfig);
|
|
@@ -24750,9 +24807,9 @@ callstack : ${L.stack}`);
|
|
|
24750
24807
|
this.referenceGrammars && this.referenceGrammars.length && L.addReferenceGrammar(this.referenceGrammars);
|
|
24751
24808
|
const { phrases: Bg } = this._grammars;
|
|
24752
24809
|
if (Bg && Bg.length) {
|
|
24753
|
-
const
|
|
24810
|
+
const lg = g.PhraseListGrammar.fromRecognizer(this.recognizer);
|
|
24754
24811
|
Bg.forEach((cg) => {
|
|
24755
|
-
|
|
24812
|
+
lg.addPhrase(cg);
|
|
24756
24813
|
});
|
|
24757
24814
|
}
|
|
24758
24815
|
} else this.recognizer = null;
|
|
@@ -24806,8 +24863,8 @@ callstack : ${L.stack}`);
|
|
|
24806
24863
|
break;
|
|
24807
24864
|
}
|
|
24808
24865
|
}, this._autoStart = !!(S != null && S.autoStart), this._passive = !!(S != null && S.passive), this._wakeWords = (S == null ? void 0 : S.wakeWords) || [], this._continuous = !!(S != null && S.continuous), this._interimResults = (S == null ? void 0 : S.interimResults) !== !1, this._lang = S != null && S.lang ? S.lang : typeof window < "u" ? window.document.documentElement.getAttribute("lang") || window.navigator.language : "en-US", S != null && S.grammarsList && (this._grammars.phrases = S.grammarsList), this._debug = !!(S != null && S.debug) || !1;
|
|
24809
|
-
const { audioConfig: v = null, enableTelemetry: W = !0, fetchCredentials: z, looseEvents: j, referenceGrammars:
|
|
24810
|
-
if (this.enableTelemetry = W, this.looseEvents = !!j, this.referenceGrammars =
|
|
24866
|
+
const { audioConfig: v = null, enableTelemetry: W = !0, fetchCredentials: z, looseEvents: j, referenceGrammars: D, speechRecognitionEndpointId: Xg, textNormalization: eg = "display" } = m(y);
|
|
24867
|
+
if (this.enableTelemetry = W, this.looseEvents = !!j, this.referenceGrammars = D, this.textNormalization = eg, !v && (!window.navigator.mediaDevices || !window.navigator.mediaDevices.getUserMedia)) console.warn("web-speech-cognitive-services: This browser does not support WebRTC and it will not work with Cognitive Services Speech Services.");
|
|
24811
24868
|
else try {
|
|
24812
24869
|
this.audioConfig = v || g.AudioConfig.fromDefaultMicrophoneInput(), this.initRecognizer(z, Xg, S == null ? void 0 : S.timerBeforeSpeechEnd);
|
|
24813
24870
|
} catch (L) {
|
|
@@ -24836,7 +24893,7 @@ callstack : ${L.stack}`);
|
|
|
24836
24893
|
return this._grammars;
|
|
24837
24894
|
}
|
|
24838
24895
|
set grammars(y) {
|
|
24839
|
-
if (y instanceof
|
|
24896
|
+
if (y instanceof B) this._grammars = y;
|
|
24840
24897
|
else throw new Error("The provided value is not of type 'SpeechGrammarList'");
|
|
24841
24898
|
}
|
|
24842
24899
|
get interimResults() {
|
|
@@ -24861,7 +24918,7 @@ callstack : ${L.stack}`);
|
|
|
24861
24918
|
var y;
|
|
24862
24919
|
if (this.audioConfig && !this.started) {
|
|
24863
24920
|
const { pause: S, unprepare: v } = H(this.audioConfig), W = c();
|
|
24864
|
-
let z = !1, j = !1,
|
|
24921
|
+
let z = !1, j = !1, D = "";
|
|
24865
24922
|
const { detach: Xg } = this.audioConfig.events.attach((eg) => {
|
|
24866
24923
|
const { name: L } = eg;
|
|
24867
24924
|
L === "AudioSourceReadyEvent" ? W.push({
|
|
@@ -24873,7 +24930,7 @@ callstack : ${L.stack}`);
|
|
|
24873
24930
|
});
|
|
24874
24931
|
});
|
|
24875
24932
|
if (await this.createRecognizer(), this.recognizer) try {
|
|
24876
|
-
this.recognizer.canceled = (
|
|
24933
|
+
this.recognizer.canceled = (lg, { errorDetails: cg, offset: jg, reason: iI, sessionId: ne }) => {
|
|
24877
24934
|
W.push({
|
|
24878
24935
|
canceled: {
|
|
24879
24936
|
errorDetails: cg,
|
|
@@ -24882,7 +24939,7 @@ callstack : ${L.stack}`);
|
|
|
24882
24939
|
sessionId: ne
|
|
24883
24940
|
}
|
|
24884
24941
|
});
|
|
24885
|
-
}, this.recognizer.recognized = (
|
|
24942
|
+
}, this.recognizer.recognized = (lg, { offset: cg, result: jg, sessionId: iI }) => {
|
|
24886
24943
|
W.push({
|
|
24887
24944
|
recognized: {
|
|
24888
24945
|
offset: cg,
|
|
@@ -24890,7 +24947,7 @@ callstack : ${L.stack}`);
|
|
|
24890
24947
|
sessionId: iI
|
|
24891
24948
|
}
|
|
24892
24949
|
});
|
|
24893
|
-
}, this.recognizer.recognizing = (
|
|
24950
|
+
}, this.recognizer.recognizing = (lg, { offset: cg, result: jg, sessionId: iI }) => {
|
|
24894
24951
|
W.push({
|
|
24895
24952
|
recognizing: {
|
|
24896
24953
|
offset: cg,
|
|
@@ -24898,26 +24955,26 @@ callstack : ${L.stack}`);
|
|
|
24898
24955
|
sessionId: iI
|
|
24899
24956
|
}
|
|
24900
24957
|
});
|
|
24901
|
-
}, this.recognizer.sessionStarted = (
|
|
24958
|
+
}, this.recognizer.sessionStarted = (lg, { sessionId: cg }) => {
|
|
24902
24959
|
W.push({
|
|
24903
24960
|
sessionStarted: {
|
|
24904
24961
|
sessionId: cg
|
|
24905
24962
|
}
|
|
24906
24963
|
});
|
|
24907
|
-
}, this.recognizer.sessionStopped = (
|
|
24964
|
+
}, this.recognizer.sessionStopped = (lg, { sessionId: cg }) => {
|
|
24908
24965
|
W.push({
|
|
24909
24966
|
sessionStopped: {
|
|
24910
24967
|
sessionId: cg
|
|
24911
24968
|
}
|
|
24912
24969
|
});
|
|
24913
|
-
}, this.recognizer.speechStartDetected = (
|
|
24970
|
+
}, this.recognizer.speechStartDetected = (lg, { offset: cg, sessionId: jg }) => {
|
|
24914
24971
|
W.push({
|
|
24915
24972
|
speechStartDetected: {
|
|
24916
24973
|
offset: cg,
|
|
24917
24974
|
sessionId: jg
|
|
24918
24975
|
}
|
|
24919
24976
|
});
|
|
24920
|
-
}, this.recognizer.speechEndDetected = (
|
|
24977
|
+
}, this.recognizer.speechEndDetected = (lg, { sessionId: cg }) => {
|
|
24921
24978
|
W.push({
|
|
24922
24979
|
speechEndDetected: {
|
|
24923
24980
|
sessionId: cg
|
|
@@ -24929,7 +24986,7 @@ callstack : ${L.stack}`);
|
|
|
24929
24986
|
stop: {}
|
|
24930
24987
|
});
|
|
24931
24988
|
let eg = !1, L = null, Bg = [];
|
|
24932
|
-
for (let
|
|
24989
|
+
for (let lg = 0; !D || eg; lg++) {
|
|
24933
24990
|
const cg = await W.shift(), { abort: jg, audioSourceOff: iI, audioSourceReady: ne, canceled: Ci, firstAudibleChunk: FA, recognized: Ye, recognizing: Yo, stop: JA } = cg, wo = Ci && Ci.errorDetails;
|
|
24934
24991
|
if (/Permission\sdenied/u.test(wo || "")) {
|
|
24935
24992
|
L = {
|
|
@@ -24938,7 +24995,7 @@ callstack : ${L.stack}`);
|
|
|
24938
24995
|
};
|
|
24939
24996
|
break;
|
|
24940
24997
|
}
|
|
24941
|
-
if (
|
|
24998
|
+
if (lg || this.processSendEvent("start"), wo) {
|
|
24942
24999
|
/1006/u.test(wo) ? (eg || (this.processSendEvent("audiostart"), this.processSendEvent("audioend")), L = {
|
|
24943
25000
|
data: "network",
|
|
24944
25001
|
type: "error"
|
|
@@ -24950,7 +25007,7 @@ callstack : ${L.stack}`);
|
|
|
24950
25007
|
} else if (jg || JA)
|
|
24951
25008
|
jg ? (L = {
|
|
24952
25009
|
type: "abort"
|
|
24953
|
-
},
|
|
25010
|
+
}, D = "abort") : (S(), D = "stop"), jg && this.recognizer.stopContinuousRecognitionAsync && await Z(this.recognizer.stopContinuousRecognitionAsync.bind(this.recognizer))();
|
|
24954
25011
|
else if (ne)
|
|
24955
25012
|
this.processSendEvent("audiostart"), eg = !0;
|
|
24956
25013
|
else if (FA)
|
|
@@ -24958,7 +25015,7 @@ callstack : ${L.stack}`);
|
|
|
24958
25015
|
else if (iI) {
|
|
24959
25016
|
j && this.processSendEvent("speechend"), z && this.processSendEvent("soundend"), eg && this.processSendEvent("audioend"), eg = z = j = !1;
|
|
24960
25017
|
break;
|
|
24961
|
-
} else if (
|
|
25018
|
+
} else if (D !== "abort") {
|
|
24962
25019
|
if (Ye && Ye.result && Ye.result.reason === g.ResultReason.NoMatch) L = {
|
|
24963
25020
|
data: "no-speech",
|
|
24964
25021
|
type: "error"
|
|
@@ -25024,7 +25081,7 @@ callstack : ${L.stack}`);
|
|
|
25024
25081
|
}
|
|
25025
25082
|
const gg = (K, y) => ({
|
|
25026
25083
|
speechRecognition: new R(K, y),
|
|
25027
|
-
SpeechGrammarList:
|
|
25084
|
+
SpeechGrammarList: B
|
|
25028
25085
|
});
|
|
25029
25086
|
class q extends EventTarget {
|
|
25030
25087
|
constructor(y) {
|
|
@@ -25133,7 +25190,7 @@ callstack : ${L.stack}`);
|
|
|
25133
25190
|
const { speechSynthesisHostname: v, subscriptionKey: W, authorizationToken: z, region: j } = await y();
|
|
25134
25191
|
if (!z && !W) throw new Error("no subscription data : authorizationToken or subscriptionKey needed");
|
|
25135
25192
|
if (S) {
|
|
25136
|
-
const
|
|
25193
|
+
const D = v || `${j}.customvoice.api.speech.microsoft.com`, Xg = `https://${encodeURI(D)}/api/texttospeech/v2.0/endpoints/${encodeURIComponent(S)}`;
|
|
25137
25194
|
this.speechConfig = g.SpeechConfig.fromEndpoint(new URL(Xg), W);
|
|
25138
25195
|
} else v ? this.speechConfig = g.SpeechConfig.fromHost(v, W) : this.speechConfig = z ? g.SpeechConfig.fromAuthorizationToken(z, j) : g.SpeechConfig.fromSubscription(W, j);
|
|
25139
25196
|
this.synth = new g.SpeechSynthesizer(this.speechConfig, this.audioConfig), this.updateVoices();
|
|
@@ -25223,16 +25280,16 @@ callstack : ${L.stack}`);
|
|
|
25223
25280
|
}, this.speakerAudioDestination.onAudioEnd = () => {
|
|
25224
25281
|
this.speaking = !1, W.onend && W.onend(), v();
|
|
25225
25282
|
}, this.linkEventsCallbacks(W), z ? new Promise((j) => {
|
|
25226
|
-
this.synth && this.synth.speakSsmlAsync(W.text, (
|
|
25227
|
-
|
|
25228
|
-
}, (
|
|
25229
|
-
j(new Error(`Synthesis failed : ${
|
|
25283
|
+
this.synth && this.synth.speakSsmlAsync(W.text, (D) => {
|
|
25284
|
+
D ? this.synth && this.synth.close() : j(new Error("No synthesis result."));
|
|
25285
|
+
}, (D) => {
|
|
25286
|
+
j(new Error(`Synthesis failed : ${D}`));
|
|
25230
25287
|
});
|
|
25231
25288
|
}) : new Promise((j) => {
|
|
25232
|
-
this.synth && this.synth.speakTextAsync(W.text, (
|
|
25233
|
-
|
|
25234
|
-
}, (
|
|
25235
|
-
j(new Error(`Synthesis failed : ${
|
|
25289
|
+
this.synth && this.synth.speakTextAsync(W.text, (D) => {
|
|
25290
|
+
D ? this.synth && this.synth.close() : j(new Error("No synthesis result."));
|
|
25291
|
+
}, (D) => {
|
|
25292
|
+
j(new Error(`Synthesis failed : ${D}`));
|
|
25236
25293
|
});
|
|
25237
25294
|
});
|
|
25238
25295
|
}
|
|
@@ -25310,7 +25367,7 @@ callstack : ${L.stack}`);
|
|
|
25310
25367
|
})(Wr);
|
|
25311
25368
|
var Ol = Wr.exports;
|
|
25312
25369
|
const IV = () => {
|
|
25313
|
-
const i =
|
|
25370
|
+
const i = sg((m) => m.animationsLoaded), g = sg((m) => m.characterState), I = sg((m) => m.lipSyncManager), e = Sg((m) => m.credentials), t = Sg((m) => m.currentUtterance), o = Sg((m) => m.textToSpeak), C = Sg((m) => m.visemes), n = Sg((m) => m.visemeIntensity), s = Sg((m) => m.currentVisemeIndex), [l, a] = Dg(!1), [c, G] = Dg(!1), u = ql(() => e != null && e.region && (e.subscriptionKey || e.token) ? Ol.createSpeechSynthesisPonyfill({
|
|
25314
25371
|
credentials: {
|
|
25315
25372
|
region: e.region,
|
|
25316
25373
|
authorizationToken: e.token,
|
|
@@ -25325,14 +25382,14 @@ const IV = () => {
|
|
|
25325
25382
|
};
|
|
25326
25383
|
}
|
|
25327
25384
|
}, [u]), ug(() => {
|
|
25328
|
-
l && I && i &&
|
|
25385
|
+
l && I && i && G(!0);
|
|
25329
25386
|
}, [l, I, i]), ug(() => {
|
|
25330
25387
|
if (o) {
|
|
25331
25388
|
const m = new Ol.SpeechSynthesisUtterance(o);
|
|
25332
25389
|
EB(m);
|
|
25333
25390
|
}
|
|
25334
25391
|
}, [o]), ug(() => {
|
|
25335
|
-
var m,
|
|
25392
|
+
var m, B;
|
|
25336
25393
|
t && c ? (t.onstart = () => {
|
|
25337
25394
|
console.log("Start"), Ca(yg.speaking);
|
|
25338
25395
|
}, t.onend = () => {
|
|
@@ -25340,25 +25397,25 @@ const IV = () => {
|
|
|
25340
25397
|
}, t.onboundary = () => {
|
|
25341
25398
|
}, t.onviseme = (p) => {
|
|
25342
25399
|
Sr(p);
|
|
25343
|
-
}, (m = u == null ? void 0 : u.speechSynthesis) == null || m.speak(t, null)) : (
|
|
25400
|
+
}, (m = u == null ? void 0 : u.speechSynthesis) == null || m.speak(t, null)) : (B = u == null ? void 0 : u.speechSynthesis) == null || B.cancel();
|
|
25344
25401
|
}, [t]), ug(() => {
|
|
25345
25402
|
I && (I.visemeIntensity = n);
|
|
25346
25403
|
}, [n]), ug(() => {
|
|
25347
25404
|
if (C.length && I && g === yg.speaking) {
|
|
25348
25405
|
if (!I.isStarted && I.start(), C.length > 1 && s === 0)
|
|
25349
25406
|
C.forEach((m) => {
|
|
25350
|
-
const
|
|
25351
|
-
if (!isNaN(
|
|
25352
|
-
const p = aa.get(
|
|
25407
|
+
const B = parseInt(m.name);
|
|
25408
|
+
if (!isNaN(B)) {
|
|
25409
|
+
const p = aa.get(B);
|
|
25353
25410
|
p && I.PlayVisemeAsync(p, m.elapsedTime / 1e4);
|
|
25354
25411
|
}
|
|
25355
25412
|
});
|
|
25356
25413
|
else
|
|
25357
25414
|
for (let m = s + 1; m < C.length; m++) {
|
|
25358
|
-
const
|
|
25415
|
+
const B = C[m], p = parseInt(B.name);
|
|
25359
25416
|
if (!isNaN(p)) {
|
|
25360
25417
|
const b = aa.get(p);
|
|
25361
|
-
b && I.PlayVisemeAsync(b,
|
|
25418
|
+
b && I.PlayVisemeAsync(b, B.elapsedTime / 1e4);
|
|
25362
25419
|
}
|
|
25363
25420
|
}
|
|
25364
25421
|
xB(C.length - 1);
|
|
@@ -25367,12 +25424,12 @@ const IV = () => {
|
|
|
25367
25424
|
g !== yg.speaking && PB();
|
|
25368
25425
|
}, [g]), null;
|
|
25369
25426
|
}, eV = ({ parentGpuTier: i, setIsGpuAvailable: g, children: I, tonemapping: e }) => {
|
|
25370
|
-
const t =
|
|
25427
|
+
const t = Ug((R) => R.cameraPosition), o = Ug((R) => R.lookAt), C = Ug((R) => R.movable), [n] = Dg(i || EA()), [s, l] = Dg(), [a, c] = Dg(null), [G, u] = Dg(void 0), m = Kt(), B = Kt(), p = Kt(), b = (R) => {
|
|
25371
25428
|
R.preventDefault(), R.stopPropagation();
|
|
25372
25429
|
};
|
|
25373
25430
|
ug(() => {
|
|
25374
|
-
HB(
|
|
25375
|
-
}, [
|
|
25431
|
+
HB(B.current);
|
|
25432
|
+
}, [B.current]), ug(() => {
|
|
25376
25433
|
var R, gg, q, ig;
|
|
25377
25434
|
if (C)
|
|
25378
25435
|
a == null || a.abort(), c(null);
|
|
@@ -25430,8 +25487,8 @@ const IV = () => {
|
|
|
25430
25487
|
break;
|
|
25431
25488
|
}
|
|
25432
25489
|
}, [s]);
|
|
25433
|
-
const [Z] =
|
|
25434
|
-
if (Z && s !== "low" &&
|
|
25490
|
+
const [Z] = Dg(new d.Scene()), H = ql(() => {
|
|
25491
|
+
if (Z && s !== "low" && B.current && m.current) {
|
|
25435
25492
|
const R = {
|
|
25436
25493
|
antialias: s !== "medium",
|
|
25437
25494
|
powerPreference: "high-performance",
|
|
@@ -25439,20 +25496,20 @@ const IV = () => {
|
|
|
25439
25496
|
colorBufferType: s === "medium" ? d.UnsignedByteType : d.HalfFloatType
|
|
25440
25497
|
}, gg = new MA(R);
|
|
25441
25498
|
return gg.setClearColor(new d.Color("#000000"), 0), gg.setPixelRatio(devicePixelRatio), gg.shadowMap.type = d.PCFSoftShadowMap, gg.setAnimationLoop(() => {
|
|
25442
|
-
gg.render(Z,
|
|
25499
|
+
gg.render(Z, B.current);
|
|
25443
25500
|
}), gg;
|
|
25444
25501
|
}
|
|
25445
|
-
}, [Z, s,
|
|
25446
|
-
return
|
|
25502
|
+
}, [Z, s, B.current, m.current]);
|
|
25503
|
+
return G ? /* @__PURE__ */ tg.createElement(qA, { gl: H, dpr: G, ref: m, shadows: !0, scene: Z }, /* @__PURE__ */ tg.createElement(iV, { renderer: H, tonemapping: e, processedTier: s, scene: Z }), /* @__PURE__ */ tg.createElement(xA, null), /* @__PURE__ */ tg.createElement(IV, null), /* @__PURE__ */ tg.createElement(PA, { ref: B, makeDefault: !0, fov: 28 }), /* @__PURE__ */ tg.createElement(jA, { ref: p }), /* @__PURE__ */ tg.createElement(zA, { fallback: null }, I)) : /* @__PURE__ */ tg.createElement(tg.Fragment, null);
|
|
25447
25504
|
}, iV = ({ renderer: i, tonemapping: g, processedTier: I, scene: e }) => {
|
|
25448
|
-
const { gl: t } = _A(), [o] =
|
|
25505
|
+
const { gl: t } = _A(), [o] = Dg(new d.Vector3(-3, 2, 2)), [C] = Dg(new d.Vector3(0, 1, 0)), [n] = Dg(2), [s] = Dg(-1e-3), [l] = Dg(0.6), a = Kt();
|
|
25449
25506
|
return ug(() => {
|
|
25450
25507
|
!t || !i || (t.shadowMap.type = d.PCFSoftShadowMap, t.toneMapping = g, I !== "low" ? e.environmentIntensity = l : e.environmentIntensity = 1);
|
|
25451
25508
|
}, [t, i, g]), ug(() => {
|
|
25452
25509
|
e.environmentIntensity = l;
|
|
25453
25510
|
}, [l]), /* @__PURE__ */ tg.createElement(tg.Fragment, null, I !== "low" && t && /* @__PURE__ */ tg.createElement(tg.Fragment, null, /* @__PURE__ */ tg.createElement("directionalLight", { ref: a, color: "white", position: o.toArray(), "target-position": C.toArray(), intensity: n, castShadow: !0, "shadow-mapSize-width": 1024, "shadow-mapSize-height": 1024, "shadow-bias": s }, /* @__PURE__ */ tg.createElement("orthographicCamera", { attach: "shadow-camera", args: [-1, 1, 2, -0.5, 2, 8] }))));
|
|
25454
25511
|
}, tV = ({ character: i, autoLookAt: g }) => {
|
|
25455
|
-
const I =
|
|
25512
|
+
const I = sg((l) => l.characterState), e = pI((l) => l.currentAUs), t = pI((l) => l.currentGaze), o = pI((l) => l.currentHeadPose), C = pI((l) => l.lookAtCamera), n = Ug((l) => l.cameraPosition), s = pI((l) => l.targets);
|
|
25456
25513
|
return $A((l, a) => {
|
|
25457
25514
|
const c = {
|
|
25458
25515
|
deltaTime: a,
|
|
@@ -25482,8 +25539,8 @@ const IV = () => {
|
|
|
25482
25539
|
}, [I, g]), ug(() => {
|
|
25483
25540
|
WB(i);
|
|
25484
25541
|
}, [i]), null;
|
|
25485
|
-
},
|
|
25486
|
-
const Z =
|
|
25542
|
+
}, NV = ({ url: i, type: g, animationsUrl: I, gender: e, speechSynthesis: t, camera: o, onLoadingCompleted: C, autoLookAt: n, breathing: s, disableAnimations: l, debug: a, enableBml: c, animationWeights: G, license: u, detectGpuData: m, environmentPreset: B = "apartment", tonemapping: p = d.NeutralToneMapping, targets: b }) => {
|
|
25543
|
+
const Z = sg((S) => S.animationsLoaded), H = Ug((S) => S.defaultPositions), R = Ug((S) => S.defaultDistances), [gg, q] = Dg(), [ig, Jg] = Dg(null), [eI, Ig] = Dg(), [Vg, Ce] = Dg(!1), Pg = async (S) => {
|
|
25487
25544
|
let v = null;
|
|
25488
25545
|
switch (g) {
|
|
25489
25546
|
case dg.cc3:
|
|
@@ -25510,7 +25567,7 @@ const IV = () => {
|
|
|
25510
25567
|
type: g,
|
|
25511
25568
|
debug: a,
|
|
25512
25569
|
enableBmlManager: !!c,
|
|
25513
|
-
animationWeights:
|
|
25570
|
+
animationWeights: G,
|
|
25514
25571
|
license: u
|
|
25515
25572
|
};
|
|
25516
25573
|
switch (g) {
|
|
@@ -25558,36 +25615,36 @@ const IV = () => {
|
|
|
25558
25615
|
try {
|
|
25559
25616
|
const S = new d.Box3().setFromObject(ig), v = S.max, W = S.min, z = new d.Vector3((v.x + W.x) / 2, (v.y + W.y) / 2, (v.z + W.z) / 2);
|
|
25560
25617
|
VB(z);
|
|
25561
|
-
const j = Math.abs(v.x - W.x),
|
|
25618
|
+
const j = Math.abs(v.x - W.x), D = Math.abs(v.y - W.y), Xg = Math.abs(v.z - W.z);
|
|
25562
25619
|
vB({
|
|
25563
25620
|
x: j,
|
|
25564
|
-
y:
|
|
25621
|
+
y: D,
|
|
25565
25622
|
z: Xg
|
|
25566
25623
|
});
|
|
25567
25624
|
const eg = (v.x + W.x) / 2, L = (v.z + W.z) / 2, Bg = {
|
|
25568
|
-
eye: new d.Vector3(eg, v.y -
|
|
25569
|
-
mouth: new d.Vector3(eg, v.y -
|
|
25570
|
-
neck: new d.Vector3(eg, v.y -
|
|
25571
|
-
clavicle: new d.Vector3(eg, v.y -
|
|
25572
|
-
torso: new d.Vector3(eg, v.y -
|
|
25573
|
-
belly: new d.Vector3(eg, v.y -
|
|
25574
|
-
lowerbelly: new d.Vector3(eg, v.y -
|
|
25625
|
+
eye: new d.Vector3(eg, v.y - D / 16, L),
|
|
25626
|
+
mouth: new d.Vector3(eg, v.y - D / 12, L),
|
|
25627
|
+
neck: new d.Vector3(eg, v.y - D / 8, L),
|
|
25628
|
+
clavicle: new d.Vector3(eg, v.y - D / 6, L),
|
|
25629
|
+
torso: new d.Vector3(eg, v.y - D / 4, L),
|
|
25630
|
+
belly: new d.Vector3(eg, v.y - D / 8 * 3, L),
|
|
25631
|
+
lowerbelly: new d.Vector3(eg, v.y - D / 32 * 15, L),
|
|
25575
25632
|
hips: z,
|
|
25576
|
-
higherthigh: new d.Vector3(eg, W.y +
|
|
25577
|
-
thigh: new d.Vector3(eg, W.y +
|
|
25578
|
-
knee: new d.Vector3(eg, W.y +
|
|
25579
|
-
leg: new d.Vector3(eg, W.y +
|
|
25633
|
+
higherthigh: new d.Vector3(eg, W.y + D / 32 * 15, L),
|
|
25634
|
+
thigh: new d.Vector3(eg, W.y + D / 8 * 3, L),
|
|
25635
|
+
knee: new d.Vector3(eg, W.y + D / 4, L),
|
|
25636
|
+
leg: new d.Vector3(eg, W.y + D / 8, L),
|
|
25580
25637
|
feet: new d.Vector3(eg, W.y, L)
|
|
25581
|
-
},
|
|
25582
|
-
veryclose:
|
|
25583
|
-
closer:
|
|
25584
|
-
close:
|
|
25585
|
-
midclose:
|
|
25586
|
-
medium:
|
|
25587
|
-
midfar:
|
|
25588
|
-
far:
|
|
25589
|
-
farther:
|
|
25590
|
-
veryfar:
|
|
25638
|
+
}, lg = (v.y - (W.y + D / 7 * 2)) / 2 / Math.tan(25 * (Math.PI / 180)), cg = {
|
|
25639
|
+
veryclose: lg / 4,
|
|
25640
|
+
closer: lg / 3,
|
|
25641
|
+
close: lg / 2.5,
|
|
25642
|
+
midclose: lg / 2,
|
|
25643
|
+
medium: lg,
|
|
25644
|
+
midfar: lg * 2,
|
|
25645
|
+
far: lg * 2.5,
|
|
25646
|
+
farther: lg * 3,
|
|
25647
|
+
veryfar: lg * 4
|
|
25591
25648
|
};
|
|
25592
25649
|
XB(Bg), RB(cg);
|
|
25593
25650
|
} catch (S) {
|
|
@@ -25596,64 +25653,65 @@ const IV = () => {
|
|
|
25596
25653
|
Ce(!0);
|
|
25597
25654
|
}
|
|
25598
25655
|
};
|
|
25599
|
-
return /* @__PURE__ */ tg.createElement(eV, { parentGpuTier: m, setIsGpuAvailable: q, tonemapping: p }, gg ? /* @__PURE__ */ tg.createElement(tg.Fragment, null, ig && /* @__PURE__ */ tg.createElement(tV, { character: ig, autoLookAt: !!n }), ig && /* @__PURE__ */ tg.createElement(tg.Fragment, null, /* @__PURE__ */ tg.createElement(OA, { preset:
|
|
25656
|
+
return /* @__PURE__ */ tg.createElement(eV, { parentGpuTier: m, setIsGpuAvailable: q, tonemapping: p }, gg ? /* @__PURE__ */ tg.createElement(tg.Fragment, null, ig && /* @__PURE__ */ tg.createElement(tV, { character: ig, autoLookAt: !!n }), ig && /* @__PURE__ */ tg.createElement(tg.Fragment, null, /* @__PURE__ */ tg.createElement(OA, { preset: B }), /* @__PURE__ */ tg.createElement("primitive", { object: ig, castShadow: !0, receiveShadow: !0 }))) : /* @__PURE__ */ tg.createElement(tg.Fragment, null));
|
|
25600
25657
|
}, oV = {
|
|
25601
25658
|
emotions: [],
|
|
25602
25659
|
currentTopEmotion: Kn.Neutral,
|
|
25603
25660
|
useTopEmotionOnly: !0,
|
|
25604
25661
|
autoDecay: !1
|
|
25605
|
-
}, Li = Ii()(() => oV),
|
|
25662
|
+
}, Li = Ii()(() => oV), FV = (i) => {
|
|
25606
25663
|
if (Li.setState({ emotions: i || [] }), i != null && i.length) {
|
|
25607
25664
|
const g = i.reduce((I, e) => I.value > e.value ? I : e);
|
|
25608
25665
|
Li.setState({ currentTopEmotion: g.emotion });
|
|
25609
25666
|
} else
|
|
25610
25667
|
Li.setState({ currentTopEmotion: Kn.Neutral });
|
|
25611
|
-
}, FV = (i) => {
|
|
25612
|
-
Li.setState({ useTopEmotionOnly: i });
|
|
25613
25668
|
}, JV = (i) => {
|
|
25614
|
-
Li.setState({
|
|
25669
|
+
Li.setState({ useTopEmotionOnly: i });
|
|
25615
25670
|
}, kV = (i) => {
|
|
25616
|
-
|
|
25671
|
+
Li.setState({ autoDecay: i });
|
|
25672
|
+
}, zV = (i) => {
|
|
25673
|
+
const g = sg.getState().FACSManager;
|
|
25617
25674
|
g == null || g.playFacialAnimation({ ...i });
|
|
25618
25675
|
};
|
|
25619
25676
|
export {
|
|
25620
|
-
|
|
25677
|
+
NV as Character,
|
|
25621
25678
|
yg as CharacterState,
|
|
25622
25679
|
dg as CreationTool,
|
|
25623
|
-
|
|
25624
|
-
|
|
25680
|
+
Tg as Distances,
|
|
25681
|
+
UV as Object3D,
|
|
25625
25682
|
gI as Positions,
|
|
25626
|
-
|
|
25627
|
-
|
|
25683
|
+
VI as Rotations,
|
|
25684
|
+
XV as addSPPASViseme,
|
|
25628
25685
|
Sr as addViseme,
|
|
25629
25686
|
hV as bmlTags,
|
|
25630
25687
|
GV as emotionList,
|
|
25631
25688
|
PB as flushLipSyncData,
|
|
25632
|
-
|
|
25689
|
+
SV as getAnimationsMap,
|
|
25633
25690
|
mV as getCameraPosition,
|
|
25634
25691
|
BV as getCharacterHeight,
|
|
25635
25692
|
uV as getLookAt,
|
|
25636
|
-
|
|
25693
|
+
KV as getVoices,
|
|
25637
25694
|
wB as lookAtAndKeep,
|
|
25638
|
-
|
|
25639
|
-
|
|
25640
|
-
|
|
25695
|
+
yV as lookAtAndSteady,
|
|
25696
|
+
vV as playAnimationByName,
|
|
25697
|
+
zV as playFacialAnimation,
|
|
25698
|
+
HV as presets,
|
|
25641
25699
|
LB as releaseLookAt,
|
|
25642
|
-
|
|
25643
|
-
|
|
25700
|
+
kV as setAutoDecay,
|
|
25701
|
+
WV as setAutoPlay,
|
|
25644
25702
|
na as setCameraPosition,
|
|
25645
25703
|
Ca as setCharacterState,
|
|
25646
25704
|
bV as setCurrentAUs,
|
|
25647
25705
|
pV as setCurrentGaze,
|
|
25648
25706
|
ZV as setCurrentHeadPose,
|
|
25649
25707
|
EB as setCurrentUtterance,
|
|
25650
|
-
|
|
25708
|
+
FV as setEmotions,
|
|
25651
25709
|
Fo as setLookAtCamera,
|
|
25652
25710
|
KB as setMovable,
|
|
25653
|
-
|
|
25654
|
-
|
|
25655
|
-
|
|
25656
|
-
|
|
25711
|
+
RV as setTextToSpeak,
|
|
25712
|
+
JV as setUseTopEmotionOnly,
|
|
25713
|
+
YV as setVisemeIntensity,
|
|
25714
|
+
VV as setVisemes,
|
|
25657
25715
|
jB as setVoice,
|
|
25658
|
-
|
|
25716
|
+
sg as useCharacterStore
|
|
25659
25717
|
};
|