@vincentt-xr/sdk 2.0.0-alpha.0 → 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/GROUNDING.md +232 -14
  2. package/dist/{DebuggerUI-CEfdddkZ.cjs → DebuggerUI-CatYc-RG.cjs} +1 -1
  3. package/dist/{DebuggerUI-Dgop6Q6o.js → DebuggerUI-gLMKiVwJ.js} +1 -1
  4. package/dist/MediaSourceSwitcher-C-xYg0nQ.js +317 -0
  5. package/dist/MediaSourceSwitcher-Cq3g4IKw.cjs +31 -0
  6. package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +6 -1
  7. package/dist/components/FaceMesh/material/defaults.d.ts +4 -0
  8. package/dist/components/FaceMesh/material/types.d.ts +2 -0
  9. package/dist/components/FaceRetouch/Background.d.ts +6 -1
  10. package/dist/components/FaceRetouch/defaults.d.ts +13 -0
  11. package/dist/components/FaceRetouch/index.d.ts +3 -1
  12. package/dist/components/FaceRetouch/landmarkMask.d.ts +4 -1
  13. package/dist/components/FaceRetouch/useFaceRetouchMask.d.ts +2 -1
  14. package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +15 -0
  15. package/dist/components/FaceWarp3D/defaults.d.ts +37 -0
  16. package/dist/components/FaceWarp3D/index.d.ts +3 -0
  17. package/dist/components/FaceWarp3D/warp.d.ts +13 -0
  18. package/dist/components/HandJoints2D/index.d.ts +6 -0
  19. package/dist/components/HandTracker/index.d.ts +2 -2
  20. package/dist/components/HandTracking2D/HandVisual.d.ts +12 -0
  21. package/dist/components/HandTracking2D/index.d.ts +5 -0
  22. package/dist/components/HandTracking2DController/index.d.ts +5 -0
  23. package/dist/components/HandTracking3D/index.d.ts +6 -0
  24. package/dist/components/ScreenImage/index.d.ts +87 -0
  25. package/dist/components/ScreenText/index.d.ts +20 -0
  26. package/dist/components/TextLabel/index.d.ts +99 -0
  27. package/dist/components/XRScene/index.d.ts +14 -3
  28. package/dist/components/XRViewport/index.d.ts +17 -0
  29. package/dist/components/index.d.ts +7 -0
  30. package/dist/debug-ui/default-setting/index.d.ts +37 -0
  31. package/dist/debug-ui/default-setting.cjs +21 -0
  32. package/dist/debug-ui/default-setting.js +777 -0
  33. package/dist/debug-ui/face-warp-3d/index.d.ts +6 -0
  34. package/dist/debug-ui/hand-joints-2d/index.d.ts +6 -0
  35. package/dist/debug-ui/hand-tracking-2d/index.d.ts +6 -0
  36. package/dist/debug-ui/hand-tracking-2d-controller/index.d.ts +6 -0
  37. package/dist/debug-ui/hand-tracking-3d/index.d.ts +6 -0
  38. package/dist/debug-ui/index.d.ts +23 -0
  39. package/dist/debug-ui/layer-panel/index.d.ts +17 -0
  40. package/dist/debug-ui/media-source/MediaSourceSwitcher.d.ts +10 -0
  41. package/dist/debug-ui/media-source/index.d.ts +4 -0
  42. package/dist/debug-ui/media-source/media-preset.d.ts +9 -0
  43. package/dist/debug-ui/media-source.cjs +1 -0
  44. package/dist/debug-ui/media-source.js +7 -0
  45. package/dist/debug-ui/screen-image-settings/index.d.ts +7 -0
  46. package/dist/debug-ui/screen-text-settings/index.d.ts +122 -0
  47. package/dist/debug-ui/settings-panel/index.d.ts +38 -0
  48. package/dist/debug-ui/shared/MaterialSection.d.ts +13 -0
  49. package/dist/debug-ui/shared/ScreenTransformSection.d.ts +29 -0
  50. package/dist/debug-ui.cjs +20 -0
  51. package/dist/debug-ui.js +6063 -0
  52. package/dist/defaults-BLpcN3pG.cjs +1 -0
  53. package/dist/defaults-LtY4M7dg.js +55 -0
  54. package/dist/entries/core.d.ts +5 -1
  55. package/dist/entries/face-effects.d.ts +2 -0
  56. package/dist/entries/low-level.d.ts +3 -0
  57. package/dist/face-effects.cjs +113 -23
  58. package/dist/face-effects.js +1566 -1399
  59. package/dist/handJoints2d.d.ts +49 -0
  60. package/dist/handTracking2d.d.ts +33 -0
  61. package/dist/handTracking2dController.d.ts +65 -0
  62. package/dist/handTracking3d.d.ts +52 -0
  63. package/dist/{index-BD-JWMjE.js → index-BGNbrc4C.js} +113 -137
  64. package/dist/index-BXyObVHF.cjs +1 -0
  65. package/dist/index-CY3bUAcW.js +12 -0
  66. package/dist/index-C_Duh13c.cjs +1 -0
  67. package/dist/index-D8fpPQkC.cjs +1 -0
  68. package/dist/index-DxshgBu0.cjs +1 -0
  69. package/dist/index-O-2crZ3M.js +1102 -0
  70. package/dist/{index-CYMj26Ej.js → index-safCs_af.js} +426 -416
  71. package/dist/{internal-DH5d1Xnq.cjs → internal-BjyhBP8i.cjs} +1 -1
  72. package/dist/{internal-KOKJDxCG.js → internal-Cae1ps15.js} +3 -3
  73. package/dist/internal.cjs +1 -1
  74. package/dist/internal.js +2 -2
  75. package/dist/layerStack.d.ts +29 -0
  76. package/dist/low-level.cjs +1 -1
  77. package/dist/low-level.js +74 -890
  78. package/dist/main.cjs +73 -1
  79. package/dist/main.js +1656 -407
  80. package/dist/models/Hand/HandTracking.d.ts +2 -0
  81. package/dist/screen2d/index.d.ts +4 -0
  82. package/dist/screen2d/material-runtime.d.ts +32 -0
  83. package/dist/screen2d/texture.d.ts +10 -0
  84. package/dist/screen2d/transform.d.ts +25 -0
  85. package/dist/screen2d/types.d.ts +90 -0
  86. package/dist/screenImagePresets.d.ts +13 -0
  87. package/dist/screenImageSettings-6NRg4cx9.js +39 -0
  88. package/dist/screenImageSettings-y_B4_767.cjs +1 -0
  89. package/dist/screenImageSettings.d.ts +50 -0
  90. package/dist/screenTextPresets.d.ts +6 -0
  91. package/dist/screenTextSettings.d.ts +131 -0
  92. package/dist/{selectors-Bub0o3qy.cjs → selectors-BLl2JUWW.cjs} +1 -1
  93. package/dist/{selectors-BHO6TnoC.js → selectors-CXd_x-6t.js} +6 -6
  94. package/dist/tracking.cjs +1 -1
  95. package/dist/tracking.js +193 -168
  96. package/dist/types/hand-tracking.d.ts +8 -0
  97. package/dist/types/nodes.d.ts +2 -0
  98. package/dist/useXRModel-3DcUa28n.cjs +1 -0
  99. package/dist/useXRModel-BMJE1hrk.js +28 -0
  100. package/dist/x-Co8jPhP0.js +127 -0
  101. package/dist/x-KC8E4Gaj.cjs +41 -0
  102. package/package.json +19 -1
  103. package/dist/index-B5J4gzn2.cjs +0 -1
  104. package/dist/index-BVBVg96G.cjs +0 -1
  105. package/dist/index-DtwHElmG.js +0 -157
  106. package/dist/index-PtFmD6B8.cjs +0 -1
@@ -1,26 +1,51 @@
1
1
  import * as R from "three";
