@needle-tools/engine 4.8.8-next.857d744 → 4.8.8-next.e4d7577

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 (33) hide show
  1. package/CHANGELOG.md +4 -5
  2. package/README.md +31 -23
  3. package/dist/{needle-engine.bundle-BATGweff.js → needle-engine.bundle-BQOCkmgC.js} +671 -666
  4. package/dist/{needle-engine.bundle-C0MpXHGe.min.js → needle-engine.bundle-fWjqSVUr.min.js} +82 -82
  5. package/dist/{needle-engine.bundle-gnU2UVys.umd.cjs → needle-engine.bundle-qWPeuyPt.umd.cjs} +104 -104
  6. package/dist/needle-engine.js +2 -2
  7. package/dist/needle-engine.min.js +1 -1
  8. package/dist/needle-engine.umd.cjs +1 -1
  9. package/lib/engine/engine_camera.js +3 -3
  10. package/lib/engine/engine_camera.js.map +1 -1
  11. package/lib/engine/engine_context.d.ts +1 -1
  12. package/lib/engine/engine_context.js +1 -1
  13. package/lib/engine/engine_context.js.map +1 -1
  14. package/lib/engine-components/Camera.d.ts +2 -0
  15. package/lib/engine-components/Camera.js +5 -1
  16. package/lib/engine-components/Camera.js.map +1 -1
  17. package/lib/engine-components/OrbitControls.d.ts +29 -6
  18. package/lib/engine-components/OrbitControls.js +41 -3
  19. package/lib/engine-components/OrbitControls.js.map +1 -1
  20. package/lib/engine-components/api.d.ts +1 -0
  21. package/lib/engine-components/api.js.map +1 -1
  22. package/lib/engine-components/export/usdz/USDZExporter.d.ts +1 -1
  23. package/lib/engine-components/export/usdz/USDZExporter.js +1 -1
  24. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  25. package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
  26. package/package.json +1 -1
  27. package/src/engine/engine_camera.ts +4 -4
  28. package/src/engine/engine_context.ts +1 -1
  29. package/src/engine-components/Camera.ts +7 -1
  30. package/src/engine-components/OrbitControls.ts +63 -10
  31. package/src/engine-components/api.ts +2 -1
  32. package/src/engine-components/export/usdz/USDZExporter.ts +1 -1
  33. package/src/engine-components/webxr/WebXRImageTracking.ts +1 -1
@@ -1,4 +1,4 @@
1
- import { Vector2 as J, Vector3 as b, Vector4 as de, Quaternion as $, PlaneGeometry as Un, WebGLRenderer as ur, PerspectiveCamera as pe, OrthographicCamera as Td, Scene as gi, Mesh as H, Texture as Te, Uniform$1 as zi, Color as se, ShaderMaterial as Ln, Box3 as pi, ShadowMaterial as ob, Euler as Rt, MeshStandardMaterial as ct, Box3Helper as Ww, GridHelper as am, Object3D as M, Material as _e, Matrix3 as rb, Matrix4 as te, Layers as ao, Ray as lo, MathUtils as gs, AxesHelper as mi, MeshBasicMaterial as we, DoubleSide as yi, BufferGeometry as Tn, Group as io, CylinderGeometry as ab, SphereGeometry as Ed, BoxGeometry as la, SpriteMaterial as Vw, Sprite as Hw, Shape as Gw, ExtrudeGeometry as qw, Fog as lb, DirectionalLight as ip, PointLight as lm, EdgesGeometry as Xw, LineSegments as cb, LineBasicMaterial as hb, Line as Zl, BufferAttribute as ht, Raycaster as Ad, Sphere as Id, ArrayCamera as Qw, Plane as nr, SkinnedMesh as ys, InterleavedBufferAttribute as db, Skeleton as Yw, Bone as Kw, Source as Zw, WebGLCubeRenderTarget as Jw, CubeCamera as ex, AnimationClip as no, FileLoader as cm, TextureLoader as Jl, PropertyBinding as ca, LinearSRGBColorSpace as Ss, ShaderChunk as Wt, UniformsLib as tx, DataTexture as hm, RGBAFormat as Ld, EquirectangularReflectionMapping as _s, SRGBColorSpace as Cs, Clock as ix, NeutralToneMapping as ha, AgXToneMapping as Dd, ACESFilmicToneMapping as jd, NoToneMapping as Gh, PCFSoftShadowMap$1 as nx, BasicNodeLibrary as sx, WebGLRenderTarget as Dn, DepthTexture as ub, NearestFilter as qh, LoopRepeat as ox, LoopOnce as np, AnimationMixer as dm, CompressedTexture as rx, FrontSide as co, Camera as ax, Frustum as Gg, AudioListener as lx, PositionalAudio as cx, AudioLoader as sp, EventDispatcher as um, BackSide as Bd, MeshDepthMaterial as hx, CustomBlending as dx, MaxEquation as ux, AmbientLight as fx, HemisphereLight as px, AlwaysStencilFunc as mx, GreaterEqualStencilFunc as gx, NotEqualStencilFunc as yx, GreaterStencilFunc as _x, LessEqualStencilFunc as bx, EqualStencilFunc as vx, LessStencilFunc as wx, NeverStencilFunc as qg, InvertStencilOp as xx, DecrementWrapStencilOp as Sx, IncrementWrapStencilOp as Cx, DecrementStencilOp as Px, IncrementStencilOp as Ox, ReplaceStencilOp as kx, ZeroStencilOp as Mx, KeepStencilOp as Rx, RawShaderMaterial as fb, GLSL3 as Tx, AlwaysDepth as Ex, GreaterEqualDepth as Ax, GreaterDepth as Ix, LessEqualDepth as Lx, LessDepth as Dx, NotEqualDepth as jx, EqualDepth as Bx, BatchedMesh as Xg, MeshPhysicalMaterial as op, LinearFilter as Xh, UnsignedByteType as Fx, RingGeometry as zx, Line3 as Ux, AdditiveBlending as pb, BoxHelper as Nx, SpotLight as $x, DirectionalLightHelper as Wx, CameraHelper as Vx, LOD as Hx, Triangle as Gx, NormalBlending as qx, ReinhardToneMapping as fm, LinearToneMapping as pm, HalfFloatType as Vu, VideoTexture as Xx, CubeUVReflectionMapping as mb, CubeTexture as Qx, CompressedCubeTexture as Yx, EquirectangularRefractionMapping as Kx, VectorKeyframeTrack as Zx, QuaternionKeyframeTrack as Jx, Audio as eS, ShaderLib as Qh, UniformsUtils as gb, MirroredRepeatWrapping as Qg, MeshNormalMaterial as tS, AudioContext as iS, PMREMGenerator$1 as nS } from "./three-BRSLmpyi.js";
1
+ import { Vector2 as J, Vector3 as b, Vector4 as de, Quaternion as N, PlaneGeometry as Un, WebGLRenderer as ur, PerspectiveCamera as pe, OrthographicCamera as Td, Scene as gi, Mesh as H, Texture as Te, Uniform$1 as zi, Color as se, ShaderMaterial as Ln, Box3 as pi, ShadowMaterial as ob, Euler as Rt, MeshStandardMaterial as ct, Box3Helper as Ww, GridHelper as am, Object3D as M, Material as _e, Matrix3 as rb, Matrix4 as te, Layers as ao, Ray as lo, MathUtils as gs, AxesHelper as mi, MeshBasicMaterial as we, DoubleSide as yi, BufferGeometry as Tn, Group as io, CylinderGeometry as ab, SphereGeometry as Ed, BoxGeometry as la, SpriteMaterial as Vw, Sprite as Hw, Shape as Gw, ExtrudeGeometry as qw, Fog as lb, DirectionalLight as ip, PointLight as lm, EdgesGeometry as Xw, LineSegments as cb, LineBasicMaterial as hb, Line as Zl, BufferAttribute as ht, Raycaster as Ad, Sphere as Id, ArrayCamera as Qw, Plane as nr, SkinnedMesh as ys, InterleavedBufferAttribute as db, Skeleton as Yw, Bone as Kw, Source as Zw, WebGLCubeRenderTarget as Jw, CubeCamera as ex, AnimationClip as no, FileLoader as cm, TextureLoader as Jl, PropertyBinding as ca, LinearSRGBColorSpace as Ss, ShaderChunk as Wt, UniformsLib as tx, DataTexture as hm, RGBAFormat as Ld, EquirectangularReflectionMapping as _s, SRGBColorSpace as Cs, Clock as ix, NeutralToneMapping as ha, AgXToneMapping as Dd, ACESFilmicToneMapping as jd, NoToneMapping as Gh, PCFSoftShadowMap$1 as nx, BasicNodeLibrary as sx, WebGLRenderTarget as Dn, DepthTexture as ub, NearestFilter as qh, LoopRepeat as ox, LoopOnce as np, AnimationMixer as dm, CompressedTexture as rx, FrontSide as co, Camera as ax, Frustum as Gg, AudioListener as lx, PositionalAudio as cx, AudioLoader as sp, EventDispatcher as um, BackSide as Bd, MeshDepthMaterial as hx, CustomBlending as dx, MaxEquation as ux, AmbientLight as fx, HemisphereLight as px, AlwaysStencilFunc as mx, GreaterEqualStencilFunc as gx, NotEqualStencilFunc as yx, GreaterStencilFunc as _x, LessEqualStencilFunc as bx, EqualStencilFunc as vx, LessStencilFunc as wx, NeverStencilFunc as qg, InvertStencilOp as xx, DecrementWrapStencilOp as Sx, IncrementWrapStencilOp as Cx, DecrementStencilOp as Px, IncrementStencilOp as Ox, ReplaceStencilOp as kx, ZeroStencilOp as Mx, KeepStencilOp as Rx, RawShaderMaterial as fb, GLSL3 as Tx, AlwaysDepth as Ex, GreaterEqualDepth as Ax, GreaterDepth as Ix, LessEqualDepth as Lx, LessDepth as Dx, NotEqualDepth as jx, EqualDepth as Bx, BatchedMesh as Xg, MeshPhysicalMaterial as op, LinearFilter as Xh, UnsignedByteType as Fx, RingGeometry as zx, Line3 as Ux, AdditiveBlending as pb, BoxHelper as Nx, SpotLight as $x, DirectionalLightHelper as Wx, CameraHelper as Vx, LOD as Hx, Triangle as Gx, NormalBlending as qx, ReinhardToneMapping as fm, LinearToneMapping as pm, HalfFloatType as Vu, VideoTexture as Xx, CubeUVReflectionMapping as mb, CubeTexture as Qx, CompressedCubeTexture as Yx, EquirectangularRefractionMapping as Kx, VectorKeyframeTrack as Zx, QuaternionKeyframeTrack as Jx, Audio as eS, ShaderLib as Qh, UniformsUtils as gb, MirroredRepeatWrapping as Qg, MeshNormalMaterial as tS, AudioContext as iS, PMREMGenerator$1 as nS } from "./three-BRSLmpyi.js";
2
2
  import { createLoaders as mm, getRaycastMesh as yb, LODsManager as Ao, NEEDLE_progressive as We, addDracoAndKTX2Loaders as sS, configureLoader as oS, setKTX2TranscoderLocation as rS, setDracoDecoderLocation as aS } from "./gltf-progressive-BcHT3Nyo.js";
3
3
  import { GroundedSkybox as da, Font as lS, TextGeometry as cS, FontLoader as hS, GLTFLoader as Ps, TransformControlsGizmo as _b, EXRLoader as gm, RGBELoader as bb, Stats as dS, nodeFrame as uS, OrbitControls as vb, PositionalAudioHelper as fS, HorizontalBlurShader as pS, VerticalBlurShader as mS, GLTFExporter as wb, strToU8 as xb, zipSync as gS, XRControllerModelFactory as yS, XRHandMeshModel as _S, Line2 as bS, LineGeometry as vS, LineMaterial as wS, TransformControls as xS, InteractiveGroup as SS, HTMLMesh as CS, VertexNormalsHelper as PS, OBJLoader as ym, FBXLoader as Sb, mergeVertices as OS } from "./three-examples-CNexix3E.js";
4
4
  import { fetchProfile as kS, MotionController as MS, $70d766613f57b014$export$2e2bcd8739ae039 as Yg, ByteBuffer as RS, v5 as Kg, md5 as Zg, SIZE_PREFIX_LENGTH as Cb, Builder as _m, createNoise4D as TS, Matrix4 as Hu, BatchedParticleRenderer as ES, ParticleSystem as AS, RenderMode as as, ConstantColor as IS, Vector4 as LS, ConstantValue as DS, TrailParticle as Jg, WorkerBase as jS, MeshBVH as BS } from "./vendor-Z4SPrTcP.js";
@@ -329,7 +329,7 @@ function bm(s, e) {
329
329
  s[jr] = new so(s, ["x", "y"]);
330
330
  else if (s instanceof b)
331
331
  s[jr] = new so(s, ["x", "y", "z"]);
332
- else if (s instanceof de || s instanceof $)
332
+ else if (s instanceof de || s instanceof N)
333
333
  s[jr] = new so(s, ["x", "y", "z", "w"]);
334
334
  else
335
335
  return !1;
@@ -340,12 +340,12 @@ function Rb(s, e) {
340
340
  const t = s[jr];
341
341
  t && t.unsubscribeWrite(e);
342
342
  }
343
- var X;
343
+ var q;
344
344
  ((s) => {
345
345
  let e;
346
346
  function t() {
347
347
  if (e !== void 0) return e;
348
- const W = window.navigator.userAgent, ne = /Windows|MacOS|Mac OS/.test(W), re = /Windows NT/.test(W) && /Edg/.test(W) && !/Win64/.test(W);
348
+ const V = window.navigator.userAgent, ne = /Windows|MacOS|Mac OS/.test(V), re = /Windows NT/.test(V) && /Edg/.test(V) && !/Win64/.test(V);
349
349
  return e = ne && !re && !y();
350
350
  }
351
351
  s.isDesktop = t;
@@ -379,8 +379,8 @@ var X;
379
379
  if (navigator.userAgentData)
380
380
  return f = navigator.userAgentData.platform === "macOS";
381
381
  {
382
- const W = navigator.userAgent.toLowerCase();
383
- return f = W.includes("mac os x") || W.includes("macintosh");
382
+ const V = navigator.userAgent.toLowerCase();
383
+ return f = V.includes("mac os x") || V.includes("macintosh");
384
384
  }
385
385
  }
386
386
  s.isMacOS = p;
@@ -406,69 +406,69 @@ var X;
406
406
  }
407
407
  s.isQuest = k;
408
408
  let E;
409
- function z() {
409
+ function B() {
410
410
  return E !== void 0 || (E = document.createElement("a").relList.supports("ar")), E;
411
411
  }
412
- s.supportsQuickLookAR = z;
413
- async function D() {
412
+ s.supportsQuickLookAR = B;
413
+ async function L() {
414
414
  try {
415
415
  return (await navigator.permissions.query({ name: "microphone" })).state !== "denied";
416
- } catch (W) {
417
- return console.error("Error querying `microphone` permissions.", W), !1;
416
+ } catch (V) {
417
+ return console.error("Error querying `microphone` permissions.", V), !1;
418
418
  }
419
419
  }
420
- s.microphonePermissionsGranted = D;
421
- let V;
422
- function q() {
423
- if (V !== void 0) return V;
424
- const W = navigator.userAgent.match(/iPhone OS (\d+_\d+)/);
425
- if (W && (V = W[1].replace("_", ".")), !V) {
420
+ s.microphonePermissionsGranted = L;
421
+ let W;
422
+ function X() {
423
+ if (W !== void 0) return W;
424
+ const V = navigator.userAgent.match(/iPhone OS (\d+_\d+)/);
425
+ if (V && (W = V[1].replace("_", ".")), !W) {
426
426
  const ne = navigator.userAgent.match(/(?:\(Macintosh;|iPhone;|iPad;).*Version\/(\d+\.\d+)/);
427
- ne && (V = ne[1]);
427
+ ne && (W = ne[1]);
428
428
  }
429
- return V || (V = null), V;
429
+ return W || (W = null), W;
430
430
  }
431
- s.getiOSVersion = q;
431
+ s.getiOSVersion = X;
432
432
  let A;
433
- function U() {
433
+ function $() {
434
434
  if (A !== void 0) return A;
435
- const W = navigator.userAgent.match(/(?:CriOS|Chrome)\/(\d+\.\d+\.\d+\.\d+)/);
436
- return W ? A = W[1].replace("_", ".") : A = null, A;
435
+ const V = navigator.userAgent.match(/(?:CriOS|Chrome)\/(\d+\.\d+\.\d+\.\d+)/);
436
+ return V ? A = V[1].replace("_", ".") : A = null, A;
437
437
  }
438
- s.getChromeVersion = U;
439
- })(X || (X = {}));
438
+ s.getChromeVersion = $;
439
+ })(q || (q = {}));
440
440
  function sI() {
441
- return X.isDesktop();
441
+ return q.isDesktop();
442
442
  }
443
443
  function oI() {
444
- return X.isMobileDevice();
444
+ return q.isMobileDevice();
445
445
  }
446
446
  function rI() {
447
- return X.isiPad();
447
+ return q.isiPad();
448
448
  }
449
449
  function aI() {
450
- return X.isiPad();
450
+ return q.isiPad();
451
451
  }
452
452
  function lI() {
453
- return X.isAndroidDevice();
453
+ return q.isAndroidDevice();
454
454
  }
455
455
  function cI() {
456
- return X.isMozillaXR();
456
+ return q.isMozillaXR();
457
457
  }
458
458
  function hI() {
459
- return X.isMacOS();
459
+ return q.isMacOS();
460
460
  }
461
461
  function dI() {
462
- return X.isiOS();
462
+ return q.isiOS();
463
463
  }
464
464
  function uI() {
465
- return X.isSafari();
465
+ return q.isSafari();
466
466
  }
467
467
  function fI() {
468
- return X.isQuest();
468
+ return q.isQuest();
469
469
  }
470
470
  async function pI() {
471
- return X.microphonePermissionsGranted();
471
+ return q.microphonePermissionsGranted();
472
472
  }
473
473
  const Zs = /* @__PURE__ */ new WeakMap();
474
474
  function iC(s, e, t) {
@@ -581,12 +581,12 @@ async function rC(s, e) {
581
581
  if (h) {
582
582
  const y = a.width / a.height;
583
583
  y > 1 ? _ = g / y : g = _ * y;
584
- const x = n * s.width, I = Math.max(g, _), O = Math.round(I + x), k = Math.round(I + x), E = (d.width - I) / 2, z = (d.height - I) / 2;
584
+ const x = n * s.width, I = Math.max(g, _), O = Math.round(I + x), k = Math.round(I + x), E = (d.width - I) / 2, B = (d.height - I) / 2;
585
585
  f.shadowColor = o, f.shadowBlur = i;
586
- const D = r, V = Math.round(E - x / 2), q = Math.round(z - x / 2);
587
- f.beginPath(), f.moveTo(V + D, q), f.lineTo(V + O - D, q), f.quadraticCurveTo(V + O, q, V + O, q + D), f.lineTo(V + O, q + k - D), f.quadraticCurveTo(V + O, q + k, V + O - D, q + k), f.lineTo(V + D, q + k), f.quadraticCurveTo(V, q + k, V, q + k - D), f.lineTo(V, q + D), f.quadraticCurveTo(V, q, V + D, q), f.fillStyle = "#ffffff", f.closePath(), f.fill(), f.clip(), f.shadowColor = "transparent";
588
- const A = (d.width - g) / 2, U = (d.height - _) / 2;
589
- f.drawImage(a, A, U, g, _);
586
+ const L = r, W = Math.round(E - x / 2), X = Math.round(B - x / 2);
587
+ f.beginPath(), f.moveTo(W + L, X), f.lineTo(W + O - L, X), f.quadraticCurveTo(W + O, X, W + O, X + L), f.lineTo(W + O, X + k - L), f.quadraticCurveTo(W + O, X + k, W + O - L, X + k), f.lineTo(W + L, X + k), f.quadraticCurveTo(W, X + k, W, X + k - L), f.lineTo(W, X + L), f.quadraticCurveTo(W, X, W + L, X), f.fillStyle = "#ffffff", f.closePath(), f.fill(), f.clip(), f.shadowColor = "transparent";
588
+ const A = (d.width - g) / 2, $ = (d.height - _) / 2;
589
+ f.drawImage(a, A, $, g, _);
590
590
  }
591
591
  const m = d.toDataURL("image/png"), v = document.createElement("img");
592
592
  return v.src = m, v.style.width = "100%", v.style.height = "auto", v;
@@ -957,13 +957,13 @@ function wC(s) {
957
957
  function cp(s, e) {
958
958
  s[lp] = e;
959
959
  }
960
- let Qn, xC = { x: 0, y: 0, width: 0, height: 0 };
960
+ let Qn;
961
+ const xC = { x: 0, y: 0, width: 0, height: 0 };
961
962
  function SC(s, e, t, i) {
962
963
  s instanceof Element && (s = s.getBoundingClientRect()), Qn = i.domElement.getBoundingClientRect();
963
964
  const n = xC;
964
965
  n.x = s.x, n.y = s.y, n.width = s.width, n.height = s.height, n.x -= Qn.x, n.y -= Qn.y;
965
- let o = n.width / -2 - (n.x - Qn.width / 2), r = n.height / -2 - (n.y - Qn.height / 2);
966
- const a = t.view;
966
+ const o = n.width / -2 - (n.x - Qn.width / 2), r = n.height / -2 - (n.y - Qn.height / 2), a = t.view;
967
967
  let l = a?.offsetX || 0, c = a?.offsetY || 0;
968
968
  l = j.lerp(l, o, e), c = j.lerp(c, r, e), t.setViewOffset(Qn.width, Qn.height, l, c, Qn.width, Qn.height), t.updateProjectionMatrix();
969
969
  }
@@ -971,7 +971,7 @@ function yI(s, e, t) {
971
971
  const i = s.length(), n = e.length(), o = j.lerp(i, n, t);
972
972
  return s.lerp(e, t).normalize().multiplyScalar(o);
973
973
  }
974
- const Ku = new $(), jb = new $().setFromAxisAngle(new b(0, 1, 0), Math.PI);
974
+ const Ku = new N(), jb = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
975
975
  function _I(s, e) {
976
976
  s.lookAt(e), s.quaternion.multiply(jb);
977
977
  }
@@ -1014,10 +1014,10 @@ function OC(s) {
1014
1014
  const e = PC.get();
1015
1015
  return s ? e.copy(s) : e.set(0, 0, 0), e;
1016
1016
  }
1017
- const kC = new $i(() => new $(), 100);
1017
+ const kC = new $i(() => new N(), 100);
1018
1018
  function bn(s) {
1019
1019
  const e = kC.get();
1020
- return e.identity(), s instanceof $ ? e.copy(s) : s instanceof DOMPointReadOnly && e.set(s.x, s.y, s.z, s.w), e;
1020
+ return e.identity(), s instanceof N ? e.copy(s) : s instanceof DOMPointReadOnly && e.set(s.x, s.y, s.z, s.w), e;
1021
1021
  }
1022
1022
  const wm = new $i(() => new b(), 100), hy = Symbol("lastMatrixWorldUpdateKey");
1023
1023
  function Z(s, e = null, t = !0) {
@@ -1033,7 +1033,7 @@ function ua(s, e, t, i) {
1033
1033
  const n = wm.get();
1034
1034
  return n.set(e, t, i), ut(s, n), s;
1035
1035
  }
1036
- const Zh = new $i(() => new $(), 100), Xo = new $(), Zu = new $();
1036
+ const Zh = new $i(() => new N(), 100), Xo = new N(), Zu = new N();
1037
1037
  function be(s, e = null) {
1038
1038
  if (!s) return Zh.get().identity();
1039
1039
  const t = e ?? Zh.get();
@@ -1063,11 +1063,11 @@ function tc(s, e) {
1063
1063
  const t = RC;
1064
1064
  s.parent.getWorldScale(t), s.scale.copy(e), s.scale.divide(t);
1065
1065
  }
1066
- const TC = new b(), dy = new $();
1066
+ const TC = new b(), dy = new N();
1067
1067
  function vI(s) {
1068
1068
  return be(s, dy), TC.set(0, 0, 1).applyQuaternion(dy);
1069
1069
  }
1070
- const EC = new $i(() => new b(), 100), uy = new $();
1070
+ const EC = new $i(() => new b(), 100), uy = new N();
1071
1071
  function AC(s, e) {
1072
1072
  return e || (e = EC.get().set(0, 0, 1)), be(s, uy), e.applyQuaternion(uy);
1073
1073
  }
@@ -1330,7 +1330,7 @@ function Nb(s, e, t, i) {
1330
1330
  }
1331
1331
  let Gc = !1;
1332
1332
  lC((...s) => {
1333
- L() && he.Current?.isInXR && (Yr(!0), $b("error", ...s));
1333
+ D() && he.Current?.isInXR && (Yr(!0), $b("error", ...s));
1334
1334
  });
1335
1335
  function Yr(s) {
1336
1336
  if (s) {
@@ -1545,7 +1545,7 @@ function $b(s, ...e) {
1545
1545
  if (o instanceof J) return `(${i(o.x)}, ${i(o.y)})`;
1546
1546
  if (o instanceof b) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)})`;
1547
1547
  if (o instanceof de) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)}, ${i(o.w)})`;
1548
- if (o instanceof $) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)}, ${i(o.w)})`;
1548
+ if (o instanceof N) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)}, ${i(o.w)})`;
1549
1549
  if (o instanceof _e || o instanceof Te) return o.name;
1550
1550
  if (o instanceof rb) return `[${o.elements.join(", ")}]`;
1551
1551
  if (o instanceof te) return `[${o.elements.join(", ")}]`;
@@ -1589,7 +1589,7 @@ function Wd(s) {
1589
1589
  Be(s, Ui.Error);
1590
1590
  }
1591
1591
  let dp, Ju;
1592
- function L() {
1592
+ function D() {
1593
1593
  if (HC) return !1;
1594
1594
  if (dp !== void 0) return dp;
1595
1595
  if (Ju !== void 0) return Ju;
@@ -1765,9 +1765,9 @@ fo('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUIL
1765
1765
  fo('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
1766
1766
  fo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.8.8";');
1767
1767
  fo('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
1768
- fo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Fri Aug 29 2025 16:58:42 GMT+0000 (Coordinated Universal Time)";');
1768
+ fo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Sep 01 2025 10:35:17 GMT+0000 (Coordinated Universal Time)";');
1769
1769
  fo('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
1770
- const En = "4.8.8", Sm = "undefined", Gb = "Fri Aug 29 2025 16:58:42 GMT+0000 (Coordinated Universal Time)";
1770
+ const En = "4.8.8", Sm = "undefined", Gb = "Mon Sep 01 2025 10:35:17 GMT+0000 (Coordinated Universal Time)";
1771
1771
  Hb && console.log(`Engine version: ${En} (generator: ${Sm})
1772
1772
  Project built at ${Gb}`);
1773
1773
  const bl = NEEDLE_PUBLIC_KEY, oo = "needle_isActiveInHierarchy", Br = "builtin_components", Mh = "needle_editor_guid";
@@ -2428,7 +2428,7 @@ class a1 {
2428
2428
  this._mouseWheelDeltaY[e] = 0;
2429
2429
  };
2430
2430
  canReceiveInput(e) {
2431
- return e.target === this.context.renderer?.domElement || e.target === this.context.domElement || this.context.isInAR || this.context.isInAR && e.target === document.body && X.isMozillaXR() ? !0 : (tt && console.warn("CanReceiveInput:False for", e.target), !1);
2431
+ return e.target === this.context.renderer?.domElement || e.target === this.context.domElement || this.context.isInAR || this.context.isInAR && e.target === document.body && q.isMozillaXR() ? !0 : (tt && console.warn("CanReceiveInput:False for", e.target), !1);
2432
2432
  }
2433
2433
  onContextMenu = (e) => {
2434
2434
  this.canReceiveInput(e) !== !1 && e instanceof PointerEvent && e.pointerType;
@@ -2640,15 +2640,15 @@ class a1 {
2640
2640
  return t[e] = i, i;
2641
2641
  }
2642
2642
  onDispatchEvent(e) {
2643
- const t = N.Current;
2643
+ const t = U.Current;
2644
2644
  try {
2645
- N.Current = this.context, this.dispatchEvent(e);
2645
+ U.Current = this.context, this.dispatchEvent(e);
2646
2646
  } finally {
2647
- N.Current = t;
2647
+ U.Current = t;
2648
2648
  }
2649
2649
  }
2650
2650
  }
2651
- const Kr = new te().makeRotationY(Math.PI), ji = new $().setFromAxisAngle(new b(0, 1, 0), Math.PI), l1 = w("debugwebxr");
2651
+ const Kr = new te().makeRotationY(Math.PI), ji = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI), l1 = w("debugwebxr");
2652
2652
  class c1 {
2653
2653
  priority = -1e5;
2654
2654
  gameObject;
@@ -2665,7 +2665,7 @@ class c1 {
2665
2665
  }
2666
2666
  }
2667
2667
  }
2668
- const Yn = w("debugwebxr"), Xc = w("debugcustomgesture"), h1 = "https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles", d1 = "generic-trigger", u1 = new $().setFromEuler(new Rt(gs.degToRad(0), gs.degToRad(-90), gs.degToRad(-90))), f1 = new b(0.04, -0.04, 0);
2668
+ const Yn = w("debugwebxr"), Xc = w("debugcustomgesture"), h1 = "https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles", d1 = "generic-trigger", u1 = new N().setFromEuler(new Rt(gs.degToRad(0), gs.degToRad(-90), gs.degToRad(-90))), f1 = new b(0.04, -0.04, 0);
2669
2669
  class Zb {
2670
2670
  /** the Needle XR Session */
2671
2671
  xr;
@@ -2797,16 +2797,16 @@ class Zb {
2797
2797
  /** Grip position in grip space */
2798
2798
  _gripPosition = new b();
2799
2799
  /** Grip rotation in grip space */
2800
- _gripQuaternion = new $();
2800
+ _gripQuaternion = new N();
2801
2801
  _linearVelocity = new b();
2802
2802
  _rayPositionRaw = new b();
2803
- _rayRotationRaw = new $();
2803
+ _rayRotationRaw = new N();
2804
2804
  /** ray matrix in grip space */
2805
2805
  _rayMatrix = new te();
2806
2806
  /** Ray position in rig space */
2807
2807
  _rayPosition = new b();
2808
2808
  /** Ray rotation in rig space */
2809
- _rayQuaternion = new $();
2809
+ _rayQuaternion = new N();
2810
2810
  /** Grip position in rig space */
2811
2811
  get gripPosition() {
2812
2812
  return G(this._gripPosition);
@@ -2841,7 +2841,7 @@ class Zb {
2841
2841
  get gripWorldQuaternion() {
2842
2842
  return bn(this._gripWorldQuaternion);
2843
2843
  }
2844
- _gripWorldQuaternion = new $();
2844
+ _gripWorldQuaternion = new N();
2845
2845
  /** Controller ray position in worldspace (this value is calculated once per frame by default - call `updateRayWorldPosition` to force an update) */
2846
2846
  get rayWorldPosition() {
2847
2847
  return G(this._rayWorldPosition);
@@ -2856,7 +2856,7 @@ class Zb {
2856
2856
  get rayWorldQuaternion() {
2857
2857
  return bn(this._rayWorldQuaternion);
2858
2858
  }
2859
- _rayWorldQuaternion = new $();
2859
+ _rayWorldQuaternion = new N();
2860
2860
  get pinchPosition() {
2861
2861
  return G(this._pinchPosition);
2862
2862
  }
@@ -2943,7 +2943,7 @@ class Zb {
2943
2943
  this.onUpdateFrame(e), this.updateInputEvents(), this.onUpdateMove();
2944
2944
  }
2945
2945
  onRenderDebug() {
2946
- F.DrawSphere(this.rayWorldPosition, 3e-3), F.DrawDirection(this.rayWorldPosition, G(0, 0, 10).applyQuaternion(this.rayWorldQuaternion));
2946
+ z.DrawSphere(this.rayWorldPosition, 3e-3), z.DrawDirection(this.rayWorldPosition, G(0, 0, 10).applyQuaternion(this.rayWorldQuaternion));
2947
2947
  const t = (this.inputSource.gripSpace ? this.gripWorldPosition : this.object.worldPosition).sub(this.object.worldForward.multiplyScalar(0.1)), i = this.inputSource.profiles.join(`
2948
2948
  `);
2949
2949
  let n = `Controller[${this.index}] (${this.inputSource.targetRayMode}, ${this.side})
@@ -2958,7 +2958,7 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
2958
2958
  [axes ` + o.axes.length + "]: " + o.axes.map((a) => a.toPrecision(1)).join(","), n += `
2959
2959
  ` + r;
2960
2960
  }
2961
- F.DrawLabel(t, n, 6e-3);
2961
+ z.DrawLabel(t, n, 6e-3);
2962
2962
  }
2963
2963
  onUpdateFrame(e) {
2964
2964
  if (this._handJointPoses.clear(), this._hand_wristDotUp = void 0, !this.xr.referenceSpace) {
@@ -3156,13 +3156,13 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
3156
3156
  if (!this.emitPointerDownEvent || this.inputSource !== e.inputSource) return;
3157
3157
  this.onUpdateFrame(e.frame), this._hasSelectEvent = !0;
3158
3158
  const t = this._layout?.selectComponentId, i = this._layout?.components[t]?.gamepadIndices?.button;
3159
- i !== void 0 && (this._selectButtonIndex = i), !Xc && (Yn && F.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this.emitPointerEvent(De.PointerDown, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
3159
+ i !== void 0 && (this._selectButtonIndex = i), !Xc && (Yn && z.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this.emitPointerEvent(De.PointerDown, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
3160
3160
  };
3161
3161
  onSelectEnd = (e) => {
3162
3162
  this.emitPointerUpEvent && (Xc || this.inputSource === e.inputSource && this.emitPointerEvent(De.PointerUp, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
3163
3163
  };
3164
3164
  onSequeezeStart = (e) => {
3165
- this.emitPointerDownEvent && this.inputSource === e.inputSource && (this._squeezeButtonIndex = this._layout?.components["xr-standard-squeeze"]?.gamepadIndices?.button, this._squeezeButtonIndex !== void 0 && (Yn && F.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 255, 10), this.emitPointerEvent(De.PointerDown, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e)));
3165
+ this.emitPointerDownEvent && this.inputSource === e.inputSource && (this._squeezeButtonIndex = this._layout?.components["xr-standard-squeeze"]?.gamepadIndices?.button, this._squeezeButtonIndex !== void 0 && (Yn && z.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 255, 10), this.emitPointerEvent(De.PointerDown, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e)));
3166
3166
  };
3167
3167
  onSequeezeEnd = (e) => {
3168
3168
  this.emitPointerUpEvent && this.inputSource === e.inputSource && this._squeezeButtonIndex !== void 0 && this.emitPointerEvent(De.PointerUp, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e);
@@ -3213,12 +3213,12 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
3213
3213
  }
3214
3214
  _didMoveLastFrame = !1;
3215
3215
  _lastPointerMovePosition = new b();
3216
- _lastPointerMoveQuaternion = new $();
3216
+ _lastPointerMoveQuaternion = new N();
3217
3217
  onUpdateMove() {
3218
3218
  if (!this.emitPointerMoveEvent) return;
3219
3219
  let e = !1;
3220
3220
  if (this._lastPointerMovePosition.distanceTo(this.gripWorldPosition) > this.pointerMoveDistanceThreshold * this.xr.rigScale && (e = !0), e || this._lastPointerMoveQuaternion.angleTo(this.gripWorldQuaternion) > this.pointerMoveAngleThreshold && (e = !0), e) {
3221
- this._didMoveLastFrame = !0, this._lastPointerMovePosition.copy(this.gripWorldPosition), this._lastPointerMoveQuaternion.copy(this.gripWorldQuaternion), Yn && F.DrawLabel(this.rayWorldPosition.add(this.object.worldForward.multiplyScalar(0.1)), "move", 0.01);
3221
+ this._didMoveLastFrame = !0, this._lastPointerMovePosition.copy(this.gripWorldPosition), this._lastPointerMoveQuaternion.copy(this.gripWorldQuaternion), Yn && z.DrawLabel(this.rayWorldPosition.add(this.object.worldForward.multiplyScalar(0.1)), "move", 0.01);
3222
3222
  let i = this.xr.context.input.getFirstPressedButtonForPointer(this.index);
3223
3223
  i === void 0 && (i = 0);
3224
3224
  const n = this.gamepad?.buttons[i]?.value;
@@ -3235,8 +3235,8 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
3235
3235
  }
3236
3236
  if (this.xr.mode === "immersive-vr" || this.xr.isPassThrough) {
3237
3237
  this.pointerInit.origin = this, this.pointerInit.pointerId = this.getPointerId(t), this.pointerInit.pointerType = this.hand ? "hand" : "controller", this.pointerInit.button = t, this.pointerInit.buttonName = i, this.pointerInit.isPrimary = n, this.pointerInit.mode = this.inputSource.targetRayMode, this.pointerInit.ray = this.ray, this.pointerInit.device = this.object, this.pointerInit.pressure = r, this.pointerInit.clientX = this._rayPosition.x / this.xr.rigScale, this.pointerInit.clientY = this._rayPosition.y / this.xr.rigScale, this.pointerInit.clientZ = this._rayPosition.z / this.xr.rigScale;
3238
- const a = N.Current;
3239
- N.Current = this.xr.context, Yn && e !== "pointermove" && console.warn("Pointer event", e, t, i, { ...this.pointerInit }), this.xr.context.input.createInputEvent(new Ws(e, o, this.pointerInit)), N.Current = a;
3238
+ const a = U.Current;
3239
+ U.Current = this.xr.context, Yn && e !== "pointermove" && console.warn("Pointer event", e, t, i, { ...this.pointerInit }), this.xr.context.input.createInputEvent(new Ws(e, o, this.pointerInit)), U.Current = a;
3240
3240
  }
3241
3241
  }
3242
3242
  }
@@ -3268,7 +3268,7 @@ let ed = !1;
3268
3268
  const Vr = [];
3269
3269
  function pr() {
3270
3270
  if (ed) return;
3271
- L() && console.debug("User interaction registered: audio can now be played"), ed = !0;
3271
+ D() && console.debug("User interaction registered: audio can now be played"), ed = !0;
3272
3272
  const s = [...Vr];
3273
3273
  Vr.length = 0, s.forEach((e) => e());
3274
3274
  }
@@ -3866,7 +3866,7 @@ class x1 {
3866
3866
  console.debug(`⊡ Connecting to networking backend on
3867
3867
  ` + Mi);
3868
3868
  const o = await import("./vendor-Z4SPrTcP.js").then((c) => c.index), r = o.default?.WebsocketBuilder ?? o.WebsocketBuilder, a = o.default?.ExponentialBackoff ?? o.ExponentialBackoff, l = new r(Mi).withMaxRetries(10).withBackoff(new a(2e3, 4)).onOpen(() => {
3869
- this._connectingToWebsocketPromise = null, this._ws = l, this.connected = !0, L() || oi ? console.log(`⊞ Connected to networking backend
3869
+ this._connectingToWebsocketPromise = null, this._ws = l, this.connected = !0, D() || oi ? console.log(`⊞ Connected to networking backend
3870
3870
  ` + Mi) : console.debug("⊞ Connected to networking backend", Mi), n(!0), this.onSendQueued(vn.OnConnection);
3871
3871
  }).onClose((c) => {
3872
3872
  this._connectingToWebsocketPromise = null, this.connected = !1, this._isInRoom = !1, n(!1);
@@ -3896,7 +3896,7 @@ class x1 {
3896
3896
  else this.handleIncomingStringMessage(n);
3897
3897
  return;
3898
3898
  } catch (n) {
3899
- oi && i === "pong" ? console.log("<<", i) : L() && console.error("Failed to parse message", n);
3899
+ oi && i === "pong" ? console.log("<<", i) : D() && console.error("Failed to parse message", n);
3900
3900
  }
3901
3901
  }
3902
3902
  async handleIncomingBinaryMessage(e) {
@@ -3926,7 +3926,7 @@ class x1 {
3926
3926
  if (oi && console.log(e), e) {
3927
3927
  this._isInRoom = !0;
3928
3928
  const r = e;
3929
- this._currentRoomName = r.room, this._currentRoomViewId = r.viewId, this._currentRoomAllowEditing = r.allowEditing ?? !0, this._currentInRoom.length = 0, this._currentInRoom.push(...r.inRoom), (Kc || L()) && console.debug("Joined Needle Engine Room: " + r.room);
3929
+ this._currentRoomName = r.room, this._currentRoomViewId = r.viewId, this._currentRoomAllowEditing = r.allowEditing ?? !0, this._currentInRoom.length = 0, this._currentInRoom.push(...r.inRoom), (Kc || D()) && console.debug("Joined Needle Engine Room: " + r.room);
3930
3930
  const a = new URL(window.location.href);
3931
3931
  a.searchParams.has("room") && a.searchParams.delete("room"), a.searchParams.set("view", this._currentRoomViewId), console.debug(`Room view id: ${this._currentRoomViewId}
3932
3932
  ${a.href}`);
@@ -3935,7 +3935,7 @@ ${a.href}`);
3935
3935
  break;
3936
3936
  case "left-room":
3937
3937
  const n = e;
3938
- n.room === this.currentRoomName && (this._isInRoom = !1, this._currentRoomName = null, this._currentRoomAllowEditing = !0, this._currentInRoom.length = 0, (Kc || L()) && console.debug("Left Needle Engine Room: " + n.room));
3938
+ n.room === this.currentRoomName && (this._isInRoom = !1, this._currentRoomName = null, this._currentRoomAllowEditing = !0, this._currentInRoom.length = 0, (Kc || D()) && console.debug("Left Needle Engine Room: " + n.room));
3939
3939
  break;
3940
3940
  case "user-joined-room":
3941
3941
  if (e.data) {
@@ -4480,7 +4480,7 @@ async function M1() {
4480
4480
  const s = sessionStorage.getItem("needle_xr_session_mode"), e = sessionStorage.getItem("needle_xr_session_init") ?? null, t = e ? JSON.parse(e) : null;
4481
4481
  let i = null;
4482
4482
  if (n0() && (await ga.start(s || "immersive-vr", t || K.getDefaultSessionInit("immersive-vr")), await E1(), i = await ga.handoff()), i)
4483
- K.setSession(i.mode, i.session, i.init, N.Current);
4483
+ K.setSession(i.mode, i.session, i.init, U.Current);
4484
4484
  else if (s && e) {
4485
4485
  console.log("Session Granted: Restore last session");
4486
4486
  const n = JSON.parse(e);
@@ -4515,7 +4515,7 @@ function E1() {
4515
4515
  }, 100);
4516
4516
  });
4517
4517
  }
4518
- X.isDesktop() && L() && window.addEventListener("keydown", (s) => {
4518
+ q.isDesktop() && D() && window.addEventListener("keydown", (s) => {
4519
4519
  (s.key === "x" || s.key === "Escape") && K.active && K.stop();
4520
4520
  });
4521
4521
  function A1(s) {
@@ -4662,12 +4662,12 @@ class K {
4662
4662
  switch (e) {
4663
4663
  case "immersive-ar":
4664
4664
  const t = ["anchors", "local-floor", "layers", "dom-overlay", "hit-test", "unbounded"];
4665
- return X.isVisionOS() || t.push("hand-tracking"), {
4665
+ return q.isVisionOS() || t.push("hand-tracking"), {
4666
4666
  optionalFeatures: t
4667
4667
  };
4668
4668
  case "immersive-vr":
4669
4669
  const i = ["local-floor", "bounded-floor", "high-fixed-foveation-level", "layers"];
4670
- return X.isVisionOS() || i.push("hand-tracking"), {
4670
+ return q.isVisionOS() || i.push("hand-tracking"), {
4671
4671
  optionalFeatures: i
4672
4672
  };
4673
4673
  default:
@@ -4681,20 +4681,20 @@ class K {
4681
4681
  * @param context The Needle Engine context to use
4682
4682
  */
4683
4683
  static async start(e, t, i) {
4684
- if (X.isiOS()) {
4684
+ if (q.isiOS()) {
4685
4685
  if (e === "ar")
4686
4686
  if (await this.isARSupported())
4687
4687
  e = "immersive-ar";
4688
4688
  else
4689
4689
  return ic.exportAndOpen(), null;
4690
4690
  } else e == "ar" && (e = "immersive-ar");
4691
- if (L() && w("debugxrpreroom"))
4691
+ if (D() && w("debugxrpreroom"))
4692
4692
  return console.warn("Debug: Starting temporary XR session"), await ga.start(e, t || K.getDefaultSessionInit(e)), null;
4693
4693
  if (this._currentSessionRequest)
4694
- return console.warn("A XRSession is already being requested"), (He || L()) && ge("A XRSession is already being requested"), this._currentSessionRequest.then(() => this._activeSession);
4694
+ return console.warn("A XRSession is already being requested"), (He || D()) && ge("A XRSession is already being requested"), this._currentSessionRequest.then(() => this._activeSession);
4695
4695
  if (this._activeSession)
4696
4696
  return console.error("A XRSession is already running"), this._activeSession;
4697
- if (i || (i = N.Current), i || (i = he.All[0]), !i) throw new Error("No Needle Engine Context found");
4697
+ if (i || (i = U.Current), i || (i = he.All[0]), !i) throw new Error("No Needle Engine Context found");
4698
4698
  switch (t || (t = {}), e) {
4699
4699
  // Setup VR initialization parameters
4700
4700
  case "immersive-ar":
@@ -4702,7 +4702,7 @@ class K {
4702
4702
  if (await this.xrSystem?.isSessionSupported("immersive-ar") !== !0)
4703
4703
  return console.error(e + " is not supported by this browser."), null;
4704
4704
  const l = this.getDefaultSessionInit(e), c = k1(i.domElement);
4705
- c && !X.isQuest() && (l.domOverlay = { root: c }, l.optionalFeatures.push("dom-overlay")), t = {
4705
+ c && !q.isQuest() && (l.domOverlay = { root: c }, l.optionalFeatures.push("dom-overlay")), t = {
4706
4706
  ...l,
4707
4707
  ...t
4708
4708
  };
@@ -4831,7 +4831,7 @@ class K {
4831
4831
  }
4832
4832
  /** Returns true if running in pass through mode in immersive AR (e.g. user is wearing a headset while in AR) */
4833
4833
  get isPassThrough() {
4834
- return !!(this.environmentBlendMode !== "opaque" && this.interactionMode === "world-space" || this.mode === "immersive-ar" && this.environmentBlendMode !== "opaque" && this.controllers.some((e) => e.inputSource.targetRayMode === "tracked-pointer") || L() && X.isDesktop() && this.mode === "immersive-ar");
4834
+ return !!(this.environmentBlendMode !== "opaque" && this.interactionMode === "world-space" || this.mode === "immersive-ar" && this.environmentBlendMode !== "opaque" && this.controllers.some((e) => e.inputSource.targetRayMode === "tracked-pointer") || D() && q.isDesktop() && this.mode === "immersive-ar");
4835
4835
  }
4836
4836
  get isAR() {
4837
4837
  return this.mode === "immersive-ar";
@@ -4995,7 +4995,7 @@ class K {
4995
4995
  */
4996
4996
  _mainCamera = null;
4997
4997
  constructor(e, t, i, n) {
4998
- R1(e, n.init), this.session = t, this.mode = e, this.context = i, (He || w("console")) && Yr(!0), this._xr_scripts = [...n.scripts], this._xr_update_scripts = this._xr_scripts.filter((o) => typeof o.onUpdateXR == "function"), this._controllerAdded = n.controller_added, this._controllerRemoved = n.controller_removed, ks(this.onBefore, xe.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), (n.init.optionalFeatures?.includes("hit-test") || n.init.requiredFeatures?.includes("hit-test")) && t.requestReferenceSpace("viewer").then((o) => t.requestHitTestSource?.call(t, { space: o })?.then((r) => this._viewerHitTestSource = r).catch((r) => console.error(r))).catch((o) => console.error(o)), this.context.mainCamera && (this._originalCameraWorldPosition = Z(this.context.mainCamera, new b()), this._originalCameraWorldRotation = be(this.context.mainCamera, new $()), this._originalCameraWorldScale = $e(this.context.mainCamera, new b()), this._originalCameraParent = this.context.mainCamera.parent), this._defaultRig = new c1(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
4998
+ R1(e, n.init), this.session = t, this.mode = e, this.context = i, (He || w("console")) && Yr(!0), this._xr_scripts = [...n.scripts], this._xr_update_scripts = this._xr_scripts.filter((o) => typeof o.onUpdateXR == "function"), this._controllerAdded = n.controller_added, this._controllerRemoved = n.controller_removed, ks(this.onBefore, xe.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), (n.init.optionalFeatures?.includes("hit-test") || n.init.requiredFeatures?.includes("hit-test")) && t.requestReferenceSpace("viewer").then((o) => t.requestHitTestSource?.call(t, { space: o })?.then((r) => this._viewerHitTestSource = r).catch((r) => console.error(r))).catch((o) => console.error(o)), this.context.mainCamera && (this._originalCameraWorldPosition = Z(this.context.mainCamera, new b()), this._originalCameraWorldRotation = be(this.context.mainCamera, new N()), this._originalCameraWorldScale = $e(this.context.mainCamera, new b()), this._originalCameraParent = this.context.mainCamera.parent), this._defaultRig = new c1(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
4999
4999
  for (let o = 0; o < t.inputSources.length; o++) {
5000
5000
  const r = t.inputSources[o];
5001
5001
  if (!r.handedness) {
@@ -5202,14 +5202,14 @@ class K {
5202
5202
  for (const o of this.controllers)
5203
5203
  n += `
5204
5204
  ${o.hand ? "hand" : "ctrl"} ${o.inputSource.handedness}[${o.index}] con:${o.connected} tr:${o.isTracking} hts:${o.hasHitTestSource ? "yes" : "no"}`;
5205
- of = 0, F.DrawLabel(e, n, void 0, 1 / 60 * 20);
5205
+ of = 0, z.DrawLabel(e, n, void 0, 1 / 60 * 20);
5206
5206
  }
5207
5207
  }
5208
5208
  onBeforeRender = () => {
5209
5209
  this.context.mainCamera && this.updateFade(this.context.mainCamera);
5210
5210
  };
5211
5211
  onAfterRender = () => {
5212
- if (this.onUpdateFade_PostRender(), X.isDesktop() || !this._renderOnceOnDevice) {
5212
+ if (this.onUpdateFade_PostRender(), q.isDesktop() || !this._renderOnceOnDevice) {
5213
5213
  const e = this.context.renderer;
5214
5214
  if (e.xr.isPresenting && this.context.mainCamera) {
5215
5215
  this._renderOnceOnDevice = !0;
@@ -5311,7 +5311,7 @@ ${o.hand ? "hand" : "ctrl"} ${o.inputSource.handedness}[${o.index}] con:${o.conn
5311
5311
  this._camera && this._previousCameraParent && this._previousCameraParent.add(this._camera), this._previousCameraParent = null, this._camera instanceof pe && this.originalCameraNearPlane != null && (this._camera.near = this.originalCameraNearPlane);
5312
5312
  }
5313
5313
  _viewerPose;
5314
- _transformOrientation = new $();
5314
+ _transformOrientation = new N();
5315
5315
  _transformPosition = new b();
5316
5316
  internalUpdateState() {
5317
5317
  const e = this.context.renderer.xr.getReferenceSpace();
@@ -5359,8 +5359,8 @@ class I1 {
5359
5359
  }
5360
5360
  }
5361
5361
  }
5362
- const Ot = new b(), Ey = new b(), Ay = new $(), L1 = w("debuggizmos"), Zi = 8947848, af = 32;
5363
- class F {
5362
+ const Ot = new b(), Ey = new b(), Ay = new N(), L1 = w("debuggizmos"), Zi = 8947848, af = 32;
5363
+ class z {
5364
5364
  constructor() {
5365
5365
  }
5366
5366
  /**
@@ -5391,7 +5391,7 @@ class F {
5391
5391
  * @returns a handle to the label that can be used to update the text
5392
5392
  */
5393
5393
  static DrawLabel(e, t, i = 0.05, n = 0, o, r, a) {
5394
- if (!F.enabled) return null;
5394
+ if (!z.enabled) return null;
5395
5395
  o || (o = Zi);
5396
5396
  const l = K.active?.rigScale ?? 1, c = Ri.getTextLabel(n, t, i * l, o, r);
5397
5397
  return a instanceof M && a.add(c), c.position.x = e.x, c.position.y = e.y, c.position.z = e.z, c;
@@ -5405,7 +5405,7 @@ class F {
5405
5405
  * @param depthTest if true the ray will be rendered with depth test
5406
5406
  */
5407
5407
  static DrawRay(e, t, i = Zi, n = 0, o = !0) {
5408
- if (!F.enabled) return;
5408
+ if (!z.enabled) return;
5409
5409
  const r = Ri.getLine(n), a = r.geometry.getAttribute("position");
5410
5410
  a.setXYZ(0, e.x, e.y, e.z), Ot.set(t.x, t.y, t.z).multiplyScalar(999999999), a.setXYZ(1, e.x + Ot.x, e.y + Ot.y, e.z + Ot.z), a.needsUpdate = !0, r.material.color.set(i), r.material.depthTest = o, r.material.depthWrite = !1;
5411
5411
  }
@@ -5419,7 +5419,7 @@ class F {
5419
5419
  * @param lengthFactor the length of the line. Default is 1
5420
5420
  */
5421
5421
  static DrawDirection(e, t, i = Zi, n = 0, o = !0, r = 1) {
5422
- if (!F.enabled) return;
5422
+ if (!z.enabled) return;
5423
5423
  const a = Ri.getLine(n), l = a.geometry.getAttribute("position");
5424
5424
  l.setXYZ(0, e.x, e.y, e.z), t.w !== void 0 ? (Ot.set(0, 0, -r), Ay.set(t.x, t.y, t.z, t.w), Ot.applyQuaternion(Ay)) : (Ot.set(t.x, t.y, t.z), Ot.multiplyScalar(r)), l.setXYZ(1, e.x + Ot.x, e.y + Ot.y, e.z + Ot.z), l.needsUpdate = !0, a.material.color.set(i), a.material.depthTest = o, a.material.depthWrite = !1;
5425
5425
  }
@@ -5432,7 +5432,7 @@ class F {
5432
5432
  * @param depthTest if true the line will be rendered with depth test
5433
5433
  */
5434
5434
  static DrawLine(e, t, i = Zi, n = 0, o = !0) {
5435
- if (!F.enabled) return;
5435
+ if (!z.enabled) return;
5436
5436
  const r = Ri.getLine(n), a = r.geometry.getAttribute("position");
5437
5437
  a.setXYZ(0, e.x, e.y, e.z), a.setXYZ(1, t.x, t.y, t.z), a.needsUpdate = !0, r.material.color.set(i), r.material.depthTest = o, r.material.depthWrite = !1, r.material.fog = !1;
5438
5438
  }
@@ -5446,7 +5446,7 @@ class F {
5446
5446
  * @param depthTest if true the circle will be rendered with depth test
5447
5447
  */
5448
5448
  static DrawCircle(e, t, i, n = Zi, o = 0, r = !0) {
5449
- if (!F.enabled) return;
5449
+ if (!z.enabled) return;
5450
5450
  const a = Ri.getCircle(o);
5451
5451
  a.position.set(e.x, e.y, e.z), a.scale.set(i, i, i), a.quaternion.setFromUnitVectors(this._up, Ot.set(t.x, t.y, t.z).normalize()), a.material.color.set(n), a.material.depthTest = r, a.material.depthWrite = !1, a.material.fog = !1;
5452
5452
  }
@@ -5459,7 +5459,7 @@ class F {
5459
5459
  * @param depthTest if true the sphere will be rendered with depth test
5460
5460
  */
5461
5461
  static DrawWireSphere(e, t, i = Zi, n = 0, o = !0) {
5462
- if (!F.enabled) return;
5462
+ if (!z.enabled) return;
5463
5463
  const r = Ri.getSphere(t, n, !0);
5464
5464
  ua(r, e.x, e.y, e.z), r.material.color.set(i), r.material.depthTest = o, r.material.depthWrite = !1, r.material.fog = !1;
5465
5465
  }
@@ -5472,7 +5472,7 @@ class F {
5472
5472
  * @param depthTest if true the sphere will be rendered with depth test
5473
5473
  */
5474
5474
  static DrawSphere(e, t, i = Zi, n = 0, o = !0) {
5475
- if (!F.enabled) return;
5475
+ if (!z.enabled) return;
5476
5476
  const r = Ri.getSphere(t, n, !1);
5477
5477
  ua(r, e.x, e.y, e.z), r.material.color.set(i), r.material.depthTest = o, r.material.depthWrite = !1;
5478
5478
  }
@@ -5486,7 +5486,7 @@ class F {
5486
5486
  * @param depthTest if true the box will be rendered with depth test
5487
5487
  */
5488
5488
  static DrawWireBox(e, t, i = Zi, n = 0, o = !0, r = void 0) {
5489
- if (!F.enabled) return;
5489
+ if (!z.enabled) return;
5490
5490
  const a = Ri.getBox(n);
5491
5491
  a.position.set(e.x, e.y, e.z), a.scale.set(t.x, t.y, t.z), r ? a.quaternion.copy(r) : a.quaternion.identity(), a.material.color.set(i), a.material.depthTest = o, a.material.wireframe = !0, a.material.depthWrite = !1, a.material.fog = !1;
5492
5492
  }
@@ -5498,7 +5498,7 @@ class F {
5498
5498
  * @param depthTest if true the box will be rendered with depth test
5499
5499
  */
5500
5500
  static DrawWireBox3(e, t = Zi, i = 0, n = !0) {
5501
- if (!F.enabled) return;
5501
+ if (!z.enabled) return;
5502
5502
  const o = Ri.getBox(i);
5503
5503
  o.position.copy(e.getCenter(Ot)), o.scale.copy(e.getSize(Ot)), o.material.color.set(t), o.material.depthTest = n, o.material.wireframe = !0, o.material.depthWrite = !1, o.material.fog = !1;
5504
5504
  }
@@ -5513,7 +5513,7 @@ class F {
5513
5513
  * @param wireframe if true the arrow will be rendered as wireframe
5514
5514
  */
5515
5515
  static DrawArrow(e, t, i = Zi, n = 0, o = !0, r = !1) {
5516
- if (!F.enabled) return;
5516
+ if (!z.enabled) return;
5517
5517
  const a = Ri.getArrowHead(n);
5518
5518
  a.position.set(t.x, t.y, t.z), a.quaternion.setFromUnitVectors(this._up.set(0, 1, 0), Ot.set(t.x, t.y, t.z).sub(Ey.set(e.x, e.y, e.z)).normalize());
5519
5519
  const c = Ot.set(t.x, t.y, t.z).sub(Ey.set(e.x, e.y, e.z)).length() * 0.1;
@@ -5582,7 +5582,7 @@ class Ri {
5582
5582
  this.set({ textContent: d }), c.tmuiNeedsUpdate = !0;
5583
5583
  };
5584
5584
  }
5585
- return this.tmuiNeedsUpdate = !0, this.registerTimedObject(N.Current, r, e, this.textLabelCache), r;
5585
+ return this.tmuiNeedsUpdate = !0, this.registerTimedObject(U.Current, r, e, this.textLabelCache), r;
5586
5586
  }
5587
5587
  static getBox(e) {
5588
5588
  let t = this.boxesCache.pop();
@@ -5590,7 +5590,7 @@ class Ri {
5590
5590
  const i = new la(1, 1, 1);
5591
5591
  t = new H(i);
5592
5592
  }
5593
- return this.registerTimedObject(N.Current, t, e, this.boxesCache), t;
5593
+ return this.registerTimedObject(U.Current, t, e, this.boxesCache), t;
5594
5594
  }
5595
5595
  static getLine(e) {
5596
5596
  let t = this.linesCache.pop();
@@ -5599,7 +5599,7 @@ class Ri {
5599
5599
  let i = t.geometry.getAttribute("position");
5600
5600
  i || (i = new ht(new Float32Array(6), 3), t.geometry.setAttribute("position", i));
5601
5601
  }
5602
- return t.frustumCulled = !1, this.registerTimedObject(N.Current, t, e, this.linesCache), t;
5602
+ return t.frustumCulled = !1, this.registerTimedObject(U.Current, t, e, this.linesCache), t;
5603
5603
  }
5604
5604
  static getCircle(e) {
5605
5605
  let t = this.circlesCache.pop();
@@ -5619,19 +5619,19 @@ class Ri {
5619
5619
  }
5620
5620
  }
5621
5621
  }
5622
- return t.frustumCulled = !1, this.registerTimedObject(N.Current, t, e, this.circlesCache), t;
5622
+ return t.frustumCulled = !1, this.registerTimedObject(U.Current, t, e, this.circlesCache), t;
5623
5623
  }
5624
5624
  static getSphere(e, t, i) {
5625
5625
  let n = this.spheresCache.pop();
5626
- return n || (n = new H(new Ed(1, 8, 8))), n.scale.set(e, e, e), n.material.wireframe = i, this.registerTimedObject(N.Current, n, t, this.spheresCache), n;
5626
+ return n || (n = new H(new Ed(1, 8, 8))), n.scale.set(e, e, e), n.material.wireframe = i, this.registerTimedObject(U.Current, n, t, this.spheresCache), n;
5627
5627
  }
5628
5628
  static getArrowHead(e) {
5629
5629
  let t = this.arrowHeadsCache.pop();
5630
- return t || (t = new H(new ab(0, 0.5, 1, 8))), this.registerTimedObject(N.Current, t, e, this.arrowHeadsCache), t;
5630
+ return t || (t = new H(new ab(0, 0.5, 1, 8))), this.registerTimedObject(U.Current, t, e, this.arrowHeadsCache), t;
5631
5631
  }
5632
5632
  static getMesh(e) {
5633
5633
  let t = this.mesh.pop();
5634
- return t || (t = new H(), t.material = new we()), this.registerTimedObject(N.Current, t, e, this.mesh), t;
5634
+ return t || (t = new H(), t.material = new we()), this.registerTimedObject(U.Current, t, e, this.mesh), t;
5635
5635
  }
5636
5636
  static linesCache = [];
5637
5637
  static circlesCache = [];
@@ -5670,7 +5670,7 @@ class Ri {
5670
5670
  }
5671
5671
  t.traverse((a) => {
5672
5672
  a.layers.disableAll(), a.layers.enable(2);
5673
- }), t.renderOrder = 999999, t[mp] = n, t.castShadow = !1, t.receiveShadow = !1, t.isGizmo = !0, this.timedObjectsBuffer.push(t), this.timesBuffer.push(N.Current.time.realtimeSinceStartup + i), e.scene.add(t);
5673
+ }), t.renderOrder = 999999, t[mp] = n, t.castShadow = !1, t.receiveShadow = !1, t.isGizmo = !0, this.timedObjectsBuffer.push(t), this.timesBuffer.push(U.Current.time.realtimeSinceStartup + i), e.scene.add(t);
5674
5674
  }
5675
5675
  static timedObjectsBuffer = new Array();
5676
5676
  static timesBuffer = new Array();
@@ -5825,7 +5825,7 @@ class nc {
5825
5825
  }
5826
5826
  intersect(e, t, i, n) {
5827
5827
  for (const o of t) {
5828
- if (!o || o.visible === !1 || F.isGizmo(o) || n.lineThreshold !== void 0 && n.lineThreshold < 0 && o instanceof Zl)
5828
+ if (!o || o.visible === !1 || z.isGizmo(o) || n.lineThreshold !== void 0 && n.lineThreshold < 0 && o instanceof Zl)
5829
5829
  continue;
5830
5830
  let r = !0;
5831
5831
  const a = o, l = a.geometry;
@@ -5842,7 +5842,7 @@ class nc {
5842
5842
  let d = !0;
5843
5843
  if (n.precise === !1 && (d = !1), d ||= l.getAttribute("position")?.array?.length < 64, a instanceof da && (d = !1), !d && B1(a, e, i) || (n.useAcceleratedRaycast !== !1 ? td.runMeshBVHRaycast(e, a, i, this.context, n) : e.intersectObject(a, !1, i)), $t && i.length != h) {
5844
5844
  const f = i[i.length - 1], p = c ? 8969557 : 7798784;
5845
- F.DrawWireSphere(f.point, 0.1, p, 1, !1), F.DrawWireMesh({ mesh: o, depthTest: !1, duration: 0.2, color: p });
5845
+ z.DrawWireSphere(f.point, 0.1, p, 1, !1), z.DrawWireMesh({ mesh: o, depthTest: !1, duration: 0.2, color: p });
5846
5846
  }
5847
5847
  a.geometry = l;
5848
5848
  }
@@ -5852,7 +5852,7 @@ class nc {
5852
5852
  }
5853
5853
  tempBoundingBox = new pi();
5854
5854
  intersectSphere(e, t, i, n, o, r, a, l) {
5855
- let c = e && e.isMesh && e.layers.test(n) && !F.isGizmo(e);
5855
+ let c = e && e.isMesh && e.layers.test(n) && !z.isGizmo(e);
5856
5856
  c &&= e.visible, c &&= !(e instanceof Zl), c &&= !(e instanceof da);
5857
5857
  const h = e, d = h.geometry;
5858
5858
  if (c && l) {
@@ -5925,37 +5925,37 @@ var td;
5925
5925
  return !1;
5926
5926
  const k = y.geometry;
5927
5927
  if (y?.isSkinnedMesh) {
5928
- const E = y, z = E.bvhNeedsUpdate;
5928
+ const E = y, B = E.bvhNeedsUpdate;
5929
5929
  if (!E.staticGenerator)
5930
5930
  a(), o && (E.staticGenerator = new o(y), E.staticGenerator.applyWorldTransforms = !1, E.staticGeometry = E.staticGenerator.generate(), k.boundsTree = r?.call(E.staticGeometry), E.staticGeometryLastUpdate = performance.now() + Math.random() * 200, E.bvhNeedsUpdate = !0);
5931
- else if (k.boundsTree && (E.autoUpdateMeshBvhInterval !== void 0 && E.autoUpdateMeshBvhInterval >= 0 || z === !0)) {
5932
- const D = performance.now(), V = D - E.staticGeometryLastUpdate, q = E.autoUpdateMeshBvhInterval ?? 100;
5933
- (z || V > q) && ($t && console.warn(`Physics: updating skinned mesh bvh for ${y.name} after ${V.toFixed(2)}ms`), E.bvhNeedsUpdate = !1, E.staticGeometryLastUpdate = D, E.staticGenerator?.generate(E.staticGeometry), k.boundsTree.refit());
5931
+ else if (k.boundsTree && (E.autoUpdateMeshBvhInterval !== void 0 && E.autoUpdateMeshBvhInterval >= 0 || B === !0)) {
5932
+ const L = performance.now(), W = L - E.staticGeometryLastUpdate, X = E.autoUpdateMeshBvhInterval ?? 100;
5933
+ (B || W > X) && ($t && console.warn(`Physics: updating skinned mesh bvh for ${y.name} after ${W.toFixed(2)}ms`), E.bvhNeedsUpdate = !1, E.staticGeometryLastUpdate = L, E.staticGenerator?.generate(E.staticGeometry), k.boundsTree.refit());
5934
5934
  }
5935
5935
  } else if (!k.boundsTree) {
5936
5936
  c || m();
5937
5937
  let E = !0;
5938
5938
  if ((I.xr || k[p] === !1 || k.getAttribute("position")?.isInterleavedBufferAttribute || k.index && k.index?.isInterleavedBufferAttribute) && (E = !1), E && d) {
5939
5939
  if (k[f] === void 0) {
5940
- let z = null;
5940
+ let B = null;
5941
5941
  if (_.length > 0) {
5942
- const D = _.shift();
5943
- D && !D.running && (z = D);
5942
+ const L = _.shift();
5943
+ L && !L.running && (B = L);
5944
5944
  }
5945
- if (!z && g.length < 3 && (z = new d(), g.push(z)), z != null && !z.running) {
5946
- const D = y.name;
5947
- $t && console.log("<<<< worker start", D, z), k[f] = "queued", performance.mark("bvh.create.start");
5948
- const V = k.clone();
5945
+ if (!B && g.length < 3 && (B = new d(), g.push(B)), B != null && !B.running) {
5946
+ const L = y.name;
5947
+ $t && console.log("<<<< worker start", L, B), k[f] = "queued", performance.mark("bvh.create.start");
5948
+ const W = k.clone();
5949
5949
  try {
5950
- z.generate(V).then((q) => {
5951
- k[f] = "done", k.boundsTree = q;
5952
- }).catch((q) => {
5953
- k[f] = "failed - " + q?.message, k[p] = !1, $t && console.error("Failed to generate mesh bvh on worker", q);
5950
+ B.generate(W).then((X) => {
5951
+ k[f] = "done", k.boundsTree = X;
5952
+ }).catch((X) => {
5953
+ k[f] = "failed - " + X?.message, k[p] = !1, $t && console.error("Failed to generate mesh bvh on worker", X);
5954
5954
  }).finally(() => {
5955
- $t && console.log(">>>>> worker done", D, { hasBoundsTre: k.boundsTree != null }), _.push(z), V.dispose(), performance.mark("bvh.create.end"), performance.measure("bvh.create (worker)", "bvh.create.start", "bvh.create.end");
5955
+ $t && console.log(">>>>> worker done", L, { hasBoundsTre: k.boundsTree != null }), _.push(B), W.dispose(), performance.mark("bvh.create.end"), performance.measure("bvh.create (worker)", "bvh.create.start", "bvh.create.end");
5956
5956
  });
5957
- } catch (q) {
5958
- console.error("Failed to generate mesh bvh on worker", q);
5957
+ } catch (X) {
5958
+ console.error("Failed to generate mesh bvh on worker", X);
5959
5959
  }
5960
5960
  } else
5961
5961
  $t && console.warn("No worker available");
@@ -5963,19 +5963,19 @@ var td;
5963
5963
  } else (!h || !E) && (a(), n && (performance.mark("bvh.create.start"), k.boundsTree = new n(k), performance.mark("bvh.create.end"), performance.measure("bvh.create", "bvh.create.start", "bvh.create.end")));
5964
5964
  }
5965
5965
  if (v instanceof Ad) {
5966
- const E = v, z = y.raycast;
5966
+ const E = v, B = y.raycast;
5967
5967
  if (k.boundsTree)
5968
5968
  a(), i && (y.acceleratedRaycast || (y.acceleratedRaycast = i.bind(y), $t && console.debug(`Physics: bind acceleratedRaycast fn to "${y.name}"`)), y.raycast = y.acceleratedRaycast);
5969
5969
  else if ($t && console.warn("No bounds tree found for mesh", y.name, { workerTask: k[f], hasAcceleratedRaycast: i != null }), O.allowSlowRaycastFallback === !1)
5970
5970
  return $t && console.warn("Skipping raycast because no bounds tree is available and allowSlowRaycastFallback is false"), !1;
5971
- const D = E.firstHitOnly;
5972
- return E.firstHitOnly = !1, E.intersectObject(y, !1, x), E.firstHitOnly = D, y.raycast = z, !0;
5971
+ const L = E.firstHitOnly;
5972
+ return E.firstHitOnly = !1, E.intersectObject(y, !1, x), E.firstHitOnly = L, y.raycast = B, !0;
5973
5973
  } else if (v instanceof Id) {
5974
5974
  const E = k.boundsTree;
5975
5975
  if (E) {
5976
- const z = v;
5977
- if (l.copy(y.matrixWorld).invert(), z.applyMatrix4(l), E.intersectsSphere(z)) {
5978
- const V = Z(y), q = V.distanceTo(z.center), A = new s0(y, q, V);
5976
+ const B = v;
5977
+ if (l.copy(y.matrixWorld).invert(), B.applyMatrix4(l), E.intersectsSphere(B)) {
5978
+ const W = Z(y), X = W.distanceTo(B.center), A = new s0(y, X, W);
5979
5979
  x.push(A);
5980
5980
  }
5981
5981
  }
@@ -5989,7 +5989,7 @@ var td;
5989
5989
  t || (t = !0, import("./vendor-Z4SPrTcP.js").then((v) => v.index$1).then((v) => {
5990
5990
  i = v.acceleratedRaycast, n = v.MeshBVH, o = v.StaticGeometryGenerator, r = v.computeBoundsTree;
5991
5991
  }).catch((v) => {
5992
- ($t || L()) && console.error("Failed to load BVH library...", v.message);
5992
+ ($t || D()) && console.error("Failed to load BVH library...", v.message);
5993
5993
  }));
5994
5994
  }
5995
5995
  const l = new te();
@@ -5999,7 +5999,7 @@ var td;
5999
5999
  c = !0, h = !0, Promise.resolve().then(() => HA).then((v) => {
6000
6000
  d = v.GenerateMeshBVHWorker;
6001
6001
  }).catch((v) => {
6002
- ($t || L()) && console.warn("Failed to setup mesh bvh worker");
6002
+ ($t || D()) && console.warn("Failed to setup mesh bvh worker");
6003
6003
  }).finally(() => {
6004
6004
  h = !1;
6005
6005
  });
@@ -6266,7 +6266,7 @@ function sd(s) {
6266
6266
  try {
6267
6267
  const t = ke[e];
6268
6268
  if (t.isComponent !== !0) {
6269
- (L() || yp) && console.error(`Registered script is not a Needle Engine component.
6269
+ (D() || yp) && console.error(`Registered script is not a Needle Engine component.
6270
6270
  The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
6271
6271
  `, t), ke.splice(e, 1), e--;
6272
6272
  continue;
@@ -6367,7 +6367,7 @@ function Rh(s, e = !1) {
6367
6367
  return;
6368
6368
  }
6369
6369
  const t = yc(s);
6370
- u0(s, t, !0) || (yp || L() ? console.error(`Error updating hierarchy
6370
+ u0(s, t, !0) || (yp || D() ? console.error(`Error updating hierarchy
6371
6371
  Do you have circular references in your project? <a target="_blank" href="https://docs.needle.tools/circular-reference"> Click here for more information.`, s) : console.error('Failed to update active state in hierarchy of "' + s.name + '"', s), console.warn(" ↑ this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again)."));
6372
6372
  }
6373
6373
  function u0(s, e, t, i = 0) {
@@ -6486,7 +6486,7 @@ function Hd(s, e, t = !0, i) {
6486
6486
  return;
6487
6487
  }
6488
6488
  if (!e.isConnected) {
6489
- L() && console.debug("Can not send destroy: not connected", s.guid);
6489
+ D() && console.debug("Can not send destroy: not connected", s.guid);
6490
6490
  return;
6491
6491
  }
6492
6492
  let o = s.guid;
@@ -6543,7 +6543,7 @@ function m0(s, e, t, i) {
6543
6543
  const n = s;
6544
6544
  if (!n.guid)
6545
6545
  return console.warn("Can not instantiate: No guid", n), null;
6546
- if (e.context || (e.context = N.Current), !e.context)
6546
+ if (e.context || (e.context = U.Current), !e.context)
6547
6547
  return console.error("Missing network instantiate options / reference to network connection in sync instantiate"), null;
6548
6548
  const o = e ? { ...e } : null, { instance: r, seed: a } = nP(n, e);
6549
6549
  if (r) {
@@ -6551,7 +6551,7 @@ function m0(s, e, t, i) {
6551
6551
  if (l.guid) {
6552
6552
  od && console.log("[Local] new instance", "gameobject:", r?.guid);
6553
6553
  const c = new eP(n.guid, l.guid);
6554
- c.seed = a, e.deleteOnDisconnect === !0 && (c.deleteStateOnDisconnect = !0), o && (o.position && (c.position = { x: o.position.x, y: o.position.y, z: o.position.z }), o.rotation && (c.rotation = { x: o.rotation.x, y: o.rotation.y, z: o.rotation.z, w: o.rotation.w }), o.scale && (c.scale = { x: o.scale.x, y: o.scale.y, z: o.scale.z })), c.position || (c.position = { x: l.position.x, y: l.position.y, z: l.position.z }), c.rotation || (c.rotation = { x: l.quaternion.x, y: l.quaternion.y, z: l.quaternion.z, w: l.quaternion.w }), c.scale || (c.scale = { x: l.scale.x, y: l.scale.y, z: l.scale.z }), c.visible = n.visible, o?.parent && (typeof o.parent == "string" ? c.parent = o.parent : c.parent = o.parent.guid), c.hostData = t, i === !1 && (c.dontSave = !0), !e?.context?.connection && L() && console.debug("Object will be instantiated but it will not be synced: not connected", n.guid), e.context.connection.isInRoom && Fr.push(new WeakRef(l)), e?.context?.connection.send("new-instance-created", c);
6554
+ c.seed = a, e.deleteOnDisconnect === !0 && (c.deleteStateOnDisconnect = !0), o && (o.position && (c.position = { x: o.position.x, y: o.position.y, z: o.position.z }), o.rotation && (c.rotation = { x: o.rotation.x, y: o.rotation.y, z: o.rotation.z, w: o.rotation.w }), o.scale && (c.scale = { x: o.scale.x, y: o.scale.y, z: o.scale.z })), c.position || (c.position = { x: l.position.x, y: l.position.y, z: l.position.z }), c.rotation || (c.rotation = { x: l.quaternion.x, y: l.quaternion.y, z: l.quaternion.z, w: l.quaternion.w }), c.scale || (c.scale = { x: l.scale.x, y: l.scale.y, z: l.scale.z }), c.visible = n.visible, o?.parent && (typeof o.parent == "string" ? c.parent = o.parent : c.parent = o.parent.guid), c.hostData = t, i === !1 && (c.dontSave = !0), !e?.context?.connection && D() && console.debug("Object will be instantiated but it will not be synced: not connected", n.guid), e.context.connection.isInRoom && Fr.push(new WeakRef(l)), e?.context?.connection.send("new-instance-created", c);
6555
6555
  } else console.warn("Missing guid, can not send new instance event", l);
6556
6556
  }
6557
6557
  return r;
@@ -6570,7 +6570,7 @@ function iP(s) {
6570
6570
  return;
6571
6571
  }
6572
6572
  const i = new Nn();
6573
- e.position && (i.position = new b(e.position.x, e.position.y, e.position.z)), e.rotation && (i.rotation = new $(e.rotation.x, e.rotation.y, e.rotation.z, e.rotation.w)), e.scale && (i.scale = new b(e.scale.x, e.scale.y, e.scale.z)), i.parent = e.parent, e.seed && (i.idProvider = new Tt(e.seed)), i.visible = e.visible, i.context = s, od && s.alias && console.log("[Remote] instantiate in: " + s.alias);
6573
+ e.position && (i.position = new b(e.position.x, e.position.y, e.position.z)), e.rotation && (i.rotation = new N(e.rotation.x, e.rotation.y, e.rotation.z, e.rotation.w)), e.scale && (i.scale = new b(e.scale.x, e.scale.y, e.scale.z)), i.parent = e.parent, e.seed && (i.idProvider = new Tt(e.seed)), i.visible = e.visible, i.context = s, od && s.alias && console.log("[Remote] instantiate in: " + s.alias);
6574
6574
  const n = va(t, i);
6575
6575
  Fr.push(new WeakRef(n)), n && (e.parent === "scene" && s.scene.add(n), od && console.log("[Remote] new instance", "gameobject:", n?.guid, t));
6576
6576
  }), s.connection.beginListen("left-room", () => {
@@ -7254,7 +7254,7 @@ function TP(s) {
7254
7254
  const e = s.gameObject.userData.components.indexOf(s);
7255
7255
  s.gameObject.userData.components.splice(e, 1);
7256
7256
  }
7257
- s.__internalDisable && s.__internalDisable(), cs(s, s.context ?? N.Current), s.destroy(), s.gameObject = null;
7257
+ s.__internalDisable && s.__internalDisable(), cs(s, s.context ?? U.Current), s.destroy(), s.gameObject = null;
7258
7258
  }
7259
7259
  let Hy = !1;
7260
7260
  function P0(s, e, t) {
@@ -7321,7 +7321,7 @@ function Dm(s, e, t, i = !0) {
7321
7321
  }
7322
7322
  function Qd(s, e = void 0, t = !0) {
7323
7323
  if (!s) return null;
7324
- if (!e && (e = N.Current, !e))
7324
+ if (!e && (e = U.Current, !e))
7325
7325
  return console.error("Can not search object without any needle context or scene!!!"), null;
7326
7326
  let i = e;
7327
7327
  if (i.isScene || (i = e?.scene), !i) return null;
@@ -7330,7 +7330,7 @@ function Qd(s, e = void 0, t = !0) {
7330
7330
  }
7331
7331
  function EP(s, e, t = void 0) {
7332
7332
  if (!s) return e ?? [];
7333
- if (e || (e = []), e.length = 0, !t && (t = N.Current, !t))
7333
+ if (e || (e = []), e.length = 0, !t && (t = U.Current, !t))
7334
7334
  return console.error("Can not search object without any needle context or scene!!!"), e;
7335
7335
  "scene" in t && (t = t.scene);
7336
7336
  const i = t;
@@ -7638,7 +7638,7 @@ function va(s, e) {
7638
7638
  return s.instantiate(e ?? void 0);
7639
7639
  let t = null;
7640
7640
  e != null && (e.x !== void 0 ? (t = new Nn(), t.position = e) : t = e);
7641
- let i = N.Current;
7641
+ let i = U.Current;
7642
7642
  t?.context && (i = t.context), Ah && i.alias && console.log("context", i.alias), t && !t.idProvider && (t.idProvider = new Tt(Date.now()));
7643
7643
  const n = [], o = {}, r = {}, a = R0(i, s, t, n, o, r);
7644
7644
  a && (jP(o), DP(r, o)), Ah && (hp(s, !0), hp(a, !0));
@@ -7848,7 +7848,7 @@ var wa;
7848
7848
  headers: v,
7849
7849
  body: p,
7850
7850
  signal: d?.abort
7851
- }).then((z) => (d?.onProgress?.call(null, { progress01: 1, state: "finished" }), z)).catch((z) => z);
7851
+ }).then((B) => (d?.onProgress?.call(null, { progress01: 1, state: "finished" }), B)).catch((B) => B);
7852
7852
  };
7853
7853
  console.debug("Uploading file", y.upload);
7854
7854
  let I = !1, O = null;
@@ -7936,7 +7936,7 @@ class ie {
7936
7936
  * @returns the AssetReference for the URL
7937
7937
  */
7938
7938
  static getOrCreateFromUrl(e, t) {
7939
- if (!t && (t = N.Current, !t))
7939
+ if (!t && (t = U.Current, !t))
7940
7940
  throw new Error('Context is required when sourceId is a string. When you call this method from a component you can call it with "getOrCreate(this, url)" where "this" is the component.');
7941
7941
  const i = t.addressables, n = i.findAssetReference(e);
7942
7942
  if (n) return n;
@@ -7949,7 +7949,7 @@ class ie {
7949
7949
  */
7950
7950
  static getOrCreate(e, t, i) {
7951
7951
  if (typeof e == "string") {
7952
- if (!i && (i = N.Current, !i))
7952
+ if (!i && (i = U.Current, !i))
7953
7953
  throw new Error('Context is required when sourceId is a string. When you call this method from a component you can call it with "getOrCreate(this, url)" where "this" is the component.');
7954
7954
  } else
7955
7955
  i = e.context, e = e.sourceId;
@@ -8031,7 +8031,7 @@ class ie {
8031
8031
  }
8032
8032
  /** frees previously allocated memory and destroys the current `asset` instance (if any) */
8033
8033
  unload() {
8034
- this.asset && (js && console.log("Unload", this.asset), "scene" in this.asset && this.asset.scene && Wi(this.asset.scene, !0, !0), Wi(this.asset, !0, !0)), this.asset = null, this._rawBinary = void 0, this._glbRoot = null, this._loadingPromise = null, N.Current && N.Current.addressables.unregisterAssetReference(this);
8034
+ this.asset && (js && console.log("Unload", this.asset), "scene" in this.asset && this.asset.scene && Wi(this.asset.scene, !0, !0), Wi(this.asset, !0, !0)), this.asset = null, this._rawBinary = void 0, this._glbRoot = null, this._loadingPromise = null, U.Current && U.Current.addressables.unregisterAssetReference(this);
8035
8035
  }
8036
8036
  /** loads the asset binary without creating an instance */
8037
8037
  async preload() {
@@ -8051,7 +8051,7 @@ class ie {
8051
8051
  if (js && console.log("[AssetReference] loadAssetAsync", this.url), !this.mustLoad) return this.asset;
8052
8052
  if (e && this._progressListeners.push(e), this._loadingPromise !== null)
8053
8053
  return this._loadingPromise.then((n) => this.asset);
8054
- const t = N.Current;
8054
+ const t = U.Current;
8055
8055
  if (this._rawBinary) {
8056
8056
  if (!(this._rawBinary instanceof ArrayBuffer))
8057
8057
  return console.error("[AssetReference] Failed loading – Invalid data. Must be of type ArrayBuffer. " + typeof this._rawBinary), null;
@@ -8085,7 +8085,7 @@ class ie {
8085
8085
  }
8086
8086
  static currentlyInstantiating = /* @__PURE__ */ new Map();
8087
8087
  async onInstantiate(e, t = !1, i) {
8088
- const n = N.Current, o = new Nn();
8088
+ const n = U.Current, o = new Nn();
8089
8089
  if (e instanceof M ? o.parent = e : e && (Object.assign(o, e), o.cloneAssign(e)), o.parent === void 0 && (o.parent = n.scene), this.mustLoad && await this.loadAssetAsync(), js && console.log("Instantiate", this.url, "parent:", e), this.asset) {
8090
8090
  js && console.log("Add to scene", this.asset);
8091
8091
  let r = ie.currentlyInstantiating.get(this.url);
@@ -8341,7 +8341,7 @@ class rc {
8341
8341
  }
8342
8342
  }
8343
8343
  function* T0(s, e = null) {
8344
- const t = e ? e.time : N.Current.time, i = t.time;
8344
+ const t = e ? e.time : U.Current.time, i = t.time;
8345
8345
  for (; t.time - i < s; )
8346
8346
  yield;
8347
8347
  }
@@ -8389,7 +8389,7 @@ class VP {
8389
8389
  h && a.push(h);
8390
8390
  }
8391
8391
  const l = await Tb(a);
8392
- l?.anyFailed && L() && console.error("Failed to load lightmap extension", l), o();
8392
+ l?.anyFailed && D() && console.error("Failed to load lightmap extension", l), o();
8393
8393
  })) : null;
8394
8394
  }
8395
8395
  }
@@ -8504,7 +8504,7 @@ class GP {
8504
8504
  }
8505
8505
  /** @internal */
8506
8506
  setRenderer(e) {
8507
- this._lodsManager?.disable(), Ao.removePlugin(this), Ao.addPlugin(this), Ao.debugDrawLine = F.DrawLine, this._lodsManager = Ao.get(e, { engine: "needle-engine" }), this.applySettings(), this._lodsManager.enable();
8507
+ this._lodsManager?.disable(), Ao.removePlugin(this), Ao.addPlugin(this), Ao.debugDrawLine = z.DrawLine, this._lodsManager = Ao.get(e, { engine: "needle-engine" }), this.applySettings(), this._lodsManager.enable();
8508
8508
  }
8509
8509
  disable() {
8510
8510
  this._lodsManager?.disable(), Ao.removePlugin(this);
@@ -8524,7 +8524,7 @@ class GP {
8524
8524
  th.copy(a), th.applyMatrix4(t.matrixWorld);
8525
8525
  const l = th.center, c = th.radius, h = ["#76c43e", "#bcc43e", "#c4ac3e", "#c4673e", "#ff3e3e"];
8526
8526
  if (r)
8527
- F.DrawWireSphere(l, c, h[o], 0.1);
8527
+ z.DrawWireSphere(l, c, h[o], 0.1);
8528
8528
  else {
8529
8529
  const d = t.geometry.index?.count ?? 0, f = We.getMeshLODExtension(t.geometry)?.lods;
8530
8530
  o = f ? Math.min(f?.length - 1, o) : 0;
@@ -8543,8 +8543,8 @@ TEX ` + i.texture_lod;
8543
8543
  ` + (n.lastScreenCoverage * 100).toFixed(1) + `% cov
8544
8544
  ` + (n.lastCentrality * 100).toFixed(1) + `% centr
8545
8545
  ` + (eh.min.x.toFixed(2) + "-" + eh.max.x.toFixed(2) + "x" + eh.min.y.toFixed(2) + "-" + eh.max.y.toFixed(2)) + " scr"), n.lastScreenCoverage > 0.1) {
8546
- const m = e, v = m.worldForward, y = m.worldPosition, I = G(v).multiplyScalar(c * 0.7).add(l), O = I.distanceTo(y), k = h[Math.min(h.length - 1, Math.max(0, o))] + "88", E = this.context.domHeight > 0 ? screen.height / this.context.domHeight : 1, z = e.isPerspectiveCamera ? Math.tan(e.fov * Math.PI / 180 / 2) : 1;
8547
- F.DrawLabel(I, _, O * 0.012 * E * z, void 0, 16777215, k);
8546
+ const m = e, v = m.worldForward, y = m.worldPosition, I = G(v).multiplyScalar(c * 0.7).add(l), O = I.distanceTo(y), k = h[Math.min(h.length - 1, Math.max(0, o))] + "88", E = this.context.domHeight > 0 ? screen.height / this.context.domHeight : 1, B = e.isPerspectiveCamera ? Math.tan(e.fov * Math.PI / 180 / 2) : 1;
8547
+ z.DrawLabel(I, _, O * 0.012 * E * B, void 0, 16777215, k);
8548
8548
  }
8549
8549
  }
8550
8550
  }
@@ -8977,7 +8977,7 @@ vec3 NeutralToneMapping( vec3 color ) {
8977
8977
  if (i >= 0 && n >= 0) {
8978
8978
  const o = Wt.tonemapping_pars_fragment.substring(i, n + t.length);
8979
8979
  Wt.tonemapping_pars_fragment = Wt.tonemapping_pars_fragment.replace(o, s);
8980
- } else L() && console.error("Couldn't find NeutralToneMapping in ShaderChunk.tonemapping_pars_fragment");
8980
+ } else D() && console.error("Couldn't find NeutralToneMapping in ShaderChunk.tonemapping_pars_fragment");
8981
8981
  }
8982
8982
  function rO() {
8983
8983
  const s = `
@@ -9095,7 +9095,7 @@ vec3 AgXToneMapping( vec3 color ) {
9095
9095
  if (i >= 0 && n >= 0) {
9096
9096
  const o = Wt.tonemapping_pars_fragment.substring(i, n + t.length);
9097
9097
  Wt.tonemapping_pars_fragment = Wt.tonemapping_pars_fragment.replace(o, s);
9098
- } else L() && console.error("Couldn't find AgXToneMapping in ShaderChunk.tonemapping_pars_fragment");
9098
+ } else D() && console.error("Couldn't find AgXToneMapping in ShaderChunk.tonemapping_pars_fragment");
9099
9099
  }
9100
9100
  function A0(s) {
9101
9101
  if (typeof s == "string")
@@ -9171,7 +9171,7 @@ class On {
9171
9171
  if (this._fullscreenButton)
9172
9172
  return this._fullscreenButton;
9173
9173
  if (!document.fullscreenEnabled)
9174
- return L() && console.warn("NeedleMenu: Fullscreen button could not be created, device doesn't support the Fullscreen API"), null;
9174
+ return D() && console.warn("NeedleMenu: Fullscreen button could not be created, device doesn't support the Fullscreen API"), null;
9175
9175
  const t = document.createElement("button");
9176
9176
  this._fullscreenButton = t, t.classList.add("fullscreen-button"), t.title = "Click to enter fullscreen mode";
9177
9177
  const i = Mt("fullscreen"), n = Mt("fullscreen_exit");
@@ -9243,7 +9243,7 @@ class On {
9243
9243
  const n = document.createElement("div");
9244
9244
  n.classList.add("qr-code-container"), i.appendChild(n), t.addEventListener("click", () => {
9245
9245
  if (i.parentNode) return r();
9246
- L() && window.location.href.includes("://localhost") && ge("To access your website from another device in the same local network you have to use the IP address instead of localhost. The IP address is logged in your development server console when you start the server."), o();
9246
+ D() && window.location.href.includes("://localhost") && ge("To access your website from another device in the same local network you have to use the IP address instead of localhost. The IP address is logged in your development server console when you start the server."), o();
9247
9247
  });
9248
9248
  async function o() {
9249
9249
  await a();
@@ -9396,7 +9396,7 @@ class lO {
9396
9396
  this.menu?.removeFromParent();
9397
9397
  return;
9398
9398
  }
9399
- if (mf && X.isDesktop() && this.updateMenu(), !this._context.xr?.running) {
9399
+ if (mf && q.isDesktop() && this.updateMenu(), !this._context.xr?.running) {
9400
9400
  this._wasInXR && (this._wasInXR = !1, this.onExitXR());
9401
9401
  return;
9402
9402
  }
@@ -9432,7 +9432,7 @@ class lO {
9432
9432
  const t = this._context.mainCamera, n = this._context.xr?.rigScale || 1;
9433
9433
  if (t) {
9434
9434
  const o = t.worldPosition, r = t.worldForward.multiplyScalar(-1), a = r.y > 0.6, l = r.y > 0.4, c = (e.visible ? l : a) || this.userRequestedMenu, h = !e.visible && c;
9435
- e.visible = c || X.isDesktop() && mf, r.multiplyScalar(3 * n), o.add(r), (h || !1) && (e.position.copy(this._menuTarget.position), e.position.y += 0.25, this._menuTarget.position.copy(e.position), this.positionFilter.reset(e.position), e.quaternion.copy(this._menuTarget.quaternion), this.markDirty());
9435
+ e.visible = c || q.isDesktop() && mf, r.multiplyScalar(3 * n), o.add(r), (h || !1) && (e.position.copy(this._menuTarget.position), e.position.y += 0.25, this._menuTarget.position.copy(e.position), this.positionFilter.reset(e.position), e.quaternion.copy(this._menuTarget.quaternion), this.markDirty());
9436
9436
  const f = this._menuTarget.position.distanceTo(o);
9437
9437
  (h || f > 1.5 * n) && (this.ensureRenderOnTop(this.menu), this._menuTarget.position.copy(o), this._context.scene.add(this._menuTarget), Nd(this._menuTarget, this._context.mainCamera, !0, !0), this._menuTarget.removeFromParent()), this.positionFilter.filter(this._menuTarget.position, e.position, this._context.time.time), this.menu?.quaternion.slerp(this._menuTarget.quaternion, this._context.time.deltaTime * 5), this.menu?.scale.setScalar(n);
9438
9438
  }
@@ -9738,7 +9738,7 @@ let hO = class {
9738
9738
  * If enabled=true then a button will be added to the menu that will show a QR code for the current page when clicked.
9739
9739
  */
9740
9740
  showQRCodeButton(e) {
9741
- if (e === "desktop-only" && (e = !X.isMobileDevice()), e) {
9741
+ if (e === "desktop-only" && (e = !q.isMobileDevice()), e) {
9742
9742
  const t = On.getOrCreate().createQRCode();
9743
9743
  return t.style.display = "", this._menu.appendChild(t), t;
9744
9744
  } else {
@@ -10412,32 +10412,32 @@ var xe = /* @__PURE__ */ ((s) => (s[s.Start = -1] = "Start", s[s.EarlyUpdate = 0
10412
10412
  function Um(s, e) {
10413
10413
  if (!s) return;
10414
10414
  if (!s.isComponent) {
10415
- (L() || Xe) && console.error(`Registered script is not a Needle Engine component.
10415
+ (D() || Xe) && console.error(`Registered script is not a Needle Engine component.
10416
10416
  The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
10417
10417
  `, s);
10418
10418
  return;
10419
10419
  }
10420
- e || (e = N.Current, Xe && console.warn("> Registering component without context"));
10420
+ e || (e = U.Current, Xe && console.warn("> Registering component without context"));
10421
10421
  const t = e?.new_scripts;
10422
10422
  t.includes(s) || t.push(s);
10423
10423
  }
10424
- class N {
10424
+ class U {
10425
10425
  static _defaultTargetFramerate = { value: 90, toString() {
10426
10426
  return this.value;
10427
10427
  } };
10428
10428
  /** When a new context is created this is the framerate that will be used by default */
10429
10429
  static get DefaultTargetFrameRate() {
10430
- return N._defaultTargetFramerate.value;
10430
+ return U._defaultTargetFramerate.value;
10431
10431
  }
10432
10432
  /** When a new context is created this is the framerate that will be used by default */
10433
10433
  static set DefaultTargetFrameRate(e) {
10434
- N._defaultTargetFramerate.value = e;
10434
+ U._defaultTargetFramerate.value = e;
10435
10435
  }
10436
10436
  static _defaultWebglRendererParameters = {
10437
10437
  antialias: !0,
10438
10438
  alpha: !1,
10439
10439
  // Note: this is due to a bug on OSX devices. See NE-5370
10440
- powerPreference: X.isiOS() || X.isMacOS() ? "default" : "high-performance",
10440
+ powerPreference: q.isiOS() || q.isMacOS() ? "default" : "high-performance",
10441
10441
  stencil: !0
10442
10442
  // logarithmicDepthBuffer: true,
10443
10443
  // reverseDepthBuffer: true, // https://github.com/mrdoob/three.js/issues/29770
@@ -10451,7 +10451,7 @@ class N {
10451
10451
  * ```
10452
10452
  */
10453
10453
  static get DefaultWebGLRendererParameters() {
10454
- return N._defaultWebglRendererParameters;
10454
+ return U._defaultWebglRendererParameters;
10455
10455
  }
10456
10456
  /** The needle engine version */
10457
10457
  get version() {
@@ -10764,11 +10764,11 @@ class N {
10764
10764
  * @returns {WebGLRenderer} the newly created renderer
10765
10765
  */
10766
10766
  createNewRenderer(e) {
10767
- if (this.renderer?.dispose(), e = { ...N.DefaultWebGLRendererParameters, ...e }, !e.canvas) {
10767
+ if (this.renderer?.dispose(), e = { ...U.DefaultWebGLRendererParameters, ...e }, !e.canvas) {
10768
10768
  const t = this.domElement?.shadowRoot?.querySelector("canvas");
10769
10769
  t && (e.canvas = t, Xe && console.log("Using canvas from shadow root", t));
10770
10770
  }
10771
- return Xe && console.log("Using Renderer Parameters:", e, this.domElement), this.renderer = new ur(e), this.renderer.debug.checkShaderErrors = L() || w("checkshadererrors") === !0, this.renderer.toneMappingExposure = 1, this.renderer.toneMapping = Gh, this.renderer.setClearColor(new se("lightgrey"), 0), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = nx, this.renderer.setSize(this.domWidth, this.domHeight), this.renderer.outputColorSpace = Cs, this.renderer.nodes = {
10771
+ return Xe && console.log("Using Renderer Parameters:", e, this.domElement), this.renderer = new ur(e), this.renderer.debug.checkShaderErrors = D() || w("checkshadererrors") === !0, this.renderer.toneMappingExposure = 1, this.renderer.toneMapping = Gh, this.renderer.setClearColor(new se("lightgrey"), 0), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = nx, this.renderer.setSize(this.domWidth, this.domHeight), this.renderer.outputColorSpace = Cs, this.renderer.nodes = {
10772
10772
  library: new sx(),
10773
10773
  modelViewMatrix: null,
10774
10774
  modelNormalViewMatrix: null
@@ -10876,14 +10876,14 @@ class N {
10876
10876
  this.internalOnDestroy();
10877
10877
  }
10878
10878
  internalOnDestroy() {
10879
- N.Current = this, he.dispatchCallback(ce.ContextDestroying, this), mn(this, ce.ContextDestroying), this.clear(), this.renderer?.setAnimationLoop(null), this.renderer && (this.renderer.setClearAlpha(0), this.renderer.clear(), this.isManagedExternally || (Xe && console.log("Disposing renderer"), this.renderer.dispose())), this.scene = null, this.renderer = null, this.input.dispose(), this.menu.onDestroy(), this.animations.onDestroy();
10879
+ U.Current = this, he.dispatchCallback(ce.ContextDestroying, this), mn(this, ce.ContextDestroying), this.clear(), this.renderer?.setAnimationLoop(null), this.renderer && (this.renderer.setClearAlpha(0), this.renderer.clear(), this.isManagedExternally || (Xe && console.log("Disposing renderer"), this.renderer.dispose())), this.scene = null, this.renderer = null, this.input.dispose(), this.menu.onDestroy(), this.animations.onDestroy();
10880
10880
  for (const e of this._disposeCallbacks)
10881
10881
  try {
10882
10882
  e();
10883
10883
  } catch (t) {
10884
10884
  console.error("Error in on dispose callback:", t, e);
10885
10885
  }
10886
- this.domElement?.parentElement && this.domElement.parentElement.removeChild(this.domElement), this._isCreated = !1, he.dispatchCallback(ce.ContextDestroyed, this), mn(this, ce.ContextDestroyed), he.unregister(this), N.Current === this && (N.Current = null);
10886
+ this.domElement?.parentElement && this.domElement.parentElement.removeChild(this.domElement), this._isCreated = !1, he.dispatchCallback(ce.ContextDestroyed, this), mn(this, ce.ContextDestroyed), he.unregister(this), U.Current === this && (U.Current = null);
10887
10887
  }
10888
10888
  /** @internal Automatically called by components when you call `startCoroutine`. Use `startCoroutine` instead */
10889
10889
  registerCoroutineUpdate(e, t, i) {
@@ -11016,7 +11016,7 @@ Start a coroutine from a component by calling "this.startCoroutine(myCoroutine()
11016
11016
  Xe && console.log("Creating context", this.name, e);
11017
11017
  const i = globalThis["needle:dependencies:ready"];
11018
11018
  i instanceof Promise && (Xe && console.log("Waiting for dependencies to be ready"), await i.catch((c) => {
11019
- if (Xe || L()) {
11019
+ if (Xe || D()) {
11020
11020
  if (Wd("Needle Engine dependencies failed to load. Please check the console for more details"), c instanceof ReferenceError) {
11021
11021
  let h = "YourComponentName";
11022
11022
  const d = c.message.indexOf("'");
@@ -11044,10 +11044,10 @@ Possible solutions:
11044
11044
  Xe && console.log("Needle Engine dependencies are ready");
11045
11045
  })), this.clear();
11046
11046
  const n = this.renderer, o = !n || n.isDisposed === !0;
11047
- this.isManagedExternally === !1 && o ? this.createNewRenderer() : this.lodsManager.setRenderer(this.renderer), this.renderer?.setAnimationLoop(null), N.Current = this, await he.dispatchCallback(ce.ContextCreationStart, this);
11047
+ this.isManagedExternally === !1 && o ? this.createNewRenderer() : this.lodsManager.setRenderer(this.renderer), this.renderer?.setAnimationLoop(null), U.Current = this, await he.dispatchCallback(ce.ContextCreationStart, this);
11048
11048
  let r = !0, a;
11049
11049
  try {
11050
- N.Current = this, e ? a = await this.internalLoadInitialContent(t, e) : a = [];
11050
+ U.Current = this, e ? a = await this.internalLoadInitialContent(t, e) : a = [];
11051
11051
  } catch (c) {
11052
11052
  console.error(c), r = !1;
11053
11053
  }
@@ -11057,7 +11057,7 @@ Possible solutions:
11057
11057
  return !1;
11058
11058
  if (this.internalOnUpdateVisible(), !this.renderer)
11059
11059
  return Xe && console.warn("Context has no renderer (perhaps it was disconnected?", this.domElement.isConnected), !1;
11060
- !this.isManagedExternally && !this.domElement.shadowRoot && this.domElement.prepend(this.renderer.domElement), N.Current = this, N.Current = this;
11060
+ !this.isManagedExternally && !this.domElement.shadowRoot && this.domElement.prepend(this.renderer.domElement), U.Current = this, U.Current = this;
11061
11061
  for (let c = 0; c < this.new_scripts.length; c++) {
11062
11062
  const h = this.new_scripts[c];
11063
11063
  if (h.gameObject !== void 0 && h.gameObject !== null) {
@@ -11068,9 +11068,9 @@ Possible solutions:
11068
11068
  }
11069
11069
  if (this.post_setup_callbacks)
11070
11070
  for (let c = 0; c < this.post_setup_callbacks.length; c++)
11071
- N.Current = this, await this.post_setup_callbacks[c](this);
11071
+ U.Current = this, await this.post_setup_callbacks[c](this);
11072
11072
  if (!this._mainCamera) {
11073
- N.Current = this;
11073
+ U.Current = this;
11074
11074
  let c = null;
11075
11075
  ba(this.scene, (h) => {
11076
11076
  const d = h;
@@ -11082,7 +11082,7 @@ Possible solutions:
11082
11082
  }
11083
11083
  }), c ? this.setCurrentCamera(c) : !he.dispatchCallback(ce.MissingCamera, this, { files: a }) && !this.mainCamera && !this.isManagedExternally && console.warn("Missing camera in main scene", this);
11084
11084
  }
11085
- this.input.bindEvents(), N.Current = this, sd(this), this.physics.engine && (this.physics.engine?.step(0), this.physics.engine?.postStep()), !this.isManagedExternally && this.composer && this.mainCamera, this._needsUpdateSize = !0, this._stats && (this._stats.showPanel(0), this._stats.dom.style.position = "absolute", this.domElement.shadowRoot?.appendChild(this._stats.dom)), Xe && hp(this.scene, !0), this.targetFrameRate === void 0 ? (Xe && console.warn("No target framerate set, using default", N.DefaultTargetFrameRate), this.targetFrameRate = N._defaultTargetFramerate) : Xe && console.log("Target framerate set to", this.targetFrameRate), this._dispatchReadyAfterFrame = !0;
11085
+ this.input.bindEvents(), U.Current = this, sd(this), this.physics.engine && (this.physics.engine?.step(0), this.physics.engine?.postStep()), !this.isManagedExternally && this.composer && this.mainCamera, this._needsUpdateSize = !0, this._stats && (this._stats.showPanel(0), this._stats.dom.style.position = "absolute", this.domElement.shadowRoot?.appendChild(this._stats.dom)), Xe && hp(this.scene, !0), this.targetFrameRate === void 0 ? (Xe && console.warn("No target framerate set, using default", U.DefaultTargetFrameRate), this.targetFrameRate = U._defaultTargetFramerate) : Xe && console.log("Target framerate set to", this.targetFrameRate), this._dispatchReadyAfterFrame = !0;
11086
11086
  const l = he.dispatchCallback(ce.ContextCreated, this, { files: a });
11087
11087
  if (l) {
11088
11088
  const c = this.domElement;
@@ -11157,11 +11157,11 @@ Possible solutions:
11157
11157
  _renderlooperrors = 0;
11158
11158
  /** Performs a full update step including script callbacks, rendering (unless isManagedExternally is set to false) and post render callbacks */
11159
11159
  update(e, t) {
11160
- if (t === void 0 && (t = null), L() || Xe || G1())
11160
+ if (t === void 0 && (t = null), D() || Xe || G1())
11161
11161
  try {
11162
11162
  this.internalStep(e, t), this._renderlooperrors = 0;
11163
11163
  } catch (i) {
11164
- this._renderlooperrors += 1, (L() || Xe) && (i instanceof Error || i instanceof TypeError) && Be("Caught unhandled exception during render-loop - see console for details.", Ui.Error), console.error("Frame #" + this.time.frame + `
11164
+ this._renderlooperrors += 1, (D() || Xe) && (i instanceof Error || i instanceof TypeError) && Be("Caught unhandled exception during render-loop - see console for details.", Ui.Error), console.error("Frame #" + this.time.frame + `
11165
11165
  `, i), this._renderlooperrors >= 3 && (console.warn("Stopping render loop due to error"), this.renderer.setAnimationLoop(null)), this.domElement.dispatchEvent(new CustomEvent("error", { detail: i }));
11166
11166
  }
11167
11167
  else
@@ -11203,8 +11203,8 @@ Possible solutions:
11203
11203
  return !1;
11204
11204
  this._accumulatedTime = 0;
11205
11205
  }
11206
- if (this._stats?.begin(), N.Current = this, this.onHandlePaused()) return !1;
11207
- for (N.Current = this, this.time.update(), fO && console.log("FPS", this.time.smoothedFps.toFixed(0)), sd(this), Rh(this.scene), d0(this), mn(
11206
+ if (this._stats?.begin(), U.Current = this, this.onHandlePaused()) return !1;
11207
+ for (U.Current = this, this.time.update(), fO && console.log("FPS", this.time.smoothedFps.toFixed(0)), sd(this), Rh(this.scene), d0(this), mn(
11208
11208
  this,
11209
11209
  -1
11210
11210
  /* Start */
@@ -11224,7 +11224,7 @@ Possible solutions:
11224
11224
  this._currentFrameEvent = 0;
11225
11225
  for (let n = 0; n < this.scripts_earlyUpdate.length; n++) {
11226
11226
  const o = this.scripts_earlyUpdate[n];
11227
- o.activeAndEnabled && o.earlyUpdate !== void 0 && (N.Current = this, o.earlyUpdate());
11227
+ o.activeAndEnabled && o.earlyUpdate !== void 0 && (U.Current = this, o.earlyUpdate());
11228
11228
  }
11229
11229
  this.executeCoroutines(
11230
11230
  0
@@ -11236,7 +11236,7 @@ Possible solutions:
11236
11236
  ), this._currentFrameEvent = 1;
11237
11237
  for (let n = 0; n < this.scripts_update.length; n++) {
11238
11238
  const o = this.scripts_update[n];
11239
- o.activeAndEnabled && o.update !== void 0 && (N.Current = this, o.update());
11239
+ o.activeAndEnabled && o.update !== void 0 && (U.Current = this, o.update());
11240
11240
  }
11241
11241
  this.executeCoroutines(
11242
11242
  1
@@ -11248,7 +11248,7 @@ Possible solutions:
11248
11248
  ), this._currentFrameEvent = 2;
11249
11249
  for (let n = 0; n < this.scripts_lateUpdate.length; n++) {
11250
11250
  const o = this.scripts_lateUpdate[n];
11251
- o.activeAndEnabled && o.lateUpdate !== void 0 && (N.Current = this, o.lateUpdate());
11251
+ o.activeAndEnabled && o.lateUpdate !== void 0 && (U.Current = this, o.lateUpdate());
11252
11252
  }
11253
11253
  if (this.executeCoroutines(
11254
11254
  2
@@ -11261,7 +11261,7 @@ Possible solutions:
11261
11261
  this._focusRect && this.mainCamera instanceof pe && SC(this._focusRect, this.time.deltaTime / 0.05, this.mainCamera, this.renderer), this._currentFrameEvent = 3;
11262
11262
  for (let n = 0; n < this.scripts_onBeforeRender.length; n++) {
11263
11263
  const o = this.scripts_onBeforeRender[n];
11264
- o.activeAndEnabled && o.onBeforeRender !== void 0 && (N.Current = this, o.onBeforeRender(t));
11264
+ o.activeAndEnabled && o.onBeforeRender !== void 0 && (U.Current = this, o.onBeforeRender(t));
11265
11265
  }
11266
11266
  if (this.executeCoroutines(
11267
11267
  3
@@ -11296,7 +11296,7 @@ Possible solutions:
11296
11296
  if (this.isVisibleToUser || this.runInBackground) {
11297
11297
  for (let e = 0; e < this.scripts_onAfterRender.length; e++) {
11298
11298
  const t = this.scripts_onAfterRender[e];
11299
- t.activeAndEnabled && t.onAfterRender !== void 0 && (N.Current = this, t.onAfterRender());
11299
+ t.activeAndEnabled && t.onAfterRender !== void 0 && (U.Current = this, t.onAfterRender());
11300
11300
  }
11301
11301
  if (this.executeCoroutines(
11302
11302
  4
@@ -11323,7 +11323,7 @@ Target Framerate: ` + this.targetFrameRate)), this._dispatchReadyAfterFrame && (
11323
11323
  e && "setMainCamera" in this.composer && this.composer.passes[0]?.mainCamera != e && this.composer.setMainCamera(e);
11324
11324
  const t = this.renderer.getClearColor(this._tempClearColor), i = this.renderer.getClearAlpha();
11325
11325
  this._tempClearColor2.copy(t), this.renderer.setClearColor(t.convertSRGBToLinear(), this.renderer.getClearAlpha()), this.composer.render(this.time.deltaTime), this.renderer.setClearColor(this._tempClearColor2, i);
11326
- } else e && (this.isInXR && X.isMacOS() && this.renderer.clearDepth(), this.renderer.render(this.scene, e));
11326
+ } else e && (this.isInXR && q.isMacOS() && this.renderer.clearDepth(), this.renderer.render(this.scene, e));
11327
11327
  return this._isRendering = !1, !0;
11328
11328
  }
11329
11329
  _contextRestoreTries = 0;
@@ -11338,7 +11338,7 @@ Target Framerate: ` + this.targetFrameRate)), this._dispatchReadyAfterFrame && (
11338
11338
  uO && console.log("Paused?", e, "context:" + this.alias);
11339
11339
  for (let t = 0; t < this.scripts_pausedChanged.length; t++) {
11340
11340
  const i = this.scripts_pausedChanged[t];
11341
- i.activeAndEnabled && i.onPausedChanged !== void 0 && (N.Current = this, i.onPausedChanged(e, this._wasPaused));
11341
+ i.activeAndEnabled && i.onPausedChanged !== void 0 && (U.Current = this, i.onPausedChanged(e, this._wasPaused));
11342
11342
  }
11343
11343
  }
11344
11344
  return this._wasPaused = e, e;
@@ -11597,7 +11597,7 @@ async function bO(s) {
11597
11597
  border-radius: .5em;
11598
11598
  border: 2px solid rgba(160,160,160,.3);
11599
11599
  `, n = `Needle Engine — No license active, commercial use is not allowed. Visit https://needle.tools/pricing for more information and licensing options! v${En}`;
11600
- N.Current?.xr ? console.log(n) : console.log("%c " + n, t);
11600
+ U.Current?.xr ? console.log(n) : console.log("%c " + n, t);
11601
11601
  }
11602
11602
  async function vO(s) {
11603
11603
  if (window.crossOriginIsolated) return;
@@ -11828,7 +11828,7 @@ class S extends M {
11828
11828
  * @param processStart Whether to process the start callbacks if being activated
11829
11829
  */
11830
11830
  static setActive(e, t, i = !0) {
11831
- e && (Ih(e, t), Rh(e), t && i && d0(N.Current, e));
11831
+ e && (Ih(e, t), Rh(e), t && i && d0(U.Current, e));
11832
11832
  }
11833
11833
  /**
11834
11834
  * Checks if the GameObject itself is active (same as go.visible)
@@ -11893,7 +11893,7 @@ class S extends M {
11893
11893
  static destroySynced(e, t, i = !0) {
11894
11894
  if (!e) return;
11895
11895
  const n = e;
11896
- t = t ?? N.Current, Hd(n, t.connection, i);
11896
+ t = t ?? U.Current, Hd(n, t.connection, i);
11897
11897
  }
11898
11898
  /**
11899
11899
  * Destroys an object
@@ -11915,7 +11915,7 @@ class S extends M {
11915
11915
  console.warn("Can not add object to self", e);
11916
11916
  return;
11917
11917
  }
11918
- i || (i = N.Current), t.add(e), Ih(e, !0), Rh(e), i ? S.foreachComponent(e, (n) => {
11918
+ i || (i = U.Current), t.add(e), Ih(e, !0), Rh(e), i ? S.foreachComponent(e, (n) => {
11919
11919
  Am(n, i), !n.__internalDidAwakeAndStart && i.new_script_start.includes(n) === !1 && i.new_script_start.push(n);
11920
11920
  }, !0) : console.warn("Missing context");
11921
11921
  }
@@ -12029,7 +12029,7 @@ class S extends M {
12029
12029
  * @returns The first matching component if found, otherwise null
12030
12030
  */
12031
12031
  static findObjectOfType(e, t, i = !0) {
12032
- return Qd(e, t ?? N.Current, i);
12032
+ return Qd(e, t ?? U.Current, i);
12033
12033
  }
12034
12034
  /**
12035
12035
  * Finds all objects of the specified component type in the scene
@@ -12114,7 +12114,7 @@ class T {
12114
12114
  * including physics, timing utilities, camera, and scene
12115
12115
  */
12116
12116
  get context() {
12117
- return this.__context ?? N.Current;
12117
+ return this.__context ?? U.Current;
12118
12118
  }
12119
12119
  set context(e) {
12120
12120
  this.__context = e;
@@ -12327,7 +12327,7 @@ class T {
12327
12327
  }
12328
12328
  /** @internal */
12329
12329
  __internalEnable(e) {
12330
- return this.__destroyed ? (L() && console.warn("[Needle Engine Dev] Trying to enable destroyed component"), !1) : this.__didAwake ? this.__didEnable ? (e !== !0 && (this.__isEnabled = !0), !1) : (this.__didEnable = !0, this.__isEnabled = !0, this.onEnable(), !0) : !1;
12330
+ return this.__destroyed ? (D() && console.warn("[Needle Engine Dev] Trying to enable destroyed component"), !1) : this.__didAwake ? this.__didEnable ? (e !== !0 && (this.__isEnabled = !0), !1) : (this.__didEnable = !0, this.__isEnabled = !0, this.onEnable(), !0) : !1;
12331
12331
  }
12332
12332
  /** @internal */
12333
12333
  __internalDisable(e) {
@@ -12352,7 +12352,7 @@ class T {
12352
12352
  }
12353
12353
  set enabled(e) {
12354
12354
  if (this.__destroyed) {
12355
- L() && console.warn(`[Needle Engine Dev] Trying to ${e ? "enable" : "disable"} destroyed component`);
12355
+ D() && console.warn(`[Needle Engine Dev] Trying to ${e ? "enable" : "disable"} destroyed component`);
12356
12356
  return;
12357
12357
  }
12358
12358
  if (typeof e == "number" && (e >= 0.5 ? e = !0 : e = !1), !this.__didAwake) {
@@ -12860,7 +12860,7 @@ function EO(s) {
12860
12860
  class YI {
12861
12861
  _context;
12862
12862
  get context() {
12863
- return this._context ?? N.Current;
12863
+ return this._context ?? U.Current;
12864
12864
  }
12865
12865
  get isStateMachineBehaviour() {
12866
12866
  return !0;
@@ -13230,7 +13230,7 @@ class on {
13230
13230
  }
13231
13231
  }
13232
13232
  setStartTransition() {
13233
- this.model.layers.length > 1 && (et || L()) && console.warn("Multiple layers are not supported yet " + this.animator?.name);
13233
+ this.model.layers.length > 1 && (et || D()) && console.warn("Multiple layers are not supported yet " + this.animator?.name);
13234
13234
  for (const e of this.model.layers) {
13235
13235
  const t = e.stateMachine;
13236
13236
  t.defaultState === void 0 && (et && console.warn("AnimatorController default state is undefined, will assign state 0 as default", e), t.defaultState = 0);
@@ -13381,7 +13381,7 @@ Exit Time: ` + c, o.hasExitTime);
13381
13381
  r.conditions || (r.conditions = []);
13382
13382
  if (o.motion || (et && console.warn("No motion", o), o.motion = AO(o.name)), this.animator && o.motion.clips) {
13383
13383
  const r = o.motion.clips?.find((a) => a.node.name === this.animator?.gameObject?.name);
13384
- r ? o.motion.clip = r.clip : (et || L()) && console.warn('Could not find clip for animator "' + this.animator?.gameObject?.name + '"', o.motion.clips.map((a) => a.node.name));
13384
+ r ? o.motion.clip = r.clip : (et || D()) && console.warn('Could not find clip for animator "' + this.animator?.gameObject?.name + '"', o.motion.clips.map((a) => a.node.name));
13385
13385
  }
13386
13386
  if (!o.motion.clip) {
13387
13387
  et && console.warn("No clip assigned to state", o);
@@ -13394,7 +13394,7 @@ Exit Time: ` + c, o.hasExitTime);
13394
13394
  const a = this.createAction(r);
13395
13395
  o.motion.action = a;
13396
13396
  } else
13397
- (et || L()) && console.warn("No valid animationclip assigned", o);
13397
+ (et || D()) && console.warn("No valid animationclip assigned", o);
13398
13398
  }
13399
13399
  if (o.behaviours && Array.isArray(o.behaviours))
13400
13400
  for (const r of o.behaviours) {
@@ -13404,7 +13404,7 @@ Exit Time: ` + c, o.hasExitTime);
13404
13404
  const l = new a();
13405
13405
  l.isStateMachineBehaviour && (l._context = this.context ?? void 0, ya(l, r.properties), r.instance = l), et && console.log("Created animator controller behaviour", o.name, r.typeName, r.properties, l);
13406
13406
  } else
13407
- (et || L()) && console.warn("Could not find AnimatorBehaviour type: " + r.typeName);
13407
+ (et || D()) && console.warn("Could not find AnimatorBehaviour type: " + r.typeName);
13408
13408
  }
13409
13409
  }
13410
13410
  }
@@ -13483,13 +13483,13 @@ class nt {
13483
13483
  rotationWrapper = null;
13484
13484
  context;
13485
13485
  positionChange = new b();
13486
- rotationChange = new $();
13486
+ rotationChange = new N();
13487
13487
  constructor(e, t, i, n, o) {
13488
- if (this.context = e, this.root = t, this.clip = i, nt.firstKeyframeRotation[this.cacheId] || (nt.firstKeyframeRotation[this.cacheId] = new $()), o) {
13488
+ if (this.context = e, this.root = t, this.clip = i, nt.firstKeyframeRotation[this.cacheId] || (nt.firstKeyframeRotation[this.cacheId] = new N()), o) {
13489
13489
  const r = o.values;
13490
13490
  nt.firstKeyframeRotation[this.cacheId].set(r[0], r[1], r[2], r[3]);
13491
13491
  }
13492
- nt.spaceRotation[this.cacheId] || (nt.spaceRotation[this.cacheId] = new $()), nt.effectiveSpaceRotation[this.cacheId] || (nt.effectiveSpaceRotation[this.cacheId] = new $()), nt.clipOffsetRotation[this.cacheId] = new $(), o && nt.clipOffsetRotation[this.cacheId].set(o.values[0], o.values[1], o.values[2], o.values[3]).invert(), this.handlePosition(i, n), this.handleRotation(i, o);
13492
+ nt.spaceRotation[this.cacheId] || (nt.spaceRotation[this.cacheId] = new N()), nt.effectiveSpaceRotation[this.cacheId] || (nt.effectiveSpaceRotation[this.cacheId] = new N()), nt.clipOffsetRotation[this.cacheId] = new N(), o && nt.clipOffsetRotation[this.cacheId].set(o.values[0], o.values[1], o.values[2], o.values[3]).invert(), this.handlePosition(i, n), this.handleRotation(i, o);
13493
13493
  }
13494
13494
  onStart(e) {
13495
13495
  if (e.getClip() !== this.clip) return;
@@ -13515,17 +13515,17 @@ class nt {
13515
13515
  });
13516
13516
  }
13517
13517
  }
13518
- static identityQuaternion = new $();
13518
+ static identityQuaternion = new N();
13519
13519
  handleRotation(e, t) {
13520
13520
  if (t) {
13521
13521
  if (oh) {
13522
- const r = t.values, a = new Rt().setFromQuaternion(new $(r[0], r[1], r[2], r[3]));
13522
+ const r = t.values, a = new Rt().setFromQuaternion(new N(r[0], r[1], r[2], r[3]));
13523
13523
  console.log(e.name, t.name, "FIRST ROTATION IN TRACK", j.toDegrees(a.y));
13524
- const l = t.values.length - 4, c = new $().set(r[l], r[l + 1], r[l + 2], r[l + 3]), h = new Rt().setFromQuaternion(c);
13524
+ const l = t.values.length - 4, c = new N().set(r[l], r[l + 1], r[l + 2], r[l + 3]), h = new Rt().setFromQuaternion(c);
13525
13525
  console.log(e.name, t.name, "LAST ROTATION IN TRACK", j.toDegrees(h.y));
13526
13526
  }
13527
13527
  let i = 0;
13528
- const n = new $(), o = new $();
13528
+ const n = new N(), o = new N();
13529
13529
  this.rotationWrapper = new c_(t, (r, a) => (r > i && (o.set(a[0], a[1], a[2], a[3]), n.invert(), o.multiply(n), this.rotationChange.copy(o)), n.fromArray(a), i = r, a[0] = 0, a[1] = 0, a[2] = 0, a[3] = 1, a));
13530
13530
  }
13531
13531
  }
@@ -13542,7 +13542,7 @@ class IO {
13542
13542
  handler = [];
13543
13543
  root;
13544
13544
  basePosition = new b();
13545
- baseQuaternion = new $();
13545
+ baseQuaternion = new N();
13546
13546
  baseRotation = new Rt();
13547
13547
  constructor(e) {
13548
13548
  this.controller = e;
@@ -13564,7 +13564,7 @@ class IO {
13564
13564
  t.onBeforeUpdate(e);
13565
13565
  }
13566
13566
  summedPosition = new b();
13567
- summedRotation = new $();
13567
+ summedRotation = new N();
13568
13568
  onAfterUpdate(e) {
13569
13569
  if (!(e <= 0)) {
13570
13570
  this.root.position.copy(this.basePosition), this.root.quaternion.copy(this.baseQuaternion), this.summedPosition.set(0, 0, 0), this.summedRotation.set(0, 0, 0, 1);
@@ -13997,7 +13997,7 @@ class Ms extends T {
13997
13997
  const l = $e(this.gameObject).x;
13998
13998
  a.y = r + this._height * l - i, a.z = o.min.z + (o.max.z - o.min.z) * 0.5, ut(this._projection, a);
13999
13999
  }
14000
- rh && F.DrawWireBox3(o, 65280, 5);
14000
+ rh && z.DrawWireBox3(o, 65280, 5);
14001
14001
  }
14002
14002
  this.context.scene.backgroundBlurriness > 1e-3 && this._needsTextureUpdate && this.updateBlurriness(e, this.context.scene.backgroundBlurriness), this._lastBackground = e, this._lastHeight = this._height, this._lastRadius = this._radius, this._needsTextureUpdate = !1;
14003
14003
  }
@@ -14303,13 +14303,13 @@ function $O(s, e, t, i, n) {
14303
14303
  const r = Symbol(o), a = s.__internalAwake;
14304
14304
  s.__internalAwake = function() {
14305
14305
  if (!this.onValidate) {
14306
- L() && console.warn('Usage of @validate decorate detected but there is no onValidate method in your class: "' + s.constructor?.name + '"');
14306
+ D() && console.warn('Usage of @validate decorate detected but there is no onValidate method in your class: "' + s.constructor?.name + '"');
14307
14307
  return;
14308
14308
  }
14309
14309
  if (this[r] === void 0) {
14310
14310
  this[r] = this[o];
14311
14311
  const l = this[o];
14312
- if (l instanceof J || l instanceof b || l instanceof de || l instanceof $) {
14312
+ if (l instanceof J || l instanceof b || l instanceof de || l instanceof N) {
14313
14313
  const c = this[o];
14314
14314
  bm(c, () => {
14315
14315
  this.onValidate(o);
@@ -14521,7 +14521,7 @@ const ei = class Bh extends T {
14521
14521
  this._watch = void 0, this._propertiesChanged = !1;
14522
14522
  }
14523
14523
  onEnable() {
14524
- this._watch || (this._watch = new HO(this.gameObject, this.context)), this._watch.start(!0, !0), this.startCoroutine(this.beforePhysics(), xe.LateUpdate), L() && (globalThis.NEEDLE_USE_RAPIER ? R.RAPIER_PHYSICS.ready().then(async () => {
14524
+ this._watch || (this._watch = new HO(this.gameObject, this.context)), this._watch.start(!0, !0), this.startCoroutine(this.beforePhysics(), xe.LateUpdate), D() && (globalThis.NEEDLE_USE_RAPIER ? R.RAPIER_PHYSICS.ready().then(async () => {
14525
14525
  await Ud(3), this.context.physics.engine?.getBody(this) || console.warn(`Rigidbody could not be created. Ensure "${this.name}" has a Collider component.`);
14526
14526
  }) : console.warn("Rigidbody could not be created: Rapier physics are explicitly disabled."));
14527
14527
  }
@@ -14762,7 +14762,7 @@ class Fn extends T {
14762
14762
  receivedDataCallback = null;
14763
14763
  /** @internal */
14764
14764
  awake() {
14765
- Vs && console.log("new instance", this.guid, this), this._receivedDataBefore = !1, this._targetPosition = new b(), this._targetRotation = new $(), this.lastPosition = new b(), this.lastRotation = new $(), this.lastScale = new b(), this.rb = S.getComponentInChildren(this.gameObject, ft), this.rb && (this._wasKinematic = this.rb.isKinematic), this.receivedUpdate = !0, this._model = new i0(this.context.connection, this.guid), this.context.connection.isConnected && this.tryGetLastState(), this.joinedRoomCallback = this.tryGetLastState.bind(this), this.context.connection.beginListen(ee.JoinedRoom, this.joinedRoomCallback), this.receivedDataCallback = this.onReceivedData.bind(this), this.context.connection.beginListenBinary(lc, this.receivedDataCallback);
14765
+ Vs && console.log("new instance", this.guid, this), this._receivedDataBefore = !1, this._targetPosition = new b(), this._targetRotation = new N(), this.lastPosition = new b(), this.lastRotation = new N(), this.lastScale = new b(), this.rb = S.getComponentInChildren(this.gameObject, ft), this.rb && (this._wasKinematic = this.rb.isKinematic), this.receivedUpdate = !0, this._model = new i0(this.context.connection, this.guid), this.context.connection.isConnected && this.tryGetLastState(), this.joinedRoomCallback = this.tryGetLastState.bind(this), this.context.connection.beginListen(ee.JoinedRoom, this.joinedRoomCallback), this.receivedDataCallback = this.onReceivedData.bind(this), this.context.connection.beginListenBinary(lc, this.receivedDataCallback);
14766
14766
  }
14767
14767
  /** @internal */
14768
14768
  onDestroy() {
@@ -15031,7 +15031,7 @@ class me {
15031
15031
  if (l) {
15032
15032
  const c = o.arguments?.map((h) => h instanceof Object && h.uuid ? e[h.uuid] : h?.isComponent ? e[h.guid] : h);
15033
15033
  t.push(new Qs(l.clone, o.methodName, c, o.enabled));
15034
- } else L() && console.warn("Could not find target for event listener");
15034
+ } else D() && console.warn("Could not find target for event listener");
15035
15035
  }
15036
15036
  }
15037
15037
  }
@@ -15154,7 +15154,7 @@ class QO extends Xi {
15154
15154
  if (e.endsWith(".glb") || e.endsWith(".gltf")) {
15155
15155
  if (t.serializable instanceof Array && t.serializable.includes(ie))
15156
15156
  return;
15157
- L() && ge("Detected wrong usage of @serializable with Object3D or GameObject. Instead you should use AssetReference here! Please see the console for details.");
15157
+ D() && ge("Detected wrong usage of @serializable with Object3D or GameObject. Instead you should use AssetReference here! Please see the console for details.");
15158
15158
  const i = t.target?.constructor?.name;
15159
15159
  console.warn(`Wrong usage of @serializable detected in your script "${i}"
15160
15160
 
@@ -15179,7 +15179,7 @@ ${t.path}! : AssetReference;
15179
15179
  }
15180
15180
  let i;
15181
15181
  const n = t.gltf?.scene;
15182
- return n && (i = S.findByGuid(e.guid, n)), i || (i = S.findByGuid(e.guid, t.context.scene)), i ? (i && i.isComponent === !0 && (dt && console.warn("Deserialized object reference is a component"), i = i.gameObject), dt && console.log("Deserialized object reference?", e, i, t?.nodeToObject)) : ((L() || dt) && console.warn("Could not resolve object reference", t.path, e, t.target, t.context.scene), e.could_not_resolve = !0), i;
15182
+ return n && (i = S.findByGuid(e.guid, n)), i || (i = S.findByGuid(e.guid, t.context.scene)), i ? (i && i.isComponent === !0 && (dt && console.warn("Deserialized object reference is a component"), i = i.gameObject), dt && console.log("Deserialized object reference?", e, i, t?.nodeToObject)) : ((D() || dt) && console.warn("Could not resolve object reference", t.path, e, t.target, t.context.scene), e.could_not_resolve = !0), i;
15183
15183
  }
15184
15184
  }
15185
15185
  }
@@ -15204,7 +15204,7 @@ class KO extends Xi {
15204
15204
  let n = this.findObjectForGuid(e.guid, t.root);
15205
15205
  if (n || t.context && (n = this.findObjectForGuid(e.guid, t.context?.scene), n))
15206
15206
  return n;
15207
- (L() || dt) && console.warn('Could not resolve component reference: "' + i + '" using guid ' + e.guid, t.target), e.could_not_resolve = !0;
15207
+ (D() || dt) && console.warn('Could not resolve component reference: "' + i + '" using guid ' + e.guid, t.target), e.could_not_resolve = !0;
15208
15208
  return;
15209
15209
  }
15210
15210
  }
@@ -15271,7 +15271,7 @@ Could not find method ${r.method} on object ${l.name}`, l, typeof l[r.method]);
15271
15271
  }
15272
15272
  p = Object.getPrototypeOf(p);
15273
15273
  }
15274
- !f && (L() || dt) && h();
15274
+ !f && (D() || dt) && h();
15275
15275
  }
15276
15276
  }
15277
15277
  if (l) {
@@ -15283,7 +15283,7 @@ Could not find method ${r.method} on object ${l.name}`, l, typeof l[r.method]);
15283
15283
  const f = new Qs(l, r.method, h, r.enabled);
15284
15284
  i.push(f);
15285
15285
  }
15286
- } else L() && console.warn(`[Dev] EventList: Could not find event listener in scene (${t.object?.name})`, r);
15286
+ } else D() && console.warn(`[Dev] EventList: Could not find event listener in scene (${t.object?.name})`, r);
15287
15287
  }
15288
15288
  const n = new me(i);
15289
15289
  dt && console.log(n);
@@ -15498,7 +15498,7 @@ class Jt extends T {
15498
15498
  }
15499
15499
  /** Get the currently active event system */
15500
15500
  static get instance() {
15501
- return this.get(N.Current);
15501
+ return this.get(U.Current);
15502
15502
  }
15503
15503
  raycaster = [];
15504
15504
  register(e) {
@@ -15768,7 +15768,7 @@ class Jt extends T {
15768
15768
  const n = this._capturedPointer[i] || [];
15769
15769
  n.push(t), this._capturedPointer[i] = n;
15770
15770
  } else
15771
- L() && !t.z__warned_no_pointermove && (t.z__warned_no_pointermove = !0, console.warn("PointerCapture was requested but the component doesn't implement onPointerMove. It will not receive any pointer events"));
15771
+ D() && !t.z__warned_no_pointermove && (t.z__warned_no_pointermove = !0, console.warn("PointerCapture was requested but the component doesn't implement onPointerMove. It will not receive any pointer events"));
15772
15772
  } else e.z__pointer_cture_rleased && (e.z__pointer_cture_rleased = !1, this.releasePointerCapture(e, t));
15773
15773
  }
15774
15774
  /** removes the component from the pointer capture list */
@@ -16064,7 +16064,7 @@ class ye extends T {
16064
16064
  this._controls.target.copy(l);
16065
16065
  }
16066
16066
  if (this._controls)
16067
- if (bf && (this.enablePan = !0, this.enableZoom = !0, this.middleClickToFocus = !0, X.isMobileDevice() && (this.doubleClickToFocus = !0)), this._controls.addEventListener("start", this.onControlsChangeStarted), this._controls.addEventListener("endMovement", this.onControlsChangeEnded), !this._startedListeningToKeyEvents && this.enableKeys)
16067
+ if (bf && (this.enablePan = !0, this.enableZoom = !0, this.middleClickToFocus = !0, q.isMobileDevice() && (this.doubleClickToFocus = !0)), this._controls.addEventListener("start", this.onControlsChangeStarted), this._controls.addEventListener("endMovement", this.onControlsChangeEnded), !this._startedListeningToKeyEvents && this.enableKeys)
16068
16068
  this._startedListeningToKeyEvents = !0, this._controls.listenToKeyEvents(this.context.domElement);
16069
16069
  else
16070
16070
  try {
@@ -16117,7 +16117,7 @@ class ye extends T {
16117
16117
  };
16118
16118
  updateTargetNow(e) {
16119
16119
  const t = new lo(this._cameraObject?.worldPosition, this._cameraObject?.worldForward.multiplyScalar(-1)), i = this.context.physics.raycastFromRay(t, e), n = i.length > 0 ? i[0] : void 0;
16120
- n && n.distance > this.minZoom && n.distance < this.maxZoom && (Ai && F.DrawWireSphere(n.point, 0.1, 16711680, 2), this._controls?.target.copy(i[0].point));
16120
+ n && n.distance > this.minZoom && n.distance < this.maxZoom && (Ai && z.DrawWireSphere(n.point, 0.1, 16711680, 2), this._controls?.target.copy(i[0].point));
16121
16121
  }
16122
16122
  _orbitStartAngle = 0;
16123
16123
  _zoomStartDistance = 0;
@@ -16149,7 +16149,7 @@ class ye extends T {
16149
16149
  if (t && !this.setLookTargetFromConstraint()) {
16150
16150
  this.debugLog && console.log("NO TARGET");
16151
16151
  const i = Z(t.threeCamera), n = Math.max(0.01, i.length()), o = new b(0, 0, -n).applyMatrix4(t.threeCamera.matrixWorld);
16152
- Ai && F.DrawLine(i, o, 5592575, 10), this.setLookTargetPosition(o, !0);
16152
+ Ai && z.DrawLine(i, o, 5592575, 10), this.setLookTargetPosition(o, !0);
16153
16153
  }
16154
16154
  if (!this.setLookTargetFromConstraint()) {
16155
16155
  const i = new mr();
@@ -16190,7 +16190,7 @@ class ye extends T {
16190
16190
  const t = typeof ah == "number" ? ah : 0.99;
16191
16191
  this._controls.dampingFactor = Math.max(1e-3, 1 - Math.min(1, t));
16192
16192
  }
16193
- this.allowInterrupt || (this._lookTargetLerpActive && (this._controls.enablePan = !1), this._cameraLerpActive && (this._controls.enableRotate = !1, this._controls.autoRotate = !1), (this._lookTargetLerpActive || this._cameraLerpActive) && (this._controls.enableZoom = !1)), this.context.isInXR || (!bf && this.lookAtConstraint?.locked && !this._lookTargetLerpActive && this.setLookTargetFromConstraint(0, this.lookAtConstraint01), this._controls.update(this.context.time.deltaTime), Ai && F.DrawWireSphere(this._controls.target, 0.1, 65280));
16193
+ this.allowInterrupt || (this._lookTargetLerpActive && (this._controls.enablePan = !1), this._cameraLerpActive && (this._controls.enableRotate = !1, this._controls.autoRotate = !1), (this._lookTargetLerpActive || this._cameraLerpActive) && (this._controls.enableZoom = !1)), this.context.isInXR || (!bf && this.lookAtConstraint?.locked && !this._lookTargetLerpActive && this.setLookTargetFromConstraint(0, this.lookAtConstraint01), this._controls.update(this.context.time.deltaTime), Ai && z.DrawWireSphere(this._controls.target, 0.1, 65280));
16194
16194
  }
16195
16195
  }
16196
16196
  __onPreRender = () => {
@@ -16212,14 +16212,14 @@ class ye extends T {
16212
16212
  */
16213
16213
  setCameraAndLookTarget(e, t = !1) {
16214
16214
  if (!e)
16215
- return (L() || Ai) && console.warn("[OrbitControls] setCameraAndLookTarget target is null"), !1;
16215
+ return (D() || Ai) && console.warn("[OrbitControls] setCameraAndLookTarget target is null"), !1;
16216
16216
  if (!(e instanceof M) && !(e instanceof ui))
16217
- return (L() || Ai) && console.warn("[OrbitControls] setCameraAndLookTarget target is not an Object3D or Camera"), !1;
16217
+ return (D() || Ai) && console.warn("[OrbitControls] setCameraAndLookTarget target is not an Object3D or Camera"), !1;
16218
16218
  e instanceof ui && (e = e.gameObject);
16219
16219
  const i = e.worldPosition, n = e.worldForward;
16220
16220
  e instanceof ax && (Ai && console.debug("[OrbitControls] setCameraAndLookTarget flip forward direction for camera"), n.multiplyScalar(-1));
16221
16221
  const o = new lo(i, n);
16222
- return Ai && F.DrawRay(o.origin, o.direction, 16711680, 10), this.setTargetFromRaycast(o, t) || this.setLookTargetPosition(o.at(2, G()), t), this.setCameraTargetPosition(i, t), !0;
16222
+ return Ai && z.DrawRay(o.origin, o.direction, 16711680, 10), this.setTargetFromRaycast(o, t) || this.setLookTargetPosition(o.at(2, G()), t), this.setCameraTargetPosition(i, t), !0;
16223
16223
  }
16224
16224
  /** Moves the camera to position smoothly.
16225
16225
  * @param position The position in local space of the controllerObject to move the camera to. If null the camera will stop lerping to the target.
@@ -16270,7 +16270,7 @@ class ye extends T {
16270
16270
  * @param immediateOrDuration If true the camera target will move immediately to the new position, otherwise it will lerp. If a number is passed in it will be used as the duration of the lerp.
16271
16271
  */
16272
16272
  setLookTargetPosition(e = null, t = !1) {
16273
- this._controls && e && (e instanceof M && (e = Z(e)), this._lookTargetEndPosition.copy(e), this._didSetTarget++, Ai && (console.warn("OrbitControls: setLookTargetPosition", e, t), F.DrawWireSphere(this._lookTargetEndPosition, 0.2, 16711680, 2)), t === !0 ? this.lerpLookTarget(this._lookTargetEndPosition, this._lookTargetEndPosition, 1) : (this._lookTargetLerpActive = !0, this._lookTargetLerp01 = 0, this._lookTargetStartPosition.copy(this._controls.target), typeof t == "number" ? this._lookTargetLerpDuration = t : this._lookTargetLerpDuration = this.targetLerpDuration));
16273
+ this._controls && e && (e instanceof M && (e = Z(e)), this._lookTargetEndPosition.copy(e), this._didSetTarget++, Ai && (console.warn("OrbitControls: setLookTargetPosition", e, t), z.DrawWireSphere(this._lookTargetEndPosition, 0.2, 16711680, 2)), t === !0 ? this.lerpLookTarget(this._lookTargetEndPosition, this._lookTargetEndPosition, 1) : (this._lookTargetLerpActive = !0, this._lookTargetLerp01 = 0, this._lookTargetStartPosition.copy(this._controls.target), typeof t == "number" ? this._lookTargetLerpDuration = t : this._lookTargetLerpDuration = this.targetLerpDuration));
16274
16274
  }
16275
16275
  /** True while the camera look target is being lerped */
16276
16276
  get lookTargetLerpActive() {
@@ -16310,8 +16310,10 @@ class ye extends T {
16310
16310
  return !1;
16311
16311
  }
16312
16312
  fitCamera(e, t) {
16313
- if (this.context.isInXR)
16313
+ if (this.context.isInXR) {
16314
+ console.warn("[OrbitControls] Can not fit camera while XR session is active");
16314
16315
  return;
16316
+ }
16315
16317
  let i;
16316
16318
  if (Array.isArray(e) ? i = e : e && "type" in e ? i = e.children : e && typeof e == "object" && !(e instanceof M) && !Array.isArray(e) && (t = e, i = t.objects), i && !Array.isArray(i) && (i = i.children), (!Array.isArray(i) || i && i.length <= 0) && (i = this.context.scene.children), !Array.isArray(i) || i.length <= 0) {
16317
16319
  console.warn("No objects to fit camera to...");
@@ -16323,7 +16325,7 @@ class ye extends T {
16323
16325
  return;
16324
16326
  }
16325
16327
  t || (t = {});
16326
- const { immediate: r = !1, centerCamera: a = "y", cameraNearFar: l = "auto", fitOffset: c = 1.1, fov: h = n?.fov } = t, d = new b(), f = new b(), p = _i(i, void 0, this._camera?.threeCamera?.layers), g = p.clone();
16328
+ const { immediate: r = !1, centerCamera: a, cameraNearFar: l = "auto", fitOffset: c = 1.1, fov: h = n?.fov } = t, d = new b(), f = new b(), p = _i(i, void 0, this._camera?.threeCamera?.layers), g = p.clone();
16327
16329
  n.updateMatrixWorld(), n.updateProjectionMatrix(), p.getCenter(f);
16328
16330
  const _ = new b();
16329
16331
  if (p.getSize(_), p.applyMatrix4(n.matrixWorldInverse), p.getSize(d), p.setFromCenterAndSize(f, d), Number.isNaN(d.x) || Number.isNaN(d.y) || Number.isNaN(d.z)) {
@@ -16337,21 +16339,21 @@ class ye extends T {
16337
16339
  const m = h, v = 2 * Math.atan(Math.tan(m * Math.PI / 360 / 2) * n.aspect) / Math.PI * 360, y = d.y / (2 * Math.atan(Math.PI * m / 360)), x = d.x / (2 * Math.atan(Math.PI * v / 360)), I = c * Math.max(y, x) + d.z / 2;
16338
16340
  nl && console.log("Fit camera to objects", { fitHeightDistance: y, fitWidthDistance: x, distance: I, verticalFov: m, horizontalFov: v }), this.maxZoom = I * 10, this.minZoom = I * 0.01;
16339
16341
  const O = 0.05, k = f.clone();
16340
- if (k.y -= d.y * O, this.setLookTargetPosition(k, r), this.setFieldOfView(t.fov, r), l == null || l == "auto") {
16341
- const q = S.findObjectOfType(Ms), A = q ? q.radius : 0, U = Math.max(_.x, _.y, _.z, A);
16342
- n.near = I / 100, n.far = U + I * 10, q && (this.maxZoom = Math.max(Math.min(this.maxZoom, A * 0.5), I));
16342
+ if (k.y -= d.y * O, t.targetOffset && (t.targetOffset.x !== void 0 && (k.x += t.targetOffset.x), t.targetOffset.y !== void 0 && (k.y += t.targetOffset.y), t.targetOffset.z !== void 0 && (k.z += t.targetOffset.z)), t.relativeTargetOffset && (t.relativeTargetOffset.x !== void 0 && (k.x += t.relativeTargetOffset.x * d.x), t.relativeTargetOffset.y !== void 0 && (k.y += t.relativeTargetOffset.y * d.y), t.relativeTargetOffset.z !== void 0 && (k.z += t.relativeTargetOffset.z * d.z)), this.setLookTargetPosition(k, r), this.setFieldOfView(t.fov, r), l == null || l == "auto") {
16343
+ const W = S.findObjectOfType(Ms), X = W ? W.radius : 0, A = Math.max(_.x, _.y, _.z, X);
16344
+ n.near = I / 100, n.far = A + I * 10, W && (this.maxZoom = Math.max(Math.min(this.maxZoom, X * 0.5), I));
16343
16345
  }
16344
16346
  const E = o.getDistance();
16345
16347
  E < this.minZoom && (this.minZoom = E * 0.9), E > this.maxZoom && (this.maxZoom = E * 1.1), n.updateMatrixWorld(), n.updateProjectionMatrix();
16346
- const z = Z(n), D = f.clone();
16347
- D.sub(z), a === "y" && (D.y = 0), D.normalize(), D.multiplyScalar(I), a === "y" && (D.y += -O * 4 * I);
16348
- let V = f.clone().sub(D);
16349
- n.parent && (V = n.parent.worldToLocal(V)), this.setCameraTargetPosition(V, r), (nl || t.debug) && (F.DrawWireBox3(p, 16777011, 10), F.DrawWireBox3(g, 65280, 10), !this._haveAttachedKeyboardEvents && nl && (this._haveAttachedKeyboardEvents = !0, document.body.addEventListener("keydown", (q) => {
16350
- if (q.code === "KeyF") {
16351
- let A;
16352
- this._cameraObject instanceof pe && (A = Math.random() * Math.random() * 170 + 10), this.fitCamera({ objects: i, fitOffset: c, immediate: !1, fov: A });
16353
- }
16354
- q.code === "KeyV" && this._cameraObject instanceof pe && (this._cameraObject.fov = 60);
16348
+ const B = f.clone();
16349
+ t.fitDirection ? B.sub(new b().copy(t.fitDirection).multiplyScalar(1e6)) : B.sub(n.worldPosition), a === "y" && (B.y = 0), B.normalize(), B.multiplyScalar(I), a === "y" && (B.y += -O * 4 * I);
16350
+ let L = f.clone().sub(B);
16351
+ t.cameraOffset && (t.cameraOffset.x !== void 0 && (L.x += t.cameraOffset.x), t.cameraOffset.y !== void 0 && (L.y += t.cameraOffset.y), t.cameraOffset.z !== void 0 && (L.z += t.cameraOffset.z)), t.relativeCameraOffset && (t.relativeCameraOffset.x !== void 0 && (L.x += t.relativeCameraOffset.x * d.x), t.relativeCameraOffset.y !== void 0 && (L.y += t.relativeCameraOffset.y * d.y), t.relativeCameraOffset.z !== void 0 && (L.z += t.relativeCameraOffset.z * d.z)), n.parent && (L = n.parent.worldToLocal(L)), this.setCameraTargetPosition(L, r), (nl || t.debug) && (z.DrawWireBox3(p, 16777011, 10), z.DrawWireBox3(g, 65280, 10), !this._haveAttachedKeyboardEvents && nl && (this._haveAttachedKeyboardEvents = !0, document.body.addEventListener("keydown", (W) => {
16352
+ if (W.code === "KeyF") {
16353
+ let X;
16354
+ this._cameraObject instanceof pe && (X = Math.random() * Math.random() * 170 + 10), this.fitCamera({ objects: i, fitOffset: c, immediate: !1, fov: X });
16355
+ }
16356
+ W.code === "KeyV" && this._cameraObject instanceof pe && (this._cameraObject.fov = 60);
16355
16357
  }))), this.onBeforeRender();
16356
16358
  }
16357
16359
  _haveAttachedKeyboardEvents = !1;
@@ -16650,7 +16652,7 @@ const Gs = w("debugcam"), u_ = w("debugscreenpointtoray"), Lt = class Sl extends
16650
16652
  const t = e.clientX, i = e.clientY;
16651
16653
  console.log("touch", t.toFixed(2), i.toFixed(2));
16652
16654
  const n = this.screenPointToRay(t, i), o = "#" + Math.floor(Math.random() * 16777215).toString(16);
16653
- F.DrawRay(n.origin, n.direction, o, 10);
16655
+ z.DrawRay(n.origin, n.direction, o, 10);
16654
16656
  });
16655
16657
  }
16656
16658
  /** @internal */
@@ -16661,6 +16663,9 @@ const Gs = w("debugcam"), u_ = w("debugscreenpointtoray"), Lt = class Sl extends
16661
16663
  onDisable() {
16662
16664
  this.context.removeCamera(this);
16663
16665
  }
16666
+ onLeaveXR(e) {
16667
+ this.fieldOfView = this._fov;
16668
+ }
16664
16669
  /** @internal */
16665
16670
  onBeforeRender() {
16666
16671
  if (this._cam && (this._frustum && this.updateFrustum(), this._clearFlags === 2 && this.applyClearFlagsIfIsActiveCamera(), this._targetTexture)) {
@@ -16707,7 +16712,7 @@ const Gs = w("debugcam"), u_ = w("debugscreenpointtoray"), Lt = class Sl extends
16707
16712
  Gs && console.log("Camera does not exist (apply clear flags)");
16708
16713
  return;
16709
16714
  }
16710
- if (this.fieldOfView = this._fov, Gs) {
16715
+ if (this.fieldOfView = this.fieldOfView, Gs) {
16711
16716
  const i = `[Camera] Apply ClearFlags: ${sa[this._clearFlags]} - "${this.name}"`;
16712
16717
  console.debug(i);
16713
16718
  }
@@ -17066,7 +17071,7 @@ const bt = w("debugaudio"), Qi = class qs extends T {
17066
17071
  onVisibilityChanged = () => {
17067
17072
  switch (document.visibilityState) {
17068
17073
  case "hidden":
17069
- (this.playInBackground === !1 || X.isMobileDevice()) && (this.wasPlaying = this.isPlaying, this.isPlaying && this.pause());
17074
+ (this.playInBackground === !1 || q.isMobileDevice()) && (this.wasPlaying = this.isPlaying, this.isPlaying && this.pause());
17070
17075
  break;
17071
17076
  case "visible":
17072
17077
  bt && console.log("visible", this.enabled, this.playOnAwake, !this.isPlaying, qs.userInteractionRegistered, this.wasPlaying), this.enabled && this.playOnAwake && !this.isPlaying && qs.userInteractionRegistered && this.wasPlaying && this.play();
@@ -17132,7 +17137,7 @@ const bt = w("debugaudio"), Qi = class qs extends T {
17132
17137
  * @param clip - Optional audio clip or {@link MediaStream} to play
17133
17138
  */
17134
17139
  play(e = void 0) {
17135
- !e && this.clip && (e = this.clip), e !== void 0 && typeof e != "string" && !(e instanceof MediaStream) && (L() && console.warn("Called play on AudioSource with unknown argument type:", e + `
17140
+ !e && this.clip && (e = this.clip), e !== void 0 && typeof e != "string" && !(e instanceof MediaStream) && (D() && console.warn("Called play on AudioSource with unknown argument type:", e + `
17136
17141
  Using the assigned clip instead:`, this.clip), e = this.clip);
17137
17142
  let t = !this.sound || e && e !== this.clip;
17138
17143
  if (typeof e == "string" && !this.audioLoader && (t = !0), (e instanceof MediaStream || typeof e == "string") && (this.clip = e), t) {
@@ -17244,7 +17249,7 @@ class oa {
17244
17249
  if (t) {
17245
17250
  for (const i of this.Pois)
17246
17251
  if (i.obj === t) {
17247
- this.Pois.splice(this.Pois.indexOf(i), 1), this.LastChangeTime = e?.time.time ?? N.Current?.time.time;
17252
+ this.Pois.splice(this.Pois.indexOf(i), 1), this.LastChangeTime = e?.time.time ?? U.Current?.time.time;
17248
17253
  return;
17249
17254
  }
17250
17255
  }
@@ -17624,7 +17629,7 @@ class tu extends um {
17624
17629
  e = i.context, t = eo.getOrCreate(i.context, i.guid);
17625
17630
  } else typeof t == "string" && (t = eo.getOrCreate(e, t));
17626
17631
  if (e) {
17627
- if (!(e instanceof N)) throw new Error("Failed to create NetworkedStreams because context is not an instance of Context");
17632
+ if (!(e instanceof U)) throw new Error("Failed to create NetworkedStreams because context is not an instance of Context");
17628
17633
  } else throw new Error("Failed to create NetworkedStreams because context is undefined");
17629
17634
  if (!t) throw new Error("Failed to create NetworkedStreams because peer is undefined");
17630
17635
  this.context = e, this.peer = t, Le && (this.debug = !0);
@@ -17807,10 +17812,10 @@ class _r extends T {
17807
17812
  if (!this._net)
17808
17813
  return console.error("Cannot connect to voice chat - NetworkedStreams not initialized. Make sure the component is enabled before calling this method."), !1;
17809
17814
  if (this.context.connection.isConnected) {
17810
- if (!await X.microphonePermissionsGranted())
17815
+ if (!await q.microphonePermissionsGranted())
17811
17816
  return console.error("Cannot connect to voice chat - microphone permissions not granted"), this.updateButton(), !1;
17812
17817
  } else return console.error("Cannot connect to voice chat - not connected to server"), this.updateButton(), !1;
17813
- return this._allowSending = !0, this._net?.stopSendingStream(this._outputStream), ms(this._outputStream), this._outputStream = await this.getAudioStream(e), this._outputStream ? (this.debug && console.log("VOIP: Got audio stream"), this._net?.startSendingStream(this._outputStream), this.updateButton(), !0) : (this.updateButton(), await X.microphonePermissionsGranted() ? console.error("VOIP: Could not get audio stream - please make sure to connect an audio device and grant microphone permissions") : Wd("Microphone permissions not granted: Please grant microphone permissions to use voice chat"), (this.debug || L()) && console.log("VOIP: Failed to get audio stream"), !1);
17818
+ return this._allowSending = !0, this._net?.stopSendingStream(this._outputStream), ms(this._outputStream), this._outputStream = await this.getAudioStream(e), this._outputStream ? (this.debug && console.log("VOIP: Got audio stream"), this._net?.startSendingStream(this._outputStream), this.updateButton(), !0) : (this.updateButton(), await q.microphonePermissionsGranted() ? console.error("VOIP: Could not get audio stream - please make sure to connect an audio device and grant microphone permissions") : Wd("Microphone permissions not granted: Please grant microphone permissions to use voice chat"), (this.debug || D()) && console.log("VOIP: Failed to get audio stream"), !1);
17814
17819
  }
17815
17820
  /** Stop sending audio (muting your own microphone) */
17816
17821
  disconnect(e) {
@@ -17838,27 +17843,27 @@ class _r extends T {
17838
17843
  async updateButton() {
17839
17844
  if (this.createMenuButton) {
17840
17845
  if (this._menubutton || (this._menubutton = document.createElement("button"), this._menubutton.addEventListener("click", () => {
17841
- this.isSending ? this.disconnect({ remember: !0 }) : this.connect(), X.microphonePermissionsGranted().then((e) => {
17846
+ this.isSending ? this.disconnect({ remember: !0 }) : this.connect(), q.microphonePermissionsGranted().then((e) => {
17842
17847
  e || ge("<strong>Microphone permissions not granted</strong>. Please allow your browser to use the microphone to be able to talk. Click on the button on the left side of your browser's address bar to allow microphone permissions.");
17843
17848
  });
17844
17849
  })), this._menubutton) {
17845
17850
  this.context.menu.appendChild(this._menubutton), this.activeAndEnabled ? this._menubutton.style.display = "" : this._menubutton.style.display = "none", this._menubutton.title = this.isSending ? "Click to disable your microphone" : "Click to enable your microphone";
17846
17851
  let e = (this.isSending, ""), t = this.isSending ? "mic" : "mic_off";
17847
- await X.microphonePermissionsGranted() || (e = "No Permission", t = "mic_off", this._menubutton.title = "Microphone permissions not granted. Please allow your browser to use the microphone to be able to talk. This can usually be done in the addressbar of the webpage."), this._menubutton.innerText = e, this._menubutton.prepend(Mt(t)), this.context.connection.isConnected == !1 ? this._menubutton.setAttribute("disabled", "") : this._menubutton.removeAttribute("disabled");
17852
+ await q.microphonePermissionsGranted() || (e = "No Permission", t = "mic_off", this._menubutton.title = "Microphone permissions not granted. Please allow your browser to use the microphone to be able to talk. This can usually be done in the addressbar of the webpage."), this._menubutton.innerText = e, this._menubutton.prepend(Mt(t)), this.context.connection.isConnected == !1 ? this._menubutton.setAttribute("disabled", "") : this._menubutton.removeAttribute("disabled");
17848
17853
  }
17849
17854
  } else this.activeAndEnabled || this._menubutton?.remove();
17850
17855
  }
17851
17856
  // private _analyzer?: AudioAnalyser;
17852
17857
  /** @deprecated */
17853
17858
  getFrequency(e) {
17854
- return this.unsupported_getfrequency || (this.unsupported_getfrequency = !0, L() && ge("VOIP: getFrequency is currently not supported"), console.warn("VOIP: getFrequency is currently not supported")), null;
17859
+ return this.unsupported_getfrequency || (this.unsupported_getfrequency = !0, D() && ge("VOIP: getFrequency is currently not supported"), console.warn("VOIP: getFrequency is currently not supported")), null;
17855
17860
  }
17856
17861
  async getAudioStream(e) {
17857
17862
  if (!navigator.mediaDevices.getUserMedia)
17858
17863
  return console.error("No getDisplayMedia support"), null;
17859
17864
  const t = async (n) => await navigator.mediaDevices.getUserMedia({ audio: n ?? !0, video: !1 }).catch((o) => (console.warn("VOIP failed getting audio stream", o), null)), i = await t(e);
17860
17865
  if (!i) return null;
17861
- if (X.isiOS() && e?.deviceId === void 0) {
17866
+ if (q.isiOS() && e?.deviceId === void 0) {
17862
17867
  const o = (await navigator.mediaDevices.enumerateDevices()).find((r) => (r.kind === "audioinput" || r.kind === "audiooutput") && !r.label.includes("iPhone"));
17863
17868
  if (o) {
17864
17869
  const r = Object.assign({}, e);
@@ -18232,7 +18237,7 @@ class Ct extends T {
18232
18237
  }
18233
18238
  this.updateBox();
18234
18239
  const t = this.box?.intersectsBox(Ct.testBox);
18235
- return t && jk && F.DrawWireBox3(Ct.testBox, 16711680, 5), t;
18240
+ return t && jk && z.DrawWireBox3(Ct.testBox, 16711680, 5), t;
18236
18241
  }
18237
18242
  /**
18238
18243
  * Tests if this helper's bounding box intersects with another box
@@ -18419,7 +18424,7 @@ const Zm = class J0 extends wi {
18419
18424
  const t = this.gameObject, i = t.position.clone(), n = t.quaternion.clone(), o = t.scale.clone(), r = t.parent;
18420
18425
  t.position.set(0, 0, 0), t.quaternion.set(0, 0, 0, 1), t.scale.set(1, 1, 1), t.parent = null, t.updateMatrix();
18421
18426
  const a = _i([t]);
18422
- t.position.copy(i), t.quaternion.copy(n), t.scale.copy(o), t.parent = r, e?.debug === !0 && F.DrawWireBox3(a, 16768256, 20), this.size = a.getSize(new b()) || new b(1, 1, 1), this.center = a.getCenter(new b()) || new b(0, 0, 0), this.size.length() <= 0 && this.size.set(0.01, 0.01, 0.01);
18427
+ t.position.copy(i), t.quaternion.copy(n), t.scale.copy(o), t.parent = r, e?.debug === !0 && z.DrawWireBox3(a, 16768256, 20), this.size = a.getSize(new b()) || new b(1, 1, 1), this.center = a.getCenter(new b()) || new b(0, 0, 0), this.size.length() <= 0 && this.size.set(0.01, 0.01, 0.01);
18423
18428
  }
18424
18429
  };
18425
18430
  ti([
@@ -18462,7 +18467,7 @@ class br extends wi {
18462
18467
  r && this.activeAndEnabled && (o.geometry = r, this.context.physics.engine?.addMeshCollider(this, o, this.convex));
18463
18468
  });
18464
18469
  } else
18465
- (L() || w("showcolliders")) && console.warn(`[MeshCollider] A MeshCollider mesh is assigned to an unknown object on "${this.gameObject.name}", but it's neither a Mesh nor a Group. Please double check that you attached the collider component to the right object and report a bug otherwise!`, this);
18470
+ (D() || w("showcolliders")) && console.warn(`[MeshCollider] A MeshCollider mesh is assigned to an unknown object on "${this.gameObject.name}", but it's neither a Mesh nor a Group. Please double check that you attached the collider component to the right object and report a bug otherwise!`, this);
18466
18471
  }
18467
18472
  }
18468
18473
  }
@@ -18559,7 +18564,7 @@ class mo extends T {
18559
18564
  animator;
18560
18565
  lookForward = !0;
18561
18566
  awake() {
18562
- this._currentRotation = new $();
18567
+ this._currentRotation = new N();
18563
18568
  }
18564
18569
  update() {
18565
18570
  const e = this.context.input;
@@ -18652,7 +18657,7 @@ const vr = class Cl extends T {
18652
18657
  * @returns The instance of the contact shadows.
18653
18658
  */
18654
18659
  static auto(e) {
18655
- if (e || (e = N.Current), !e)
18660
+ if (e || (e = U.Current), !e)
18656
18661
  throw new Error("No context provided and no current context set.");
18657
18662
  let t = this._instances.get(e);
18658
18663
  if (!t || t.destroyed) {
@@ -18711,7 +18716,7 @@ const vr = class Cl extends T {
18711
18716
  fitShadows() {
18712
18717
  sl && console.warn("Fitting shadows to scene"), cp(this.shadowsRoot, !1);
18713
18718
  const e = _i(this.context.scene.children, [this.shadowsRoot]), t = Math.max(1, this.blur / 32), i = e.max.x - e.min.x, n = e.max.z - e.min.z;
18714
- e.expandByVector(new b(t * i, 0, t * n)), sl && F.DrawWireBox3(e, 16776960, 60), this.gameObject.parent && e.applyMatrix4(this.gameObject.parent.matrixWorld.clone().invert());
18719
+ e.expandByVector(new b(t * i, 0, t * n)), sl && z.DrawWireBox3(e, 16776960, 60), this.gameObject.parent && e.applyMatrix4(this.gameObject.parent.matrixWorld.clone().invert());
18715
18720
  const o = e.min, r = Math.max(1e-5, (e.max.y - o.y) * 2e-3);
18716
18721
  e.max.y += r, this.shadowsRoot.position.set((o.x + e.max.x) / 2, o.y - r, (o.z + e.max.z) / 2), this.shadowsRoot.scale.set(e.max.x - o.x, e.max.y - o.y, e.max.z - o.z), this.applyMinSize(), this.shadowsRoot.matrixWorldNeedsUpdate = !0, sl && console.log("Fitted shadows to scene", this.shadowsRoot.scale.clone());
18717
18722
  }
@@ -18872,7 +18877,7 @@ class iv extends T {
18872
18877
  try {
18873
18878
  if (e.box) {
18874
18879
  const o = e.box, r = Ct.testBox;
18875
- F.DrawWireBox3(o, 16711680, 5), F.DrawWireBox3(r, 255, 5), console.log("DeleteBox: Destroying", this.gameObject, { deleteBoxArea: o, deletedObjectArea: r });
18880
+ z.DrawWireBox3(o, 16711680, 5), z.DrawWireBox3(r, 255, 5), console.log("DeleteBox: Destroying", this.gameObject, { deleteBoxArea: o, deletedObjectArea: r });
18876
18881
  } else
18877
18882
  console.log("DeleteBox: Destroying", this.gameObject);
18878
18883
  } catch {
@@ -18897,7 +18902,7 @@ class eg extends T {
18897
18902
  this.test() || S.setActive(this.gameObject, !1);
18898
18903
  }
18899
18904
  test() {
18900
- return this.visibleOn < 0 ? !0 : X.isMobileDevice() ? (this.visibleOn & 2) !== 0 : (this.visibleOn & 1) !== 0;
18905
+ return this.visibleOn < 0 ? !0 : q.isMobileDevice() ? (this.visibleOn & 2) !== 0 : (this.visibleOn & 1) !== 0;
18901
18906
  }
18902
18907
  }
18903
18908
  $k([
@@ -19048,7 +19053,7 @@ const go = class Ii extends T {
19048
19053
  * @internal
19049
19054
  */
19050
19055
  onPointerUp(e) {
19051
- if (kn && F.DrawLabel(e.point ?? this.gameObject.worldPosition, "POINTERUP:" + e.pointerId + ", " + e.button, 0.03, 3), !this.allowEdit(this.gameObject) || e.button !== 0) return;
19056
+ if (kn && z.DrawLabel(e.point ?? this.gameObject.worldPosition, "POINTERUP:" + e.pointerId + ", " + e.button, 0.03, 3), !this.allowEdit(this.gameObject) || e.button !== 0) return;
19052
19057
  this._potentialDragStartEvt = null;
19053
19058
  const t = this._dragHandlers.get(e.event.space), i = this._dragHandlers.get(this.gameObject);
19054
19059
  i && (i.handlerA === t || i.handlerB === t) && (this._dragHandlers.delete(this.gameObject), i.onDragEnd(e)), t && (Ii._active > 0 && (Ii._active -= 1), this.setTargetObject(null), t.onDragEnd && t.onDragEnd(e), this._dragHandlers.delete(e.event.space), this._dragHandlers.size === 0 && this.onLastDragEnd(e), e.use());
@@ -19155,7 +19160,7 @@ class Vk {
19155
19160
  _followObject;
19156
19161
  _manipulatorObject;
19157
19162
  _deviceMode;
19158
- _followObjectStartWorldQuaternion = new $();
19163
+ _followObjectStartWorldQuaternion = new N();
19159
19164
  constructor(e, t, i, n) {
19160
19165
  this.context = e.context, this.settings = e, this.gameObject = t, this.handlerA = i, this.handlerB = n, this._followObject = new M(), this._manipulatorObject = new M(), this.context.scene.add(this._manipulatorObject);
19161
19166
  const o = K.active?.rig?.gameObject;
@@ -19166,7 +19171,7 @@ class Vk {
19166
19171
  if (this._tempVec1.copy(this.handlerA.hitPointInLocalSpace), this._tempVec2.copy(this.handlerB.hitPointInLocalSpace), this.gameObject.localToWorld(this._tempVec1), this.gameObject.localToWorld(this._tempVec2), o && (o.worldToLocal(this._tempVec1), o.worldToLocal(this._tempVec2)), this._initialDistance = this._tempVec1.distanceTo(this._tempVec2), this._initialDistance < 0.02 ? (kn && console.log("Finding alternative drag attachment points since initial distance is too low: " + this._initialDistance.toFixed(2)), this.handlerA.followObject.parent.getWorldPosition(this._tempVec1), this.handlerB.followObject.parent.getWorldPosition(this._tempVec2), this._handlerAAttachmentPoint.copy(this._tempVec1), this._handlerBAttachmentPoint.copy(this._tempVec2), this.gameObject.worldToLocal(this._handlerAAttachmentPoint), this.gameObject.worldToLocal(this._handlerBAttachmentPoint), this._initialDistance = this._tempVec1.distanceTo(this._tempVec2), this._initialDistance < 1e-3 && (console.warn("Not supported right now – controller drag points for multitouch are too close!"), this._initialDistance = 1)) : (this._handlerAAttachmentPoint.copy(this.handlerA.hitPointInLocalSpace), this._handlerBAttachmentPoint.copy(this.handlerB.hitPointInLocalSpace)), this._tempVec3.lerpVectors(this._tempVec1, this._tempVec2, 0.5), this._initialScale.copy(t.scale), kn) {
19167
19172
  this._followObject.add(new mi(2)), this._manipulatorObject.add(new mi(5));
19168
19173
  const r = (a) => `${a.x.toFixed(2)}, ${a.y.toFixed(2)}, ${a.z.toFixed(2)}`;
19169
- F.DrawLine(this._tempVec1, this._tempVec2, 65535, 0, !1), F.DrawLabel(this._tempVec3, "A:B " + this._initialDistance.toFixed(2) + `
19174
+ z.DrawLine(this._tempVec1, this._tempVec2, 65535, 0, !1), z.DrawLabel(this._tempVec3, "A:B " + this._initialDistance.toFixed(2) + `
19170
19175
  ` + r(this._tempVec1) + `
19171
19176
  ` + r(this._tempVec2), 0.03, 5);
19172
19177
  }
@@ -19182,7 +19187,7 @@ class Vk {
19182
19187
  this.handlerA.recenter(), this.handlerB.recenter(), this._manipulatorObject.removeFromParent(), this._followObject.removeFromParent(), this._manipulatorObject.destroy(), this._followObject.destroy();
19183
19188
  }
19184
19189
  _manipulatorPosOffset = new b();
19185
- _manipulatorRotOffset = new $();
19190
+ _manipulatorRotOffset = new N();
19186
19191
  _manipulatorScaleOffset = new b();
19187
19192
  _tempVec1 = new b();
19188
19193
  _tempVec2 = new b();
@@ -19203,7 +19208,7 @@ class Vk {
19203
19208
  const e = this.context.mainCamera;
19204
19209
  this.tempLookMatrix.lookAt(this._tempVec3, this._tempVec2, e.worldUp), this._manipulatorObject.quaternion.setFromRotationMatrix(this.tempLookMatrix);
19205
19210
  const t = this._tempVec1.distanceTo(this._tempVec2);
19206
- this._manipulatorObject.scale.copy(this._initialScale).multiplyScalar(t / this._initialDistance), this._manipulatorObject.updateMatrix(), this._manipulatorObject.updateMatrixWorld(!0), kn && (F.DrawLabel(this._tempVec3.clone().add(new b(0, 0.2, 0)), "A:B " + t.toFixed(2), 0.03), F.DrawLine(this._tempVec1, this._tempVec2, 65280, 0, !1));
19211
+ this._manipulatorObject.scale.copy(this._initialScale).multiplyScalar(t / this._initialDistance), this._manipulatorObject.updateMatrix(), this._manipulatorObject.updateMatrixWorld(!0), kn && (z.DrawLabel(this._tempVec3.clone().add(new b(0, 0.2, 0)), "A:B " + t.toFixed(2), 0.03), z.DrawLine(this._tempVec1, this._tempVec2, 65280, 0, !1));
19207
19212
  }
19208
19213
  onDragUpdate() {
19209
19214
  this.alignManipulator();
@@ -19266,8 +19271,8 @@ class Cf {
19266
19271
  _grabStartDistance = 0;
19267
19272
  _deviceMode;
19268
19273
  _followObjectStartPosition = new b();
19269
- _followObjectStartQuaternion = new $();
19270
- _followObjectStartWorldQuaternion = new $();
19274
+ _followObjectStartQuaternion = new N();
19275
+ _followObjectStartWorldQuaternion = new N();
19271
19276
  _lastDragPosRigSpace;
19272
19277
  _tempVec = new b();
19273
19278
  _tempMat = new te();
@@ -19303,7 +19308,7 @@ class Cf {
19303
19308
  const t = this._hitPointInLocalSpace.clone();
19304
19309
  this.gameObject.localToWorld(t), this._grabStartDistance = t.distanceTo(e.worldPosition);
19305
19310
  const n = K.active?.rig?.gameObject?.worldScale.x || 1;
19306
- this._grabStartDistance /= n, this._totalMovementAlongRayDirection = 0, this._lastDragPosRigSpace = void 0, kn && (F.DrawLine(t, e.worldPosition, 65280, 0.5, !1), F.DrawLabel(e.worldPosition.add(new b(0, 0.1, 0)), this._grabStartDistance.toFixed(2), 0.03, 0.5));
19311
+ this._grabStartDistance /= n, this._totalMovementAlongRayDirection = 0, this._lastDragPosRigSpace = void 0, kn && (z.DrawLine(t, e.worldPosition, 65280, 0.5, !1), z.DrawLabel(e.worldPosition.add(new b(0, 0.1, 0)), this._grabStartDistance.toFixed(2), 0.03, 0.5));
19307
19312
  }
19308
19313
  onDragStart(e) {
19309
19314
  if (!this.gameObject) {
@@ -19357,7 +19362,7 @@ class Cf {
19357
19362
  const n = e.worldForward;
19358
19363
  if (i && (this._tempMat.copy(i.matrixWorld).invert(), n.transformDirection(this._tempMat)), this._totalMovementAlongRayDirection += n.dot(this._tempVec), this._tempVec.x = Math.abs(this._tempVec.x), this._tempVec.y = Math.abs(this._tempVec.y), this._tempVec.z = Math.abs(this._tempVec.z), this._totalMovement.add(this._tempVec), this._lastDragPosRigSpace.copy(t), kn) {
19359
19364
  let o = t;
19360
- i && (o = o.clone(), o.transformDirection(i.matrixWorld)), F.DrawRay(o, n, 255);
19365
+ i && (o = o.clone(), o.transformDirection(i.matrixWorld)), z.DrawRay(o, n, 255);
19361
19366
  }
19362
19367
  }
19363
19368
  onDragUpdate(e) {
@@ -19395,15 +19400,15 @@ class Cf {
19395
19400
  const x = y[0];
19396
19401
  if (this._draggedOverObject === x.object ? this._draggedOverObjectDuration += this.context.time.deltaTime : (this._draggedOverObject = x.object, this._draggedOverObjectDuration = 0), x.face) {
19397
19402
  this._hasLastSurfaceHitPoint = !0, this._lastSurfaceHitPoint.copy(x.point);
19398
- const O = this._draggedOverObjectDuration >= 0.15, E = this._totalMovement.length() >= 1e-3, z = G(x.normal || x.face.normal).applyQuaternion(x.object.worldQuaternion);
19399
- if ((O || E) && (this._draggedOverObjectLastSetUp !== this._draggedOverObject || this._draggedOverObjectLastNormal.dot(z) < 0.999999 || this.context.time.frame % 60 === 0)) {
19403
+ const O = this._draggedOverObjectDuration >= 0.15, E = this._totalMovement.length() >= 1e-3, B = G(x.normal || x.face.normal).applyQuaternion(x.object.worldQuaternion);
19404
+ if ((O || E) && (this._draggedOverObjectLastSetUp !== this._draggedOverObject || this._draggedOverObjectLastNormal.dot(B) < 0.999999 || this.context.time.frame % 60 === 0)) {
19400
19405
  this._draggedOverObjectLastSetUp = this._draggedOverObject, this._draggedOverObjectLastNormal.copy(x.face.normal);
19401
- const D = G(), V = G();
19402
- this._bounds.getCenter(D), this._bounds.getSize(V), D.sub(V.multiplyScalar(0.5).multiply(z)), this._hitPointInLocalSpace.copy(D), this._hitNormalInLocalSpace.copy(x.face.normal), this._bounds.getCenter(D), this._bounds.getSize(V), D.add(V.multiplyScalar(0.5).multiply(x.face.normal));
19403
- const q = G(this._hitPointInLocalSpace).add(D);
19404
- this._followObject.localToWorld(q);
19406
+ const L = G(), W = G();
19407
+ this._bounds.getCenter(L), this._bounds.getSize(W), L.sub(W.multiplyScalar(0.5).multiply(B)), this._hitPointInLocalSpace.copy(L), this._hitNormalInLocalSpace.copy(x.face.normal), this._bounds.getCenter(L), this._bounds.getSize(W), L.add(W.multiplyScalar(0.5).multiply(x.face.normal));
19408
+ const X = G(this._hitPointInLocalSpace).add(L);
19409
+ this._followObject.localToWorld(X);
19405
19410
  const A = x.point;
19406
- this._dragPlane.setFromNormalAndCoplanarPoint(z, A);
19411
+ this._dragPlane.setFromNormalAndCoplanarPoint(B, A);
19407
19412
  } else if (!(O || E))
19408
19413
  return;
19409
19414
  }
@@ -19412,7 +19417,7 @@ class Cf {
19412
19417
  if (l !== 1 && p.intersectPlane(this._dragPlane, this._tempVec)) {
19413
19418
  this._followObject.worldPosition = this._tempVec, this._followObject.updateMatrix(), this._followObject.updateMatrixWorld(!0);
19414
19419
  const y = G(this._hitPointInLocalSpace);
19415
- this._followObject.localToWorld(y), kn && F.DrawLine(y, this._tempVec, 65535, 0, !1), this._followObject.worldPosition = this._tempVec.multiplyScalar(2).sub(y), this._followObject.updateMatrix(), this._followObject.updateMatrix();
19420
+ this._followObject.localToWorld(y), kn && z.DrawLine(y, this._tempVec, 65535, 0, !1), this._followObject.worldPosition = this._tempVec.multiplyScalar(2).sub(y), this._followObject.updateMatrix(), this._followObject.updateMatrix();
19416
19421
  }
19417
19422
  if (this.settings.snapGridResolution > 0) {
19418
19423
  const y = this._followObject.worldPosition, x = this.settings.snapGridResolution;
@@ -19424,9 +19429,9 @@ class Cf {
19424
19429
  const v = t.worldQuaternion;
19425
19430
  if (v.slerp(this._followObject.worldQuaternion, _), t.worldQuaternion = v, kn) {
19426
19431
  const y = this._hitPointInLocalSpace.clone();
19427
- t.localToWorld(y), F.DrawSphere(y, 0.02, 16711680);
19432
+ t.localToWorld(y), z.DrawSphere(y, 0.02, 16711680);
19428
19433
  const x = this._hitNormalInLocalSpace.clone();
19429
- x.applyQuaternion(v), F.DrawRay(y, x, 16711680), F.DrawLabel(
19434
+ x.applyQuaternion(v), z.DrawRay(y, x, 16711680), z.DrawLabel(
19430
19435
  m.add(new b(0, 0.25, 0)),
19431
19436
  `Distance: ${this._totalMovement.length().toFixed(2)}
19432
19437
 
@@ -19440,7 +19445,7 @@ class Cf {
19440
19445
  0.03
19441
19446
  );
19442
19447
  const I = this._bottomCenter.clone(), O = this._backCenter.clone(), k = this._backBottomCenter.clone();
19443
- t.localToWorld(I), t.localToWorld(O), t.localToWorld(k), F.DrawSphere(I, 0.01, 65280, 0, !1), F.DrawSphere(O, 0.01, 255, 0, !1), F.DrawSphere(k, 0.01, 16711935, 0, !1), F.DrawLine(I, k, 65535, 0, !1), F.DrawLine(k, O, 65535, 0, !1);
19448
+ t.localToWorld(I), t.localToWorld(O), t.localToWorld(k), z.DrawSphere(I, 0.01, 65280, 0, !1), z.DrawSphere(O, 0.01, 255, 0, !1), z.DrawSphere(k, 0.01, 16711935, 0, !1), z.DrawLine(I, k, 65535, 0, !1), z.DrawLine(k, O, 65535, 0, !1);
19444
19449
  }
19445
19450
  }
19446
19451
  onDragEnd(e) {
@@ -19764,7 +19769,7 @@ function Xk(s, e, t) {
19764
19769
  if (r)
19765
19770
  return Vl && console.debug(`Mimetype callback returned: ${r}`), r;
19766
19771
  }
19767
- if (L() || Vl) {
19772
+ if (D() || Vl) {
19768
19773
  const o = new TextDecoder().decode(e.slice(0, Math.min(e.byteLength, 32)));
19769
19774
  console.warn(`Could not determine file type.
19770
19775
 
@@ -19987,7 +19992,7 @@ class yo extends T {
19987
19992
  const r = n.scene;
19988
19993
  this.gameObject.attach(r), r.position.set(0, 0, 0), r.quaternion.identity(), this._addedObjects.push(r), this._addedModels.push(n);
19989
19994
  const a = new pi().setFromCenterAndSize(new b(0, this.fitVolumeSize.y * 0.5, 0).add(this.gameObject.worldPosition), this.fitVolumeSize);
19990
- if (ri && F.DrawWireBox3(a, 255, 5), this.fitIntoVolume && UC(r, a, {
19995
+ if (ri && z.DrawWireBox3(a, 255, 5), this.fitIntoVolume && UC(r, a, {
19991
19996
  position: !this.placeAtHitPosition
19992
19997
  }), this.placeAtHitPosition && t && t.screenposition) {
19993
19998
  r.visible = !1;
@@ -20056,7 +20061,7 @@ class yo extends T {
20056
20061
  recursive: !0,
20057
20062
  testObject: (n) => !this._addedObjects.includes(n)
20058
20063
  }).length)
20059
- return L() && console.log(`Dropped outside of drop area for DropListener "${this.name}".`), !1;
20064
+ return D() && console.log(`Dropped outside of drop area for DropListener "${this.name}".`), !1;
20060
20065
  }
20061
20066
  return !0;
20062
20067
  }
@@ -20100,7 +20105,7 @@ var md;
20100
20105
  async function t(i, n) {
20101
20106
  return new Promise(async (o, r) => {
20102
20107
  const a = new Tt(n.guid), l = i.toString();
20103
- ri && F.DrawWireSphere(n.point, 0.1, 16711680, 3);
20108
+ ri && z.DrawWireSphere(n.point, 0.1, 16711680, 3);
20104
20109
  const c = Wo.addPreview({
20105
20110
  guid: n.guid,
20106
20111
  parent: n.parent,
@@ -20144,7 +20149,7 @@ const au = class ov extends T {
20144
20149
  }
20145
20150
  this.object.visible = !1;
20146
20151
  const e = this.gameObject.getComponent(Gr);
20147
- e && (e.enabled = !1), this._startPosition = this.object.position?.clone() ?? new b(0, 0, 0), this._startQuaternion = this.object.quaternion?.clone() ?? new $(0, 0, 0, 1);
20152
+ e && (e.enabled = !1), this._startPosition = this.object.position?.clone() ?? new b(0, 0, 0), this._startQuaternion = this.object.quaternion?.clone() ?? new N(0, 0, 0, 1);
20148
20153
  }
20149
20154
  this.gameObject.getComponentInParent(Vi) || this.gameObject.addComponent(Vi);
20150
20155
  }
@@ -20164,7 +20169,7 @@ const au = class ov extends T {
20164
20169
  const t = this.handleDuplication();
20165
20170
  if (t) {
20166
20171
  const i = S.getComponent(t, Gr);
20167
- i ? (i.onPointerDown(e), this._forwardPointerEvents.set(e.event.space, i)) : L() && console.warn(`Duplicated object (${t.name}) does not have DragControls`);
20172
+ i ? (i.onPointerDown(e), this._forwardPointerEvents.set(e.event.space, i)) : D() && console.warn(`Duplicated object (${t.name}) does not have DragControls`);
20168
20173
  } else
20169
20174
  this._currentCount >= this.limitCount ? console.warn(`[Duplicatable] Limit of ${this.limitCount} objects created within a few seconds reached. Please wait a moment before creating more objects.`) : console.warn("[Duplicatable] Could not duplicate object.");
20170
20175
  }
@@ -20262,7 +20267,7 @@ class av {
20262
20267
  }
20263
20268
  class tM extends av {
20264
20269
  beforeWriteNode(e, t) {
20265
- F.isGizmo(e) && (t.keep = !1);
20270
+ z.isGizmo(e) && (t.keep = !1);
20266
20271
  }
20267
20272
  }
20268
20273
  class lv extends av {
@@ -20697,12 +20702,12 @@ class Me extends fb {
20697
20702
  return dv(e), e;
20698
20703
  }
20699
20704
  constructor(e, ...t) {
20700
- super(...t), this.identifier = e, _n && console.log(this), this.type = "NEEDLE_CUSTOM_SHADER", this.uniforms[this._objToWorldName] || (this.uniforms[this._objToWorldName] = { value: [] }), this.uniforms[this._worldToObjectName] || (this.uniforms[this._worldToObjectName] = { value: [] }), this.uniforms[this._viewProjectionName] || (this.uniforms[this._viewProjectionName] = { value: [] }), this.uniforms[this._sphericalHarmonicsName], (this.depthTextureUniform || this.opaqueTextureUniform) && N.Current.pre_render_callbacks.push(this.onBeforeRenderSceneCallback);
20705
+ super(...t), this.identifier = e, _n && console.log(this), this.type = "NEEDLE_CUSTOM_SHADER", this.uniforms[this._objToWorldName] || (this.uniforms[this._objToWorldName] = { value: [] }), this.uniforms[this._worldToObjectName] || (this.uniforms[this._worldToObjectName] = { value: [] }), this.uniforms[this._viewProjectionName] || (this.uniforms[this._viewProjectionName] = { value: [] }), this.uniforms[this._sphericalHarmonicsName], (this.depthTextureUniform || this.opaqueTextureUniform) && U.Current.pre_render_callbacks.push(this.onBeforeRenderSceneCallback);
20701
20706
  }
20702
20707
  dispose() {
20703
20708
  super.dispose();
20704
- const e = N.Current.pre_render_callbacks.indexOf(this.onBeforeRenderSceneCallback);
20705
- e >= 0 && N.Current.pre_render_callbacks.splice(e, 1);
20709
+ const e = U.Current.pre_render_callbacks.indexOf(this.onBeforeRenderSceneCallback);
20710
+ e >= 0 && U.Current.pre_render_callbacks.splice(e, 1);
20706
20711
  }
20707
20712
  /* REMOVED, we don't have Lit shader support for now
20708
20713
  async waitForLighting() {
@@ -20754,13 +20759,13 @@ class Me extends fb {
20754
20759
  return this.uniforms._CameraOpaqueTexture;
20755
20760
  }
20756
20761
  onBeforeRenderScene() {
20757
- this.opaqueTextureUniform && N.Current.setRequireColor(!0), this.depthTextureUniform && N.Current.setRequireDepth(!0);
20762
+ this.opaqueTextureUniform && U.Current.setRequireColor(!0), this.depthTextureUniform && U.Current.setRequireDepth(!0);
20758
20763
  }
20759
20764
  onBeforeRender(e, t, i, n, o, r) {
20760
20765
  n.attributes.tangent || n.computeTangents(), this.onUpdateUniforms(i, o);
20761
20766
  }
20762
20767
  onUpdateUniforms(e, t) {
20763
- const i = N.Current;
20768
+ const i = U.Current;
20764
20769
  if (e && (Me.viewProjection && this.uniforms[this._viewProjectionName] && (Me.viewProjection.copy(e.projectionMatrix).multiply(e.matrixWorldInverse), ld(Me.viewProjection, Me._viewProjectionValues)), Me.viewMatrix && this.uniforms[this._viewMatrixName] && (Me.viewMatrix.copy(e.matrixWorldInverse), ld(Me.viewMatrix, Me._viewMatrixValues)), this.uniforms[Me._worldSpaceCameraPosName] && Me._worldSpaceCameraPos.setFromMatrixPosition(e.matrixWorld)), this.uniforms._TimeParameters && (this.uniforms._TimeParameters.value = i.sceneLighting.timeVec4), this.uniforms._Time) {
20765
20770
  const a = this.uniforms._Time.value;
20766
20771
  a.x = i.sceneLighting.timeVec4.x / 20, a.y = i.sceneLighting.timeVec4.x, a.z = i.sceneLighting.timeVec4.x * 2, a.w = i.sceneLighting.timeVec4.x * 3;
@@ -21023,7 +21028,7 @@ async function Fp(s, e, t) {
21023
21028
  const o = new gd(n);
21024
21029
  return o.setAnimationPointerResolver.bind(o)(new gM()), o;
21025
21030
  } else
21026
- return (pM || L()) && console.error("Missing KHR_animation_pointer extension..."), {
21031
+ return (pM || D()) && console.error("Missing KHR_animation_pointer extension..."), {
21027
21032
  name: "KHR_animation_pointer_NOT_AVAILABLE"
21028
21033
  };
21029
21034
  });
@@ -21050,7 +21055,7 @@ class pv {
21050
21055
  const a = new Array(), l = new Array(), c = new Array();
21051
21056
  for (let p = 0; p < e.count; p++) {
21052
21057
  e.getMatrixAt(p, r);
21053
- let g = new b(), _ = new $(), m = new b();
21058
+ let g = new b(), _ = new N(), m = new b();
21054
21059
  r.decompose(g, _, m), a.push(g.x, g.y, g.z), l.push(_.x, _.y, _.z, _.w), c.push(m.x, m.y, m.z);
21055
21060
  }
21056
21061
  const h = new Float32Array(a), d = new Float32Array(l), f = new Float32Array(c);
@@ -21111,7 +21116,7 @@ const ol = w("debugreflectionprobe"), v_ = w("noreflectionprobe"), Mf = Symbol("
21111
21116
  this._boxHelper = this.gameObject.addComponent(Ct), this._boxHelper.updateBox(!0), ol && this._boxHelper.showHelper(5592320, !0), this._texture && (this._texture.mapping = _s, this._texture.colorSpace = Ss, this._texture.needsUpdate = !0);
21112
21117
  }
21113
21118
  start() {
21114
- !this._texture && L() && (console.warn(`[ReflectionProbe] Missing texture. Please assign a custom cubemap texture. To use reflection probes assign them to your renderer's "anchor" property.`), ge("ReflectionProbe configuration hint: See browser console for details"));
21119
+ !this._texture && D() && (console.warn(`[ReflectionProbe] Missing texture. Please assign a custom cubemap texture. To use reflection probes assign them to your renderer's "anchor" property.`), ge("ReflectionProbe configuration hint: See browser console for details"));
21115
21120
  }
21116
21121
  onDestroy() {
21117
21122
  const e = ss._probes.get(this.context);
@@ -21299,7 +21304,7 @@ class ra {
21299
21304
  return i(`Instancing: Can not update geometry (${this.name}), reserved index range is too small: ${this.__reservedIndexRange.toLocaleString()} < ${this.indexCount.toLocaleString()} indices for ${this.name}`);
21300
21305
  return this.renderer.updateGeometry(e, this.__geometryIndex);
21301
21306
  function i(n) {
21302
- return t.updateMeshInformation() && (t.renderer.remove(t, !0), t.renderer.add(t)) ? !0 : ((L() || Qt) && console.error(n), !1);
21307
+ return t.updateMeshInformation() && (t.renderer.remove(t, !0), t.renderer.add(t)) ? !0 : ((D() || Qt) && console.error(n), !1);
21303
21308
  }
21304
21309
  }
21305
21310
  /** Adds this object to the instancing renderer (effectively activating instancing) */
@@ -21357,7 +21362,7 @@ class bM {
21357
21362
  updateBounds(e = !0, t = !0) {
21358
21363
  if (this._needUpdateBounds = !1, e && this._batchedMesh.computeBoundingBox(), t && this._batchedMesh.computeBoundingSphere(), Qt && this._batchedMesh.boundingSphere) {
21359
21364
  const i = this._batchedMesh.boundingSphere;
21360
- F.DrawWireSphere(i.center, i.radius, 65280);
21365
+ z.DrawWireSphere(i.center, i.radius, 65280);
21361
21366
  }
21362
21367
  }
21363
21368
  _context;
@@ -21396,7 +21401,7 @@ class bM {
21396
21401
  this.add(t);
21397
21402
  } catch (i) {
21398
21403
  if (console.error(`Failed adding mesh to instancing (object name: "${e.name}", instances: ${this._currentInstanceCount.toLocaleString()}/${this._maxInstanceCount.toLocaleString()}, vertices: ${this._currentVertexCount.toLocaleString()}/${this._maxVertexCount.toLocaleString()}, indices: ${this._currentIndexCount.toLocaleString()}/${this._maxIndexCount.toLocaleString()})
21399
- `, i), L()) {
21404
+ `, i), D()) {
21400
21405
  Wd("Failed instancing mesh. See the browser console for details.");
21401
21406
  debugger;
21402
21407
  }
@@ -21434,7 +21439,7 @@ class bM {
21434
21439
  const t = this.geometry;
21435
21440
  for (const i in t.attributes)
21436
21441
  if (i !== "batchId" && !e.hasAttribute(i))
21437
- return L() && console.warn(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`), !1;
21442
+ return D() && console.warn(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`), !1;
21438
21443
  return !0;
21439
21444
  }
21440
21445
  markNeedsUpdate() {
@@ -21459,7 +21464,7 @@ ${c.vertexCount} vertices, ${c.indexCount} indices
21459
21464
  Max count ${this._maxInstanceCount} → ${i}
21460
21465
  Max vertex count ${this._maxVertexCount} -> ${o}
21461
21466
  Max index count ${this._maxIndexCount} -> ${r}`), this._debugMaterial = x_();
21462
- } else L() && console.debug(`[Instancing] Growing Buffer
21467
+ } else D() && console.debug(`[Instancing] Growing Buffer
21463
21468
  Mesh: "${this.name}${e.name?.length ? "/" + e.name : ""}"
21464
21469
  Max count ${this._maxInstanceCount} → ${i}
21465
21470
  Max vertex count ${this._maxVertexCount} -> ${o}
@@ -21523,7 +21528,7 @@ Index: ${e.__instanceIndex}`), this._batchedMesh.deleteInstance(e.__instanceInde
21523
21528
  }
21524
21529
  function Vo(s) {
21525
21530
  if (!s)
21526
- return L() && console.error("Cannot get mesh information from null geometry"), { vertexCount: 0, indexCount: 0 };
21531
+ return D() && console.error("Cannot get mesh information from null geometry"), { vertexCount: 0, indexCount: 0 };
21527
21532
  let e = s.attributes?.position?.count || 0, t = s.index ? s.index.count : 0;
21528
21533
  const i = We.getMeshLODExtension(s);
21529
21534
  if (i) {
@@ -21988,7 +21993,7 @@ const $n = class zh extends T {
21988
21993
  if (this._probeAnchorLastFrame !== this.probeAnchor && (this._reflectionProbe?.onUnset(this), this.updateReflectionProbe()), Pl == this.name && this.gameObject instanceof H) {
21989
21994
  this.gameObject.geometry.computeBoundingSphere();
21990
21995
  const e = G(this.gameObject.geometry.boundingSphere.center).applyMatrix4(this.gameObject.matrixWorld);
21991
- F.DrawWireSphere(e, this.gameObject.geometry.boundingSphere.radius, 56831);
21996
+ z.DrawWireSphere(e, this.gameObject.geometry.boundingSphere.radius, 56831);
21992
21997
  }
21993
21998
  if (this.isMultiMaterialObject(this.gameObject) && this.gameObject.children?.length > 0)
21994
21999
  for (const e of this.gameObject.children)
@@ -22115,7 +22120,7 @@ class gv extends lu {
22115
22120
  for (const e of this.sharedMeshes)
22116
22121
  if (e instanceof ys && e.boundingSphere) {
22117
22122
  const t = G(e.boundingSphere.center).applyMatrix4(e.matrixWorld);
22118
- F.DrawWireSphere(t, e.boundingSphere.radius, "red");
22123
+ z.DrawWireSphere(t, e.boundingSphere.radius, "red");
22119
22124
  }
22120
22125
  }
22121
22126
  }
@@ -22678,7 +22683,7 @@ function xv(s) {
22678
22683
  }
22679
22684
  return t;
22680
22685
  }
22681
- const IM = new b(), LM = new $(), DM = new b(1, 1, 1);
22686
+ const IM = new b(), LM = new N(), DM = new b(1, 1, 1);
22682
22687
  class st {
22683
22688
  static USDObject_export_id = 0;
22684
22689
  uuid;
@@ -22700,7 +22705,7 @@ class st {
22700
22705
  this.transform = null;
22701
22706
  return;
22702
22707
  }
22703
- const t = new b(), i = new $(), n = new b();
22708
+ const t = new b(), i = new N(), n = new b();
22704
22709
  e.decompose(t, i, n), this.transform = { position: t, quaternion: i, scale: n };
22705
22710
  }
22706
22711
  /** @deprecated Use `transform`, or `getMatrix()` if you really need the matrix */
@@ -22988,13 +22993,13 @@ let FM = class {
22988
22993
  le.report("export-usdz-textures", { message: "read back texture", autoStep: !0 });
22989
22994
  const E = x.scale !== void 0 && x.scale.x !== 1 && x.scale.y !== 1 && x.scale.z !== 1 && x.scale.w !== 1;
22990
22995
  (I.isCompressedTexture || I.isRenderTargetTexture || E) && (k = await UM(I, t.maxTextureSize, g, x.scale)), le.report("export-usdz-textures", { message: "convert texture to canvas", autoStep: !0 });
22991
- const z = await $M(k.imageBitmap || k.imageData, t.maxTextureSize).catch((D) => {
22992
- console.error("Error converting texture to canvas", I, D);
22996
+ const B = await $M(k.imageBitmap || k.imageData, t.maxTextureSize).catch((L) => {
22997
+ console.error("Error converting texture to canvas", I, L);
22993
22998
  });
22994
- if (z) {
22999
+ if (B) {
22995
23000
  le.report("export-usdz-textures", { message: "convert canvas to blob", autoStep: !0 });
22996
- const D = await z.convertToBlob({ type: O ? "image/png" : "image/jpeg", quality: 0.95 });
22997
- n[`textures/${y}.${O ? "png" : "jpg"}`] = new Uint8Array(await D.arrayBuffer());
23001
+ const L = await B.convertToBlob({ type: O ? "image/png" : "image/jpeg", quality: 0.95 });
23002
+ n[`textures/${y}.${O ? "png" : "jpg"}`] = new Uint8Array(await L.arrayBuffer());
22998
23003
  } else
22999
23004
  console.warn("Can`t export texture: ", I);
23000
23005
  };
@@ -23482,7 +23487,7 @@ function Fs(s, e, t, i, n, o, r = void 0, a = void 0) {
23482
23487
  // MirroredRepeatWrapping
23483
23488
  }, _ = s.repeat.clone(), m = s.offset.clone(), v = s.rotation, y = Math.sin(v), x = Math.cos(v);
23484
23489
  m.y = 1 - m.y - _.y, t ? (_.x === 0 && (_.x = 1e-4), _.y === 0 && (_.y = 1e-4), m.x = m.x / _.x, m.y = m.y / _.y, m.x += y / _.x, m.y += x - 1) : (m.x += y * _.x, m.y += (1 - x) * _.y);
23485
- const I = cu(n), O = _.x != 1 || _.y != 1 || m.x != 0 || m.y != 0 || v != 0, k = `${Ut}/${I}/${"uvReader_" + f}.outputs:result>`, E = `${Ut}/${I}/Transform2d_${e}.outputs:result>`, z = e !== "normal" && r && (r.r !== 1 || r.g !== 1 || r.b !== 1 || a !== 1) || !1, D = e === "normal", V = n instanceof ct && n.normalScale ? n.normalScale.x * 2 : 2, q = V.toFixed(Oe), A = (-1 * (V / 2)).toFixed(Oe), U = (1 - V).toFixed(Oe);
23490
+ const I = cu(n), O = _.x != 1 || _.y != 1 || m.x != 0 || m.y != 0 || v != 0, k = `${Ut}/${I}/${"uvReader_" + f}.outputs:result>`, E = `${Ut}/${I}/Transform2d_${e}.outputs:result>`, B = e !== "normal" && r && (r.r !== 1 || r.g !== 1 || r.b !== 1 || a !== 1) || !1, L = e === "normal", W = n instanceof ct && n.normalScale ? n.normalScale.x * 2 : 2, X = W.toFixed(Oe), A = (-1 * (W / 2)).toFixed(Oe), $ = (1 - W).toFixed(Oe);
23486
23491
  return `
23487
23492
  ${O ? `def Shader "Transform2d_${e}" (
23488
23493
  sdrMetadata = {
@@ -23504,12 +23509,12 @@ function Fs(s, e, t, i, n, o, r = void 0, a = void 0) {
23504
23509
  asset inputs:file = @textures/${c}.${p ? "png" : "jpg"}@
23505
23510
  token inputs:sourceColorSpace = "${s.colorSpace === "srgb" ? "sRGB" : "raw"}"
23506
23511
  float2 inputs:st.connect = ${O ? E : k}
23507
- ${z ? `
23512
+ ${B ? `
23508
23513
  float4 inputs:scale = (${r ? r.r + ", " + r.g + ", " + r.b : "1, 1, 1"}, ${a})
23509
23514
  ` : ""}
23510
- ${D ? `
23511
- float4 inputs:scale = (${q}, ${q}, ${q}, 1)
23512
- float4 inputs:bias = (${A}, ${A}, ${U}, 0)
23515
+ ${L ? `
23516
+ float4 inputs:scale = (${X}, ${X}, ${X}, 1)
23517
+ float4 inputs:bias = (${A}, ${A}, ${$}, 0)
23513
23518
  ` : ""}
23514
23519
  token inputs:wrapS = "${g[s.wrapS]}"
23515
23520
  token inputs:wrapT = "${g[s.wrapT]}"
@@ -24075,7 +24080,7 @@ class Ue {
24075
24080
  console.error("This is a rest clip but you're trying to add tracks to it – this is likely a bug");
24076
24081
  return;
24077
24082
  }
24078
- e.name.endsWith("position") ? this.pos = e : e.name.endsWith("quaternion") ? this.rot = e : e.name.endsWith("scale") ? this.scale = e : (e.name.endsWith("activeSelf") ? console.warn("[USDZ] Animation of enabled/disabled state is not supported for USDZ export and will NOT be exported: " + e.name + " on " + (this.root?.name ?? this.target.name) + ". Animate scale 0/1 instead.") : console.warn("[USDZ] Animation track type not supported for USDZ export and will NOT be exported: " + e.name + " on " + (this.root?.name ?? this.target.name) + ". Only .position, .rotation, .scale are supported."), L() && ge("[USDZ] Some animations can't be exported. See console for details."));
24083
+ e.name.endsWith("position") ? this.pos = e : e.name.endsWith("quaternion") ? this.rot = e : e.name.endsWith("scale") ? this.scale = e : (e.name.endsWith("activeSelf") ? console.warn("[USDZ] Animation of enabled/disabled state is not supported for USDZ export and will NOT be exported: " + e.name + " on " + (this.root?.name ?? this.target.name) + ". Animate scale 0/1 instead.") : console.warn("[USDZ] Animation track type not supported for USDZ export and will NOT be exported: " + e.name + " on " + (this.root?.name ?? this.target.name) + ". Only .position, .rotation, .scale are supported."), D() && ge("[USDZ] Some animations can't be exported. See console for details."));
24079
24084
  }
24080
24085
  getFrames() {
24081
24086
  return this.clip ? Math.max(this.pos?.times?.length ?? 0, this.rot?.times?.length ?? 0, this.scale?.times?.length ?? 0) : 2;
@@ -24101,7 +24106,7 @@ class Ue {
24101
24106
  * @param generateScale
24102
24107
  */
24103
24108
  *getValues(e, t = !0, i = !0, n = !0) {
24104
- const o = new b(), r = new $(), a = new b(1, 1, 1), l = this.target, c = t ? this.pos?.createInterpolant() : void 0, h = i ? this.rot?.createInterpolant() : void 0, d = n ? this.scale?.createInterpolant() : void 0;
24109
+ const o = new b(), r = new N(), a = new b(1, 1, 1), l = this.target, c = t ? this.pos?.createInterpolant() : void 0, h = i ? this.rot?.createInterpolant() : void 0, d = n ? this.scale?.createInterpolant() : void 0;
24105
24110
  c || o.set(l.position.x, l.position.y, l.position.z), h || r.set(l.quaternion.x, l.quaternion.y, l.quaternion.z, l.quaternion.w), d || a.set(l.scale.x, l.scale.y, l.scale.z), c && c.valueSize !== 3 && (c.valueSize = 3), h && h.valueSize !== 4 && (h.valueSize = 4), d && d.valueSize !== 3 && (d.valueSize = 3);
24106
24111
  const f = 0;
24107
24112
  for (let p = 0 - f; p < e.length + f; p++) {
@@ -24344,35 +24349,35 @@ class JM {
24344
24349
  const n = this.model, o = this.animationData;
24345
24350
  if (n && n.skinnedMesh) {
24346
24351
  let r = function(A) {
24347
- const U = [];
24348
- for (const [W, ne] of A) {
24349
- let re = `${W} : [`;
24352
+ const $ = [];
24353
+ for (const [V, ne] of A) {
24354
+ let re = `${V} : [`;
24350
24355
  const ue = [];
24351
24356
  for (const Se of ne)
24352
24357
  ue.push(`(${ae(Se.x)}, ${ae(Se.y)}, ${ae(Se.z)})`);
24353
- re = re.concat(ue.join(", ")), re = re.concat("],"), U.push(re);
24358
+ re = re.concat(ue.join(", ")), re = re.concat("],"), $.push(re);
24354
24359
  }
24355
- return U;
24360
+ return $;
24356
24361
  }, a = function(A) {
24357
- const U = [];
24358
- for (const [W, ne] of A) {
24359
- let re = `${W} : [`;
24362
+ const $ = [];
24363
+ for (const [V, ne] of A) {
24364
+ let re = `${V} : [`;
24360
24365
  const ue = [];
24361
24366
  for (const Se of ne)
24362
24367
  ue.push(`(${ae(Se.w)}, ${ae(Se.x)}, ${ae(Se.y)}, ${ae(Se.z)})`);
24363
- re = re.concat(ue.join(", ")), re = re.concat("],"), U.push(re);
24368
+ re = re.concat(ue.join(", ")), re = re.concat("],"), $.push(re);
24364
24369
  }
24365
- return U;
24370
+ return $;
24366
24371
  }, l = function(A) {
24367
- let U, W = !0;
24372
+ let $, V = !0;
24368
24373
  const ne = /* @__PURE__ */ new Map();
24369
24374
  for (const [ue, Se] of A) {
24370
- U === void 0 && (U = Se.length), U !== Se.length && (W = !1);
24375
+ $ === void 0 && ($ = Se.length), $ !== Se.length && (V = !1);
24371
24376
  let Je = 0;
24372
24377
  for (const ki of Se)
24373
24378
  Je++, ki || (ne.has(ue) || ne.set(ue, []), ne.get(ue).push(Je));
24374
24379
  }
24375
- Sn && console.log("Bone count: ", A.size, "TransformData entries per bone: ", U, "Undefined bone entries: ", ne), console.assert(W, "All bones should have the same number of TransformData entries", A), console.assert(ne.size === 0, "All TransformData entries should be set", ne);
24380
+ Sn && console.log("Bone count: ", A.size, "TransformData entries per bone: ", $, "Undefined bone entries: ", ne), console.assert(V, "All bones should have the same number of TransformData entries", A), console.assert(ne.size === 0, "All TransformData entries should be set", ne);
24376
24381
  const re = [];
24377
24382
  for (const [ue, Se] of A)
24378
24383
  for (let Je = 0; Je < Se.length; Je++) {
@@ -24384,14 +24389,14 @@ class JM {
24384
24389
  for (const ue of re)
24385
24390
  ue.pos.sort((Se, Je) => Se - Je), ue.rot.sort((Se, Je) => Se - Je), ue.scale.sort((Se, Je) => Se - Je), ue.pos = [...new Set(ue.pos)], ue.rot = [...new Set(ue.rot)], ue.scale = [...new Set(ue.scale)];
24386
24391
  return re;
24387
- }, c = function(A, U, W) {
24388
- const ne = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new Map(), Se = U.length;
24389
- for (const Je of W) {
24392
+ }, c = function(A, $, V) {
24393
+ const ne = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new Map(), Se = $.length;
24394
+ for (const Je of V) {
24390
24395
  const ki = A.get(Je);
24391
24396
  let Vc;
24392
- ki ? console.assert(ki.length === Se, "We should have the same number of TransformData entries for each bone", ki, U) : Vc = new Ue(null, Je, null);
24397
+ ki ? console.assert(ki.length === Se, "We should have the same number of TransformData entries for each bone", ki, $) : Vc = new Ue(null, Je, null);
24393
24398
  for (let Ds = 0; Ds < Se; Ds++) {
24394
- const Wu = ki ? ki[Ds] : Vc, kr = U[Ds];
24399
+ const Wu = ki ? ki[Ds] : Vc, kr = $[Ds];
24395
24400
  for (const { time: Ya, translation: Ka } of Wu.getValues(kr.pos, !0, !1, !1)) {
24396
24401
  const Ki = (Ya + kr.timeOffset) * 60;
24397
24402
  ne.has(Ki) || ne.set(Ki, new Array()), ne.get(Ki).push(Ka.clone());
@@ -24412,93 +24417,93 @@ class JM {
24412
24417
  scale: ue.size == 0 ? void 0 : ue
24413
24418
  };
24414
24419
  }, h = function(A) {
24415
- const U = [];
24416
- for (const W of A)
24417
- U.push(`(${ae(W.x)}, ${ae(W.y)}, ${ae(W.z)})`);
24418
- return U.join(", ");
24420
+ const $ = [];
24421
+ for (const V of A)
24422
+ $.push(`(${ae(V.x)}, ${ae(V.y)}, ${ae(V.z)})`);
24423
+ return $.join(", ");
24419
24424
  }, d = function(A) {
24420
- const U = [];
24421
- for (const W of A)
24422
- U.push(`(${ae(W.w)}, ${ae(W.x)}, ${ae(W.y)}, ${ae(W.z)})`);
24423
- return U.join(", ");
24425
+ const $ = [];
24426
+ for (const V of A)
24427
+ $.push(`(${ae(V.w)}, ${ae(V.x)}, ${ae(V.y)}, ${ae(V.z)})`);
24428
+ return $.join(", ");
24424
24429
  }, f = function(A) {
24425
- const U = /* @__PURE__ */ new Map();
24430
+ const $ = /* @__PURE__ */ new Map();
24426
24431
  if (Sn) {
24427
- const W = new Array();
24432
+ const V = new Array();
24428
24433
  for (const [ne, re] of o)
24429
- W.push(ne.uuid + ": " + re.length + " " + re.map((ue) => ue.clip?.uuid.substring(0, 6)).join(" "));
24434
+ V.push(ne.uuid + ": " + re.length + " " + re.map((ue) => ue.clip?.uuid.substring(0, 6)).join(" "));
24430
24435
  console.log(`getPerBoneTransformData
24431
- ` + W.join(`
24436
+ ` + V.join(`
24432
24437
  `));
24433
24438
  }
24434
- for (const W of A) {
24435
- const ne = o.get(W);
24436
- ne && U.set(W, ne);
24439
+ for (const V of A) {
24440
+ const ne = o.get(V);
24441
+ ne && $.set(V, ne);
24437
24442
  }
24438
- return U;
24443
+ return $;
24439
24444
  }, p = function(A) {
24440
- const U = f(A), W = l(U);
24441
- return c(U, W, A);
24445
+ const $ = f(A), V = l($);
24446
+ return c($, V, A);
24442
24447
  };
24443
24448
  const g = n.skinnedMesh.skeleton, _ = new Array(), m = [], v = [];
24444
24449
  for (const A of g.bones) {
24445
24450
  m.push(A), v.push(A.uuid);
24446
- const U = g.boneInverses[g.bones.indexOf(A)];
24447
- _.push({ bone: A, inverse: U });
24451
+ const $ = g.boneInverses[g.bones.indexOf(A)];
24452
+ _.push({ bone: A, inverse: $ });
24448
24453
  }
24449
24454
  let y = 1e4;
24450
24455
  for (; v.length < g.bones.length && y-- > 0; )
24451
24456
  for (const A of m) {
24452
- const U = A.children;
24453
- for (const W of U)
24454
- if (v.indexOf(W.uuid) === -1 && g.bones.indexOf(W) !== -1) {
24455
- m.push(W), v.push(W.uuid);
24456
- const ne = g.boneInverses[g.bones.indexOf(W)];
24457
- _.push({ bone: W, inverse: ne });
24457
+ const $ = A.children;
24458
+ for (const V of $)
24459
+ if (v.indexOf(V.uuid) === -1 && g.bones.indexOf(V) !== -1) {
24460
+ m.push(V), v.push(V.uuid);
24461
+ const ne = g.boneInverses[g.bones.indexOf(V)];
24462
+ _.push({ bone: V, inverse: ne });
24458
24463
  }
24459
24464
  }
24460
24465
  y <= 0 && console.error("Failed to sort bones in skinned mesh", n.skinnedMesh, g.bones, v);
24461
24466
  for (const A of xv(g.bones))
24462
24467
  _.push({ bone: A, inverse: A.matrixWorld.clone().invert() });
24463
24468
  const x = _[0].bone.parent;
24464
- x || console.error("No bone parent found for skinned mesh during USDZ export", n.skinnedMesh), _.sort((A, U) => aa(A.bone, x) > aa(U.bone, x) ? 1 : -1);
24465
- const I = t.quickLookCompatible, O = [], k = [], E = [], z = [];
24469
+ x || console.error("No bone parent found for skinned mesh during USDZ export", n.skinnedMesh), _.sort((A, $) => aa(A.bone, x) > aa($.bone, x) ? 1 : -1);
24470
+ const I = t.quickLookCompatible, O = [], k = [], E = [], B = [];
24466
24471
  for (const { bone: A } of _) {
24467
24472
  if (I) {
24468
- const U = A.scale;
24469
- U.x == 0 && (U.x = 1e-5), U.y == 0 && (U.y = 1e-5), U.z == 0 && (U.z = 1e-5), O.push(new te().compose(A.position, A.quaternion, A.scale));
24473
+ const $ = A.scale;
24474
+ $.x == 0 && ($.x = 1e-5), $.y == 0 && ($.y = 1e-5), $.z == 0 && ($.z = 1e-5), O.push(new te().compose(A.position, A.quaternion, A.scale));
24470
24475
  } else
24471
24476
  O.push(A.matrix.clone());
24472
- k.push(A.position), E.push(A.quaternion), z.push(A.scale);
24477
+ k.push(A.position), E.push(A.quaternion), B.push(A.scale);
24473
24478
  }
24474
- const D = _.map((A) => '"' + aa(A.bone, x) + '"').join(", "), V = _.map((A) => k_(A.inverse.clone().invert())).join(", ");
24475
- e.beginBlock('def Skeleton "Rig"'), e.appendLine(`uniform matrix4d[] bindTransforms = [${V}]`), e.appendLine(`uniform token[] joints = [${D}]`), e.appendLine('uniform token purpose = "guide"'), e.appendLine(`uniform matrix4d[] restTransforms = [${O.map((A) => k_(A)).join(", ")}]`);
24476
- const q = p(_.map((A) => A.bone));
24479
+ const L = _.map((A) => '"' + aa(A.bone, x) + '"').join(", "), W = _.map((A) => k_(A.inverse.clone().invert())).join(", ");
24480
+ e.beginBlock('def Skeleton "Rig"'), e.appendLine(`uniform matrix4d[] bindTransforms = [${W}]`), e.appendLine(`uniform token[] joints = [${L}]`), e.appendLine('uniform token purpose = "guide"'), e.appendLine(`uniform matrix4d[] restTransforms = [${O.map((A) => k_(A)).join(", ")}]`);
24481
+ const X = p(_.map((A) => A.bone));
24477
24482
  if (Sn) {
24478
- let A = 1e7, U = 0;
24479
- for (const W of q.position?.keys() ?? [])
24480
- A = Math.min(A, W), U = Math.max(U, W);
24481
- console.log("Time samples", A, U, q);
24483
+ let A = 1e7, $ = 0;
24484
+ for (const V of X.position?.keys() ?? [])
24485
+ A = Math.min(A, V), $ = Math.max($, V);
24486
+ console.log("Time samples", A, $, X);
24482
24487
  }
24483
- if (e.beginBlock('def SkelAnimation "_anim"'), e.appendLine(`uniform token[] joints = [${D}]`), e.appendLine(`quatf[] rotations = [${d(E)}]`), q && q.quaternion) {
24488
+ if (e.beginBlock('def SkelAnimation "_anim"'), e.appendLine(`uniform token[] joints = [${L}]`), e.appendLine(`quatf[] rotations = [${d(E)}]`), X && X.quaternion) {
24484
24489
  e.beginBlock("quatf[] rotations.timeSamples = {", "");
24485
- const A = a(q.quaternion);
24486
- for (const U of A)
24487
- e.appendLine(U);
24490
+ const A = a(X.quaternion);
24491
+ for (const $ of A)
24492
+ e.appendLine($);
24488
24493
  e.closeBlock();
24489
24494
  }
24490
- if (e.appendLine(`half3[] scales = [${h(z)}]`), q && q.scale) {
24495
+ if (e.appendLine(`half3[] scales = [${h(B)}]`), X && X.scale) {
24491
24496
  e.beginBlock("half3[] scales.timeSamples = {", "");
24492
- const A = r(q.scale);
24493
- for (const U of A)
24494
- e.appendLine(U);
24497
+ const A = r(X.scale);
24498
+ for (const $ of A)
24499
+ e.appendLine($);
24495
24500
  e.closeBlock();
24496
24501
  }
24497
- if (e.appendLine(`float3[] translations = [${h(k)}]`), q && q.position) {
24502
+ if (e.appendLine(`float3[] translations = [${h(k)}]`), X && X.position) {
24498
24503
  e.beginBlock("float3[] translations.timeSamples = {", "");
24499
- const A = r(q.position);
24500
- for (const U of A)
24501
- e.appendLine(U);
24504
+ const A = r(X.position);
24505
+ for (const $ of A)
24506
+ e.appendLine($);
24502
24507
  e.closeBlock();
24503
24508
  }
24504
24509
  e.closeBlock(), e.closeBlock();
@@ -24552,18 +24557,18 @@ class JM {
24552
24557
  }
24553
24558
  if (y)
24554
24559
  for (const { time: O, translation: k } of g.getValues(m, !0, !1, !1)) {
24555
- const z = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24556
- e.appendLine(z);
24560
+ const B = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24561
+ e.appendLine(B);
24557
24562
  }
24558
24563
  if (x)
24559
24564
  for (const { time: O, rotation: k } of g.getValues(m, !1, !0, !1)) {
24560
- const z = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.w)}, ${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24561
- e.appendLine(z);
24565
+ const B = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.w)}, ${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24566
+ e.appendLine(B);
24562
24567
  }
24563
24568
  if (I)
24564
24569
  for (const { time: O, scale: k } of g.getValues(m, !1, !1, !0)) {
24565
- const z = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24566
- e.appendLine(z);
24570
+ const B = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24571
+ e.appendLine(B);
24567
24572
  }
24568
24573
  }
24569
24574
  e.closeBlock();
@@ -24619,7 +24624,7 @@ var tR = Object.defineProperty, Fe = (s, e, t, i) => {
24619
24624
  };
24620
24625
  const A_ = w("debugusdzbehaviours");
24621
24626
  function xc(s) {
24622
- s && (s.getComponentInParent(Sa) || (L() && console.debug('Raycaster on "' + s.name + '" was automatically added, because no raycaster was found in the parent hierarchy.'), s.addComponent(Vi)));
24627
+ s && (s.getComponentInParent(Sa) || (D() && console.debug('Raycaster on "' + s.name + '" was automatically added, because no raycaster was found in the parent hierarchy.'), s.addComponent(Vi)));
24623
24628
  }
24624
24629
  class Da extends T {
24625
24630
  object;
@@ -24628,7 +24633,7 @@ class Da extends T {
24628
24633
  relativeMotion = !1;
24629
24634
  coroutine = null;
24630
24635
  targetPos = new b();
24631
- targetRot = new $();
24636
+ targetRot = new N();
24632
24637
  targetScale = new b();
24633
24638
  start() {
24634
24639
  xc(this.gameObject);
@@ -24685,7 +24690,7 @@ const hu = class zt extends T {
24685
24690
  variantMaterial;
24686
24691
  fadeDuration = 0;
24687
24692
  start() {
24688
- this._objectsWithThisMaterial = this.objectsWithThisMaterial, xc(this.gameObject), L() && this._objectsWithThisMaterial.length <= 0 && console.warn('ChangeMaterialOnClick: No objects found with material "' + this.materialToSwitch?.name + '"');
24693
+ this._objectsWithThisMaterial = this.objectsWithThisMaterial, xc(this.gameObject), D() && this._objectsWithThisMaterial.length <= 0 && console.warn('ChangeMaterialOnClick: No objects found with material "' + this.materialToSwitch?.name + '"');
24689
24694
  }
24690
24695
  onPointerEnter(e) {
24691
24696
  this.context.input.setCursor("pointer");
@@ -25024,7 +25029,7 @@ const cg = class yn extends T {
25024
25029
  afterSerialize() {
25025
25030
  if (yn.rootsWithExclusivePlayback.size > 1) {
25026
25031
  const e = 'Multiple root objects targeted by more than one animation. To work around QuickLook bug FB13410767, animations will be set as "exclusive" and activating them will stop other animations being marked as exclusive.';
25027
- L() && ge(e), console.warn(e, ...yn.rootsWithExclusivePlayback);
25032
+ D() && ge(e), console.warn(e, ...yn.rootsWithExclusivePlayback);
25028
25033
  }
25029
25034
  yn.animationActions = [], yn.rootsWithExclusivePlayback = /* @__PURE__ */ new Set();
25030
25035
  }
@@ -25033,7 +25038,7 @@ const cg = class yn extends T {
25033
25038
  const i = t.document, n = t.extensions.find((a) => a instanceof lg);
25034
25039
  if (!n) return;
25035
25040
  const o = n.getClipCount(this.target) > 1;
25036
- o && (L() && console.warn("Setting exclusive playback for " + this.target.name + "@" + this.stateName + " because it has " + n.getClipCount(this.target) + " animations. This works around QuickLook bug FB13410767."), yn.rootsWithExclusivePlayback.add(this.target));
25041
+ o && (D() && console.warn("Setting exclusive playback for " + this.target.name + "@" + this.stateName + " because it has " + n.getClipCount(this.target) + " animations. This works around QuickLook bug FB13410767."), yn.rootsWithExclusivePlayback.add(this.target));
25037
25042
  const r = this.name ? this.name : "";
25038
25043
  i.traverse((a) => {
25039
25044
  if (a.uuid === this.target?.uuid) {
@@ -25131,8 +25136,8 @@ const cg = class yn extends T {
25131
25136
  y.tracks = v.tracks.map((O) => {
25132
25137
  const k = O.clone();
25133
25138
  k.times = new Float32Array([0, I]);
25134
- const E = O.values.length, z = O.getValueSize(), D = O.values.slice(E - z, E);
25135
- return k.values = new Float32Array(2 * z), k.values.set(D, 0), k.values.set(D, z), k;
25139
+ const E = O.values.length, B = O.getValueSize(), L = O.values.slice(E - B, E);
25140
+ return k.values = new Float32Array(2 * B), k.values.set(L, 0), k.values.set(L, B), k;
25136
25141
  }), y.name = x, e.holdClipMap.set(v, y);
25137
25142
  }
25138
25143
  if (y) {
@@ -25275,11 +25280,11 @@ class ir {
25275
25280
  if (this._quicklookButton) return this._quicklookButton;
25276
25281
  const e = document.createElement("button");
25277
25282
  this._quicklookButton = e, e.dataset.needle = "quicklook-button";
25278
- const t = X.supportsQuickLookAR();
25283
+ const t = q.supportsQuickLookAR();
25279
25284
  e.innerText = "View in AR", e.prepend(Mt("view_in_ar"));
25280
25285
  let i = !1, n = null;
25281
25286
  return e.addEventListener("click", () => {
25282
- n = Qd(ws), n || (i = !0, n = new ws()), i && (n.objectToExport = N.Current.scene), n ? (e.classList.add("this-mode-is-requested"), n.exportAndOpen().then(() => {
25287
+ n = Qd(ws), n || (i = !0, n = new ws()), i && (n.objectToExport = U.Current.scene), n ? (e.classList.add("this-mode-is-requested"), n.exportAndOpen().then(() => {
25283
25288
  e.classList.remove("this-mode-is-requested");
25284
25289
  }).catch((o) => {
25285
25290
  e.classList.remove("this-mode-is-requested"), console.error(o);
@@ -25296,7 +25301,7 @@ class ir {
25296
25301
  createARButton(e) {
25297
25302
  if (this._arButton) return this._arButton;
25298
25303
  const t = "immersive-ar", i = document.createElement("button");
25299
- return this._arButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-ar-button", i.innerText = "Enter AR", i.prepend(Mt("view_in_ar")), i.title = "Click to start an AR session", i.addEventListener("click", () => K.start(t, e)), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), X.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
25304
+ return this._arButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-ar-button", i.innerText = "Enter AR", i.prepend(Mt("view_in_ar")), i.title = "Click to start an AR session", i.addEventListener("click", () => K.start(t, e)), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), q.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
25300
25305
  }
25301
25306
  /** get or create the WebXR VR button
25302
25307
  * @param init optional session init options
@@ -25308,7 +25313,7 @@ class ir {
25308
25313
  createVRButton(e) {
25309
25314
  if (this._vrButton) return this._vrButton;
25310
25315
  const t = "immersive-vr", i = document.createElement("button");
25311
- return this._vrButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-vr-button", i.innerText = "Enter VR", i.prepend(Mt("panorama_photosphere")), i.title = "Click to start a VR session", i.addEventListener("click", () => K.start(t, e)), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), X.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
25316
+ return this._vrButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-vr-button", i.innerText = "Enter VR", i.prepend(Mt("panorama_photosphere")), i.title = "Click to start a VR session", i.addEventListener("click", () => K.start(t, e)), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), q.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
25312
25317
  }
25313
25318
  /** get or create the Send To Quest button
25314
25319
  * Behaviour of the button:
@@ -25320,7 +25325,7 @@ class ir {
25320
25325
  return this._sendToQuestButton = t, t.dataset.needle = "webxr-sendtoquest-button", t.innerText = "Open on Quest", t.prepend(Mt("share_windows")), t.title = "Click to send this page to the Oculus Browser on your Quest", t.addEventListener("click", () => {
25321
25326
  const i = encodeURIComponent(window.location.href), n = e + i;
25322
25327
  window.open(n) == null && Be("This page doesn't allow popups. Please paste " + n + " into your browser.");
25323
- }), this.listenToXRSessionState(t), this.hideElementDuringXRSession(t), X.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => {
25328
+ }), this.listenToXRSessionState(t), this.hideElementDuringXRSession(t), q.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => {
25324
25329
  navigator.xr?.isSessionSupported("immersive-vr") ? t.style.display = "none" : t.style.display = "";
25325
25330
  }), t;
25326
25331
  }
@@ -25336,7 +25341,7 @@ class ir {
25336
25341
  return;
25337
25342
  }
25338
25343
  K.isSessionSupported(t).then((i) => {
25339
- e.style.display = i ? "" : "none", L() && !i && console.log('[WebXR] "' + t + '" is not supported on this device – make sure your server runs using HTTPS and you have a device connected that supports ' + t);
25344
+ e.style.display = i ? "" : "none", D() && !i && console.log('[WebXR] "' + t + '" is not supported on this device – make sure your server runs using HTTPS and you have a device connected that supports ' + t);
25340
25345
  });
25341
25346
  }
25342
25347
  hideElementDuringXRSession(e) {
@@ -25843,7 +25848,7 @@ class Ni extends T {
25843
25848
  }
25844
25849
  async onCreateAnchor(e, t) {
25845
25850
  if (t.createAnchor === void 0) {
25846
- console.warn("Hit does not support creating an anchor", t), L() && ge("Hit does not support creating an anchor");
25851
+ console.warn("Hit does not support creating an anchor", t), D() && ge("Hit does not support creating an anchor");
25847
25852
  return;
25848
25853
  } else {
25849
25854
  const i = await t.createAnchor(e.viewerPose.transform);
@@ -25948,7 +25953,7 @@ class vd {
25948
25953
  touchStart = (e) => {
25949
25954
  if (!e.defaultPrevented)
25950
25955
  for (let t = 0; t < e.changedTouches.length; t++) {
25951
- const i = e.changedTouches[t], n = X.isAndroidDevice() && i.clientY < window.innerHeight * 0.1;
25956
+ const i = e.changedTouches[t], n = q.isAndroidDevice() && i.clientY < window.innerHeight * 0.1;
25952
25957
  this.prev.has(i.identifier) || this.prev.set(i.identifier, {
25953
25958
  ignore: n,
25954
25959
  x: 0,
@@ -26100,10 +26105,10 @@ const Lv = function(s = null) {
26100
26105
  let i = "";
26101
26106
  typeof t == "string" ? i = t : i = t.name;
26102
26107
  let n = null, o;
26103
- typeof s == "string" ? o = e[s] : typeof s == "function" && (o = s), o == null && (L() || Ks) && s != null && console.warn('syncField: no callback function found for property "' + i + '"', '"' + s + '"');
26108
+ typeof s == "string" ? o = e[s] : typeof s == "function" && (o = s), o == null && (D() || Ks) && s != null && console.warn('syncField: no callback function found for property "' + i + '"', '"' + s + '"');
26104
26109
  const r = e, a = r.__internalAwake;
26105
26110
  if (typeof a != "function") {
26106
- (Ks || L()) && console.error('@syncField can currently only used on Needle Engine Components, custom object of type "' + e?.constructor?.name + '" is not supported', e);
26111
+ (Ks || D()) && console.error('@syncField can currently only used on Needle Engine Components, custom object of type "' + e?.constructor?.name + '" is not supported', e);
26107
26112
  return;
26108
26113
  }
26109
26114
  Ks && console.log(i);
@@ -26117,7 +26122,7 @@ const Lv = function(s = null) {
26117
26122
  set: function(f) {
26118
26123
  const p = this[l];
26119
26124
  if (this[l] = f, d) {
26120
- (L() || Ks) && console.warn("Recursive call detected", i);
26125
+ (D() || Ks) && console.warn("Recursive call detected", i);
26121
26126
  return;
26122
26127
  }
26123
26128
  d = !0;
@@ -26397,7 +26402,7 @@ class Es extends T {
26397
26402
  * Applies all configured options to the active {@link Context.menu}.
26398
26403
  */
26399
26404
  applyOptions() {
26400
- this.context.menu.setPosition(this.position), this.context.menu.showNeedleLogo(this.showNeedleLogo), this.createFullscreenButton === !0 && this.context.menu.showFullscreenOption(!0), this.createMuteButton === !0 && this.context.menu.showAudioPlaybackOption(!0), this.showSpatialMenu === !0 && this.context.menu.showSpatialMenu(this.showSpatialMenu), this.createQRCodeButton === !0 && (X.isMobileDevice() || this.context.menu.showQRCodeButton(!0));
26405
+ this.context.menu.setPosition(this.position), this.context.menu.showNeedleLogo(this.showNeedleLogo), this.createFullscreenButton === !0 && this.context.menu.showFullscreenOption(!0), this.createMuteButton === !0 && this.context.menu.showAudioPlaybackOption(!0), this.showSpatialMenu === !0 && this.context.menu.showSpatialMenu(this.showSpatialMenu), this.createQRCodeButton === !0 && (q.isMobileDevice() || this.context.menu.showQRCodeButton(!0));
26401
26406
  }
26402
26407
  }
26403
26408
  ja([
@@ -26423,7 +26428,7 @@ var mR = Object.defineProperty, ug = (s, e, t, i) => {
26423
26428
  (r = s[o]) && (n = r(e, t, n) || n);
26424
26429
  return n && mR(e, t, n), n;
26425
26430
  };
26426
- const rl = w("debugwebxr"), L_ = new $().setFromAxisAngle(new b(0, 1, 0), Math.PI);
26431
+ const rl = w("debugwebxr"), L_ = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
26427
26432
  class lr extends T {
26428
26433
  head;
26429
26434
  leftHand;
@@ -26646,7 +26651,7 @@ class uo extends T {
26646
26651
  }
26647
26652
  async loadHandModel(e, t) {
26648
26653
  const i = this.context, n = i.renderer.xr.getHand(t.index);
26649
- n || (Jn ? F.DrawLabel(t.rayWorldPosition, "No hand found for index " + t.index, 0.05, 5) : console.warn("No hand found for index " + t.index));
26654
+ n || (Jn ? z.DrawLabel(t.rayWorldPosition, "No hand found for index " + t.index, 0.05, 5) : console.warn("No hand found for index " + t.index));
26650
26655
  const o = new Ps();
26651
26656
  $m(o, i), await Fp(o, i, this.sourceId ?? "");
26652
26657
  const r = uv(o);
@@ -26659,7 +26664,7 @@ class uo extends T {
26659
26664
  const f = r?.gltf;
26660
26665
  f?.scene.children?.length === 0 && (f.scene.children[0] = d), r?.gltf && jn().createBuiltinComponents(e.context, e.sourceId || a, r.gltf, null, r), d.traverse((p) => {
26661
26666
  p.layers.set(2), K.active?.isPassThrough && !l && this.makeOccluder(p), p instanceof H && We.assignMeshLOD(p, 0);
26662
- }), t.connected || (Jn && F.DrawLabel(t.rayWorldPosition, "Hand is loaded but not connected anymore", 0.05, 5), d.removeFromParent());
26667
+ }), t.connected || (Jn && z.DrawLabel(t.rayWorldPosition, "Hand is loaded but not connected anymore", 0.05, 5), d.removeFromParent());
26663
26668
  });
26664
26669
  if (Jn && c.add(new mi(0.5)), t.inputSource.hand) {
26665
26670
  Jn && console.log(t.inputSource.hand);
@@ -26669,7 +26674,7 @@ class uo extends T {
26669
26674
  f.matrixAutoUpdate = !1, f.visible = !0, n.joints[d.jointName] = f, n.add(f);
26670
26675
  }
26671
26676
  } else
26672
- Jn && F.DrawLabel(t.rayWorldPosition, "No inputSource.hand found for index " + t.index, 0.05, 5);
26677
+ Jn && z.DrawLabel(t.rayWorldPosition, "No inputSource.hand found for index " + t.index, 0.05, 5);
26673
26678
  return { handObject: c, handmesh: h };
26674
26679
  }
26675
26680
  makeOccluder(e) {
@@ -26784,9 +26789,9 @@ class Gi extends T {
26784
26789
  if (this.useTeleportTarget && !S.getComponentInParent(n.object, fg))
26785
26790
  return;
26786
26791
  const r = o.clone();
26787
- if (jf && F.DrawSphere(o, 0.025, 16711680, 5), this.context.mainCamera?.position) {
26792
+ if (jf && z.DrawSphere(o, 0.025, 16711680, 5), this.context.mainCamera?.position) {
26788
26793
  const l = this.context.xr?.getUserOffsetInRig();
26789
- l && (l.y = 0, r.sub(l), jf && F.DrawWireSphere(l.add(r), 0.025, 65280, 5));
26794
+ l && (l.y = 0, r.sub(l), jf && z.DrawWireSphere(l.add(r), 0.025, 65280, 5));
26790
26795
  }
26791
26796
  this._teleportBuffer.push(t.matrix.clone()), this._teleportBuffer.length > 10 && this._teleportBuffer.shift(), this.useTeleportFade ? e.xr.fadeTransition()?.then(() => {
26792
26797
  t.worldPosition = r;
@@ -26849,7 +26854,7 @@ class Gi extends T {
26849
26854
  if (c || (c = l[0]), n && (n.controller = i, n.hit = c), this._hitDistances[t] = c?.distance || null, c) {
26850
26855
  this._lastHitDistances[t] = c.distance;
26851
26856
  const h = e.rigScale ?? 1;
26852
- jf && (F.DrawWireSphere(c.point, 0.025 * h, 16711680), F.DrawLabel(G(0, 0.2, 0).add(c.point), c.object.name, 0.02, 0)), n || (n = this.createHitPointObject(), this._hitDiscs[t] = n), n.hit = c, n.visible = c.distance > h * 0.05;
26857
+ jf && (z.DrawWireSphere(c.point, 0.025 * h, 16711680), z.DrawLabel(G(0, 0.2, 0).add(c.point), c.object.name, 0.02, 0)), n || (n = this.createHitPointObject(), this._hitDiscs[t] = n), n.hit = c, n.visible = c.distance > h * 0.05;
26853
26858
  let d = 0.01 * (h + c.distance);
26854
26859
  const f = i.getButton("primary")?.pressed;
26855
26860
  f && (d *= 1.1), n.scale.set(d, d, d), n.layers.set(2);
@@ -27074,7 +27079,7 @@ const al = w("debugwebxr"), vR = w("debugusdz"), rt = class Wr extends T {
27074
27079
  for (const o of this.context.scene.children)
27075
27080
  n.add(o);
27076
27081
  this.context.scene.add(n), i = S.addComponent(n, Ni), this._createdComponentsInSession.push(i);
27077
- } else (al || L()) && console.warn("WebXR: No WebARSessionRoot found in scene and usePlacementReticle is disabled in WebXR component.");
27082
+ } else (al || D()) && console.warn("WebXR: No WebARSessionRoot found in scene and usePlacementReticle is disabled in WebXR component.");
27078
27083
  this._activeWebARSessionRoot = i, i && (i.customReticle = this.customARPlacementReticle, i.arScale = this.arScale, i.arTouchTransform = this.usePlacementAdjustment, i.autoPlace = this.autoPlace, i.autoCenter = this.autoCenter, i.useXRAnchor = this.useXRAnchor);
27079
27084
  }
27080
27085
  this.useDefaultControls && this.setDefaultMovementEnabled(!0), (this.showControllerModels || this.showHandModels) && this.setDefaultControllerRenderingEnabled(!0), this.useSpatialGrab && (this._spatialGrabRaycaster = S.findObjectOfType(Ca) ?? void 0, this._spatialGrabRaycaster || (this._spatialGrabRaycaster = this.gameObject.addComponent(Ca))), this.createLocalAvatar(e.xr), e.xr.isScreenBasedAR || (this._exitXRMenuButton = this.context.menu.appendChild({
@@ -27157,7 +27162,7 @@ const al = w("debugwebxr"), vR = w("debugusdz"), rt = class Wr extends T {
27157
27162
  */
27158
27163
  handleCreatingHTML() {
27159
27164
  if (this.createARButton || this.createVRButton || this.useQuicklookExport) {
27160
- if ((X.isiOS() && X.isSafari() || vR) && this.useQuicklookExport) {
27165
+ if ((q.isiOS() && q.isSafari() || vR) && this.useQuicklookExport) {
27161
27166
  const t = S.findObjectOfType(ws);
27162
27167
  if (!t || t && t.allowCreateQuicklookButton) {
27163
27168
  const i = this.getButtonsFactory().createQuicklookButton();
@@ -27173,7 +27178,7 @@ const al = w("debugwebxr"), vR = w("debugusdz"), rt = class Wr extends T {
27173
27178
  this.addButton(t, 50);
27174
27179
  }
27175
27180
  }
27176
- if (this.createSendToQuestButton && !X.isQuest() && K.isVRSupported().then((t) => {
27181
+ if (this.createSendToQuestButton && !q.isQuest() && K.isVRSupported().then((t) => {
27177
27182
  if (!t) {
27178
27183
  const i = this.getButtonsFactory().createSendToQuestButton();
27179
27184
  this.addButton(i, 50);
@@ -27181,8 +27186,8 @@ const al = w("debugwebxr"), vR = w("debugusdz"), rt = class Wr extends T {
27181
27186
  }), this.createQRCode) {
27182
27187
  const t = Qd(Es);
27183
27188
  if (t && t.createQRCodeButton === !1)
27184
- L() && console.warn("WebXR: QRCode button is disabled in the Needle Menu component");
27185
- else if (!X.isMobileDevice()) {
27189
+ D() && console.warn("WebXR: QRCode button is disabled in the Needle Menu component");
27190
+ else if (!q.isMobileDevice()) {
27186
27191
  const i = On.getOrCreate().createQRCode();
27187
27192
  this.addButton(i, 50);
27188
27193
  }
@@ -27587,7 +27592,7 @@ class PR {
27587
27592
  width;
27588
27593
  height;
27589
27594
  }
27590
- const en = new b(), ll = new te(), gh = new $(), Ba = class zv extends hn {
27595
+ const en = new b(), ll = new te(), gh = new N(), Ba = class zv extends hn {
27591
27596
  get parent() {
27592
27597
  return this._parentRectTransform;
27593
27598
  }
@@ -28503,8 +28508,8 @@ class vo extends Si {
28503
28508
  a ? m += this.padding.left : m += this.padding.top;
28504
28509
  let v = 0, y = 0;
28505
28510
  for (let E = 0; E < this.gameObject.children.length; E++) {
28506
- const z = this.gameObject.children[E], D = S.getComponent(z, zn);
28507
- D?.activeAndEnabled && (y += 1, a ? v += D.width : v += D.height);
28511
+ const B = this.gameObject.children[E], L = S.getComponent(B, zn);
28512
+ L?.activeAndEnabled && (y += 1, a ? v += L.width : v += L.height);
28508
28513
  }
28509
28514
  let x = 0;
28510
28515
  const I = this.spacing * (y - 1);
@@ -28516,20 +28521,20 @@ class vo extends Si {
28516
28521
  O += this.padding.left, O -= this.padding.right, _ !== 0 && (m = g - v, m *= _, m -= I * _, a ? (m -= this.padding.right * _, m += this.padding.left * (1 - _), m < this.padding.left && (m = this.padding.left)) : (m -= this.padding.bottom * _, m += this.padding.top * (1 - _), m < this.padding.top && (m = this.padding.top)));
28517
28522
  let k = 1;
28518
28523
  for (let E = 0; E < this.gameObject.children.length; E++) {
28519
- const z = this.gameObject.children[E], D = S.getComponent(z, zn);
28520
- if (D?.activeAndEnabled) {
28521
- D.pivot?.set(0.5, 0.5), D.anchorMin.set(0, 1), D.anchorMax.set(0, 1);
28522
- const V = i * 0.5 + O * 0.5;
28523
- D.anchoredPosition.x !== V && (D.anchoredPosition.x = V);
28524
- const q = o * -0.5;
28525
- D.anchoredPosition.y !== q && (D.anchoredPosition.y = q), f && h && D.sizeDelta[l] !== p && (D.sizeDelta[l] = p), d && c && D.sizeDelta[t] !== x && (D.sizeDelta[t] = x);
28526
- const A = a ? D.width : D.height, U = A * 0.5;
28527
- if (m += U, d) {
28524
+ const B = this.gameObject.children[E], L = S.getComponent(B, zn);
28525
+ if (L?.activeAndEnabled) {
28526
+ L.pivot?.set(0.5, 0.5), L.anchorMin.set(0, 1), L.anchorMax.set(0, 1);
28527
+ const W = i * 0.5 + O * 0.5;
28528
+ L.anchoredPosition.x !== W && (L.anchoredPosition.x = W);
28529
+ const X = o * -0.5;
28530
+ L.anchoredPosition.y !== X && (L.anchoredPosition.y = X), f && h && L.sizeDelta[l] !== p && (L.sizeDelta[l] = p), d && c && L.sizeDelta[t] !== x && (L.sizeDelta[t] = x);
28531
+ const A = a ? L.width : L.height, $ = A * 0.5;
28532
+ if (m += $, d) {
28528
28533
  const ne = x * k - x * 0.5;
28529
- ne > m && (m = ne - x * 0.5 + A + this.padding.left, m -= U);
28534
+ ne > m && (m = ne - x * 0.5 + A + this.padding.left, m -= $);
28530
28535
  }
28531
- let W = m;
28532
- t === "y" && (W = -W), D.anchoredPosition[t] !== W && (D.anchoredPosition[t] = W), m += U, m += this.spacing, k += 1;
28536
+ let V = m;
28537
+ t === "y" && (V = -V), L.anchoredPosition[t] !== V && (L.anchoredPosition[t] = V), m += $, m += this.spacing, k += 1;
28533
28538
  }
28534
28539
  }
28535
28540
  }
@@ -29064,7 +29069,7 @@ const ii = class Tl extends T {
29064
29069
  }
29065
29070
  /** @internal */
29066
29071
  onEnable() {
29067
- const e = X.supportsQuickLookAR(), t = X.isiOS() || X.isiPad();
29072
+ const e = q.supportsQuickLookAR(), t = q.isiOS() || q.isiPad();
29068
29073
  !this.button && (ni || e || t) && (this.allowCreateQuicklookButton && (this.button = this.createQuicklookButton()), this.lastCallback = this.quicklookCallback.bind(this), this.link = j_(this.context, e), this.link.addEventListener("message", this.lastCallback)), ni && Be("USDZ Exporter enabled: " + this.name), document.getElementById("open-in-ar")?.addEventListener("click", this.onClickedOpenInARElement), ic.registerExporter(this);
29069
29074
  }
29070
29075
  /** @internal */
@@ -29088,7 +29093,7 @@ const ii = class Tl extends T {
29088
29093
  */
29089
29094
  async exportAndOpen() {
29090
29095
  let e = this.exportFileName ?? this.objectToExport?.name ?? this.name;
29091
- if (e += "-" + OM(), bs() || (e !== "" && (e += "-"), e += "MadeWithNeedle"), this.link || (this.link = j_(this.context, X.supportsQuickLookAR())), this.customUsdzFile)
29096
+ if (e += "-" + OM(), bs() || (e !== "" && (e += "-"), e += "MadeWithNeedle"), this.link || (this.link = j_(this.context, q.supportsQuickLookAR())), this.customUsdzFile)
29092
29097
  return ni && console.log("Exporting custom usdz", this.customUsdzFile), this.openInQuickLook(this.customUsdzFile, e), null;
29093
29098
  if (!this.objectToExport)
29094
29099
  return console.warn("No object to export", this), null;
@@ -29128,19 +29133,19 @@ const ii = class Tl extends T {
29128
29133
  for (const k of O.sharedMeshes)
29129
29134
  if (k) {
29130
29135
  const E = We.assignMeshLOD(k, 0);
29131
- E instanceof Promise && n.push(new Promise((z, D) => {
29136
+ E instanceof Promise && n.push(new Promise((B, L) => {
29132
29137
  E.then(() => {
29133
- o++, le.report("export-usdz-textures", { message: "Loaded progressive mesh", currentStep: o, totalSteps: n.length }), z();
29134
- }).catch((V) => D(V));
29138
+ o++, le.report("export-usdz-textures", { message: "Loaded progressive mesh", currentStep: o, totalSteps: n.length }), B();
29139
+ }).catch((W) => L(W));
29135
29140
  }));
29136
29141
  }
29137
29142
  for (const k of O.sharedMaterials)
29138
29143
  if (k) {
29139
29144
  const E = We.assignTextureLOD(k, 0);
29140
- E instanceof Promise && n.push(new Promise((z, D) => {
29145
+ E instanceof Promise && n.push(new Promise((B, L) => {
29141
29146
  E.then(() => {
29142
- o++, le.report("export-usdz-textures", { message: "Loaded progressive texture", currentStep: o, totalSteps: n.length }), z();
29143
- }).catch((V) => D(V));
29147
+ o++, le.report("export-usdz-textures", { message: "Loaded progressive texture", currentStep: o, totalSteps: n.length }), B();
29148
+ }).catch((W) => L(W));
29144
29149
  }));
29145
29150
  }
29146
29151
  }
@@ -29150,7 +29155,7 @@ const ii = class Tl extends T {
29150
29155
  const a = new FM(), l = new lg(this.quickLookCompatible);
29151
29156
  let c;
29152
29157
  const h = [];
29153
- this.interactive && (h.push(new Bv()), h.push(new La()), globalThis.NEEDLE_USE_RAPIER && S.getComponentsInChildren(e, ft).length > 0 && (this.physics ? (c = new Fv(), h.push(c)) : L() && console.warn("USDZExporter: Physics export is disabled, but there are active Rigidbody components in the scene. They will not be exported.")), h.push(new gg()), h.push(new Qv()));
29158
+ this.interactive && (h.push(new Bv()), h.push(new La()), globalThis.NEEDLE_USE_RAPIER && S.getComponentsInChildren(e, ft).length > 0 && (this.physics ? (c = new Fv(), h.push(c)) : D() && console.warn("USDZExporter: Physics export is disabled, but there are active Rigidbody components in the scene. They will not be exported.")), h.push(new gg()), h.push(new Qv()));
29154
29159
  const d = [l, ...h, ...this.extensions], f = { self: this, exporter: a, extensions: d, object: e };
29155
29160
  le.report("export-usdz", "Invoking before-export"), this.dispatchEvent(new CustomEvent("before-export", { detail: f })), this.applyWebARSessionRoot(), this._previousTimeScale = this.context.time.timeScale, this.context.time.timeScale = 0, le.report("export-usdz", "auto export animations and audio sources");
29156
29161
  const p = new Array();
@@ -29161,11 +29166,11 @@ const ii = class Tl extends T {
29161
29166
  const E = S.getComponent(O, Hi);
29162
29167
  return E && !E.enabled && (k = !1), k && _.includes(O) && (k = !1), k && S.getComponentInParent(O, ou) && (k = !1), k && S.getComponentInParent(O, Ms) && (k = !1), ni && !k && console.log("USDZExporter: Discarding object", O), k;
29163
29168
  }, a.beforeWritingDocument = () => {
29164
- if (L() && l && c) {
29169
+ if (D() && l && c) {
29165
29170
  const O = l.animatedRoots;
29166
29171
  for (const k of O) {
29167
- const E = S.getComponentsInChildren(k, ft).filter((D) => D.enabled), z = S.getComponents(k, wi).filter((D) => D.enabled && !D.isTrigger);
29168
- (E.length > 0 || z.length > 0) && console.error("An animated object has physics components in its child hierarchy. This can lead to undefined behaviour due to a bug in Apple's QuickLook (FB15925487). Remove the physics components from child objects or verify that you get the expected results.", k);
29172
+ const E = S.getComponentsInChildren(k, ft).filter((L) => L.enabled), B = S.getComponents(k, wi).filter((L) => L.enabled && !L.isTrigger);
29173
+ (E.length > 0 || B.length > 0) && console.error("An animated object has physics components in its child hierarchy. This can lead to undefined behaviour due to a bug in Apple's QuickLook (FB15925487). Remove the physics components from child objects or verify that you get the expected results.", k);
29169
29174
  }
29170
29175
  }
29171
29176
  };
@@ -29237,10 +29242,10 @@ const ii = class Tl extends T {
29237
29242
  return this.customBranding && Object.assign(e, this.customBranding), bs() || (console.log("Custom Quicklook banner text requires pro license: https://needle.tools/pricing"), e.callToAction = "Close", e.checkoutTitle = "🌵 Made with Needle", e.checkoutSubtitle = "_"), (e.callToAction?.length || e.checkoutTitle?.length || e.checkoutSubtitle?.length) && (e.callToAction?.length || (e.callToAction = "\0"), e.checkoutTitle?.length || (e.checkoutTitle = "\0"), e.checkoutSubtitle?.length || (e.checkoutSubtitle = "\0")), this.dispatchEvent(new CustomEvent("quicklook-overlay", { detail: e })), e;
29238
29243
  }
29239
29244
  static invertForwardMatrix = new te().makeRotationY(Math.PI);
29240
- static invertForwardQuaternion = new $().setFromEuler(new Rt(0, Math.PI, 0));
29245
+ static invertForwardQuaternion = new N().setFromEuler(new Rt(0, Math.PI, 0));
29241
29246
  _rootSessionRootWasAppliedTo = null;
29242
29247
  _rootPositionBeforeExport = new b();
29243
- _rootRotationBeforeExport = new $();
29248
+ _rootRotationBeforeExport = new N();
29244
29249
  _rootScaleBeforeExport = new b();
29245
29250
  getARScaleAndTarget() {
29246
29251
  if (!this.objectToExport) return { scale: 1, _invertForward: !1, target: this.gameObject, sessionRoot: null };
@@ -29984,7 +29989,7 @@ class Na extends T {
29984
29989
  a.projectPoint(e, c), e.copy(c);
29985
29990
  }
29986
29991
  this.affectPosition && ut(this.gameObject, e);
29987
- const n = new Rt(this.rotationOffset.x, this.rotationOffset.y, this.rotationOffset.z), o = new $().setFromEuler(n);
29992
+ const n = new Rt(this.rotationOffset.x, this.rotationOffset.y, this.rotationOffset.z), o = new N().setFromEuler(n);
29988
29993
  this.affectRotation && an(this.gameObject, t.multiply(o));
29989
29994
  const r = new b();
29990
29995
  this.from.getWorldDirection(r).multiplyScalar(50), this.levelLookDirection && (r.y = 0), this.alignLookDirection && this.gameObject.lookAt(r);
@@ -30601,7 +30606,7 @@ const Ke = class Il {
30601
30606
  if (i && (n *= this.system.worldScale.x), this.enabled) {
30602
30607
  switch (this.shapeType) {
30603
30608
  case 5:
30604
- bh && F.DrawWireBox(this.position, this.scale, 14540253, 1), this._vector.x = Math.random() * this.scale.x - this.scale.x / 2, this._vector.y = Math.random() * this.scale.y - this.scale.y / 2, this._vector.z = Math.random() * this.scale.z - this.scale.z / 2, this._vector.add(t);
30609
+ bh && z.DrawWireBox(this.position, this.scale, 14540253, 1), this._vector.x = Math.random() * this.scale.x - this.scale.x / 2, this._vector.y = Math.random() * this.scale.y - this.scale.y / 2, this._vector.z = Math.random() * this.scale.z - this.scale.z / 2, this._vector.add(t);
30605
30610
  break;
30606
30611
  case 4:
30607
30612
  this.randomConePoint(this.position, this.angle, n, this.radiusThickness, this.arc, this.arcMode, this._vector);
@@ -30643,12 +30648,12 @@ const Ke = class Il {
30643
30648
  }
30644
30649
  break;
30645
30650
  default:
30646
- this._vector.set(0, 0, 0), L() && !globalThis.__particlesystem_shapetype_unsupported && (console.warn("ParticleSystem ShapeType is not supported:", Gp[this.shapeType]), globalThis.__particlesystem_shapetype_unsupported = !0);
30651
+ this._vector.set(0, 0, 0), D() && !globalThis.__particlesystem_shapetype_unsupported && (console.warn("ParticleSystem ShapeType is not supported:", Gp[this.shapeType]), globalThis.__particlesystem_shapetype_unsupported = !0);
30647
30652
  break;
30648
30653
  }
30649
30654
  this.randomizePosition(this._vector, this.randomPositionAmount);
30650
30655
  }
30651
- this.applyRotation(this._vector), i && (this._vector.applyQuaternion(this.system.worldQuaternion), this._vector.add(this.system.worldPos)), bh && F.DrawSphere(this._vector, 0.03, 16711680, 0.5, !0);
30656
+ this.applyRotation(this._vector), i && (this._vector.applyQuaternion(this.system.worldQuaternion), this._vector.add(this.system.worldPos)), bh && z.DrawSphere(this._vector, 0.03, 16711680, 0.5, !0);
30652
30657
  }
30653
30658
  _dir = new b();
30654
30659
  getDirection(e, t) {
@@ -30695,9 +30700,9 @@ const Ke = class Il {
30695
30700
  this._dir.set(0, 0, 1);
30696
30701
  break;
30697
30702
  }
30698
- return this._space === 1 && this._dir.applyQuaternion(this.system.worldQuaternion), this.applyRotation(this._dir), this._dir.normalize(), this.spherizeDirection(this._dir, this.sphericalDirectionAmount), this.randomizeDirection(this._dir, this.randomDirectionAmount), bh && (F.DrawSphere(t, 0.01, 8925952, 0.5, !0), F.DrawDirection(t, this._dir, 8925952, 0.5, !0)), this._dir;
30703
+ return this._space === 1 && this._dir.applyQuaternion(this.system.worldQuaternion), this.applyRotation(this._dir), this._dir.normalize(), this.spherizeDirection(this._dir, this.sphericalDirectionAmount), this.randomizeDirection(this._dir, this.randomDirectionAmount), bh && (z.DrawSphere(t, 0.01, 8925952, 0.5, !0), z.DrawDirection(t, this._dir, 8925952, 0.5, !0)), this._dir;
30699
30704
  }
30700
- static _randomQuat = new $();
30705
+ static _randomQuat = new N();
30701
30706
  static _tempVec = new b();
30702
30707
  randomizePosition(e, t) {
30703
30708
  if (t <= 0) return;
@@ -31056,7 +31061,7 @@ class Ve {
31056
31061
  if (!this.enabled) return;
31057
31062
  const l = r / a, c = this.speedModifier.evaluate(l) * this.speedModifierMultiplier, h = this.x.evaluate(l), d = this.y.evaluate(l), f = this.z.evaluate(l);
31058
31063
  if (this._temp.set(-h, d, f), this._system && this._system.main.simulationSpace === 1 && this._temp.applyQuaternion(this._system.worldQuaternion), this._hasOrbital && this._system?.worldPos) {
31059
- const g = this._temp2.set(i.x, i.y, i.z), _ = this.orbitalXMultiplier, m = this.orbitalYMultiplier, v = this.orbitalZMultiplier, y = c * Math.PI * 2 * 10, x = Math.cos(y * _), I = Math.sin(y * _), O = Math.cos(y * m), k = Math.sin(y * m), E = Math.cos(y * v), z = Math.sin(y * v), D = g.x * (O * E) + g.y * (O * z) + g.z * -k, V = g.x * (I * k * E - x * z) + g.y * (I * k * z + x * E) + g.z * (I * O), q = g.x * (x * k * E + I * z) + g.y * (x * k * z - I * E) + g.z * (x * O), A = this._temp3.set(g.x - D, g.y - V, g.z - q);
31064
+ const g = this._temp2.set(i.x, i.y, i.z), _ = this.orbitalXMultiplier, m = this.orbitalYMultiplier, v = this.orbitalZMultiplier, y = c * Math.PI * 2 * 10, x = Math.cos(y * _), I = Math.sin(y * _), O = Math.cos(y * m), k = Math.sin(y * m), E = Math.cos(y * v), B = Math.sin(y * v), L = g.x * (O * E) + g.y * (O * B) + g.z * -k, W = g.x * (I * k * E - x * B) + g.y * (I * k * B + x * E) + g.z * (I * O), X = g.x * (x * k * E + I * B) + g.y * (x * k * B - I * E) + g.z * (x * O), A = this._temp3.set(g.x - L, g.y - W, g.z - X);
31060
31065
  A.normalize(), A.multiplyScalar(0.2 / o * Math.max(this.orbitalXMultiplier, this.orbitalYMultiplier, this.orbitalZMultiplier)), n.x += A.x, n.y += A.y, n.z += A.z;
31061
31066
  }
31062
31067
  n.x += this._temp.x, n.y += this._temp.y, n.z += this._temp.z, n.x *= c, n.y *= c, n.z *= c;
@@ -31493,7 +31498,7 @@ class iw {
31493
31498
  emitterType;
31494
31499
  emitterProbability;
31495
31500
  //private matrix_ = new Matrix4();
31496
- q_ = new $();
31501
+ q_ = new N();
31497
31502
  v_ = new b();
31498
31503
  v2_ = new b();
31499
31504
  _emitterMatrix = new Hu();
@@ -31569,7 +31574,7 @@ class fn extends T {
31569
31574
  cameraVelocityScale;
31570
31575
  lengthScale;
31571
31576
  start() {
31572
- if (this.maxParticleSize !== 0.5 && this.minParticleSize !== 0 && L()) {
31577
+ if (this.maxParticleSize !== 0.5 && this.minParticleSize !== 0 && D()) {
31573
31578
  const e = `ParticleSystem "${this.name}" has non-default min/max particle size. This may not render correctly. Please set min size to 0 and the max size to 0.5 and use the "StartSize" setting instead`;
31574
31579
  console.warn(e);
31575
31580
  }
@@ -32062,11 +32067,11 @@ const Dt = class $h extends T {
32062
32067
  get localspace() {
32063
32068
  return this.main.simulationSpace === dc.Local;
32064
32069
  }
32065
- __worldQuaternion = new $();
32070
+ __worldQuaternion = new N();
32066
32071
  get worldQuaternion() {
32067
32072
  return this.__worldQuaternion;
32068
32073
  }
32069
- _worldQuaternionInverted = new $();
32074
+ _worldQuaternionInverted = new N();
32070
32075
  get worldQuaternionInverted() {
32071
32076
  return this._worldQuaternionInverted;
32072
32077
  }
@@ -32111,7 +32116,7 @@ const Dt = class $h extends T {
32111
32116
  if (!this._particleSystem)
32112
32117
  return !1;
32113
32118
  const t = this._particleSystem.behaviors, i = t.indexOf(e);
32114
- return i !== -1 && ((L() || Xs) && console.debug("Remove custom ParticleSystem Behaviour", i, e), t.splice(i, 1)), !0;
32119
+ return i !== -1 && ((D() || Xs) && console.debug("Remove custom ParticleSystem Behaviour", i, e), t.splice(i, 1)), !0;
32115
32120
  }
32116
32121
  /** Removes all behaviours from the particle system
32117
32122
  * **Note:** this will also remove the default behaviours like SizeBehaviour, ColorBehaviour etc.
@@ -32248,7 +32253,7 @@ const Dt = class $h extends T {
32248
32253
  addSubParticleSystems() {
32249
32254
  if (this._subEmitterSystems && this._particleSystem)
32250
32255
  for (const e of this._subEmitterSystems) {
32251
- e.particleSystem && (e.particleSystem.__internalAwake ? e.particleSystem.__internalAwake() : L() && console.warn("SubParticleSystem serialization issue(?)", e.particleSystem, e));
32256
+ e.particleSystem && (e.particleSystem.__internalAwake ? e.particleSystem.__internalAwake() : D() && console.warn("SubParticleSystem serialization issue(?)", e.particleSystem, e));
32252
32257
  const t = e.particleSystem?._particleSystem;
32253
32258
  if (t) {
32254
32259
  e.particleSystem._isUsedAsSubsystem = !0;
@@ -32326,7 +32331,7 @@ function nw(s, e) {
32326
32331
  if (!s.unsupported_scaling_mode) {
32327
32332
  s.unsupported_scaling_mode = !0;
32328
32333
  const t = "ParticleSystem scale mode " + qp[s.main.scalingMode] + " is not supported";
32329
- L() && ge(t), console.warn(t, s.name, s);
32334
+ D() && ge(t), console.warn(t, s.name, s);
32330
32335
  }
32331
32336
  e = $e(s.gameObject, e);
32332
32337
  break;
@@ -32402,7 +32407,7 @@ function ST(s) {
32402
32407
  const t = s.scene;
32403
32408
  e = An(t, Zp);
32404
32409
  } else
32405
- L() && console.warn("No post processing manager found");
32410
+ D() && console.warn("No post processing manager found");
32406
32411
  return e;
32407
32412
  }
32408
32413
  const lt = {
@@ -32438,7 +32443,7 @@ var PT = Object.defineProperty, OT = Object.getOwnPropertyDescriptor, ow = (s, e
32438
32443
  return n && PT(e, t, n), n;
32439
32444
  };
32440
32445
  const kT = w("debugpost");
32441
- class B {
32446
+ class F {
32442
32447
  isVolumeParameter = !0;
32443
32448
  constructor(e) {
32444
32449
  e !== void 0 && this.initialize(e);
@@ -32492,20 +32497,20 @@ class B {
32492
32497
  }
32493
32498
  ow([
32494
32499
  u()
32495
- ], B.prototype, "overrideState");
32500
+ ], F.prototype, "overrideState");
32496
32501
  ow([
32497
32502
  u()
32498
- ], B.prototype, "value");
32503
+ ], F.prototype, "value");
32499
32504
  class MT extends Xi {
32500
32505
  constructor() {
32501
- super([B]);
32506
+ super([F]);
32502
32507
  }
32503
32508
  onSerialize(e, t) {
32504
32509
  }
32505
32510
  onDeserialize(e, t) {
32506
32511
  const i = t.target, n = t.path;
32507
32512
  let o;
32508
- if (i && n && (o = i[n]), (typeof o != "object" || typeof o == "object" && o.isVolumeParameter !== !0) && (o = new B()), typeof e == "object" && "value" in e) {
32513
+ if (i && n && (o = i[n]), (typeof o != "object" || typeof o == "object" && o.isVolumeParameter !== !0) && (o = new F()), typeof e == "object" && "value" in e) {
32509
32514
  const r = e.value;
32510
32515
  o.initialize(r), o.overrideState = e.overrideState;
32511
32516
  } else
@@ -32546,7 +32551,7 @@ class ot extends T {
32546
32551
  if (super(), e)
32547
32552
  for (const t of Object.keys(e)) {
32548
32553
  const i = e[t], n = this[t];
32549
- n instanceof B ? n.initialize(i) : n !== void 0 && (this[t] = i);
32554
+ n instanceof F ? n.initialize(i) : n !== void 0 && (this[t] = i);
32550
32555
  }
32551
32556
  }
32552
32557
  active = !0;
@@ -32583,14 +32588,14 @@ class ot extends T {
32583
32588
  const e = Object.keys(this);
32584
32589
  for (const t of e) {
32585
32590
  const i = this[t];
32586
- i instanceof B && i.__init();
32591
+ i instanceof F && i.__init();
32587
32592
  }
32588
32593
  }
32589
32594
  // TODO this is currently not used for post processing effects that are part of Volume stacks,
32590
32595
  // since these handle that already.
32591
32596
  onEditorModification(e) {
32592
32597
  const t = e.propertyName;
32593
- if (this[t] instanceof B) {
32598
+ if (this[t] instanceof F) {
32594
32599
  const i = e.value;
32595
32600
  return this[t].value = i, !0;
32596
32601
  }
@@ -32643,7 +32648,7 @@ class Cu extends ot {
32643
32648
  get typeName() {
32644
32649
  return "Antialiasing";
32645
32650
  }
32646
- preset = new B(2);
32651
+ preset = new F(2);
32647
32652
  // 2 is HIGH: https://github.com/pmndrs/postprocessing/blob/main/src/enums/SMAAPreset.js#L14
32648
32653
  onCreateEffect() {
32649
32654
  const e = new R.POSTPROCESSING.MODULE.SMAAEffect({
@@ -32658,7 +32663,7 @@ class Cu extends ot {
32658
32663
  }
32659
32664
  }
32660
32665
  jT([
32661
- u(B)
32666
+ u(F)
32662
32667
  ], Cu.prototype, "preset");
32663
32668
  pn("Antialiasing", Cu);
32664
32669
  var FT = Object.defineProperty, Mg = (s, e, t, i) => {
@@ -32672,9 +32677,9 @@ const Pu = class rw extends ot {
32672
32677
  get typeName() {
32673
32678
  return "Bloom";
32674
32679
  }
32675
- threshold = new B(0.9);
32676
- intensity = new B(1);
32677
- scatter = new B(0.7);
32680
+ threshold = new F(0.9);
32681
+ intensity = new F(1);
32682
+ scatter = new F(0.7);
32678
32683
  /**
32679
32684
  * Set to true to use selective bloom when the effect gets created.
32680
32685
  * @default false
@@ -32716,13 +32721,13 @@ const Pu = class rw extends ot {
32716
32721
  }
32717
32722
  };
32718
32723
  Mg([
32719
- u(B)
32724
+ u(F)
32720
32725
  ], Pu.prototype, "threshold");
32721
32726
  Mg([
32722
- u(B)
32727
+ u(F)
32723
32728
  ], Pu.prototype, "intensity");
32724
32729
  Mg([
32725
- u(B)
32730
+ u(F)
32726
32731
  ], Pu.prototype, "scatter");
32727
32732
  let Rg = Pu;
32728
32733
  pn("Bloom", Rg);
@@ -32735,7 +32740,7 @@ class Ou extends ot {
32735
32740
  get typeName() {
32736
32741
  return "ChromaticAberration";
32737
32742
  }
32738
- intensity = new B(0);
32743
+ intensity = new F(0);
32739
32744
  onCreateEffect() {
32740
32745
  const e = new R.POSTPROCESSING.MODULE.ChromaticAberrationEffect();
32741
32746
  return e.offset = new J(0, 0), e.radialModulation = !0, e.modulationOffset = 0.15, this.intensity.valueProcessor = (t) => t * 0.02, this.intensity.onValueChanged = (t) => {
@@ -32744,7 +32749,7 @@ class Ou extends ot {
32744
32749
  }
32745
32750
  }
32746
32751
  UT([
32747
- u(B)
32752
+ u(F)
32748
32753
  ], Ou.prototype, "intensity");
32749
32754
  pn("ChromaticAberration", Ou);
32750
32755
  var Dl = /* @__PURE__ */ ((s) => (s[s.None = 0] = "None", s[s.Neutral = 1] = "Neutral", s[s.ACES = 2] = "ACES", s[s.AgX = 3] = "AgX", s[s.KhronosNeutral = 4] = "KhronosNeutral", s))(Dl || {});
@@ -32807,8 +32812,8 @@ class hr extends ot {
32807
32812
  get typeName() {
32808
32813
  return "ToneMapping";
32809
32814
  }
32810
- mode = new B(void 0);
32811
- exposure = new B(1);
32815
+ mode = new F(void 0);
32816
+ exposure = new F(1);
32812
32817
  /** Set the tonemapping mode to e.g. "agx" */
32813
32818
  setMode(e) {
32814
32819
  const t = Dl[e];
@@ -32849,10 +32854,10 @@ class hr extends ot {
32849
32854
  }
32850
32855
  }
32851
32856
  aw([
32852
- u(B)
32857
+ u(F)
32853
32858
  ], hr.prototype, "mode");
32854
32859
  aw([
32855
- u(B)
32860
+ u(F)
32856
32861
  ], hr.prototype, "exposure");
32857
32862
  pn("Tonemapping", hr);
32858
32863
  var WT = Object.defineProperty, ku = (s, e, t, i) => {
@@ -32868,10 +32873,10 @@ class Sr extends ot {
32868
32873
  * Whether values for contrast, hueshift or saturation are remapped to a different range.
32869
32874
  */
32870
32875
  remap = !0;
32871
- postExposure = new B(1);
32872
- contrast = new B(0);
32873
- hueShift = new B(0);
32874
- saturation = new B(0);
32876
+ postExposure = new F(1);
32877
+ contrast = new F(0);
32878
+ hueShift = new F(0);
32879
+ saturation = new F(0);
32875
32880
  init() {
32876
32881
  this.postExposure.valueProcessor = (e) => (this.remap && (e = Math.pow(2, e)), e), this.contrast.valueProcessor = (e) => {
32877
32882
  if (!this.remap) return e;
@@ -32892,16 +32897,16 @@ class Sr extends ot {
32892
32897
  }
32893
32898
  }
32894
32899
  ku([
32895
- u(B)
32900
+ u(F)
32896
32901
  ], Sr.prototype, "postExposure");
32897
32902
  ku([
32898
- u(B)
32903
+ u(F)
32899
32904
  ], Sr.prototype, "contrast");
32900
32905
  ku([
32901
- u(B)
32906
+ u(F)
32902
32907
  ], Sr.prototype, "hueShift");
32903
32908
  ku([
32904
- u(B)
32909
+ u(F)
32905
32910
  ], Sr.prototype, "saturation");
32906
32911
  pn("ColorAdjustments", Sr);
32907
32912
  var VT = Object.defineProperty, Cr = (s, e, t, i) => {
@@ -32915,12 +32920,12 @@ class Gn extends ot {
32915
32920
  return "DepthOfField";
32916
32921
  }
32917
32922
  mode;
32918
- focusDistance = new B(1);
32919
- focalLength = new B(0.2);
32920
- aperture = new B(20);
32921
- gaussianMaxRadius = new B();
32922
- resolutionScale = new B(1 / window.devicePixelRatio);
32923
- bokehScale = new B();
32923
+ focusDistance = new F(1);
32924
+ focalLength = new F(0.2);
32925
+ aperture = new F(20);
32926
+ gaussianMaxRadius = new F();
32927
+ resolutionScale = new F(1 / window.devicePixelRatio);
32928
+ bokehScale = new F();
32924
32929
  init() {
32925
32930
  this.focalLength.valueProcessor = (t) => {
32926
32931
  const i = t / 300;
@@ -32954,22 +32959,22 @@ Cr([
32954
32959
  u()
32955
32960
  ], Gn.prototype, "mode");
32956
32961
  Cr([
32957
- u(B)
32962
+ u(F)
32958
32963
  ], Gn.prototype, "focusDistance");
32959
32964
  Cr([
32960
- u(B)
32965
+ u(F)
32961
32966
  ], Gn.prototype, "focalLength");
32962
32967
  Cr([
32963
- u(B)
32968
+ u(F)
32964
32969
  ], Gn.prototype, "aperture");
32965
32970
  Cr([
32966
- u(B)
32971
+ u(F)
32967
32972
  ], Gn.prototype, "gaussianMaxRadius");
32968
32973
  Cr([
32969
- u(B)
32974
+ u(F)
32970
32975
  ], Gn.prototype, "resolutionScale");
32971
32976
  Cr([
32972
- u(B)
32977
+ u(F)
32973
32978
  ], Gn.prototype, "bokehScale");
32974
32979
  pn("DepthOfField", Gn);
32975
32980
  class xd extends ot {
@@ -32993,7 +32998,7 @@ class Mu extends ot {
32993
32998
  get typeName() {
32994
32999
  return "PixelationEffect";
32995
33000
  }
32996
- granularity = new B(10);
33001
+ granularity = new F(10);
32997
33002
  onCreateEffect() {
32998
33003
  const e = new R.POSTPROCESSING.MODULE.PixelationEffect();
32999
33004
  return this.granularity.onValueChanged = (t) => {
@@ -33002,7 +33007,7 @@ class Mu extends ot {
33002
33007
  }
33003
33008
  }
33004
33009
  qT([
33005
- u(B)
33010
+ u(F)
33006
33011
  ], Mu.prototype, "granularity");
33007
33012
  pn("PixelationEffect", Mu);
33008
33013
  var XT = Object.defineProperty, Lc = (s, e, t, i) => {
@@ -33014,11 +33019,11 @@ class Co extends ot {
33014
33019
  get typeName() {
33015
33020
  return "ScreenSpaceAmbientOcclusion";
33016
33021
  }
33017
- intensity = new B(2);
33018
- falloff = new B(1);
33019
- samples = new B(9);
33020
- color = new B(new se(0, 0, 0));
33021
- luminanceInfluence = new B(0.7);
33022
+ intensity = new F(2);
33023
+ falloff = new F(1);
33024
+ samples = new F(9);
33025
+ color = new F(new se(0, 0, 0));
33026
+ luminanceInfluence = new F(0.7);
33022
33027
  onBeforeRender() {
33023
33028
  if (this._ssao && this.context.mainCamera instanceof pe) {
33024
33029
  const e = this.context.mainCamera.far - this.context.mainCamera.near;
@@ -33058,19 +33063,19 @@ class Co extends ot {
33058
33063
  }
33059
33064
  }
33060
33065
  Lc([
33061
- u(B)
33066
+ u(F)
33062
33067
  ], Co.prototype, "intensity");
33063
33068
  Lc([
33064
- u(B)
33069
+ u(F)
33065
33070
  ], Co.prototype, "falloff");
33066
33071
  Lc([
33067
- u(B)
33072
+ u(F)
33068
33073
  ], Co.prototype, "samples");
33069
33074
  Lc([
33070
- u(B)
33075
+ u(F)
33071
33076
  ], Co.prototype, "color");
33072
33077
  Lc([
33073
- u(B)
33078
+ u(F)
33074
33079
  ], Co.prototype, "luminanceInfluence");
33075
33080
  pn("ScreenSpaceAmbientOcclusion", Co);
33076
33081
  var QT = Object.defineProperty, Pr = (s, e, t, i) => {
@@ -33088,10 +33093,10 @@ class qn extends ot {
33088
33093
  return this._ssao;
33089
33094
  }
33090
33095
  gammaCorrection = !0;
33091
- aoRadius = new B(1);
33092
- falloff = new B(1);
33093
- intensity = new B(1);
33094
- color = new B(new se(0, 0, 0));
33096
+ aoRadius = new F(1);
33097
+ falloff = new F(1);
33098
+ intensity = new F(1);
33099
+ color = new F(new se(0, 0, 0));
33095
33100
  screenspaceRadius = !1;
33096
33101
  quality = 2;
33097
33102
  _ssao;
@@ -33129,16 +33134,16 @@ Pr([
33129
33134
  u()
33130
33135
  ], qn.prototype, "gammaCorrection");
33131
33136
  Pr([
33132
- u(B)
33137
+ u(F)
33133
33138
  ], qn.prototype, "aoRadius");
33134
33139
  Pr([
33135
- u(B)
33140
+ u(F)
33136
33141
  ], qn.prototype, "falloff");
33137
33142
  Pr([
33138
- u(B)
33143
+ u(F)
33139
33144
  ], qn.prototype, "intensity");
33140
33145
  Pr([
33141
- u(B)
33146
+ u(F)
33142
33147
  ], qn.prototype, "color");
33143
33148
  Pr([
33144
33149
  It(),
@@ -33265,12 +33270,12 @@ class Ls extends ot {
33265
33270
  get typeName() {
33266
33271
  return "TiltShiftEffect";
33267
33272
  }
33268
- offset = new B(0);
33269
- rotation = new B(0);
33270
- focusArea = new B(0.4);
33271
- feather = new B(0.3);
33272
- kernelSize = new B(2);
33273
- resolutionScale = new B(1 / window.devicePixelRatio);
33273
+ offset = new F(0);
33274
+ rotation = new F(0);
33275
+ focusArea = new F(0.4);
33276
+ feather = new F(0.3);
33277
+ kernelSize = new F(2);
33278
+ resolutionScale = new F(1 / window.devicePixelRatio);
33274
33279
  init() {
33275
33280
  this.offset.defaultValue = 0, this.rotation.defaultValue = 0, this.focusArea.defaultValue = 0.4, this.feather.defaultValue = 0.3, this.kernelSize.defaultValue = R.POSTPROCESSING.MODULE.KernelSize.MEDIUM, this.resolutionScale.defaultValue = 1 / window.devicePixelRatio;
33276
33281
  }
@@ -33286,22 +33291,22 @@ class Ls extends ot {
33286
33291
  }
33287
33292
  }
33288
33293
  Ha([
33289
- u(B)
33294
+ u(F)
33290
33295
  ], Ls.prototype, "offset");
33291
33296
  Ha([
33292
- u(B)
33297
+ u(F)
33293
33298
  ], Ls.prototype, "rotation");
33294
33299
  Ha([
33295
- u(B)
33300
+ u(F)
33296
33301
  ], Ls.prototype, "focusArea");
33297
33302
  Ha([
33298
- u(B)
33303
+ u(F)
33299
33304
  ], Ls.prototype, "feather");
33300
33305
  Ha([
33301
- u(B)
33306
+ u(F)
33302
33307
  ], Ls.prototype, "kernelSize");
33303
33308
  Ha([
33304
- u(B)
33309
+ u(F)
33305
33310
  ], Ls.prototype, "resolutionScale");
33306
33311
  pn("TiltShiftEffect", Ls);
33307
33312
  var tE = Object.defineProperty, Tg = (s, e, t, i) => {
@@ -33313,9 +33318,9 @@ class Ga extends ot {
33313
33318
  get typeName() {
33314
33319
  return "Vignette";
33315
33320
  }
33316
- color = new B({ r: 0, g: 0, b: 0, a: 1 });
33317
- intensity = new B(0);
33318
- center = new B({ x: 0.5, y: 0.5 });
33321
+ color = new F({ r: 0, g: 0, b: 0, a: 1 });
33322
+ intensity = new F(0);
33323
+ center = new F({ x: 0.5, y: 0.5 });
33319
33324
  init() {
33320
33325
  this.color.defaultValue = { r: 0, g: 0, b: 0, a: 1 }, this.intensity.defaultValue = 0, this.center.defaultValue = { x: 0.5, y: 0.5 };
33321
33326
  }
@@ -33333,13 +33338,13 @@ class Ga extends ot {
33333
33338
  }
33334
33339
  }
33335
33340
  Tg([
33336
- u(B)
33341
+ u(F)
33337
33342
  ], Ga.prototype, "color");
33338
33343
  Tg([
33339
- u(B)
33344
+ u(F)
33340
33345
  ], Ga.prototype, "intensity");
33341
33346
  Tg([
33342
- u(B)
33347
+ u(F)
33343
33348
  ], Ga.prototype, "center");
33344
33349
  pn("Vignette", Ga);
33345
33350
  globalThis.NEEDLE_USE_POSTPROCESSING = globalThis.NEEDLE_USE_POSTPROCESSING !== void 0 ? globalThis.NEEDLE_USE_POSTPROCESSING : !0;
@@ -33653,7 +33658,7 @@ class Dc extends T {
33653
33658
  if (!this.context.isInXR && (this.context.mainCamera && this._isDirty && this.apply(), this.context.composer && this._postprocessing && this._postprocessing.composer === this.context.composer)) {
33654
33659
  if (this.context.renderer.getContext().isContextLost() && this.context.renderer.forceContextRestore(), this.context.composer.getRenderer() !== this.context.renderer && this.context.composer.setRenderer(this.context.renderer), this.context.composer.setMainScene(this.context.scene), this.multisampling === "auto")
33655
33660
  if (this._postprocessing && this._postprocessing.hasSmaaEffect)
33656
- this._postprocessing.multisampling !== 0 && (this._postprocessing.multisampling = 0, (Bo || L()) && console.log(`[PostProcessing] multisampling is disabled because it's set to 'auto' on your PostprocessingManager/Volume component that also has an SMAA effect.
33661
+ this._postprocessing.multisampling !== 0 && (this._postprocessing.multisampling = 0, (Bo || D()) && console.log(`[PostProcessing] multisampling is disabled because it's set to 'auto' on your PostprocessingManager/Volume component that also has an SMAA effect.
33657
33662
 
33658
33663
  If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`));
33659
33664
  else {
@@ -33693,7 +33698,7 @@ If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`))
33693
33698
  _rapidApplyCount = 0;
33694
33699
  _isDirty = !1;
33695
33700
  apply() {
33696
- if (Bo && console.log(`Apply PostProcessing "${this.name || "unnamed"}"`), L() && (this._lastApplyTime !== void 0 && Date.now() - this._lastApplyTime < 100 && (this._rapidApplyCount++, this._rapidApplyCount === 5 && console.warn("Detected rapid post processing modifications - this might be a bug", this)), this._lastApplyTime = Date.now()), this._isDirty = !1, this._activeEffects.length = 0, this.sharedProfile?.components) {
33701
+ if (Bo && console.log(`Apply PostProcessing "${this.name || "unnamed"}"`), D() && (this._lastApplyTime !== void 0 && Date.now() - this._lastApplyTime < 100 && (this._rapidApplyCount++, this._rapidApplyCount === 5 && console.warn("Detected rapid post processing modifications - this might be a bug", this)), this._lastApplyTime = Date.now()), this._isDirty = !1, this._activeEffects.length = 0, this.sharedProfile?.components) {
33697
33702
  const e = this.sharedProfile.components;
33698
33703
  for (const t of e)
33699
33704
  t.active && t.enabled && !this._activeEffects.includes(t) && this._activeEffects.push(t);
@@ -33701,7 +33706,7 @@ If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`))
33701
33706
  for (const e of this._effects)
33702
33707
  e.active && e.enabled && !this._activeEffects.includes(e) && this._activeEffects.push(e);
33703
33708
  this._activeEffects.length > 0 ? (this._postprocessing || (this._postprocessing = new cw(this.context)), this._postprocessing.apply(this._activeEffects)?.then(() => {
33704
- this.activeAndEnabled && (this._applyPostQueue(), this._postprocessing ? (this.multisampling === "auto" ? this._postprocessing.multisampling = X.isMobileDevice() ? 2 : 4 : this._postprocessing.multisampling = Math.max(0, Math.min(this.multisampling, this.context.renderer.capabilities.maxSamples)), Bo && console.debug(`[PostProcessing] Set multisampling to ${this._postprocessing.multisampling} (Is Mobile: ${X.isMobileDevice()})`)) : Bo && console.warn("[PostProcessing] No composer found"));
33709
+ this.activeAndEnabled && (this._applyPostQueue(), this._postprocessing ? (this.multisampling === "auto" ? this._postprocessing.multisampling = q.isMobileDevice() ? 2 : 4 : this._postprocessing.multisampling = Math.max(0, Math.min(this.multisampling, this.context.renderer.capabilities.maxSamples)), Bo && console.debug(`[PostProcessing] Set multisampling to ${this._postprocessing.multisampling} (Is Mobile: ${q.isMobileDevice()})`)) : Bo && console.warn("[PostProcessing] No composer found"));
33705
33710
  })) : this._postprocessing?.unapply(!1);
33706
33711
  }
33707
33712
  _applyPostQueue() {
@@ -33730,14 +33735,14 @@ If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`))
33730
33735
  Sh.set(i, r);
33731
33736
  const a = Object.keys(o);
33732
33737
  for (const l of a)
33733
- o[l] instanceof B && r.push(l);
33738
+ o[l] instanceof F && r.push(l);
33734
33739
  }
33735
33740
  if (Sh.has(i)) {
33736
33741
  const r = n.toLowerCase(), a = Sh.get(i);
33737
33742
  for (const l of a)
33738
33743
  if (l.toLowerCase() === r) {
33739
33744
  const c = o[l];
33740
- c instanceof B && (t.length === 4 && t[3] === "active" ? (c.overrideState = e.value, this.scheduleRecreate()) : c && c.value !== void 0 && (c.value = e.value));
33745
+ c instanceof F && (t.length === 4 && t[3] === "active" ? (c.overrideState = e.value, this.scheduleRecreate()) : c && c.value !== void 0 && (c.value = e.value));
33741
33746
  return;
33742
33747
  }
33743
33748
  }
@@ -34474,7 +34479,7 @@ class pt extends T {
34474
34479
  return this.clip;
34475
34480
  }
34476
34481
  set audioOutputMode(e) {
34477
- e !== this._audioOutputMode && (e === 1 && L() && console.warn("VideoAudioOutputMode.AudioSource is not yet implemented"), this._audioOutputMode = e, this.updateVideoElementSettings());
34482
+ e !== this._audioOutputMode && (e === 1 && D() && console.warn("VideoAudioOutputMode.AudioSource is not yet implemented"), this._audioOutputMode = e, this.updateVideoElementSettings());
34478
34483
  }
34479
34484
  get audioOutputMode() {
34480
34485
  return this._audioOutputMode;
@@ -35046,7 +35051,7 @@ class Or extends T {
35046
35051
  }
35047
35052
  async internalShare(e) {
35048
35053
  if (this.context.connection.isInRoom === !1) {
35049
- console.warn("Can not start screensharing: requires network connection"), L() && ge("Can not start screensharing: requires network connection. Add a SyncedRoom component or join a room first.");
35054
+ console.warn("Can not start screensharing: requires network connection"), D() && ge("Can not start screensharing: requires network connection. Add a SyncedRoom component or join a room first.");
35050
35055
  return;
35051
35056
  }
35052
35057
  if (e?.device && (this.device = e.device), !this.videoPlayer && this.requiresVideoPlayer && (this._videoPlayer || (this._videoPlayer = S.getComponent(this.gameObject, pt) ?? void 0), this.videoPlayer || this._ensureVideoPlayer(), !this.videoPlayer)) {
@@ -35194,7 +35199,7 @@ class Or extends T {
35194
35199
  } else
35195
35200
  console.error("Failed to get user media", r.message, r.code, r);
35196
35201
  }
35197
- !n && L() && (ge("No camera found for sharing. Please connect a camera (see console for more information)"), console.warn("No camera found for sharing. Please connect a camera", i, this.deviceName, "Using deviceFilter? " + this.deviceFilter != null, "Using options? " + t != null, "Using deviceName? " + this.deviceName != null, "Using options.deviceId? " + t?.deviceId != null, "Using options.deviceFilter? " + t?.deviceFilter != null));
35202
+ !n && D() && (ge("No camera found for sharing. Please connect a camera (see console for more information)"), console.warn("No camera found for sharing. Please connect a camera", i, this.deviceName, "Using deviceFilter? " + this.deviceFilter != null, "Using options? " + t != null, "Using deviceName? " + this.deviceName != null, "Using options.deviceId? " + t?.deviceId != null, "Using options.deviceFilter? " + t?.deviceFilter != null));
35198
35203
  }
35199
35204
  // private _cameraSelectionWindow : Window | null = null;
35200
35205
  // private openWindowToSelectCamera(){
@@ -35536,7 +35541,7 @@ const Fc = class gw extends T {
35536
35541
  rotateFactor = 0.1;
35537
35542
  positionAxes = xl.All;
35538
35543
  flipForward = !1;
35539
- static _invertForward = new $().setFromAxisAngle(new b(0, 1, 0), Math.PI);
35544
+ static _invertForward = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
35540
35545
  _firstUpdate = !0;
35541
35546
  /**
35542
35547
  * Update the position and rotation of the GameObject to follow the target.
@@ -35973,7 +35978,7 @@ class OE {
35973
35978
  }
35974
35979
  }
35975
35980
  }
35976
- const kE = new $().setFromAxisAngle(new b(0, 1, 0), Math.PI);
35981
+ const kE = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
35977
35982
  class ME {
35978
35983
  context;
35979
35984
  spectator;
@@ -36255,7 +36260,7 @@ const _w = class tm extends T {
36255
36260
  for (const n in this.remoteCams) {
36256
36261
  const o = this.remoteCams[n], r = this.context.time.realtimeSinceStartup - o.lastUpdate;
36257
36262
  if (!o || r > this._camTimeoutInSeconds) {
36258
- L() && console.log("Remote cam timeout", n), o?.obj && S.destroy(o.obj), delete this.remoteCams[n], o && delete this.userToCamMap[o.userId], tm.instances.push(o), this.context.players.removePlayerView(o.userId, Zo.Browser);
36263
+ D() && console.log("Remote cam timeout", n), o?.obj && S.destroy(o.obj), delete this.remoteCams[n], o && delete this.userToCamMap[o.userId], tm.instances.push(o), this.context.players.removePlayerView(o.userId, Zo.Browser);
36259
36264
  continue;
36260
36265
  }
36261
36266
  }
@@ -36370,7 +36375,7 @@ class Xn extends T {
36370
36375
  return this.tryJoinRoom(e + 1);
36371
36376
  } else
36372
36377
  this.joinRandomRoom && (this.roomName === null || this.roomName === void 0 || this.roomName.length <= 0) && (this.roomName = this.generateRoomName());
36373
- return this.requireRoomParameter && !t ? ((Kf || L()) && console.warn('[SyncedRoom] Missing required room parameter "' + this.urlParameterName + `" in url - will not connect.
36378
+ return this.requireRoomParameter && !t ? ((Kf || D()) && console.warn('[SyncedRoom] Missing required room parameter "' + this.urlParameterName + `" in url - will not connect.
36374
36379
  To allow joining a room without a query parameter you can set "requireRoomParameter" to false.`), !1) : (this.context.connection.isConnected || this.context.connection.connect(), this._lastJoinedRoom = this.roomName, this._roomPrefix && (this.roomName = this._roomPrefix + this.roomName), this.roomName.length <= 0 ? (console.warn(`[SyncedRoom] Room name is not set so we can not join a networked room.
36375
36380
  Please choose one of the following options to fix this:
36376
36381
  A) Set a room name in the SyncedRoom component
@@ -36382,7 +36387,7 @@ C) Set "joinRandomRoom" to true`), !1) : (Kf && console.log("Join " + this.roomN
36382
36387
  _userWantsToBeInARoom = !1;
36383
36388
  /** @internal */
36384
36389
  update() {
36385
- this.context.connection.isConnected && (this.context.time.time - this._lastPingTime > 3 && (this._lastPingTime = this.context.time.time, this.context.connection.sendPing()), this.context.connection.isInRoom && (this._lastRoomTime = this.context.time.time)), this._lastRoomTime > 0 && this.context.time.time - this._lastRoomTime > 0.3 && (this._lastRoomTime = -1, this.autoRejoin ? this._userWantsToBeInARoom && (console.log("Disconnected from networking backend - attempt reconnecting now"), this.tryJoinRoom()) : L() && console.warn("You are not connected to a room anymore (possibly because the tab was inactive for too long and the server kicked you?)"));
36390
+ this.context.connection.isConnected && (this.context.time.time - this._lastPingTime > 3 && (this._lastPingTime = this.context.time.time, this.context.connection.sendPing()), this.context.connection.isInRoom && (this._lastRoomTime = this.context.time.time)), this._lastRoomTime > 0 && this.context.time.time - this._lastRoomTime > 0.3 && (this._lastRoomTime = -1, this.autoRejoin ? this._userWantsToBeInARoom && (console.log("Disconnected from networking backend - attempt reconnecting now"), this.tryJoinRoom()) : D() && console.warn("You are not connected to a room anymore (possibly because the tab was inactive for too long and the server kicked you?)"));
36386
36391
  }
36387
36392
  /**
36388
36393
  * Get the URL to view the current room in view only mode.
@@ -36727,7 +36732,7 @@ class $E {
36727
36732
  if (!(r.times.length <= 0)) {
36728
36733
  if (r.name.endsWith(n))
36729
36734
  this.rootStartPosition = new b().fromArray(r.values, 0), this.rootEndPosition = new b().fromArray(r.values, r.values.length - 3), this.rootPositionOffset = this.rootEndPosition.clone().sub(this.rootStartPosition), Rn && console.log(this.rootPositionOffset);
36730
- else if (r.name.endsWith(o) && (this.rootStartQuaternion = new $().fromArray(r.values, 0), this.rootEndQuaternion = new $().fromArray(r.values, r.values.length - 4), this.rootQuaternionOffset = this.rootEndQuaternion.clone().multiply(this.rootStartQuaternion), Rn)) {
36735
+ else if (r.name.endsWith(o) && (this.rootStartQuaternion = new N().fromArray(r.values, 0), this.rootEndQuaternion = new N().fromArray(r.values, r.values.length - 4), this.rootQuaternionOffset = this.rootEndQuaternion.clone().multiply(this.rootStartQuaternion), Rn)) {
36731
36736
  const a = new Rt().setFromQuaternion(this.rootQuaternionOffset);
36732
36737
  console.log("ROT", a);
36733
36738
  }
@@ -36805,7 +36810,7 @@ class Bg extends Du {
36805
36810
  this.target && (this._animator = S.getComponent(this.target, At) ?? null, this._animator && l_(this._animator.gameObject, this, !0));
36806
36811
  for (const e of this.models) {
36807
36812
  const t = e.asset, i = t.position, n = t.rotation;
36808
- i && i.x !== void 0 && (i.isVector3 || (t.position = new b(i.x, i.y, i.z)), n.isQuaternion || (t.rotation = new $(n.x, n.y, n.z, n.w)));
36813
+ i && i.x !== void 0 && (i.isVector3 || (t.position = new b(i.x, i.y, i.z)), n.isQuaternion || (t.rotation = new N(n.x, n.y, n.z, n.w)));
36809
36814
  }
36810
36815
  this.ensureTrackOffsets();
36811
36816
  }
@@ -36815,19 +36820,19 @@ class Bg extends Du {
36815
36820
  const e = this.trackOffset.position;
36816
36821
  e && (e.isVector3 || (this.trackOffset.position = new b(e.x, e.y, e.z)));
36817
36822
  const t = this.trackOffset.rotation;
36818
- t && (t.isQuaternion || (this.trackOffset.rotation = new $(t.x, t.y, t.z, t.w)));
36823
+ t && (t.isQuaternion || (this.trackOffset.rotation = new N(t.x, t.y, t.z, t.w)));
36819
36824
  }
36820
36825
  }
36821
36826
  _useclipOffsets = !0;
36822
36827
  _totalOffsetPosition = new b();
36823
- _totalOffsetRotation = new $();
36828
+ _totalOffsetRotation = new N();
36824
36829
  _totalOffsetPosition2 = new b();
36825
- _totalOffsetRotation2 = new $();
36830
+ _totalOffsetRotation2 = new N();
36826
36831
  _summedPos = new b();
36827
36832
  _tempPos = new b();
36828
- _summedRot = new $();
36829
- _tempRot = new $();
36830
- _clipRotQuat = new $();
36833
+ _summedRot = new N();
36834
+ _tempRot = new N();
36835
+ _clipRotQuat = new N();
36831
36836
  evaluate(e) {
36832
36837
  if (this.track.muted || !this.mixer) return;
36833
36838
  this.bind(), this._totalOffsetPosition.set(0, 0, 0), this._totalOffsetRotation.set(0, 0, 0, 1), this._totalOffsetPosition2.set(0, 0, 0), this._totalOffsetRotation2.set(0, 0, 0, 1);
@@ -36867,33 +36872,33 @@ class Bg extends Du {
36867
36872
  x %= O;
36868
36873
  break;
36869
36874
  case rs.PingPong:
36870
- const z = Math.floor(x / O) % 2 !== 0;
36871
- x %= O, z && (x = O - x);
36875
+ const B = Math.floor(x / O) % 2 !== 0;
36876
+ x %= O, B && (x = O - x);
36872
36877
  break;
36873
36878
  }
36874
36879
  l.reversed === !0 ? c.time = c.getClip().duration - x : c.time = x, c.timeScale = 0;
36875
36880
  const k = Math.max(0, v);
36876
36881
  if (c.weight = k, r += k, c.clampWhenFinished = !1, c.isRunning() || c.play(), this._useclipOffsets) {
36877
- const E = t == 0 ? this._totalOffsetPosition : this._totalOffsetPosition2, z = t == 0 ? this._totalOffsetRotation : this._totalOffsetRotation2;
36882
+ const E = t == 0 ? this._totalOffsetPosition : this._totalOffsetPosition2, B = t == 0 ? this._totalOffsetRotation : this._totalOffsetRotation2;
36878
36883
  t < 1 && (i = 1 - v), t += 1;
36879
- const D = this._summedPos.set(0, 0, 0), V = this._tempPos.set(0, 0, 0), q = this._summedRot.identity(), A = this._tempRot.identity(), U = h.rotation;
36880
- U && (this._clipRotQuat.identity(), this._clipRotQuat.slerp(U, v));
36881
- const W = this._actionOffsets[a];
36882
- if (W.hasOffsets)
36884
+ const L = this._summedPos.set(0, 0, 0), W = this._tempPos.set(0, 0, 0), X = this._summedRot.identity(), A = this._tempRot.identity(), $ = h.rotation;
36885
+ $ && (this._clipRotQuat.identity(), this._clipRotQuat.slerp($, v));
36886
+ const V = this._actionOffsets[a];
36887
+ if (V.hasOffsets)
36883
36888
  for (let ne = 0; ne < I; ne++)
36884
- W.rootPositionOffset ? V.copy(W.rootPositionOffset) : V.set(0, 0, 0), V.applyQuaternion(q), this._clipRotQuat && V.applyQuaternion(this._clipRotQuat), W.rootQuaternionOffset && (A.copy(W.rootQuaternionOffset), q.multiply(A)), D.add(V);
36885
- this._clipRotQuat && z.multiply(this._clipRotQuat), z.multiply(q), h.position && D.add(h.position), E.add(D);
36889
+ V.rootPositionOffset ? W.copy(V.rootPositionOffset) : W.set(0, 0, 0), W.applyQuaternion(X), this._clipRotQuat && W.applyQuaternion(this._clipRotQuat), V.rootQuaternionOffset && (A.copy(V.rootQuaternionOffset), X.multiply(A)), L.add(W);
36890
+ this._clipRotQuat && B.multiply(this._clipRotQuat), B.multiply(X), h.position && L.add(h.position), E.add(L);
36886
36891
  }
36887
36892
  }
36888
36893
  }
36889
- if (this._useclipOffsets && (this._totalOffsetPosition.lerp(this._totalOffsetPosition2, i), this._totalOffsetRotation.slerp(this._totalOffsetRotation2, i)), this.__mixerError === void 0 && (Rn || L()) && this._animator?.runtimeAnimatorController?.mixer && this.mixer !== this._animator?.runtimeAnimatorController?.mixer && (this.__mixerError = !0, console.error("AnimationTrack mixer is not shared with the animator controller - this might result in the timeline to not animate properly. Please report a bug to the Needle Engine team!", this)), this._animator?.runtimeAnimatorController) {
36894
+ if (this._useclipOffsets && (this._totalOffsetPosition.lerp(this._totalOffsetPosition2, i), this._totalOffsetRotation.slerp(this._totalOffsetRotation2, i)), this.__mixerError === void 0 && (Rn || D()) && this._animator?.runtimeAnimatorController?.mixer && this.mixer !== this._animator?.runtimeAnimatorController?.mixer && (this.__mixerError = !0, console.error("AnimationTrack mixer is not shared with the animator controller - this might result in the timeline to not animate properly. Please report a bug to the Needle Engine team!", this)), this._animator?.runtimeAnimatorController) {
36890
36895
  const a = Math.max(0, 1 - r);
36891
36896
  this._animator?.runtimeAnimatorController?.update(a);
36892
36897
  } else
36893
36898
  this.mixer.update(e);
36894
36899
  }
36895
36900
  createRotationInterpolant(e, t, i) {
36896
- const n = i.createInterpolant.bind(i), o = new $();
36901
+ const n = i.createInterpolant.bind(i), o = new N();
36897
36902
  this.ensureTrackOffsets();
36898
36903
  const r = this.trackOffset?.rotation;
36899
36904
  i.createInterpolant = () => {
@@ -37189,7 +37194,7 @@ const ts = w("debugtimeline"), zg = class im extends T {
37189
37194
  _speed = 1;
37190
37195
  /** @internal */
37191
37196
  awake() {
37192
- ts && console.log(this, this.playableAsset?.tracks), this.rebuildGraph(), !this.isValid() && (ts || L()) && (ts ? console.warn("PlayableDirector is not valid", "Asset?", this.playableAsset, "Tracks:", this.playableAsset?.tracks, "IsArray?", Array.isArray(this.playableAsset?.tracks), this) : this.playableAsset?.tracks?.length ? console.warn("PlayableDirector is not valid") : console.warn("PlayableDirector has no tracks"));
37197
+ ts && console.log(this, this.playableAsset?.tracks), this.rebuildGraph(), !this.isValid() && (ts || D()) && (ts ? console.warn("PlayableDirector is not valid", "Asset?", this.playableAsset, "Tracks:", this.playableAsset?.tracks, "IsArray?", Array.isArray(this.playableAsset?.tracks), this) : this.playableAsset?.tracks?.length ? console.warn("PlayableDirector is not valid") : console.warn("PlayableDirector has no tracks"));
37193
37198
  }
37194
37199
  /** @internal */
37195
37200
  onEnable() {
@@ -37819,7 +37824,7 @@ class ko extends T {
37819
37824
  onPointerClick(e) {
37820
37825
  if (this.interactable && !(e.button !== 0 && e.event.pointerType === km.Mouse) && (Fo && (console.warn("Button Click", this.onClick), Be("CLICKED button " + this.name + " at " + this.context.time.frameCount)), this.onClick && this.onClick.listenerCount > 0 && (this.onClick.invoke(), e.use(), Fo))) {
37821
37826
  const t = this.gameObject.worldPosition;
37822
- t.add(this.gameObject.worldUp.multiplyScalar(1 + Math.random() * 0.5)), F.DrawLabel(t, "CLICK:" + Date.now(), 0.1, 1 + Math.random() * 0.5);
37827
+ t.add(this.gameObject.worldUp.multiplyScalar(1 + Math.random() * 0.5)), z.DrawLabel(t, "CLICK:" + Date.now(), 0.1, 1 + Math.random() * 0.5);
37823
37828
  }
37824
37829
  }
37825
37830
  colors;
@@ -37952,7 +37957,7 @@ const $s = w("debuginputfield"), Nc = class Q extends T {
37952
37957
  $s && console.log(this.name, this);
37953
37958
  }
37954
37959
  onEnable() {
37955
- Q.htmlField || (Q.htmlField = document.createElement("input"), Q.htmlField.style.width = "0px", Q.htmlField.style.height = "0px", Q.htmlField.style.padding = "0px", Q.htmlField.style.border = "none", Q.htmlField.style.overflow = "hidden", Q.htmlField.style.caretColor = "transparent", Q.htmlField.style.outline = "none", Q.htmlField.classList.add("ar"), Q.htmlField.onfocus = () => Q.htmlFieldFocused = !0, Q.htmlField.onblur = () => Q.htmlFieldFocused = !1, document.body.append(Q.htmlField)), this.inputEventFn || (this.inputEventFn = this.onInput.bind(this)), Q.htmlField.addEventListener("keyup", this.inputEventFn), this.placeholder && this.textComponent?.text.length && S.setActive(this.placeholder.gameObject, !1), X.isiOS() && (this._iosEventFn = this.processInputOniOS.bind(this), window.addEventListener("click", this._iosEventFn));
37960
+ Q.htmlField || (Q.htmlField = document.createElement("input"), Q.htmlField.style.width = "0px", Q.htmlField.style.height = "0px", Q.htmlField.style.padding = "0px", Q.htmlField.style.border = "none", Q.htmlField.style.overflow = "hidden", Q.htmlField.style.caretColor = "transparent", Q.htmlField.style.outline = "none", Q.htmlField.classList.add("ar"), Q.htmlField.onfocus = () => Q.htmlFieldFocused = !0, Q.htmlField.onblur = () => Q.htmlFieldFocused = !1, document.body.append(Q.htmlField)), this.inputEventFn || (this.inputEventFn = this.onInput.bind(this)), Q.htmlField.addEventListener("keyup", this.inputEventFn), this.placeholder && this.textComponent?.text.length && S.setActive(this.placeholder.gameObject, !1), q.isiOS() && (this._iosEventFn = this.processInputOniOS.bind(this), window.addEventListener("click", this._iosEventFn));
37956
37961
  }
37957
37962
  onDisable() {
37958
37963
  Q.htmlField?.removeEventListener("keyup", this.inputEventFn), this.onDeselected(), this._iosEventFn && window.removeEventListener("click", this._iosEventFn);
@@ -38017,7 +38022,7 @@ const $s = w("debuginputfield"), Nc = class Q extends T {
38017
38022
  }
38018
38023
  }
38019
38024
  selectInputField() {
38020
- Q.htmlField && ($s && console.log("Focus Inputfield", Q.htmlFieldFocused), Q.htmlField.setSelectionRange(Q.htmlField.value.length, Q.htmlField.value.length), X.isiOS() ? Q.htmlField.focus({ preventScroll: !0 }) : setTimeout(() => Q.htmlField?.focus(), 1));
38025
+ Q.htmlField && ($s && console.log("Focus Inputfield", Q.htmlFieldFocused), Q.htmlField.setSelectionRange(Q.htmlField.value.length, Q.htmlField.value.length), q.isiOS() ? Q.htmlField.focus({ preventScroll: !0 }) : setTimeout(() => Q.htmlField?.focus(), 1));
38021
38026
  }
38022
38027
  processInputOniOS() {
38023
38028
  const e = this.context.physics.raycast();
@@ -38327,7 +38332,7 @@ const $c = class kw extends T {
38327
38332
  invertForward = !1;
38328
38333
  keepUpDirection = !0;
38329
38334
  copyTargetRotation = !1;
38330
- static flipYQuat = new $().setFromAxisAngle(new b(0, 1, 0), Math.PI);
38335
+ static flipYQuat = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
38331
38336
  /** @internal */
38332
38337
  onBeforeRender() {
38333
38338
  let e = this.target;
@@ -38391,15 +38396,15 @@ class Wc extends T {
38391
38396
  }
38392
38397
  this._validateUrl();
38393
38398
  let e = this.url;
38394
- switch (!e.startsWith("mailto:") && e.includes("@") && (e = "mailto:" + e), L() && Be("Open URL: " + e), this.mode) {
38399
+ switch (!e.startsWith("mailto:") && e.includes("@") && (e = "mailto:" + e), D() && Be("Open URL: " + e), this.mode) {
38395
38400
  case 0:
38396
- X.isSafari(), globalThis.open(e, "_blank");
38401
+ q.isSafari(), globalThis.open(e, "_blank");
38397
38402
  break;
38398
38403
  case 1:
38399
- X.isSafari() && X.isiOS() ? globalThis.open(e, "_top") : globalThis.open(e, "_self");
38404
+ q.isSafari() && q.isiOS() ? globalThis.open(e, "_top") : globalThis.open(e, "_self");
38400
38405
  break;
38401
38406
  case 2:
38402
- X.isSafari() ? globalThis.open(e, "_top") : globalThis.open(e, "_new");
38407
+ q.isSafari() ? globalThis.open(e, "_top") : globalThis.open(e, "_new");
38403
38408
  break;
38404
38409
  }
38405
38410
  }
@@ -38420,7 +38425,7 @@ class Wc extends T {
38420
38425
  this.clickable && !e.used && this.url?.length && this.open();
38421
38426
  }
38422
38427
  _validateUrl() {
38423
- this.url && this.url.startsWith("www.") && (L() && console.warn("URL is not valid, adding https:// to the start of the URL", this.url), this.url = "https://" + this.url);
38428
+ this.url && this.url.startsWith("www.") && (D() && console.warn("URL is not valid, adding https:// to the start of the URL", this.url), this.url = "https://" + this.url);
38424
38429
  }
38425
38430
  }
38426
38431
  Wg([
@@ -38449,7 +38454,7 @@ class Mo extends T {
38449
38454
  useGripSpace = !1;
38450
38455
  resetTransformAfterXRSession = !0;
38451
38456
  _startPosition = new b();
38452
- _startRotation = new $();
38457
+ _startRotation = new N();
38453
38458
  _startScale = new b();
38454
38459
  /** @internal */
38455
38460
  onEnterXR(e) {
@@ -38506,7 +38511,7 @@ NeedleXRSession.onSessionRequestStart(evt => {
38506
38511
  evt.init.optionalFeatures = evt.init.optionalFeatures || [];
38507
38512
  evt.init.optionalFeatures.push('camera-access');
38508
38513
  });
38509
- `), L() && Wd("No camera feed available - please request the 'camera-access' feature before starting WebXR or add the ARCameraBackground component to your scene"), !1;
38514
+ `), D() && Wd("No camera feed available - please request the 'camera-access' feature before starting WebXR or add the ARCameraBackground component to your scene"), !1;
38510
38515
  const n = t.getViewerPose(s.xr.getReferenceSpace());
38511
38516
  if (n)
38512
38517
  for (const o of n.views)
@@ -38554,9 +38559,9 @@ function Tw(s) {
38554
38559
  const a = i.renderer, l = a.xr.enabled && a.xr.isPresenting;
38555
38560
  if (l && i.currentFrameEvent != xe.EarlyUpdate)
38556
38561
  return console.warn("Screenshot: defer to access XR frame"), new Promise((E) => {
38557
- ks((z) => {
38558
- const D = Tw(s);
38559
- E(D);
38562
+ ks((B) => {
38563
+ const L = Tw(s);
38564
+ E(L);
38560
38565
  }, xe.EarlyUpdate, { once: !0 });
38561
38566
  });
38562
38567
  const c = a.domElement, h = c.width, d = c.height;
@@ -38571,20 +38576,20 @@ function Tw(s) {
38571
38576
  const k = s.render_events !== !1, E = new Array();
38572
38577
  k && (gc(i.scene, Hi, E), E.forEach((A) => {
38573
38578
  if (A?.onBeforeRender(), A.isInstancingActive && A.instances)
38574
- for (let U = 0; U < A.instances?.length; U++) {
38575
- const W = A.instances[U];
38576
- hs(W.object, !0);
38579
+ for (let $ = 0; $ < A.instances?.length; $++) {
38580
+ const V = A.instances[$];
38581
+ hs(V.object, !0);
38577
38582
  }
38578
38583
  })), e && (i.scene.background = null, a.setClearColor(0, 0)), s.background && (i.scene.background = null, a.setClearColor(s.background), s.background instanceof oe && a.setClearAlpha(s.background.a)), e && a.setClearAlpha(0), a.setSize(n, o, !1), "cam" in r && (r = r.threeCamera), r instanceof pe && (r.aspect = n / o, r.updateProjectionMatrix());
38579
- const z = "type" in s && s.type === "texture";
38580
- let D = null;
38581
- z && (D = new Dn(n, o, {
38584
+ const B = "type" in s && s.type === "texture";
38585
+ let L = null;
38586
+ B && (L = new Dn(n, o, {
38582
38587
  wrapS: Qg,
38583
38588
  wrapT: Qg,
38584
38589
  format: 1023
38585
- }), a.setRenderTarget(D));
38586
- let V = c;
38587
- if (l ? (D && console.error('Taking XR screenshots with { type: "texture" } is currently not supported.'), V = Od.compositeWithCameraImage({
38590
+ }), a.setRenderTarget(L));
38591
+ let W = c;
38592
+ if (l ? (L && console.error('Taking XR screenshots with { type: "texture" } is currently not supported.'), W = Od.compositeWithCameraImage({
38588
38593
  width: f,
38589
38594
  height: p,
38590
38595
  scene: i.scene,
@@ -38604,21 +38609,21 @@ function Tw(s) {
38604
38609
  break;
38605
38610
  }
38606
38611
  if (e && s.trim === !0) {
38607
- const A = oA(V);
38608
- A && (V = A);
38612
+ const A = oA(W);
38613
+ A && (W = A);
38609
38614
  }
38610
38615
  if ("type" in s) {
38611
38616
  if (s.type === "texture")
38612
- return D ? (s.target && (s.target.image = D?.texture.image, s.target.needsUpdate = !0), D.texture.offset.set(0, -1), D.texture.needsUpdate = !0, D.texture) : (console.error("No target texture found"), null);
38617
+ return L ? (s.target && (s.target.image = L?.texture.image, s.target.needsUpdate = !0), L.texture.offset.set(0, -1), L.texture.needsUpdate = !0, L.texture) : (console.error("No target texture found"), null);
38613
38618
  if (s.type === "blob")
38614
- return new Promise((U, W) => {
38615
- V.toBlob((ne) => {
38616
- U(ne);
38619
+ return new Promise(($, V) => {
38620
+ W.toBlob((ne) => {
38621
+ $(ne);
38617
38622
  }, t);
38618
38623
  });
38619
38624
  if (s.type === "share")
38620
- return new Promise((U, W) => {
38621
- V.toBlob((ne) => {
38625
+ return new Promise(($, V) => {
38626
+ W.toBlob((ne) => {
38622
38627
  if (ne && "share" in navigator) {
38623
38628
  let re = "file_type" in s && s.file_type || t;
38624
38629
  t || (re = "image/png");
@@ -38631,7 +38636,7 @@ function Tw(s) {
38631
38636
  }).catch((Je) => {
38632
38637
  console.warn("User cancelled share", Je.message);
38633
38638
  }).finally(() => {
38634
- U({ blob: ne, shared: !0 });
38639
+ $({ blob: ne, shared: !0 });
38635
38640
  });
38636
38641
  }
38637
38642
  return {
@@ -38641,17 +38646,17 @@ function Tw(s) {
38641
38646
  }, t);
38642
38647
  });
38643
38648
  }
38644
- const q = V.toDataURL(t);
38649
+ const X = W.toDataURL(t);
38645
38650
  if ("download_filename" in s && s.download_filename) {
38646
38651
  let A = s.download_filename;
38647
- if (X.isMobileDevice() && typeof window < "u") {
38648
- const U = A + "_screenshots", W = A.split("."), ne = W.pop()?.toLowerCase();
38652
+ if (q.isMobileDevice() && typeof window < "u") {
38653
+ const $ = A + "_screenshots", V = A.split("."), ne = V.pop()?.toLowerCase();
38649
38654
  let re = 0;
38650
- localStorage.getItem(U) && (re = parseInt(sessionStorage.getItem(U) || "0")), re > 0 && (A = `${W.join()}-${re}.${ne}`), re += 1, sessionStorage.setItem(U, re.toString());
38655
+ localStorage.getItem($) && (re = parseInt(sessionStorage.getItem($) || "0")), re > 0 && (A = `${V.join()}-${re}.${ne}`), re += 1, sessionStorage.setItem($, re.toString());
38651
38656
  }
38652
- rA(q, A);
38657
+ rA(X, A);
38653
38658
  }
38654
- return q;
38659
+ return X;
38655
38660
  } finally {
38656
38661
  a.setRenderTarget(v), i.scene.background = I, a.setSize(h, d, !1), a.setClearColor(y, x), O != null && r instanceof pe && (r.aspect = O, r.updateProjectionMatrix()), a.xr.enabled = m, a.xr.isPresenting = l, l || i.updateSize(!0);
38657
38662
  }
@@ -38877,7 +38882,7 @@ class pc {
38877
38882
  t && (t *= Math.max(1, i)), t === void 0 || t >= 1 ? (e.position.copy(this._position), e.quaternion.copy(this._rotation)) : (t = Math.max(0, Math.min(1, t)), e.position.lerp(this._position, t), e.quaternion.slerp(this._rotation, t));
38878
38883
  }
38879
38884
  static _positionBuffer = new $i(() => new b(), 20);
38880
- static _rotationBuffer = new $i(() => new $(), 20);
38885
+ static _rotationBuffer = new $i(() => new N(), 20);
38881
38886
  _position;
38882
38887
  _rotation;
38883
38888
  ensureTransformData() {
@@ -38938,11 +38943,11 @@ class dA {
38938
38943
  const n = i;
38939
38944
  return n.isImageTrackingExtension && n.component.activeAndEnabled && n.component.trackedImages?.length > 0;
38940
38945
  }).indexOf(this);
38941
- this.shouldExport = t === 0, this.shouldExport && this.component.trackedImages?.length > 1 && (kd || L()) && (ge("USDZ: Only one tracked image is supported."), console.warn("USDZ: Only one tracked image is supported. Will choose the first one in the trackedImages list"));
38946
+ this.shouldExport = t === 0, this.shouldExport && this.component.trackedImages?.length > 1 && (kd || D()) && (ge("USDZ: Only one tracked image is supported."), console.warn("USDZ: Only one tracked image is supported. Will choose the first one in the trackedImages list"));
38942
38947
  }
38943
38948
  onAfterHierarchy(e, t) {
38944
38949
  if (!this.shouldExport) return;
38945
- const i = X.getiOSVersion(), r = (i ? parseInt(i.split(".")[0]) : 18) >= 18 ? 1 : 100;
38950
+ const i = q.getiOSVersion(), r = (i ? parseInt(i.split(".")[0]) : 18) >= 18 ? 1 : 100;
38946
38951
  t.beginBlock('def Preliminary_ReferenceImage "AnchoringReferenceImage"'), t.appendLine("uniform asset image = @image_tracking/" + this.filename + "@"), t.appendLine("uniform double physicalWidth = " + (this.imageModel.widthInMeters * r).toFixed(8)), t.closeBlock();
38947
38952
  }
38948
38953
  async onAfterSerialize(e) {
@@ -39022,7 +39027,7 @@ class $u extends T {
39022
39027
  t.frames = 0;
39023
39028
  }
39024
39029
  onLeaveXR(e) {
39025
- if (!this.supported && X.isAndroidDevice() && ge(this.webXRIncubationsWarning), this.trackedImages) {
39030
+ if (!this.supported && q.isAndroidDevice() && ge(this.webXRIncubationsWarning), this.trackedImages) {
39026
39031
  for (const t of this.trackedImages)
39027
39032
  if (t.object?.asset) {
39028
39033
  const i = t.object.asset;
@@ -39184,7 +39189,7 @@ class Eo extends T {
39184
39189
  for (const d of this._allPlanes.values())
39185
39190
  !d.mesh || !d.mesh.visible || (this.bounds.makeEmpty(), d.mesh.traverse((f) => {
39186
39191
  f instanceof H && this.bounds.expandByObject(f);
39187
- }), this.bounds.getCenter(this.center), this.labelOffset.copy(h).sub(this.center).normalize().multiplyScalar(0.1), F.DrawLabel(
39192
+ }), this.bounds.getCenter(this.center), this.labelOffset.copy(h).sub(this.center).normalize().multiplyScalar(0.1), z.DrawLabel(
39188
39193
  this.center.add(this.labelOffset),
39189
39194
  (d.xrData.semanticLabel || "plane").toUpperCase() + `
39190
39195
  ` + d.xrData.lastChangedTime.toFixed(2),
@@ -39738,7 +39743,7 @@ Use import { NeedleEngineModelLoader } from "@needle-tools/engine" namespace to
39738
39743
  }
39739
39744
  }
39740
39745
  function uL(s, e) {
39741
- return Lw(e?.context || N.Current, s, s, e?.seed || null, e?.onprogress);
39746
+ return Lw(e?.context || U.Current, s, s, e?.seed || null, e?.onprogress);
39742
39747
  }
39743
39748
  async function SA(s, e, t, i) {
39744
39749
  typeof t != "string" && (console.warn("Parse gltf binary without path, this might lead to errors in resolving extensions. Please provide the source path of the gltf/glb file", t, typeof t), t = ""), Aw && console.log("Parse glTF", t);
@@ -39883,7 +39888,7 @@ class MA {
39883
39888
  this.onRequestedEndAR();
39884
39889
  };
39885
39890
  onBegin(e, t, i) {
39886
- if (this.currentSession = i, this.arContainer = t, X.isMozillaXR()) {
39891
+ if (this.currentSession = i, this.arContainer = t, q.isMozillaXR()) {
39887
39892
  const n = e.domElement.children;
39888
39893
  for (let o = 0; o < n?.length; o++) {
39889
39894
  const r = n[o];
@@ -39901,7 +39906,7 @@ class MA {
39901
39906
  const i = t.el;
39902
39907
  t.previousParent?.appendChild(i);
39903
39908
  }
39904
- this._reparentedObjects.length = 0, X.isMozillaXR() && setTimeout(() => {
39909
+ this._reparentedObjects.length = 0, q.isMozillaXR() && setTimeout(() => {
39905
39910
  const t = e.renderer.domElement;
39906
39911
  t && e.domElement.shadowRoot?.prepend(t);
39907
39912
  const i = document.querySelectorAll("*");
@@ -39917,7 +39922,7 @@ class MA {
39917
39922
  const t = e.shadowRoot.querySelector(".content");
39918
39923
  this.contentElement = t;
39919
39924
  const i = e.shadowRoot.querySelector(".overlay-content");
39920
- return i && t.appendChild(i), fl && !X.isMobileDevice() && this.ensureQuitARButton(t), t;
39925
+ return i && t.appendChild(i), fl && !q.isMobileDevice() && this.ensureQuitARButton(t), t;
39921
39926
  }
39922
39927
  onRequestedEndAR() {
39923
39928
  this.currentSession && (this.currentSession.end(), this.currentSession = null);
@@ -40092,7 +40097,7 @@ class Md {
40092
40097
  Z_ && console.log("Loading UI has commercial license?", t);
40093
40098
  const i = document.createElement("div");
40094
40099
  i.style.paddingTop = ".6em", i.style.fontSize = ".8em", i.style.textTransform = "uppercase", i.innerText = `NEEDLE ENGINE NON COMMERCIAL VERSION
40095
- CLICK HERE TO GET A LICENSE`, i.style.cursor = "pointer", i.style.userSelect = "none", i.style.textAlign = "center", i.style.pointerEvents = "all", i.addEventListener("click", () => window.open("https://needle.tools/pricing", "_self")), i.style.opacity = "0", e.appendChild(i), !L() && xa && (Z_ && console.log("Waiting for runtime license check"), await xa, t = vs()), !t && (i.style.transition = "opacity .5s ease-in-out", i.style.opacity = "1");
40100
+ CLICK HERE TO GET A LICENSE`, i.style.cursor = "pointer", i.style.userSelect = "none", i.style.textAlign = "center", i.style.pointerEvents = "all", i.addEventListener("click", () => window.open("https://needle.tools/pricing", "_self")), i.style.opacity = "0", e.appendChild(i), !D() && xa && (Z_ && console.log("Waiting for runtime license check"), await xa, t = vs()), !t && (i.style.transition = "opacity .5s ease-in-out", i.style.opacity = "1");
40096
40101
  }
40097
40102
  }
40098
40103
  Xb(Ew);
@@ -40252,7 +40257,7 @@ class Uw extends HTMLElement {
40252
40257
  <div class="content">
40253
40258
  <slot class="overlay-content"></slot>
40254
40259
  </div>
40255
- `, this.shadowRoot && this.shadowRoot.appendChild(e.content.cloneNode(!0)), this._context = new N({ domElement: this }), this.addEventListener("error", this.onError);
40260
+ `, this.shadowRoot && this.shadowRoot.appendChild(e.content.cloneNode(!0)), this._context = new U({ domElement: this }), this.addEventListener("error", this.onError);
40256
40261
  }
40257
40262
  /**
40258
40263
  * @internal
@@ -40339,7 +40344,7 @@ changed from "`, t, '" to "', i, '"'), this.onLoad();
40339
40344
  _createContextPromise = null;
40340
40345
  async onLoad() {
40341
40346
  if (!this.isConnected) return;
40342
- if (this._context || (Pe && console.warn("Create new context"), this._context = new N({ domElement: this })), !this._context) {
40347
+ if (this._context || (Pe && console.warn("Create new context"), this._context = new U({ domElement: this })), !this._context) {
40343
40348
  console.error("Needle Engine: Context not initialized");
40344
40349
  return;
40345
40350
  }
@@ -40365,7 +40370,7 @@ changed from "`, t, '" to "', i, '"'), this.onLoad();
40365
40370
  const g = this.getAttribute("hide-loading-overlay");
40366
40371
  g != null && g !== "0" && (o = !1);
40367
40372
  }
40368
- o === !1 && !n && (L() || (o = !0), console.warn("Needle Engine: You need a commercial license to override the default loading view. Visit https://needle.tools/pricing"), L() && ge('You need a <a target="_blank" href="https://needle.tools/pricing">commercial license</a> to override the default loading view. This will not work in production.')), !this._loadingView && o && (this._loadingView = new Md(this)), o && (this._didFullyLoad !== !0 ? this._loadingView?.onLoadingBegin("begin load") : setTimeout(() => {
40373
+ o === !1 && !n && (D() || (o = !0), console.warn("Needle Engine: You need a commercial license to override the default loading view. Visit https://needle.tools/pricing"), D() && ge('You need a <a target="_blank" href="https://needle.tools/pricing">commercial license</a> to override the default loading view. This will not work in production.')), !this._loadingView && o && (this._loadingView = new Md(this)), o && (this._didFullyLoad !== !0 ? this._loadingView?.onLoadingBegin("begin load") : setTimeout(() => {
40369
40374
  this._loadingView && this._loadingProgress01 < 0.3 && this._loadId === t && this._loadingView.onLoadingBegin("begin load");
40370
40375
  }, 300)), Pe && console.warn(`--------------
40371
40376
  Needle Engine: Begin loading ` + t + `
@@ -40589,9 +40594,9 @@ function EA(s) {
40589
40594
  let f = t[d];
40590
40595
  (f === "_" || f === "-") && (f = " "), !(f === " " && l.length <= 0 || h.includes(f) || (l.length === 0 && (f = f.toUpperCase()), c && f === " ")) && (c && (f = f.toUpperCase()), c = !1, l += f, f === " " && (c = !0));
40591
40596
  }
40592
- return L() && t !== l && console.debug('Generated display name: "' + t + '" → "' + l + '"'), l.trim();
40597
+ return D() && t !== l && console.debug('Generated display name: "' + t + '" → "' + l + '"'), l.trim();
40593
40598
  }
40594
- return L() && console.debug("Loading: use default name", t), t;
40599
+ return D() && console.debug("Loading: use default name", t), t;
40595
40600
  }
40596
40601
  function AA(s) {
40597
40602
  B0((e) => {
@@ -40678,7 +40683,7 @@ class Kl {
40678
40683
  this.world?.removeCollider(o, !0);
40679
40684
  const r = o.parent();
40680
40685
  r && r.numColliders() <= 0 && (r[Yt] || this.world?.removeRigidBody(r));
40681
- } else n instanceof R.RAPIER_PHYSICS.MODULE.RigidBody && (n.numColliders() <= 0 ? this.world?.removeRigidBody(n) : L() && (n.did_log_removing || setTimeout(() => {
40686
+ } else n instanceof R.RAPIER_PHYSICS.MODULE.RigidBody && (n.numColliders() <= 0 ? this.world?.removeRigidBody(n) : D() && (n.did_log_removing || setTimeout(() => {
40682
40687
  n.numColliders() > 0 && (n.did_log_removing = !0, console.warn("RapierPhysics: removing rigidbody with colliders from the physics world is not possible right now, please remove the colliders first"));
40683
40688
  }, 1)));
40684
40689
  }
@@ -40779,7 +40784,7 @@ class Kl {
40779
40784
  n === void 0 && (n = 1 / 0), o === void 0 && (o = !0);
40780
40785
  const r = this.getPhysicsRay(this.rapierRay, e, t);
40781
40786
  if (!r) return null;
40782
- (this.debugRenderRaycasts || Oh) && F.DrawRay(r.origin, r.dir, 255, 1);
40787
+ (this.debugRenderRaycasts || Oh) && z.DrawRay(r.origin, r.dir, 255, 1);
40783
40788
  const a = this.world?.castRay(r, n, o, i?.queryFilterFlags, i?.filterGroups, void 0, void 0, (l) => {
40784
40789
  const c = l[Yt];
40785
40790
  return i?.filterPredicate ? i.filterPredicate(c) : i?.useIgnoreRaycastLayer !== !1 ? !c?.gameObject.layers.isEnabled(2) : !0;
@@ -40797,7 +40802,7 @@ class Kl {
40797
40802
  n === void 0 && (n = 1 / 0), o === void 0 && (o = !0);
40798
40803
  const r = this.getPhysicsRay(this.rapierRay, e, t);
40799
40804
  if (!r) return null;
40800
- (this.debugRenderRaycasts || Oh) && F.DrawRay(r.origin, r.dir, 255, 1);
40805
+ (this.debugRenderRaycasts || Oh) && z.DrawRay(r.origin, r.dir, 255, 1);
40801
40806
  const a = this.world?.castRayAndGetNormal(r, n, o, i?.queryFilterFlags, i?.filterGroups, void 0, void 0, (l) => {
40802
40807
  const c = l[Yt];
40803
40808
  return i?.filterPredicate ? i.filterPredicate(c) : i?.useIgnoreRaycastLayer !== !1 ? !c?.gameObject.layers.isEnabled(2) : !0;
@@ -40846,7 +40851,7 @@ class Kl {
40846
40851
  * @returns array of colliders that overlap with the sphere. Note: they currently only contain the collider and the gameobject
40847
40852
  */
40848
40853
  sphereOverlap(e, t) {
40849
- return this.rapierSphere ??= new R.RAPIER_PHYSICS.MODULE.Ball(t), this.rapierSphere.radius = t, (this.debugRenderRaycasts || Oh) && F.DrawWireSphere(e, t, 3359999, 1), this.shapeOverlap(e, this.rapierIdentityRotation, this.rapierSphere);
40854
+ return this.rapierSphere ??= new R.RAPIER_PHYSICS.MODULE.Ball(t), this.rapierSphere.radius = t, (this.debugRenderRaycasts || Oh) && z.DrawWireSphere(e, t, 3359999, 1), this.shapeOverlap(e, this.rapierIdentityRotation, this.rapierSphere);
40850
40855
  }
40851
40856
  /** box overlap detection using rapier against colliders
40852
40857
  * @param point center of the box in worldspace
@@ -40855,7 +40860,7 @@ class Kl {
40855
40860
  * @returns array of colliders that overlap with the box. Note: they currently only contain the collider and the gameobject
40856
40861
  */
40857
40862
  boxOverlap(e, t, i = null) {
40858
- return i === null && (i = this.rapierIdentityRotation), this.rapierBox ??= new R.RAPIER_PHYSICS.MODULE.Cuboid(1, 1, 1), this.rapierBox.halfExtents.x = t.x * 0.5, this.rapierBox.halfExtents.y = t.y * 0.5, this.rapierBox.halfExtents.z = t.z * 0.5, (this.debugRenderRaycasts || Oh) && F.DrawWireBox(e, t, 3359999, 1, !0, i), this.shapeOverlap(e, i, this.rapierBox);
40863
+ return i === null && (i = this.rapierIdentityRotation), this.rapierBox ??= new R.RAPIER_PHYSICS.MODULE.Cuboid(1, 1, 1), this.rapierBox.halfExtents.x = t.x * 0.5, this.rapierBox.halfExtents.y = t.y * 0.5, this.rapierBox.halfExtents.z = t.z * 0.5, (this.debugRenderRaycasts || Oh) && z.DrawWireBox(e, t, 3359999, 1, !0, i), this.shapeOverlap(e, i, this.rapierBox);
40859
40864
  }
40860
40865
  shapeOverlap(e, t, i) {
40861
40866
  return this.rapierColliderArray.length = 0, this._isInitialized ? this.world ? (this.world.intersectionsWithShape(
@@ -40882,7 +40887,7 @@ class Kl {
40882
40887
  return this._world;
40883
40888
  }
40884
40889
  _tempPosition = new b();
40885
- _tempQuaternion = new $();
40890
+ _tempQuaternion = new N();
40886
40891
  _tempScale = new b();
40887
40892
  _tempMatrix = new te();
40888
40893
  static _didLoadPhysicsEngine = !1;
@@ -40971,7 +40976,7 @@ class Kl {
40971
40976
  if (this._meshCache.has(d))
40972
40977
  Qe && console.warn("Use cached mesh collider"), r = this._meshCache.get(d);
40973
40978
  else {
40974
- (Qe || L()) && console.debug(`[Performance] Your MeshCollider "${e.name}" is scaled: consider applying the scale to the collider mesh instead (${c.x}, ${c.y}, ${c.z})`);
40979
+ (Qe || D()) && console.debug(`[Performance] Your MeshCollider "${e.name}" is scaled: consider applying the scale to the collider mesh instead (${c.x}, ${c.y}, ${c.z})`);
40975
40980
  const f = new Float32Array(r.length);
40976
40981
  for (let p = 0; p < r.length; p += 3)
40977
40982
  f[p] = r[p] * c.x, f[p + 1] = r[p + 1] * c.y, f[p + 2] = r[p + 2] * c.z;
@@ -41201,7 +41206,7 @@ Error:`, r), null;
41201
41206
  }
41202
41207
  const o = i.translation(), r = i.rotation();
41203
41208
  if (Number.isNaN(o.x) || Number.isNaN(r.x)) {
41204
- !n.__COLLIDER_NAN && L() && (console.warn("Collider has NaN values", n.name, n.gameObject, i), n.__COLLIDER_NAN = !0);
41209
+ !n.__COLLIDER_NAN && D() && (console.warn("Collider has NaN values", n.name, n.gameObject, i), n.__COLLIDER_NAN = !0);
41205
41210
  continue;
41206
41211
  }
41207
41212
  const a = t.center;
@@ -41241,7 +41246,7 @@ Error:`, r), null;
41241
41246
  }
41242
41247
  _tempCenterPos = new b();
41243
41248
  _tempCenterVec = new b();
41244
- _tempCenterQuaternion = new $();
41249
+ _tempCenterQuaternion = new N();
41245
41250
  tryApplyCenter(e, t) {
41246
41251
  const i = e.center;
41247
41252
  i && e.gameObject && (i.x !== 0 || i.y !== 0 || i.z !== 0) && (this._tempCenterPos.x = i.x, this._tempCenterPos.y = i.y, this._tempCenterPos.z = i.z, $e(e.gameObject, this._tempCenterVec), this._tempCenterPos.multiply(this._tempCenterVec), e.attachedRigidbody ? this._tempCenterPos.applyQuaternion(e.gameObject.quaternion) : (be(e.gameObject, this._tempCenterQuaternion), this._tempCenterPos.applyQuaternion(this._tempCenterQuaternion)), t.x += this._tempCenterPos.x, t.y += this._tempCenterPos.y, t.z += this._tempCenterPos.z);
@@ -41331,7 +41336,7 @@ class jA {
41331
41336
  const g = a.solverContactPoint(p), _ = a.contactImpulse(p);
41332
41337
  if (g) {
41333
41338
  const m = a.contactDist(p), v = a.solverContactFriction(p), y = a.solverContactTangentVelocity(p), x = new _k(g, m, f, _, v, y);
41334
- d.push(x), ep && F.DrawDirection(g, f, 16711680, 3, !0);
41339
+ d.push(x), ep && z.DrawDirection(g, f, 16711680, 3, !0);
41335
41340
  }
41336
41341
  }
41337
41342
  o = new bk(r, i, d);
@@ -41540,7 +41545,7 @@ function zA(s, e, t) {
41540
41545
  const i = new Set(t);
41541
41546
  return Array.from(i);
41542
41547
  }
41543
- const sb = "needle-button", tp = L();
41548
+ const sb = "needle-button", tp = D();
41544
41549
  class UA extends HTMLElement {
41545
41550
  static observedAttributes = ["ar", "vr", "quicklook"];
41546
41551
  constructor() {
@@ -41971,7 +41976,7 @@ const yL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41971
41976
  VisibilityAction: uu,
41972
41977
  Voip: _r,
41973
41978
  Volume: Dc,
41974
- VolumeParameter: B,
41979
+ VolumeParameter: F,
41975
41980
  VolumeProfile: kg,
41976
41981
  WebARCameraBackground: Nu,
41977
41982
  WebARSessionRoot: Ni,
@@ -42176,7 +42181,7 @@ export {
42176
42181
  v1 as ConnectionEvents,
42177
42182
  _k as ContactPoint,
42178
42183
  ou as ContactShadows,
42179
- N as Context,
42184
+ U as Context,
42180
42185
  NI as ContextArgs,
42181
42186
  ce as ContextEvent,
42182
42187
  he as ContextRegistry,
@@ -42188,7 +42193,7 @@ export {
42188
42193
  er as DeleteBox,
42189
42194
  Gn as DepthOfField,
42190
42195
  eg as DeviceFlag,
42191
- X as DeviceUtilities,
42196
+ q as DeviceUtilities,
42192
42197
  $A as DocumentExtension,
42193
42198
  Gr as DragControls,
42194
42199
  nv as DragMode,
@@ -42213,7 +42218,7 @@ export {
42213
42218
  xe as FrameEvent,
42214
42219
  Sm as GENERATOR,
42215
42220
  S as GameObject,
42216
- F as Gizmos,
42221
+ z as Gizmos,
42217
42222
  bv as GltfExport,
42218
42223
  _v as GltfExportBox,
42219
42224
  $a as Gradient,
@@ -42432,7 +42437,7 @@ export {
42432
42437
  uu as VisibilityAction,
42433
42438
  _r as Voip,
42434
42439
  Dc as Volume,
42435
- B as VolumeParameter,
42440
+ F as VolumeParameter,
42436
42441
  kg as VolumeProfile,
42437
42442
  FI as WaitForFrames,
42438
42443
  WP as WaitForPromise,
@@ -42551,7 +42556,7 @@ export {
42551
42556
  JA as isDebugMode,
42552
42557
  sI as isDesktop,
42553
42558
  _a as isDestroyed,
42554
- L as isDevEnvironment,
42559
+ D as isDevEnvironment,
42555
42560
  LI as isDisposed,
42556
42561
  mL as isExporting,
42557
42562
  gk as isGLTFModel,