u-space 0.0.28 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { Raycaster as Ne, Vector2 as C, EventDispatcher as De, Box2 as at, Matrix4 as ke, Vector3 as v, Box3 as V, Scene as je, Color as M, AmbientLight as ct, DirectionalLight as ye, PointLight as we, SpotLight as ve, HemisphereLight as be, DirectionalLightHelper as ht, PointLightHelper as lt, SpotLightHelper as dt, HemisphereLightHelper as pt, RenderPipeline as ut, PerspectiveCamera as se, Sphere as Ue, Spherical as T, Quaternion as mt, Vector4 as ft, MathUtils as gt, PMREMGenerator as yt, OrthographicCamera as ne, TimestampQuery as Z, Cache as wt, Timer as vt, WebGPURenderer as bt, PCFShadowMap as xt, AgXToneMapping as St, Fog as Ct, FogExp2 as Mt, MeshStandardNodeMaterial as L, Loader as Tt, LoaderUtils as I, FileLoader as He, TextureLoader as Fe, Group as R, SRGBColorSpace as Ge, RepeatWrapping as xe, BufferGeometry as Q, BufferAttribute as Se, Mesh as k, FrontSide as _t, BackSide as Et, DoubleSide as Pt, REVISION as Ce, CubeTextureLoader as Ot, EquirectangularReflectionMapping as At, Sprite as Bt, AnimationMixer as It, LoopRepeat as Rt, LoopOnce as Lt, SphereGeometry as zt, TubeGeometry as Nt, LineCurve3 as Dt, CatmullRomCurve3 as kt, SpriteNodeMaterial as jt, CanvasTexture as Ut, ShapeGeometry as Ht, Shape as $e, ExtrudeGeometry as Ft, PlaneGeometry as Gt, CircleGeometry as $t, ClippingGroup as Wt, Plane as Kt, PlaneHelper as Qt, LineBasicMaterial as ie, Line as re } from "three/webgpu";
2
- import { pass as fe, mrt as qt, output as Xt, add as Me, blendColor as Yt, emissive as Vt, normalView as Jt, velocity as Zt, color as H, uv as Te, time as oe, pow as ae, sin as ge, mix as ce, mx_noise_float as _e, Fn as We, userData as O, materialColor as Ee, select as q, materialOpacity as Pe, vec3 as es } from "three/tsl";
1
+ import { Raycaster as De, Vector2 as C, EventDispatcher as ke, Box2 as at, Matrix4 as je, Vector3 as v, Box3 as V, Scene as Ue, Color as T, AmbientLight as ct, DirectionalLight as we, PointLight as ve, SpotLight as be, HemisphereLight as xe, DirectionalLightHelper as ht, PointLightHelper as lt, SpotLightHelper as dt, HemisphereLightHelper as pt, RenderPipeline as ut, PerspectiveCamera as se, Sphere as fe, Spherical as M, Quaternion as mt, Vector4 as ft, MathUtils as gt, PMREMGenerator as yt, OrthographicCamera as ne, TimestampQuery as Z, Cache as wt, Timer as vt, WebGPURenderer as bt, PCFShadowMap as xt, AgXToneMapping as St, Fog as Ct, FogExp2 as Tt, MeshStandardNodeMaterial as L, Loader as Mt, LoaderUtils as R, FileLoader as He, TextureLoader as Fe, Group as I, SRGBColorSpace as Ge, RepeatWrapping as Se, BufferGeometry as Q, BufferAttribute as Ce, Mesh as k, FrontSide as _t, BackSide as Et, DoubleSide as Pt, REVISION as Te, CubeTextureLoader as Ot, EquirectangularReflectionMapping as At, Sprite as Bt, AnimationMixer as Rt, LoopRepeat as It, LoopOnce as Lt, SphereGeometry as zt, TubeGeometry as Nt, LineCurve3 as Dt, CatmullRomCurve3 as kt, SpriteNodeMaterial as jt, CanvasTexture as Ut, ShapeGeometry as Ht, Shape as $e, ExtrudeGeometry as Ft, PlaneGeometry as Gt, CircleGeometry as $t, ClippingGroup as Wt, Plane as Kt, PlaneHelper as Qt, LineBasicMaterial as ie, Line as re } from "three/webgpu";
2
+ import { pass as ge, mrt as qt, output as Xt, add as Me, blendColor as Yt, emissive as Vt, normalView as Jt, velocity as Zt, color as H, uv as _e, time as oe, pow as ae, sin as ye, mix as ce, mx_noise_float as Ee, Fn as We, userData as O, materialColor as Pe, select as q, materialOpacity as Oe, vec3 as es } from "three/tsl";
3
3
  import { bloom as ts } from "three/addons/tsl/display/BloomNode.js";
4
4
  import { ssgi as ss } from "three/addons/tsl/display/SSGINode.js";
5
5
  import { traa as ns } from "three/addons/tsl/display/TRAANode.js";
@@ -7,16 +7,16 @@ import Ke from "camera-controls";
7
7
  import { RoomEnvironment as is } from "three/addons/environments/RoomEnvironment.js";
8
8
  import { ViewHelper as rs } from "three/addons/helpers/ViewHelper.js";
9
9
  import { CSS2DRenderer as os, CSS2DObject as as } from "three/addons/renderers/CSS2DRenderer.js";
10
- import { CSS2DObject as Gn } from "three/addons/renderers/CSS2DRenderer.js";
10
+ import { CSS2DObject as $n } from "three/addons/renderers/CSS2DRenderer.js";
11
11
  import { CSS3DRenderer as cs, CSS3DSprite as hs, CSS3DObject as ls } from "three/addons/renderers/CSS3DRenderer.js";
12
- import { CSS3DObject as Wn, CSS3DSprite as Kn } from "three/addons/renderers/CSS3DRenderer.js";
12
+ import { CSS3DObject as Kn, CSS3DSprite as Qn } from "three/addons/renderers/CSS3DRenderer.js";
13
13
  import { GLTFLoader as Qe } from "three/addons/loaders/GLTFLoader.js";
14
14
  import { FBXLoader as ds } from "three/addons/loaders/FBXLoader.js";
15
15
  import { OBJLoader as ps } from "three/addons/loaders/OBJLoader.js";
16
16
  import { STLLoader as us } from "three/addons/loaders/STLLoader.js";
17
17
  import { DRACOLoader as ms } from "three/addons/loaders/DRACOLoader.js";
18
18
  import { KTX2Loader as fs } from "three/addons/loaders/KTX2Loader.js";
19
- import { MeshoptDecoder as Oe } from "three/addons/libs/meshopt_decoder.module.js";
19
+ import { MeshoptDecoder as Ae } from "three/addons/libs/meshopt_decoder.module.js";
20
20
  import { HDRLoader as gs } from "three/addons/loaders/HDRLoader.js";
21
21
  import { clone as ys } from "three/addons/utils/SkeletonUtils.js";
22
22
  import { Easing as f, Tween as ws } from "three/addons/libs/tween.module.js";
@@ -52,7 +52,7 @@ class bs {
52
52
  domElement;
53
53
  scene;
54
54
  camera;
55
- raycaster = new Ne();
55
+ raycaster = new De();
56
56
  pointer = new C();
57
57
  hoveredObject = null;
58
58
  pointerDownTime = 0;
@@ -205,7 +205,7 @@ class bs {
205
205
  this.domElement.removeEventListener("click", this._onClick), this.domElement.removeEventListener("dblclick", this._onDblClick), this.domElement.removeEventListener("contextmenu", this._onContextMenu), this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.clickTimer && (clearTimeout(this.clickTimer), this.clickTimer = null), this.hoveredObject = null, this._excludeSet.clear();
206
206
  }
207
207
  }