2
- import { TrianglesDrawMode as $t, TriangleFanDrawMode as tt, TriangleStripDrawMode as _t, Loader as Jt, LoaderUtils as xe, FileLoader as Lt, MeshPhysicalMaterial as X, Vector2 as It, Color as se, LinearSRGBColorSpace as V, SRGBColorSpace as ve, SpotLight as en, PointLight as tn, DirectionalLight as nn, Matrix4 as Ne, Vector3 as te, Quaternion as Ct, InstancedMesh as sn, InstancedBufferAttribute as rn, Object3D as Nt, TextureLoader as on, ImageBitmapLoader as an, BufferAttribute as He, InterleavedBuffer as cn, InterleavedBufferAttribute as ln, LinearMipmapLinearFilter as Pt, NearestMipmapLinearFilter as un, LinearMipmapNearestFilter as hn, NearestMipmapNearestFilter as dn, LinearFilter as nt, NearestFilter as Ft, RepeatWrapping as st, MirroredRepeatWrapping as fn, ClampToEdgeWrapping as pn, PointsMaterial as mn, Material as je, LineBasicMaterial as gn, MeshStandardMaterial as Ot, DoubleSide as Ie, MeshBasicMaterial as Te, PropertyBinding as An, BufferGeometry as Tn, SkinnedMesh as xn, Mesh as vn, LineSegments as bn, Line as En, LineLoop as Rn, Points as Mn, Group as Xe, PerspectiveCamera as wn, MathUtils as Sn, OrthographicCamera as yn, Skeleton as _n, AnimationClip as Ln, Bone as In, InterpolateDiscrete as Cn, InterpolateLinear as Dt, Texture as ft, VectorKeyframeTrack as pt, NumberKeyframeTrack as mt, QuaternionKeyframeTrack as gt, ColorManagement as At, FrontSide as Nn, Interpolant as Pn, Box3 as Fn, Sphere as On, Euler as Dn } from "three";
3
- import { jsxs as w, Fragment as rt, jsx as T } from "react/jsx-runtime";
4
- import { useThree as kt, useLoader as Ke, useFrame as kn } from "@react-three/fiber";
5
- import { useState as at, useEffect as $, useMemo as j, useRef as N } from "react";
6
- import { l as Pe, f as Bt, X as Bn } from "./index-CYMj26Ej.js";
7
- import { a as Un, u as Ut } from "./selectors-BHO6TnoC.js";
8
- import { p as Gn, F as Hn, b as jn } from "./index-BD-JWMjE.js";
9
- import { Text as Ye } from "@react-three/drei";
10
- const Tt = {
11
- normal: 0,
12
- add: 1,
13
- subtract: 2,
14
- multiply: 3,
15
- screen: 4,
16
- overlay: 5,
17
- softLight: 6,
18
- hardLight: 7,
19
- lighten: 8,
20
- darken: 9,
21
- difference: 10,
22
- exclusion: 11
23
- }, Ve = /* @__PURE__ */ new Set([
2
+ import { TrianglesDrawMode as dn, TriangleFanDrawMode as ut, TriangleStripDrawMode as Ht, Loader as fn, LoaderUtils as be, FileLoader as Gt, MeshPhysicalMaterial as V, Vector2 as Xt, Color as oe, LinearSRGBColorSpace as Z, SRGBColorSpace as Me, SpotLight as mn, PointLight as pn, DirectionalLight as gn, Matrix4 as Oe, Vector3 as se, Quaternion as jt, InstancedMesh as An, InstancedBufferAttribute as vn, Object3D as Kt, TextureLoader as Tn, ImageBitmapLoader as xn, BufferAttribute as qe, InterleavedBuffer as bn, InterleavedBufferAttribute as Mn, LinearMipmapLinearFilter as Yt, NearestMipmapLinearFilter as Rn, LinearMipmapNearestFilter as En, NearestMipmapNearestFilter as wn, LinearFilter as ht, NearestFilter as Wt, RepeatWrapping as dt, MirroredRepeatWrapping as Sn, ClampToEdgeWrapping as yn, PointsMaterial as _n, Material as Ze, LineBasicMaterial as Ln, MeshStandardMaterial as Vt, DoubleSide as Fe, MeshBasicMaterial as Te, PropertyBinding as Cn, BufferGeometry as In, SkinnedMesh as Pn, Mesh as Nn, LineSegments as Fn, Line as kn, LineLoop as On, Points as Dn, Group as Qe, PerspectiveCamera as Un, MathUtils as Bn, OrthographicCamera as Hn, Skeleton as Gn, AnimationClip as Xn, Bone as jn, InterpolateDiscrete as Kn, InterpolateLinear as zt, Texture as wt, VectorKeyframeTrack as St, NumberKeyframeTrack as yt, QuaternionKeyframeTrack as _t, ColorManagement as Lt, FrontSide as Yn, Interpolant as Wn, Box3 as Vn, Sphere as zn, Euler as qn } from "three";
3
+ import { jsxs as S, Fragment as ft, jsx as x } from "react/jsx-runtime";
4
+ import { useThree as qt, useLoader as $e, useFrame as Zn } from "@react-three/fiber";
5
+ import { useState as gt, useEffect as $, useMemo as W, useRef as P } from "react";
6
+ import { f as Zt, X as Qn } from "./index-safCs_af.js";
7
+ import { d as $n, b as Qt } from "./selectors-CXd_x-6t.js";
8
+ import { p as Jn, F as es, a as ts } from "./index-BGNbrc4C.js";
9
+ import { l as De } from "./index-CY3bUAcW.js";
10
+ import { D as To, F as xo } from "./defaults-LtY4M7dg.js";
11
+ import { Text as Je } from "@react-three/drei";
12
+ const xe = (a) => Math.min(1, Math.max(0, a)), U = (a, e, t) => xe(1 - Math.abs(a - e) / t), ns = (a) => {
13
+ let e = 1 / 0, t = -1 / 0, s = 1 / 0, n = -1 / 0;
14
+ for (const c of a)
15
+ e = Math.min(e, c.x), t = Math.max(t, c.x), s = Math.min(s, c.y), n = Math.max(n, c.y);
16
+ const o = Math.max(t - e, 1e-3), r = Math.max(n - s, 1e-3);
17
+ return {
18
+ centerX: e + o * 0.5,
19
+ centerY: s + r * 0.5,
20
+ width: o,
21
+ height: r
22
+ };
23
+ }, ss = (a) => a != null && a.enabled ? (a.strength ?? 1) !== 0 && Object.entries(a).some(
24
+ ([e, t]) => e !== "enabled" && e !== "strength" && typeof t == "number" && t !== 0
25
+ ) : !1, rs = (a, e, t, s) => {
26
+ const n = t.enabled ? t.strength ?? 1 : 0;
27
+ if (n === 0)
28
+ return s.x = a.x, s.y = a.y, s.z = a.z, s;
29
+ const o = (a.x - e.centerX) / e.width, r = (a.y - e.centerY) / e.height, c = Math.abs(o), i = xe((-r + 0.42) / 0.55), l = U(r, -0.02, 0.34), h = U(r, -0.24, 0.16) * xe((c - 0.05) / 0.28), u = U(r, 0.02, 0.26) * U(c, 0, 0.18), d = U(r, 0.29, 0.18) * U(c, 0, 0.36), m = xe((r - 0.16) / 0.36), A = l * U(c, 0.34, 0.22), g = i * U(c, 0, 0.48), p = U(r, -0.19, 0.1) * xe((c - 0.05) / 0.3), f = U(r, 0.48, 0.2) * U(c, 0, 0.26);
30
+ let v = a.x, T = a.y, b = a.z;
31
+ const E = (F, _ = 1) => {
32
+ v += o * e.width * F * n * _;
33
+ }, L = (F, _ = 1) => {
34
+ T += r * e.height * F * n * _;
35
+ };
36
+ E(t.faceWidth ?? 0), L(t.faceHeight ?? 0), E(t.faceRoundness ?? 0, l * (1 - c)), T -= e.height * (t.midfaceHeight ?? 0) * n * l * 0.25, L(-(t.foreheadHeight ?? 0), g), E(t.foreheadWidth ?? 0, g), E(
37
+ t.cheekboneWidth ?? 0,
38
+ U(r, -0.06, 0.16) * U(c, 0.34, 0.2)
39
+ ), E(t.cheekWidth ?? 0, A), E(t.jawWidth ?? 0, m), L(t.chinHeight ?? 0, f), T -= e.height * (t.scalpHeight ?? 0) * n * i * 0.3, b -= (t.midfaceDepth ?? 0) * n * l * 0.08, b += (t.cheekHollowness ?? 0) * n * A * 0.06, b -= (t.browDepth ?? 0) * n * p * 0.05, T -= e.height * (t.browHeight ?? 0) * n * p * 0.2, v += Math.sign(o || 1) * e.width * (t.browDistance ?? 0) * n * p * 0.16;
40
+ const y = (t.headCurve ?? 0) * n * (r + 0.1);
41
+ b -= y * y * 0.04 * Math.sign(t.headCurve ?? 0), v += e.width * (t.faceTwist ?? 0) * n * r * 0.18;
42
+ const N = (t.faceSwirl ?? 0) * n * 0.22;
43
+ v += -r * e.width * N, T += o * e.height * N;
44
+ const C = o < 0 ? t.leftEyeSize ?? 0 : t.rightEyeSize ?? 0, I = ((t.eyeSize ?? 0) + C) * n * h;
45
+ v += o * e.width * I * 0.45, T += (r + 0.24) * e.height * I * 0.7, v += Math.sign(o || 1) * e.width * (t.eyeDistance ?? 0) * n * h * 0.2, v += e.width * (o < 0 ? t.leftEyeX ?? 0 : t.rightEyeX ?? 0) * n * h * 0.15, T += e.height * (o < 0 ? t.leftEyeY ?? 0 : t.rightEyeY ?? 0) * n * h * 0.15;
46
+ const O = (t.noseSize ?? 0) * n * u;
47
+ return v += o * e.width * O * 0.7, T += (r - 0.02) * e.height * O * 0.5, T += e.height * (t.noseLength ?? 0) * n * u * Math.max(r + 0.08, 0) * 0.4, b -= (t.noseSize ?? 0) * n * u * 0.08, v += o * e.width * (t.mouthWidth ?? 0) * n * d, T += (r - 0.29) * e.height * (t.mouthHeight ?? 0) * n * d, s.x = v, s.y = T, s.z = b, s;
48
+ }, et = /* @__PURE__ */ new Set([
24
49
  61,
25
50
  146,
26
51
  91,
@@ -52,7 +77,7 @@ const Tt = {
52
77
  311,
53
78
  310,
54
79
  415
55
- ]), We = /* @__PURE__ */ new Set([
80
+ ]), tt = /* @__PURE__ */ new Set([
56
81
  33,
57
82
  7,
58
83
  163,
@@ -69,7 +94,7 @@ const Tt = {
69
94
  160,
70
95
  161,
71
96
  246
72
- ]), ze = /* @__PURE__ */ new Set([
97
+ ]), nt = /* @__PURE__ */ new Set([
73
98
  362,
74
99
  382,
75
100
  381,
@@ -86,42 +111,42 @@ const Tt = {
86
111
  385,
87
112
  384,
88
113
  398
89
- ]), Xn = /* @__PURE__ */ new Set([814, 815, 816, 817, 818, 819, 830, 831, 832, 833]), Kn = (i, e, t) => {
90
- const s = Ve.has(i) && Ve.has(e) && Ve.has(t), n = We.has(i) && We.has(e) && We.has(t), r = ze.has(i) && ze.has(e) && ze.has(t);
91
- return s ? "mouth" : n || r ? "eye" : "base";
92
- }, Yn = (i) => {
93
- const e = [], t = [], s = [], n = [], r = [], o = [];
94
- let c = 0, a = 0;
95
- i.split(`
96
- `).forEach((u) => {
97
- const h = u.trim();
98
- if (!h) return;
99
- if (h.startsWith("v ")) {
114
+ ]), os = /* @__PURE__ */ new Set([814, 815, 816, 817, 818, 819, 830, 831, 832, 833]), as = (a, e, t) => {
115
+ const s = et.has(a) && et.has(e) && et.has(t), n = tt.has(a) && tt.has(e) && tt.has(t), o = nt.has(a) && nt.has(e) && nt.has(t);
116
+ return s ? "mouth" : n || o ? "eye" : "base";
117
+ }, is = (a) => {
118
+ const e = [], t = [], s = [], n = [], o = [], r = [];
119
+ let c = 0, i = 0;
120
+ a.split(`
121
+ `).forEach((h) => {
122
+ const u = h.trim();
123
+ if (!u) return;
124
+ if (u.startsWith("v ")) {
100
125
  c += 1;
101
126
  return;
102
127
  }
103
- if (h.startsWith("vt ")) {
104
- const [, A, m] = h.split(/\s+/);
105
- r.push([Number(A), Number(m)]);
128
+ if (u.startsWith("vt ")) {
129
+ const [, g, p] = u.split(/\s+/);
130
+ o.push([Number(g), Number(p)]);
106
131
  return;
107
132
  }
108
- if (!h.startsWith("f ")) return;
109
- const d = a;
110
- a += 1;
111
- const [, ...p] = h.split(/\s+/), g = p.map((A) => {
112
- const [m, f] = A.split("/"), x = Number(m) - 1, v = Number(f) - 1;
113
- return v >= 0 && r[v] && !o[x] && (o[x] = r[v]), x;
133
+ if (!u.startsWith("f ")) return;
134
+ const d = i;
135
+ i += 1;
136
+ const [, ...m] = u.split(/\s+/), A = m.map((g) => {
137
+ const [p, f] = g.split("/"), v = Number(p) - 1, T = Number(f) - 1;
138
+ return T >= 0 && o[T] && !r[v] && (r[v] = o[T]), v;
114
139
  });
115
- if (!(g.length < 3))
116
- for (let A = 1; A < g.length - 1; A += 1) {
117
- const m = g[0], f = g[A], x = g[A + 1], v = Kn(m, f, x);
118
- Xn.has(d) ? n.push(m, f, x) : v === "mouth" ? t.push(m, f, x) : v === "eye" ? s.push(m, f, x) : e.push(m, f, x);
140
+ if (!(A.length < 3))
141
+ for (let g = 1; g < A.length - 1; g += 1) {
142
+ const p = A[0], f = A[g], v = A[g + 1], T = as(p, f, v);
143
+ os.has(d) ? n.push(p, f, v) : T === "mouth" ? t.push(p, f, v) : T === "eye" ? s.push(p, f, v) : e.push(p, f, v);
119
144
  }
120
145
  });
121
146
  const l = [];
122
- for (let u = 0; u < c; u += 1) {
123
- const [h, d] = o[u] ?? [0, 0];
124
- l.push(h, d);
147
+ for (let h = 0; h < c; h += 1) {
148
+ const [u, d] = r[h] ?? [0, 0];
149
+ l.push(u, d);
125
150
  }
126
151
  return {
127
152
  baseIndices: new Uint16Array(e),
@@ -131,34 +156,47 @@ const Tt = {
131
156
  uvs: new Float32Array(l),
132
157
  vertexCount: c
133
158
  };
134
- }, Vn = "canonical_face_model.obj", Wn = new TextDecoder("utf-8"), qe = /* @__PURE__ */ new Map(), zn = (i) => {
135
- const e = qe.get(i);
159
+ }, cs = "canonical_face_model.obj", ls = new TextDecoder("utf-8"), st = /* @__PURE__ */ new Map(), us = (a) => {
160
+ const e = st.get(a);
136
161
  if (e) return e;
137
- const t = Bt(i).then((s) => Yn(Wn.decode(s))).catch((s) => {
138
- throw qe.delete(i), s;
162
+ const t = Zt(a).then((s) => is(ls.decode(s))).catch((s) => {
163
+ throw st.delete(a), s;
139
164
  });
140
- return qe.set(i, t), t;
141
- }, qn = (i) => {
142
- const { mesh: e, url: t } = i ?? {}, s = t ?? `${Pe.sdkAssetsBaseUrl}/${Vn}`, [n, r] = at(e ?? null);
165
+ return st.set(a, t), t;
166
+ }, hs = (a) => {
167
+ const { mesh: e, url: t } = a ?? {}, s = t ?? `${De.sdkAssetsBaseUrl}/${cs}`, [n, o] = gt(e ?? null);
143
168
  return $(() => {
144
169
  if (e) {
145
- r(e);
170
+ o(e);
146
171
  return;
147
172
  }
148
- let o = !1;
149
- return zn(s).then((c) => {
150
- o || r(c);
173
+ let r = !1;
174
+ return us(s).then((c) => {
175
+ r || o(c);
151
176
  }).catch((c) => {
152
- o || console.error(`${Pe.loggerPrefix} canonical face mesh load failed`, c);
177
+ r || console.error(`${De.loggerPrefix} canonical face mesh load failed`, c);
153
178
  }), () => {
154
- o = !0;
179
+ r = !0;
155
180
  };
156
181
  }, [e, s]), n;
157
- }, Zn = {
182
+ }, Ct = {
183
+ normal: 0,
184
+ add: 1,
185
+ subtract: 2,
186
+ multiply: 3,
187
+ screen: 4,
188
+ overlay: 5,
189
+ softLight: 6,
190
+ hardLight: 7,
191
+ lighten: 8,
192
+ darken: 9,
193
+ difference: 10,
194
+ exclusion: 11
195
+ }, rt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO2YpZcAAAAASUVORK5CYII=", ds = {
158
196
  front: R.FrontSide,
159
197
  back: R.BackSide,
160
198
  double: R.DoubleSide
161
- }, Qn = `
199
+ }, fs = `
162
200
  attribute vec2 faceUv;
163
201
  varying vec2 vUv;
164
202
  varying vec2 vFaceUv;
@@ -170,13 +208,14 @@ const Tt = {
170
208
  vNormal = normalize(normalMatrix * normal);
171
209
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
172
210
  }
173
- `, $n = `
211
+ `, ms = `
174
212
  uniform sampler2D cameraTexture;
175
213
  uniform sampler2D canonicalTexture;
176
214
  uniform sampler2D alphaMask;
177
215
  uniform vec3 textureTint;
178
216
  uniform float opacity;
179
217
  uniform float blendMode;
218
+ uniform float blendOpacity;
180
219
  uniform float useCanonicalTexture;
181
220
  uniform float useAlphaMask;
182
221
  uniform float alphaOpacity;
@@ -262,10 +301,11 @@ const Tt = {
262
301
  float maskSample = texture2D(alphaMask, vUv).r;
263
302
  float mask = useAlphaMask > 0.5 ? mix(1.0, maskSample, alphaOpacity) : 1.0;
264
303
  float textureAlpha = useCanonicalTexture > 0.5 ? textureSample.a : 1.0;
265
- vec3 color = useCanonicalTexture > 0.5 ? applyBlendMode(base, blend, blendMode) : base;
304
+ vec3 blended = applyBlendMode(base, blend, blendMode);
305
+ vec3 color = useCanonicalTexture > 0.5 ? mix(base, blended, blendOpacity) : base;
266
306
  gl_FragColor = vec4(srgbToLinear(color), opacity * mask * textureAlpha);
267
307
  }
268
- `, Jn = `
308
+ `, ps = `
269
309
  varying vec2 vUv;
270
310
  varying vec3 vNormal;
271
311
 
@@ -274,7 +314,7 @@ const Tt = {
274
314
  vNormal = normalize(normalMatrix * normal);
275
315
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
276
316
  }
277
- `, es = `
317
+ `, gs = `
278
318
  uniform vec3 color;
279
319
  uniform float opacity;
280
320
  varying vec3 vNormal;
@@ -285,8 +325,8 @@ const Tt = {
285
325
 
286
326
  gl_FragColor = vec4(base, opacity);
287
327
  }
288
- `, ts = () => {
289
- const i = new Uint8Array([
328
+ `, As = () => {
329
+ const a = new Uint8Array([
290
330
  32,
291
331
  32,
292
332
  32,
@@ -303,68 +343,79 @@ const Tt = {
303
343
  255,
304
344
  255,
305
345
  255
306
- ]), e = new R.DataTexture(i, 4, 1, R.RGBAFormat);
346
+ ]), e = new R.DataTexture(a, 4, 1, R.RGBAFormat);
307
347
  return e.minFilter = R.NearestFilter, e.magFilter = R.NearestFilter, e.generateMipmaps = !1, e.needsUpdate = !0, e;
308
- }, ns = () => {
309
- const i = document.createElement("canvas");
310
- i.width = 256, i.height = 256;
311
- const e = i.getContext("2d");
348
+ }, vs = () => {
349
+ const a = document.createElement("canvas");
350
+ a.width = 256, a.height = 256;
351
+ const e = a.getContext("2d");
312
352
  if (!e)
313
- return new R.CanvasTexture(i);
353
+ return new R.CanvasTexture(a);
314
354
  const t = e.createRadialGradient(96, 80, 10, 128, 128, 128);
315
- t.addColorStop(0, "#ffffff"), t.addColorStop(0.18, "#f7d794"), t.addColorStop(0.45, "#d97706"), t.addColorStop(0.72, "#78350f"), t.addColorStop(1, "#120701"), e.fillStyle = t, e.fillRect(0, 0, i.width, i.height);
316
- const s = new R.CanvasTexture(i);
355
+ t.addColorStop(0, "#ffffff"), t.addColorStop(0.18, "#f7d794"), t.addColorStop(0.45, "#d97706"), t.addColorStop(0.72, "#78350f"), t.addColorStop(1, "#120701"), e.fillStyle = t, e.fillRect(0, 0, a.width, a.height);
356
+ const s = new R.CanvasTexture(a);
317
357
  return s.needsUpdate = !0, s;
318
- }, Cr = ({
319
- faceIndex: i = 0,
320
- color: e = "#38bdf8",
321
- opacity: t = 0.45,
322
- materialType: s = "basic",
323
- shaderPreset: n = "basicShader",
358
+ }, zr = ({
359
+ faceIndex: a = 0,
360
+ baseColor: e,
361
+ color: t = "#38bdf8",
362
+ opacity: s = 0.45,
363
+ materialType: n = "basic",
364
+ shaderPreset: o = "basicShader",
324
365
  textureMap: r = "none",
325
- alphaMap: o = "none",
326
- alphaOpacity: c = 0,
327
- side: a = "front",
328
- blendMode: l = "normal",
329
- showMouthMask: u = !0,
330
- showEyeMask: h = !0,
331
- showNoseMask: d = !0,
332
- maskTextureSource: p = "none",
333
- maskColor: g = "#111111",
334
- maskOpacity: A = 0,
335
- faceTextureUrl: m = "",
336
- faceTextureStyle2Url: f = "",
337
- faceAlphaMaskUrl: x = "",
338
- compositeShading: v = !1,
339
- mesh: b,
340
- meshUrl: y
366
+ alphaMap: c = "none",
367
+ alphaOpacity: i = 0,
368
+ side: l = "front",
369
+ blendMode: h = "normal",
370
+ blendOpacity: u = 1,
371
+ showMouthMask: d = !0,
372
+ showEyeMask: m = !0,
373
+ showNoseMask: A = !0,
374
+ maskTextureSource: g = "none",
375
+ maskColor: p = "#111111",
376
+ maskOpacity: f = 0,
377
+ faceTextureUrl: v = "",
378
+ faceTextureStyle2Url: T = "",
379
+ faceAlphaMaskUrl: b = "",
380
+ compositeShading: E = !1,
381
+ faceWarp3D: L,
382
+ renderOrder: y = 10,
383
+ mesh: N,
384
+ meshUrl: C
341
385
  }) => {
342
- const L = Un(Bn.FACE_TRACKER), _ = Ut(), { camera: D } = kt(), M = qn({ mesh: b, url: y }), P = Ke(R.TextureLoader, m || "/placeholder.png"), re = Ke(
386
+ const I = $n(Qn.FACE_TRACKER), O = Qt(), { camera: F } = qt(), _ = hs({ mesh: N, url: C }), w = $e(
343
387
  R.TextureLoader,
344
- f || m || "/placeholder.png"
345
- ), I = Ke(R.TextureLoader, x || "/placeholder.png"), W = j(() => ts(), []), S = j(() => ns(), []), oe = N(null), z = N(null), q = N(null), ue = N(null), he = N(null), de = N(null), fe = N(null), ie = N(null), ae = N(null), pe = N(null), me = N(null), be = N(null), qt = N(new R.Vector3()), Ee = N(!1), J = Zn[a], ce = {
346
- side: J,
388
+ v || rt
389
+ ), he = $e(
390
+ R.TextureLoader,
391
+ T || v || rt
392
+ ), G = $e(
393
+ R.TextureLoader,
394
+ b || rt
395
+ ), J = W(() => As(), []), Re = W(() => vs(), []), de = P(null), fe = P(null), me = P(null), ae = P(null), pe = P(null), Ee = P(null), we = P(null), Se = P(null), Ue = P(null), Be = P(null), He = P(null), Tt = P(null), cn = P(new R.Vector3()), ln = P({ x: 0, y: 0, z: 0 }), ye = P(!1), ee = ds[l], ie = e ?? t, ce = {
396
+ side: ee,
347
397
  transparent: !0,
348
- opacity: t,
398
+ opacity: s,
349
399
  wireframe: !1
350
- }, Fe = r === "style2" ? re : P, ge = r !== "none", Re = j(
400
+ }, Ge = r === "style2" ? he : w, ge = r !== "none", _e = W(
351
401
  () => ({
352
- color: { value: new R.Color(e) },
353
- opacity: { value: t }
402
+ color: { value: new R.Color(ie) },
403
+ opacity: { value: s }
354
404
  }),
355
405
  []
356
- ), F = j(
406
+ ), D = W(
357
407
  () => ({
358
408
  cameraTexture: { value: null },
359
409
  canonicalTexture: { value: null },
360
410
  alphaMask: { value: null },
361
- textureTint: { value: new R.Color(e) },
362
- opacity: { value: t },
363
- blendMode: { value: Tt[l] },
411
+ textureTint: { value: new R.Color(ie) },
412
+ opacity: { value: s },
413
+ blendMode: { value: Ct[h] },
414
+ blendOpacity: { value: u },
364
415
  useCanonicalTexture: { value: ge ? 1 : 0 },
365
- useAlphaMask: { value: o === "canonical" ? 1 : 0 },
366
- alphaOpacity: { value: c },
367
- compositeShading: { value: v ? 1 : 0 },
416
+ useAlphaMask: { value: c === "canonical" ? 1 : 0 },
417
+ alphaOpacity: { value: i },
418
+ compositeShading: { value: E ? 1 : 0 },
368
419
  lightDirection: { value: new R.Vector3(0.3, 0.65, 0.7).normalize() },
369
420
  ambientStrength: { value: 0.78 },
370
421
  directionalStrength: { value: 0.38 }
@@ -372,60 +423,61 @@ const Tt = {
372
423
  []
373
424
  );
374
425
  $(() => {
375
- Re.color.value.set(e), Re.opacity.value = t;
376
- }, [e, t, Re]), $(() => {
377
- F.cameraTexture.value = _ ?? P, F.canonicalTexture.value = Fe, F.alphaMask.value = I, F.textureTint.value.set(e), F.opacity.value = t, F.blendMode.value = Tt[l], F.useCanonicalTexture.value = ge ? 1 : 0, F.useAlphaMask.value = o === "canonical" ? 1 : 0, F.alphaOpacity.value = c, F.compositeShading.value = v ? 1 : 0;
426
+ _e.color.value.set(ie), _e.opacity.value = s;
427
+ }, [ie, s, _e]), $(() => {
428
+ D.cameraTexture.value = O ?? w, D.canonicalTexture.value = Ge, D.alphaMask.value = G, D.textureTint.value.set(ie), D.opacity.value = s, D.blendMode.value = Ct[h], D.blendOpacity.value = u, D.useCanonicalTexture.value = ge ? 1 : 0, D.useAlphaMask.value = c === "canonical" ? 1 : 0, D.alphaOpacity.value = i, D.compositeShading.value = E ? 1 : 0;
378
429
  }, [
379
- o,
380
- I,
381
430
  c,
382
- l,
383
- _,
384
- e,
385
- v,
386
- F,
387
- P,
431
+ G,
432
+ i,
433
+ h,
434
+ u,
435
+ O,
436
+ E,
437
+ D,
438
+ w,
388
439
  ge,
389
- t,
390
- Fe,
440
+ ie,
441
+ s,
442
+ Ge,
391
443
  r
392
444
  ]);
393
- const Me = (C) => {
394
- if (C)
395
- return p === "canonical" ? /* @__PURE__ */ T(
445
+ const Le = (k) => {
446
+ if (k)
447
+ return g === "canonical" ? /* @__PURE__ */ x(
396
448
  "meshBasicMaterial",
397
449
  {
398
- color: g,
399
- alphaMap: I,
450
+ color: p,
451
+ alphaMap: G,
400
452
  transparent: !0,
401
- opacity: A,
402
- side: J,
453
+ opacity: f,
454
+ side: ee,
403
455
  depthWrite: !1,
404
456
  depthTest: !1,
405
457
  toneMapped: !1
406
458
  },
407
459
  "masked-canonical-material"
408
- ) : /* @__PURE__ */ T(
460
+ ) : /* @__PURE__ */ x(
409
461
  "meshBasicMaterial",
410
462
  {
411
- color: g,
463
+ color: p,
412
464
  transparent: !0,
413
- opacity: A,
414
- side: J,
465
+ opacity: f,
466
+ side: ee,
415
467
  depthWrite: !1,
416
468
  depthTest: !1,
417
469
  toneMapped: !1
418
470
  },
419
471
  "masked-solid-material"
420
472
  );
421
- if (s === "wireframe")
422
- return /* @__PURE__ */ T(
473
+ if (n === "wireframe")
474
+ return /* @__PURE__ */ x(
423
475
  "meshBasicMaterial",
424
476
  {
425
- color: e,
477
+ color: t,
426
478
  transparent: !0,
427
- opacity: t,
428
- side: J,
479
+ opacity: s,
480
+ side: ee,
429
481
  depthWrite: !1,
430
482
  depthTest: !1,
431
483
  wireframe: !0,
@@ -433,57 +485,57 @@ const Tt = {
433
485
  },
434
486
  "wireframe-material"
435
487
  );
436
- if (s === "shader" && _ && (n === "originalFace" || n === "composite" && r === "none"))
437
- return /* @__PURE__ */ T(
488
+ if (n === "shader" && O && (o === "originalFace" || o === "composite" && r === "none"))
489
+ return /* @__PURE__ */ x(
438
490
  "meshBasicMaterial",
439
491
  {
440
- map: _,
441
- alphaMap: I,
492
+ map: O,
493
+ alphaMap: G,
442
494
  transparent: !0,
443
- opacity: t,
444
- side: J,
495
+ opacity: s,
496
+ side: ee,
445
497
  depthWrite: !1,
446
498
  depthTest: !0,
447
499
  toneMapped: !1
448
500
  },
449
501
  "use-original-face-material"
450
502
  );
451
- if (s === "shader" && n === "composite" && ge && _)
452
- return /* @__PURE__ */ T(
503
+ if (n === "shader" && o === "composite" && ge && O)
504
+ return /* @__PURE__ */ x(
453
505
  "shaderMaterial",
454
506
  {
455
- uniforms: F,
456
- vertexShader: Qn,
457
- fragmentShader: $n,
507
+ uniforms: D,
508
+ vertexShader: fs,
509
+ fragmentShader: ms,
458
510
  transparent: !0,
459
- side: J,
511
+ side: ee,
460
512
  depthWrite: !1,
461
513
  depthTest: !0,
462
514
  toneMapped: !1
463
515
  },
464
516
  "composite-material"
465
517
  );
466
- const k = ge ? Fe : null, B = o === "canonical" && c > 0 ? I : null, U = `${s}-${r}-${o}-${c > 0 ? "alpha-on" : "alpha-off"}`;
467
- return s === "standard" ? /* @__PURE__ */ T(
518
+ const X = ge ? Ge : null, j = c === "canonical" && i > 0 ? G : null, K = `${n}-${r}-${c}-${i > 0 ? "alpha-on" : "alpha-off"}`;
519
+ return n === "standard" ? /* @__PURE__ */ x(
468
520
  "meshStandardMaterial",
469
521
  {
470
522
  ...ce,
471
- color: e,
472
- map: k ?? void 0,
473
- alphaMap: B ?? void 0,
523
+ color: t,
524
+ map: X ?? void 0,
525
+ alphaMap: j ?? void 0,
474
526
  depthWrite: !0,
475
527
  depthTest: !0,
476
528
  metalness: 0.05,
477
529
  roughness: 0.72
478
530
  },
479
- U
480
- ) : s === "physical" ? /* @__PURE__ */ T(
531
+ K
532
+ ) : n === "physical" ? /* @__PURE__ */ x(
481
533
  "meshPhysicalMaterial",
482
534
  {
483
535
  ...ce,
484
- color: e,
485
- map: k ?? void 0,
486
- alphaMap: B ?? void 0,
536
+ color: t,
537
+ map: X ?? void 0,
538
+ alphaMap: j ?? void 0,
487
539
  depthWrite: !0,
488
540
  depthTest: !0,
489
541
  roughness: 0.58,
@@ -491,20 +543,20 @@ const Tt = {
491
543
  clearcoat: 0.35,
492
544
  clearcoatRoughness: 0.4
493
545
  },
494
- U
495
- ) : s === "toon" ? /* @__PURE__ */ T(
546
+ K
547
+ ) : n === "toon" ? /* @__PURE__ */ x(
496
548
  "meshToonMaterial",
497
549
  {
498
550
  ...ce,
499
- color: e,
500
- map: k ?? void 0,
501
- alphaMap: B ?? void 0,
502
- gradientMap: W,
551
+ color: t,
552
+ map: X ?? void 0,
553
+ alphaMap: j ?? void 0,
554
+ gradientMap: J,
503
555
  depthWrite: !0,
504
556
  depthTest: !0
505
557
  },
506
- U
507
- ) : s === "normal" ? /* @__PURE__ */ T(
558
+ K
559
+ ) : n === "normal" ? /* @__PURE__ */ x(
508
560
  "meshNormalMaterial",
509
561
  {
510
562
  ...ce,
@@ -513,84 +565,84 @@ const Tt = {
513
565
  flatShading: !1
514
566
  },
515
567
  "normal-material"
516
- ) : s === "matcap" ? /* @__PURE__ */ T(
568
+ ) : n === "matcap" ? /* @__PURE__ */ x(
517
569
  "meshMatcapMaterial",
518
570
  {
519
571
  ...ce,
520
- color: e,
521
- matcap: S,
572
+ color: t,
573
+ matcap: Re,
522
574
  depthWrite: !0,
523
575
  depthTest: !0
524
576
  },
525
577
  "matcap-material"
526
- ) : s === "shader" ? /* @__PURE__ */ T(
578
+ ) : n === "shader" ? /* @__PURE__ */ x(
527
579
  "shaderMaterial",
528
580
  {
529
- uniforms: Re,
530
- vertexShader: Jn,
531
- fragmentShader: es,
581
+ uniforms: _e,
582
+ vertexShader: ps,
583
+ fragmentShader: gs,
532
584
  transparent: !0,
533
- side: J,
585
+ side: ee,
534
586
  depthWrite: !1,
535
587
  depthTest: !0,
536
588
  toneMapped: !1
537
589
  },
538
590
  "generic-shader-material"
539
- ) : /* @__PURE__ */ T(
591
+ ) : /* @__PURE__ */ x(
540
592
  "meshBasicMaterial",
541
593
  {
542
594
  ...ce,
543
- color: e,
544
- map: k ?? void 0,
545
- alphaMap: B ?? void 0,
595
+ color: t,
596
+ map: X ?? void 0,
597
+ alphaMap: j ?? void 0,
546
598
  depthWrite: !1,
547
- depthTest: r !== "none" || o !== "none",
599
+ depthTest: r !== "none" || c !== "none",
548
600
  toneMapped: !1
549
601
  },
550
- U
602
+ K
551
603
  );
552
- }, Zt = (C) => Gn(C, D, qt.current);
553
- return kn(() => {
554
- var ht, dt;
555
- const C = oe.current, k = z.current, B = q.current, U = ue.current, Oe = he.current, De = de.current, ke = fe.current, Be = ie.current, we = (dt = (ht = L == null ? void 0 : L.detectionResults) == null ? void 0 : ht.faceLandmarks) == null ? void 0 : dt[i];
556
- if (!M || !C || !k || !B || !U || !Oe || !De || !ke || !Be)
604
+ }, un = (k) => Jn(k, F, cn.current);
605
+ return Zn(() => {
606
+ var Rt, Et;
607
+ const k = de.current, X = fe.current, j = me.current, K = ae.current, Xe = pe.current, je = Ee.current, Ke = we.current, Ye = Se.current, Ae = (Et = (Rt = I == null ? void 0 : I.detectionResults) == null ? void 0 : Rt.faceLandmarks) == null ? void 0 : Et[a];
608
+ if (!_ || !k || !X || !j || !K || !Xe || !je || !Ke || !Ye)
557
609
  return;
558
- if (!we || we.length < M.vertexCount) {
559
- Oe.visible = !1, De.visible = !1, ke.visible = !1, Be.visible = !1;
610
+ if (!Ae || Ae.length < _.vertexCount) {
611
+ Xe.visible = !1, je.visible = !1, Ke.visible = !1, Ye.visible = !1;
560
612
  return;
561
613
  }
562
- if (be.current !== M) {
563
- ae.current = new Float32Array(M.vertexCount * 3), pe.current = new Float32Array(M.uvs), me.current = new Float32Array(M.vertexCount * 2);
564
- const H = new R.BufferAttribute(ae.current, 3), G = new R.BufferAttribute(pe.current, 2), Z = new R.BufferAttribute(me.current, 2);
565
- C.setAttribute("position", H), C.setAttribute("uv", G), C.setAttribute("faceUv", Z), C.setIndex(new R.BufferAttribute(M.baseIndices, 1)), k.setAttribute("position", H), k.setAttribute("uv", G), k.setAttribute("faceUv", Z), k.setIndex(new R.BufferAttribute(M.mouthIndices, 1)), B.setAttribute("position", H), B.setAttribute("uv", G), B.setAttribute("faceUv", Z), B.setIndex(new R.BufferAttribute(M.eyeIndices, 1)), U.setAttribute("position", H), U.setAttribute("uv", G), U.setAttribute("faceUv", Z), U.setIndex(new R.BufferAttribute(M.noseIndices, 1)), G.needsUpdate = !0, be.current = M, Ee.current = !1;
614
+ if (Tt.current !== _) {
615
+ Ue.current = new Float32Array(_.vertexCount * 3), Be.current = new Float32Array(_.uvs), He.current = new Float32Array(_.vertexCount * 2);
616
+ const Y = new R.BufferAttribute(Ue.current, 3), B = new R.BufferAttribute(Be.current, 2), le = new R.BufferAttribute(He.current, 2);
617
+ k.setAttribute("position", Y), k.setAttribute("uv", B), k.setAttribute("faceUv", le), k.setIndex(new R.BufferAttribute(_.baseIndices, 1)), X.setAttribute("position", Y), X.setAttribute("uv", B), X.setAttribute("faceUv", le), X.setIndex(new R.BufferAttribute(_.mouthIndices, 1)), j.setAttribute("position", Y), j.setAttribute("uv", B), j.setAttribute("faceUv", le), j.setIndex(new R.BufferAttribute(_.eyeIndices, 1)), K.setAttribute("position", Y), K.setAttribute("uv", B), K.setAttribute("faceUv", le), K.setIndex(new R.BufferAttribute(_.noseIndices, 1)), B.needsUpdate = !0, Tt.current = _, ye.current = !1;
566
618
  }
567
- const Se = ae.current, Ue = me.current, ye = pe.current;
568
- if (!Se || !Ue || !ye) return;
569
- const ut = s === "shader" && (n === "originalFace" || n === "composite" && r === "none"), Qt = Math.min(we.length, M.vertexCount);
570
- for (let H = 0; H < Qt; H++) {
571
- const G = we[H], Z = H * 3, _e = H * 2, Ge = Zt(G);
572
- Se[Z] = Ge.x, Se[Z + 1] = Ge.y, Se[Z + 2] = Ge.z, Ue[_e] = G.x, Ue[_e + 1] = 1 - G.y, ut && (ye[_e] = G.x, ye[_e + 1] = 1 - G.y);
619
+ const Ce = Ue.current, We = He.current, Ie = Be.current;
620
+ if (!Ce || !We || !Ie) return;
621
+ const xt = n === "shader" && (o === "originalFace" || o === "composite" && r === "none"), bt = ss(L), Mt = bt ? ns(Ae) : null, hn = Math.min(Ae.length, _.vertexCount);
622
+ for (let Y = 0; Y < hn; Y++) {
623
+ const B = Ae[Y], le = bt && Mt ? rs(B, Mt, L, ln.current) : B, Ve = Y * 3, Pe = Y * 2, ze = un(le);
624
+ Ce[Ve] = ze.x, Ce[Ve + 1] = ze.y, Ce[Ve + 2] = ze.z, We[Pe] = B.x, We[Pe + 1] = 1 - B.y, xt && (Ie[Pe] = B.x, Ie[Pe + 1] = 1 - B.y);
573
625
  }
574
- ut ? (C.attributes.uv.needsUpdate = !0, Ee.current = !0) : Ee.current && (ye.set(M.uvs), C.attributes.uv.needsUpdate = !0, Ee.current = !1), Oe.visible = !0, De.visible = !0, ke.visible = !0, Be.visible = !0, C.attributes.position.needsUpdate = !0, C.attributes.faceUv.needsUpdate = !0, C.computeVertexNormals(), k.computeVertexNormals(), B.computeVertexNormals(), U.computeVertexNormals();
575
- }), /* @__PURE__ */ w(rt, { children: [
576
- /* @__PURE__ */ w("mesh", { ref: he, renderOrder: 10, frustumCulled: !1, children: [
577
- /* @__PURE__ */ T("bufferGeometry", { ref: oe }),
578
- Me(!1)
626
+ xt ? (k.attributes.uv.needsUpdate = !0, ye.current = !0) : ye.current && (Ie.set(_.uvs), k.attributes.uv.needsUpdate = !0, ye.current = !1), Xe.visible = !0, je.visible = !0, Ke.visible = !0, Ye.visible = !0, k.attributes.position.needsUpdate = !0, k.attributes.faceUv.needsUpdate = !0, k.computeVertexNormals(), X.computeVertexNormals(), j.computeVertexNormals(), K.computeVertexNormals();
627
+ }), /* @__PURE__ */ S(ft, { children: [
628
+ /* @__PURE__ */ S("mesh", { ref: pe, renderOrder: y, frustumCulled: !1, children: [
629
+ /* @__PURE__ */ x("bufferGeometry", { ref: de }),
630
+ Le(!1)
579
631
  ] }),
580
- /* @__PURE__ */ w("mesh", { ref: de, renderOrder: 12, frustumCulled: !1, children: [
581
- /* @__PURE__ */ T("bufferGeometry", { ref: z }),
582
- Me(u)
632
+ /* @__PURE__ */ S("mesh", { ref: Ee, renderOrder: y + 2, frustumCulled: !1, children: [
633
+ /* @__PURE__ */ x("bufferGeometry", { ref: fe }),
634
+ Le(d)
583
635
  ] }),
584
- /* @__PURE__ */ w("mesh", { ref: fe, renderOrder: 12, frustumCulled: !1, children: [
585
- /* @__PURE__ */ T("bufferGeometry", { ref: q }),
586
- Me(h)
636
+ /* @__PURE__ */ S("mesh", { ref: we, renderOrder: y + 2, frustumCulled: !1, children: [
637
+ /* @__PURE__ */ x("bufferGeometry", { ref: me }),
638
+ Le(m)
587
639
  ] }),
588
- /* @__PURE__ */ w("mesh", { ref: ie, renderOrder: 12, frustumCulled: !1, children: [
589
- /* @__PURE__ */ T("bufferGeometry", { ref: ue }),
590
- Me(d)
640
+ /* @__PURE__ */ S("mesh", { ref: Se, renderOrder: y + 2, frustumCulled: !1, children: [
641
+ /* @__PURE__ */ x("bufferGeometry", { ref: ae }),
642
+ Le(A)
591
643
  ] })
592
644
  ] });
593
- }, Nr = {
645
+ }, qr = {
594
646
  materialType: "basic",
595
647
  shaderPreset: "basicShader",
596
648
  textureMap: "none",
@@ -598,13 +650,15 @@ const Tt = {
598
650
  alphaOpacity: 1,
599
651
  side: "front",
600
652
  blendMode: "normal",
653
+ blendOpacity: 1,
601
654
  baseColor: "#38bdf8",
602
- opacity: 0.45
603
- }, Pr = {
655
+ opacity: 0.45,
656
+ compositeShading: !1
657
+ }, Zr = {
604
658
  mouth: !0,
605
659
  eyes: !0,
606
660
  nose: !0
607
- }, Fr = [
661
+ }, Qr = [
608
662
  { label: "Wireframe", value: "wireframe" },
609
663
  { label: "Basic", value: "basic" },
610
664
  { label: "Standard", value: "standard" },
@@ -613,22 +667,22 @@ const Tt = {
613
667
  { label: "Normal", value: "normal" },
614
668
  { label: "Matcap", value: "matcap" },
615
669
  { label: "Shader", value: "shader" }
616
- ], Or = [
670
+ ], $r = [
617
671
  { label: "Basic Shader", value: "basicShader" },
618
672
  { label: "Original Face", value: "originalFace" },
619
673
  { label: "Composite", value: "composite" }
620
- ], Dr = [
674
+ ], Jr = [
621
675
  { label: "Front", value: "front" },
622
676
  { label: "Back", value: "back" },
623
677
  { label: "Double", value: "double" }
624
- ], kr = [
678
+ ], eo = [
625
679
  { label: "None", value: "none" },
626
680
  { label: "UV Map 1", value: "canonical" },
627
681
  { label: "UV Map 2", value: "style2" }
628
- ], Br = [
682
+ ], to = [
629
683
  { label: "None", value: "none" },
630
684
  { label: "Default Mask", value: "canonical" }
631
- ], Ur = [
685
+ ], no = [
632
686
  { label: "Normal", value: "normal" },
633
687
  { label: "Add", value: "add" },
634
688
  { label: "Subtract", value: "subtract" },
@@ -641,20 +695,24 @@ const Tt = {
641
695
  { label: "Darken", value: "darken" },
642
696
  { label: "Difference", value: "difference" },
643
697
  { label: "Exclusion", value: "exclusion" }
644
- ], Gr = (i, e) => i === "basic" || i === "standard" || i === "physical" || i === "toon" || i === "shader" && e === "composite", Hr = (i, e) => i === "shader" && e === "composite", ss = `
698
+ ], so = (a, e) => a === "basic" || a === "standard" || a === "physical" || a === "toon" || a === "shader" && e === "composite", ro = (a, e) => a === "shader" && e === "composite", Ts = `
645
699
  varying vec2 vUv;
646
700
 
647
701
  void main() {
648
702
  vUv = uv;
649
703
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
650
704
  }
651
- `, rs = `
705
+ `, xs = `
652
706
  uniform sampler2D cameraTexture;
653
707
  uniform sampler2D retouchMaskTexture;
654
708
  uniform sampler2D mouthMaskTexture;
655
709
  uniform vec2 texelSize;
656
710
  uniform float retouchAmount;
657
711
  uniform float blurRadius;
712
+ uniform float detailPreservation;
713
+ uniform float blemishReduction;
714
+ uniform float rednessReduction;
715
+ uniform float blemishRadius;
658
716
  uniform float teethWhitening;
659
717
  uniform float previewMask;
660
718
  uniform float protectLandmarks;
@@ -714,23 +772,105 @@ const Tt = {
714
772
  return color / max(weightSum, 0.001);
715
773
  }
716
774
 
717
- vec3 whitenTeeth(vec3 color, float amount, float mouthRegion) {
775
+ float retouchLuminance(vec3 color) {
776
+ return dot(color, vec3(0.299, 0.587, 0.114));
777
+ }
778
+
779
+ void addMouthSample(inout vec3 color, inout float weightSum, vec2 uv, float weight) {
780
+ float mouth = readMouthMask(uv);
781
+ color += sampleCamera(uv) * mouth * weight;
782
+ weightSum += mouth * weight;
783
+ }
784
+
785
+ vec3 mouthAverage(vec2 uv) {
786
+ vec2 r = texelSize * 7.0;
787
+ vec3 color = vec3(0.0);
788
+ float weightSum = 0.0;
789
+
790
+ addMouthSample(color, weightSum, uv, 0.22);
791
+ addMouthSample(color, weightSum, uv + vec2(r.x, 0.0), 0.12);
792
+ addMouthSample(color, weightSum, uv - vec2(r.x, 0.0), 0.12);
793
+ addMouthSample(color, weightSum, uv + vec2(0.0, r.y), 0.12);
794
+ addMouthSample(color, weightSum, uv - vec2(0.0, r.y), 0.12);
795
+ addMouthSample(color, weightSum, uv + r, 0.08);
796
+ addMouthSample(color, weightSum, uv - r, 0.08);
797
+ addMouthSample(color, weightSum, uv + vec2(r.x, -r.y), 0.08);
798
+ addMouthSample(color, weightSum, uv + vec2(-r.x, r.y), 0.08);
799
+
800
+ return weightSum > 0.01 ? color / weightSum : sampleCamera(uv);
801
+ }
802
+
803
+ float teethCandidateMask(vec3 color, vec3 localMouth, float mouthRegion) {
804
+ float lum = retouchLuminance(color);
805
+ float localLum = retouchLuminance(localMouth);
718
806
  float maxChannel = max(max(color.r, color.g), color.b);
719
807
  float minChannel = min(min(color.r, color.g), color.b);
720
808
  float saturation = maxChannel - minChannel;
721
- float brightness = dot(color, vec3(0.299, 0.587, 0.114));
722
809
  float redness = max(color.r - max(color.g, color.b), 0.0);
723
- float greenBlueBalance = 1.0 - smoothstep(0.08, 0.24, abs(color.g - color.b));
810
+ float yellowness = max(min(color.r, color.g) - color.b, 0.0);
811
+ float pinkness = max(color.r - color.g * 0.92, 0.0) * max(color.r - color.b * 0.92, 0.0);
812
+ float relativeBrightness = lum - localLum;
813
+ float brightEnough = smoothstep(0.015, 0.18, relativeBrightness) * smoothstep(0.28, 0.58, lum);
814
+ float neutralEnough = 1.0 - smoothstep(0.16, 0.42, saturation);
815
+ float notRed = 1.0 - smoothstep(0.08, 0.28, redness + pinkness);
816
+ float notDark = smoothstep(0.18, 0.38, lum);
817
+ float plausibleWarmth = 1.0 - smoothstep(0.24, 0.5, yellowness);
818
+
819
+ return clamp(mouthRegion * brightEnough * max(neutralEnough, 0.35) * notRed * notDark * plausibleWarmth, 0.0, 1.0);
820
+ }
821
+
822
+ float softTeethMask(vec2 uv, vec3 color, vec3 localMouth, float mouthRegion) {
823
+ vec2 r = texelSize * 2.0;
824
+ float mask = teethCandidateMask(color, localMouth, mouthRegion) * 0.42;
825
+ mask += teethCandidateMask(sampleCamera(uv + vec2(r.x, 0.0)), localMouth, readMouthMask(uv + vec2(r.x, 0.0))) * 0.14;
826
+ mask += teethCandidateMask(sampleCamera(uv - vec2(r.x, 0.0)), localMouth, readMouthMask(uv - vec2(r.x, 0.0))) * 0.14;
827
+ mask += teethCandidateMask(sampleCamera(uv + vec2(0.0, r.y)), localMouth, readMouthMask(uv + vec2(0.0, r.y))) * 0.14;
828
+ mask += teethCandidateMask(sampleCamera(uv - vec2(0.0, r.y)), localMouth, readMouthMask(uv - vec2(0.0, r.y))) * 0.14;
829
+
830
+ return smoothstep(0.18, 0.62, mask);
831
+ }
832
+
833
+ vec3 whitenTeeth(vec2 uv, vec3 color, float amount, float mouthRegion) {
834
+ if (amount <= 0.001 || mouthRegion <= 0.001) return color;
835
+
836
+ vec3 localMouth = mouthAverage(uv);
837
+ float mask = softTeethMask(uv, color, localMouth, mouthRegion);
838
+ float lum = retouchLuminance(color);
839
+ float localLum = retouchLuminance(localMouth);
840
+ vec3 neutral = vec3(lum);
841
+ vec3 chromaCorrected = mix(color, neutral, 0.46);
842
+ chromaCorrected.r = min(chromaCorrected.r, color.r * 0.96 + lum * 0.04);
843
+ chromaCorrected.g = min(chromaCorrected.g * 1.02, 1.0);
844
+ chromaCorrected.b = min(max(chromaCorrected.b, color.b * 1.08), 1.0);
845
+ float lift = clamp((0.62 - lum) * 0.18 + max(lum - localLum, 0.0) * 0.08, 0.0, 0.12);
846
+ vec3 brightened = min(chromaCorrected + vec3(lift), vec3(1.0));
847
+
848
+ return mix(color, brightened, clamp(amount * mask, 0.0, 0.72));
849
+ }
850
+
851
+ vec3 reduceBlemishes(vec2 uv, vec3 original, vec3 localAverage, vec3 skinBase, float skinMask) {
852
+ float originalLum = retouchLuminance(original);
853
+ float localLum = retouchLuminance(localAverage);
854
+ float redness = max(original.r - max(original.g, original.b), 0.0);
855
+ float localRedness = max(localAverage.r - max(localAverage.g, localAverage.b), 0.0);
856
+ float excessRedness = max(redness - localRedness * 0.82, 0.0);
857
+ float darkSpot = max(localLum - originalLum, 0.0);
858
+ float contrast = length(original - localAverage);
724
859
  float candidate =
725
- smoothstep(0.34, 0.62, brightness) *
726
- (1.0 - smoothstep(0.14, 0.32, redness)) *
727
- (1.0 - smoothstep(0.18, 0.42, saturation)) *
728
- greenBlueBalance;
729
- float whiteningMask = clamp(mouthRegion * candidate, 0.0, 1.0);
730
- vec3 desaturated = mix(color, vec3(brightness), 0.42);
731
- vec3 brightened = min(desaturated + vec3(0.16), vec3(1.0));
860
+ smoothstep(0.025, 0.13, excessRedness * rednessReduction) +
861
+ smoothstep(0.035, 0.18, darkSpot) +
862
+ smoothstep(0.045, 0.22, contrast);
863
+ float blemishMask = clamp(candidate * 0.45, 0.0, 1.0) * skinMask * blemishReduction;
732
864
 
733
- return mix(color, brightened, clamp(amount * whiteningMask * 0.38, 0.0, 1.0));
865
+ vec3 chromaReduced = vec3(
866
+ mix(original.r, min(original.r, localAverage.r * 1.04), rednessReduction * blemishMask),
867
+ mix(original.g, max(original.g, localAverage.g * 0.98), 0.25 * blemishMask),
868
+ mix(original.b, max(original.b, localAverage.b * 0.98), 0.25 * blemishMask)
869
+ );
870
+ vec3 texture = original - localAverage;
871
+ vec3 repaired = clamp(skinBase + texture * detailPreservation * 0.35, 0.0, 1.0);
872
+
873
+ return mix(chromaReduced, repaired, blemishMask);
734
874
  }
735
875
 
736
876
  void main() {
@@ -742,7 +882,7 @@ const Tt = {
742
882
  float sharpPreview = 1.0 - step(0.001, retouchAmount + blurRadius);
743
883
  float retouchPreview = mix(masks.x, masks.z, sharpPreview);
744
884
  float protectedPreview = mix(masks.y, step(0.08, masks.y), sharpPreview);
745
- float whiteningPreview = mouthMask * teethWhitening;
885
+ float whiteningPreview = softTeethMask(vUv, original, mouthAverage(vUv), mouthMask) * teethWhitening;
746
886
  vec3 facePreview = vec3(retouchPreview, 0.08, 0.08);
747
887
  vec3 featurePreview = vec3(0.05, protectedPreview, 0.1);
748
888
  vec3 whiteningMaskPreview = vec3(whiteningPreview, whiteningPreview, 0.05);
@@ -757,70 +897,85 @@ const Tt = {
757
897
  vec3 smallBlur = maskedBlurCamera(vUv, max(0.0, effectiveBlurRadius * 0.45));
758
898
  vec3 largeBlur = maskedBlurCamera(vUv, max(0.0, effectiveBlurRadius));
759
899
  vec3 detail = original - smallBlur;
760
- float detailAmount = mix(0.5, 0.9, masks.y);
900
+ float detailAmount = mix(detailPreservation, 0.9, masks.y);
761
901
  vec3 smoothed = clamp(largeBlur + detail * detailAmount, 0.0, 1.0);
762
902
  vec3 color = mix(original, smoothed, min(retouchAmount, 0.72) * masks.x);
763
- color = whitenTeeth(color, teethWhitening, mouthMask);
903
+ vec3 blemishAverage = maskedBlurCamera(vUv, max(1.0, blemishRadius));
904
+ color = reduceBlemishes(vUv, color, blemishAverage, smoothed, masks.x);
905
+ color = whitenTeeth(vUv, color, teethWhitening, mouthMask);
764
906
  gl_FragColor = vec4(color, 1.0);
765
907
  #include <colorspace_fragment>
766
908
  }
767
- `, jr = ({
768
- retouchMask: i,
909
+ `, oo = ({
910
+ retouchMask: a,
769
911
  mouthMask: e,
770
912
  retouchAmount: t,
771
913
  blurRadius: s,
772
- teethWhitening: n,
773
- previewMask: r,
774
- protectLandmarks: o
914
+ detailPreservation: n = 0.62,
915
+ blemishReduction: o = 0.35,
916
+ rednessReduction: r = 0.45,
917
+ blemishRadius: c = 3,
918
+ teethWhitening: i,
919
+ previewMask: l,
920
+ protectLandmarks: h,
921
+ renderOrder: u = -1e3
775
922
  }) => {
776
- const { camera: c, size: a } = kt(), l = Ut(), u = j(
923
+ const { camera: d, size: m } = qt(), A = Qt(), g = W(
777
924
  () => ({
778
925
  cameraTexture: { value: null },
779
- retouchMaskTexture: { value: i },
926
+ retouchMaskTexture: { value: a },
780
927
  mouthMaskTexture: { value: e },
781
928
  texelSize: { value: new R.Vector2(1 / 1280, 1 / 720) },
782
929
  retouchAmount: { value: t },
783
930
  blurRadius: { value: s },
784
- teethWhitening: { value: n },
931
+ detailPreservation: { value: n },
932
+ blemishReduction: { value: o },
933
+ rednessReduction: { value: r },
934
+ blemishRadius: { value: c },
935
+ teethWhitening: { value: i },
785
936
  previewMask: { value: 0 },
786
937
  protectLandmarks: { value: 1 }
787
938
  }),
788
- [e, i]
789
- ), h = j(() => {
790
- if (!(c instanceof R.PerspectiveCamera))
939
+ [e, a]
940
+ ), p = W(() => {
941
+ if (!d.isPerspectiveCamera)
791
942
  return [10, 10];
792
- const g = (c.position.z || 5) - -1, A = R.MathUtils.degToRad(c.fov), m = 2 * Math.tan(A / 2) * g;
793
- return [m * (a.width / a.height), m];
794
- }, [c, a]);
943
+ const f = d, b = (f.position.z || 5) - -1, E = R.MathUtils.degToRad(f.fov), L = 2 * Math.tan(E / 2) * b;
944
+ return [L * (m.width / m.height), L];
945
+ }, [d, m]);
795
946
  return $(() => {
796
- u.cameraTexture.value = l ?? null, u.retouchMaskTexture.value = i, u.mouthMaskTexture.value = e, u.texelSize.value.set(1 / Math.max(a.width, 1), 1 / Math.max(a.height, 1)), u.retouchAmount.value = t, u.blurRadius.value = s, u.teethWhitening.value = n, u.previewMask.value = r ? 1 : 0, u.protectLandmarks.value = o ? 1 : 0;
947
+ g.cameraTexture.value = A ?? null, g.retouchMaskTexture.value = a, g.mouthMaskTexture.value = e, g.texelSize.value.set(1 / Math.max(m.width, 1), 1 / Math.max(m.height, 1)), g.retouchAmount.value = t, g.blurRadius.value = s, g.detailPreservation.value = n, g.blemishReduction.value = o, g.rednessReduction.value = r, g.blemishRadius.value = c, g.teethWhitening.value = i, g.previewMask.value = l ? 1 : 0, g.protectLandmarks.value = h ? 1 : 0;
797
948
  }, [
798
949
  s,
799
- l,
800
- r,
950
+ c,
801
951
  o,
952
+ A,
953
+ n,
954
+ l,
955
+ h,
802
956
  t,
957
+ r,
803
958
  e,
959
+ a,
804
960
  i,
805
- n,
806
- a.height,
807
- a.width,
808
- u
809
- ]), l ? /* @__PURE__ */ T("group", { position: [0, 0, -1], children: /* @__PURE__ */ w("mesh", { renderOrder: -1e3, children: [
810
- /* @__PURE__ */ T("planeGeometry", { args: h }),
811
- /* @__PURE__ */ T(
961
+ m.height,
962
+ m.width,
963
+ g
964
+ ]), A ? /* @__PURE__ */ x("group", { position: [0, 0, -1], children: /* @__PURE__ */ S("mesh", { renderOrder: u, children: [
965
+ /* @__PURE__ */ x("planeGeometry", { args: p }),
966
+ /* @__PURE__ */ x(
812
967
  "shaderMaterial",
813
968
  {
814
- uniforms: u,
815
- vertexShader: ss,
816
- fragmentShader: rs,
969
+ uniforms: g,
970
+ vertexShader: Ts,
971
+ fragmentShader: xs,
817
972
  depthTest: !1,
818
973
  depthWrite: !1,
819
974
  toneMapped: !1
820
975
  }
821
976
  )
822
977
  ] }) }) : null;
823
- }, ct = 512, Gt = [
978
+ }, At = 512, $t = [
824
979
  10,
825
980
  338,
826
981
  297,
@@ -857,7 +1012,7 @@ const Tt = {
857
1012
  103,
858
1013
  67,
859
1014
  109
860
- ], os = [
1015
+ ], bs = [
861
1016
  33,
862
1017
  246,
863
1018
  161,
@@ -874,7 +1029,7 @@ const Tt = {
874
1029
  144,
875
1030
  163,
876
1031
  7
877
- ], is = [
1032
+ ], Ms = [
878
1033
  362,
879
1034
  398,
880
1035
  384,
@@ -891,7 +1046,7 @@ const Tt = {
891
1046
  380,
892
1047
  381,
893
1048
  382
894
- ], as = [
1049
+ ], Rs = [
895
1050
  61,
896
1051
  146,
897
1052
  91,
@@ -912,7 +1067,7 @@ const Tt = {
912
1067
  39,
913
1068
  40,
914
1069
  185
915
- ], Ht = [
1070
+ ], Jt = [
916
1071
  78,
917
1072
  95,
918
1073
  88,
@@ -933,38 +1088,48 @@ const Tt = {
933
1088
  81,
934
1089
  80,
935
1090
  191
936
- ], cs = [70, 63, 105, 66, 107, 55, 65, 52, 53, 46], ls = [336, 296, 334, 293, 300, 276, 283, 282, 295, 285], us = [
937
- os,
938
- is,
939
- as,
940
- Ht,
941
- cs,
942
- ls
943
- ], xt = (i, e, t) => {
944
- lt(i, e, Gt, t);
945
- }, hs = (i, e, t) => {
946
- us.forEach((s) => lt(i, e, s, t));
947
- }, vt = (i, e, t) => {
948
- const s = i[e];
1091
+ ], Es = [70, 63, 105, 66, 107, 55, 65, 52, 53, 46], ws = [336, 296, 334, 293, 300, 276, 283, 282, 295, 285], Ss = [
1092
+ bs,
1093
+ Ms,
1094
+ Rs,
1095
+ Jt,
1096
+ Es,
1097
+ ws
1098
+ ], It = (a, e, t) => {
1099
+ vt(a, e, $t, t);
1100
+ }, Pt = (a, e, t) => {
1101
+ const s = ne(e, 10, t), n = ne(e, 103, t), o = ne(e, 332, t), r = ne(e, 105, t), c = ne(e, 334, t);
1102
+ if (!s || !n || !o || !r || !c) return;
1103
+ const i = (r.y + c.y) * 0.5, l = Math.abs(o.x - n.x), h = Math.max(Math.abs(i - s.y) * 0.72, l * 0.08), u = Math.max(0, s.y - h), d = h * 0.34;
1104
+ a.beginPath(), a.moveTo(n.x, n.y - d), a.quadraticCurveTo((n.x + s.x) * 0.5, u, s.x, u), a.quadraticCurveTo(
1105
+ (o.x + s.x) * 0.5,
1106
+ u,
1107
+ o.x,
1108
+ o.y - d
1109
+ ), a.lineTo(c.x, i), a.quadraticCurveTo(s.x, i + h * 0.16, r.x, i), a.closePath(), a.fill();
1110
+ }, ys = (a, e, t) => {
1111
+ Ss.forEach((s) => vt(a, e, s, t));
1112
+ }, ne = (a, e, t) => {
1113
+ const s = a[e];
949
1114
  return s ? {
950
1115
  x: s.x * t,
951
1116
  y: s.y * t
952
1117
  } : null;
953
- }, lt = (i, e, t, s) => {
954
- const n = vt(e, t[0], s);
1118
+ }, vt = (a, e, t, s) => {
1119
+ const n = ne(e, t[0], s);
955
1120
  if (n) {
956
- i.beginPath(), i.moveTo(n.x, n.y);
957
- for (let r = 1; r < t.length; r += 1) {
958
- const o = vt(e, t[r], s);
959
- o && i.lineTo(o.x, o.y);
1121
+ a.beginPath(), a.moveTo(n.x, n.y);
1122
+ for (let o = 1; o < t.length; o += 1) {
1123
+ const r = ne(e, t[o], s);
1124
+ r && a.lineTo(r.x, r.y);
960
1125
  }
961
- i.closePath(), i.fill();
1126
+ a.closePath(), a.fill();
962
1127
  }
963
- }, ds = (i, e, t = ct) => {
964
- i.clearRect(0, 0, t, t), e != null && e.length && (i.save(), i.globalCompositeOperation = "lighter", i.fillStyle = "rgb(0, 0, 255)", xt(i, e, t), i.restore(), i.save(), i.globalCompositeOperation = "lighter", i.filter = "blur(8px)", i.fillStyle = "rgb(255, 0, 0)", xt(i, e, t), i.restore(), i.save(), i.globalCompositeOperation = "lighter", i.filter = "blur(3px)", i.fillStyle = "rgb(0, 255, 0)", hs(i, e, t), i.restore());
965
- }, fs = (i, e, t = ct) => {
966
- i.clearRect(0, 0, t, t), e != null && e.length && (i.save(), i.filter = "blur(2px)", i.fillStyle = "rgb(255, 255, 255)", lt(i, e, Ht, t), i.restore());
967
- }, ps = 0.1, ms = 0.48, gs = 0.012, As = 1, Ts = 1.1, xs = 1.15, vs = 0.04, bs = [
1128
+ }, _s = (a, e, t = At, s = {}) => {
1129
+ a.clearRect(0, 0, t, t), e != null && e.length && (a.save(), a.globalCompositeOperation = "lighter", a.fillStyle = "rgb(0, 0, 255)", It(a, e, t), s.foreheadCoverage && Pt(a, e, t), a.restore(), a.save(), a.globalCompositeOperation = "lighter", a.filter = "blur(8px)", a.fillStyle = "rgb(255, 0, 0)", It(a, e, t), s.foreheadCoverage && Pt(a, e, t), a.restore(), a.save(), a.globalCompositeOperation = "lighter", a.filter = "blur(3px)", a.fillStyle = "rgb(0, 255, 0)", ys(a, e, t), a.restore());
1130
+ }, Ls = (a, e, t = At) => {
1131
+ a.clearRect(0, 0, t, t), e != null && e.length && (a.save(), a.filter = "blur(2px)", a.fillStyle = "rgb(255, 255, 255)", vt(a, e, Jt, t), a.restore());
1132
+ }, Cs = 0.1, Is = 0.48, Ps = 0.012, Ns = 1, Fs = 1.1, ks = 1.15, Os = 0.04, Ds = [
968
1133
  61,
969
1134
  146,
970
1135
  91,
@@ -996,7 +1161,7 @@ const Tt = {
996
1161
  311,
997
1162
  310,
998
1163
  415
999
- ], Es = [
1164
+ ], Us = [
1000
1165
  33,
1001
1166
  7,
1002
1167
  163,
@@ -1013,7 +1178,7 @@ const Tt = {
1013
1178
  160,
1014
1179
  161,
1015
1180
  246
1016
- ], Rs = [
1181
+ ], Bs = [
1017
1182
  362,
1018
1183
  382,
1019
1184
  381,
@@ -1030,7 +1195,7 @@ const Tt = {
1030
1195
  385,
1031
1196
  384,
1032
1197
  398
1033
- ], Ms = [70, 63, 105, 66, 107, 55, 65, 52, 53, 46], ws = [336, 296, 334, 293, 300, 285, 295, 282, 283, 276], Ss = [
1198
+ ], Hs = [70, 63, 105, 66, 107, 55, 65, 52, 53, 46], Gs = [336, 296, 334, 293, 300, 285, 295, 282, 283, 276], Xs = [
1034
1199
  1,
1035
1200
  2,
1036
1201
  4,
@@ -1055,14 +1220,14 @@ const Tt = {
1055
1220
  344,
1056
1221
  358,
1057
1222
  440
1058
- ], ys = [
1059
- bs,
1060
- Es,
1061
- Rs,
1062
- Ms,
1063
- ws,
1064
- Ss
1065
- ], _s = [
1223
+ ], js = [
1224
+ Ds,
1225
+ Us,
1226
+ Bs,
1227
+ Hs,
1228
+ Gs,
1229
+ Xs
1230
+ ], Ks = [
1066
1231
  61,
1067
1232
  91,
1068
1233
  84,
@@ -1121,86 +1286,86 @@ const Tt = {
1121
1286
  326,
1122
1287
  2,
1123
1288
  195
1124
- ], Le = (i) => Math.min(Math.max(i, 0), 1), bt = (i, e, t, s, n, r) => {
1125
- let o = 1, c = 1, a = 0, l = 0, u = 0;
1126
- if (e.forEach((v) => {
1127
- const b = i[v];
1128
- b && (o = Math.min(o, b.x), c = Math.min(c, b.y), a = Math.max(a, b.x), l = Math.max(l, b.y), u += 1);
1129
- }), u === 0) return null;
1130
- const h = a - o, d = l - c, p = Math.max(h * t, r), g = Math.max(d * t, r), A = Le(o - p), m = Le(c - g), f = Le(a + p), x = Le(l + g);
1289
+ ], Ne = (a) => Math.min(Math.max(a, 0), 1), Nt = (a, e, t, s, n, o) => {
1290
+ let r = 1, c = 1, i = 0, l = 0, h = 0;
1291
+ if (e.forEach((T) => {
1292
+ const b = a[T];
1293
+ b && (r = Math.min(r, b.x), c = Math.min(c, b.y), i = Math.max(i, b.x), l = Math.max(l, b.y), h += 1);
1294
+ }), h === 0) return null;
1295
+ const u = i - r, d = l - c, m = Math.max(u * t, o), A = Math.max(d * t, o), g = Ne(r - m), p = Ne(c - A), f = Ne(i + m), v = Ne(l + A);
1131
1296
  return {
1132
- centerX: (A + f) * 0.5,
1133
- centerY: (m + x) * 0.5,
1134
- radiusX: Math.max((f - A) * 0.5, r),
1135
- radiusY: Math.max((x - m) * 0.5, r),
1297
+ centerX: (g + f) * 0.5,
1298
+ centerY: (p + v) * 0.5,
1299
+ radiusX: Math.max((f - g) * 0.5, o),
1300
+ radiusY: Math.max((v - p) * 0.5, o),
1136
1301
  strength: s,
1137
1302
  kind: n
1138
1303
  };
1139
- }, Ls = (i, e, t) => i ? {
1140
- centerX: i.x,
1141
- centerY: i.y,
1304
+ }, Ys = (a, e, t) => a ? {
1305
+ centerX: a.x,
1306
+ centerY: a.y,
1142
1307
  radiusX: e,
1143
1308
  radiusY: e,
1144
1309
  strength: t,
1145
1310
  kind: "feature"
1146
- } : null, Is = (i, e) => {
1147
- if (!(i != null && i.length)) return [];
1148
- const t = (e == null ? void 0 : e.faceOvalIndices) ?? Gt, s = (e == null ? void 0 : e.featureGroups) ?? ys, n = (e == null ? void 0 : e.featurePointIndices) ?? _s, r = (e == null ? void 0 : e.faceBoundsExpansion) ?? ps, o = (e == null ? void 0 : e.featureBoundsExpansion) ?? ms, c = (e == null ? void 0 : e.minRegionRadius) ?? gs, a = (e == null ? void 0 : e.faceRegionStrength) ?? As, l = (e == null ? void 0 : e.featureRegionStrength) ?? Ts, u = (e == null ? void 0 : e.featurePointRegionStrength) ?? xs, h = (e == null ? void 0 : e.featurePointRadiusRatio) ?? vs, d = [], p = bt(
1149
- i,
1150
- t,
1151
- r,
1311
+ } : null, Ws = (a, e) => {
1312
+ if (!(a != null && a.length)) return [];
1313
+ const t = (e == null ? void 0 : e.faceOvalIndices) ?? $t, s = (e == null ? void 0 : e.featureGroups) ?? js, n = (e == null ? void 0 : e.featurePointIndices) ?? Ks, o = (e == null ? void 0 : e.faceBoundsExpansion) ?? Cs, r = (e == null ? void 0 : e.featureBoundsExpansion) ?? Is, c = (e == null ? void 0 : e.minRegionRadius) ?? Ps, i = (e == null ? void 0 : e.faceRegionStrength) ?? Ns, l = (e == null ? void 0 : e.featureRegionStrength) ?? Fs, h = (e == null ? void 0 : e.featurePointRegionStrength) ?? ks, u = (e == null ? void 0 : e.featurePointRadiusRatio) ?? Os, d = [], m = Nt(
1152
1314
  a,
1315
+ t,
1316
+ o,
1317
+ i,
1153
1318
  "face",
1154
1319
  c
1155
1320
  );
1156
- p && d.push(p);
1157
- const g = Math.max(
1158
- Math.max((p == null ? void 0 : p.radiusX) ?? 0, (p == null ? void 0 : p.radiusY) ?? 0) * h,
1321
+ m && d.push(m);
1322
+ const A = Math.max(
1323
+ Math.max((m == null ? void 0 : m.radiusX) ?? 0, (m == null ? void 0 : m.radiusY) ?? 0) * u,
1159
1324
  c * 1.35
1160
1325
  );
1161
- return s.forEach((A) => {
1162
- const m = bt(
1163
- i,
1164
- A,
1165
- o,
1326
+ return s.forEach((g) => {
1327
+ const p = Nt(
1328
+ a,
1329
+ g,
1330
+ r,
1166
1331
  l,
1167
1332
  "feature",
1168
1333
  c
1169
1334
  );
1170
- m && d.push(m);
1171
- }), n.forEach((A) => {
1172
- const m = Ls(
1173
- i[A],
1174
- g,
1175
- u
1335
+ p && d.push(p);
1336
+ }), n.forEach((g) => {
1337
+ const p = Ys(
1338
+ a[g],
1339
+ A,
1340
+ h
1176
1341
  );
1177
- m && d.push(m);
1342
+ p && d.push(p);
1178
1343
  }), d;
1179
- }, Et = (i) => {
1344
+ }, Ft = (a) => {
1180
1345
  const e = document.createElement("canvas");
1181
- e.width = i, e.height = i;
1346
+ e.width = a, e.height = a;
1182
1347
  const t = e.getContext("2d", { willReadFrequently: !1 });
1183
1348
  if (!t) throw new Error("Unable to create face retouch mask context");
1184
1349
  const s = new R.CanvasTexture(e);
1185
1350
  return s.colorSpace = R.NoColorSpace, s.minFilter = R.LinearFilter, s.magFilter = R.LinearFilter, s.generateMipmaps = !1, s.needsUpdate = !0, { canvas: e, context: t, texture: s };
1186
- }, Xr = (i, e = ct) => {
1187
- const { mask: t, mouthMask: s } = j(() => ({
1188
- mask: Et(e),
1189
- mouthMask: Et(e)
1351
+ }, ao = (a, e = At, t = {}) => {
1352
+ const { mask: s, mouthMask: n } = W(() => ({
1353
+ mask: Ft(e),
1354
+ mouthMask: Ft(e)
1190
1355
  }), [e]);
1191
1356
  return $(() => {
1192
- let n = 0;
1357
+ let o = 0;
1193
1358
  const r = () => {
1194
- var c, a;
1195
- n = requestAnimationFrame(r);
1196
- const o = (a = (c = i == null ? void 0 : i.detectionResults) == null ? void 0 : c.faceLandmarks) == null ? void 0 : a[0];
1197
- ds(t.context, o, e), fs(s.context, o, e), t.texture.needsUpdate = !0, s.texture.needsUpdate = !0;
1359
+ var i, l;
1360
+ o = requestAnimationFrame(r);
1361
+ const c = (l = (i = a == null ? void 0 : a.detectionResults) == null ? void 0 : i.faceLandmarks) == null ? void 0 : l[0];
1362
+ _s(s.context, c, e, t), Ls(n.context, c, e), s.texture.needsUpdate = !0, n.texture.needsUpdate = !0;
1198
1363
  };
1199
1364
  return r(), () => {
1200
- cancelAnimationFrame(n);
1365
+ cancelAnimationFrame(o);
1201
1366
  };
1202
- }, [i, t.context, t.texture, s.context, s.texture, e]), { canvas: t.canvas, texture: t.texture, mouthTexture: s.texture };
1203
- }, Cs = (i) => i.map(
1367
+ }, [a, s.context, s.texture, n.context, n.texture, t, e]), { canvas: s.canvas, texture: s.texture, mouthTexture: n.texture };
1368
+ }, Vs = (a) => a.map(
1204
1369
  (e) => [
1205
1370
  e.centerX.toFixed(4),
1206
1371
  e.centerY.toFixed(4),
@@ -1209,107 +1374,107 @@ const Tt = {
1209
1374
  e.strength.toFixed(2),
1210
1375
  e.kind
1211
1376
  ].join(",")
1212
- ).join("|"), Kr = (i, e) => {
1213
- const [t, s] = at([]);
1377
+ ).join("|"), io = (a, e) => {
1378
+ const [t, s] = gt([]);
1214
1379
  return $(() => {
1215
- let n = 0, r = "";
1216
- const o = () => {
1217
- var u, h;
1218
- n = requestAnimationFrame(o);
1219
- const c = (h = (u = i == null ? void 0 : i.detectionResults) == null ? void 0 : u.faceLandmarks) == null ? void 0 : h[0], a = Is(c, e), l = Cs(a);
1220
- l !== r && (r = l, s(a));
1380
+ let n = 0, o = "";
1381
+ const r = () => {
1382
+ var h, u;
1383
+ n = requestAnimationFrame(r);
1384
+ const c = (u = (h = a == null ? void 0 : a.detectionResults) == null ? void 0 : h.faceLandmarks) == null ? void 0 : u[0], i = Ws(c, e), l = Vs(i);
1385
+ l !== o && (o = l, s(i));
1221
1386
  };
1222
- return o(), () => {
1387
+ return r(), () => {
1223
1388
  cancelAnimationFrame(n);
1224
1389
  };
1225
- }, [i]), t;
1390
+ }, [a]), t;
1226
1391
  };
1227
- function Rt(i, e) {
1228
- if (e === $t)
1229
- return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), i;
1230
- if (e === tt || e === _t) {
1231
- let t = i.getIndex();
1392
+ function kt(a, e) {
1393
+ if (e === dn)
1394
+ return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), a;
1395
+ if (e === ut || e === Ht) {
1396
+ let t = a.getIndex();
1232
1397
  if (t === null) {
1233
- const o = [], c = i.getAttribute("position");
1398
+ const r = [], c = a.getAttribute("position");
1234
1399
  if (c !== void 0) {
1235
- for (let a = 0; a < c.count; a++)
1236
- o.push(a);
1237
- i.setIndex(o), t = i.getIndex();
1400
+ for (let i = 0; i < c.count; i++)
1401
+ r.push(i);
1402
+ a.setIndex(r), t = a.getIndex();
1238
1403
  } else
1239
- return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), i;
1404
+ return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), a;
1240
1405
  }
1241
1406
  const s = t.count - 2, n = [];
1242
- if (e === tt)
1243
- for (let o = 1; o <= s; o++)
1244
- n.push(t.getX(0)), n.push(t.getX(o)), n.push(t.getX(o + 1));
1407
+ if (e === ut)
1408
+ for (let r = 1; r <= s; r++)
1409
+ n.push(t.getX(0)), n.push(t.getX(r)), n.push(t.getX(r + 1));
1245
1410
  else
1246
- for (let o = 0; o < s; o++)
1247
- o % 2 === 0 ? (n.push(t.getX(o)), n.push(t.getX(o + 1)), n.push(t.getX(o + 2))) : (n.push(t.getX(o + 2)), n.push(t.getX(o + 1)), n.push(t.getX(o)));
1411
+ for (let r = 0; r < s; r++)
1412
+ r % 2 === 0 ? (n.push(t.getX(r)), n.push(t.getX(r + 1)), n.push(t.getX(r + 2))) : (n.push(t.getX(r + 2)), n.push(t.getX(r + 1)), n.push(t.getX(r)));
1248
1413
  n.length / 3 !== s && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
1249
- const r = i.clone();
1250
- return r.setIndex(n), r.clearGroups(), r;
1414
+ const o = a.clone();
1415
+ return o.setIndex(n), o.clearGroups(), o;
1251
1416
  } else
1252
- return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), i;
1417
+ return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), a;
1253
1418
  }
1254
- class Ns extends Jt {
1419
+ class zs extends fn {
1255
1420
  constructor(e) {
1256
1421
  super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
1257
- return new ks(t);
1258
- }), this.register(function(t) {
1259
- return new Bs(t);
1422
+ return new Js(t);
1260
1423
  }), this.register(function(t) {
1261
- return new Ws(t);
1424
+ return new er(t);
1262
1425
  }), this.register(function(t) {
1263
- return new zs(t);
1426
+ return new lr(t);
1264
1427
  }), this.register(function(t) {
1265
- return new qs(t);
1428
+ return new ur(t);
1266
1429
  }), this.register(function(t) {
1267
- return new Gs(t);
1430
+ return new hr(t);
1268
1431
  }), this.register(function(t) {
1269
- return new Hs(t);
1432
+ return new nr(t);
1270
1433
  }), this.register(function(t) {
1271
- return new js(t);
1434
+ return new sr(t);
1272
1435
  }), this.register(function(t) {
1273
- return new Xs(t);
1436
+ return new rr(t);
1274
1437
  }), this.register(function(t) {
1275
- return new Ds(t);
1438
+ return new or(t);
1276
1439
  }), this.register(function(t) {
1277
- return new Ks(t);
1440
+ return new $s(t);
1278
1441
  }), this.register(function(t) {
1279
- return new Us(t);
1442
+ return new ar(t);
1280
1443
  }), this.register(function(t) {
1281
- return new Vs(t);
1444
+ return new tr(t);
1282
1445
  }), this.register(function(t) {
1283
- return new Ys(t);
1446
+ return new cr(t);
1284
1447
  }), this.register(function(t) {
1285
- return new Fs(t);
1448
+ return new ir(t);
1286
1449
  }), this.register(function(t) {
1287
1450
  return new Zs(t);
1288
1451
  }), this.register(function(t) {
1289
- return new Qs(t);
1452
+ return new dr(t);
1453
+ }), this.register(function(t) {
1454
+ return new fr(t);
1290
1455
  });
1291
1456
  }
1292
1457
  load(e, t, s, n) {
1293
- const r = this;
1294
- let o;
1458
+ const o = this;
1459
+ let r;
1295
1460
  if (this.resourcePath !== "")
1296
- o = this.resourcePath;
1461
+ r = this.resourcePath;
1297
1462
  else if (this.path !== "") {
1298
- const l = xe.extractUrlBase(e);
1299
- o = xe.resolveURL(l, this.path);
1463
+ const l = be.extractUrlBase(e);
1464
+ r = be.resolveURL(l, this.path);
1300
1465
  } else
1301
- o = xe.extractUrlBase(e);
1466
+ r = be.extractUrlBase(e);
1302
1467
  this.manager.itemStart(e);
1303
1468
  const c = function(l) {
1304
- n ? n(l) : console.error(l), r.manager.itemError(e), r.manager.itemEnd(e);
1305
- }, a = new Lt(this.manager);
1306
- a.setPath(this.path), a.setResponseType("arraybuffer"), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(e, function(l) {
1469
+ n ? n(l) : console.error(l), o.manager.itemError(e), o.manager.itemEnd(e);
1470
+ }, i = new Gt(this.manager);
1471
+ i.setPath(this.path), i.setResponseType("arraybuffer"), i.setRequestHeader(this.requestHeader), i.setWithCredentials(this.withCredentials), i.load(e, function(l) {
1307
1472
  try {
1308
- r.parse(l, o, function(u) {
1309
- t(u), r.manager.itemEnd(e);
1473
+ o.parse(l, r, function(h) {
1474
+ t(h), o.manager.itemEnd(e);
1310
1475
  }, c);
1311
- } catch (u) {
1312
- c(u);
1476
+ } catch (h) {
1477
+ c(h);
1313
1478
  }
1314
1479
  }, s, c);
1315
1480
  }
@@ -1329,28 +1494,28 @@ class Ns extends Jt {
1329
1494
  return this.pluginCallbacks.indexOf(e) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this;
1330
1495
  }
1331
1496
  parse(e, t, s, n) {
1332
- let r;
1333
- const o = {}, c = {}, a = new TextDecoder();
1497
+ let o;
1498
+ const r = {}, c = {}, i = new TextDecoder();
1334
1499
  if (typeof e == "string")
1335
- r = JSON.parse(e);
1500
+ o = JSON.parse(e);
1336
1501
  else if (e instanceof ArrayBuffer)
1337
- if (a.decode(new Uint8Array(e, 0, 4)) === jt) {
1502
+ if (i.decode(new Uint8Array(e, 0, 4)) === en) {
1338
1503
  try {
1339
- o[E.KHR_BINARY_GLTF] = new $s(e);
1340
- } catch (h) {
1341
- n && n(h);
1504
+ r[M.KHR_BINARY_GLTF] = new mr(e);
1505
+ } catch (u) {
1506
+ n && n(u);
1342
1507
  return;
1343
1508
  }
1344
- r = JSON.parse(o[E.KHR_BINARY_GLTF].content);
1509
+ o = JSON.parse(r[M.KHR_BINARY_GLTF].content);
1345
1510
  } else
1346
- r = JSON.parse(a.decode(e));
1511
+ o = JSON.parse(i.decode(e));
1347
1512
  else
1348
- r = e;
1349
- if (r.asset === void 0 || r.asset.version[0] < 2) {
1513
+ o = e;
1514
+ if (o.asset === void 0 || o.asset.version[0] < 2) {
1350
1515
  n && n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
1351
1516
  return;
1352
1517
  }
1353
- const l = new hr(r, {
1518
+ const l = new yr(o, {
1354
1519
  path: t || this.resourcePath || "",
1355
1520
  crossOrigin: this.crossOrigin,
1356
1521
  requestHeader: this.requestHeader,
@@ -1359,57 +1524,57 @@ class Ns extends Jt {
1359
1524
  meshoptDecoder: this.meshoptDecoder
1360
1525
  });
1361
1526
  l.fileLoader.setRequestHeader(this.requestHeader);
1362
- for (let u = 0; u < this.pluginCallbacks.length; u++) {
1363
- const h = this.pluginCallbacks[u](l);
1364
- h.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), c[h.name] = h, o[h.name] = !0;
1527
+ for (let h = 0; h < this.pluginCallbacks.length; h++) {
1528
+ const u = this.pluginCallbacks[h](l);
1529
+ u.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), c[u.name] = u, r[u.name] = !0;
1365
1530
  }
1366
- if (r.extensionsUsed)
1367
- for (let u = 0; u < r.extensionsUsed.length; ++u) {
1368
- const h = r.extensionsUsed[u], d = r.extensionsRequired || [];
1369
- switch (h) {
1370
- case E.KHR_MATERIALS_UNLIT:
1371
- o[h] = new Os();
1531
+ if (o.extensionsUsed)
1532
+ for (let h = 0; h < o.extensionsUsed.length; ++h) {
1533
+ const u = o.extensionsUsed[h], d = o.extensionsRequired || [];
1534
+ switch (u) {
1535
+ case M.KHR_MATERIALS_UNLIT:
1536
+ r[u] = new Qs();
1372
1537
  break;
1373
- case E.KHR_DRACO_MESH_COMPRESSION:
1374
- o[h] = new Js(r, this.dracoLoader);
1538
+ case M.KHR_DRACO_MESH_COMPRESSION:
1539
+ r[u] = new pr(o, this.dracoLoader);
1375
1540
  break;
1376
- case E.KHR_TEXTURE_TRANSFORM:
1377
- o[h] = new er();
1541
+ case M.KHR_TEXTURE_TRANSFORM:
1542
+ r[u] = new gr();
1378
1543
  break;
1379
- case E.KHR_MESH_QUANTIZATION:
1380
- o[h] = new tr();
1544
+ case M.KHR_MESH_QUANTIZATION:
1545
+ r[u] = new Ar();
1381
1546
  break;
1382
1547
  default:
1383
- d.indexOf(h) >= 0 && c[h] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + h + '".');
1548
+ d.indexOf(u) >= 0 && c[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".');
1384
1549
  }
1385
1550
  }
1386
- l.setExtensions(o), l.setPlugins(c), l.parse(s, n);
1551
+ l.setExtensions(r), l.setPlugins(c), l.parse(s, n);
1387
1552
  }
1388
1553
  parseAsync(e, t) {
1389
1554
  const s = this;
1390
- return new Promise(function(n, r) {
1391
- s.parse(e, t, n, r);
1555
+ return new Promise(function(n, o) {
1556
+ s.parse(e, t, n, o);
1392
1557
  });
1393
1558
  }
1394
1559
  }
1395
- function Ps() {
1396
- let i = {};
1560
+ function qs() {
1561
+ let a = {};
1397
1562
  return {
1398
1563
  get: function(e) {
1399
- return i[e];
1564
+ return a[e];
1400
1565
  },
1401
1566
  add: function(e, t) {
1402
- i[e] = t;
1567
+ a[e] = t;
1403
1568
  },
1404
1569
  remove: function(e) {
1405
- delete i[e];
1570
+ delete a[e];
1406
1571
  },
1407
1572
  removeAll: function() {
1408
- i = {};
1573
+ a = {};
1409
1574
  }
1410
1575
  };
1411
1576
  }
1412
- const E = {
1577
+ const M = {
1413
1578
  KHR_BINARY_GLTF: "KHR_binary_glTF",
1414
1579
  KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
1415
1580
  KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
@@ -1433,292 +1598,292 @@ const E = {
1433
1598
  EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
1434
1599
  EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
1435
1600
  };
1436
- class Fs {
1601
+ class Zs {
1437
1602
  constructor(e) {
1438
- this.parser = e, this.name = E.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
1603
+ this.parser = e, this.name = M.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
1439
1604
  }
1440
1605
  _markDefs() {
1441
1606
  const e = this.parser, t = this.parser.json.nodes || [];
1442
1607
  for (let s = 0, n = t.length; s < n; s++) {
1443
- const r = t[s];
1444
- r.extensions && r.extensions[this.name] && r.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, r.extensions[this.name].light);
1608
+ const o = t[s];
1609
+ o.extensions && o.extensions[this.name] && o.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, o.extensions[this.name].light);
1445
1610
  }
1446
1611
  }
1447
1612
  _loadLight(e) {
1448
1613
  const t = this.parser, s = "light:" + e;
1449
1614
  let n = t.cache.get(s);
1450
1615
  if (n) return n;
1451
- const r = t.json, a = ((r.extensions && r.extensions[this.name] || {}).lights || [])[e];
1616
+ const o = t.json, i = ((o.extensions && o.extensions[this.name] || {}).lights || [])[e];
1452
1617
  let l;
1453
- const u = new se(16777215);
1454
- a.color !== void 0 && u.setRGB(a.color[0], a.color[1], a.color[2], V);
1455
- const h = a.range !== void 0 ? a.range : 0;
1456
- switch (a.type) {
1618
+ const h = new oe(16777215);
1619
+ i.color !== void 0 && h.setRGB(i.color[0], i.color[1], i.color[2], Z);
1620
+ const u = i.range !== void 0 ? i.range : 0;
1621
+ switch (i.type) {
1457
1622
  case "directional":
1458
- l = new nn(u), l.target.position.set(0, 0, -1), l.add(l.target);
1623
+ l = new gn(h), l.target.position.set(0, 0, -1), l.add(l.target);
1459
1624
  break;
1460
1625
  case "point":
1461
- l = new tn(u), l.distance = h;
1626
+ l = new pn(h), l.distance = u;
1462
1627
  break;
1463
1628
  case "spot":
1464
- l = new en(u), l.distance = h, a.spot = a.spot || {}, a.spot.innerConeAngle = a.spot.innerConeAngle !== void 0 ? a.spot.innerConeAngle : 0, a.spot.outerConeAngle = a.spot.outerConeAngle !== void 0 ? a.spot.outerConeAngle : Math.PI / 4, l.angle = a.spot.outerConeAngle, l.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle, l.target.position.set(0, 0, -1), l.add(l.target);
1629
+ l = new mn(h), l.distance = u, i.spot = i.spot || {}, i.spot.innerConeAngle = i.spot.innerConeAngle !== void 0 ? i.spot.innerConeAngle : 0, i.spot.outerConeAngle = i.spot.outerConeAngle !== void 0 ? i.spot.outerConeAngle : Math.PI / 4, l.angle = i.spot.outerConeAngle, l.penumbra = 1 - i.spot.innerConeAngle / i.spot.outerConeAngle, l.target.position.set(0, 0, -1), l.add(l.target);
1465
1630
  break;
1466
1631
  default:
1467
- throw new Error("THREE.GLTFLoader: Unexpected light type: " + a.type);
1632
+ throw new Error("THREE.GLTFLoader: Unexpected light type: " + i.type);
1468
1633
  }
1469
- return l.position.set(0, 0, 0), K(l, a), a.intensity !== void 0 && (l.intensity = a.intensity), l.name = t.createUniqueName(a.name || "light_" + e), n = Promise.resolve(l), t.cache.add(s, n), n;
1634
+ return l.position.set(0, 0, 0), z(l, i), i.intensity !== void 0 && (l.intensity = i.intensity), l.name = t.createUniqueName(i.name || "light_" + e), n = Promise.resolve(l), t.cache.add(s, n), n;
1470
1635
  }
1471
1636
  getDependency(e, t) {
1472
1637
  if (e === "light")
1473
1638
  return this._loadLight(t);
1474
1639
  }
1475
1640
  createNodeAttachment(e) {
1476
- const t = this, s = this.parser, r = s.json.nodes[e], c = (r.extensions && r.extensions[this.name] || {}).light;
1477
- return c === void 0 ? null : this._loadLight(c).then(function(a) {
1478
- return s._getNodeRef(t.cache, c, a);
1641
+ const t = this, s = this.parser, o = s.json.nodes[e], c = (o.extensions && o.extensions[this.name] || {}).light;
1642
+ return c === void 0 ? null : this._loadLight(c).then(function(i) {
1643
+ return s._getNodeRef(t.cache, c, i);
1479
1644
  });
1480
1645
  }
1481
1646
  }
1482
- class Os {
1647
+ class Qs {
1483
1648
  constructor() {
1484
- this.name = E.KHR_MATERIALS_UNLIT;
1649
+ this.name = M.KHR_MATERIALS_UNLIT;
1485
1650
  }
1486
1651
  getMaterialType() {
1487
1652
  return Te;
1488
1653
  }
1489
1654
  extendParams(e, t, s) {
1490
1655
  const n = [];
1491
- e.color = new se(1, 1, 1), e.opacity = 1;
1492
- const r = t.pbrMetallicRoughness;
1493
- if (r) {
1494
- if (Array.isArray(r.baseColorFactor)) {
1495
- const o = r.baseColorFactor;
1496
- e.color.setRGB(o[0], o[1], o[2], V), e.opacity = o[3];
1656
+ e.color = new oe(1, 1, 1), e.opacity = 1;
1657
+ const o = t.pbrMetallicRoughness;
1658
+ if (o) {
1659
+ if (Array.isArray(o.baseColorFactor)) {
1660
+ const r = o.baseColorFactor;
1661
+ e.color.setRGB(r[0], r[1], r[2], Z), e.opacity = r[3];
1497
1662
  }
1498
- r.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", r.baseColorTexture, ve));
1663
+ o.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", o.baseColorTexture, Me));
1499
1664
  }
1500
1665
  return Promise.all(n);
1501
1666
  }
1502
1667
  }
1503
- class Ds {
1668
+ class $s {
1504
1669
  constructor(e) {
1505
- this.parser = e, this.name = E.KHR_MATERIALS_EMISSIVE_STRENGTH;
1670
+ this.parser = e, this.name = M.KHR_MATERIALS_EMISSIVE_STRENGTH;
1506
1671
  }
1507
1672
  extendMaterialParams(e, t) {
1508
1673
  const n = this.parser.json.materials[e];
1509
1674
  if (!n.extensions || !n.extensions[this.name])
1510
1675
  return Promise.resolve();
1511
- const r = n.extensions[this.name].emissiveStrength;
1512
- return r !== void 0 && (t.emissiveIntensity = r), Promise.resolve();
1676
+ const o = n.extensions[this.name].emissiveStrength;
1677
+ return o !== void 0 && (t.emissiveIntensity = o), Promise.resolve();
1513
1678
  }
1514
1679
  }
1515
- class ks {
1680
+ class Js {
1516
1681
  constructor(e) {
1517
- this.parser = e, this.name = E.KHR_MATERIALS_CLEARCOAT;
1682
+ this.parser = e, this.name = M.KHR_MATERIALS_CLEARCOAT;
1518
1683
  }
1519
1684
  getMaterialType(e) {
1520
1685
  const s = this.parser.json.materials[e];
1521
- return !s.extensions || !s.extensions[this.name] ? null : X;
1686
+ return !s.extensions || !s.extensions[this.name] ? null : V;
1522
1687
  }
1523
1688
  extendMaterialParams(e, t) {
1524
1689
  const s = this.parser, n = s.json.materials[e];
1525
1690
  if (!n.extensions || !n.extensions[this.name])
1526
1691
  return Promise.resolve();
1527
- const r = [], o = n.extensions[this.name];
1528
- if (o.clearcoatFactor !== void 0 && (t.clearcoat = o.clearcoatFactor), o.clearcoatTexture !== void 0 && r.push(s.assignTexture(t, "clearcoatMap", o.clearcoatTexture)), o.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = o.clearcoatRoughnessFactor), o.clearcoatRoughnessTexture !== void 0 && r.push(s.assignTexture(t, "clearcoatRoughnessMap", o.clearcoatRoughnessTexture)), o.clearcoatNormalTexture !== void 0 && (r.push(s.assignTexture(t, "clearcoatNormalMap", o.clearcoatNormalTexture)), o.clearcoatNormalTexture.scale !== void 0)) {
1529
- const c = o.clearcoatNormalTexture.scale;
1530
- t.clearcoatNormalScale = new It(c, c);
1692
+ const o = [], r = n.extensions[this.name];
1693
+ if (r.clearcoatFactor !== void 0 && (t.clearcoat = r.clearcoatFactor), r.clearcoatTexture !== void 0 && o.push(s.assignTexture(t, "clearcoatMap", r.clearcoatTexture)), r.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = r.clearcoatRoughnessFactor), r.clearcoatRoughnessTexture !== void 0 && o.push(s.assignTexture(t, "clearcoatRoughnessMap", r.clearcoatRoughnessTexture)), r.clearcoatNormalTexture !== void 0 && (o.push(s.assignTexture(t, "clearcoatNormalMap", r.clearcoatNormalTexture)), r.clearcoatNormalTexture.scale !== void 0)) {
1694
+ const c = r.clearcoatNormalTexture.scale;
1695
+ t.clearcoatNormalScale = new Xt(c, c);
1531
1696
  }
1532
- return Promise.all(r);
1697
+ return Promise.all(o);
1533
1698
  }
1534
1699
  }
1535
- class Bs {
1700
+ class er {
1536
1701
  constructor(e) {
1537
- this.parser = e, this.name = E.KHR_MATERIALS_DISPERSION;
1702
+ this.parser = e, this.name = M.KHR_MATERIALS_DISPERSION;
1538
1703
  }
1539
1704
  getMaterialType(e) {
1540
1705
  const s = this.parser.json.materials[e];
1541
- return !s.extensions || !s.extensions[this.name] ? null : X;
1706
+ return !s.extensions || !s.extensions[this.name] ? null : V;
1542
1707
  }
1543
1708
  extendMaterialParams(e, t) {
1544
1709
  const n = this.parser.json.materials[e];
1545
1710
  if (!n.extensions || !n.extensions[this.name])
1546
1711
  return Promise.resolve();
1547
- const r = n.extensions[this.name];
1548
- return t.dispersion = r.dispersion !== void 0 ? r.dispersion : 0, Promise.resolve();
1712
+ const o = n.extensions[this.name];
1713
+ return t.dispersion = o.dispersion !== void 0 ? o.dispersion : 0, Promise.resolve();
1549
1714
  }
1550
1715
  }
1551
- class Us {
1716
+ class tr {
1552
1717
  constructor(e) {
1553
- this.parser = e, this.name = E.KHR_MATERIALS_IRIDESCENCE;
1718
+ this.parser = e, this.name = M.KHR_MATERIALS_IRIDESCENCE;
1554
1719
  }
1555
1720
  getMaterialType(e) {
1556
1721
  const s = this.parser.json.materials[e];
1557
- return !s.extensions || !s.extensions[this.name] ? null : X;
1722
+ return !s.extensions || !s.extensions[this.name] ? null : V;
1558
1723
  }
1559
1724
  extendMaterialParams(e, t) {
1560
1725
  const s = this.parser, n = s.json.materials[e];
1561
1726
  if (!n.extensions || !n.extensions[this.name])
1562
1727
  return Promise.resolve();
1563
- const r = [], o = n.extensions[this.name];
1564
- return o.iridescenceFactor !== void 0 && (t.iridescence = o.iridescenceFactor), o.iridescenceTexture !== void 0 && r.push(s.assignTexture(t, "iridescenceMap", o.iridescenceTexture)), o.iridescenceIor !== void 0 && (t.iridescenceIOR = o.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), o.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = o.iridescenceThicknessMinimum), o.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = o.iridescenceThicknessMaximum), o.iridescenceThicknessTexture !== void 0 && r.push(s.assignTexture(t, "iridescenceThicknessMap", o.iridescenceThicknessTexture)), Promise.all(r);
1728
+ const o = [], r = n.extensions[this.name];
1729
+ return r.iridescenceFactor !== void 0 && (t.iridescence = r.iridescenceFactor), r.iridescenceTexture !== void 0 && o.push(s.assignTexture(t, "iridescenceMap", r.iridescenceTexture)), r.iridescenceIor !== void 0 && (t.iridescenceIOR = r.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), r.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = r.iridescenceThicknessMinimum), r.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = r.iridescenceThicknessMaximum), r.iridescenceThicknessTexture !== void 0 && o.push(s.assignTexture(t, "iridescenceThicknessMap", r.iridescenceThicknessTexture)), Promise.all(o);
1565
1730
  }
1566
1731
  }
1567
- class Gs {
1732
+ class nr {
1568
1733
  constructor(e) {
1569
- this.parser = e, this.name = E.KHR_MATERIALS_SHEEN;
1734
+ this.parser = e, this.name = M.KHR_MATERIALS_SHEEN;
1570
1735
  }
1571
1736
  getMaterialType(e) {
1572
1737
  const s = this.parser.json.materials[e];
1573
- return !s.extensions || !s.extensions[this.name] ? null : X;
1738
+ return !s.extensions || !s.extensions[this.name] ? null : V;
1574
1739
  }
1575
1740
  extendMaterialParams(e, t) {
1576
1741
  const s = this.parser, n = s.json.materials[e];
1577
1742
  if (!n.extensions || !n.extensions[this.name])
1578
1743
  return Promise.resolve();
1579
- const r = [];
1580
- t.sheenColor = new se(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1;
1581
- const o = n.extensions[this.name];
1582
- if (o.sheenColorFactor !== void 0) {
1583
- const c = o.sheenColorFactor;
1584
- t.sheenColor.setRGB(c[0], c[1], c[2], V);
1744
+ const o = [];
1745
+ t.sheenColor = new oe(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1;
1746
+ const r = n.extensions[this.name];
1747
+ if (r.sheenColorFactor !== void 0) {
1748
+ const c = r.sheenColorFactor;
1749
+ t.sheenColor.setRGB(c[0], c[1], c[2], Z);
1585
1750
  }
1586
- return o.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = o.sheenRoughnessFactor), o.sheenColorTexture !== void 0 && r.push(s.assignTexture(t, "sheenColorMap", o.sheenColorTexture, ve)), o.sheenRoughnessTexture !== void 0 && r.push(s.assignTexture(t, "sheenRoughnessMap", o.sheenRoughnessTexture)), Promise.all(r);
1751
+ return r.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = r.sheenRoughnessFactor), r.sheenColorTexture !== void 0 && o.push(s.assignTexture(t, "sheenColorMap", r.sheenColorTexture, Me)), r.sheenRoughnessTexture !== void 0 && o.push(s.assignTexture(t, "sheenRoughnessMap", r.sheenRoughnessTexture)), Promise.all(o);
1587
1752
  }
1588
1753
  }
1589
- class Hs {
1754
+ class sr {
1590
1755
  constructor(e) {
1591
- this.parser = e, this.name = E.KHR_MATERIALS_TRANSMISSION;
1756
+ this.parser = e, this.name = M.KHR_MATERIALS_TRANSMISSION;
1592
1757
  }
1593
1758
  getMaterialType(e) {
1594
1759
  const s = this.parser.json.materials[e];
1595
- return !s.extensions || !s.extensions[this.name] ? null : X;
1760
+ return !s.extensions || !s.extensions[this.name] ? null : V;
1596
1761
  }
1597
1762
  extendMaterialParams(e, t) {
1598
1763
  const s = this.parser, n = s.json.materials[e];
1599
1764
  if (!n.extensions || !n.extensions[this.name])
1600
1765
  return Promise.resolve();
1601
- const r = [], o = n.extensions[this.name];
1602
- return o.transmissionFactor !== void 0 && (t.transmission = o.transmissionFactor), o.transmissionTexture !== void 0 && r.push(s.assignTexture(t, "transmissionMap", o.transmissionTexture)), Promise.all(r);
1766
+ const o = [], r = n.extensions[this.name];
1767
+ return r.transmissionFactor !== void 0 && (t.transmission = r.transmissionFactor), r.transmissionTexture !== void 0 && o.push(s.assignTexture(t, "transmissionMap", r.transmissionTexture)), Promise.all(o);
1603
1768
  }
1604
1769
  }
1605
- class js {
1770
+ class rr {
1606
1771
  constructor(e) {
1607
- this.parser = e, this.name = E.KHR_MATERIALS_VOLUME;
1772
+ this.parser = e, this.name = M.KHR_MATERIALS_VOLUME;
1608
1773
  }
1609
1774
  getMaterialType(e) {
1610
1775
  const s = this.parser.json.materials[e];
1611
- return !s.extensions || !s.extensions[this.name] ? null : X;
1776
+ return !s.extensions || !s.extensions[this.name] ? null : V;
1612
1777
  }
1613
1778
  extendMaterialParams(e, t) {
1614
1779
  const s = this.parser, n = s.json.materials[e];
1615
1780
  if (!n.extensions || !n.extensions[this.name])
1616
1781
  return Promise.resolve();
1617
- const r = [], o = n.extensions[this.name];
1618
- t.thickness = o.thicknessFactor !== void 0 ? o.thicknessFactor : 0, o.thicknessTexture !== void 0 && r.push(s.assignTexture(t, "thicknessMap", o.thicknessTexture)), t.attenuationDistance = o.attenuationDistance || 1 / 0;
1619
- const c = o.attenuationColor || [1, 1, 1];
1620
- return t.attenuationColor = new se().setRGB(c[0], c[1], c[2], V), Promise.all(r);
1782
+ const o = [], r = n.extensions[this.name];
1783
+ t.thickness = r.thicknessFactor !== void 0 ? r.thicknessFactor : 0, r.thicknessTexture !== void 0 && o.push(s.assignTexture(t, "thicknessMap", r.thicknessTexture)), t.attenuationDistance = r.attenuationDistance || 1 / 0;
1784
+ const c = r.attenuationColor || [1, 1, 1];
1785
+ return t.attenuationColor = new oe().setRGB(c[0], c[1], c[2], Z), Promise.all(o);
1621
1786
  }
1622
1787
  }
1623
- class Xs {
1788
+ class or {
1624
1789
  constructor(e) {
1625
- this.parser = e, this.name = E.KHR_MATERIALS_IOR;
1790
+ this.parser = e, this.name = M.KHR_MATERIALS_IOR;
1626
1791
  }
1627
1792
  getMaterialType(e) {
1628
1793
  const s = this.parser.json.materials[e];
1629
- return !s.extensions || !s.extensions[this.name] ? null : X;
1794
+ return !s.extensions || !s.extensions[this.name] ? null : V;
1630
1795
  }
1631
1796
  extendMaterialParams(e, t) {
1632
1797
  const n = this.parser.json.materials[e];
1633
1798
  if (!n.extensions || !n.extensions[this.name])
1634
1799
  return Promise.resolve();
1635
- const r = n.extensions[this.name];
1636
- return t.ior = r.ior !== void 0 ? r.ior : 1.5, Promise.resolve();
1800
+ const o = n.extensions[this.name];
1801
+ return t.ior = o.ior !== void 0 ? o.ior : 1.5, Promise.resolve();
1637
1802
  }
1638
1803
  }
1639
- class Ks {
1804
+ class ar {
1640
1805
  constructor(e) {
1641
- this.parser = e, this.name = E.KHR_MATERIALS_SPECULAR;
1806
+ this.parser = e, this.name = M.KHR_MATERIALS_SPECULAR;
1642
1807
  }
1643
1808
  getMaterialType(e) {
1644
1809
  const s = this.parser.json.materials[e];
1645
- return !s.extensions || !s.extensions[this.name] ? null : X;
1810
+ return !s.extensions || !s.extensions[this.name] ? null : V;
1646
1811
  }
1647
1812
  extendMaterialParams(e, t) {
1648
1813
  const s = this.parser, n = s.json.materials[e];
1649
1814
  if (!n.extensions || !n.extensions[this.name])
1650
1815
  return Promise.resolve();
1651
- const r = [], o = n.extensions[this.name];
1652
- t.specularIntensity = o.specularFactor !== void 0 ? o.specularFactor : 1, o.specularTexture !== void 0 && r.push(s.assignTexture(t, "specularIntensityMap", o.specularTexture));
1653
- const c = o.specularColorFactor || [1, 1, 1];
1654
- return t.specularColor = new se().setRGB(c[0], c[1], c[2], V), o.specularColorTexture !== void 0 && r.push(s.assignTexture(t, "specularColorMap", o.specularColorTexture, ve)), Promise.all(r);
1816
+ const o = [], r = n.extensions[this.name];
1817
+ t.specularIntensity = r.specularFactor !== void 0 ? r.specularFactor : 1, r.specularTexture !== void 0 && o.push(s.assignTexture(t, "specularIntensityMap", r.specularTexture));
1818
+ const c = r.specularColorFactor || [1, 1, 1];
1819
+ return t.specularColor = new oe().setRGB(c[0], c[1], c[2], Z), r.specularColorTexture !== void 0 && o.push(s.assignTexture(t, "specularColorMap", r.specularColorTexture, Me)), Promise.all(o);
1655
1820
  }
1656
1821
  }
1657
- class Ys {
1822
+ class ir {
1658
1823
  constructor(e) {
1659
- this.parser = e, this.name = E.EXT_MATERIALS_BUMP;
1824
+ this.parser = e, this.name = M.EXT_MATERIALS_BUMP;
1660
1825
  }
1661
1826
  getMaterialType(e) {
1662
1827
  const s = this.parser.json.materials[e];
1663
- return !s.extensions || !s.extensions[this.name] ? null : X;
1828
+ return !s.extensions || !s.extensions[this.name] ? null : V;
1664
1829
  }
1665
1830
  extendMaterialParams(e, t) {
1666
1831
  const s = this.parser, n = s.json.materials[e];
1667
1832
  if (!n.extensions || !n.extensions[this.name])
1668
1833
  return Promise.resolve();
1669
- const r = [], o = n.extensions[this.name];
1670
- return t.bumpScale = o.bumpFactor !== void 0 ? o.bumpFactor : 1, o.bumpTexture !== void 0 && r.push(s.assignTexture(t, "bumpMap", o.bumpTexture)), Promise.all(r);
1834
+ const o = [], r = n.extensions[this.name];
1835
+ return t.bumpScale = r.bumpFactor !== void 0 ? r.bumpFactor : 1, r.bumpTexture !== void 0 && o.push(s.assignTexture(t, "bumpMap", r.bumpTexture)), Promise.all(o);
1671
1836
  }
1672
1837
  }
1673
- class Vs {
1838
+ class cr {
1674
1839
  constructor(e) {
1675
- this.parser = e, this.name = E.KHR_MATERIALS_ANISOTROPY;
1840
+ this.parser = e, this.name = M.KHR_MATERIALS_ANISOTROPY;
1676
1841
  }
1677
1842
  getMaterialType(e) {
1678
1843
  const s = this.parser.json.materials[e];
1679
- return !s.extensions || !s.extensions[this.name] ? null : X;
1844
+ return !s.extensions || !s.extensions[this.name] ? null : V;
1680
1845
  }
1681
1846
  extendMaterialParams(e, t) {
1682
1847
  const s = this.parser, n = s.json.materials[e];
1683
1848
  if (!n.extensions || !n.extensions[this.name])
1684
1849
  return Promise.resolve();
1685
- const r = [], o = n.extensions[this.name];
1686
- return o.anisotropyStrength !== void 0 && (t.anisotropy = o.anisotropyStrength), o.anisotropyRotation !== void 0 && (t.anisotropyRotation = o.anisotropyRotation), o.anisotropyTexture !== void 0 && r.push(s.assignTexture(t, "anisotropyMap", o.anisotropyTexture)), Promise.all(r);
1850
+ const o = [], r = n.extensions[this.name];
1851
+ return r.anisotropyStrength !== void 0 && (t.anisotropy = r.anisotropyStrength), r.anisotropyRotation !== void 0 && (t.anisotropyRotation = r.anisotropyRotation), r.anisotropyTexture !== void 0 && o.push(s.assignTexture(t, "anisotropyMap", r.anisotropyTexture)), Promise.all(o);
1687
1852
  }
1688
1853
  }
1689
- class Ws {
1854
+ class lr {
1690
1855
  constructor(e) {
1691
- this.parser = e, this.name = E.KHR_TEXTURE_BASISU;
1856
+ this.parser = e, this.name = M.KHR_TEXTURE_BASISU;
1692
1857
  }
1693
1858
  loadTexture(e) {
1694
1859
  const t = this.parser, s = t.json, n = s.textures[e];
1695
1860
  if (!n.extensions || !n.extensions[this.name])
1696
1861
  return null;
1697
- const r = n.extensions[this.name], o = t.options.ktx2Loader;
1698
- if (!o) {
1862
+ const o = n.extensions[this.name], r = t.options.ktx2Loader;
1863
+ if (!r) {
1699
1864
  if (s.extensionsRequired && s.extensionsRequired.indexOf(this.name) >= 0)
1700
1865
  throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
1701
1866
  return null;
1702
1867
  }
1703
- return t.loadTextureImage(e, r.source, o);
1868
+ return t.loadTextureImage(e, o.source, r);
1704
1869
  }
1705
1870
  }
1706
- class zs {
1871
+ class ur {
1707
1872
  constructor(e) {
1708
- this.parser = e, this.name = E.EXT_TEXTURE_WEBP, this.isSupported = null;
1873
+ this.parser = e, this.name = M.EXT_TEXTURE_WEBP, this.isSupported = null;
1709
1874
  }
1710
1875
  loadTexture(e) {
1711
- const t = this.name, s = this.parser, n = s.json, r = n.textures[e];
1712
- if (!r.extensions || !r.extensions[t])
1876
+ const t = this.name, s = this.parser, n = s.json, o = n.textures[e];
1877
+ if (!o.extensions || !o.extensions[t])
1713
1878
  return null;
1714
- const o = r.extensions[t], c = n.images[o.source];
1715
- let a = s.textureLoader;
1879
+ const r = o.extensions[t], c = n.images[r.source];
1880
+ let i = s.textureLoader;
1716
1881
  if (c.uri) {
1717
1882
  const l = s.options.manager.getHandler(c.uri);
1718
- l !== null && (a = l);
1883
+ l !== null && (i = l);
1719
1884
  }
1720
1885
  return this.detectSupport().then(function(l) {
1721
- if (l) return s.loadTextureImage(e, o.source, a);
1886
+ if (l) return s.loadTextureImage(e, r.source, i);
1722
1887
  if (n.extensionsRequired && n.extensionsRequired.indexOf(t) >= 0)
1723
1888
  throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");
1724
1889
  return s.loadTexture(e);
@@ -1733,22 +1898,22 @@ class zs {
1733
1898
  })), this.isSupported;
1734
1899
  }
1735
1900
  }
1736
- class qs {
1901
+ class hr {
1737
1902
  constructor(e) {
1738
- this.parser = e, this.name = E.EXT_TEXTURE_AVIF, this.isSupported = null;
1903
+ this.parser = e, this.name = M.EXT_TEXTURE_AVIF, this.isSupported = null;
1739
1904
  }
1740
1905
  loadTexture(e) {
1741
- const t = this.name, s = this.parser, n = s.json, r = n.textures[e];
1742
- if (!r.extensions || !r.extensions[t])
1906
+ const t = this.name, s = this.parser, n = s.json, o = n.textures[e];
1907
+ if (!o.extensions || !o.extensions[t])
1743
1908
  return null;
1744
- const o = r.extensions[t], c = n.images[o.source];
1745
- let a = s.textureLoader;
1909
+ const r = o.extensions[t], c = n.images[r.source];
1910
+ let i = s.textureLoader;
1746
1911
  if (c.uri) {
1747
1912
  const l = s.options.manager.getHandler(c.uri);
1748
- l !== null && (a = l);
1913
+ l !== null && (i = l);
1749
1914
  }
1750
1915
  return this.detectSupport().then(function(l) {
1751
- if (l) return s.loadTextureImage(e, o.source, a);
1916
+ if (l) return s.loadTextureImage(e, r.source, i);
1752
1917
  if (n.extensionsRequired && n.extensionsRequired.indexOf(t) >= 0)
1753
1918
  throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");
1754
1919
  return s.loadTexture(e);
@@ -1763,35 +1928,35 @@ class qs {
1763
1928
  })), this.isSupported;
1764
1929
  }
1765
1930
  }
1766
- class Zs {
1931
+ class dr {
1767
1932
  constructor(e) {
1768
- this.name = E.EXT_MESHOPT_COMPRESSION, this.parser = e;
1933
+ this.name = M.EXT_MESHOPT_COMPRESSION, this.parser = e;
1769
1934
  }
1770
1935
  loadBufferView(e) {
1771
1936
  const t = this.parser.json, s = t.bufferViews[e];
1772
1937
  if (s.extensions && s.extensions[this.name]) {
1773
- const n = s.extensions[this.name], r = this.parser.getDependency("buffer", n.buffer), o = this.parser.options.meshoptDecoder;
1774
- if (!o || !o.supported) {
1938
+ const n = s.extensions[this.name], o = this.parser.getDependency("buffer", n.buffer), r = this.parser.options.meshoptDecoder;
1939
+ if (!r || !r.supported) {
1775
1940
  if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0)
1776
1941
  throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
1777
1942
  return null;
1778
1943
  }
1779
- return r.then(function(c) {
1780
- const a = n.byteOffset || 0, l = n.byteLength || 0, u = n.count, h = n.byteStride, d = new Uint8Array(c, a, l);
1781
- return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(u, h, d, n.mode, n.filter).then(function(p) {
1782
- return p.buffer;
1783
- }) : o.ready.then(function() {
1784
- const p = new ArrayBuffer(u * h);
1785
- return o.decodeGltfBuffer(new Uint8Array(p), u, h, d, n.mode, n.filter), p;
1944
+ return o.then(function(c) {
1945
+ const i = n.byteOffset || 0, l = n.byteLength || 0, h = n.count, u = n.byteStride, d = new Uint8Array(c, i, l);
1946
+ return r.decodeGltfBufferAsync ? r.decodeGltfBufferAsync(h, u, d, n.mode, n.filter).then(function(m) {
1947
+ return m.buffer;
1948
+ }) : r.ready.then(function() {
1949
+ const m = new ArrayBuffer(h * u);
1950
+ return r.decodeGltfBuffer(new Uint8Array(m), h, u, d, n.mode, n.filter), m;
1786
1951
  });
1787
1952
  });
1788
1953
  } else
1789
1954
  return null;
1790
1955
  }
1791
1956
  }
1792
- class Qs {
1957
+ class fr {
1793
1958
  constructor(e) {
1794
- this.name = E.EXT_MESH_GPU_INSTANCING, this.parser = e;
1959
+ this.name = M.EXT_MESH_GPU_INSTANCING, this.parser = e;
1795
1960
  }
1796
1961
  createNodeMesh(e) {
1797
1962
  const t = this.parser.json, s = t.nodes[e];
@@ -1799,132 +1964,132 @@ class Qs {
1799
1964
  return null;
1800
1965
  const n = t.meshes[s.mesh];
1801
1966
  for (const l of n.primitives)
1802
- if (l.mode !== O.TRIANGLES && l.mode !== O.TRIANGLE_STRIP && l.mode !== O.TRIANGLE_FAN && l.mode !== void 0)
1967
+ if (l.mode !== H.TRIANGLES && l.mode !== H.TRIANGLE_STRIP && l.mode !== H.TRIANGLE_FAN && l.mode !== void 0)
1803
1968
  return null;
1804
- const o = s.extensions[this.name].attributes, c = [], a = {};
1805
- for (const l in o)
1806
- c.push(this.parser.getDependency("accessor", o[l]).then((u) => (a[l] = u, a[l])));
1969
+ const r = s.extensions[this.name].attributes, c = [], i = {};
1970
+ for (const l in r)
1971
+ c.push(this.parser.getDependency("accessor", r[l]).then((h) => (i[l] = h, i[l])));
1807
1972
  return c.length < 1 ? null : (c.push(this.parser.createNodeMesh(e)), Promise.all(c).then((l) => {
1808
- const u = l.pop(), h = u.isGroup ? u.children : [u], d = l[0].count, p = [];
1809
- for (const g of h) {
1810
- const A = new Ne(), m = new te(), f = new Ct(), x = new te(1, 1, 1), v = new sn(g.geometry, g.material, d);
1973
+ const h = l.pop(), u = h.isGroup ? h.children : [h], d = l[0].count, m = [];
1974
+ for (const A of u) {
1975
+ const g = new Oe(), p = new se(), f = new jt(), v = new se(1, 1, 1), T = new An(A.geometry, A.material, d);
1811
1976
  for (let b = 0; b < d; b++)
1812
- a.TRANSLATION && m.fromBufferAttribute(a.TRANSLATION, b), a.ROTATION && f.fromBufferAttribute(a.ROTATION, b), a.SCALE && x.fromBufferAttribute(a.SCALE, b), v.setMatrixAt(b, A.compose(m, f, x));
1813
- for (const b in a)
1977
+ i.TRANSLATION && p.fromBufferAttribute(i.TRANSLATION, b), i.ROTATION && f.fromBufferAttribute(i.ROTATION, b), i.SCALE && v.fromBufferAttribute(i.SCALE, b), T.setMatrixAt(b, g.compose(p, f, v));
1978
+ for (const b in i)
1814
1979
  if (b === "_COLOR_0") {
1815
- const y = a[b];
1816
- v.instanceColor = new rn(y.array, y.itemSize, y.normalized);
1817
- } else b !== "TRANSLATION" && b !== "ROTATION" && b !== "SCALE" && g.geometry.setAttribute(b, a[b]);
1818
- Nt.prototype.copy.call(v, g), this.parser.assignFinalMaterial(v), p.push(v);
1980
+ const E = i[b];
1981
+ T.instanceColor = new vn(E.array, E.itemSize, E.normalized);
1982
+ } else b !== "TRANSLATION" && b !== "ROTATION" && b !== "SCALE" && A.geometry.setAttribute(b, i[b]);
1983
+ Kt.prototype.copy.call(T, A), this.parser.assignFinalMaterial(T), m.push(T);
1819
1984
  }
1820
- return u.isGroup ? (u.clear(), u.add(...p), u) : p[0];
1985
+ return h.isGroup ? (h.clear(), h.add(...m), h) : m[0];
1821
1986
  }));
1822
1987
  }
1823
1988
  }
1824
- const jt = "glTF", Ae = 12, Mt = { JSON: 1313821514, BIN: 5130562 };
1825
- class $s {
1989
+ const en = "glTF", ve = 12, Ot = { JSON: 1313821514, BIN: 5130562 };
1990
+ class mr {
1826
1991
  constructor(e) {
1827
- this.name = E.KHR_BINARY_GLTF, this.content = null, this.body = null;
1828
- const t = new DataView(e, 0, Ae), s = new TextDecoder();
1992
+ this.name = M.KHR_BINARY_GLTF, this.content = null, this.body = null;
1993
+ const t = new DataView(e, 0, ve), s = new TextDecoder();
1829
1994
  if (this.header = {
1830
1995
  magic: s.decode(new Uint8Array(e.slice(0, 4))),
1831
1996
  version: t.getUint32(4, !0),
1832
1997
  length: t.getUint32(8, !0)
1833
- }, this.header.magic !== jt)
1998
+ }, this.header.magic !== en)
1834
1999
  throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
1835
2000
  if (this.header.version < 2)
1836
2001
  throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
1837
- const n = this.header.length - Ae, r = new DataView(e, Ae);
1838
- let o = 0;
1839
- for (; o < n; ) {
1840
- const c = r.getUint32(o, !0);
1841
- o += 4;
1842
- const a = r.getUint32(o, !0);
1843
- if (o += 4, a === Mt.JSON) {
1844
- const l = new Uint8Array(e, Ae + o, c);
2002
+ const n = this.header.length - ve, o = new DataView(e, ve);
2003
+ let r = 0;
2004
+ for (; r < n; ) {
2005
+ const c = o.getUint32(r, !0);
2006
+ r += 4;
2007
+ const i = o.getUint32(r, !0);
2008
+ if (r += 4, i === Ot.JSON) {
2009
+ const l = new Uint8Array(e, ve + r, c);
1845
2010
  this.content = s.decode(l);
1846
- } else if (a === Mt.BIN) {
1847
- const l = Ae + o;
2011
+ } else if (i === Ot.BIN) {
2012
+ const l = ve + r;
1848
2013
  this.body = e.slice(l, l + c);
1849
2014
  }
1850
- o += c;
2015
+ r += c;
1851
2016
  }
1852
2017
  if (this.content === null)
1853
2018
  throw new Error("THREE.GLTFLoader: JSON content not found.");
1854
2019
  }
1855
2020
  }
1856
- class Js {
2021
+ class pr {
1857
2022
  constructor(e, t) {
1858
2023
  if (!t)
1859
2024
  throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
1860
- this.name = E.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
2025
+ this.name = M.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
1861
2026
  }
1862
2027
  decodePrimitive(e, t) {
1863
- const s = this.json, n = this.dracoLoader, r = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, c = {}, a = {}, l = {};
1864
- for (const u in o) {
1865
- const h = ot[u] || u.toLowerCase();
1866
- c[h] = o[u];
2028
+ const s = this.json, n = this.dracoLoader, o = e.extensions[this.name].bufferView, r = e.extensions[this.name].attributes, c = {}, i = {}, l = {};
2029
+ for (const h in r) {
2030
+ const u = mt[h] || h.toLowerCase();
2031
+ c[u] = r[h];
1867
2032
  }
1868
- for (const u in e.attributes) {
1869
- const h = ot[u] || u.toLowerCase();
1870
- if (o[u] !== void 0) {
1871
- const d = s.accessors[e.attributes[u]], p = le[d.componentType];
1872
- l[h] = p.name, a[h] = d.normalized === !0;
2033
+ for (const h in e.attributes) {
2034
+ const u = mt[h] || h.toLowerCase();
2035
+ if (r[h] !== void 0) {
2036
+ const d = s.accessors[e.attributes[h]], m = ue[d.componentType];
2037
+ l[u] = m.name, i[u] = d.normalized === !0;
1873
2038
  }
1874
2039
  }
1875
- return t.getDependency("bufferView", r).then(function(u) {
1876
- return new Promise(function(h, d) {
1877
- n.decodeDracoFile(u, function(p) {
1878
- for (const g in p.attributes) {
1879
- const A = p.attributes[g], m = a[g];
1880
- m !== void 0 && (A.normalized = m);
2040
+ return t.getDependency("bufferView", o).then(function(h) {
2041
+ return new Promise(function(u, d) {
2042
+ n.decodeDracoFile(h, function(m) {
2043
+ for (const A in m.attributes) {
2044
+ const g = m.attributes[A], p = i[A];
2045
+ p !== void 0 && (g.normalized = p);
1881
2046
  }
1882
- h(p);
1883
- }, c, l, V, d);
2047
+ u(m);
2048
+ }, c, l, Z, d);
1884
2049
  });
1885
2050
  });
1886
2051
  }
1887
2052
  }
1888
- class er {
2053
+ class gr {
1889
2054
  constructor() {
1890
- this.name = E.KHR_TEXTURE_TRANSFORM;
2055
+ this.name = M.KHR_TEXTURE_TRANSFORM;
1891
2056
  }
1892
2057
  extendTexture(e, t) {
1893
2058
  return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e;
1894
2059
  }
1895
2060
  }
1896
- class tr {
2061
+ class Ar {
1897
2062
  constructor() {
1898
- this.name = E.KHR_MESH_QUANTIZATION;
2063
+ this.name = M.KHR_MESH_QUANTIZATION;
1899
2064
  }
1900
2065
  }
1901
- class Xt extends Pn {
2066
+ class tn extends Wn {
1902
2067
  constructor(e, t, s, n) {
1903
2068
  super(e, t, s, n);
1904
2069
  }
1905
2070
  copySampleValue_(e) {
1906
- const t = this.resultBuffer, s = this.sampleValues, n = this.valueSize, r = e * n * 3 + n;
1907
- for (let o = 0; o !== n; o++)
1908
- t[o] = s[r + o];
2071
+ const t = this.resultBuffer, s = this.sampleValues, n = this.valueSize, o = e * n * 3 + n;
2072
+ for (let r = 0; r !== n; r++)
2073
+ t[r] = s[o + r];
1909
2074
  return t;
1910
2075
  }
1911
2076
  interpolate_(e, t, s, n) {
1912
- const r = this.resultBuffer, o = this.sampleValues, c = this.valueSize, a = c * 2, l = c * 3, u = n - t, h = (s - t) / u, d = h * h, p = d * h, g = e * l, A = g - l, m = -2 * p + 3 * d, f = p - d, x = 1 - m, v = f - d + h;
2077
+ const o = this.resultBuffer, r = this.sampleValues, c = this.valueSize, i = c * 2, l = c * 3, h = n - t, u = (s - t) / h, d = u * u, m = d * u, A = e * l, g = A - l, p = -2 * m + 3 * d, f = m - d, v = 1 - p, T = f - d + u;
1913
2078
  for (let b = 0; b !== c; b++) {
1914
- const y = o[A + b + c], L = o[A + b + a] * u, _ = o[g + b + c], D = o[g + b] * u;
1915
- r[b] = x * y + v * L + m * _ + f * D;
2079
+ const E = r[g + b + c], L = r[g + b + i] * h, y = r[A + b + c], N = r[A + b] * h;
2080
+ o[b] = v * E + T * L + p * y + f * N;
1916
2081
  }
1917
- return r;
2082
+ return o;
1918
2083
  }
1919
2084
  }
1920
- const nr = new Ct();
1921
- class sr extends Xt {
2085
+ const vr = new jt();
2086
+ class Tr extends tn {
1922
2087
  interpolate_(e, t, s, n) {
1923
- const r = super.interpolate_(e, t, s, n);
1924
- return nr.fromArray(r).normalize().toArray(r), r;
2088
+ const o = super.interpolate_(e, t, s, n);
2089
+ return vr.fromArray(o).normalize().toArray(o), o;
1925
2090
  }
1926
2091
  }
1927
- const O = {
2092
+ const H = {
1928
2093
  POINTS: 0,
1929
2094
  LINES: 1,
1930
2095
  LINE_LOOP: 2,
@@ -1932,25 +2097,25 @@ const O = {
1932
2097
  TRIANGLES: 4,
1933
2098
  TRIANGLE_STRIP: 5,
1934
2099
  TRIANGLE_FAN: 6
1935
- }, le = {
2100
+ }, ue = {
1936
2101
  5120: Int8Array,
1937
2102
  5121: Uint8Array,
1938
2103
  5122: Int16Array,
1939
2104
  5123: Uint16Array,
1940
2105
  5125: Uint32Array,
1941
2106
  5126: Float32Array
1942
- }, wt = {
1943
- 9728: Ft,
1944
- 9729: nt,
1945
- 9984: dn,
1946
- 9985: hn,
1947
- 9986: un,
1948
- 9987: Pt
1949
- }, St = {
1950
- 33071: pn,
1951
- 33648: fn,
1952
- 10497: st
1953
- }, Ze = {
2107
+ }, Dt = {
2108
+ 9728: Wt,
2109
+ 9729: ht,
2110
+ 9984: wn,
2111
+ 9985: En,
2112
+ 9986: Rn,
2113
+ 9987: Yt
2114
+ }, Ut = {
2115
+ 33071: yn,
2116
+ 33648: Sn,
2117
+ 10497: dt
2118
+ }, ot = {
1954
2119
  SCALAR: 1,
1955
2120
  VEC2: 2,
1956
2121
  VEC3: 3,
@@ -1958,7 +2123,7 @@ const O = {
1958
2123
  MAT2: 4,
1959
2124
  MAT3: 9,
1960
2125
  MAT4: 16
1961
- }, ot = {
2126
+ }, mt = {
1962
2127
  POSITION: "position",
1963
2128
  NORMAL: "normal",
1964
2129
  TANGENT: "tangent",
@@ -1974,98 +2139,98 @@ const O = {
1974
2139
  translation: "position",
1975
2140
  rotation: "quaternion",
1976
2141
  weights: "morphTargetInfluences"
1977
- }, rr = {
2142
+ }, xr = {
1978
2143
  CUBICSPLINE: void 0,
1979
2144
  // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
1980
2145
  // keyframe track will be initialized with a default interpolation type, then modified.
1981
- LINEAR: Dt,
1982
- STEP: Cn
1983
- }, Qe = {
2146
+ LINEAR: zt,
2147
+ STEP: Kn
2148
+ }, at = {
1984
2149
  OPAQUE: "OPAQUE",
1985
2150
  MASK: "MASK",
1986
2151
  BLEND: "BLEND"
1987
2152
  };
1988
- function or(i) {
1989
- return i.DefaultMaterial === void 0 && (i.DefaultMaterial = new Ot({
2153
+ function br(a) {
2154
+ return a.DefaultMaterial === void 0 && (a.DefaultMaterial = new Vt({
1990
2155
  color: 16777215,
1991
2156
  emissive: 0,
1992
2157
  metalness: 1,
1993
2158
  roughness: 1,
1994
2159
  transparent: !1,
1995
2160
  depthTest: !0,
1996
- side: Nn
1997
- })), i.DefaultMaterial;
2161
+ side: Yn
2162
+ })), a.DefaultMaterial;
1998
2163
  }
1999
- function ee(i, e, t) {
2164
+ function te(a, e, t) {
2000
2165
  for (const s in t.extensions)
2001
- i[s] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[s] = t.extensions[s]);
2166
+ a[s] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[s] = t.extensions[s]);
2002
2167
  }
2003
- function K(i, e) {
2004
- e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(i.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
2168
+ function z(a, e) {
2169
+ e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(a.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
2005
2170
  }
2006
- function ir(i, e, t) {
2007
- let s = !1, n = !1, r = !1;
2008
- for (let l = 0, u = e.length; l < u; l++) {
2009
- const h = e[l];
2010
- if (h.POSITION !== void 0 && (s = !0), h.NORMAL !== void 0 && (n = !0), h.COLOR_0 !== void 0 && (r = !0), s && n && r) break;
2011
- }
2012
- if (!s && !n && !r) return Promise.resolve(i);
2013
- const o = [], c = [], a = [];
2014
- for (let l = 0, u = e.length; l < u; l++) {
2015
- const h = e[l];
2171
+ function Mr(a, e, t) {
2172
+ let s = !1, n = !1, o = !1;
2173
+ for (let l = 0, h = e.length; l < h; l++) {
2174
+ const u = e[l];
2175
+ if (u.POSITION !== void 0 && (s = !0), u.NORMAL !== void 0 && (n = !0), u.COLOR_0 !== void 0 && (o = !0), s && n && o) break;
2176
+ }
2177
+ if (!s && !n && !o) return Promise.resolve(a);
2178
+ const r = [], c = [], i = [];
2179
+ for (let l = 0, h = e.length; l < h; l++) {
2180
+ const u = e[l];
2016
2181
  if (s) {
2017
- const d = h.POSITION !== void 0 ? t.getDependency("accessor", h.POSITION) : i.attributes.position;
2018
- o.push(d);
2182
+ const d = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) : a.attributes.position;
2183
+ r.push(d);
2019
2184
  }
2020
2185
  if (n) {
2021
- const d = h.NORMAL !== void 0 ? t.getDependency("accessor", h.NORMAL) : i.attributes.normal;
2186
+ const d = u.NORMAL !== void 0 ? t.getDependency("accessor", u.NORMAL) : a.attributes.normal;
2022
2187
  c.push(d);
2023
2188
  }
2024
- if (r) {
2025
- const d = h.COLOR_0 !== void 0 ? t.getDependency("accessor", h.COLOR_0) : i.attributes.color;
2026
- a.push(d);
2189
+ if (o) {
2190
+ const d = u.COLOR_0 !== void 0 ? t.getDependency("accessor", u.COLOR_0) : a.attributes.color;
2191
+ i.push(d);
2027
2192
  }
2028
2193
  }
2029
2194
  return Promise.all([
2030
- Promise.all(o),
2195
+ Promise.all(r),
2031
2196
  Promise.all(c),
2032
- Promise.all(a)
2197
+ Promise.all(i)
2033
2198
  ]).then(function(l) {
2034
- const u = l[0], h = l[1], d = l[2];
2035
- return s && (i.morphAttributes.position = u), n && (i.morphAttributes.normal = h), r && (i.morphAttributes.color = d), i.morphTargetsRelative = !0, i;
2199
+ const h = l[0], u = l[1], d = l[2];
2200
+ return s && (a.morphAttributes.position = h), n && (a.morphAttributes.normal = u), o && (a.morphAttributes.color = d), a.morphTargetsRelative = !0, a;
2036
2201
  });
2037
2202
  }
2038
- function ar(i, e) {
2039
- if (i.updateMorphTargets(), e.weights !== void 0)
2203
+ function Rr(a, e) {
2204
+ if (a.updateMorphTargets(), e.weights !== void 0)
2040
2205
  for (let t = 0, s = e.weights.length; t < s; t++)
2041
- i.morphTargetInfluences[t] = e.weights[t];
2206
+ a.morphTargetInfluences[t] = e.weights[t];
2042
2207
  if (e.extras && Array.isArray(e.extras.targetNames)) {
2043
2208
  const t = e.extras.targetNames;
2044
- if (i.morphTargetInfluences.length === t.length) {
2045
- i.morphTargetDictionary = {};
2209
+ if (a.morphTargetInfluences.length === t.length) {
2210
+ a.morphTargetDictionary = {};
2046
2211
  for (let s = 0, n = t.length; s < n; s++)
2047
- i.morphTargetDictionary[t[s]] = s;
2212
+ a.morphTargetDictionary[t[s]] = s;
2048
2213
  } else
2049
2214
  console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
2050
2215
  }
2051
2216
  }
2052
- function cr(i) {
2217
+ function Er(a) {
2053
2218
  let e;
2054
- const t = i.extensions && i.extensions[E.KHR_DRACO_MESH_COMPRESSION];
2055
- if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + $e(t.attributes) : e = i.indices + ":" + $e(i.attributes) + ":" + i.mode, i.targets !== void 0)
2056
- for (let s = 0, n = i.targets.length; s < n; s++)
2057
- e += ":" + $e(i.targets[s]);
2219
+ const t = a.extensions && a.extensions[M.KHR_DRACO_MESH_COMPRESSION];
2220
+ if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + it(t.attributes) : e = a.indices + ":" + it(a.attributes) + ":" + a.mode, a.targets !== void 0)
2221
+ for (let s = 0, n = a.targets.length; s < n; s++)
2222
+ e += ":" + it(a.targets[s]);
2058
2223
  return e;
2059
2224
  }
2060
- function $e(i) {
2225
+ function it(a) {
2061
2226
  let e = "";
2062
- const t = Object.keys(i).sort();
2227
+ const t = Object.keys(a).sort();
2063
2228
  for (let s = 0, n = t.length; s < n; s++)
2064
- e += t[s] + ":" + i[t[s]] + ";";
2229
+ e += t[s] + ":" + a[t[s]] + ";";
2065
2230
  return e;
2066
2231
  }
2067
- function it(i) {
2068
- switch (i) {
2232
+ function pt(a) {
2233
+ switch (a) {
2069
2234
  case Int8Array:
2070
2235
  return 1 / 127;
2071
2236
  case Uint8Array:
@@ -2078,21 +2243,21 @@ function it(i) {
2078
2243
  throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
2079
2244
  }
2080
2245
  }
2081
- function lr(i) {
2082
- return i.search(/\.jpe?g($|\?)/i) > 0 || i.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : i.search(/\.webp($|\?)/i) > 0 || i.search(/^data\:image\/webp/) === 0 ? "image/webp" : i.search(/\.ktx2($|\?)/i) > 0 || i.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
2246
+ function wr(a) {
2247
+ return a.search(/\.jpe?g($|\?)/i) > 0 || a.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : a.search(/\.webp($|\?)/i) > 0 || a.search(/^data\:image\/webp/) === 0 ? "image/webp" : a.search(/\.ktx2($|\?)/i) > 0 || a.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
2083
2248
  }
2084
- const ur = new Ne();
2085
- class hr {
2249
+ const Sr = new Oe();
2250
+ class yr {
2086
2251
  constructor(e = {}, t = {}) {
2087
- this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new Ps(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
2088
- let s = !1, n = -1, r = !1, o = -1;
2252
+ this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new qs(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
2253
+ let s = !1, n = -1, o = !1, r = -1;
2089
2254
  if (typeof navigator < "u") {
2090
2255
  const c = navigator.userAgent;
2091
2256
  s = /^((?!chrome|android).)*safari/i.test(c) === !0;
2092
- const a = c.match(/Version\/(\d+)/);
2093
- n = s && a ? parseInt(a[1], 10) : -1, r = c.indexOf("Firefox") > -1, o = r ? c.match(/Firefox\/([0-9]+)\./)[1] : -1;
2257
+ const i = c.match(/Version\/(\d+)/);
2258
+ n = s && i ? parseInt(i[1], 10) : -1, o = c.indexOf("Firefox") > -1, r = o ? c.match(/Firefox\/([0-9]+)\./)[1] : -1;
2094
2259
  }
2095
- typeof createImageBitmap > "u" || s && n < 17 || r && o < 98 ? this.textureLoader = new on(this.options.manager) : this.textureLoader = new an(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Lt(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
2260
+ typeof createImageBitmap > "u" || s && n < 17 || o && r < 98 ? this.textureLoader = new Tn(this.options.manager) : this.textureLoader = new xn(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Gt(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
2096
2261
  }
2097
2262
  setExtensions(e) {
2098
2263
  this.extensions = e;
@@ -2101,32 +2266,32 @@ class hr {
2101
2266
  this.plugins = e;
2102
2267
  }
2103
2268
  parse(e, t) {
2104
- const s = this, n = this.json, r = this.extensions;
2105
- this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(o) {
2106
- return o._markDefs && o._markDefs();
2107
- }), Promise.all(this._invokeAll(function(o) {
2108
- return o.beforeRoot && o.beforeRoot();
2269
+ const s = this, n = this.json, o = this.extensions;
2270
+ this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(r) {
2271
+ return r._markDefs && r._markDefs();
2272
+ }), Promise.all(this._invokeAll(function(r) {
2273
+ return r.beforeRoot && r.beforeRoot();
2109
2274
  })).then(function() {
2110
2275
  return Promise.all([
2111
2276
  s.getDependencies("scene"),
2112
2277
  s.getDependencies("animation"),
2113
2278
  s.getDependencies("camera")
2114
2279
  ]);
2115
- }).then(function(o) {
2280
+ }).then(function(r) {
2116
2281
  const c = {
2117
- scene: o[0][n.scene || 0],
2118
- scenes: o[0],
2119
- animations: o[1],
2120
- cameras: o[2],
2282
+ scene: r[0][n.scene || 0],
2283
+ scenes: r[0],
2284
+ animations: r[1],
2285
+ cameras: r[2],
2121
2286
  asset: n.asset,
2122
2287
  parser: s,
2123
2288
  userData: {}
2124
2289
  };
2125
- return ee(r, c, n), K(c, n), Promise.all(s._invokeAll(function(a) {
2126
- return a.afterRoot && a.afterRoot(c);
2290
+ return te(o, c, n), z(c, n), Promise.all(s._invokeAll(function(i) {
2291
+ return i.afterRoot && i.afterRoot(c);
2127
2292
  })).then(function() {
2128
- for (const a of c.scenes)
2129
- a.updateMatrixWorld();
2293
+ for (const i of c.scenes)
2294
+ i.updateMatrixWorld();
2130
2295
  e(c);
2131
2296
  });
2132
2297
  }).catch(t);
@@ -2136,14 +2301,14 @@ class hr {
2136
2301
  */
2137
2302
  _markDefs() {
2138
2303
  const e = this.json.nodes || [], t = this.json.skins || [], s = this.json.meshes || [];
2139
- for (let n = 0, r = t.length; n < r; n++) {
2140
- const o = t[n].joints;
2141
- for (let c = 0, a = o.length; c < a; c++)
2142
- e[o[c]].isBone = !0;
2304
+ for (let n = 0, o = t.length; n < o; n++) {
2305
+ const r = t[n].joints;
2306
+ for (let c = 0, i = r.length; c < i; c++)
2307
+ e[r[c]].isBone = !0;
2143
2308
  }
2144
- for (let n = 0, r = e.length; n < r; n++) {
2145
- const o = e[n];
2146
- o.mesh !== void 0 && (this._addNodeRef(this.meshCache, o.mesh), o.skin !== void 0 && (s[o.mesh].isSkinnedMesh = !0)), o.camera !== void 0 && this._addNodeRef(this.cameraCache, o.camera);
2309
+ for (let n = 0, o = e.length; n < o; n++) {
2310
+ const r = e[n];
2311
+ r.mesh !== void 0 && (this._addNodeRef(this.meshCache, r.mesh), r.skin !== void 0 && (s[r.mesh].isSkinnedMesh = !0)), r.camera !== void 0 && this._addNodeRef(this.cameraCache, r.camera);
2147
2312
  }
2148
2313
  }
2149
2314
  /**
@@ -2171,13 +2336,13 @@ class hr {
2171
2336
  */
2172
2337
  _getNodeRef(e, t, s) {
2173
2338
  if (e.refs[t] <= 1) return s;
2174
- const n = s.clone(), r = (o, c) => {
2175
- const a = this.associations.get(o);
2176
- a != null && this.associations.set(c, a);
2177
- for (const [l, u] of o.children.entries())
2178
- r(u, c.children[l]);
2339
+ const n = s.clone(), o = (r, c) => {
2340
+ const i = this.associations.get(r);
2341
+ i != null && this.associations.set(c, i);
2342
+ for (const [l, h] of r.children.entries())
2343
+ o(h, c.children[l]);
2179
2344
  };
2180
- return r(s, n), n.name += "_instance_" + e.uses[t]++, n;
2345
+ return o(s, n), n.name += "_instance_" + e.uses[t]++, n;
2181
2346
  }
2182
2347
  _invokeOne(e) {
2183
2348
  const t = Object.values(this.plugins);
@@ -2193,8 +2358,8 @@ class hr {
2193
2358
  t.unshift(this);
2194
2359
  const s = [];
2195
2360
  for (let n = 0; n < t.length; n++) {
2196
- const r = e(t[n]);
2197
- r && s.push(r);
2361
+ const o = e(t[n]);
2362
+ o && s.push(o);
2198
2363
  }
2199
2364
  return s;
2200
2365
  }
@@ -2213,50 +2378,50 @@ class hr {
2213
2378
  n = this.loadScene(t);
2214
2379
  break;
2215
2380
  case "node":
2216
- n = this._invokeOne(function(r) {
2217
- return r.loadNode && r.loadNode(t);
2381
+ n = this._invokeOne(function(o) {
2382
+ return o.loadNode && o.loadNode(t);
2218
2383
  });
2219
2384
  break;
2220
2385
  case "mesh":
2221
- n = this._invokeOne(function(r) {
2222
- return r.loadMesh && r.loadMesh(t);
2386
+ n = this._invokeOne(function(o) {
2387
+ return o.loadMesh && o.loadMesh(t);
2223
2388
  });
2224
2389
  break;
2225
2390
  case "accessor":
2226
2391
  n = this.loadAccessor(t);
2227
2392
  break;
2228
2393
  case "bufferView":
2229
- n = this._invokeOne(function(r) {
2230
- return r.loadBufferView && r.loadBufferView(t);
2394
+ n = this._invokeOne(function(o) {
2395
+ return o.loadBufferView && o.loadBufferView(t);
2231
2396
  });
2232
2397
  break;
2233
2398
  case "buffer":
2234
2399
  n = this.loadBuffer(t);
2235
2400
  break;
2236
2401
  case "material":
2237
- n = this._invokeOne(function(r) {
2238
- return r.loadMaterial && r.loadMaterial(t);
2402
+ n = this._invokeOne(function(o) {
2403
+ return o.loadMaterial && o.loadMaterial(t);
2239
2404
  });
2240
2405
  break;
2241
2406
  case "texture":
2242
- n = this._invokeOne(function(r) {
2243
- return r.loadTexture && r.loadTexture(t);
2407
+ n = this._invokeOne(function(o) {
2408
+ return o.loadTexture && o.loadTexture(t);
2244
2409
  });
2245
2410
  break;
2246
2411
  case "skin":
2247
2412
  n = this.loadSkin(t);
2248
2413
  break;
2249
2414
  case "animation":
2250
- n = this._invokeOne(function(r) {
2251
- return r.loadAnimation && r.loadAnimation(t);
2415
+ n = this._invokeOne(function(o) {
2416
+ return o.loadAnimation && o.loadAnimation(t);
2252
2417
  });
2253
2418
  break;
2254
2419
  case "camera":
2255
2420
  n = this.loadCamera(t);
2256
2421
  break;
2257
2422
  default:
2258
- if (n = this._invokeOne(function(r) {
2259
- return r != this && r.getDependency && r.getDependency(e, t);
2423
+ if (n = this._invokeOne(function(o) {
2424
+ return o != this && o.getDependency && o.getDependency(e, t);
2260
2425
  }), !n)
2261
2426
  throw new Error("Unknown type: " + e);
2262
2427
  break;
@@ -2274,8 +2439,8 @@ class hr {
2274
2439
  let t = this.cache.get(e);
2275
2440
  if (!t) {
2276
2441
  const s = this, n = this.json[e + (e === "mesh" ? "es" : "s")] || [];
2277
- t = Promise.all(n.map(function(r, o) {
2278
- return s.getDependency(e, o);
2442
+ t = Promise.all(n.map(function(o, r) {
2443
+ return s.getDependency(e, r);
2279
2444
  })), this.cache.add(e, t);
2280
2445
  }
2281
2446
  return t;
@@ -2290,11 +2455,11 @@ class hr {
2290
2455
  if (t.type && t.type !== "arraybuffer")
2291
2456
  throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
2292
2457
  if (t.uri === void 0 && e === 0)
2293
- return Promise.resolve(this.extensions[E.KHR_BINARY_GLTF].body);
2458
+ return Promise.resolve(this.extensions[M.KHR_BINARY_GLTF].body);
2294
2459
  const n = this.options;
2295
- return new Promise(function(r, o) {
2296
- s.load(xe.resolveURL(t.uri, n.path), r, void 0, function() {
2297
- o(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
2460
+ return new Promise(function(o, r) {
2461
+ s.load(be.resolveURL(t.uri, n.path), o, void 0, function() {
2462
+ r(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
2298
2463
  });
2299
2464
  });
2300
2465
  }
@@ -2306,8 +2471,8 @@ class hr {
2306
2471
  loadBufferView(e) {
2307
2472
  const t = this.json.bufferViews[e];
2308
2473
  return this.getDependency("buffer", t.buffer).then(function(s) {
2309
- const n = t.byteLength || 0, r = t.byteOffset || 0;
2310
- return s.slice(r, r + n);
2474
+ const n = t.byteLength || 0, o = t.byteOffset || 0;
2475
+ return s.slice(o, o + n);
2311
2476
  });
2312
2477
  }
2313
2478
  /**
@@ -2318,29 +2483,29 @@ class hr {
2318
2483
  loadAccessor(e) {
2319
2484
  const t = this, s = this.json, n = this.json.accessors[e];
2320
2485
  if (n.bufferView === void 0 && n.sparse === void 0) {
2321
- const o = Ze[n.type], c = le[n.componentType], a = n.normalized === !0, l = new c(n.count * o);
2322
- return Promise.resolve(new He(l, o, a));
2486
+ const r = ot[n.type], c = ue[n.componentType], i = n.normalized === !0, l = new c(n.count * r);
2487
+ return Promise.resolve(new qe(l, r, i));
2323
2488
  }
2324
- const r = [];
2325
- return n.bufferView !== void 0 ? r.push(this.getDependency("bufferView", n.bufferView)) : r.push(null), n.sparse !== void 0 && (r.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(r).then(function(o) {
2326
- const c = o[0], a = Ze[n.type], l = le[n.componentType], u = l.BYTES_PER_ELEMENT, h = u * a, d = n.byteOffset || 0, p = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, g = n.normalized === !0;
2327
- let A, m;
2328
- if (p && p !== h) {
2329
- const f = Math.floor(d / p), x = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + f + ":" + n.count;
2330
- let v = t.cache.get(x);
2331
- v || (A = new l(c, f * p, n.count * p / u), v = new cn(A, p / u), t.cache.add(x, v)), m = new ln(v, a, d % p / u, g);
2489
+ const o = [];
2490
+ return n.bufferView !== void 0 ? o.push(this.getDependency("bufferView", n.bufferView)) : o.push(null), n.sparse !== void 0 && (o.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), o.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(o).then(function(r) {
2491
+ const c = r[0], i = ot[n.type], l = ue[n.componentType], h = l.BYTES_PER_ELEMENT, u = h * i, d = n.byteOffset || 0, m = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, A = n.normalized === !0;
2492
+ let g, p;
2493
+ if (m && m !== u) {
2494
+ const f = Math.floor(d / m), v = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + f + ":" + n.count;
2495
+ let T = t.cache.get(v);
2496
+ T || (g = new l(c, f * m, n.count * m / h), T = new bn(g, m / h), t.cache.add(v, T)), p = new Mn(T, i, d % m / h, A);
2332
2497
  } else
2333
- c === null ? A = new l(n.count * a) : A = new l(c, d, n.count * a), m = new He(A, a, g);
2498
+ c === null ? g = new l(n.count * i) : g = new l(c, d, n.count * i), p = new qe(g, i, A);
2334
2499
  if (n.sparse !== void 0) {
2335
- const f = Ze.SCALAR, x = le[n.sparse.indices.componentType], v = n.sparse.indices.byteOffset || 0, b = n.sparse.values.byteOffset || 0, y = new x(o[1], v, n.sparse.count * f), L = new l(o[2], b, n.sparse.count * a);
2336
- c !== null && (m = new He(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
2337
- for (let _ = 0, D = y.length; _ < D; _++) {
2338
- const M = y[_];
2339
- if (m.setX(M, L[_ * a]), a >= 2 && m.setY(M, L[_ * a + 1]), a >= 3 && m.setZ(M, L[_ * a + 2]), a >= 4 && m.setW(M, L[_ * a + 3]), a >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
2500
+ const f = ot.SCALAR, v = ue[n.sparse.indices.componentType], T = n.sparse.indices.byteOffset || 0, b = n.sparse.values.byteOffset || 0, E = new v(r[1], T, n.sparse.count * f), L = new l(r[2], b, n.sparse.count * i);
2501
+ c !== null && (p = new qe(p.array.slice(), p.itemSize, p.normalized)), p.normalized = !1;
2502
+ for (let y = 0, N = E.length; y < N; y++) {
2503
+ const C = E[y];
2504
+ if (p.setX(C, L[y * i]), i >= 2 && p.setY(C, L[y * i + 1]), i >= 3 && p.setZ(C, L[y * i + 2]), i >= 4 && p.setW(C, L[y * i + 3]), i >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
2340
2505
  }
2341
- m.normalized = g;
2506
+ p.normalized = A;
2342
2507
  }
2343
- return m;
2508
+ return p;
2344
2509
  });
2345
2510
  }
2346
2511
  /**
@@ -2349,55 +2514,55 @@ class hr {
2349
2514
  * @return {Promise<THREE.Texture|null>}
2350
2515
  */
2351
2516
  loadTexture(e) {
2352
- const t = this.json, s = this.options, r = t.textures[e].source, o = t.images[r];
2517
+ const t = this.json, s = this.options, o = t.textures[e].source, r = t.images[o];
2353
2518
  let c = this.textureLoader;
2354
- if (o.uri) {
2355
- const a = s.manager.getHandler(o.uri);
2356
- a !== null && (c = a);
2519
+ if (r.uri) {
2520
+ const i = s.manager.getHandler(r.uri);
2521
+ i !== null && (c = i);
2357
2522
  }
2358
- return this.loadTextureImage(e, r, c);
2523
+ return this.loadTextureImage(e, o, c);
2359
2524
  }
2360
2525
  loadTextureImage(e, t, s) {
2361
- const n = this, r = this.json, o = r.textures[e], c = r.images[t], a = (c.uri || c.bufferView) + ":" + o.sampler;
2362
- if (this.textureCache[a])
2363
- return this.textureCache[a];
2364
- const l = this.loadImageSource(t, s).then(function(u) {
2365
- u.flipY = !1, u.name = o.name || c.name || "", u.name === "" && typeof c.uri == "string" && c.uri.startsWith("data:image/") === !1 && (u.name = c.uri);
2366
- const d = (r.samplers || {})[o.sampler] || {};
2367
- return u.magFilter = wt[d.magFilter] || nt, u.minFilter = wt[d.minFilter] || Pt, u.wrapS = St[d.wrapS] || st, u.wrapT = St[d.wrapT] || st, u.generateMipmaps = !u.isCompressedTexture && u.minFilter !== Ft && u.minFilter !== nt, n.associations.set(u, { textures: e }), u;
2526
+ const n = this, o = this.json, r = o.textures[e], c = o.images[t], i = (c.uri || c.bufferView) + ":" + r.sampler;
2527
+ if (this.textureCache[i])
2528
+ return this.textureCache[i];
2529
+ const l = this.loadImageSource(t, s).then(function(h) {
2530
+ h.flipY = !1, h.name = r.name || c.name || "", h.name === "" && typeof c.uri == "string" && c.uri.startsWith("data:image/") === !1 && (h.name = c.uri);
2531
+ const d = (o.samplers || {})[r.sampler] || {};
2532
+ return h.magFilter = Dt[d.magFilter] || ht, h.minFilter = Dt[d.minFilter] || Yt, h.wrapS = Ut[d.wrapS] || dt, h.wrapT = Ut[d.wrapT] || dt, h.generateMipmaps = !h.isCompressedTexture && h.minFilter !== Wt && h.minFilter !== ht, n.associations.set(h, { textures: e }), h;
2368
2533
  }).catch(function() {
2369
2534
  return null;
2370
2535
  });
2371
- return this.textureCache[a] = l, l;
2536
+ return this.textureCache[i] = l, l;
2372
2537
  }
2373
2538
  loadImageSource(e, t) {
2374
- const s = this, n = this.json, r = this.options;
2539
+ const s = this, n = this.json, o = this.options;
2375
2540
  if (this.sourceCache[e] !== void 0)
2376
- return this.sourceCache[e].then((h) => h.clone());
2377
- const o = n.images[e], c = self.URL || self.webkitURL;
2378
- let a = o.uri || "", l = !1;
2379
- if (o.bufferView !== void 0)
2380
- a = s.getDependency("bufferView", o.bufferView).then(function(h) {
2541
+ return this.sourceCache[e].then((u) => u.clone());
2542
+ const r = n.images[e], c = self.URL || self.webkitURL;
2543
+ let i = r.uri || "", l = !1;
2544
+ if (r.bufferView !== void 0)
2545
+ i = s.getDependency("bufferView", r.bufferView).then(function(u) {
2381
2546
  l = !0;
2382
- const d = new Blob([h], { type: o.mimeType });
2383
- return a = c.createObjectURL(d), a;
2547
+ const d = new Blob([u], { type: r.mimeType });
2548
+ return i = c.createObjectURL(d), i;
2384
2549
  });
2385
- else if (o.uri === void 0)
2550
+ else if (r.uri === void 0)
2386
2551
  throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
2387
- const u = Promise.resolve(a).then(function(h) {
2388
- return new Promise(function(d, p) {
2389
- let g = d;
2390
- t.isImageBitmapLoader === !0 && (g = function(A) {
2391
- const m = new ft(A);
2392
- m.needsUpdate = !0, d(m);
2393
- }), t.load(xe.resolveURL(h, r.path), g, void 0, p);
2552
+ const h = Promise.resolve(i).then(function(u) {
2553
+ return new Promise(function(d, m) {
2554
+ let A = d;
2555
+ t.isImageBitmapLoader === !0 && (A = function(g) {
2556
+ const p = new wt(g);
2557
+ p.needsUpdate = !0, d(p);
2558
+ }), t.load(be.resolveURL(u, o.path), A, void 0, m);
2394
2559
  });
2395
- }).then(function(h) {
2396
- return l === !0 && c.revokeObjectURL(a), K(h, o), h.userData.mimeType = o.mimeType || lr(o.uri), h;
2397
- }).catch(function(h) {
2398
- throw console.error("THREE.GLTFLoader: Couldn't load texture", a), h;
2560
+ }).then(function(u) {
2561
+ return l === !0 && c.revokeObjectURL(i), z(u, r), u.userData.mimeType = r.mimeType || wr(r.uri), u;
2562
+ }).catch(function(u) {
2563
+ throw console.error("THREE.GLTFLoader: Couldn't load texture", i), u;
2399
2564
  });
2400
- return this.sourceCache[e] = u, u;
2565
+ return this.sourceCache[e] = h, h;
2401
2566
  }
2402
2567
  /**
2403
2568
  * Asynchronously assigns a texture to the given material parameters.
@@ -2409,17 +2574,17 @@ class hr {
2409
2574
  * @return {Promise<Texture>}
2410
2575
  */
2411
2576
  assignTexture(e, t, s, n) {
2412
- const r = this;
2413
- return this.getDependency("texture", s.index).then(function(o) {
2414
- if (!o) return null;
2415
- if (s.texCoord !== void 0 && s.texCoord > 0 && (o = o.clone(), o.channel = s.texCoord), r.extensions[E.KHR_TEXTURE_TRANSFORM]) {
2416
- const c = s.extensions !== void 0 ? s.extensions[E.KHR_TEXTURE_TRANSFORM] : void 0;
2577
+ const o = this;
2578
+ return this.getDependency("texture", s.index).then(function(r) {
2579
+ if (!r) return null;
2580
+ if (s.texCoord !== void 0 && s.texCoord > 0 && (r = r.clone(), r.channel = s.texCoord), o.extensions[M.KHR_TEXTURE_TRANSFORM]) {
2581
+ const c = s.extensions !== void 0 ? s.extensions[M.KHR_TEXTURE_TRANSFORM] : void 0;
2417
2582
  if (c) {
2418
- const a = r.associations.get(o);
2419
- o = r.extensions[E.KHR_TEXTURE_TRANSFORM].extendTexture(o, c), r.associations.set(o, a);
2583
+ const i = o.associations.get(r);
2584
+ r = o.extensions[M.KHR_TEXTURE_TRANSFORM].extendTexture(r, c), o.associations.set(r, i);
2420
2585
  }
2421
2586
  }
2422
- return n !== void 0 && (o.colorSpace = n), e[t] = o, o;
2587
+ return n !== void 0 && (r.colorSpace = n), e[t] = r, r;
2423
2588
  });
2424
2589
  }
2425
2590
  /**
@@ -2433,26 +2598,26 @@ class hr {
2433
2598
  assignFinalMaterial(e) {
2434
2599
  const t = e.geometry;
2435
2600
  let s = e.material;
2436
- const n = t.attributes.tangent === void 0, r = t.attributes.color !== void 0, o = t.attributes.normal === void 0;
2601
+ const n = t.attributes.tangent === void 0, o = t.attributes.color !== void 0, r = t.attributes.normal === void 0;
2437
2602
  if (e.isPoints) {
2438
2603
  const c = "PointsMaterial:" + s.uuid;
2439
- let a = this.cache.get(c);
2440
- a || (a = new mn(), je.prototype.copy.call(a, s), a.color.copy(s.color), a.map = s.map, a.sizeAttenuation = !1, this.cache.add(c, a)), s = a;
2604
+ let i = this.cache.get(c);
2605
+ i || (i = new _n(), Ze.prototype.copy.call(i, s), i.color.copy(s.color), i.map = s.map, i.sizeAttenuation = !1, this.cache.add(c, i)), s = i;
2441
2606
  } else if (e.isLine) {
2442
2607
  const c = "LineBasicMaterial:" + s.uuid;
2443
- let a = this.cache.get(c);
2444
- a || (a = new gn(), je.prototype.copy.call(a, s), a.color.copy(s.color), a.map = s.map, this.cache.add(c, a)), s = a;
2608
+ let i = this.cache.get(c);
2609
+ i || (i = new Ln(), Ze.prototype.copy.call(i, s), i.color.copy(s.color), i.map = s.map, this.cache.add(c, i)), s = i;
2445
2610
  }
2446
- if (n || r || o) {
2611
+ if (n || o || r) {
2447
2612
  let c = "ClonedMaterial:" + s.uuid + ":";
2448
- n && (c += "derivative-tangents:"), r && (c += "vertex-colors:"), o && (c += "flat-shading:");
2449
- let a = this.cache.get(c);
2450
- a || (a = s.clone(), r && (a.vertexColors = !0), o && (a.flatShading = !0), n && (a.normalScale && (a.normalScale.y *= -1), a.clearcoatNormalScale && (a.clearcoatNormalScale.y *= -1)), this.cache.add(c, a), this.associations.set(a, this.associations.get(s))), s = a;
2613
+ n && (c += "derivative-tangents:"), o && (c += "vertex-colors:"), r && (c += "flat-shading:");
2614
+ let i = this.cache.get(c);
2615
+ i || (i = s.clone(), o && (i.vertexColors = !0), r && (i.flatShading = !0), n && (i.normalScale && (i.normalScale.y *= -1), i.clearcoatNormalScale && (i.clearcoatNormalScale.y *= -1)), this.cache.add(c, i), this.associations.set(i, this.associations.get(s))), s = i;
2451
2616
  }
2452
2617
  e.material = s;
2453
2618
  }
2454
2619
  getMaterialType() {
2455
- return Ot;
2620
+ return Vt;
2456
2621
  }
2457
2622
  /**
2458
2623
  * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
@@ -2460,37 +2625,37 @@ class hr {
2460
2625
  * @return {Promise<Material>}
2461
2626
  */
2462
2627
  loadMaterial(e) {
2463
- const t = this, s = this.json, n = this.extensions, r = s.materials[e];
2464
- let o;
2465
- const c = {}, a = r.extensions || {}, l = [];
2466
- if (a[E.KHR_MATERIALS_UNLIT]) {
2467
- const h = n[E.KHR_MATERIALS_UNLIT];
2468
- o = h.getMaterialType(), l.push(h.extendParams(c, r, t));
2628
+ const t = this, s = this.json, n = this.extensions, o = s.materials[e];
2629
+ let r;
2630
+ const c = {}, i = o.extensions || {}, l = [];
2631
+ if (i[M.KHR_MATERIALS_UNLIT]) {
2632
+ const u = n[M.KHR_MATERIALS_UNLIT];
2633
+ r = u.getMaterialType(), l.push(u.extendParams(c, o, t));
2469
2634
  } else {
2470
- const h = r.pbrMetallicRoughness || {};
2471
- if (c.color = new se(1, 1, 1), c.opacity = 1, Array.isArray(h.baseColorFactor)) {
2472
- const d = h.baseColorFactor;
2473
- c.color.setRGB(d[0], d[1], d[2], V), c.opacity = d[3];
2635
+ const u = o.pbrMetallicRoughness || {};
2636
+ if (c.color = new oe(1, 1, 1), c.opacity = 1, Array.isArray(u.baseColorFactor)) {
2637
+ const d = u.baseColorFactor;
2638
+ c.color.setRGB(d[0], d[1], d[2], Z), c.opacity = d[3];
2474
2639
  }
2475
- h.baseColorTexture !== void 0 && l.push(t.assignTexture(c, "map", h.baseColorTexture, ve)), c.metalness = h.metallicFactor !== void 0 ? h.metallicFactor : 1, c.roughness = h.roughnessFactor !== void 0 ? h.roughnessFactor : 1, h.metallicRoughnessTexture !== void 0 && (l.push(t.assignTexture(c, "metalnessMap", h.metallicRoughnessTexture)), l.push(t.assignTexture(c, "roughnessMap", h.metallicRoughnessTexture))), o = this._invokeOne(function(d) {
2640
+ u.baseColorTexture !== void 0 && l.push(t.assignTexture(c, "map", u.baseColorTexture, Me)), c.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, c.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (l.push(t.assignTexture(c, "metalnessMap", u.metallicRoughnessTexture)), l.push(t.assignTexture(c, "roughnessMap", u.metallicRoughnessTexture))), r = this._invokeOne(function(d) {
2476
2641
  return d.getMaterialType && d.getMaterialType(e);
2477
2642
  }), l.push(Promise.all(this._invokeAll(function(d) {
2478
2643
  return d.extendMaterialParams && d.extendMaterialParams(e, c);
2479
2644
  })));
2480
2645
  }
2481
- r.doubleSided === !0 && (c.side = Ie);
2482
- const u = r.alphaMode || Qe.OPAQUE;
2483
- if (u === Qe.BLEND ? (c.transparent = !0, c.depthWrite = !1) : (c.transparent = !1, u === Qe.MASK && (c.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && o !== Te && (l.push(t.assignTexture(c, "normalMap", r.normalTexture)), c.normalScale = new It(1, 1), r.normalTexture.scale !== void 0)) {
2484
- const h = r.normalTexture.scale;
2485
- c.normalScale.set(h, h);
2646
+ o.doubleSided === !0 && (c.side = Fe);
2647
+ const h = o.alphaMode || at.OPAQUE;
2648
+ if (h === at.BLEND ? (c.transparent = !0, c.depthWrite = !1) : (c.transparent = !1, h === at.MASK && (c.alphaTest = o.alphaCutoff !== void 0 ? o.alphaCutoff : 0.5)), o.normalTexture !== void 0 && r !== Te && (l.push(t.assignTexture(c, "normalMap", o.normalTexture)), c.normalScale = new Xt(1, 1), o.normalTexture.scale !== void 0)) {
2649
+ const u = o.normalTexture.scale;
2650
+ c.normalScale.set(u, u);
2486
2651
  }
2487
- if (r.occlusionTexture !== void 0 && o !== Te && (l.push(t.assignTexture(c, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (c.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && o !== Te) {
2488
- const h = r.emissiveFactor;
2489
- c.emissive = new se().setRGB(h[0], h[1], h[2], V);
2652
+ if (o.occlusionTexture !== void 0 && r !== Te && (l.push(t.assignTexture(c, "aoMap", o.occlusionTexture)), o.occlusionTexture.strength !== void 0 && (c.aoMapIntensity = o.occlusionTexture.strength)), o.emissiveFactor !== void 0 && r !== Te) {
2653
+ const u = o.emissiveFactor;
2654
+ c.emissive = new oe().setRGB(u[0], u[1], u[2], Z);
2490
2655
  }
2491
- return r.emissiveTexture !== void 0 && o !== Te && l.push(t.assignTexture(c, "emissiveMap", r.emissiveTexture, ve)), Promise.all(l).then(function() {
2492
- const h = new o(c);
2493
- return r.name && (h.name = r.name), K(h, r), t.associations.set(h, { materials: e }), r.extensions && ee(n, h, r), h;
2656
+ return o.emissiveTexture !== void 0 && r !== Te && l.push(t.assignTexture(c, "emissiveMap", o.emissiveTexture, Me)), Promise.all(l).then(function() {
2657
+ const u = new r(c);
2658
+ return o.name && (u.name = o.name), z(u, o), t.associations.set(u, { materials: e }), o.extensions && te(n, u, o), u;
2494
2659
  });
2495
2660
  }
2496
2661
  /**
@@ -2500,7 +2665,7 @@ class hr {
2500
2665
  * @return {String}
2501
2666
  */
2502
2667
  createUniqueName(e) {
2503
- const t = An.sanitizeNodeName(e || "");
2668
+ const t = Cn.sanitizeNodeName(e || "");
2504
2669
  return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
2505
2670
  }
2506
2671
  /**
@@ -2513,22 +2678,22 @@ class hr {
2513
2678
  */
2514
2679
  loadGeometries(e) {
2515
2680
  const t = this, s = this.extensions, n = this.primitiveCache;
2516
- function r(c) {
2517
- return s[E.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c, t).then(function(a) {
2518
- return yt(a, c, t);
2681
+ function o(c) {
2682
+ return s[M.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c, t).then(function(i) {
2683
+ return Bt(i, c, t);
2519
2684
  });
2520
2685
  }
2521
- const o = [];
2522
- for (let c = 0, a = e.length; c < a; c++) {
2523
- const l = e[c], u = cr(l), h = n[u];
2524
- if (h)
2525
- o.push(h.promise);
2686
+ const r = [];
2687
+ for (let c = 0, i = e.length; c < i; c++) {
2688
+ const l = e[c], h = Er(l), u = n[h];
2689
+ if (u)
2690
+ r.push(u.promise);
2526
2691
  else {
2527
2692
  let d;
2528
- l.extensions && l.extensions[E.KHR_DRACO_MESH_COMPRESSION] ? d = r(l) : d = yt(new Tn(), l, t), n[u] = { primitive: l, promise: d }, o.push(d);
2693
+ l.extensions && l.extensions[M.KHR_DRACO_MESH_COMPRESSION] ? d = o(l) : d = Bt(new In(), l, t), n[h] = { primitive: l, promise: d }, r.push(d);
2529
2694
  }
2530
2695
  }
2531
- return Promise.all(o);
2696
+ return Promise.all(r);
2532
2697
  }
2533
2698
  /**
2534
2699
  * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes
@@ -2536,42 +2701,42 @@ class hr {
2536
2701
  * @return {Promise<Group|Mesh|SkinnedMesh>}
2537
2702
  */
2538
2703
  loadMesh(e) {
2539
- const t = this, s = this.json, n = this.extensions, r = s.meshes[e], o = r.primitives, c = [];
2540
- for (let a = 0, l = o.length; a < l; a++) {
2541
- const u = o[a].material === void 0 ? or(this.cache) : this.getDependency("material", o[a].material);
2542
- c.push(u);
2704
+ const t = this, s = this.json, n = this.extensions, o = s.meshes[e], r = o.primitives, c = [];
2705
+ for (let i = 0, l = r.length; i < l; i++) {
2706
+ const h = r[i].material === void 0 ? br(this.cache) : this.getDependency("material", r[i].material);
2707
+ c.push(h);
2543
2708
  }
2544
- return c.push(t.loadGeometries(o)), Promise.all(c).then(function(a) {
2545
- const l = a.slice(0, a.length - 1), u = a[a.length - 1], h = [];
2546
- for (let p = 0, g = u.length; p < g; p++) {
2547
- const A = u[p], m = o[p];
2709
+ return c.push(t.loadGeometries(r)), Promise.all(c).then(function(i) {
2710
+ const l = i.slice(0, i.length - 1), h = i[i.length - 1], u = [];
2711
+ for (let m = 0, A = h.length; m < A; m++) {
2712
+ const g = h[m], p = r[m];
2548
2713
  let f;
2549
- const x = l[p];
2550
- if (m.mode === O.TRIANGLES || m.mode === O.TRIANGLE_STRIP || m.mode === O.TRIANGLE_FAN || m.mode === void 0)
2551
- f = r.isSkinnedMesh === !0 ? new xn(A, x) : new vn(A, x), f.isSkinnedMesh === !0 && f.normalizeSkinWeights(), m.mode === O.TRIANGLE_STRIP ? f.geometry = Rt(f.geometry, _t) : m.mode === O.TRIANGLE_FAN && (f.geometry = Rt(f.geometry, tt));
2552
- else if (m.mode === O.LINES)
2553
- f = new bn(A, x);
2554
- else if (m.mode === O.LINE_STRIP)
2555
- f = new En(A, x);
2556
- else if (m.mode === O.LINE_LOOP)
2557
- f = new Rn(A, x);
2558
- else if (m.mode === O.POINTS)
2559
- f = new Mn(A, x);
2714
+ const v = l[m];
2715
+ if (p.mode === H.TRIANGLES || p.mode === H.TRIANGLE_STRIP || p.mode === H.TRIANGLE_FAN || p.mode === void 0)
2716
+ f = o.isSkinnedMesh === !0 ? new Pn(g, v) : new Nn(g, v), f.isSkinnedMesh === !0 && f.normalizeSkinWeights(), p.mode === H.TRIANGLE_STRIP ? f.geometry = kt(f.geometry, Ht) : p.mode === H.TRIANGLE_FAN && (f.geometry = kt(f.geometry, ut));
2717
+ else if (p.mode === H.LINES)
2718
+ f = new Fn(g, v);
2719
+ else if (p.mode === H.LINE_STRIP)
2720
+ f = new kn(g, v);
2721
+ else if (p.mode === H.LINE_LOOP)
2722
+ f = new On(g, v);
2723
+ else if (p.mode === H.POINTS)
2724
+ f = new Dn(g, v);
2560
2725
  else
2561
- throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
2562
- Object.keys(f.geometry.morphAttributes).length > 0 && ar(f, r), f.name = t.createUniqueName(r.name || "mesh_" + e), K(f, r), m.extensions && ee(n, f, m), t.assignFinalMaterial(f), h.push(f);
2726
+ throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + p.mode);
2727
+ Object.keys(f.geometry.morphAttributes).length > 0 && Rr(f, o), f.name = t.createUniqueName(o.name || "mesh_" + e), z(f, o), p.extensions && te(n, f, p), t.assignFinalMaterial(f), u.push(f);
2563
2728
  }
2564
- for (let p = 0, g = h.length; p < g; p++)
2565
- t.associations.set(h[p], {
2729
+ for (let m = 0, A = u.length; m < A; m++)
2730
+ t.associations.set(u[m], {
2566
2731
  meshes: e,
2567
- primitives: p
2732
+ primitives: m
2568
2733
  });
2569
- if (h.length === 1)
2570
- return r.extensions && ee(n, h[0], r), h[0];
2571
- const d = new Xe();
2572
- r.extensions && ee(n, d, r), t.associations.set(d, { meshes: e });
2573
- for (let p = 0, g = h.length; p < g; p++)
2574
- d.add(h[p]);
2734
+ if (u.length === 1)
2735
+ return o.extensions && te(n, u[0], o), u[0];
2736
+ const d = new Qe();
2737
+ o.extensions && te(n, d, o), t.associations.set(d, { meshes: e });
2738
+ for (let m = 0, A = u.length; m < A; m++)
2739
+ d.add(u[m]);
2575
2740
  return d;
2576
2741
  });
2577
2742
  }
@@ -2587,7 +2752,7 @@ class hr {
2587
2752
  console.warn("THREE.GLTFLoader: Missing camera parameters.");
2588
2753
  return;
2589
2754
  }
2590
- return s.type === "perspective" ? t = new wn(Sn.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new yn(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), s.name && (t.name = this.createUniqueName(s.name)), K(t, s), Promise.resolve(t);
2755
+ return s.type === "perspective" ? t = new Un(Bn.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new Hn(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), s.name && (t.name = this.createUniqueName(s.name)), z(t, s), Promise.resolve(t);
2591
2756
  }
2592
2757
  /**
2593
2758
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
@@ -2596,20 +2761,20 @@ class hr {
2596
2761
  */
2597
2762
  loadSkin(e) {
2598
2763
  const t = this.json.skins[e], s = [];
2599
- for (let n = 0, r = t.joints.length; n < r; n++)
2764
+ for (let n = 0, o = t.joints.length; n < o; n++)
2600
2765
  s.push(this._loadNodeShallow(t.joints[n]));
2601
2766
  return t.inverseBindMatrices !== void 0 ? s.push(this.getDependency("accessor", t.inverseBindMatrices)) : s.push(null), Promise.all(s).then(function(n) {
2602
- const r = n.pop(), o = n, c = [], a = [];
2603
- for (let l = 0, u = o.length; l < u; l++) {
2604
- const h = o[l];
2605
- if (h) {
2606
- c.push(h);
2607
- const d = new Ne();
2608
- r !== null && d.fromArray(r.array, l * 16), a.push(d);
2767
+ const o = n.pop(), r = n, c = [], i = [];
2768
+ for (let l = 0, h = r.length; l < h; l++) {
2769
+ const u = r[l];
2770
+ if (u) {
2771
+ c.push(u);
2772
+ const d = new Oe();
2773
+ o !== null && d.fromArray(o.array, l * 16), i.push(d);
2609
2774
  } else
2610
2775
  console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[l]);
2611
2776
  }
2612
- return new _n(c, a);
2777
+ return new Gn(c, i);
2613
2778
  });
2614
2779
  }
2615
2780
  /**
@@ -2618,40 +2783,40 @@ class hr {
2618
2783
  * @return {Promise<AnimationClip>}
2619
2784
  */
2620
2785
  loadAnimation(e) {
2621
- const t = this.json, s = this, n = t.animations[e], r = n.name ? n.name : "animation_" + e, o = [], c = [], a = [], l = [], u = [];
2622
- for (let h = 0, d = n.channels.length; h < d; h++) {
2623
- const p = n.channels[h], g = n.samplers[p.sampler], A = p.target, m = A.node, f = n.parameters !== void 0 ? n.parameters[g.input] : g.input, x = n.parameters !== void 0 ? n.parameters[g.output] : g.output;
2624
- A.node !== void 0 && (o.push(this.getDependency("node", m)), c.push(this.getDependency("accessor", f)), a.push(this.getDependency("accessor", x)), l.push(g), u.push(A));
2786
+ const t = this.json, s = this, n = t.animations[e], o = n.name ? n.name : "animation_" + e, r = [], c = [], i = [], l = [], h = [];
2787
+ for (let u = 0, d = n.channels.length; u < d; u++) {
2788
+ const m = n.channels[u], A = n.samplers[m.sampler], g = m.target, p = g.node, f = n.parameters !== void 0 ? n.parameters[A.input] : A.input, v = n.parameters !== void 0 ? n.parameters[A.output] : A.output;
2789
+ g.node !== void 0 && (r.push(this.getDependency("node", p)), c.push(this.getDependency("accessor", f)), i.push(this.getDependency("accessor", v)), l.push(A), h.push(g));
2625
2790
  }
2626
2791
  return Promise.all([
2627
- Promise.all(o),
2792
+ Promise.all(r),
2628
2793
  Promise.all(c),
2629
- Promise.all(a),
2794
+ Promise.all(i),
2630
2795
  Promise.all(l),
2631
- Promise.all(u)
2632
- ]).then(function(h) {
2633
- const d = h[0], p = h[1], g = h[2], A = h[3], m = h[4], f = [];
2634
- for (let x = 0, v = d.length; x < v; x++) {
2635
- const b = d[x], y = p[x], L = g[x], _ = A[x], D = m[x];
2796
+ Promise.all(h)
2797
+ ]).then(function(u) {
2798
+ const d = u[0], m = u[1], A = u[2], g = u[3], p = u[4], f = [];
2799
+ for (let v = 0, T = d.length; v < T; v++) {
2800
+ const b = d[v], E = m[v], L = A[v], y = g[v], N = p[v];
2636
2801
  if (b === void 0) continue;
2637
2802
  b.updateMatrix && b.updateMatrix();
2638
- const M = s._createAnimationTracks(b, y, L, _, D);
2639
- if (M)
2640
- for (let P = 0; P < M.length; P++)
2641
- f.push(M[P]);
2803
+ const C = s._createAnimationTracks(b, E, L, y, N);
2804
+ if (C)
2805
+ for (let I = 0; I < C.length; I++)
2806
+ f.push(C[I]);
2642
2807
  }
2643
- return new Ln(r, void 0, f);
2808
+ return new Xn(o, void 0, f);
2644
2809
  });
2645
2810
  }
2646
2811
  createNodeMesh(e) {
2647
2812
  const t = this.json, s = this, n = t.nodes[e];
2648
- return n.mesh === void 0 ? null : s.getDependency("mesh", n.mesh).then(function(r) {
2649
- const o = s._getNodeRef(s.meshCache, n.mesh, r);
2650
- return n.weights !== void 0 && o.traverse(function(c) {
2813
+ return n.mesh === void 0 ? null : s.getDependency("mesh", n.mesh).then(function(o) {
2814
+ const r = s._getNodeRef(s.meshCache, n.mesh, o);
2815
+ return n.weights !== void 0 && r.traverse(function(c) {
2651
2816
  if (c.isMesh)
2652
- for (let a = 0, l = n.weights.length; a < l; a++)
2653
- c.morphTargetInfluences[a] = n.weights[a];
2654
- }), o;
2817
+ for (let i = 0, l = n.weights.length; i < l; i++)
2818
+ c.morphTargetInfluences[i] = n.weights[i];
2819
+ }), r;
2655
2820
  });
2656
2821
  }
2657
2822
  /**
@@ -2660,22 +2825,22 @@ class hr {
2660
2825
  * @return {Promise<Object3D>}
2661
2826
  */
2662
2827
  loadNode(e) {
2663
- const t = this.json, s = this, n = t.nodes[e], r = s._loadNodeShallow(e), o = [], c = n.children || [];
2664
- for (let l = 0, u = c.length; l < u; l++)
2665
- o.push(s.getDependency("node", c[l]));
2666
- const a = n.skin === void 0 ? Promise.resolve(null) : s.getDependency("skin", n.skin);
2828
+ const t = this.json, s = this, n = t.nodes[e], o = s._loadNodeShallow(e), r = [], c = n.children || [];
2829
+ for (let l = 0, h = c.length; l < h; l++)
2830
+ r.push(s.getDependency("node", c[l]));
2831
+ const i = n.skin === void 0 ? Promise.resolve(null) : s.getDependency("skin", n.skin);
2667
2832
  return Promise.all([
2668
- r,
2669
- Promise.all(o),
2670
- a
2833
+ o,
2834
+ Promise.all(r),
2835
+ i
2671
2836
  ]).then(function(l) {
2672
- const u = l[0], h = l[1], d = l[2];
2673
- d !== null && u.traverse(function(p) {
2674
- p.isSkinnedMesh && p.bind(d, ur);
2837
+ const h = l[0], u = l[1], d = l[2];
2838
+ d !== null && h.traverse(function(m) {
2839
+ m.isSkinnedMesh && m.bind(d, Sr);
2675
2840
  });
2676
- for (let p = 0, g = h.length; p < g; p++)
2677
- u.add(h[p]);
2678
- return u;
2841
+ for (let m = 0, A = u.length; m < A; m++)
2842
+ h.add(u[m]);
2843
+ return h;
2679
2844
  });
2680
2845
  }
2681
2846
  // ._loadNodeShallow() parses a single node.
@@ -2684,26 +2849,26 @@ class hr {
2684
2849
  const t = this.json, s = this.extensions, n = this;
2685
2850
  if (this.nodeCache[e] !== void 0)
2686
2851
  return this.nodeCache[e];
2687
- const r = t.nodes[e], o = r.name ? n.createUniqueName(r.name) : "", c = [], a = n._invokeOne(function(l) {
2852
+ const o = t.nodes[e], r = o.name ? n.createUniqueName(o.name) : "", c = [], i = n._invokeOne(function(l) {
2688
2853
  return l.createNodeMesh && l.createNodeMesh(e);
2689
2854
  });
2690
- return a && c.push(a), r.camera !== void 0 && c.push(n.getDependency("camera", r.camera).then(function(l) {
2691
- return n._getNodeRef(n.cameraCache, r.camera, l);
2855
+ return i && c.push(i), o.camera !== void 0 && c.push(n.getDependency("camera", o.camera).then(function(l) {
2856
+ return n._getNodeRef(n.cameraCache, o.camera, l);
2692
2857
  })), n._invokeAll(function(l) {
2693
2858
  return l.createNodeAttachment && l.createNodeAttachment(e);
2694
2859
  }).forEach(function(l) {
2695
2860
  c.push(l);
2696
2861
  }), this.nodeCache[e] = Promise.all(c).then(function(l) {
2697
- let u;
2698
- if (r.isBone === !0 ? u = new In() : l.length > 1 ? u = new Xe() : l.length === 1 ? u = l[0] : u = new Nt(), u !== l[0])
2699
- for (let h = 0, d = l.length; h < d; h++)
2700
- u.add(l[h]);
2701
- if (r.name && (u.userData.name = r.name, u.name = o), K(u, r), r.extensions && ee(s, u, r), r.matrix !== void 0) {
2702
- const h = new Ne();
2703
- h.fromArray(r.matrix), u.applyMatrix4(h);
2862
+ let h;
2863
+ if (o.isBone === !0 ? h = new jn() : l.length > 1 ? h = new Qe() : l.length === 1 ? h = l[0] : h = new Kt(), h !== l[0])
2864
+ for (let u = 0, d = l.length; u < d; u++)
2865
+ h.add(l[u]);
2866
+ if (o.name && (h.userData.name = o.name, h.name = r), z(h, o), o.extensions && te(s, h, o), o.matrix !== void 0) {
2867
+ const u = new Oe();
2868
+ u.fromArray(o.matrix), h.applyMatrix4(u);
2704
2869
  } else
2705
- r.translation !== void 0 && u.position.fromArray(r.translation), r.rotation !== void 0 && u.quaternion.fromArray(r.rotation), r.scale !== void 0 && u.scale.fromArray(r.scale);
2706
- return n.associations.has(u) || n.associations.set(u, {}), n.associations.get(u).nodes = e, u;
2870
+ o.translation !== void 0 && h.position.fromArray(o.translation), o.rotation !== void 0 && h.quaternion.fromArray(o.rotation), o.scale !== void 0 && h.scale.fromArray(o.scale);
2871
+ return n.associations.has(h) || n.associations.set(h, {}), n.associations.get(h).nodes = e, h;
2707
2872
  }), this.nodeCache[e];
2708
2873
  }
2709
2874
  /**
@@ -2712,96 +2877,96 @@ class hr {
2712
2877
  * @return {Promise<Group>}
2713
2878
  */
2714
2879
  loadScene(e) {
2715
- const t = this.extensions, s = this.json.scenes[e], n = this, r = new Xe();
2716
- s.name && (r.name = n.createUniqueName(s.name)), K(r, s), s.extensions && ee(t, r, s);
2717
- const o = s.nodes || [], c = [];
2718
- for (let a = 0, l = o.length; a < l; a++)
2719
- c.push(n.getDependency("node", o[a]));
2720
- return Promise.all(c).then(function(a) {
2721
- for (let u = 0, h = a.length; u < h; u++)
2722
- r.add(a[u]);
2723
- const l = (u) => {
2724
- const h = /* @__PURE__ */ new Map();
2725
- for (const [d, p] of n.associations)
2726
- (d instanceof je || d instanceof ft) && h.set(d, p);
2727
- return u.traverse((d) => {
2728
- const p = n.associations.get(d);
2729
- p != null && h.set(d, p);
2730
- }), h;
2880
+ const t = this.extensions, s = this.json.scenes[e], n = this, o = new Qe();
2881
+ s.name && (o.name = n.createUniqueName(s.name)), z(o, s), s.extensions && te(t, o, s);
2882
+ const r = s.nodes || [], c = [];
2883
+ for (let i = 0, l = r.length; i < l; i++)
2884
+ c.push(n.getDependency("node", r[i]));
2885
+ return Promise.all(c).then(function(i) {
2886
+ for (let h = 0, u = i.length; h < u; h++)
2887
+ o.add(i[h]);
2888
+ const l = (h) => {
2889
+ const u = /* @__PURE__ */ new Map();
2890
+ for (const [d, m] of n.associations)
2891
+ (d instanceof Ze || d instanceof wt) && u.set(d, m);
2892
+ return h.traverse((d) => {
2893
+ const m = n.associations.get(d);
2894
+ m != null && u.set(d, m);
2895
+ }), u;
2731
2896
  };
2732
- return n.associations = l(r), r;
2897
+ return n.associations = l(o), o;
2733
2898
  });
2734
2899
  }
2735
- _createAnimationTracks(e, t, s, n, r) {
2736
- const o = [], c = e.name ? e.name : e.uuid, a = [];
2737
- Q[r.path] === Q.weights ? e.traverse(function(d) {
2738
- d.morphTargetInfluences && a.push(d.name ? d.name : d.uuid);
2739
- }) : a.push(c);
2900
+ _createAnimationTracks(e, t, s, n, o) {
2901
+ const r = [], c = e.name ? e.name : e.uuid, i = [];
2902
+ Q[o.path] === Q.weights ? e.traverse(function(d) {
2903
+ d.morphTargetInfluences && i.push(d.name ? d.name : d.uuid);
2904
+ }) : i.push(c);
2740
2905
  let l;
2741
- switch (Q[r.path]) {
2906
+ switch (Q[o.path]) {
2742
2907
  case Q.weights:
2743
- l = mt;
2908
+ l = yt;
2744
2909
  break;
2745
2910
  case Q.rotation:
2746
- l = gt;
2911
+ l = _t;
2747
2912
  break;
2748
2913
  case Q.position:
2749
2914
  case Q.scale:
2750
- l = pt;
2915
+ l = St;
2751
2916
  break;
2752
2917
  default:
2753
2918
  switch (s.itemSize) {
2754
2919
  case 1:
2755
- l = mt;
2920
+ l = yt;
2756
2921
  break;
2757
2922
  case 2:
2758
2923
  case 3:
2759
2924
  default:
2760
- l = pt;
2925
+ l = St;
2761
2926
  break;
2762
2927
  }
2763
2928
  break;
2764
2929
  }
2765
- const u = n.interpolation !== void 0 ? rr[n.interpolation] : Dt, h = this._getArrayFromAccessor(s);
2766
- for (let d = 0, p = a.length; d < p; d++) {
2767
- const g = new l(
2768
- a[d] + "." + Q[r.path],
2930
+ const h = n.interpolation !== void 0 ? xr[n.interpolation] : zt, u = this._getArrayFromAccessor(s);
2931
+ for (let d = 0, m = i.length; d < m; d++) {
2932
+ const A = new l(
2933
+ i[d] + "." + Q[o.path],
2769
2934
  t.array,
2770
- h,
2771
- u
2935
+ u,
2936
+ h
2772
2937
  );
2773
- n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(g), o.push(g);
2938
+ n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(A), r.push(A);
2774
2939
  }
2775
- return o;
2940
+ return r;
2776
2941
  }
2777
2942
  _getArrayFromAccessor(e) {
2778
2943
  let t = e.array;
2779
2944
  if (e.normalized) {
2780
- const s = it(t.constructor), n = new Float32Array(t.length);
2781
- for (let r = 0, o = t.length; r < o; r++)
2782
- n[r] = t[r] * s;
2945
+ const s = pt(t.constructor), n = new Float32Array(t.length);
2946
+ for (let o = 0, r = t.length; o < r; o++)
2947
+ n[o] = t[o] * s;
2783
2948
  t = n;
2784
2949
  }
2785
2950
  return t;
2786
2951
  }
2787
2952
  _createCubicSplineTrackInterpolant(e) {
2788
2953
  e.createInterpolant = function(s) {
2789
- const n = this instanceof gt ? sr : Xt;
2954
+ const n = this instanceof _t ? Tr : tn;
2790
2955
  return new n(this.times, this.values, this.getValueSize() / 3, s);
2791
2956
  }, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
2792
2957
  }
2793
2958
  }
2794
- function dr(i, e, t) {
2795
- const s = e.attributes, n = new Fn();
2959
+ function _r(a, e, t) {
2960
+ const s = e.attributes, n = new Vn();
2796
2961
  if (s.POSITION !== void 0) {
2797
- const c = t.json.accessors[s.POSITION], a = c.min, l = c.max;
2798
- if (a !== void 0 && l !== void 0) {
2962
+ const c = t.json.accessors[s.POSITION], i = c.min, l = c.max;
2963
+ if (i !== void 0 && l !== void 0) {
2799
2964
  if (n.set(
2800
- new te(a[0], a[1], a[2]),
2801
- new te(l[0], l[1], l[2])
2965
+ new se(i[0], i[1], i[2]),
2966
+ new se(l[0], l[1], l[2])
2802
2967
  ), c.normalized) {
2803
- const u = it(le[c.componentType]);
2804
- n.min.multiplyScalar(u), n.max.multiplyScalar(u);
2968
+ const h = pt(ue[c.componentType]);
2969
+ n.min.multiplyScalar(h), n.max.multiplyScalar(h);
2805
2970
  }
2806
2971
  } else {
2807
2972
  console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
@@ -2809,120 +2974,120 @@ function dr(i, e, t) {
2809
2974
  }
2810
2975
  } else
2811
2976
  return;
2812
- const r = e.targets;
2813
- if (r !== void 0) {
2814
- const c = new te(), a = new te();
2815
- for (let l = 0, u = r.length; l < u; l++) {
2816
- const h = r[l];
2817
- if (h.POSITION !== void 0) {
2818
- const d = t.json.accessors[h.POSITION], p = d.min, g = d.max;
2819
- if (p !== void 0 && g !== void 0) {
2820
- if (a.setX(Math.max(Math.abs(p[0]), Math.abs(g[0]))), a.setY(Math.max(Math.abs(p[1]), Math.abs(g[1]))), a.setZ(Math.max(Math.abs(p[2]), Math.abs(g[2]))), d.normalized) {
2821
- const A = it(le[d.componentType]);
2822
- a.multiplyScalar(A);
2977
+ const o = e.targets;
2978
+ if (o !== void 0) {
2979
+ const c = new se(), i = new se();
2980
+ for (let l = 0, h = o.length; l < h; l++) {
2981
+ const u = o[l];
2982
+ if (u.POSITION !== void 0) {
2983
+ const d = t.json.accessors[u.POSITION], m = d.min, A = d.max;
2984
+ if (m !== void 0 && A !== void 0) {
2985
+ if (i.setX(Math.max(Math.abs(m[0]), Math.abs(A[0]))), i.setY(Math.max(Math.abs(m[1]), Math.abs(A[1]))), i.setZ(Math.max(Math.abs(m[2]), Math.abs(A[2]))), d.normalized) {
2986
+ const g = pt(ue[d.componentType]);
2987
+ i.multiplyScalar(g);
2823
2988
  }
2824
- c.max(a);
2989
+ c.max(i);
2825
2990
  } else
2826
2991
  console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
2827
2992
  }
2828
2993
  }
2829
2994
  n.expandByVector(c);
2830
2995
  }
2831
- i.boundingBox = n;
2832
- const o = new On();
2833
- n.getCenter(o.center), o.radius = n.min.distanceTo(n.max) / 2, i.boundingSphere = o;
2996
+ a.boundingBox = n;
2997
+ const r = new zn();
2998
+ n.getCenter(r.center), r.radius = n.min.distanceTo(n.max) / 2, a.boundingSphere = r;
2834
2999
  }
2835
- function yt(i, e, t) {
3000
+ function Bt(a, e, t) {
2836
3001
  const s = e.attributes, n = [];
2837
- function r(o, c) {
2838
- return t.getDependency("accessor", o).then(function(a) {
2839
- i.setAttribute(c, a);
3002
+ function o(r, c) {
3003
+ return t.getDependency("accessor", r).then(function(i) {
3004
+ a.setAttribute(c, i);
2840
3005
  });
2841
3006
  }
2842
- for (const o in s) {
2843
- const c = ot[o] || o.toLowerCase();
2844
- c in i.attributes || n.push(r(s[o], c));
3007
+ for (const r in s) {
3008
+ const c = mt[r] || r.toLowerCase();
3009
+ c in a.attributes || n.push(o(s[r], c));
2845
3010
  }
2846
- if (e.indices !== void 0 && !i.index) {
2847
- const o = t.getDependency("accessor", e.indices).then(function(c) {
2848
- i.setIndex(c);
3011
+ if (e.indices !== void 0 && !a.index) {
3012
+ const r = t.getDependency("accessor", e.indices).then(function(c) {
3013
+ a.setIndex(c);
2849
3014
  });
2850
- n.push(o);
3015
+ n.push(r);
2851
3016
  }
2852
- return At.workingColorSpace !== V && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${At.workingColorSpace}" not supported.`), K(i, e), dr(i, e, t), Promise.all(n).then(function() {
2853
- return e.targets !== void 0 ? ir(i, e.targets, t) : i;
3017
+ return Lt.workingColorSpace !== Z && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Lt.workingColorSpace}" not supported.`), z(a, e), _r(a, e, t), Promise.all(n).then(function() {
3018
+ return e.targets !== void 0 ? Mr(a, e.targets, t) : a;
2854
3019
  });
2855
3020
  }
2856
- const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new Map(), fr = (i) => {
2857
- const e = Je.get(i);
3021
+ const ke = [0, 0, -10], re = [0.5, 0.5, 0.5], nn = 1, ct = /* @__PURE__ */ new Map(), Lr = (a) => {
3022
+ const e = ct.get(a);
2858
3023
  if (e) return e;
2859
- const t = new Ns(), s = Bt(i).then(
2860
- (n) => new Promise((r, o) => {
2861
- t.parse(n, "", r, o);
3024
+ const t = new zs(), s = Zt(a).then(
3025
+ (n) => new Promise((o, r) => {
3026
+ t.parse(n, "", o, r);
2862
3027
  })
2863
3028
  ).catch((n) => {
2864
- throw Je.delete(i), n;
3029
+ throw ct.delete(a), n;
2865
3030
  });
2866
- return Je.set(i, s), s;
2867
- }, Yt = ({
2868
- position: i,
3031
+ return ct.set(a, s), s;
3032
+ }, sn = ({
3033
+ position: a,
2869
3034
  rotation: e,
2870
3035
  scale: t,
2871
3036
  url: s,
2872
3037
  showDebugMaterial: n = !1,
2873
- opacity: r = Kt
3038
+ opacity: o = nn
2874
3039
  }) => {
2875
- const o = s ?? new URL("/assets/xr/3d-models/head-occluder-v2.glb", Pe.assetStorageEndpoint).toString(), [c, a] = at(null);
3040
+ const r = s ?? new URL("/assets/xr/3d-models/head-occluder-v2.glb", De.assetStorageEndpoint).toString(), [c, i] = gt(null);
2876
3041
  $(() => {
2877
- let u = !1;
2878
- return fr(o).then((h) => {
2879
- u || a(h.scene);
2880
- }).catch((h) => {
2881
- u || console.error(`${Pe.loggerPrefix} head occluder load failed`, h);
3042
+ let h = !1;
3043
+ return Lr(r).then((u) => {
3044
+ h || i(u.scene);
3045
+ }).catch((u) => {
3046
+ h || console.error(`${De.loggerPrefix} head occluder load failed`, u);
2882
3047
  }), () => {
2883
- u = !0;
3048
+ h = !0;
2884
3049
  };
2885
- }, [o]);
2886
- const l = j(() => {
3050
+ }, [r]);
3051
+ const l = W(() => {
2887
3052
  if (!c) return null;
2888
- const u = c.clone();
2889
- return u.traverse((h) => {
2890
- h instanceof R.Mesh && (h.material = new R.MeshStandardMaterial({
3053
+ const h = c.clone();
3054
+ return h.traverse((u) => {
3055
+ u instanceof R.Mesh && (u.material = new R.MeshStandardMaterial({
2891
3056
  color: 15132390,
2892
3057
  colorWrite: n,
2893
3058
  depthWrite: !0,
2894
- opacity: n ? r : 1,
3059
+ opacity: n ? o : 1,
2895
3060
  side: R.DoubleSide,
2896
3061
  transparent: n
2897
3062
  }));
2898
- }), u;
2899
- }, [c, n, r]);
3063
+ }), h;
3064
+ }, [c, n, o]);
2900
3065
  return $(() => {
2901
3066
  if (l)
2902
3067
  return () => {
2903
- l.traverse((u) => {
2904
- u instanceof R.Mesh && u.material.dispose();
3068
+ l.traverse((h) => {
3069
+ h instanceof R.Mesh && h.material.dispose();
2905
3070
  });
2906
3071
  };
2907
- }, [l]), l ? (i ? l.position.set(i[0], i[1], i[2]) : l.position.set(
2908
- Ce[0],
2909
- Ce[1],
2910
- Ce[2]
3072
+ }, [l]), l ? (a ? l.position.set(a[0], a[1], a[2]) : l.position.set(
3073
+ ke[0],
3074
+ ke[1],
3075
+ ke[2]
2911
3076
  ), e && l.rotation.set(e[0], e[1], e[2]), t ? l.scale.set(t[0], t[1], t[2]) : l.scale.set(
2912
- ne[0],
2913
- ne[1],
2914
- ne[2]
2915
- ), l.renderOrder = -1, /* @__PURE__ */ T("primitive", { object: l })) : null;
2916
- }, pr = 4, Yr = ({
2917
- children: i,
3077
+ re[0],
3078
+ re[1],
3079
+ re[2]
3080
+ ), l.renderOrder = -1, /* @__PURE__ */ x("primitive", { object: l })) : null;
3081
+ }, Cr = 4, co = ({
3082
+ children: a,
2918
3083
  faceIndex: e = 0,
2919
- numFaces: t = pr,
3084
+ numFaces: t = Cr,
2920
3085
  scaleWithFace: s = !0,
2921
3086
  occluder: n = !0,
2922
- showFaceMesh: r = !1,
2923
- faceMeshMaterial: o
3087
+ showFaceMesh: o = !1,
3088
+ faceMeshMaterial: r
2924
3089
  }) => {
2925
- const c = j(
3090
+ const c = W(
2926
3091
  () => new R.MeshBasicMaterial({
2927
3092
  color: "#22c55e",
2928
3093
  side: R.BackSide,
@@ -2931,60 +3096,60 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
2931
3096
  depthWrite: !1
2932
3097
  }),
2933
3098
  []
2934
- ), a = n === !1 ? null : n === !0 ? {} : n;
2935
- return /* @__PURE__ */ w(Hn, { faceIndex: e, numFaces: t, scaleWithFace: s, children: [
2936
- a && /* @__PURE__ */ T(
2937
- Yt,
3099
+ ), i = n === !1 ? null : n === !0 ? {} : n;
3100
+ return /* @__PURE__ */ S(es, { faceIndex: e, numFaces: t, scaleWithFace: s, children: [
3101
+ i && /* @__PURE__ */ x(
3102
+ sn,
2938
3103
  {
2939
- position: a.position ?? Ce,
2940
- rotation: a.rotation,
2941
- scale: a.scale ?? ne,
2942
- url: a.url,
2943
- showDebugMaterial: a.showDebugMaterial,
2944
- opacity: a.opacity ?? Kt
3104
+ position: i.position ?? ke,
3105
+ rotation: i.rotation,
3106
+ scale: i.scale ?? re,
3107
+ url: i.url,
3108
+ showDebugMaterial: i.showDebugMaterial,
3109
+ opacity: i.opacity ?? nn
2945
3110
  }
2946
3111
  ),
2947
- i,
2948
- r && /* @__PURE__ */ T(
2949
- jn,
3112
+ a,
3113
+ o && /* @__PURE__ */ x(
3114
+ ts,
2950
3115
  {
2951
3116
  faceIndex: e,
2952
3117
  numFaces: t,
2953
- material: o ?? c
3118
+ material: r ?? c
2954
3119
  }
2955
3120
  )
2956
3121
  ] });
2957
- }, mr = 57, gr = 15.5, et = mr / Math.PI / gr, Ar = -0.134, Tr = -0.024, Y = (i, e, t) => Math.min(t, Math.max(e, i)), Vt = (i, e) => i * e - e / 2, Wt = (i, e) => -(i * e - e / 2), xr = ({
2958
- eyeMidX: i,
3122
+ }, Ir = 57, Pr = 15.5, lt = Ir / Math.PI / Pr, Nr = -0.134, Fr = -0.024, q = (a, e, t) => Math.min(t, Math.max(e, a)), rn = (a, e) => a * e - e / 2, on = (a, e) => -(a * e - e / 2), kr = ({
3123
+ eyeMidX: a,
2959
3124
  noseX: e,
2960
3125
  offsetX: t,
2961
3126
  rawYaw: s,
2962
3127
  sideMidX: n
2963
3128
  }) => {
2964
- const r = Y((Math.abs(s) - 0.18) / 0.42, 0, 1), o = n * 0.75 + i * 0.25, c = i * 0.7 + e * 0.3;
2965
- return o * (1 - r) + c * r + t;
2966
- }, Vr = ({
2967
- baseScale: i,
3129
+ const o = q((Math.abs(s) - 0.18) / 0.42, 0, 1), r = n * 0.75 + a * 0.25, c = a * 0.7 + e * 0.3;
3130
+ return r * (1 - o) + c * o + t;
3131
+ }, lo = ({
3132
+ baseScale: a,
2968
3133
  pitchRadians: e
2969
3134
  }) => {
2970
- const t = e * 180 / Math.PI, n = 1 + Y((t - 6) / 22, 0, 1) * 0.22;
2971
- return [i[0] * n, i[1] * n, i[2] * n];
2972
- }, Wr = ({ yawRadians: i }) => {
2973
- const e = Math.abs(i * 180 / Math.PI), s = 0.066 * Y((e - 8) / 12, 0, 1);
2974
- return Math.sign(i) * s;
2975
- }, zr = ({
2976
- pitchRadians: i
3135
+ const t = e * 180 / Math.PI, n = 1 + q((t - 6) / 22, 0, 1) * 0.22;
3136
+ return [a[0] * n, a[1] * n, a[2] * n];
3137
+ }, uo = ({ yawRadians: a }) => {
3138
+ const e = Math.abs(a * 180 / Math.PI), s = 0.066 * q((e - 8) / 12, 0, 1);
3139
+ return Math.sign(a) * s;
3140
+ }, ho = ({
3141
+ pitchRadians: a
2977
3142
  }) => {
2978
- const e = i * 180 / Math.PI;
2979
- return -0.026 * Y((-e - 6) / 18, 0, 1);
2980
- }, qr = ({
2981
- baseOffset: i,
3143
+ const e = a * 180 / Math.PI;
3144
+ return -0.026 * q((-e - 6) / 18, 0, 1);
3145
+ }, fo = ({
3146
+ baseOffset: a,
2982
3147
  yawRadians: e
2983
3148
  }) => {
2984
- const t = Math.abs(e * 180 / Math.PI), s = Y((t - 8) / 24, 0, 1);
2985
- return i + s * 0.25;
2986
- }, Zr = ({
2987
- baseOffsetY: i,
3149
+ const t = Math.abs(e * 180 / Math.PI), s = q((t - 8) / 24, 0, 1);
3150
+ return a + s * 0.25;
3151
+ }, mo = ({
3152
+ baseOffsetY: a,
2988
3153
  baseScaleY: e,
2989
3154
  face: t
2990
3155
  }) => {
@@ -2993,167 +3158,167 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
2993
3158
  aspectRatio: 0,
2994
3159
  normalizedAspect: 0,
2995
3160
  scaleY: e,
2996
- offsetY: i
3161
+ offsetY: a
2997
3162
  };
2998
- const s = t.bounds.height / t.bounds.width, n = Y((s - 1.55) / 0.35, -1, 1);
3163
+ const s = t.bounds.height / t.bounds.width, n = q((s - 1.55) / 0.35, -1, 1);
2999
3164
  return {
3000
3165
  aspectRatio: s,
3001
3166
  normalizedAspect: n,
3002
3167
  scaleY: e + n * 0.06,
3003
- offsetY: i + n * 5e-3
3168
+ offsetY: a + n * 5e-3
3004
3169
  };
3005
- }, vr = ({
3006
- face: i,
3170
+ }, Or = ({
3171
+ face: a,
3007
3172
  offsetX: e,
3008
3173
  offsetY: t,
3009
3174
  scaleX: s,
3010
3175
  scaleY: n
3011
3176
  }) => {
3012
- const r = i.bounds.width * s, o = i.bounds.height * n, c = i.bounds.centerX + e, a = i.bounds.centerY + t;
3177
+ const o = a.bounds.width * s, r = a.bounds.height * n, c = a.bounds.centerX + e, i = a.bounds.centerY + t;
3013
3178
  return {
3014
- x: c - r * 0.5,
3015
- y: a - o * 0.5,
3016
- width: r,
3017
- height: o,
3179
+ x: c - o * 0.5,
3180
+ y: i - r * 0.5,
3181
+ width: o,
3182
+ height: r,
3018
3183
  centerX: c,
3019
- centerY: a
3184
+ centerY: i
3020
3185
  };
3021
- }, br = ({
3022
- face: i,
3186
+ }, Dr = ({
3187
+ face: a,
3023
3188
  height: e,
3024
3189
  lockDepth: t,
3025
3190
  lockRotation: s,
3026
3191
  model: n,
3027
- offsetX: r,
3028
- offsetY: o,
3192
+ offsetX: o,
3193
+ offsetY: r,
3029
3194
  scaleX: c,
3030
- scaleY: a,
3195
+ scaleY: i,
3031
3196
  scaleZ: l,
3032
- width: u
3197
+ width: h
3033
3198
  }) => {
3034
- const h = vr({
3035
- face: i,
3036
- offsetX: r,
3037
- offsetY: o,
3199
+ const u = Or({
3200
+ face: a,
3201
+ offsetX: o,
3202
+ offsetY: r,
3038
3203
  scaleX: c,
3039
- scaleY: a
3040
- }), d = i.landmarks[33], p = i.landmarks[263], g = i.landmarks[234], A = i.landmarks[454], m = i.landmarks[1], f = i.landmarks[10], x = i.landmarks[152], v = h.width * u, b = h.height * e, y = d && p ? (d.x + p.x) * 0.5 : i.bounds.centerX, L = d && p ? (d.y + p.y) * 0.5 : i.bounds.centerY - i.bounds.height * 0.15, _ = g && A ? (g.x + A.x) * 0.5 : y, D = (f == null ? void 0 : f.y) ?? i.bounds.minY, M = (x == null ? void 0 : x.y) ?? i.bounds.maxY, P = (D + M) * 0.5, re = d && p ? Math.atan2(p.y - d.y, p.x - d.x) : 0, I = m && i.bounds.width > 0 ? Y((m.x - i.bounds.centerX) / (i.bounds.width * 0.5), -1, 1) * 0.75 : 0, W = xr({
3041
- eyeMidX: y,
3042
- noseX: (m == null ? void 0 : m.x) ?? y,
3043
- offsetX: r,
3044
- rawYaw: I,
3045
- sideMidX: _
3046
- }), S = P * 0.75 + L * 0.25 + o, oe = n === "v2" ? Vt(W, u) : h.centerX * u - u / 2, z = n === "v2" ? Wt(i.bounds.centerY + o * 0.75, e) : -(h.centerY * e - e / 2), q = f && m ? Math.max(1e-4, m.y - f.y) : i.bounds.height * 0.42, ue = m && x ? Math.max(1e-4, x.y - m.y) : i.bounds.height * 0.58, he = (ue - q) / (ue + q), de = Y((he - Ar) / 0.28, -1, 1) * 0.58, fe = m && i.bounds.height > 0 ? Y(
3047
- (i.bounds.centerY - m.y) / (i.bounds.height * 0.5) - Tr,
3204
+ scaleY: i
3205
+ }), d = a.landmarks[33], m = a.landmarks[263], A = a.landmarks[234], g = a.landmarks[454], p = a.landmarks[1], f = a.landmarks[10], v = a.landmarks[152], T = u.width * h, b = u.height * e, E = d && m ? (d.x + m.x) * 0.5 : a.bounds.centerX, L = d && m ? (d.y + m.y) * 0.5 : a.bounds.centerY - a.bounds.height * 0.15, y = A && g ? (A.x + g.x) * 0.5 : E, N = (f == null ? void 0 : f.y) ?? a.bounds.minY, C = (v == null ? void 0 : v.y) ?? a.bounds.maxY, I = (N + C) * 0.5, O = d && m ? Math.atan2(m.y - d.y, m.x - d.x) : 0, F = p && a.bounds.width > 0 ? q((p.x - a.bounds.centerX) / (a.bounds.width * 0.5), -1, 1) * 0.75 : 0, _ = kr({
3206
+ eyeMidX: E,
3207
+ noseX: (p == null ? void 0 : p.x) ?? E,
3208
+ offsetX: o,
3209
+ rawYaw: F,
3210
+ sideMidX: y
3211
+ }), w = I * 0.75 + L * 0.25 + r, he = n === "v2" ? rn(_, h) : u.centerX * h - h / 2, G = n === "v2" ? on(a.bounds.centerY + r * 0.75, e) : -(u.centerY * e - e / 2), J = f && p ? Math.max(1e-4, p.y - f.y) : a.bounds.height * 0.42, Re = p && v ? Math.max(1e-4, v.y - p.y) : a.bounds.height * 0.58, de = (Re - J) / (Re + J), fe = q((de - Nr) / 0.28, -1, 1) * 0.58, me = p && a.bounds.height > 0 ? q(
3212
+ (a.bounds.centerY - p.y) / (a.bounds.height * 0.5) - Fr,
3048
3213
  -1,
3049
3214
  1
3050
- ) * 0.18 : 0, ie = de * 0.82 + fe * 0.18, ae = s ? 0 : n === "v2" ? I * 0.72 : I, pe = s ? 0 : n === "v2" ? -ie * 0.78 : -ie, me = s ? 0 : -re, be = t ? v * et : n === "v2" ? v * (et + Math.abs(ae) * 0.18) : v * et;
3215
+ ) * 0.18 : 0, ae = fe * 0.82 + me * 0.18, pe = s ? 0 : n === "v2" ? F * 0.72 : F, Ee = s ? 0 : n === "v2" ? -ae * 0.78 : -ae, we = s ? 0 : -O, Se = t ? T * lt : n === "v2" ? T * (lt + Math.abs(pe) * 0.18) : T * lt;
3051
3216
  return {
3052
- centerXPx: oe,
3053
- centerYPx: z,
3054
- depthPx: be * l,
3217
+ centerXPx: he,
3218
+ centerYPx: G,
3219
+ depthPx: Se * l,
3055
3220
  heightPx: b,
3056
- pitch: pe,
3057
- rawPitch: ie,
3058
- rawPitchFromBalance: de,
3059
- rawPitchFromCenter: fe,
3060
- rawYaw: I,
3061
- rotationZ: me,
3062
- roll: re,
3063
- shape: h,
3064
- skullAnchorX: W,
3065
- skullAnchorY: S,
3066
- verticalBalance: he,
3067
- widthPx: v,
3068
- yaw: ae
3221
+ pitch: Ee,
3222
+ rawPitch: ae,
3223
+ rawPitchFromBalance: fe,
3224
+ rawPitchFromCenter: me,
3225
+ rawYaw: F,
3226
+ rotationZ: we,
3227
+ roll: O,
3228
+ shape: u,
3229
+ skullAnchorX: _,
3230
+ skullAnchorY: w,
3231
+ verticalBalance: de,
3232
+ widthPx: T,
3233
+ yaw: pe
3069
3234
  };
3070
- }, Er = ({
3071
- lockDepth: i,
3235
+ }, Ur = ({
3236
+ lockDepth: a,
3072
3237
  lockRotation: e,
3073
3238
  model: t,
3074
3239
  face: s,
3075
3240
  height: n,
3076
- headDepthOffset: r,
3077
- offsetX: o,
3241
+ headDepthOffset: o,
3242
+ offsetX: r,
3078
3243
  offsetY: c,
3079
- rotationOffsetX: a,
3244
+ rotationOffsetX: i,
3080
3245
  rotationOffsetY: l,
3081
- rotationOffsetZ: u,
3082
- scaleX: h,
3246
+ rotationOffsetZ: h,
3247
+ scaleX: u,
3083
3248
  scaleY: d,
3084
- scaleZ: p,
3085
- skullCenterMode: g,
3086
- skullVerticalBias: A,
3087
- width: m
3088
- }) => zt({
3089
- lockDepth: i,
3249
+ scaleZ: m,
3250
+ skullCenterMode: A,
3251
+ skullVerticalBias: g,
3252
+ width: p
3253
+ }) => an({
3254
+ lockDepth: a,
3090
3255
  lockRotation: e,
3091
3256
  model: t,
3092
3257
  face: s,
3093
3258
  height: n,
3094
- headDepthOffset: r,
3095
- offsetX: o,
3259
+ headDepthOffset: o,
3260
+ offsetX: r,
3096
3261
  offsetY: c,
3097
- rotationOffsetX: a,
3262
+ rotationOffsetX: i,
3098
3263
  rotationOffsetY: l,
3099
- rotationOffsetZ: u,
3100
- scaleX: h,
3264
+ rotationOffsetZ: h,
3265
+ scaleX: u,
3101
3266
  scaleY: d,
3102
- scaleZ: p,
3103
- skullCenterMode: g,
3104
- skullVerticalBias: A,
3105
- width: m
3106
- }).pose, zt = ({
3107
- lockDepth: i,
3267
+ scaleZ: m,
3268
+ skullCenterMode: A,
3269
+ skullVerticalBias: g,
3270
+ width: p
3271
+ }).pose, an = ({
3272
+ lockDepth: a,
3108
3273
  lockRotation: e,
3109
3274
  model: t,
3110
3275
  face: s,
3111
3276
  height: n,
3112
- headDepthOffset: r,
3113
- offsetX: o,
3277
+ headDepthOffset: o,
3278
+ offsetX: r,
3114
3279
  offsetY: c,
3115
- rotationOffsetX: a,
3280
+ rotationOffsetX: i,
3116
3281
  rotationOffsetY: l,
3117
- rotationOffsetZ: u,
3118
- scaleX: h,
3282
+ rotationOffsetZ: h,
3283
+ scaleX: u,
3119
3284
  scaleY: d,
3120
- scaleZ: p,
3121
- skullCenterMode: g,
3122
- skullVerticalBias: A,
3123
- width: m
3285
+ scaleZ: m,
3286
+ skullCenterMode: A,
3287
+ skullVerticalBias: g,
3288
+ width: p
3124
3289
  }) => {
3125
- const f = br({
3290
+ const f = Dr({
3126
3291
  face: s,
3127
3292
  height: n,
3128
- lockDepth: i,
3293
+ lockDepth: a,
3129
3294
  lockRotation: e,
3130
3295
  model: t,
3131
- offsetX: o,
3296
+ offsetX: r,
3132
3297
  offsetY: c,
3133
- scaleX: h,
3298
+ scaleX: u,
3134
3299
  scaleY: d,
3135
- scaleZ: p,
3136
- width: m
3300
+ scaleZ: m,
3301
+ width: p
3137
3302
  });
3138
- if (g) {
3139
- const v = new te(
3303
+ if (A) {
3304
+ const T = new se(
3140
3305
  0,
3141
- f.heightPx * A,
3142
- -f.depthPx * r
3306
+ f.heightPx * g,
3307
+ -f.depthPx * o
3143
3308
  ).applyEuler(
3144
- new Dn(f.pitch, f.yaw, f.rotationZ, "XYZ")
3145
- ), b = Vt(f.skullAnchorX, m), y = Wt(f.skullAnchorY, n);
3309
+ new qn(f.pitch, f.yaw, f.rotationZ, "XYZ")
3310
+ ), b = rn(f.skullAnchorX, p), E = on(f.skullAnchorY, n);
3146
3311
  return {
3147
3312
  pose: {
3148
- boxCenterZ: v.z,
3149
- centerX: b + v.x,
3150
- centerY: y + v.y,
3313
+ boxCenterZ: T.z,
3314
+ centerX: b + T.x,
3315
+ centerY: E + T.y,
3151
3316
  width: f.widthPx,
3152
3317
  height: f.heightPx,
3153
3318
  depth: f.depthPx,
3154
- rotationX: f.pitch + a,
3319
+ rotationX: f.pitch + i,
3155
3320
  rotationY: f.yaw + l,
3156
- rotationZ: f.rotationZ + u
3321
+ rotationZ: f.rotationZ + h
3157
3322
  },
3158
3323
  debugMetrics: {
3159
3324
  face: {
@@ -3173,18 +3338,18 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3173
3338
  pose: {
3174
3339
  pitch: f.pitch,
3175
3340
  yaw: f.yaw,
3176
- rotationX: f.pitch + a,
3341
+ rotationX: f.pitch + i,
3177
3342
  rotationY: f.yaw + l,
3178
- rotationZ: f.rotationZ + u
3343
+ rotationZ: f.rotationZ + h
3179
3344
  },
3180
3345
  skullAnchor: {
3181
3346
  x: f.skullAnchorX,
3182
3347
  y: f.skullAnchorY
3183
3348
  },
3184
3349
  center: {
3185
- x: b + v.x,
3186
- y: y + v.y,
3187
- z: v.z
3350
+ x: b + T.x,
3351
+ y: E + T.y,
3352
+ z: T.z
3188
3353
  },
3189
3354
  depthPx: f.depthPx,
3190
3355
  screen: {
@@ -3196,15 +3361,15 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3196
3361
  }
3197
3362
  return {
3198
3363
  pose: {
3199
- boxCenterZ: -f.depthPx * r,
3364
+ boxCenterZ: -f.depthPx * o,
3200
3365
  centerX: f.centerXPx,
3201
3366
  centerY: f.centerYPx,
3202
3367
  width: f.widthPx,
3203
3368
  height: f.heightPx,
3204
3369
  depth: f.depthPx,
3205
- rotationX: f.pitch + a,
3370
+ rotationX: f.pitch + i,
3206
3371
  rotationY: f.yaw + l,
3207
- rotationZ: f.rotationZ + u
3372
+ rotationZ: f.rotationZ + h
3208
3373
  },
3209
3374
  debugMetrics: {
3210
3375
  face: {
@@ -3224,9 +3389,9 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3224
3389
  pose: {
3225
3390
  pitch: f.pitch,
3226
3391
  yaw: f.yaw,
3227
- rotationX: f.pitch + a,
3392
+ rotationX: f.pitch + i,
3228
3393
  rotationY: f.yaw + l,
3229
- rotationZ: f.rotationZ + u
3394
+ rotationZ: f.rotationZ + h
3230
3395
  },
3231
3396
  skullAnchor: {
3232
3397
  x: f.skullAnchorX,
@@ -3235,7 +3400,7 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3235
3400
  center: {
3236
3401
  x: f.centerXPx,
3237
3402
  y: f.centerYPx,
3238
- z: -f.depthPx * r
3403
+ z: -f.depthPx * o
3239
3404
  },
3240
3405
  depthPx: f.depthPx,
3241
3406
  screen: {
@@ -3244,151 +3409,151 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3244
3409
  }
3245
3410
  }
3246
3411
  };
3247
- }, Qr = ({
3248
- lockDepth: i,
3412
+ }, po = ({
3413
+ lockDepth: a,
3249
3414
  lockRotation: e,
3250
3415
  model: t,
3251
3416
  face: s,
3252
3417
  height: n,
3253
- headDepthOffset: r,
3254
- offsetX: o,
3418
+ headDepthOffset: o,
3419
+ offsetX: r,
3255
3420
  offsetY: c,
3256
- rotationOffsetX: a,
3421
+ rotationOffsetX: i,
3257
3422
  rotationOffsetY: l,
3258
- rotationOffsetZ: u,
3259
- scaleX: h,
3423
+ rotationOffsetZ: h,
3424
+ scaleX: u,
3260
3425
  scaleY: d,
3261
- scaleZ: p,
3262
- skullCenterMode: g,
3263
- skullVerticalBias: A,
3264
- width: m
3265
- }) => zt({
3266
- lockDepth: i,
3426
+ scaleZ: m,
3427
+ skullCenterMode: A,
3428
+ skullVerticalBias: g,
3429
+ width: p
3430
+ }) => an({
3431
+ lockDepth: a,
3267
3432
  lockRotation: e,
3268
3433
  model: t,
3269
3434
  face: s,
3270
3435
  height: n,
3271
- headDepthOffset: r,
3272
- offsetX: o,
3436
+ headDepthOffset: o,
3437
+ offsetX: r,
3273
3438
  offsetY: c,
3274
- rotationOffsetX: a,
3439
+ rotationOffsetX: i,
3275
3440
  rotationOffsetY: l,
3276
- rotationOffsetZ: u,
3277
- scaleX: h,
3441
+ rotationOffsetZ: h,
3442
+ scaleX: u,
3278
3443
  scaleY: d,
3279
- scaleZ: p,
3280
- skullCenterMode: g,
3281
- skullVerticalBias: A,
3282
- width: m
3283
- }).debugMetrics, $r = ({
3284
- boxColor: i,
3444
+ scaleZ: m,
3445
+ skullCenterMode: A,
3446
+ skullVerticalBias: g,
3447
+ width: p
3448
+ }).debugMetrics, go = ({
3449
+ boxColor: a,
3285
3450
  boxOpacity: e,
3286
3451
  face: t,
3287
3452
  headDepthOffset: s,
3288
3453
  lockDepth: n,
3289
- lockRotation: r,
3290
- model: o,
3454
+ lockRotation: o,
3455
+ model: r,
3291
3456
  occluderOffset: c,
3292
- occluderOpacity: a,
3457
+ occluderOpacity: i,
3293
3458
  occluderScale: l,
3294
- showOccluderProxy: u = !1,
3295
- offsetX: h,
3459
+ showOccluderProxy: h = !1,
3460
+ offsetX: u,
3296
3461
  offsetY: d,
3297
- pose: p,
3298
- rotationOffsetX: g,
3299
- rotationOffsetY: A,
3300
- rotationOffsetZ: m,
3462
+ pose: m,
3463
+ rotationOffsetX: A,
3464
+ rotationOffsetY: g,
3465
+ rotationOffsetZ: p,
3301
3466
  scaleX: f,
3302
- scaleY: x,
3303
- scaleZ: v,
3467
+ scaleY: v,
3468
+ scaleZ: T,
3304
3469
  show: b,
3305
- showCenterDot: y,
3470
+ showCenterDot: E,
3306
3471
  showFacePlaneReference: L,
3307
- showGizmo: _,
3308
- showHeadOccluder: D,
3309
- skullCenterMode: M,
3310
- skullVerticalBias: P,
3311
- url: re,
3312
- viewportHeight: I,
3313
- viewportWidth: W
3472
+ showGizmo: y,
3473
+ showHeadOccluder: N,
3474
+ skullCenterMode: C,
3475
+ skullVerticalBias: I,
3476
+ url: O,
3477
+ viewportHeight: F,
3478
+ viewportWidth: _
3314
3479
  }) => {
3315
- const S = j(() => p || (!t || W <= 0 || I <= 0 ? null : Er({
3480
+ const w = W(() => m || (!t || _ <= 0 || F <= 0 ? null : Ur({
3316
3481
  face: t,
3317
- width: W,
3318
- height: I,
3482
+ width: _,
3483
+ height: F,
3319
3484
  headDepthOffset: s,
3320
3485
  lockDepth: n,
3321
- lockRotation: r,
3322
- model: o,
3323
- offsetX: h,
3486
+ lockRotation: o,
3487
+ model: r,
3488
+ offsetX: u,
3324
3489
  offsetY: d,
3325
- rotationOffsetX: g,
3326
- rotationOffsetY: A,
3327
- rotationOffsetZ: m,
3490
+ rotationOffsetX: A,
3491
+ rotationOffsetY: g,
3492
+ rotationOffsetZ: p,
3328
3493
  scaleX: f,
3329
- scaleY: x,
3330
- scaleZ: v,
3331
- skullCenterMode: M,
3332
- skullVerticalBias: P
3494
+ scaleY: v,
3495
+ scaleZ: T,
3496
+ skullCenterMode: C,
3497
+ skullVerticalBias: I
3333
3498
  })), [
3334
3499
  t,
3335
3500
  s,
3336
3501
  n,
3337
- r,
3338
3502
  o,
3339
- h,
3503
+ r,
3504
+ u,
3340
3505
  d,
3341
- g,
3342
3506
  A,
3343
- m,
3507
+ g,
3508
+ p,
3344
3509
  f,
3345
- x,
3346
3510
  v,
3347
- M,
3348
- P,
3349
- p,
3511
+ T,
3512
+ C,
3350
3513
  I,
3351
- W
3514
+ m,
3515
+ F,
3516
+ _
3352
3517
  ]);
3353
- if (!b || !S) return null;
3354
- const oe = M ? [0, -S.height * P, S.depth * s] : [0, 0, 0], z = S.height, q = [
3355
- ne[0] * l[0] * z,
3356
- ne[1] * l[1] * z,
3357
- ne[2] * l[2] * z
3518
+ if (!b || !w) return null;
3519
+ const he = C ? [0, -w.height * I, w.depth * s] : [0, 0, 0], G = w.height, J = [
3520
+ re[0] * l[0] * G,
3521
+ re[1] * l[1] * G,
3522
+ re[2] * l[2] * G
3358
3523
  ];
3359
- return /* @__PURE__ */ w(rt, { children: [
3360
- /* @__PURE__ */ w(
3524
+ return /* @__PURE__ */ S(ft, { children: [
3525
+ /* @__PURE__ */ S(
3361
3526
  "group",
3362
3527
  {
3363
- position: [S.centerX, S.centerY, S.boxCenterZ],
3364
- rotation: [S.rotationX, S.rotationY, S.rotationZ],
3528
+ position: [w.centerX, w.centerY, w.boxCenterZ],
3529
+ rotation: [w.rotationX, w.rotationY, w.rotationZ],
3365
3530
  children: [
3366
- /* @__PURE__ */ T("group", { scale: [S.width, S.height, S.depth], children: e > 0 && /* @__PURE__ */ w("mesh", { children: [
3367
- /* @__PURE__ */ T("boxGeometry", { args: [1, 1, 1] }),
3368
- /* @__PURE__ */ T("meshBasicMaterial", { color: i, wireframe: !0, transparent: !0, opacity: e })
3531
+ /* @__PURE__ */ x("group", { scale: [w.width, w.height, w.depth], children: e > 0 && /* @__PURE__ */ S("mesh", { children: [
3532
+ /* @__PURE__ */ x("boxGeometry", { args: [1, 1, 1] }),
3533
+ /* @__PURE__ */ x("meshBasicMaterial", { color: a, wireframe: !0, transparent: !0, opacity: e })
3369
3534
  ] }) }),
3370
- y && /* @__PURE__ */ w("mesh", { children: [
3371
- /* @__PURE__ */ T("sphereGeometry", { args: [6, 20, 20] }),
3372
- /* @__PURE__ */ T("meshBasicMaterial", { color: i })
3535
+ E && /* @__PURE__ */ S("mesh", { children: [
3536
+ /* @__PURE__ */ x("sphereGeometry", { args: [6, 20, 20] }),
3537
+ /* @__PURE__ */ x("meshBasicMaterial", { color: a })
3373
3538
  ] }),
3374
- L && /* @__PURE__ */ w("group", { position: oe, children: [
3375
- /* @__PURE__ */ w("mesh", { rotation: [0, 0, Math.PI / 4], children: [
3376
- /* @__PURE__ */ T("ringGeometry", { args: [6, 8, 24] }),
3377
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#f8fafc", side: Ie })
3539
+ L && /* @__PURE__ */ S("group", { position: he, children: [
3540
+ /* @__PURE__ */ S("mesh", { rotation: [0, 0, Math.PI / 4], children: [
3541
+ /* @__PURE__ */ x("ringGeometry", { args: [6, 8, 24] }),
3542
+ /* @__PURE__ */ x("meshBasicMaterial", { color: "#f8fafc", side: Fe })
3378
3543
  ] }),
3379
- /* @__PURE__ */ w("mesh", { rotation: [0, 0, Math.PI / 2], children: [
3380
- /* @__PURE__ */ T("planeGeometry", { args: [3, 16] }),
3381
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#f8fafc", transparent: !0, opacity: 0.9, side: Ie })
3544
+ /* @__PURE__ */ S("mesh", { rotation: [0, 0, Math.PI / 2], children: [
3545
+ /* @__PURE__ */ x("planeGeometry", { args: [3, 16] }),
3546
+ /* @__PURE__ */ x("meshBasicMaterial", { color: "#f8fafc", transparent: !0, opacity: 0.9, side: Fe })
3382
3547
  ] }),
3383
- /* @__PURE__ */ w("mesh", { children: [
3384
- /* @__PURE__ */ T("planeGeometry", { args: [16, 3] }),
3385
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#f8fafc", transparent: !0, opacity: 0.9, side: Ie })
3548
+ /* @__PURE__ */ S("mesh", { children: [
3549
+ /* @__PURE__ */ x("planeGeometry", { args: [16, 3] }),
3550
+ /* @__PURE__ */ x("meshBasicMaterial", { color: "#f8fafc", transparent: !0, opacity: 0.9, side: Fe })
3386
3551
  ] })
3387
3552
  ] }),
3388
- D && /* @__PURE__ */ w(rt, { children: [
3389
- u && /* @__PURE__ */ w("mesh", { position: c, scale: q, renderOrder: 20, children: [
3390
- /* @__PURE__ */ T("sphereGeometry", { args: [1, 24, 16] }),
3391
- /* @__PURE__ */ T(
3553
+ N && /* @__PURE__ */ S(ft, { children: [
3554
+ h && /* @__PURE__ */ S("mesh", { position: c, scale: J, renderOrder: 20, children: [
3555
+ /* @__PURE__ */ x("sphereGeometry", { args: [1, 24, 16] }),
3556
+ /* @__PURE__ */ x(
3392
3557
  "meshBasicMaterial",
3393
3558
  {
3394
3559
  color: "#facc15",
@@ -3400,57 +3565,57 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3400
3565
  }
3401
3566
  )
3402
3567
  ] }),
3403
- /* @__PURE__ */ T(
3404
- Yt,
3568
+ /* @__PURE__ */ x(
3569
+ sn,
3405
3570
  {
3406
- opacity: a,
3571
+ opacity: i,
3407
3572
  position: c,
3408
- scale: q,
3573
+ scale: J,
3409
3574
  showDebugMaterial: !0,
3410
- url: re
3575
+ url: O
3411
3576
  }
3412
3577
  )
3413
3578
  ] })
3414
3579
  ]
3415
3580
  }
3416
3581
  ),
3417
- _ && /* @__PURE__ */ T(
3582
+ y && /* @__PURE__ */ x(
3418
3583
  "group",
3419
3584
  {
3420
- position: [S.centerX, S.centerY, S.boxCenterZ],
3421
- rotation: [S.rotationX, S.rotationY, S.rotationZ],
3585
+ position: [w.centerX, w.centerY, w.boxCenterZ],
3586
+ rotation: [w.rotationX, w.rotationY, w.rotationZ],
3422
3587
  renderOrder: 10,
3423
- children: /* @__PURE__ */ w("group", { children: [
3424
- /* @__PURE__ */ w("mesh", { children: [
3425
- /* @__PURE__ */ T("sphereGeometry", { args: [6, 20, 20] }),
3426
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#e2e8f0", depthTest: !1, depthWrite: !1 })
3588
+ children: /* @__PURE__ */ S("group", { children: [
3589
+ /* @__PURE__ */ S("mesh", { children: [
3590
+ /* @__PURE__ */ x("sphereGeometry", { args: [6, 20, 20] }),
3591
+ /* @__PURE__ */ x("meshBasicMaterial", { color: "#e2e8f0", depthTest: !1, depthWrite: !1 })
3427
3592
  ] }),
3428
- /* @__PURE__ */ w("mesh", { position: [18, 0, 0], rotation: [0, 0, -Math.PI / 2], children: [
3429
- /* @__PURE__ */ T("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
3430
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#ef4444", depthTest: !1, depthWrite: !1 })
3593
+ /* @__PURE__ */ S("mesh", { position: [18, 0, 0], rotation: [0, 0, -Math.PI / 2], children: [
3594
+ /* @__PURE__ */ x("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
3595
+ /* @__PURE__ */ x("meshBasicMaterial", { color: "#ef4444", depthTest: !1, depthWrite: !1 })
3431
3596
  ] }),
3432
- /* @__PURE__ */ w("mesh", { position: [34, 0, 0], rotation: [0, 0, -Math.PI / 2], children: [
3433
- /* @__PURE__ */ T("coneGeometry", { args: [4.2, 12, 16] }),
3434
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#ef4444", depthTest: !1, depthWrite: !1 })
3597
+ /* @__PURE__ */ S("mesh", { position: [34, 0, 0], rotation: [0, 0, -Math.PI / 2], children: [
3598
+ /* @__PURE__ */ x("coneGeometry", { args: [4.2, 12, 16] }),
3599
+ /* @__PURE__ */ x("meshBasicMaterial", { color: "#ef4444", depthTest: !1, depthWrite: !1 })
3435
3600
  ] }),
3436
- /* @__PURE__ */ w("mesh", { position: [0, 18, 0], children: [
3437
- /* @__PURE__ */ T("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
3438
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#22c55e", depthTest: !1, depthWrite: !1 })
3601
+ /* @__PURE__ */ S("mesh", { position: [0, 18, 0], children: [
3602
+ /* @__PURE__ */ x("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
3603
+ /* @__PURE__ */ x("meshBasicMaterial", { color: "#22c55e", depthTest: !1, depthWrite: !1 })
3439
3604
  ] }),
3440
- /* @__PURE__ */ w("mesh", { position: [0, 34, 0], children: [
3441
- /* @__PURE__ */ T("coneGeometry", { args: [4.2, 12, 16] }),
3442
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#22c55e", depthTest: !1, depthWrite: !1 })
3605
+ /* @__PURE__ */ S("mesh", { position: [0, 34, 0], children: [
3606
+ /* @__PURE__ */ x("coneGeometry", { args: [4.2, 12, 16] }),
3607
+ /* @__PURE__ */ x("meshBasicMaterial", { color: "#22c55e", depthTest: !1, depthWrite: !1 })
3443
3608
  ] }),
3444
- /* @__PURE__ */ w("mesh", { position: [0, 0, 18], rotation: [Math.PI / 2, 0, 0], children: [
3445
- /* @__PURE__ */ T("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
3446
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#3b82f6", depthTest: !1, depthWrite: !1 })
3609
+ /* @__PURE__ */ S("mesh", { position: [0, 0, 18], rotation: [Math.PI / 2, 0, 0], children: [
3610
+ /* @__PURE__ */ x("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
3611
+ /* @__PURE__ */ x("meshBasicMaterial", { color: "#3b82f6", depthTest: !1, depthWrite: !1 })
3447
3612
  ] }),
3448
- /* @__PURE__ */ w("mesh", { position: [0, 0, 34], rotation: [Math.PI / 2, 0, 0], children: [
3449
- /* @__PURE__ */ T("coneGeometry", { args: [4.2, 12, 16] }),
3450
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#3b82f6", depthTest: !1, depthWrite: !1 })
3613
+ /* @__PURE__ */ S("mesh", { position: [0, 0, 34], rotation: [Math.PI / 2, 0, 0], children: [
3614
+ /* @__PURE__ */ x("coneGeometry", { args: [4.2, 12, 16] }),
3615
+ /* @__PURE__ */ x("meshBasicMaterial", { color: "#3b82f6", depthTest: !1, depthWrite: !1 })
3451
3616
  ] }),
3452
- /* @__PURE__ */ T(
3453
- Ye,
3617
+ /* @__PURE__ */ x(
3618
+ Je,
3454
3619
  {
3455
3620
  position: [42, 0, 0],
3456
3621
  fontSize: 10,
@@ -3462,8 +3627,8 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3462
3627
  children: "X"
3463
3628
  }
3464
3629
  ),
3465
- /* @__PURE__ */ T(
3466
- Ye,
3630
+ /* @__PURE__ */ x(
3631
+ Je,
3467
3632
  {
3468
3633
  position: [0, 42, 0],
3469
3634
  fontSize: 10,
@@ -3475,8 +3640,8 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3475
3640
  children: "Y"
3476
3641
  }
3477
3642
  ),
3478
- /* @__PURE__ */ T(
3479
- Ye,
3643
+ /* @__PURE__ */ x(
3644
+ Je,
3480
3645
  {
3481
3646
  position: [0, 0, 42],
3482
3647
  fontSize: 10,
@@ -3494,49 +3659,51 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3494
3659
  ] });
3495
3660
  };
3496
3661
  export {
3497
- Cr as CanonicalFaceMeshRenderer,
3498
- Nr as DEFAULT_APPEARANCE,
3499
- ys as DEFAULT_FEATURE_GROUPS,
3500
- _s as DEFAULT_FEATURE_POINT_INDICES,
3501
- Pr as DEFAULT_MASKING,
3502
- ct as FACE_MASK_SIZE,
3503
- Gt as FACE_OVAL,
3504
- jr as FaceRetouchBackground,
3505
- Kt as HEAD_OCCLUDER_DEFAULT_OPACITY,
3506
- Ce as HEAD_OCCLUDER_DEFAULT_POSITION,
3507
- ne as HEAD_OCCLUDER_DEFAULT_SCALE,
3508
- Yr as HeadBinding,
3509
- $r as HeadBindingOccluder,
3510
- Yt as HeadOccluder,
3511
- Ht as INNER_MOUTH,
3512
- os as LEFT_EYE,
3513
- cs as LEFT_EYEBROW,
3514
- as as OUTER_LIPS,
3515
- is as RIGHT_EYE,
3516
- ls as RIGHT_EYEBROW,
3517
- Br as alphaMapOptions,
3518
- Tt as blendModeIndices,
3519
- Ur as blendModeOptions,
3520
- Zr as computeAdaptiveVerticalFit,
3521
- Er as computeHeadBindingCubePose,
3522
- Qr as computeHeadBindingDebugMetrics,
3523
- vr as computeHeadBindingShape,
3524
- qr as computeUniversalHeadDepthOffset,
3525
- Vr as computeUniversalOccluderScale,
3526
- zr as computeUniversalPitchOffsetY,
3527
- Wr as computeUniversalYawOffsetX,
3528
- Is as createFaceRetouchRegions,
3529
- ds as drawFaceRetouchMask,
3530
- fs as drawMouthRetouchMask,
3531
- Fr as materialTypeOptions,
3532
- Yn as parseCanonicalFaceModel,
3533
- Or as shaderPresetOptions,
3534
- Dr as sideOptions,
3535
- zt as solveHeadBinding,
3536
- Hr as supportsBlendMode,
3537
- Gr as supportsTexturePanel,
3538
- kr as textureMapOptions,
3539
- qn as useCanonicalFaceMesh,
3540
- Xr as useFaceRetouchMask,
3541
- Kr as useFaceRetouchRegions
3662
+ zr as CanonicalFaceMeshRenderer,
3663
+ qr as DEFAULT_APPEARANCE,
3664
+ To as DEFAULT_FACE_WARP_3D_SETTINGS,
3665
+ js as DEFAULT_FEATURE_GROUPS,
3666
+ Ks as DEFAULT_FEATURE_POINT_INDICES,
3667
+ Zr as DEFAULT_MASKING,
3668
+ At as FACE_MASK_SIZE,
3669
+ $t as FACE_OVAL,
3670
+ xo as FACE_WARP_3D_PRESET,
3671
+ oo as FaceRetouchBackground,
3672
+ nn as HEAD_OCCLUDER_DEFAULT_OPACITY,
3673
+ ke as HEAD_OCCLUDER_DEFAULT_POSITION,
3674
+ re as HEAD_OCCLUDER_DEFAULT_SCALE,
3675
+ co as HeadBinding,
3676
+ go as HeadBindingOccluder,
3677
+ sn as HeadOccluder,
3678
+ Jt as INNER_MOUTH,
3679
+ bs as LEFT_EYE,
3680
+ Es as LEFT_EYEBROW,
3681
+ Rs as OUTER_LIPS,
3682
+ Ms as RIGHT_EYE,
3683
+ ws as RIGHT_EYEBROW,
3684
+ to as alphaMapOptions,
3685
+ Ct as blendModeIndices,
3686
+ no as blendModeOptions,
3687
+ mo as computeAdaptiveVerticalFit,
3688
+ Ur as computeHeadBindingCubePose,
3689
+ po as computeHeadBindingDebugMetrics,
3690
+ Or as computeHeadBindingShape,
3691
+ fo as computeUniversalHeadDepthOffset,
3692
+ lo as computeUniversalOccluderScale,
3693
+ ho as computeUniversalPitchOffsetY,
3694
+ uo as computeUniversalYawOffsetX,
3695
+ Ws as createFaceRetouchRegions,
3696
+ _s as drawFaceRetouchMask,
3697
+ Ls as drawMouthRetouchMask,
3698
+ Qr as materialTypeOptions,
3699
+ is as parseCanonicalFaceModel,
3700
+ $r as shaderPresetOptions,
3701
+ Jr as sideOptions,
3702
+ an as solveHeadBinding,
3703
+ ro as supportsBlendMode,
3704
+ so as supportsTexturePanel,
3705
+ eo as textureMapOptions,
3706
+ hs as useCanonicalFaceMesh,
3707
+ ao as useFaceRetouchMask,
3708
+ io as useFaceRetouchRegions
3542
3709
  };