208
- class _n extends De {
208
+ class En extends ke {
209
209
  scene;
210
210
  camera;
211
211
  domElement;
@@ -324,7 +324,7 @@ class _n extends De {
324
324
  ), r = new at(
325
325
  new C(Math.min(n.x, i.x), Math.min(n.y, i.y)),
326
326
  new C(Math.max(n.x, i.x), Math.max(n.y, i.y))
327
- ), o = this.targetObjects || this.scene.children, a = [], c = new ke();
327
+ ), o = this.targetObjects || this.scene.children, a = [], c = new je();
328
328
  c.multiplyMatrices(this.camera.projectionMatrix, this.camera.matrixWorldInverse);
329
329
  const l = (d) => {
330
330
  if (!d.visible) return;
@@ -534,7 +534,7 @@ class xs {
534
534
  ee(e, !0);
535
535
  }
536
536
  }
537
- class En {
537
+ class Pn {
538
538
  scenes = /* @__PURE__ */ new Map();
539
539
  _activeSceneKey = null;
540
540
  /**
@@ -547,8 +547,8 @@ class En {
547
547
  * Create and register a new scene.
548
548
  */
549
549
  create(e, t = {}) {
550
- const s = new je();
551
- return t.background !== void 0 && (s.background = new M(t.background)), this.scenes.set(e, s), s;
550
+ const s = new Ue();
551
+ return t.background !== void 0 && (s.background = new T(t.background)), this.scenes.set(e, s), s;
552
552
  }
553
553
  /**
554
554
  * Get a scene by key.
@@ -587,7 +587,7 @@ class En {
587
587
  const t = this.scenes.get(e);
588
588
  if (!t) return null;
589
589
  let s = null;
590
- return t.background instanceof M && (s = `#${t.background.getHexString()}`), {
590
+ return t.background instanceof T && (s = `#${t.background.getHexString()}`), {
591
591
  name: t.name || e,
592
592
  background: s,
593
593
  environmentRotation: {
@@ -608,7 +608,7 @@ class En {
608
608
  return this.scenes.size;
609
609
  }
610
610
  }
611
- class Pn {
611
+ class On {
612
612
  scene;
613
613
  lights = /* @__PURE__ */ new Map();
614
614
  helpers = /* @__PURE__ */ new Map();
@@ -620,11 +620,11 @@ class Pn {
620
620
  return i.name = e, this._register(e, i), i;
621
621
  }
622
622
  addDirectional(e, t = {}) {
623
- const { color: s = 16777215, intensity: n = 1, position: i = { x: 5, y: 10, z: 5 }, castShadow: r = !1, shadowMapSize: o = 1024 } = t, a = new ye(s, n);
623
+ const { color: s = 16777215, intensity: n = 1, position: i = { x: 5, y: 10, z: 5 }, castShadow: r = !1, shadowMapSize: o = 1024 } = t, a = new we(s, n);
624
624
  return a.position.set(i.x, i.y, i.z), a.castShadow = r, r && a.shadow.mapSize.setScalar(o), a.name = e, this._register(e, a), a;
625
625
  }
626
626
  addPoint(e, t = {}) {
627
- const { color: s = 16777215, intensity: n = 1, distance: i = 0, decay: r = 2, position: o = { x: 0, y: 5, z: 0 }, castShadow: a = !1 } = t, c = new we(s, n, i, r);
627
+ const { color: s = 16777215, intensity: n = 1, distance: i = 0, decay: r = 2, position: o = { x: 0, y: 5, z: 0 }, castShadow: a = !1 } = t, c = new ve(s, n, i, r);
628
628
  return c.position.set(o.x, o.y, o.z), c.castShadow = a, c.name = e, this._register(e, c), c;
629
629
  }
630
630
  addSpot(e, t = {}) {
@@ -638,11 +638,11 @@ class Pn {
638
638
  position: c = { x: 0, y: 10, z: 0 },
639
639
  target: l,
640
640
  castShadow: d = !1
641
- } = t, p = new ve(s, n, i, r, o, a);
641
+ } = t, p = new be(s, n, i, r, o, a);
642
642
  return p.position.set(c.x, c.y, c.z), l && p.target.position.set(l.x, l.y, l.z), p.castShadow = d, p.name = e, this._register(e, p), p;
643
643
  }
644
644
  addHemisphere(e, t = {}) {
645
- const { skyColor: s = 8900331, groundColor: n = 3549447, intensity: i = 0.6 } = t, r = new be(s, n, i);
645
+ const { skyColor: s = 8900331, groundColor: n = 3549447, intensity: i = 0.6 } = t, r = new xe(s, n, i);
646
646
  return r.name = e, this._register(e, r), r;
647
647
  }
648
648
  /**
@@ -693,7 +693,7 @@ class Pn {
693
693
  const t = this.lights.get(e);
694
694
  if (!t) return;
695
695
  let s = null;
696
- t instanceof ye ? s = new ht(t, 1) : t instanceof we ? s = new lt(t, 0.5) : t instanceof ve ? s = new dt(t) : t instanceof be && (s = new pt(t, 1)), s && (this.scene.add(s), this.helpers.set(e, s));
696
+ t instanceof we ? s = new ht(t, 1) : t instanceof ve ? s = new lt(t, 0.5) : t instanceof be ? s = new dt(t) : t instanceof xe && (s = new pt(t, 1)), s && (this.scene.add(s), this.helpers.set(e, s));
697
697
  }
698
698
  /**
699
699
  * Hide (remove) the helper for a light.
@@ -753,7 +753,7 @@ class Ss extends ut {
753
753
  #f = !0;
754
754
  constructor(...e) {
755
755
  const [t, s, n] = e;
756
- super(t), this.scene = s, this.camera = n, this.scenePass = fe(s, n), this.needsUpdateOutputNode = !0, this.#t = /* @__PURE__ */ new Set(), this.#e = [], this.#d = /* @__PURE__ */ new Set(), this.#c = /* @__PURE__ */ new Map(), this.#g();
756
+ super(t), this.scene = s, this.camera = n, this.scenePass = ge(s, n), this.needsUpdateOutputNode = !0, this.#t = /* @__PURE__ */ new Set(), this.#e = [], this.#d = /* @__PURE__ */ new Set(), this.#c = /* @__PURE__ */ new Map(), this.#g();
757
757
  }
758
758
  /** @deprecated Use `scenePass` instead */
759
759
  get currentOutputNode() {
@@ -820,7 +820,7 @@ class Ss extends ut {
820
820
  }
821
821
  #i() {
822
822
  const e = this.scenePass;
823
- this.scenePass = fe(this.scene, this.camera), this.#g(), this.needsUpdateOutputNode = !0, e.dispose();
823
+ this.scenePass = ge(this.scene, this.camera), this.#g(), this.needsUpdateOutputNode = !0, e.dispose();
824
824
  }
825
825
  #g() {
826
826
  if (this.#s || this.#o || this.#h || this.#c.size > 0) {
@@ -886,14 +886,14 @@ const Cs = {
886
886
  Vector3: v,
887
887
  Vector4: ft,
888
888
  Quaternion: mt,
889
- Matrix4: ke,
890
- Spherical: T,
889
+ Matrix4: je,
890
+ Spherical: M,
891
891
  Box3: V,
892
- Sphere: Ue,
893
- Raycaster: Ne
892
+ Sphere: fe,
893
+ Raycaster: De
894
894
  };
895
895
  Ke.install({ THREE: Cs });
896
- class Ms extends Ke {
896
+ class Ts extends Ke {
897
897
  constructor(...e) {
898
898
  super(...e), this.minDistance = 0.2, this.smoothTime = 0.2, this.dollySpeed = 0.2;
899
899
  }
@@ -901,29 +901,32 @@ class Ms extends Ke {
901
901
  * Set absolute angle for azimuth to avoid spinning
902
902
  */
903
903
  absoluteRotations() {
904
- this.azimuthAngle = Ts(this.azimuthAngle, 0);
904
+ this.azimuthAngle = _s(this.azimuthAngle, 0);
905
905
  }
906
906
  async flyToBox(e, t = {}) {
907
907
  if (e.isEmpty())
908
908
  return console.warn("CameraControls.flyToBox: The provided Box3 is empty."), !1;
909
909
  this.absoluteRotations();
910
- const { viewpoint: s = "frontTop", enableTransition: n = !0, padding: i = 0.1, cover: r = !1 } = t, o = [];
910
+ const { viewpoint: s = "frontTop", enableTransition: n = !0, padding: i = 0.1, cover: r = !1 } = t;
911
911
  if (s !== "current") {
912
- const a = Ae[s.toUpperCase()] ?? Ae.FRONTTOP, c = a.theta, l = a.phi;
913
- o.push(
914
- this.fitToBox(e, n, {
912
+ const o = s.toUpperCase(), a = Be[o] ?? Be.FRONTTOP, c = a.theta, l = a.phi;
913
+ if (await this.rotateTo(c, l, n), Ms.has(o))
914
+ await this.fitToBox(e, n, {
915
915
  paddingLeft: i,
916
916
  paddingRight: i,
917
917
  paddingTop: i,
918
918
  paddingBottom: i,
919
919
  cover: r
920
- })
921
- ), o.push(this.rotateTo(c, l, n));
920
+ });
921
+ else {
922
+ const d = new fe();
923
+ e.getBoundingSphere(d), d.radius += i, await this.fitToSphere(d, n);
924
+ }
922
925
  } else {
923
- const a = new Ue();
924
- e.getBoundingSphere(a), a.radius += i, o.push(this.fitToSphere(a, n));
926
+ const o = new fe();
927
+ e.getBoundingSphere(o), o.radius += i, await this.fitToSphere(o, n);
925
928
  }
926
- return await Promise.all(o), !0;
929
+ return !0;
927
930
  }
928
931
  async flyToObject(e, t = {}) {
929
932
  const s = new V().setFromObject(e);
@@ -977,27 +980,27 @@ class Ms extends Ke {
977
980
  ]);
978
981
  }
979
982
  }
980
- const Ae = {
981
- LEFT: new T(0, Math.PI / 2, -Math.PI / 2),
982
- RIGHT: new T(0, Math.PI / 2, Math.PI / 2),
983
- FRONT: new T(0, Math.PI / 2, 0),
984
- BACK: new T(0, Math.PI / 2, Math.PI),
985
- TOP: new T(0, 0, 0),
986
- BOTTOM: new T(0, Math.PI, 0),
987
- FRONTTOP: new T(0, Math.PI / 4, 0),
988
- BACKTOP: new T(0, Math.PI / 4, Math.PI),
989
- LEFTTOP: new T(0, Math.PI / 4, -Math.PI / 2),
990
- RIGHTTOP: new T(0, Math.PI / 4, Math.PI / 2),
991
- LEFTFRONTTOP: new T(0, Math.PI / 4, -Math.PI / 4),
992
- RIGHTFRONTTOP: new T(0, Math.PI / 4, Math.PI / 4),
993
- LEFTBACKTOP: new T(0, Math.PI / 4, -Math.PI / 4 * 3),
994
- RIGHTBACKTOP: new T(0, Math.PI / 4, Math.PI / 4 * 3)
995
- };
996
- function Ts(h, e) {
983
+ const Be = {
984
+ LEFT: new M(0, Math.PI / 2, -Math.PI / 2),
985
+ RIGHT: new M(0, Math.PI / 2, Math.PI / 2),
986
+ FRONT: new M(0, Math.PI / 2, 0),
987
+ BACK: new M(0, Math.PI / 2, Math.PI),
988
+ TOP: new M(0, 0, 0),
989
+ BOTTOM: new M(0, Math.PI, 0),
990
+ FRONTTOP: new M(0, Math.PI / 4, 0),
991
+ BACKTOP: new M(0, Math.PI / 4, Math.PI),
992
+ LEFTTOP: new M(0, Math.PI / 4, -Math.PI / 2),
993
+ RIGHTTOP: new M(0, Math.PI / 4, Math.PI / 2),
994
+ LEFTFRONTTOP: new M(0, Math.PI / 4, -Math.PI / 4),
995
+ RIGHTFRONTTOP: new M(0, Math.PI / 4, Math.PI / 4),
996
+ LEFTBACKTOP: new M(0, Math.PI / 4, -Math.PI / 4 * 3),
997
+ RIGHTBACKTOP: new M(0, Math.PI / 4, Math.PI / 4 * 3)
998
+ }, Ms = /* @__PURE__ */ new Set(["LEFT", "RIGHT", "FRONT", "BACK", "TOP", "BOTTOM"]);
999
+ function _s(h, e) {
997
1000
  const t = h - e;
998
1001
  return gt.euclideanModulo(t + Math.PI, Math.PI * 2) - Math.PI;
999
1002
  }
1000
- class _s {
1003
+ class Es {
1001
1004
  environment = new is();
1002
1005
  renderer;
1003
1006
  pmremGenerator;
@@ -1013,13 +1016,13 @@ class _s {
1013
1016
  }
1014
1017
  }
1015
1018
  const te = 128;
1016
- class Es extends rs {
1019
+ class Ps extends rs {
1017
1020
  viewer;
1018
1021
  overlayPass;
1019
1022
  constructor(e) {
1020
1023
  super(e.camera, e.el), this.viewer = e;
1021
1024
  const t = new ne(-2, 2, 2, -2, 0, 4);
1022
- t.position.set(0, 0, 2), this.overlayPass = fe(this, t), this.setLabels("x", "y", "z");
1025
+ t.position.set(0, 0, 2), this.overlayPass = ge(this, t), this.setLabels("x", "y", "z");
1023
1026
  }
1024
1027
  _update = () => {
1025
1028
  this.quaternion.copy(this.viewer.camera.quaternion).invert();
@@ -1034,8 +1037,8 @@ class Es extends rs {
1034
1037
  return this.viewer.renderPipeline.removeOverlayPass(this.overlayPass), this.viewer.removeEventListener("beforeRender", this._update), this.viewer.render(), this;
1035
1038
  }
1036
1039
  }
1037
- const qe = "position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden;", Ps = qe + "z-index:0;", Os = qe + "z-index:1;";
1038
- class As {
1040
+ const qe = "position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden;", Os = qe + "z-index:0;", As = qe + "z-index:1;";
1041
+ class Bs {
1039
1042
  el;
1040
1043
  css2dRenderer = null;
1041
1044
  css3dRenderer = null;
@@ -1044,11 +1047,11 @@ class As {
1044
1047
  }
1045
1048
  initCSS2DRenderer() {
1046
1049
  const e = new os();
1047
- return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText = Os, this.el.appendChild(e.domElement), this.css2dRenderer = e, e;
1050
+ return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText = As, this.el.appendChild(e.domElement), this.css2dRenderer = e, e;
1048
1051
  }
1049
1052
  initCSS3DRenderer() {
1050
1053
  const e = new cs();
1051
- return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText = Ps, this.el.appendChild(e.domElement), this.css3dRenderer = e, e;
1054
+ return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText = Os, this.el.appendChild(e.domElement), this.css3dRenderer = e, e;
1052
1055
  }
1053
1056
  createCSS2DObject(e) {
1054
1057
  return this.css2dRenderer || this.initCSS2DRenderer(), new as(e);
@@ -1069,7 +1072,7 @@ class As {
1069
1072
  this.css2dRenderer && (this.el.removeChild(this.css2dRenderer.domElement), this.css2dRenderer = null), this.css3dRenderer && (this.el.removeChild(this.css3dRenderer.domElement), this.css3dRenderer = null);
1070
1073
  }
1071
1074
  }
1072
- const Bs = "timestamp-query";
1075
+ const Rs = "timestamp-query";
1073
1076
  class Is {
1074
1077
  el;
1075
1078
  renderer;
@@ -1121,7 +1124,7 @@ class Is {
1121
1124
  }
1122
1125
  #s() {
1123
1126
  try {
1124
- return this.renderer.hasFeature(Bs);
1127
+ return this.renderer.hasFeature(Rs);
1125
1128
  } catch {
1126
1129
  return !0;
1127
1130
  }
@@ -1144,7 +1147,7 @@ class Is {
1144
1147
  }
1145
1148
  }
1146
1149
  wt.enabled = !0;
1147
- class On extends De {
1150
+ class An extends ke {
1148
1151
  el;
1149
1152
  renderer;
1150
1153
  scene;
@@ -1161,7 +1164,7 @@ class On extends De {
1161
1164
  frameCount = 1;
1162
1165
  frameloop = "demand";
1163
1166
  constructor({ el: e, rendererOptions: t }) {
1164
- super(), this.el = e, this.renderer = this._initRenderer(t), this.scene = this.createScene(), this.camera = this.createPerspectiveCamera(), this.info = new Is(this.el, this.renderer), this.controls = new Ms(this.camera, this.renderer.domElement), this.renderPipeline = new Ss(this.renderer, this.scene, this.camera), this.timer = new vt(), this.roomEnvironment = new _s(this.renderer), this.interactionManager = new bs(this.renderer.domElement, this.scene, this.camera), this.objectManager = new xs(), this.viewerHelper = new Es(this), this.cssRenderer = new As(this.el), window.addEventListener("resize", this.onWindowResize);
1167
+ super(), this.el = e, this.renderer = this._initRenderer(t), this.scene = this.createScene(), this.camera = this.createPerspectiveCamera(), this.info = new Is(this.el, this.renderer), this.controls = new Ts(this.camera, this.renderer.domElement), this.renderPipeline = new Ss(this.renderer, this.scene, this.camera), this.timer = new vt(), this.roomEnvironment = new Es(this.renderer), this.interactionManager = new bs(this.renderer.domElement, this.scene, this.camera), this.objectManager = new xs(), this.viewerHelper = new Ps(this), this.cssRenderer = new Bs(this.el), window.addEventListener("resize", this.onWindowResize);
1165
1168
  }
1166
1169
  onWindowResize = () => {
1167
1170
  const e = this.el.clientWidth, t = this.el.clientHeight;
@@ -1202,8 +1205,8 @@ class On extends De {
1202
1205
  return t.setSize(this.el.clientWidth, this.el.clientHeight), t.shadowMap.enabled = !0, t.shadowMap.type = xt, t.toneMapping = St, t.toneMappingExposure = 1, t.info.autoReset = !1, t.setPixelRatio(Math.min(window.devicePixelRatio, 1.5)), t.setAnimationLoop(this.animate), this.el.appendChild(t.domElement), t;
1203
1206
  }
1204
1207
  createScene() {
1205
- const e = new je();
1206
- return e.background = new M(0), e;
1208
+ const e = new Ue();
1209
+ return e.background = new T(0), e;
1207
1210
  }
1208
1211
  createPerspectiveCamera() {
1209
1212
  const e = new se(50, this.el.clientWidth / this.el.clientHeight, 0.1, 1e5);
@@ -1239,7 +1242,7 @@ class On extends De {
1239
1242
  * Set the scene background color, texture, or null.
1240
1243
  */
1241
1244
  setBackground(e) {
1242
- e === null ? this.scene.background = null : e instanceof M || typeof e == "number" || typeof e == "string" ? this.scene.background = new M(e) : this.scene.background = e, this.render();
1245
+ e === null ? this.scene.background = null : e instanceof T || typeof e == "number" || typeof e == "string" ? this.scene.background = new T(e) : this.scene.background = e, this.render();
1243
1246
  }
1244
1247
  /**
1245
1248
  * Set the scene environment map for reflections / IBL.
@@ -1271,7 +1274,7 @@ class On extends De {
1271
1274
  */
1272
1275
  enableFogExp2(e = {}) {
1273
1276
  const { color: t = 13421772, density: s = 0.01 } = e;
1274
- this.scene.fog = new Mt(t, s), this.render();
1277
+ this.scene.fog = new Tt(t, s), this.render();
1275
1278
  }
1276
1279
  /**
1277
1280
  * Disable fog.
@@ -1283,22 +1286,22 @@ class On extends De {
1283
1286
  this.el.removeChild(this.renderer.domElement), window.removeEventListener("resize", this.onWindowResize), this.info.dispose(), this.interactionManager.dispose(), this.roomEnvironment.dispose(), this.cssRenderer.dispose(), this.renderPipeline.dispose(), this.renderer.dispose();
1284
1287
  }
1285
1288
  }
1286
- class Rs extends Qe {
1289
+ class Ls extends Qe {
1287
1290
  constructor(e) {
1288
1291
  super(e);
1289
1292
  }
1290
1293
  parse(e, t, s, n) {
1291
- if (Ls(e.slice(0, 8)) === "SBMG----") {
1292
- const r = zs(e.slice(8));
1294
+ if (zs(e.slice(0, 8)) === "SBMG----") {
1295
+ const r = Ns(e.slice(8));
1293
1296
  return super.parse(r, t, s, n);
1294
1297
  } else
1295
1298
  return super.parse(e, t, s, n);
1296
1299
  }
1297
1300
  }
1298
- function Ls(h) {
1301
+ function zs(h) {
1299
1302
  return new TextDecoder().decode(new Uint8Array(h));
1300
1303
  }
1301
- function zs(h) {
1304
+ function Ns(h) {
1302
1305
  const e = new DataView(h);
1303
1306
  for (let t = 0; t < e.byteLength; t++) {
1304
1307
  const s = e.getUint8(t), n = (s >> 4 & 15) + (s << 4 & 240);
@@ -1306,48 +1309,48 @@ function zs(h) {
1306
1309
  }
1307
1310
  return e.buffer;
1308
1311
  }
1309
- const Ns = 8, Ds = 130, Be = 66, ks = "SBK-----", js = "SBM-----", Xe = new TextDecoder(), Us = new TextEncoder();
1310
- function Hs(h) {
1311
- let e = Ns;
1312
+ const Ds = 8, ks = 130, Re = 66, js = "SBK-----", Us = "SBM-----", Xe = new TextDecoder(), Hs = new TextEncoder();
1313
+ function Fs(h) {
1314
+ let e = Ds;
1312
1315
  const t = new Uint8Array(h, 0, e);
1313
- if (Xe.decode(t) !== ks)
1316
+ if (Xe.decode(t) !== js)
1314
1317
  return h;
1315
- e += Ds;
1318
+ e += ks;
1316
1319
  const n = new Uint8Array(h, 0, e);
1317
1320
  if (n[40] === 1) {
1318
- const r = Us.encode(js), o = new Uint8Array([n[41]]), a = Fs(n), c = Gs(a);
1319
- let l = Be % c.length;
1320
- const d = e + Be, p = new Uint8Array(h, d), u = new Uint8Array(p.length);
1321
+ const r = Hs.encode(Us), o = new Uint8Array([n[41]]), a = Gs(n), c = $s(a);
1322
+ let l = Re % c.length;
1323
+ const d = e + Re, p = new Uint8Array(h, d), u = new Uint8Array(p.length);
1321
1324
  for (let w = 0; w < p.length; w++)
1322
1325
  u[w] = p[w] ^ c[l], l = (l + 1) % c.length;
1323
1326
  const m = new Uint8Array(r.length + o.length + u.length);
1324
1327
  return m.set(r), m.set(o, r.length), m.set(u, r.length + o.length), m.buffer;
1325
1328
  }
1326
1329
  }
1327
- function Fs(h) {
1330
+ function Gs(h) {
1328
1331
  const e = new Uint8Array(128);
1329
1332
  return e.set(h.slice(42, 74), 0), e.set(h.slice(74, 138), 32), e.set(h.slice(8, 40), 96), e;
1330
1333
  }
1331
- function Gs(h) {
1334
+ function $s(h) {
1332
1335
  const e = new Uint8Array(64);
1333
1336
  return e.set(h.slice(0, 8), 0), e.set(h.slice(24, 32), 8), e.set(h.slice(40, 56), 16), e.set(h.slice(64, 88), 32), e.set(h.slice(96, 104), 56), e;
1334
1337
  }
1335
- const $s = (h, e, t) => {
1338
+ const Ws = (h, e, t) => {
1336
1339
  const s = h.buffer.slice(t, t + e);
1337
1340
  let n = Xe.decode(s);
1338
1341
  return n = n.replace("\\", "/"), n.startsWith("Maps/") || (n = `Maps/${n}`), n;
1339
- }, Ws = (h, e, t) => {
1342
+ }, Ks = (h, e, t) => {
1340
1343
  const [s, n, i, r, o] = e, a = t || r < 1;
1341
1344
  return new L({
1342
1345
  name: h,
1343
- color: new M(s, n, i),
1346
+ color: new T(s, n, i),
1344
1347
  opacity: r,
1345
1348
  transparent: a,
1346
1349
  alphaTest: 0.01,
1347
1350
  side: o
1348
1351
  });
1349
- }, Ks = (h) => h?.toLowerCase().endsWith(".png") ?? !1;
1350
- class Qs {
1352
+ }, Qs = (h) => h?.toLowerCase().endsWith(".png") ?? !1;
1353
+ class qs {
1351
1354
  data;
1352
1355
  options;
1353
1356
  textureLoader;
@@ -1358,7 +1361,7 @@ class Qs {
1358
1361
  }
1359
1362
  parse(e, t) {
1360
1363
  let s = this.data;
1361
- const n = Hs(this.data);
1364
+ const n = Fs(this.data);
1362
1365
  n && (s = n);
1363
1366
  const i = new DataView(s);
1364
1367
  let r = 8;
@@ -1366,7 +1369,7 @@ class Qs {
1366
1369
  r += 1, o === 1 ? this._parseV2(i, r, e) : o === 2 ? this._parseV2(i, r, e) : o === 3 ? this._parseV3(i, r, e) : t?.(new Error(`SBMLoader: Unsupported SBM version: ${o}`));
1367
1370
  }
1368
1371
  _parseV2(e, t, s) {
1369
- const n = new R(), i = e.getUint16(t, this.littleEndian);
1372
+ const n = new I(), i = e.getUint16(t, this.littleEndian);
1370
1373
  t += 2;
1371
1374
  const r = e.getUint16(t, this.littleEndian);
1372
1375
  t += 2;
@@ -1385,11 +1388,11 @@ class Qs {
1385
1388
  t += 1, u === 0 ? u = _t : u === 1 ? u = Et : u === 2 && (u = Pt);
1386
1389
  const m = e.getUint16(t, this.littleEndian);
1387
1390
  t += 2;
1388
- const w = m > 0 ? $s(e, m, t) : "";
1391
+ const w = m > 0 ? Ws(e, m, t) : "";
1389
1392
  if (t += m, !this.materials.has(a)) {
1390
- const x = Ws(a, [c, l, d, p, u], Ks(w));
1391
- this.materials.set(a, x), w && this.options.path && this.textureLoader.load(I.resolveURL(w, this.options.path), (y) => {
1392
- y.colorSpace = Ge, y.wrapS = xe, y.wrapT = xe, y.flipY = !1, y.anisotropy = 16, x.map = y;
1393
+ const x = Ks(a, [c, l, d, p, u], Qs(w));
1394
+ this.materials.set(a, x), w && this.options.path && this.textureLoader.load(R.resolveURL(w, this.options.path), (y) => {
1395
+ y.colorSpace = Ge, y.wrapS = Se, y.wrapT = Se, y.flipY = !1, y.anisotropy = 16, x.map = y;
1393
1396
  });
1394
1397
  }
1395
1398
  }
@@ -1435,7 +1438,7 @@ class Qs {
1435
1438
  U !== void 0 && (J = U[0], W = U[1], j = U[2]), _.push(...J.toArray(), ...W.toArray(), ...j.toArray());
1436
1439
  }
1437
1440
  const A = new Float32Array(y), B = new Float32Array(_), E = new Q();
1438
- if (A.length > 0 && E.setAttribute("position", new Se(A, 3)), B.length > 0 && E.setAttribute("uv", new Se(B, 2)), E.computeVertexNormals(), this.materials.has(c)) {
1441
+ if (A.length > 0 && E.setAttribute("position", new Ce(A, 3)), B.length > 0 && E.setAttribute("uv", new Ce(B, 2)), E.computeVertexNormals(), this.materials.has(c)) {
1439
1442
  const g = new k(E, this.materials.get(c));
1440
1443
  g.name = a, g.castShadow = !0, g.receiveShadow = !0, n.add(g);
1441
1444
  }
@@ -1443,20 +1446,20 @@ class Qs {
1443
1446
  s(n);
1444
1447
  }
1445
1448
  _parseV3(e, t, s) {
1446
- const n = new R();
1449
+ const n = new I();
1447
1450
  console.warn("SBMLoader: SBM version 3 is not supported yet."), s(n);
1448
1451
  }
1449
1452
  }
1450
- class qs extends Tt {
1453
+ class Xs extends Mt {
1451
1454
  load(e, t, s, n) {
1452
1455
  let i;
1453
1456
  if (this.resourcePath !== "")
1454
1457
  i = this.resourcePath;
1455
1458
  else if (this.path !== "") {
1456
- const a = I.extractUrlBase(e);
1457
- i = I.resolveURL(a, this.path);
1459
+ const a = R.extractUrlBase(e);
1460
+ i = R.resolveURL(a, this.path);
1458
1461
  } else
1459
- i = I.extractUrlBase(e);
1462
+ i = R.extractUrlBase(e);
1460
1463
  this.manager.itemStart(e);
1461
1464
  const r = (a) => {
1462
1465
  n ? n(a) : console.error(a), this.manager.itemError(e), this.manager.itemEnd(e);
@@ -1487,7 +1490,7 @@ class qs extends Tt {
1487
1490
  n?.(new Error(`SBMLoader: Invalid SBM format: ${i}`));
1488
1491
  return;
1489
1492
  }
1490
- new Qs(e, {
1493
+ new qs(e, {
1491
1494
  path: t,
1492
1495
  crossOrigin: this.crossOrigin,
1493
1496
  requestHeader: this.requestHeader,
@@ -1509,7 +1512,7 @@ class qs extends Tt {
1509
1512
  });
1510
1513
  }
1511
1514
  }
1512
- const Xs = [
1515
+ const Ys = [
1513
1516
  "map",
1514
1517
  "alphaMap",
1515
1518
  "aoMap",
@@ -1543,7 +1546,7 @@ function K(h) {
1543
1546
  for (const s of t) {
1544
1547
  if (!s) continue;
1545
1548
  let n = !1;
1546
- for (const i of Xs) {
1549
+ for (const i of Ys) {
1547
1550
  const r = s[i];
1548
1551
  r?.isTexture && r.image == null && (r.dispose(), s[i] = null, n = !0);
1549
1552
  }
@@ -1555,14 +1558,14 @@ class D {
1555
1558
  static CACHE_NAME = "u-space-model-loader-cache";
1556
1559
  static fileLoader = new He().setResponseType("arraybuffer");
1557
1560
  static dracoLoader = new ms().setDecoderPath(
1558
- `https://cdn.jsdelivr.net/npm/three@0.${Ce}.0/examples/jsm/libs/draco/`
1561
+ `https://cdn.jsdelivr.net/npm/three@0.${Te}.0/examples/jsm/libs/draco/`
1559
1562
  );
1560
1563
  static ktx2Loader = new fs().setTranscoderPath(
1561
- `https://cdn.jsdelivr.net/npm/three@0.${Ce}.0/examples/jsm/libs/basis/`
1564
+ `https://cdn.jsdelivr.net/npm/three@0.${Te}.0/examples/jsm/libs/basis/`
1562
1565
  );
1563
- static gltfLoader = new Qe().setDRACOLoader(D.dracoLoader).setKTX2Loader(D.ktx2Loader).setMeshoptDecoder(Oe);
1564
- static sbmxLoader = new Rs().setDRACOLoader(D.dracoLoader).setKTX2Loader(D.ktx2Loader).setMeshoptDecoder(Oe);
1565
- static sbmLoader = new qs();
1566
+ static gltfLoader = new Qe().setDRACOLoader(D.dracoLoader).setKTX2Loader(D.ktx2Loader).setMeshoptDecoder(Ae);
1567
+ static sbmxLoader = new Ls().setDRACOLoader(D.dracoLoader).setKTX2Loader(D.ktx2Loader).setMeshoptDecoder(Ae);
1568
+ static sbmLoader = new Xs();
1566
1569
  static fbxLoader = new ds();
1567
1570
  static objLoader = new ps();
1568
1571
  static stlLoader = new us();
@@ -1593,16 +1596,16 @@ class D {
1593
1596
  switch (t.persistent && typeof caches < "u" ? n = await this.getPersistentData(e) : n = await this.fileLoader.loadAsync(e), s) {
1594
1597
  case "gltf":
1595
1598
  case "glb":
1596
- const i = await this.gltfLoader.parseAsync(n, I.extractUrlBase(e));
1599
+ const i = await this.gltfLoader.parseAsync(n, R.extractUrlBase(e));
1597
1600
  return i.scene.animations = i.animations, K(i.scene);
1598
1601
  case "sbmx":
1599
- const r = await this.sbmxLoader.parseAsync(n, I.extractUrlBase(e));
1602
+ const r = await this.sbmxLoader.parseAsync(n, R.extractUrlBase(e));
1600
1603
  return r.scene.animations = r.animations, K(r.scene);
1601
1604
  case "sbm":
1602
- const o = await this.sbmLoader.parseAsync(n, I.extractUrlBase(e));
1605
+ const o = await this.sbmLoader.parseAsync(n, R.extractUrlBase(e));
1603
1606
  return K(o);
1604
1607
  case "fbx":
1605
- const a = this.fbxLoader.parse(n, I.extractUrlBase(e));
1608
+ const a = this.fbxLoader.parse(n, R.extractUrlBase(e));
1606
1609
  return K(a);
1607
1610
  case "obj":
1608
1611
  const c = new TextDecoder().decode(n), l = this.objLoader.parse(c);
@@ -1626,7 +1629,7 @@ class D {
1626
1629
  }
1627
1630
  }
1628
1631
  }
1629
- class An {
1632
+ class Bn {
1630
1633
  static textureLoader = new Fe();
1631
1634
  static hdrLoader = new gs();
1632
1635
  static cubeTextureLoader = new Ot();
@@ -1657,7 +1660,7 @@ class G extends k {
1657
1660
  return this.visible === !1 && this.ignoreInvisibleWhenRaycast === !0 ? !1 : super.raycast(e, t);
1658
1661
  }
1659
1662
  }
1660
- class Ye extends R {
1663
+ class Ye extends I {
1661
1664
  isBaseGroup = !0;
1662
1665
  type = "BaseGroup";
1663
1666
  ignoreInvisibleWhenRaycast = !0;
@@ -1668,7 +1671,7 @@ class Ye extends R {
1668
1671
  return this.visible === !1 && this.ignoreInvisibleWhenRaycast === !0 ? !1 : super.raycast(e, t);
1669
1672
  }
1670
1673
  }
1671
- class Ys extends Bt {
1674
+ class Vs extends Bt {
1672
1675
  isBaseSprite = !0;
1673
1676
  type = "BaseSprite";
1674
1677
  ignoreInvisibleWhenRaycast = !0;
@@ -1695,7 +1698,7 @@ class he extends Ye {
1695
1698
  let i;
1696
1699
  s ? he.memoryCache.has(t) ? i = he.memoryCache.get(t) : (i = D.loadAsync(t, { persistent: n }), he.memoryCache.set(t, i)) : i = D.loadAsync(t, { persistent: n });
1697
1700
  const r = await i, o = ys(r);
1698
- return this.add(o), o.animations && o.animations.length > 0 && (this.animations = o.animations, this.mixer = new It(o)), o;
1701
+ return this.add(o), o.animations && o.animations.length > 0 && (this.animations = o.animations, this.mixer = new Rt(o)), o;
1699
1702
  } catch (i) {
1700
1703
  return console.error(`[Model] Failed to load model from ${t}:`, i), null;
1701
1704
  }
@@ -1707,7 +1710,7 @@ class he extends Ye {
1707
1710
  if (e === void 0 ? o = this.animations[0] : typeof e == "number" ? o = this.animations[e] : o = this.animations.find((c) => c.name === e), !o)
1708
1711
  return console.warn(`[Model] Animation not found: ${e}`), null;
1709
1712
  let a = this.actions.get(o.name);
1710
- return a || (a = this.mixer.clipAction(o), this.actions.set(o.name, a)), a.setLoop(s ? Rt : Lt, n), a.clampWhenFinished = r, a.timeScale = i, a.reset().play(), a;
1713
+ return a || (a = this.mixer.clipAction(o), this.actions.set(o.name, a)), a.setLoop(s ? It : Lt, n), a.clampWhenFinished = r, a.timeScale = i, a.reset().play(), a;
1711
1714
  }
1712
1715
  playAllAnimations(e = {}) {
1713
1716
  return this.animations.map((t, s) => this.playAnimation(s, e)).filter((t) => t !== null);
@@ -1752,7 +1755,7 @@ class he extends Ye {
1752
1755
  typeof caches < "u" && await caches.delete("u-space-loader-cache");
1753
1756
  }
1754
1757
  }
1755
- class Vs extends G {
1758
+ class Js extends G {
1756
1759
  isSphereMesh = !0;
1757
1760
  type = "SphereMesh";
1758
1761
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
@@ -1780,7 +1783,7 @@ class Ie extends G {
1780
1783
  ), this.material = new L(t);
1781
1784
  }
1782
1785
  }
1783
- class Bn extends Ye {
1786
+ class Rn extends Ye {
1784
1787
  isTopology = !0;
1785
1788
  type = "Topology";
1786
1789
  // Visuals
@@ -1883,8 +1886,8 @@ class Bn extends Ye {
1883
1886
  * Renders the entire topology graph structure using TubeGeometry and Spheres.
1884
1887
  */
1885
1888
  renderGraph() {
1886
- this.clearGraph(), this.graphGroup = new R();
1887
- const e = new Vs({
1889
+ this.clearGraph(), this.graphGroup = new I();
1890
+ const e = new Js({
1888
1891
  geometryParameters: {
1889
1892
  radius: this.parameters.nodeRadius,
1890
1893
  widthSegments: 16,
@@ -1983,7 +1986,7 @@ class Bn extends Ye {
1983
1986
  return this.adjacencyMap.get(e);
1984
1987
  }
1985
1988
  }
1986
- class In extends Ys {
1989
+ class In extends Vs {
1987
1990
  isPoi = !0;
1988
1991
  type = "Poi";
1989
1992
  parameters = {
@@ -2094,7 +2097,7 @@ class Je extends G {
2094
2097
  });
2095
2098
  }
2096
2099
  }
2097
- class Rn extends G {
2100
+ class Ln extends G {
2098
2101
  isPlaneMesh = !0;
2099
2102
  type = "PlaneMesh";
2100
2103
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
@@ -2106,7 +2109,7 @@ class Rn extends G {
2106
2109
  ), this.material = new L(t);
2107
2110
  }
2108
2111
  }
2109
- class Ln extends G {
2112
+ class zn extends G {
2110
2113
  isCircleMesh = !0;
2111
2114
  type = "CircleMesh";
2112
2115
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
@@ -2128,13 +2131,13 @@ class F {
2128
2131
  });
2129
2132
  }
2130
2133
  }
2131
- class zn {
2134
+ class Nn {
2132
2135
  static flow(e = {}) {
2133
- const { baseColor: t = 16777215, flowColor: s = 65280, speed: n = 1, scale: i = 3, intensity: r = 4 } = e, o = H(new M(t)), a = H(new M(s)), c = Te().x.mul(i).sub(oe.mul(n)), l = ae(ge(c).add(1).mul(0.5), r);
2136
+ const { baseColor: t = 16777215, flowColor: s = 65280, speed: n = 1, scale: i = 3, intensity: r = 4 } = e, o = H(new T(t)), a = H(new T(s)), c = _e().x.mul(i).sub(oe.mul(n)), l = ae(ye(c).add(1).mul(0.5), r);
2134
2137
  return ce(o, a, l);
2135
2138
  }
2136
2139
  static breathe(e = {}) {
2137
- const { baseColor: t = 16777215, breathColor: s = 65280, speed: n = 1, intensity: i = 2 } = e, r = H(new M(t)), o = H(new M(s)), a = ge(oe.mul(n)).add(1).mul(0.5), c = ae(a, i);
2140
+ const { baseColor: t = 16777215, breathColor: s = 65280, speed: n = 1, intensity: i = 2 } = e, r = H(new T(t)), o = H(new T(s)), a = ye(oe.mul(n)).add(1).mul(0.5), c = ae(a, i);
2138
2141
  return ce(r, o, c);
2139
2142
  }
2140
2143
  static fluid(e = {}) {
@@ -2145,23 +2148,23 @@ class zn {
2145
2148
  scale: i = 1,
2146
2149
  intensity: r = 1,
2147
2150
  distortion: o = 0.5
2148
- } = e, a = H(new M(t)), c = H(new M(s)), l = Te().mul(i), d = oe.mul(n), p = _e(l.add(d), 1, 0), u = l.add(p.mul(o)), m = _e(u, 1, 0).add(1).mul(0.5), w = ae(m, r);
2151
+ } = e, a = H(new T(t)), c = H(new T(s)), l = _e().mul(i), d = oe.mul(n), p = Ee(l.add(d), 1, 0), u = l.add(p.mul(o)), m = Ee(u, 1, 0).add(1).mul(0.5), w = ae(m, r);
2149
2152
  return ce(a, c, w);
2150
2153
  }
2151
2154
  }
2152
- function Nn(h) {
2155
+ function Dn(h) {
2153
2156
  }
2154
- const $ = "uSpaceHighlight", Y = `${$}/enabled`, Ze = `${$}/opacity`, et = `${$}/color`, tt = `${$}/overwrite`, st = `${$}/multiplyOpacity`, de = `${$}/instancedOriginalOpacity`, me = "uSpaceBreathe", pe = `${me}/enabled`, nt = `${me}/color`, it = `${me}/speed`, rt = `${me}/intensity`, ue = /* @__PURE__ */ new WeakMap(), Js = We(() => {
2155
- const h = O(Y, "uint"), e = O(et, "uint"), t = O(tt, "uint"), s = ze(e), n = Ee.mul(s), i = q(t.greaterThan(0), s, n), r = q(h.greaterThan(0), i, Ee), o = O(pe, "uint"), a = O(nt, "uint"), c = O(it, "float"), l = O(rt, "float"), d = ze(a), p = ge(oe.mul(c)).add(1).mul(0.5), u = ae(p, l), m = ce(r, d, u);
2157
+ const $ = "uSpaceHighlight", Y = `${$}/enabled`, Ze = `${$}/opacity`, et = `${$}/color`, tt = `${$}/overwrite`, st = `${$}/multiplyOpacity`, de = `${$}/instancedOriginalOpacity`, me = "uSpaceBreathe", pe = `${me}/enabled`, nt = `${me}/color`, it = `${me}/speed`, rt = `${me}/intensity`, ue = /* @__PURE__ */ new WeakMap(), Zs = We(() => {
2158
+ const h = O(Y, "uint"), e = O(et, "uint"), t = O(tt, "uint"), s = Ne(e), n = Pe.mul(s), i = q(t.greaterThan(0), s, n), r = q(h.greaterThan(0), i, Pe), o = O(pe, "uint"), a = O(nt, "uint"), c = O(it, "float"), l = O(rt, "float"), d = Ne(a), p = ye(oe.mul(c)).add(1).mul(0.5), u = ae(p, l), m = ce(r, d, u);
2156
2159
  return q(o.greaterThan(0), m, r);
2157
- })(), Zs = We(() => {
2158
- const h = O(Y, "uint"), e = O(Ze, "float"), t = O(st, "uint"), s = q(t.greaterThan(0), Pe.mul(e), e);
2159
- return q(h.greaterThan(0), s, Pe);
2160
+ })(), en = We(() => {
2161
+ const h = O(Y, "uint"), e = O(Ze, "float"), t = O(st, "uint"), s = q(t.greaterThan(0), Oe.mul(e), e);
2162
+ return q(h.greaterThan(0), s, Oe);
2160
2163
  })();
2161
2164
  function X(h) {
2162
2165
  return Array.isArray(h.material) ? h.material : [h.material];
2163
2166
  }
2164
- function Re(h) {
2167
+ function Le(h) {
2165
2168
  X(h).forEach((t) => {
2166
2169
  if (!t) return;
2167
2170
  let s = ue.get(t);
@@ -2171,10 +2174,10 @@ function Re(h) {
2171
2174
  transparent: t.transparent,
2172
2175
  depthWrite: t.depthWrite,
2173
2176
  activeMeshes: /* @__PURE__ */ new Set()
2174
- }, ue.set(t, s)), s.activeMeshes.add(h), t.transparent = !0, t.colorNode = Js, t.opacityNode = Zs, t.needsUpdate = !0;
2177
+ }, ue.set(t, s)), s.activeMeshes.add(h), t.transparent = !0, t.colorNode = Zs, t.opacityNode = en, t.needsUpdate = !0;
2175
2178
  });
2176
2179
  }
2177
- function Le(h) {
2180
+ function ze(h) {
2178
2181
  const e = h.userData[Y], t = h.userData[pe];
2179
2182
  if (e || t) return;
2180
2183
  X(h).forEach((n) => {
@@ -2183,18 +2186,18 @@ function Le(h) {
2183
2186
  i && (i.activeMeshes.delete(h), !(i.activeMeshes.size > 0) && (n.colorNode = i.colorNode, n.opacityNode = i.opacityNode, n.transparent = i.transparent, n.depthWrite = i.depthWrite, n.needsUpdate = !0, ue.delete(n)));
2184
2187
  });
2185
2188
  }
2186
- function en(h, e, t, s) {
2189
+ function tn(h, e, t, s) {
2187
2190
  const n = h, i = n.setSemanticHighlight;
2188
2191
  if (i)
2189
2192
  return i.call(h, e, t, s), !0;
2190
2193
  const r = n.setSemanticColor, o = n.setSemanticOpacity, a = n.getSemanticOpacity, c = n.getSemanticColor, l = n.hasSemanticColor;
2191
2194
  return !r || !o ? !1 : (h.userData[de] === void 0 && (h.userData[de] = {
2192
2195
  hasColor: l?.call(h) ?? !1,
2193
- color: c?.call(h, new M()).getHex() ?? 16777215,
2196
+ color: c?.call(h, new T()).getHex() ?? 16777215,
2194
2197
  opacity: a?.call(h) ?? 1
2195
2198
  }), r.call(h, e), o.call(h, t), !0);
2196
2199
  }
2197
- function tn(h) {
2200
+ function sn(h) {
2198
2201
  const e = h, t = e.clearSemanticHighlight;
2199
2202
  if (t)
2200
2203
  return t.call(h), !0;
@@ -2205,10 +2208,10 @@ function tn(h) {
2205
2208
  }
2206
2209
  class le {
2207
2210
  static highlightColor(e, t = {}) {
2208
- const s = Array.isArray(e) ? e : [e], { opacity: n = 0.5, color: i = 16711680, overwrite: r = !1, depthWrite: o, multiplyOpacity: a = !1 } = t, c = new M(i).getHex();
2211
+ const s = Array.isArray(e) ? e : [e], { opacity: n = 0.5, color: i = 16711680, overwrite: r = !1, depthWrite: o, multiplyOpacity: a = !1 } = t, c = new T(i).getHex();
2209
2212
  for (const l of s)
2210
- en(l, i, n, r) || F.traverseMeshes(l, (d) => {
2211
- d.userData[Y] = 1, d.userData[Ze] = n, d.userData[et] = c, d.userData[tt] = r ? 1 : 0, d.userData[st] = a ? 1 : 0, Re(d), o !== void 0 && X(d).forEach((u) => {
2213
+ tn(l, i, n, r) || F.traverseMeshes(l, (d) => {
2214
+ d.userData[Y] = 1, d.userData[Ze] = n, d.userData[et] = c, d.userData[tt] = r ? 1 : 0, d.userData[st] = a ? 1 : 0, Le(d), o !== void 0 && X(d).forEach((u) => {
2212
2215
  u && (u.depthWrite = o);
2213
2216
  });
2214
2217
  });
@@ -2216,8 +2219,8 @@ class le {
2216
2219
  static removeHighlightColor(e) {
2217
2220
  const t = Array.isArray(e) ? e : [e];
2218
2221
  for (const s of t)
2219
- tn(s) || F.traverseMeshes(s, (n) => {
2220
- n.userData[Y] = 0, Le(n);
2222
+ sn(s) || F.traverseMeshes(s, (n) => {
2223
+ n.userData[Y] = 0, ze(n);
2221
2224
  });
2222
2225
  }
2223
2226
  static breatheColor(e, t = {}) {
@@ -2229,17 +2232,17 @@ class le {
2229
2232
  },
2230
2233
  t
2231
2234
  );
2232
- n.color = new M(n.color).getHex();
2235
+ n.color = new T(n.color).getHex();
2233
2236
  for (const i of s)
2234
2237
  F.traverseMeshes(i, (r) => {
2235
- r.userData[pe] = 1, r.userData[nt] = n.color, r.userData[it] = n.speed, r.userData[rt] = n.intensity, Re(r);
2238
+ r.userData[pe] = 1, r.userData[nt] = n.color, r.userData[it] = n.speed, r.userData[rt] = n.intensity, Le(r);
2236
2239
  });
2237
2240
  }
2238
2241
  static removeBreatheColor(e) {
2239
2242
  const t = Array.isArray(e) ? e : [e];
2240
2243
  for (const s of t)
2241
2244
  F.traverseMeshes(s, (n) => {
2242
- n.userData[pe] = 0, Le(n);
2245
+ n.userData[pe] = 0, ze(n);
2243
2246
  });
2244
2247
  }
2245
2248
  /**
@@ -2317,11 +2320,11 @@ class le {
2317
2320
  });
2318
2321
  }
2319
2322
  }
2320
- const ze = (h) => {
2323
+ const Ne = (h) => {
2321
2324
  const e = h.shiftRight(16).bitAnd(255).toFloat().div(255), t = h.shiftRight(8).bitAnd(255).toFloat().div(255), s = h.bitAnd(255).toFloat().div(255);
2322
2325
  return es(e, t, s);
2323
2326
  };
2324
- class sn extends ws {
2327
+ class nn extends ws {
2325
2328
  viewer;
2326
2329
  constructor(e, t) {
2327
2330
  super(t), this.viewer = e;
@@ -2330,7 +2333,7 @@ class sn extends ws {
2330
2333
  this.update(e) && this.viewer.render();
2331
2334
  };
2332
2335
  easingByMode(e) {
2333
- const t = nn[e];
2336
+ const t = rn[e];
2334
2337
  return super.easing(t);
2335
2338
  }
2336
2339
  start(e, t) {
@@ -2340,9 +2343,9 @@ class sn extends ws {
2340
2343
  return this.viewer.removeEventListener("afterControlsUpdate", this._update), super.stop();
2341
2344
  }
2342
2345
  }
2343
- function Dn(h, e, t, s = {}, n, i) {
2346
+ function kn(h, e, t, s = {}, n, i) {
2344
2347
  return new Promise((r, o) => {
2345
- const { duration: a = 1e3, delay: c = 0, repeat: l = !1, mode: d = "Linear.None", yoyo: p = !1 } = s, u = new sn(h, e).to(t, a).easingByMode(d).delay(c).onUpdate((m) => {
2348
+ const { duration: a = 1e3, delay: c = 0, repeat: l = !1, mode: d = "Linear.None", yoyo: p = !1 } = s, u = new nn(h, e).to(t, a).easingByMode(d).delay(c).onUpdate((m) => {
2346
2349
  n?.(m, u);
2347
2350
  }).onComplete(() => {
2348
2351
  r();
@@ -2354,7 +2357,7 @@ function Dn(h, e, t, s = {}, n, i) {
2354
2357
  typeof l == "number" ? u.repeat(l) : typeof l == "boolean" && l && u.repeat(1 / 0), p && u.repeatDelay(20), u.yoyo(p), u.start();
2355
2358
  });
2356
2359
  }
2357
- const nn = {
2360
+ const rn = {
2358
2361
  "Linear.None": f.Linear.None,
2359
2362
  "Quadratic.In": f.Quadratic.In,
2360
2363
  "Quadratic.Out": f.Quadratic.Out,
@@ -2387,7 +2390,7 @@ const nn = {
2387
2390
  "Bounce.Out": f.Bounce.Out,
2388
2391
  "Bounce.InOut": f.Bounce.InOut
2389
2392
  };
2390
- class kn {
2393
+ class jn {
2391
2394
  scene;
2392
2395
  planes = /* @__PURE__ */ new Map();
2393
2396
  helpers = /* @__PURE__ */ new Map();
@@ -2503,7 +2506,7 @@ class kn {
2503
2506
  this.hideHelper(e);
2504
2507
  const n = this.planes.get(e);
2505
2508
  if (!n) return;
2506
- const i = new Qt(n, t, new M(s).getHex());
2509
+ const i = new Qt(n, t, new T(s).getHex());
2507
2510
  i.name = e, this.helpers.set(e, i), this.scene.add(i);
2508
2511
  }
2509
2512
  /**
@@ -2529,7 +2532,7 @@ class kn {
2529
2532
  this.detach(), this.removeAll(), this.scene.remove(this.group);
2530
2533
  }
2531
2534
  }
2532
- class jn {
2535
+ class Un {
2533
2536
  scene;
2534
2537
  measurements = /* @__PURE__ */ new Map();
2535
2538
  _idCounter = 0;
@@ -2540,7 +2543,7 @@ class jn {
2540
2543
  * Measure distance between two points.
2541
2544
  */
2542
2545
  measureDistance(e, t, s = {}) {
2543
- const { lineColor: n = 16776960 } = s, i = new v(e.x, e.y, e.z), r = new v(t.x, t.y, t.z), o = i.distanceTo(r), a = `measure_dist_${this._idCounter++}`, c = new R();
2546
+ const { lineColor: n = 16776960 } = s, i = new v(e.x, e.y, e.z), r = new v(t.x, t.y, t.z), o = i.distanceTo(r), a = `measure_dist_${this._idCounter++}`, c = new I();
2544
2547
  c.name = a;
2545
2548
  const l = new Q().setFromPoints([i, r]), d = new ie({ color: n }), p = new re(l, d);
2546
2549
  c.add(p), this.scene.add(c);
@@ -2561,7 +2564,7 @@ class jn {
2561
2564
  const { lineColor: s = 65280 } = t;
2562
2565
  if (e.length < 3)
2563
2566
  throw new Error("MeasureTool.measureArea requires at least 3 points");
2564
- const n = e.map((u) => new v(u.x, u.y, u.z)), i = this._calculatePolygonArea(n), r = `measure_area_${this._idCounter++}`, o = new R();
2567
+ const n = e.map((u) => new v(u.x, u.y, u.z)), i = this._calculatePolygonArea(n), r = `measure_area_${this._idCounter++}`, o = new I();
2565
2568
  o.name = r;
2566
2569
  const a = [...n, n[0]], c = new Q().setFromPoints(a), l = new ie({ color: s }), d = new re(c, l);
2567
2570
  o.add(d), this.scene.add(o);
@@ -2579,7 +2582,7 @@ class jn {
2579
2582
  * Measure the angle between three points (vertex at the middle point).
2580
2583
  */
2581
2584
  measureAngle(e, t, s, n = {}) {
2582
- const { lineColor: i = 16746496 } = n, r = new v(e.x, e.y, e.z), o = new v(t.x, t.y, t.z), a = new v(s.x, s.y, s.z), c = r.clone().sub(o).normalize(), l = a.clone().sub(o).normalize(), p = Math.acos(Math.max(-1, Math.min(1, c.dot(l)))) * 180 / Math.PI, u = `measure_angle_${this._idCounter++}`, m = new R();
2585
+ const { lineColor: i = 16746496 } = n, r = new v(e.x, e.y, e.z), o = new v(t.x, t.y, t.z), a = new v(s.x, s.y, s.z), c = r.clone().sub(o).normalize(), l = a.clone().sub(o).normalize(), p = Math.acos(Math.max(-1, Math.min(1, c.dot(l)))) * 180 / Math.PI, u = `measure_angle_${this._idCounter++}`, m = new I();
2583
2586
  m.name = u;
2584
2587
  const w = new Q().setFromPoints([r, o, a]), S = new ie({ color: i }), x = new re(w, S);
2585
2588
  m.add(x), this.scene.add(m);
@@ -2642,7 +2645,7 @@ class jn {
2642
2645
  this.removeAll();
2643
2646
  }
2644
2647
  }
2645
- class Un {
2648
+ class Hn {
2646
2649
  scene;
2647
2650
  annotations = /* @__PURE__ */ new Map();
2648
2651
  _idCounter = 0;
@@ -2662,7 +2665,7 @@ class Un {
2662
2665
  */
2663
2666
  add(e, t) {
2664
2667
  this.annotations.has(e) && this.remove(e);
2665
- const s = new R();
2668
+ const s = new I();
2666
2669
  s.name = `annotation_${e}`;
2667
2670
  const n = new v(t.position.x, t.position.y, t.position.z);
2668
2671
  s.position.copy(n);
@@ -2795,47 +2798,47 @@ class Un {
2795
2798
  this.removeAll();
2796
2799
  }
2797
2800
  }
2798
- const rn = "0.0.28";
2799
- window.__USPACE__ = { version: rn };
2801
+ const on = "0.0.29";
2802
+ window.__USPACE__ = { version: on };
2800
2803
  export {
2801
- Un as AnnotationManager,
2804
+ Hn as AnnotationManager,
2802
2805
  Ye as BaseGroup,
2803
2806
  G as BaseMesh,
2804
- Ys as BaseSprite,
2805
- Gn as CSS2DObject,
2806
- Wn as CSS3DObject,
2807
- Kn as CSS3DSprite,
2808
- As as CSSRenderer,
2809
- Ms as CameraControls,
2810
- Ln as CircleMesh,
2811
- kn as ClippingTool,
2807
+ Vs as BaseSprite,
2808
+ $n as CSS2DObject,
2809
+ Kn as CSS3DObject,
2810
+ Qn as CSS3DSprite,
2811
+ Bs as CSSRenderer,
2812
+ Ts as CameraControls,
2813
+ zn as CircleMesh,
2814
+ jn as ClippingTool,
2812
2815
  Je as ExtrudeMesh,
2813
2816
  vs as InteractionEvent,
2814
2817
  bs as InteractionManager,
2815
- Pn as LightManager,
2818
+ On as LightManager,
2816
2819
  le as MaterialEffects,
2817
- jn as MeasureTool,
2820
+ Un as MeasureTool,
2818
2821
  he as Model,
2819
2822
  D as ModelLoaderManager,
2820
2823
  xs as ObjectManager,
2821
2824
  F as ObjectUtils,
2822
- Rn as PlaneMesh,
2825
+ Ln as PlaneMesh,
2823
2826
  In as Poi,
2824
2827
  Ss as RenderPipeline,
2825
- _s as RoomEnvironment,
2826
- qs as SBMLoader,
2827
- Rs as SBMXLoader,
2828
- En as SceneManager,
2829
- _n as Selection,
2828
+ Es as RoomEnvironment,
2829
+ Xs as SBMLoader,
2830
+ Ls as SBMXLoader,
2831
+ Pn as SceneManager,
2832
+ En as Selection,
2830
2833
  Ve as ShapeMesh,
2831
- Vs as SphereMesh,
2832
- zn as TSLEffects,
2833
- An as TextureLoaderManager,
2834
- Bn as Topology,
2834
+ Js as SphereMesh,
2835
+ Nn as TSLEffects,
2836
+ Bn as TextureLoaderManager,
2837
+ Rn as Topology,
2835
2838
  Ie as TubeMesh,
2836
- sn as Tween,
2837
- On as Viewer,
2838
- Nn as reinterpretType,
2839
- Dn as tweenAnimation,
2840
- rn as version
2839
+ nn as Tween,
2840
+ An as Viewer,
2841
+ Dn as reinterpretType,
2842
+ kn as tweenAnimation,
2843
+ on as version
2841
2844
  };