@shopware-ag/dive 2.0.1-beta.4 → 2.0.1-beta.6

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 (119) hide show
  1. package/build/chunks/ARSystem-D27w7Pck.mjs +208 -0
  2. package/build/chunks/ARSystem-_0cLAxyG.cjs +1 -0
  3. package/build/{src/modules/animation/AnimationSystem.mjs → chunks/AnimationSystem-Bf-xhqRe.mjs} +24 -18
  4. package/build/chunks/AnimationSystem-DFUYMNpj.cjs +1 -0
  5. package/build/{src/modules/asset/exporter/AssetExporter.cjs → chunks/AssetExporter-CAqADFbL.cjs} +1 -1
  6. package/build/{src/modules/asset/exporter/AssetExporter.mjs → chunks/AssetExporter-ClYQ4gnb.mjs} +2 -2
  7. package/build/{src/modules/asset/loader/AssetLoader.mjs → chunks/AssetLoader-BewzFwHi.mjs} +6 -6
  8. package/build/chunks/AssetLoader-Bq-Ekxil.cjs +4 -0
  9. package/build/chunks/AxisCamera-CUb3g8WX.cjs +1 -0
  10. package/build/chunks/AxisCamera-lXJLIPLK.mjs +39 -0
  11. package/build/chunks/AxisHelperColors-BrGqktN5.cjs +1 -0
  12. package/build/chunks/AxisHelperColors-JLBHYQDi.mjs +9 -0
  13. package/build/chunks/MediaCreator-CEWeS42n.cjs +1 -0
  14. package/build/{src/modules/mediacreator/MediaCreator.mjs → chunks/MediaCreator-psLAAyJA.mjs} +1 -1
  15. package/build/chunks/ModuleRegistry-CBfx1EVd.mjs +13 -0
  16. package/build/chunks/ModuleRegistry-CDIxOzgZ.cjs +1 -0
  17. package/build/chunks/OrbitController-B8VkQV1e.cjs +1 -0
  18. package/build/chunks/OrbitController-CXu1ko6E.mjs +462 -0
  19. package/build/chunks/{PerspectiveCamera-sm4_81KJ.mjs → PerspectiveCamera-PMJPzAn3.mjs} +2 -2
  20. package/build/chunks/SelectTool-9eiKZXT4.cjs +1 -0
  21. package/build/chunks/{SelectTool-DmuTopJx.mjs → SelectTool-DLXheZay.mjs} +23 -18
  22. package/build/{src/modules/state/State.mjs → chunks/State-BNgqNPrs.mjs} +2 -2
  23. package/build/{src/modules/state/State.cjs → chunks/State-Mvu0hG-n.cjs} +1 -1
  24. package/build/{src/modules/toolbox/Toolbox.mjs → chunks/Toolbox-DKuyL8n5.mjs} +1 -1
  25. package/build/chunks/Toolbox-qFN47t2F.cjs +1 -0
  26. package/build/chunks/findInterface-C6mrvf_t.cjs +1 -0
  27. package/build/chunks/findInterface-DbJ5qzbc.mjs +11 -0
  28. package/build/chunks/index-C_uFFwT2.mjs +5 -0
  29. package/build/chunks/index-DAwIH9xh.cjs +1 -0
  30. package/build/chunks/package-CHgGmFCa.cjs +1 -0
  31. package/build/chunks/package-CIkS9WF6.mjs +39 -0
  32. package/build/dive.cjs +2 -2
  33. package/build/dive.mjs +597 -1074
  34. package/build/modules/animation/index.cjs +1 -0
  35. package/build/modules/animation/index.d.ts +2 -0
  36. package/build/modules/animation/index.mjs +5 -0
  37. package/build/modules/ar/index.cjs +1 -0
  38. package/build/modules/ar/index.d.ts +2 -0
  39. package/build/modules/ar/index.mjs +11 -0
  40. package/build/modules/assetconverter/index.cjs +1 -0
  41. package/build/modules/assetconverter/index.d.ts +2 -0
  42. package/build/modules/assetconverter/index.mjs +4 -0
  43. package/build/modules/assetexporter/index.cjs +1 -0
  44. package/build/modules/assetexporter/index.d.ts +2 -0
  45. package/build/modules/assetexporter/index.mjs +4 -0
  46. package/build/modules/assetloader/index.cjs +1 -0
  47. package/build/modules/assetloader/index.d.ts +2 -0
  48. package/build/modules/assetloader/index.mjs +4 -0
  49. package/build/modules/axiscamera/index.cjs +1 -0
  50. package/build/modules/axiscamera/index.d.ts +2 -0
  51. package/build/modules/axiscamera/index.mjs +4 -0
  52. package/build/modules/controller/index.cjs +1 -0
  53. package/build/modules/controller/index.d.ts +2 -0
  54. package/build/modules/controller/index.mjs +5 -0
  55. package/build/modules/mediacreator/index.cjs +1 -0
  56. package/build/modules/mediacreator/index.d.ts +2 -0
  57. package/build/modules/mediacreator/index.mjs +4 -0
  58. package/build/modules/state/index.cjs +1 -0
  59. package/build/modules/state/index.d.ts +2 -0
  60. package/build/modules/state/index.mjs +39 -0
  61. package/build/modules/systeminfo/index.cjs +1 -0
  62. package/build/modules/systeminfo/index.d.ts +2 -0
  63. package/build/{src/modules/systeminfo/SystemInfo.mjs → modules/systeminfo/index.mjs} +48 -27
  64. package/build/modules/toolbox/index.cjs +1 -0
  65. package/build/modules/toolbox/index.d.ts +2 -0
  66. package/build/modules/toolbox/index.mjs +10 -0
  67. package/build/src/components/node/Node.d.ts +3 -3
  68. package/build/src/core/Dive.d.ts +1 -0
  69. package/build/src/engine/index.d.ts +6 -0
  70. package/build/src/engine/renderer/Renderer.d.ts +47 -7
  71. package/build/src/events/index.d.ts +1 -0
  72. package/build/src/index.d.ts +2 -1
  73. package/build/src/modules/ModuleRegistry.d.ts +3 -3
  74. package/build/src/modules/animation/index.d.ts +2 -0
  75. package/build/src/modules/ar/ARSystem.d.ts +0 -20
  76. package/build/src/modules/ar/arquicklook/ARQuickLook.d.ts +8 -0
  77. package/build/src/modules/ar/error/ar-errors.d.ts +18 -0
  78. package/build/src/modules/ar/index.d.ts +4 -0
  79. package/build/src/modules/ar/sceneviewer/SceneViewer.d.ts +10 -0
  80. package/build/src/modules/ar/webxr/raycaster/WebXRRaycaster.d.ts +1 -1
  81. package/build/src/modules/ar/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +1 -1
  82. package/build/src/modules/{asset/converter → assetconverter}/AssetConverter.d.ts +3 -3
  83. package/build/src/modules/assetconverter/index.d.ts +1 -0
  84. package/build/src/modules/{asset/exporter → assetexporter}/AssetExporter.d.ts +1 -1
  85. package/build/src/modules/assetexporter/index.d.ts +1 -0
  86. package/build/src/modules/assetloader/index.d.ts +1 -0
  87. package/build/src/modules/axiscamera/index.d.ts +1 -0
  88. package/build/src/modules/controller/index.d.ts +1 -0
  89. package/build/src/modules/mediacreator/index.d.ts +1 -0
  90. package/build/src/modules/state/index.d.ts +4 -0
  91. package/build/src/modules/state/types/ActionTypes.d.ts +1 -1
  92. package/build/src/modules/systeminfo/SystemInfo.d.ts +21 -0
  93. package/build/src/modules/systeminfo/index.d.ts +1 -0
  94. package/build/src/modules/toolbox/index.d.ts +4 -0
  95. package/build/src/modules/toolbox/select/SelectTool.d.ts +0 -3
  96. package/build/src/modules/toolbox/transform/TransformTool.d.ts +0 -3
  97. package/package.json +47 -37
  98. package/build/chunks/ModuleRegistry-NyNtjHb2.cjs +0 -1
  99. package/build/chunks/ModuleRegistry-RSub8W0G.mjs +0 -13
  100. package/build/chunks/SelectTool-C7nerV4P.cjs +0 -1
  101. package/build/chunks/findInterface-BEdL2iUQ.cjs +0 -1
  102. package/build/chunks/findInterface-OrXgmwxj.mjs +0 -18
  103. package/build/chunks/index-C7Wx_9uY.mjs +0 -33
  104. package/build/chunks/index-MNP0K5dt.cjs +0 -1
  105. package/build/chunks/package-GVEz369Q.mjs +0 -39
  106. package/build/chunks/package-HZE1xDCC.cjs +0 -1
  107. package/build/src/error/ar-compatibility/ar-compatibility-error.d.ts +0 -12
  108. package/build/src/modules/animation/AnimationSystem.cjs +0 -1
  109. package/build/src/modules/ar/ARSystem.cjs +0 -1
  110. package/build/src/modules/ar/ARSystem.mjs +0 -163
  111. package/build/src/modules/asset/loader/AssetLoader.cjs +0 -4
  112. package/build/src/modules/mediacreator/MediaCreator.cjs +0 -1
  113. package/build/src/modules/systeminfo/SystemInfo.cjs +0 -1
  114. package/build/src/modules/toolbox/Toolbox.cjs +0 -1
  115. /package/build/{src/modules/asset/converter/AssetConverter.cjs → chunks/AssetConverter-BTAb23e8.cjs} +0 -0
  116. /package/build/{src/modules/asset/converter/AssetConverter.mjs → chunks/AssetConverter-D-qOTLs1.mjs} +0 -0
  117. /package/build/src/{modules/events → events}/EventExecutor.d.ts +0 -0
  118. /package/build/src/modules/{asset/loader → assetloader}/AssetLoader.d.ts +0 -0
  119. /package/build/src/modules/{asset → assetloader}/draco/DracoLoader.d.ts +0 -0
package/build/dive.mjs CHANGED
@@ -1,661 +1,146 @@
1
- var Dt = Object.defineProperty;
2
- var xt = (h, s, t) => s in h ? Dt(h, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[s] = t;
3
- var a = (h, s, t) => xt(h, typeof s != "symbol" ? s + "" : s, t);
4
- import { Ray as Tt, Plane as Lt, MathUtils as C, EventDispatcher as Pt, Vector3 as m, MOUSE as G, TOUCH as U, Spherical as Ne, Quaternion as Fe, Vector2 as E, OrthographicCamera as St, Vector4 as It, AxesHelper as Mt, Color as D, Matrix4 as Ct, Object3D as j, AmbientLight as Ot, PointLight as vt, SphereGeometry as Ke, MeshBasicMaterial as At, FrontSide as kt, Mesh as pe, HemisphereLight as Rt, DirectionalLight as Vt, Box3 as Ze, MeshStandardMaterial as fe, Raycaster as Xe, CylinderGeometry as Bt, BufferGeometry as qe, BufferAttribute as Ye, BoxGeometry as de, ConeGeometry as zt, LineDashedMaterial as Nt, Line as Ft, PlaneGeometry as Yt, GridHelper as Gt, Scene as Ut, WebGLRenderer as Ge } from "three";
5
- import ue from "three-spritetext";
6
- import { C as q, P as S, U as jt, H as Ht } from "./chunks/VisibilityLayerMask-CXgt1fJc.mjs";
7
- import { A as Wt, a as Kt, b as Zt, c as Xt, d as qt, e as Jt } from "./chunks/findInterface-OrXgmwxj.mjs";
8
- import { f as Fi, i as Yi } from "./chunks/findInterface-OrXgmwxj.mjs";
9
- import { g as w } from "./chunks/ModuleRegistry-RSub8W0G.mjs";
10
- import { D as $t, a as Qt } from "./chunks/PerspectiveCamera-sm4_81KJ.mjs";
11
- import { F as Ui, N as ji, S as Hi, g as Wi, i as Ki } from "./chunks/FileTypes-DuVGjbcR.mjs";
12
- import { A as Xi, E as qi, a as Ji } from "./chunks/index-C7Wx_9uY.mjs";
13
- import { F as Qi, P as es } from "./chunks/parse-error-BFRJyIxM.mjs";
14
- const Ue = { type: "change" }, me = { type: "start" }, je = { type: "end" }, ie = new Tt(), He = new Lt(), ei = Math.cos(70 * C.DEG2RAD);
15
- class ti extends Pt {
16
- constructor(s, t) {
17
- super(), this.object = s, this.domElement = t, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new m(), this.cursor = new m(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: G.ROTATE, MIDDLE: G.DOLLY, RIGHT: G.PAN }, this.touches = { ONE: U.ROTATE, TWO: U.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
18
- return l.phi;
19
- }, this.getAzimuthalAngle = function() {
20
- return l.theta;
21
- }, this.getDistance = function() {
22
- return this.object.position.distanceTo(this.target);
23
- }, this.listenToKeyEvents = function(i) {
24
- i.addEventListener("keydown", ce), this._domElementKeyEvents = i;
25
- }, this.stopListenToKeyEvents = function() {
26
- this._domElementKeyEvents.removeEventListener("keydown", ce), this._domElementKeyEvents = null;
27
- }, this.saveState = function() {
28
- e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
29
- }, this.reset = function() {
30
- e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Ue), e.update(), o = n.NONE;
31
- }, this.update = function() {
32
- const i = new m(), r = new Fe().setFromUnitVectors(s.up, new m(0, 1, 0)), d = r.clone().invert(), u = new m(), y = new Fe(), M = new m(), b = 2 * Math.PI;
33
- return function(Et = null) {
34
- const Be = e.object.position;
35
- i.copy(Be).sub(e.target), i.applyQuaternion(r), l.setFromVector3(i), e.autoRotate && o === n.NONE && W(st(Et)), e.enableDamping ? (l.theta += p.theta * e.dampingFactor, l.phi += p.phi * e.dampingFactor) : (l.theta += p.theta, l.phi += p.phi);
36
- let T = e.minAzimuthAngle, L = e.maxAzimuthAngle;
37
- isFinite(T) && isFinite(L) && (T < -Math.PI ? T += b : T > Math.PI && (T -= b), L < -Math.PI ? L += b : L > Math.PI && (L -= b), T <= L ? l.theta = Math.max(T, Math.min(L, l.theta)) : l.theta = l.theta > (T + L) / 2 ? Math.max(T, l.theta) : Math.min(L, l.theta)), l.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, l.phi)), l.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(_, e.dampingFactor) : e.target.add(_), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor);
38
- let Z = !1;
39
- if (e.zoomToCursor && $ || e.object.isOrthographicCamera)
40
- l.radius = he(l.radius);
41
- else {
42
- const P = l.radius;
43
- l.radius = he(l.radius * f), Z = P != l.radius;
44
- }
45
- if (i.setFromSpherical(l), i.applyQuaternion(d), Be.copy(e.target).add(i), e.object.lookAt(e.target), e.enableDamping === !0 ? (p.theta *= 1 - e.dampingFactor, p.phi *= 1 - e.dampingFactor, _.multiplyScalar(1 - e.dampingFactor)) : (p.set(0, 0, 0), _.set(0, 0, 0)), e.zoomToCursor && $) {
46
- let P = null;
47
- if (e.object.isPerspectiveCamera) {
48
- const X = i.length();
49
- P = he(X * f);
50
- const te = X - P;
51
- e.object.position.addScaledVector(ye, te), e.object.updateMatrixWorld(), Z = !!te;
52
- } else if (e.object.isOrthographicCamera) {
53
- const X = new m(I.x, I.y, 0);
54
- X.unproject(e.object);
55
- const te = e.object.zoom;
56
- e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), e.object.updateProjectionMatrix(), Z = te !== e.object.zoom;
57
- const ze = new m(I.x, I.y, 0);
58
- ze.unproject(e.object), e.object.position.sub(ze).add(X), e.object.updateMatrixWorld(), P = i.length();
59
- } else
60
- console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
61
- P !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(P).add(e.object.position) : (ie.origin.copy(e.object.position), ie.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(ie.direction)) < ei ? s.lookAt(e.target) : (He.setFromNormalAndCoplanarPoint(e.object.up, e.target), ie.intersectPlane(He, e.target))));
62
- } else if (e.object.isOrthographicCamera) {
63
- const P = e.object.zoom;
64
- e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), P !== e.object.zoom && (e.object.updateProjectionMatrix(), Z = !0);
65
- }
66
- return f = 1, $ = !1, Z || u.distanceToSquared(e.object.position) > c || 8 * (1 - y.dot(e.object.quaternion)) > c || M.distanceToSquared(e.target) > c ? (e.dispatchEvent(Ue), u.copy(e.object.position), y.copy(e.object.quaternion), M.copy(e.target), !0) : !1;
67
- };
68
- }(), this.dispose = function() {
69
- e.domElement.removeEventListener("contextmenu", Re), e.domElement.removeEventListener("pointerdown", Ce), e.domElement.removeEventListener("pointercancel", K), e.domElement.removeEventListener("wheel", Oe), e.domElement.removeEventListener("pointermove", le), e.domElement.removeEventListener("pointerup", K), e.domElement.getRootNode().removeEventListener("keydown", ve, { capture: !0 }), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", ce), e._domElementKeyEvents = null);
70
- };
71
- const e = this, n = {
72
- NONE: -1,
73
- ROTATE: 0,
74
- DOLLY: 1,
75
- PAN: 2,
76
- TOUCH_ROTATE: 3,
77
- TOUCH_PAN: 4,
78
- TOUCH_DOLLY_PAN: 5,
79
- TOUCH_DOLLY_ROTATE: 6
80
- };
81
- let o = n.NONE;
82
- const c = 1e-6, l = new Ne(), p = new Ne();
83
- let f = 1;
84
- const _ = new m(), O = new E(), v = new E(), V = new E(), A = new E(), k = new E(), B = new E(), z = new E(), N = new E(), R = new E(), ye = new m(), I = new E();
85
- let $ = !1;
86
- const g = [], H = {};
87
- let oe = !1;
88
- function st(i) {
89
- return i !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * i : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
90
- }
91
- function Q(i) {
92
- const r = Math.abs(i * 0.01);
93
- return Math.pow(0.95, e.zoomSpeed * r);
94
- }
95
- function W(i) {
96
- p.theta -= i;
97
- }
98
- function ee(i) {
99
- p.phi -= i;
100
- }
101
- const be = function() {
102
- const i = new m();
103
- return function(d, u) {
104
- i.setFromMatrixColumn(u, 0), i.multiplyScalar(-d), _.add(i);
105
- };
106
- }(), we = function() {
107
- const i = new m();
108
- return function(d, u) {
109
- e.screenSpacePanning === !0 ? i.setFromMatrixColumn(u, 1) : (i.setFromMatrixColumn(u, 0), i.crossVectors(e.object.up, i)), i.multiplyScalar(d), _.add(i);
110
- };
111
- }(), F = function() {
112
- const i = new m();
113
- return function(d, u) {
114
- const y = e.domElement;
115
- if (e.object.isPerspectiveCamera) {
116
- const M = e.object.position;
117
- i.copy(M).sub(e.target);
118
- let b = i.length();
119
- b *= Math.tan(e.object.fov / 2 * Math.PI / 180), be(2 * d * b / y.clientHeight, e.object.matrix), we(2 * u * b / y.clientHeight, e.object.matrix);
120
- } else e.object.isOrthographicCamera ? (be(d * (e.object.right - e.object.left) / e.object.zoom / y.clientWidth, e.object.matrix), we(u * (e.object.top - e.object.bottom) / e.object.zoom / y.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
121
- };
122
- }();
123
- function re(i) {
124
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? f /= i : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
125
- }
126
- function Ee(i) {
127
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? f *= i : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
128
- }
129
- function ae(i, r) {
130
- if (!e.zoomToCursor)
131
- return;
132
- $ = !0;
133
- const d = e.domElement.getBoundingClientRect(), u = i - d.left, y = r - d.top, M = d.width, b = d.height;
134
- I.x = u / M * 2 - 1, I.y = -(y / b) * 2 + 1, ye.set(I.x, I.y, 1).unproject(e.object).sub(e.object.position).normalize();
135
- }
136
- function he(i) {
137
- return Math.max(e.minDistance, Math.min(e.maxDistance, i));
138
- }
139
- function De(i) {
140
- O.set(i.clientX, i.clientY);
141
- }
142
- function nt(i) {
143
- ae(i.clientX, i.clientX), z.set(i.clientX, i.clientY);
144
- }
145
- function xe(i) {
146
- A.set(i.clientX, i.clientY);
147
- }
148
- function ot(i) {
149
- v.set(i.clientX, i.clientY), V.subVectors(v, O).multiplyScalar(e.rotateSpeed);
150
- const r = e.domElement;
151
- W(2 * Math.PI * V.x / r.clientHeight), ee(2 * Math.PI * V.y / r.clientHeight), O.copy(v), e.update();
152
- }
153
- function rt(i) {
154
- N.set(i.clientX, i.clientY), R.subVectors(N, z), R.y > 0 ? re(Q(R.y)) : R.y < 0 && Ee(Q(R.y)), z.copy(N), e.update();
155
- }
156
- function at(i) {
157
- k.set(i.clientX, i.clientY), B.subVectors(k, A).multiplyScalar(e.panSpeed), F(B.x, B.y), A.copy(k), e.update();
158
- }
159
- function ht(i) {
160
- ae(i.clientX, i.clientY), i.deltaY < 0 ? Ee(Q(i.deltaY)) : i.deltaY > 0 && re(Q(i.deltaY)), e.update();
161
- }
162
- function lt(i) {
163
- let r = !1;
164
- switch (i.code) {
165
- case e.keys.UP:
166
- i.ctrlKey || i.metaKey || i.shiftKey ? ee(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : F(0, e.keyPanSpeed), r = !0;
167
- break;
168
- case e.keys.BOTTOM:
169
- i.ctrlKey || i.metaKey || i.shiftKey ? ee(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : F(0, -e.keyPanSpeed), r = !0;
170
- break;
171
- case e.keys.LEFT:
172
- i.ctrlKey || i.metaKey || i.shiftKey ? W(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : F(e.keyPanSpeed, 0), r = !0;
173
- break;
174
- case e.keys.RIGHT:
175
- i.ctrlKey || i.metaKey || i.shiftKey ? W(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : F(-e.keyPanSpeed, 0), r = !0;
176
- break;
177
- }
178
- r && (i.preventDefault(), e.update());
179
- }
180
- function Te(i) {
181
- if (g.length === 1)
182
- O.set(i.pageX, i.pageY);
183
- else {
184
- const r = Y(i), d = 0.5 * (i.pageX + r.x), u = 0.5 * (i.pageY + r.y);
185
- O.set(d, u);
186
- }
187
- }
188
- function Le(i) {
189
- if (g.length === 1)
190
- A.set(i.pageX, i.pageY);
191
- else {
192
- const r = Y(i), d = 0.5 * (i.pageX + r.x), u = 0.5 * (i.pageY + r.y);
193
- A.set(d, u);
194
- }
195
- }
196
- function Pe(i) {
197
- const r = Y(i), d = i.pageX - r.x, u = i.pageY - r.y, y = Math.sqrt(d * d + u * u);
198
- z.set(0, y);
199
- }
200
- function ct(i) {
201
- e.enableZoom && Pe(i), e.enablePan && Le(i);
202
- }
203
- function dt(i) {
204
- e.enableZoom && Pe(i), e.enableRotate && Te(i);
205
- }
206
- function Se(i) {
207
- if (g.length == 1)
208
- v.set(i.pageX, i.pageY);
209
- else {
210
- const d = Y(i), u = 0.5 * (i.pageX + d.x), y = 0.5 * (i.pageY + d.y);
211
- v.set(u, y);
212
- }
213
- V.subVectors(v, O).multiplyScalar(e.rotateSpeed);
214
- const r = e.domElement;
215
- W(2 * Math.PI * V.x / r.clientHeight), ee(2 * Math.PI * V.y / r.clientHeight), O.copy(v);
216
- }
217
- function Ie(i) {
218
- if (g.length === 1)
219
- k.set(i.pageX, i.pageY);
220
- else {
221
- const r = Y(i), d = 0.5 * (i.pageX + r.x), u = 0.5 * (i.pageY + r.y);
222
- k.set(d, u);
223
- }
224
- B.subVectors(k, A).multiplyScalar(e.panSpeed), F(B.x, B.y), A.copy(k);
225
- }
226
- function Me(i) {
227
- const r = Y(i), d = i.pageX - r.x, u = i.pageY - r.y, y = Math.sqrt(d * d + u * u);
228
- N.set(0, y), R.set(0, Math.pow(N.y / z.y, e.zoomSpeed)), re(R.y), z.copy(N);
229
- const M = (i.pageX + r.x) * 0.5, b = (i.pageY + r.y) * 0.5;
230
- ae(M, b);
231
- }
232
- function ut(i) {
233
- e.enableZoom && Me(i), e.enablePan && Ie(i);
234
- }
235
- function mt(i) {
236
- e.enableZoom && Me(i), e.enableRotate && Se(i);
237
- }
238
- function Ce(i) {
239
- e.enabled !== !1 && (g.length === 0 && (e.domElement.setPointerCapture(i.pointerId), e.domElement.addEventListener("pointermove", le), e.domElement.addEventListener("pointerup", K)), !wt(i) && (yt(i), i.pointerType === "touch" ? ke(i) : pt(i)));
240
- }
241
- function le(i) {
242
- e.enabled !== !1 && (i.pointerType === "touch" ? _t(i) : ft(i));
243
- }
244
- function K(i) {
245
- switch (bt(i), g.length) {
246
- case 0:
247
- e.domElement.releasePointerCapture(i.pointerId), e.domElement.removeEventListener("pointermove", le), e.domElement.removeEventListener("pointerup", K), e.dispatchEvent(je), o = n.NONE;
248
- break;
249
- case 1:
250
- const r = g[0], d = H[r];
251
- ke({ pointerId: r, pageX: d.x, pageY: d.y });
252
- break;
253
- }
254
- }
255
- function pt(i) {
256
- let r;
257
- switch (i.button) {
258
- case 0:
259
- r = e.mouseButtons.LEFT;
260
- break;
261
- case 1:
262
- r = e.mouseButtons.MIDDLE;
263
- break;
264
- case 2:
265
- r = e.mouseButtons.RIGHT;
266
- break;
267
- default:
268
- r = -1;
269
- }
270
- switch (r) {
271
- case G.DOLLY:
272
- if (e.enableZoom === !1) return;
273
- nt(i), o = n.DOLLY;
274
- break;
275
- case G.ROTATE:
276
- if (i.ctrlKey || i.metaKey || i.shiftKey) {
277
- if (e.enablePan === !1) return;
278
- xe(i), o = n.PAN;
279
- } else {
280
- if (e.enableRotate === !1) return;
281
- De(i), o = n.ROTATE;
282
- }
283
- break;
284
- case G.PAN:
285
- if (i.ctrlKey || i.metaKey || i.shiftKey) {
286
- if (e.enableRotate === !1) return;
287
- De(i), o = n.ROTATE;
288
- } else {
289
- if (e.enablePan === !1) return;
290
- xe(i), o = n.PAN;
291
- }
292
- break;
293
- default:
294
- o = n.NONE;
295
- }
296
- o !== n.NONE && e.dispatchEvent(me);
297
- }
298
- function ft(i) {
299
- switch (o) {
300
- case n.ROTATE:
301
- if (e.enableRotate === !1) return;
302
- ot(i);
303
- break;
304
- case n.DOLLY:
305
- if (e.enableZoom === !1) return;
306
- rt(i);
307
- break;
308
- case n.PAN:
309
- if (e.enablePan === !1) return;
310
- at(i);
311
- break;
312
- }
313
- }
314
- function Oe(i) {
315
- e.enabled === !1 || e.enableZoom === !1 || o !== n.NONE || (i.preventDefault(), e.dispatchEvent(me), ht(gt(i)), e.dispatchEvent(je));
316
- }
317
- function gt(i) {
318
- const r = i.deltaMode, d = {
319
- clientX: i.clientX,
320
- clientY: i.clientY,
321
- deltaY: i.deltaY
322
- };
323
- switch (r) {
324
- case 1:
325
- d.deltaY *= 16;
326
- break;
327
- case 2:
328
- d.deltaY *= 100;
329
- break;
330
- }
331
- return i.ctrlKey && !oe && (d.deltaY *= 10), d;
332
- }
333
- function ve(i) {
334
- i.key === "Control" && (oe = !0, e.domElement.getRootNode().addEventListener("keyup", Ae, { passive: !0, capture: !0 }));
335
- }
336
- function Ae(i) {
337
- i.key === "Control" && (oe = !1, e.domElement.getRootNode().removeEventListener("keyup", Ae, { passive: !0, capture: !0 }));
338
- }
339
- function ce(i) {
340
- e.enabled === !1 || e.enablePan === !1 || lt(i);
341
- }
342
- function ke(i) {
343
- switch (Ve(i), g.length) {
344
- case 1:
345
- switch (e.touches.ONE) {
346
- case U.ROTATE:
347
- if (e.enableRotate === !1) return;
348
- Te(i), o = n.TOUCH_ROTATE;
349
- break;
350
- case U.PAN:
351
- if (e.enablePan === !1) return;
352
- Le(i), o = n.TOUCH_PAN;
353
- break;
354
- default:
355
- o = n.NONE;
356
- }
357
- break;
358
- case 2:
359
- switch (e.touches.TWO) {
360
- case U.DOLLY_PAN:
361
- if (e.enableZoom === !1 && e.enablePan === !1) return;
362
- ct(i), o = n.TOUCH_DOLLY_PAN;
363
- break;
364
- case U.DOLLY_ROTATE:
365
- if (e.enableZoom === !1 && e.enableRotate === !1) return;
366
- dt(i), o = n.TOUCH_DOLLY_ROTATE;
367
- break;
368
- default:
369
- o = n.NONE;
370
- }
371
- break;
372
- default:
373
- o = n.NONE;
374
- }
375
- o !== n.NONE && e.dispatchEvent(me);
376
- }
377
- function _t(i) {
378
- switch (Ve(i), o) {
379
- case n.TOUCH_ROTATE:
380
- if (e.enableRotate === !1) return;
381
- Se(i), e.update();
382
- break;
383
- case n.TOUCH_PAN:
384
- if (e.enablePan === !1) return;
385
- Ie(i), e.update();
386
- break;
387
- case n.TOUCH_DOLLY_PAN:
388
- if (e.enableZoom === !1 && e.enablePan === !1) return;
389
- ut(i), e.update();
390
- break;
391
- case n.TOUCH_DOLLY_ROTATE:
392
- if (e.enableZoom === !1 && e.enableRotate === !1) return;
393
- mt(i), e.update();
394
- break;
395
- default:
396
- o = n.NONE;
397
- }
398
- }
399
- function Re(i) {
400
- e.enabled !== !1 && i.preventDefault();
401
- }
402
- function yt(i) {
403
- g.push(i.pointerId);
404
- }
405
- function bt(i) {
406
- delete H[i.pointerId];
407
- for (let r = 0; r < g.length; r++)
408
- if (g[r] == i.pointerId) {
409
- g.splice(r, 1);
410
- return;
411
- }
412
- }
413
- function wt(i) {
414
- for (let r = 0; r < g.length; r++)
415
- if (g[r] == i.pointerId) return !0;
416
- return !1;
417
- }
418
- function Ve(i) {
419
- let r = H[i.pointerId];
420
- r === void 0 && (r = new E(), H[i.pointerId] = r), r.set(i.pageX, i.pageY);
421
- }
422
- function Y(i) {
423
- const r = i.pointerId === g[0] ? g[1] : g[0];
424
- return H[r];
425
- }
426
- e.domElement.addEventListener("contextmenu", Re), e.domElement.addEventListener("pointerdown", Ce), e.domElement.addEventListener("pointercancel", K), e.domElement.addEventListener("wheel", Oe, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", ve, { passive: !0, capture: !0 }), this.update();
427
- }
428
- }
429
- const se = {
430
- enableDamping: !0,
431
- dampingFactor: 0.05
432
- }, J = class J extends ti {
433
- constructor(t, e, n = se) {
434
- super(t, e);
435
- a(this, "uuid", C.generateUUID());
436
- a(this, "object");
437
- this.domElement = e, this.domElement = e, this.object = t, this.enableDamping = n.enableDamping ?? se.enableDamping, this.dampingFactor = n.dampingFactor ?? se.dampingFactor, this.object.position.set(0, 2, 2), this.target.copy({ x: 0, y: 0.5, z: 0 }), this.update();
438
- }
439
- tick() {
440
- this.enabled && this.update();
441
- }
442
- computeEncompassingView(t) {
443
- const e = t.getCenter(new m()), n = t.getSize(new m()), o = Math.max(n.x, n.y, n.z) * 1.25;
444
- return {
445
- position: this.object.position.clone().normalize().clone().multiplyScalar(o),
446
- target: e.clone()
447
- };
448
- }
449
- zoomIn(t) {
450
- const e = t || J.DEFAULT_ZOOM_FACTOR, { minDistance: n, maxDistance: o } = this;
451
- this.minDistance = this.maxDistance = C.clamp(
452
- this.getDistance() - e,
453
- n + e,
454
- o - e
455
- ), this.update(), this.minDistance = n, this.maxDistance = o;
456
- }
457
- zoomOut(t) {
458
- const e = t || J.DEFAULT_ZOOM_FACTOR, { minDistance: n, maxDistance: o } = this;
459
- this.minDistance = this.maxDistance = C.clamp(
460
- this.getDistance() + e,
461
- n + e,
462
- o - e
463
- ), this.update(), this.minDistance = n, this.maxDistance = o;
464
- }
465
- };
466
- a(J, "DEFAULT_ZOOM_FACTOR", 1);
467
- let ne = J;
468
- class ii extends St {
469
- constructor(t, e, n) {
470
- super(-1, 1, 1, -1, 0.1, 100);
471
- a(this, "axesHelper");
472
- a(this, "_renderer");
473
- a(this, "_scene");
474
- a(this, "_camera");
475
- a(this, "_restoreViewport", new It());
476
- this.layers.mask = q, this.axesHelper = new Mt(0.5), this.axesHelper.layers.mask = q, this.axesHelper.material.depthTest = !1, this.axesHelper.position.set(0, 0, -1), this.axesHelper.setColors(
477
- new D(Wt),
478
- new D(Kt),
479
- new D(Zt)
480
- );
481
- const o = new ue("X", 0.2, Xt), c = new ue("Y", 0.2, qt), l = new ue("Z", 0.2, Jt);
482
- o.layers.mask = q, c.layers.mask = q, l.layers.mask = q, o.position.set(0.7, 0, 0), c.position.set(0, 0.7, 0), l.position.set(0, 0, 0.7), this.axesHelper.add(o), this.axesHelper.add(c), this.axesHelper.add(l), this.add(this.axesHelper), this._renderer = t, this._scene = e, this._camera = n, this._scene.add(this);
483
- }
484
- tick() {
485
- const t = this._scene.background;
486
- this._scene.background = null, this._renderer.webglrenderer.getViewport(this._restoreViewport), this._renderer.webglrenderer.setViewport(0, 0, 150, 150), this._renderer.webglrenderer.autoClear = !1, this.setFromCameraMatrix(this._camera.matrix), this._renderer.webglrenderer.render(this._scene, this), this._renderer.webglrenderer.setViewport(this._restoreViewport), this._renderer.webglrenderer.autoClear = !0, this._scene.background = t;
487
- }
488
- dispose() {
489
- this._scene.remove(this);
490
- }
491
- setFromCameraMatrix(t) {
492
- this.axesHelper.rotation.setFromRotationMatrix(
493
- new Ct().extractRotation(t).invert()
494
- );
495
- }
496
- }
497
- class si extends j {
1
+ var z = Object.defineProperty;
2
+ var F = (n, i, e) => i in n ? z(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
3
+ var r = (n, i, e) => F(n, typeof i != "symbol" ? i + "" : i, e);
4
+ import { O as U, a as I } from "./chunks/OrbitController-CXu1ko6E.mjs";
5
+ import { D as W } from "./chunks/AxisCamera-lXJLIPLK.mjs";
6
+ import { Object3D as p, AmbientLight as N, PointLight as J, SphereGeometry as C, MeshBasicMaterial as Y, FrontSide as M, Mesh as E, HemisphereLight as $, DirectionalLight as H, Vector3 as m, Box3 as V, MeshStandardMaterial as b, Raycaster as P, Color as f, CylinderGeometry as Q, BufferGeometry as T, BufferAttribute as S, BoxGeometry as y, ConeGeometry as K, LineDashedMaterial as q, Line as X, PlaneGeometry as Z, GridHelper as j, Scene as ee, WebGLRenderer as L, PCFSoftShadowMap as te, PCFShadowMap as ie, BasicShadowMap as se, MathUtils as w } from "three";
7
+ import { P as g, U as ne, H as re } from "./chunks/VisibilityLayerMask-CXgt1fJc.mjs";
8
+ import { g as d } from "./chunks/ModuleRegistry-CBfx1EVd.mjs";
9
+ import { a as oe, D as ae } from "./chunks/PerspectiveCamera-PMJPzAn3.mjs";
10
+ import { F as Ne, N as Je, S as Ye, g as $e, i as He } from "./chunks/FileTypes-DuVGjbcR.mjs";
11
+ import { f as Ke, i as qe } from "./chunks/findInterface-DbJ5qzbc.mjs";
12
+ import { F as Ze, P as je } from "./chunks/parse-error-BFRJyIxM.mjs";
13
+ import { E as tt, a as it } from "./chunks/index-C_uFFwT2.mjs";
14
+ class he extends p {
498
15
  constructor() {
499
16
  super();
500
- a(this, "isDIVELight", !0);
501
- a(this, "isDIVEAmbientLight", !0);
502
- a(this, "_light");
503
- this.name = "DIVEAmbientLight", this._light = new Ot(16777215, 1), this._light.layers.mask = S, this.add(this._light);
17
+ r(this, "isDIVELight", !0);
18
+ r(this, "isDIVEAmbientLight", !0);
19
+ r(this, "_light");
20
+ this.name = "DIVEAmbientLight", this._light = new N(16777215, 1), this._light.layers.mask = g, this.add(this._light);
504
21
  }
505
- setColor(t) {
506
- this._light.color = t;
22
+ setColor(e) {
23
+ this._light.color = e;
507
24
  }
508
- setIntensity(t) {
509
- this._light.intensity = t;
25
+ setIntensity(e) {
26
+ this._light.intensity = e;
510
27
  }
511
- setEnabled(t) {
512
- this._light.visible = t;
28
+ setEnabled(e) {
29
+ this._light.visible = e;
513
30
  }
514
31
  }
515
- class ni extends j {
32
+ class le extends p {
516
33
  constructor() {
517
34
  super();
518
- a(this, "isDIVELight", !0);
519
- a(this, "isDIVEPointLight", !0);
520
- a(this, "isMovable", !0);
521
- a(this, "isSelectable", !0);
522
- a(this, "gizmo", null);
523
- a(this, "light");
524
- a(this, "mesh");
525
- this.name = "DIVEPointLight", this.light = new vt(16777215, 1), this.light.layers.mask = S, this.light.castShadow = !0, this.light.shadow.mapSize.width = 512, this.light.shadow.mapSize.height = 512, this.add(this.light);
526
- const t = 0.1, e = new Ke(
527
- t,
528
- t * 320,
529
- t * 320
530
- ), n = new At({
35
+ r(this, "isDIVELight", !0);
36
+ r(this, "isDIVEPointLight", !0);
37
+ r(this, "isMovable", !0);
38
+ r(this, "isSelectable", !0);
39
+ r(this, "gizmo", null);
40
+ r(this, "light");
41
+ r(this, "mesh");
42
+ this.name = "DIVEPointLight", this.light = new J(16777215, 1), this.light.layers.mask = g, this.light.castShadow = !0, this.light.shadow.mapSize.width = 512, this.light.shadow.mapSize.height = 512, this.add(this.light);
43
+ const e = 0.1, t = new C(
44
+ e,
45
+ e * 320,
46
+ e * 320
47
+ ), s = new Y({
531
48
  color: this.light.color,
532
49
  transparent: !0,
533
50
  opacity: 0.8,
534
- side: kt
51
+ side: M
535
52
  });
536
- this.mesh = new pe(e, n), this.mesh.layers.mask = jt, this.add(this.mesh);
53
+ this.mesh = new E(t, s), this.mesh.layers.mask = ne, this.add(this.mesh);
537
54
  }
538
- setColor(t) {
539
- this.light.color = t, this.mesh.material.color = t;
55
+ setColor(e) {
56
+ this.light.color = e, this.mesh.material.color = e;
540
57
  }
541
- setIntensity(t) {
542
- this.light.intensity = t, this.mesh.material.opacity = t > 0.8 ? 0.8 : t * 0.8;
58
+ setIntensity(e) {
59
+ this.light.intensity = e, this.mesh.material.opacity = e > 0.8 ? 0.8 : e * 0.8;
543
60
  }
544
- setEnabled(t) {
545
- this.light.visible = t;
61
+ setEnabled(e) {
62
+ this.light.visible = e;
546
63
  }
547
64
  onMove() {
548
- w("State").then((t) => {
549
- var e;
550
- (e = t.get(this.userData.id)) == null || e.performAction("UPDATE_OBJECT", {
65
+ d("State").then((e) => {
66
+ var t;
67
+ (t = e.get(this.userData.id)) == null || t.performAction("UPDATE_OBJECT", {
551
68
  id: this.userData.id,
552
69
  position: this.position
553
70
  });
554
71
  });
555
72
  }
556
73
  onSelect() {
557
- w("State").then((t) => {
558
- var e;
559
- (e = t.get(this.userData.id)) == null || e.performAction("SELECT_OBJECT", {
74
+ d("State").then((e) => {
75
+ var t;
76
+ (t = e.get(this.userData.id)) == null || t.performAction("SELECT_OBJECT", {
560
77
  id: this.userData.id
561
78
  });
562
79
  });
563
80
  }
564
81
  onDeselect() {
565
- w("State").then((t) => {
566
- var e;
567
- (e = t.get(this.userData.id)) == null || e.performAction("DESELECT_OBJECT", {
82
+ d("State").then((e) => {
83
+ var t;
84
+ (t = e.get(this.userData.id)) == null || t.performAction("DESELECT_OBJECT", {
568
85
  id: this.userData.id
569
86
  });
570
87
  });
571
88
  }
572
89
  }
573
- class Je extends j {
90
+ class B extends p {
574
91
  constructor() {
575
92
  super();
576
- a(this, "isDIVELight", !0);
577
- a(this, "isDIVESceneLight", !0);
578
- a(this, "_hemiLight");
579
- a(this, "_dirLight");
580
- this.name = "DIVESceneLight", this._hemiLight = new Rt(16777215, 16777215, 2), this._hemiLight.layers.mask = S, this._hemiLight.position.set(0, 50, 0), this.add(this._hemiLight), this._dirLight = new Vt(16777215, 3), this._dirLight.layers.mask = S, this._dirLight.position.set(1, 1.75, 1), this._dirLight.position.multiplyScalar(30), this._dirLight.castShadow = !0, this._dirLight.shadow.mapSize.width = 2048, this._dirLight.shadow.mapSize.height = 2048;
581
- const t = 5;
582
- this._dirLight.shadow.camera.left = -5, this._dirLight.shadow.camera.right = t, this._dirLight.shadow.camera.top = t, this._dirLight.shadow.camera.bottom = -5, this._dirLight.shadow.camera.far = 3500, this.add(this._dirLight);
583
- }
584
- setColor(t) {
585
- this._hemiLight.color = t, this._dirLight.color = t;
586
- }
587
- setIntensity(t) {
588
- this._hemiLight.intensity = t * 2, this._dirLight.intensity = t * 3;
93
+ r(this, "isDIVELight", !0);
94
+ r(this, "isDIVESceneLight", !0);
95
+ r(this, "_hemiLight");
96
+ r(this, "_dirLight");
97
+ this.name = "DIVESceneLight", this._hemiLight = new $(16777215, 16777215, 2), this._hemiLight.layers.mask = g, this._hemiLight.position.set(0, 50, 0), this.add(this._hemiLight), this._dirLight = new H(16777215, 3), this._dirLight.layers.mask = g, this._dirLight.position.set(1, 1.75, 1), this._dirLight.position.multiplyScalar(30), this._dirLight.castShadow = !0, this._dirLight.shadow.mapSize.width = 2048, this._dirLight.shadow.mapSize.height = 2048;
98
+ const e = 5;
99
+ this._dirLight.shadow.camera.left = -5, this._dirLight.shadow.camera.right = e, this._dirLight.shadow.camera.top = e, this._dirLight.shadow.camera.bottom = -5, this._dirLight.shadow.camera.far = 3500, this.add(this._dirLight);
589
100
  }
590
- setEnabled(t) {
591
- this._hemiLight.visible = t, this._dirLight.visible = t;
101
+ setColor(e) {
102
+ this._hemiLight.color = e, this._dirLight.color = e;
592
103
  }
593
- }
594
- const ge = (h) => h.parent ? ge(h.parent) : h;
595
- class oi {
596
- constructor() {
597
- a(this, "isMovable", !0);
104
+ setIntensity(e) {
105
+ this._hemiLight.intensity = e * 2, this._dirLight.intensity = e * 3;
598
106
  }
599
- }
600
- class ri {
601
- constructor() {
602
- a(this, "isSelectable", !0);
107
+ setEnabled(e) {
108
+ this._hemiLight.visible = e, this._dirLight.visible = e;
603
109
  }
604
110
  }
605
- function ai(h, s) {
606
- return s.forEach((t) => {
607
- Object.getOwnPropertyNames(t.prototype).forEach((n) => {
608
- if (n === "constructor")
609
- return;
610
- const o = Object.getOwnPropertyDescriptor(
611
- t.prototype,
612
- n
613
- );
614
- Object.defineProperty(h.prototype, n, o);
615
- });
616
- const e = new t();
617
- Object.getOwnPropertyNames(e).forEach((n) => {
618
- const o = Object.getOwnPropertyDescriptor(
619
- e,
620
- n
621
- );
622
- Object.defineProperty(h.prototype, n, o);
623
- });
624
- }), h;
625
- }
626
- class _e extends ai(j, [
627
- ri,
628
- oi
629
- ]) {
111
+ const v = (n) => n.parent ? v(n.parent) : n;
112
+ class D extends p {
630
113
  constructor() {
631
114
  super();
632
- a(this, "isDIVENode", !0);
633
- a(this, "gizmo", null);
634
- a(this, "_positionWorldBuffer");
635
- a(this, "_boundingBox");
636
- this.layers.mask = S, this._positionWorldBuffer = new m(), this._boundingBox = new Ze();
637
- }
638
- setPosition(t) {
115
+ r(this, "isSelectable", !0);
116
+ r(this, "isMovable", !0);
117
+ r(this, "isDIVENode", !0);
118
+ r(this, "gizmo", null);
119
+ r(this, "_positionWorldBuffer");
120
+ r(this, "_boundingBox");
121
+ this.layers.mask = g, this._positionWorldBuffer = new m(), this._boundingBox = new V();
122
+ }
123
+ setPosition(e) {
639
124
  if (!this.parent) {
640
- this.position.set(t.x, t.y, t.z);
125
+ this.position.set(e.x, e.y, e.z);
641
126
  return;
642
127
  }
643
- const e = new m(t.x, t.y, t.z);
644
- this.position.copy(this.parent.worldToLocal(e)), "isDIVEGroup" in this.parent && this.parent.updateLineTo(this);
128
+ const t = new m(e.x, e.y, e.z);
129
+ this.position.copy(this.parent.worldToLocal(t)), "isDIVEGroup" in this.parent && this.parent.updateLineTo(this);
645
130
  }
646
- setRotation(t) {
647
- this.rotation.set(t.x, t.y, t.z);
131
+ setRotation(e) {
132
+ this.rotation.set(e.x, e.y, e.z);
648
133
  }
649
- setScale(t) {
650
- this.scale.set(t.x, t.y, t.z);
134
+ setScale(e) {
135
+ this.scale.set(e.x, e.y, e.z);
651
136
  }
652
- setVisibility(t) {
653
- this.visible = t;
137
+ setVisibility(e) {
138
+ this.visible = e;
654
139
  }
655
140
  setToWorldOrigin() {
656
- this.position.set(0, 0, 0), w("State").then((t) => {
657
- var e;
658
- (e = t.get(this.userData.id)) == null || e.performAction("UPDATE_OBJECT", {
141
+ this.position.set(0, 0, 0), d("State").then((e) => {
142
+ var t;
143
+ (t = e.get(this.userData.id)) == null || t.performAction("UPDATE_OBJECT", {
659
144
  id: this.userData.id,
660
145
  position: this.getWorldPosition(this._positionWorldBuffer),
661
146
  rotation: this.rotation,
@@ -667,9 +152,9 @@ class _e extends ai(j, [
667
152
  * Can be called when the object is moved from a foreign object (gizmo, parent, etc.) to update the object's position.
668
153
  */
669
154
  onMove() {
670
- w("State").then((t) => {
671
- var e;
672
- (e = t.get(this.userData.id)) == null || e.performAction("UPDATE_OBJECT", {
155
+ d("State").then((e) => {
156
+ var t;
157
+ (t = e.get(this.userData.id)) == null || t.performAction("UPDATE_OBJECT", {
673
158
  id: this.userData.id,
674
159
  position: this.getWorldPosition(this._positionWorldBuffer),
675
160
  rotation: this.rotation,
@@ -678,60 +163,60 @@ class _e extends ai(j, [
678
163
  });
679
164
  }
680
165
  onSelect() {
681
- w("State").then((t) => {
682
- var e;
683
- (e = t.get(this.userData.id)) == null || e.performAction("SELECT_OBJECT", {
166
+ d("State").then((e) => {
167
+ var t;
168
+ (t = e.get(this.userData.id)) == null || t.performAction("SELECT_OBJECT", {
684
169
  id: this.userData.id
685
170
  });
686
171
  });
687
172
  }
688
173
  onDeselect() {
689
- w("State").then((t) => {
690
- var e;
691
- (e = t.get(this.userData.id)) == null || e.performAction("DESELECT_OBJECT", {
174
+ d("State").then((e) => {
175
+ var t;
176
+ (t = e.get(this.userData.id)) == null || t.performAction("DESELECT_OBJECT", {
692
177
  id: this.userData.id
693
178
  });
694
179
  });
695
180
  }
696
181
  }
697
- class $e extends _e {
182
+ class k extends D {
698
183
  constructor() {
699
184
  super(...arguments);
700
- a(this, "isDIVEModel", !0);
701
- a(this, "_mesh", null);
702
- a(this, "_material", null);
703
- a(this, "_assetLoader", null);
185
+ r(this, "isDIVEModel", !0);
186
+ r(this, "_mesh", null);
187
+ r(this, "_material", null);
188
+ r(this, "_assetLoader", null);
704
189
  }
705
190
  async _getAssetLoader() {
706
- return this._assetLoader || (this._assetLoader = new (await w("AssetLoader"))()), this._assetLoader;
191
+ return this._assetLoader || (this._assetLoader = new (await d("AssetLoader"))()), this._assetLoader;
707
192
  }
708
- async setFromURL(t) {
709
- const n = await (await this._getAssetLoader()).load(t);
710
- this.setFromGLTF(n), w("State").then((o) => {
711
- var c;
712
- (c = o.get(this.userData.id)) == null || c.performAction("MODEL_LOADED", {
193
+ async setFromURL(e) {
194
+ const s = await (await this._getAssetLoader()).load(e);
195
+ this.setFromGLTF(s), d("State").then((o) => {
196
+ var a;
197
+ (a = o.get(this.userData.id)) == null || a.performAction("MODEL_LOADED", {
713
198
  id: this.userData.id
714
199
  });
715
200
  });
716
201
  }
717
- setFromGLTF(t) {
718
- this.clear(), this._boundingBox.makeEmpty(), t.traverse((e) => {
719
- e.castShadow = !0, e.receiveShadow = !0, e.layers.mask = this.layers.mask, this._boundingBox.expandByObject(e), !this._mesh && "isMesh" in e && (this._mesh = e, this._material ? this._mesh.material = this._material : this._material = e.material);
720
- }), this.add(t);
202
+ setFromGLTF(e) {
203
+ this.clear(), this._boundingBox.makeEmpty(), e.traverse((t) => {
204
+ t.castShadow = !0, t.receiveShadow = !0, t.layers.mask = this.layers.mask, this._boundingBox.expandByObject(t), !this._mesh && "isMesh" in t && (this._mesh = t, this._material ? this._mesh.material = this._material : this._material = t.material);
205
+ }), this.add(e);
721
206
  }
722
- setMaterial(t) {
723
- this._material || (this._material = new fe()), t.vertexColors !== void 0 && (this._material.vertexColors = t.vertexColors), t.color !== void 0 && this._material.color.set(t.color), t.map !== void 0 && (this._material.map = t.map), t.normalMap !== void 0 && (this._material.normalMap = t.normalMap), t.roughness !== void 0 && (this._material.roughness = t.roughness), t.roughnessMap !== void 0 && (this._material.roughnessMap = t.roughnessMap, this._material.roughnessMap && (this._material.roughness = 1)), t.metalness !== void 0 && (this._material.metalness = t.metalness), t.metalnessMap !== void 0 && (this._material.metalnessMap = t.metalnessMap, this._material.metalnessMap && (this._material.metalness = 1)), this._mesh && (this._mesh.material = this._material);
207
+ setMaterial(e) {
208
+ this._material || (this._material = new b()), e.vertexColors !== void 0 && (this._material.vertexColors = e.vertexColors), e.color !== void 0 && this._material.color.set(e.color), e.map !== void 0 && (this._material.map = e.map), e.normalMap !== void 0 && (this._material.normalMap = e.normalMap), e.roughness !== void 0 && (this._material.roughness = e.roughness), e.roughnessMap !== void 0 && (this._material.roughnessMap = e.roughnessMap, this._material.roughnessMap && (this._material.roughness = 1)), e.metalness !== void 0 && (this._material.metalness = e.metalness), e.metalnessMap !== void 0 && (this._material.metalnessMap = e.metalnessMap, this._material.metalnessMap && (this._material.metalness = 1)), this._mesh && (this._mesh.material = this._material);
724
209
  }
725
210
  placeOnFloor() {
726
- var o, c, l, p;
727
- const t = this.getWorldPosition(this._positionWorldBuffer), e = t.clone();
728
- (c = (o = this._mesh) == null ? void 0 : o.geometry) == null || c.computeBoundingBox();
729
- const n = (p = (l = this._mesh) == null ? void 0 : l.geometry) == null ? void 0 : p.boundingBox;
730
- !n || !this._mesh || (t.y = t.y - this._mesh.localToWorld(n.min.clone()).y, t.y !== e.y && w("State").then((f) => {
211
+ var o, a, h, l;
212
+ const e = this.getWorldPosition(this._positionWorldBuffer), t = e.clone();
213
+ (a = (o = this._mesh) == null ? void 0 : o.geometry) == null || a.computeBoundingBox();
214
+ const s = (l = (h = this._mesh) == null ? void 0 : h.geometry) == null ? void 0 : l.boundingBox;
215
+ !s || !this._mesh || (e.y = e.y - this._mesh.localToWorld(s.min.clone()).y, e.y !== t.y && d("State").then((u) => {
731
216
  var _;
732
- (_ = f.get(this.userData.id)) == null || _.performAction("UPDATE_OBJECT", {
217
+ (_ = u.get(this.userData.id)) == null || _.performAction("UPDATE_OBJECT", {
733
218
  id: this.userData.id,
734
- position: t,
219
+ position: e,
735
220
  rotation: this.rotation,
736
221
  scale: this.scale
737
222
  });
@@ -745,50 +230,50 @@ class $e extends _e {
745
230
  );
746
231
  return;
747
232
  }
748
- const t = this._boundingBox.min.y * this.scale.y, e = this.localToWorld(
233
+ const e = this._boundingBox.min.y * this.scale.y, t = this.localToWorld(
749
234
  this._boundingBox.getCenter(new m()).multiply(this.scale)
750
235
  );
751
- e.y = t + this.position.y;
752
- const n = new Xe(e, new m(0, -1, 0));
753
- n.layers.mask = S;
754
- const o = n.intersectObjects(
755
- ge(this).root.children,
236
+ t.y = e + this.position.y;
237
+ const s = new P(t, new m(0, -1, 0));
238
+ s.layers.mask = g;
239
+ const o = s.intersectObjects(
240
+ v(this).root.children,
756
241
  !0
757
242
  );
758
243
  if (o.length > 0) {
759
- const c = o[0].object;
760
- c.geometry.computeBoundingBox();
761
- const l = c.geometry.boundingBox, p = c.localToWorld(l.max.clone()), f = this.position.clone(), _ = this.position.clone().setY(p.y).sub(new m(0, t, 0));
762
- if (this.position.copy(_), this.position.y === f.y) return;
244
+ const a = o[0].object;
245
+ a.geometry.computeBoundingBox();
246
+ const h = a.geometry.boundingBox, l = a.localToWorld(h.max.clone()), u = this.position.clone(), _ = this.position.clone().setY(l.y).sub(new m(0, e, 0));
247
+ if (this.position.copy(_), this.position.y === u.y) return;
763
248
  this.onMove();
764
249
  }
765
250
  }
766
251
  }
767
- class hi extends _e {
252
+ class de extends D {
768
253
  constructor() {
769
254
  super();
770
- a(this, "isDIVEPrimitive", !0);
771
- a(this, "_mesh");
772
- this._mesh = new pe(), this._mesh.layers.mask = S, this._mesh.castShadow = !0, this._mesh.receiveShadow = !0, this._mesh.material = new fe(), this.add(this._mesh);
255
+ r(this, "isDIVEPrimitive", !0);
256
+ r(this, "_mesh");
257
+ this._mesh = new E(), this._mesh.layers.mask = g, this._mesh.castShadow = !0, this._mesh.receiveShadow = !0, this._mesh.material = new b(), this.add(this._mesh);
773
258
  }
774
- setGeometry(t) {
775
- const e = this.assembleGeometry(t);
776
- e && (this._mesh.geometry = e, this._boundingBox.setFromObject(this._mesh));
259
+ setGeometry(e) {
260
+ const t = this.assembleGeometry(e);
261
+ t && (this._mesh.geometry = t, this._boundingBox.setFromObject(this._mesh));
777
262
  }
778
- setMaterial(t) {
779
- const e = this._mesh.material;
780
- t.vertexColors !== void 0 && (e.vertexColors = t.vertexColors), t.color !== void 0 && (e.color = new D(t.color)), t.map !== void 0 && (e.map = t.map), t.normalMap !== void 0 && (e.normalMap = t.normalMap), t.roughness !== void 0 && (e.roughness = t.roughness), t.roughnessMap !== void 0 && (e.roughnessMap = t.roughnessMap, e.roughnessMap && (e.roughness = 1)), t.metalness !== void 0 && (e.metalness = t.metalness), t.metalnessMap !== void 0 && (e.metalnessMap = t.metalnessMap, e.metalnessMap && (e.metalness = 0)), this._mesh && (this._mesh.material = e);
263
+ setMaterial(e) {
264
+ const t = this._mesh.material;
265
+ e.vertexColors !== void 0 && (t.vertexColors = e.vertexColors), e.color !== void 0 && (t.color = new f(e.color)), e.map !== void 0 && (t.map = e.map), e.normalMap !== void 0 && (t.normalMap = e.normalMap), e.roughness !== void 0 && (t.roughness = e.roughness), e.roughnessMap !== void 0 && (t.roughnessMap = e.roughnessMap, t.roughnessMap && (t.roughness = 1)), e.metalness !== void 0 && (t.metalness = e.metalness), e.metalnessMap !== void 0 && (t.metalnessMap = e.metalnessMap, t.metalnessMap && (t.metalness = 0)), this._mesh && (this._mesh.material = t);
781
266
  }
782
267
  placeOnFloor() {
783
- var o, c, l, p;
784
- const t = this.getWorldPosition(this._positionWorldBuffer), e = t.clone();
785
- (c = (o = this._mesh) == null ? void 0 : o.geometry) == null || c.computeBoundingBox();
786
- const n = (p = (l = this._mesh) == null ? void 0 : l.geometry) == null ? void 0 : p.boundingBox;
787
- !n || !this._mesh || (t.y = t.y - this._mesh.localToWorld(n.min.clone()).y, t.y !== e.y && w("State").then((f) => {
268
+ var o, a, h, l;
269
+ const e = this.getWorldPosition(this._positionWorldBuffer), t = e.clone();
270
+ (a = (o = this._mesh) == null ? void 0 : o.geometry) == null || a.computeBoundingBox();
271
+ const s = (l = (h = this._mesh) == null ? void 0 : h.geometry) == null ? void 0 : l.boundingBox;
272
+ !s || !this._mesh || (e.y = e.y - this._mesh.localToWorld(s.min.clone()).y, e.y !== t.y && d("State").then((u) => {
788
273
  var _;
789
- (_ = f.get(this.userData.id)) == null || _.performAction("UPDATE_OBJECT", {
274
+ (_ = u.get(this.userData.id)) == null || _.performAction("UPDATE_OBJECT", {
790
275
  id: this.userData.id,
791
- position: t,
276
+ position: e,
792
277
  rotation: this.rotation,
793
278
  scale: this.scale
794
279
  });
@@ -802,82 +287,82 @@ class hi extends _e {
802
287
  );
803
288
  return;
804
289
  }
805
- const t = this._boundingBox.min.y * this.scale.y, e = this.localToWorld(
290
+ const e = this._boundingBox.min.y * this.scale.y, t = this.localToWorld(
806
291
  this._boundingBox.getCenter(new m()).multiply(this.scale)
807
292
  );
808
- e.y = t + this.position.y;
809
- const n = new Xe(e, new m(0, -1, 0));
810
- n.layers.mask = S;
811
- const o = n.intersectObjects(
812
- ge(this).root.children,
293
+ t.y = e + this.position.y;
294
+ const s = new P(t, new m(0, -1, 0));
295
+ s.layers.mask = g;
296
+ const o = s.intersectObjects(
297
+ v(this).root.children,
813
298
  !0
814
299
  );
815
300
  if (o.length > 0) {
816
- const c = o[0].object;
817
- c.geometry.computeBoundingBox();
818
- const l = c.geometry.boundingBox, p = c.localToWorld(l.max.clone()), f = this.position.clone(), _ = this.position.clone().setY(p.y).sub(new m(0, t, 0));
819
- if (this.position.copy(_), this.position.y === f.y) return;
301
+ const a = o[0].object;
302
+ a.geometry.computeBoundingBox();
303
+ const h = a.geometry.boundingBox, l = a.localToWorld(h.max.clone()), u = this.position.clone(), _ = this.position.clone().setY(l.y).sub(new m(0, e, 0));
304
+ if (this.position.copy(_), this.position.y === u.y) return;
820
305
  this.onMove();
821
306
  }
822
307
  }
823
- assembleGeometry(t) {
824
- switch (this._mesh.material.flatShading = !1, t.name.toLowerCase()) {
308
+ assembleGeometry(e) {
309
+ switch (this._mesh.material.flatShading = !1, e.name.toLowerCase()) {
825
310
  case "cylinder":
826
- return this.createCylinderGeometry(t);
311
+ return this.createCylinderGeometry(e);
827
312
  case "sphere":
828
- return this.createSphereGeometry(t);
313
+ return this.createSphereGeometry(e);
829
314
  case "pyramid":
830
- return this._mesh.material.flatShading = !0, this.createPyramidGeometry(t);
315
+ return this._mesh.material.flatShading = !0, this.createPyramidGeometry(e);
831
316
  case "cube":
832
317
  case "box":
833
- return this.createBoxGeometry(t);
318
+ return this.createBoxGeometry(e);
834
319
  case "cone":
835
- return this.createConeGeometry(t);
320
+ return this.createConeGeometry(e);
836
321
  case "wall":
837
- return this.createWallGeometry(t);
322
+ return this.createWallGeometry(e);
838
323
  case "plane":
839
- return this.createPlaneGeometry(t);
324
+ return this.createPlaneGeometry(e);
840
325
  default:
841
326
  return console.warn(
842
327
  "DIVEPrimitive.assembleGeometry: Invalid geometry type:",
843
- t.name.toLowerCase()
328
+ e.name.toLowerCase()
844
329
  ), null;
845
330
  }
846
331
  }
847
- createCylinderGeometry(t) {
848
- const e = new Bt(
849
- t.width / 2,
850
- t.width / 2,
851
- t.height,
332
+ createCylinderGeometry(e) {
333
+ const t = new Q(
334
+ e.width / 2,
335
+ e.width / 2,
336
+ e.height,
852
337
  64
853
338
  );
854
- return e.translate(0, t.height / 2, 0), e;
339
+ return t.translate(0, e.height / 2, 0), t;
855
340
  }
856
- createSphereGeometry(t) {
857
- return new Ke(t.width / 2, 256, 256);
341
+ createSphereGeometry(e) {
342
+ return new C(e.width / 2, 256, 256);
858
343
  }
859
- createPyramidGeometry(t) {
860
- const e = new Float32Array([
861
- -t.width / 2,
344
+ createPyramidGeometry(e) {
345
+ const t = new Float32Array([
346
+ -e.width / 2,
862
347
  0,
863
- -t.depth / 2,
348
+ -e.depth / 2,
864
349
  // 0
865
- t.width / 2,
350
+ e.width / 2,
866
351
  0,
867
- -t.depth / 2,
352
+ -e.depth / 2,
868
353
  // 1
869
- t.width / 2,
354
+ e.width / 2,
870
355
  0,
871
- t.depth / 2,
356
+ e.depth / 2,
872
357
  // 2
873
- -t.width / 2,
358
+ -e.width / 2,
874
359
  0,
875
- t.depth / 2,
360
+ e.depth / 2,
876
361
  // 3
877
362
  0,
878
- t.height,
363
+ e.height,
879
364
  0
880
- ]), n = new Uint16Array([
365
+ ]), s = new Uint16Array([
881
366
  0,
882
367
  1,
883
368
  2,
@@ -896,112 +381,112 @@ class hi extends _e {
896
381
  3,
897
382
  4,
898
383
  0
899
- ]), o = new qe();
384
+ ]), o = new T();
900
385
  return o.setAttribute(
901
386
  "position",
902
- new Ye(e, 3)
903
- ), o.setIndex(new Ye(n, 1)), o.computeVertexNormals(), o.computeBoundingBox(), o.computeBoundingSphere(), o;
904
- }
905
- createBoxGeometry(t) {
906
- const e = new de(
907
- t.width,
908
- t.height,
909
- t.depth
387
+ new S(t, 3)
388
+ ), o.setIndex(new S(s, 1)), o.computeVertexNormals(), o.computeBoundingBox(), o.computeBoundingSphere(), o;
389
+ }
390
+ createBoxGeometry(e) {
391
+ const t = new y(
392
+ e.width,
393
+ e.height,
394
+ e.depth
910
395
  );
911
- return e.translate(0, t.height / 2, 0), e;
396
+ return t.translate(0, e.height / 2, 0), t;
912
397
  }
913
- createConeGeometry(t) {
914
- const e = new zt(t.width / 2, t.height, 256);
915
- return e.translate(0, t.height / 2, 0), e;
398
+ createConeGeometry(e) {
399
+ const t = new K(e.width / 2, e.height, 256);
400
+ return t.translate(0, e.height / 2, 0), t;
916
401
  }
917
- createWallGeometry(t) {
918
- const e = new de(
919
- t.width,
920
- t.height,
921
- t.depth || 0.05,
402
+ createWallGeometry(e) {
403
+ const t = new y(
404
+ e.width,
405
+ e.height,
406
+ e.depth || 0.05,
922
407
  16
923
408
  );
924
- return e.translate(0, t.height / 2, 0), e;
409
+ return t.translate(0, e.height / 2, 0), t;
925
410
  }
926
- createPlaneGeometry(t) {
927
- const e = new de(
928
- t.width,
929
- t.height,
930
- t.depth
411
+ createPlaneGeometry(e) {
412
+ const t = new y(
413
+ e.width,
414
+ e.height,
415
+ e.depth
931
416
  );
932
- return e.translate(0, t.height / 2, 0), e;
417
+ return t.translate(0, e.height / 2, 0), t;
933
418
  }
934
419
  }
935
- class li extends _e {
420
+ class ce extends D {
936
421
  // lines to children
937
422
  constructor() {
938
423
  super();
939
- a(this, "isDIVEGroup", !0);
940
- a(this, "_members");
941
- a(this, "_lines");
424
+ r(this, "isDIVEGroup", !0);
425
+ r(this, "_members");
426
+ r(this, "_lines");
942
427
  this.name = "DIVEGroup", this._members = [], this._lines = [];
943
428
  }
944
429
  // children objects
945
430
  get members() {
946
431
  return this._members;
947
432
  }
948
- setPosition(t) {
949
- super.setPosition(t), this._members.forEach((e) => {
950
- "isDIVENode" in e && e.onMove();
433
+ setPosition(e) {
434
+ super.setPosition(e), this._members.forEach((t) => {
435
+ "isDIVENode" in t && t.onMove();
951
436
  });
952
437
  }
953
- setLinesVisibility(t, e) {
954
- if (!e) {
438
+ setLinesVisibility(e, t) {
439
+ if (!t) {
955
440
  this._lines.forEach((o) => {
956
- o.visible = t;
441
+ o.visible = e;
957
442
  });
958
443
  return;
959
444
  }
960
- const n = this._members.indexOf(e);
961
- n !== -1 && (this._lines[n].visible = t);
445
+ const s = this._members.indexOf(t);
446
+ s !== -1 && (this._lines[s].visible = e);
962
447
  }
963
- attach(t) {
964
- if (this._members.includes(t))
448
+ attach(e) {
449
+ if (this._members.includes(e))
965
450
  return this;
966
- const e = this.createLine();
967
- return this.add(e), this._lines.push(e), super.attach(t), this._members.push(t), this._updateLineTo(e, t), this.setLinesVisibility(!0, t), this;
451
+ const t = this.createLine();
452
+ return this.add(t), this._lines.push(t), super.attach(e), this._members.push(e), this._updateLineTo(t, e), this.setLinesVisibility(!0, e), this;
968
453
  }
969
454
  /**
970
455
  * Removes an object from the group.
971
456
  * @param object - The object to remove.
972
457
  * @returns The group instance.
973
458
  */
974
- remove(t) {
975
- const e = this._members.indexOf(t);
976
- if (e === -1)
459
+ remove(e) {
460
+ const t = this._members.indexOf(e);
461
+ if (t === -1)
977
462
  return this;
978
- const n = this._lines[e];
979
- return super.remove(n), this._lines.splice(e, 1), super.remove(t), this._members.splice(e, 1), this;
463
+ const s = this._lines[t];
464
+ return super.remove(s), this._lines.splice(t, 1), super.remove(e), this._members.splice(t, 1), this;
980
465
  }
981
- updateLineTo(t) {
982
- const e = this._members.indexOf(t);
983
- e !== -1 && this._updateLineTo(this._lines[e], t);
466
+ updateLineTo(e) {
467
+ const t = this._members.indexOf(e);
468
+ t !== -1 && this._updateLineTo(this._lines[t], e);
984
469
  }
985
470
  /**
986
471
  * Creates a line for visualization.
987
472
  */
988
473
  createLine() {
989
- const t = new qe(), e = new Nt({
474
+ const e = new T(), t = new q({
990
475
  color: 6710886,
991
476
  dashSize: 0.05,
992
477
  gapSize: 0.025
993
- }), n = new Ft(t, e);
994
- return n.visible = !1, n;
478
+ }), s = new X(e, t);
479
+ return s.visible = !1, s;
995
480
  }
996
481
  /**
997
482
  * Updates a line to the object.
998
483
  */
999
- _updateLineTo(t, e) {
1000
- const n = [
484
+ _updateLineTo(e, t) {
485
+ const s = [
1001
486
  new m(0, 0, 0),
1002
- e.position.clone()
487
+ t.position.clone()
1003
488
  ];
1004
- t.geometry.setFromPoints(n), t.computeLineDistances();
489
+ e.geometry.setFromPoints(s), e.computeLineDistances();
1005
490
  }
1006
491
  // public setBoundingBoxVisibility(visible: boolean): void {
1007
492
  // this._boxMesh.visible = visible;
@@ -1051,242 +536,243 @@ class li extends _e {
1051
536
  // this._boxMesh.visible = true;
1052
537
  // }
1053
538
  }
1054
- class ci extends pe {
539
+ class ue extends E {
1055
540
  constructor() {
1056
- super(
1057
- new Yt(1e4, 1e4),
1058
- new fe({
1059
- color: new D(150 / 255, 150 / 255, 150 / 255)
1060
- })
1061
- );
1062
- a(this, "isDIVEFloor", !0);
1063
- this.name = "Floor", this.layers.mask = S, this.receiveShadow = !0, this.rotateX(-Math.PI / 2);
541
+ const e = new Z(1, 1);
542
+ e.scale(1e3, 1e3, 1), e.rotateX(-Math.PI / 2);
543
+ const t = new b({
544
+ color: new f(16777215),
545
+ side: M
546
+ });
547
+ super(e, t);
548
+ r(this, "isDIVEFloor", !0);
549
+ this.name = "Floor", this.layers.mask = g, this.receiveShadow = !0;
1064
550
  }
1065
- setVisibility(t) {
1066
- this.visible = t;
551
+ setVisibility(e) {
552
+ this.visible = e;
1067
553
  }
1068
- setColor(t) {
1069
- this.material.color = new D(t);
554
+ setColor(e) {
555
+ this.material.color = new f(e);
1070
556
  }
1071
557
  }
1072
- class di extends j {
558
+ class _e extends p {
1073
559
  constructor() {
1074
560
  super();
1075
- a(this, "isDIVERoot", !0);
1076
- a(this, "_floor");
1077
- a(this, "_assetLoader", null);
1078
- this.name = "Root", this._floor = new ci(), this.add(this._floor);
561
+ r(this, "isDIVERoot", !0);
562
+ r(this, "_floor");
563
+ r(this, "_assetLoader", null);
564
+ this.name = "Root", this._floor = new ue(), this.add(this._floor);
1079
565
  }
1080
566
  get floor() {
1081
567
  return this._floor;
1082
568
  }
1083
569
  async _getAssetLoader() {
1084
- return this._assetLoader || (this._assetLoader = new (await w("AssetLoader"))()), this._assetLoader;
570
+ return this._assetLoader || (this._assetLoader = new (await d("AssetLoader"))()), this._assetLoader;
1085
571
  }
1086
572
  computeSceneBB() {
1087
- const t = new Ze();
1088
- return this.children.forEach((e) => {
1089
- "isDIVEFloor" in e || e.traverse((n) => {
1090
- "isObject3D" in n && t.expandByObject(n);
573
+ const e = new V();
574
+ return this.children.forEach((t) => {
575
+ "isDIVEFloor" in t || t.traverse((s) => {
576
+ "isObject3D" in s && e.expandByObject(s);
1091
577
  });
1092
- }), t;
1093
- }
1094
- getSceneObject(t) {
1095
- let e;
1096
- return this.traverse((n) => {
1097
- e || n.userData.id === t.id && (e = n);
1098
578
  }), e;
1099
579
  }
1100
- addSceneObject(t) {
1101
- let e = this.getSceneObject(t);
1102
- if (e)
580
+ getSceneObject(e) {
581
+ let t;
582
+ return this.traverse((s) => {
583
+ t || s.userData.id === e.id && (t = s);
584
+ }), t;
585
+ }
586
+ addSceneObject(e) {
587
+ let t = this.getSceneObject(e);
588
+ if (t)
1103
589
  return console.warn(
1104
- `DIVERoot.addSceneObject: Scene object with id ${t.id} already exists`
1105
- ), e;
1106
- switch (t.entityType) {
590
+ `DIVERoot.addSceneObject: Scene object with id ${e.id} already exists`
591
+ ), t;
592
+ switch (e.entityType) {
1107
593
  case "pov":
1108
594
  break;
1109
595
  case "light": {
1110
- switch (t.type) {
596
+ switch (e.type) {
1111
597
  case "scene": {
1112
- e = new Je();
598
+ t = new B();
1113
599
  break;
1114
600
  }
1115
601
  case "ambient": {
1116
- e = new si();
602
+ t = new he();
1117
603
  break;
1118
604
  }
1119
605
  case "point": {
1120
- e = new ni();
606
+ t = new le();
1121
607
  break;
1122
608
  }
1123
609
  default:
1124
610
  throw new Error(
1125
- `DIVERoot.addSceneObject: Unknown light type: ${t.type}`
611
+ `DIVERoot.addSceneObject: Unknown light type: ${e.type}`
1126
612
  );
1127
613
  }
1128
- e.name = t.name, e.userData.id = t.id, this.add(e), this._updateLight(e, t);
614
+ t.name = e.name, t.userData.id = e.id, this.add(t), this._updateLight(t, e);
1129
615
  break;
1130
616
  }
1131
617
  case "model": {
1132
- e = new $e(), e.name = t.name, e.userData.id = t.id, e.userData.uri = t.uri, this.add(e), this._updateModel(e, t);
618
+ t = new k(), t.name = e.name, t.userData.id = e.id, t.userData.uri = e.uri, this.add(t), this._updateModel(t, e);
1133
619
  break;
1134
620
  }
1135
621
  case "primitive": {
1136
- e = new hi(), e.name = t.name, e.userData.id = t.id, this.add(e), this._updatePrimitive(e, t);
622
+ t = new de(), t.name = e.name, t.userData.id = e.id, this.add(t), this._updatePrimitive(t, e);
1137
623
  break;
1138
624
  }
1139
625
  case "group": {
1140
- e = new li(), e.name = t.name, e.userData.id = t.id, this.add(e), this._updateGroup(e, t);
626
+ t = new ce(), t.name = e.name, t.userData.id = e.id, this.add(t), this._updateGroup(t, e);
1141
627
  break;
1142
628
  }
1143
629
  default:
1144
630
  throw new Error(
1145
- `DIVERoot.addSceneObject: Unknown entity type: ${t.entityType}`
631
+ `DIVERoot.addSceneObject: Unknown entity type: ${e.entityType}`
1146
632
  );
1147
633
  }
1148
- return e;
634
+ return t;
1149
635
  }
1150
- updateSceneObject(t) {
1151
- const e = this.getSceneObject(t);
1152
- if (!e) {
636
+ updateSceneObject(e) {
637
+ const t = this.getSceneObject(e);
638
+ if (!t) {
1153
639
  console.warn(
1154
- `DIVERoot.updateSceneObject: Scene object with id ${t.id} does not exist`
640
+ `DIVERoot.updateSceneObject: Scene object with id ${e.id} does not exist`
1155
641
  );
1156
642
  return;
1157
643
  }
1158
- switch (t.entityType) {
644
+ switch (e.entityType) {
1159
645
  case "pov":
1160
646
  break;
1161
647
  case "light": {
1162
- this._updateLight(e, t);
648
+ this._updateLight(t, e);
1163
649
  break;
1164
650
  }
1165
651
  case "model": {
1166
- this._updateModel(e, t);
652
+ this._updateModel(t, e);
1167
653
  break;
1168
654
  }
1169
655
  case "primitive": {
1170
- this._updatePrimitive(e, t);
656
+ this._updatePrimitive(t, e);
1171
657
  break;
1172
658
  }
1173
659
  case "group": {
1174
- this._updateGroup(e, t);
660
+ this._updateGroup(t, e);
1175
661
  break;
1176
662
  }
1177
663
  default:
1178
664
  throw new Error(
1179
- `DIVERoot.updateSceneObject: Unknown entity type: ${t.entityType}`
665
+ `DIVERoot.updateSceneObject: Unknown entity type: ${e.entityType}`
1180
666
  );
1181
667
  }
1182
668
  }
1183
- deleteSceneObject(t) {
1184
- const e = this.getSceneObject(t);
1185
- if (!e) {
669
+ deleteSceneObject(e) {
670
+ const t = this.getSceneObject(e);
671
+ if (!t) {
1186
672
  console.warn(
1187
- `DIVERoot.deleteSceneObject: Object with id ${t.id} not found`
673
+ `DIVERoot.deleteSceneObject: Object with id ${e.id} not found`
1188
674
  );
1189
675
  return;
1190
676
  }
1191
- switch (t.entityType) {
677
+ switch (e.entityType) {
1192
678
  case "pov":
1193
679
  break;
1194
680
  case "light": {
1195
- this._deleteLight(e);
681
+ this._deleteLight(t);
1196
682
  break;
1197
683
  }
1198
684
  case "model": {
1199
- this._deleteModel(e);
685
+ this._deleteModel(t);
1200
686
  break;
1201
687
  }
1202
688
  case "primitive": {
1203
- this._deletePrimitive(e);
689
+ this._deletePrimitive(t);
1204
690
  break;
1205
691
  }
1206
692
  case "group": {
1207
- this._deleteGroup(e);
693
+ this._deleteGroup(t);
1208
694
  break;
1209
695
  }
1210
696
  default:
1211
697
  throw new Error(
1212
- `DIVERoot.deleteSceneObject: Unknown entity type: ${t.entityType}`
698
+ `DIVERoot.deleteSceneObject: Unknown entity type: ${e.entityType}`
1213
699
  );
1214
700
  }
1215
701
  }
1216
- _updateLight(t, e) {
1217
- e.name !== void 0 && e.name !== null && (t.name = e.name), e.position !== void 0 && e.position !== null && t.position.set(
1218
- e.position.x,
1219
- e.position.y,
1220
- e.position.z
1221
- ), e.intensity !== void 0 && e.intensity !== null && t.setIntensity(e.intensity), e.enabled !== void 0 && e.enabled !== null && t.setEnabled(e.enabled), e.color !== void 0 && e.color !== null && t.setColor(new D(e.color)), e.visible !== void 0 && e.visible !== null && (t.visible = e.visible), e.parentId !== void 0 && this._setParent({ ...e, parentId: e.parentId });
702
+ _updateLight(e, t) {
703
+ t.name !== void 0 && t.name !== null && (e.name = t.name), t.position !== void 0 && t.position !== null && e.position.set(
704
+ t.position.x,
705
+ t.position.y,
706
+ t.position.z
707
+ ), t.intensity !== void 0 && t.intensity !== null && e.setIntensity(t.intensity), t.enabled !== void 0 && t.enabled !== null && e.setEnabled(t.enabled), t.color !== void 0 && t.color !== null && e.setColor(new f(t.color)), t.visible !== void 0 && t.visible !== null && (e.visible = t.visible), t.parentId !== void 0 && this._setParent({ ...t, parentId: t.parentId });
1222
708
  }
1223
- _updateModel(t, e) {
1224
- e.uri !== void 0 && t.setFromURL(e.uri), e.name !== void 0 && (t.name = e.name), e.position !== void 0 && t.setPosition(e.position), e.rotation !== void 0 && t.setRotation(e.rotation), e.scale !== void 0 && t.setScale(e.scale), e.visible !== void 0 && t.setVisibility(e.visible), e.material !== void 0 && t.setMaterial(e.material), e.parentId !== void 0 && this._setParent({ ...e, parentId: e.parentId });
709
+ _updateModel(e, t) {
710
+ t.uri !== void 0 && e.setFromURL(t.uri), t.name !== void 0 && (e.name = t.name), t.position !== void 0 && e.setPosition(t.position), t.rotation !== void 0 && e.setRotation(t.rotation), t.scale !== void 0 && e.setScale(t.scale), t.visible !== void 0 && e.setVisibility(t.visible), t.material !== void 0 && e.setMaterial(t.material), t.parentId !== void 0 && this._setParent({ ...t, parentId: t.parentId });
1225
711
  }
1226
- _updatePrimitive(t, e) {
1227
- e.name !== void 0 && (t.name = e.name), e.geometry !== void 0 && t.setGeometry(e.geometry), e.position !== void 0 && t.setPosition(e.position), e.rotation !== void 0 && t.setRotation(e.rotation), e.scale !== void 0 && t.setScale(e.scale), e.visible !== void 0 && t.setVisibility(e.visible), e.material !== void 0 && t.setMaterial(e.material), e.parentId !== void 0 && this._setParent({ ...e, parentId: e.parentId });
712
+ _updatePrimitive(e, t) {
713
+ t.name !== void 0 && (e.name = t.name), t.geometry !== void 0 && e.setGeometry(t.geometry), t.position !== void 0 && e.setPosition(t.position), t.rotation !== void 0 && e.setRotation(t.rotation), t.scale !== void 0 && e.setScale(t.scale), t.visible !== void 0 && e.setVisibility(t.visible), t.material !== void 0 && e.setMaterial(t.material), t.parentId !== void 0 && this._setParent({ ...t, parentId: t.parentId });
1228
714
  }
1229
- _updateGroup(t, e) {
1230
- e.name !== void 0 && (t.name = e.name), e.position !== void 0 && t.setPosition(e.position), e.rotation !== void 0 && t.setRotation(e.rotation), e.scale !== void 0 && t.setScale(e.scale), e.visible !== void 0 && t.setVisibility(e.visible), e.bbVisible !== void 0 && t.setLinesVisibility(e.bbVisible), e.parentId !== void 0 && this._setParent({ ...e, parentId: e.parentId });
715
+ _updateGroup(e, t) {
716
+ t.name !== void 0 && (e.name = t.name), t.position !== void 0 && e.setPosition(t.position), t.rotation !== void 0 && e.setRotation(t.rotation), t.scale !== void 0 && e.setScale(t.scale), t.visible !== void 0 && e.setVisibility(t.visible), t.bbVisible !== void 0 && e.setLinesVisibility(t.bbVisible), t.parentId !== void 0 && this._setParent({ ...t, parentId: t.parentId });
1231
717
  }
1232
- _deleteLight(t) {
1233
- this._detachTransformControls(t), t.parent.remove(t);
718
+ _deleteLight(e) {
719
+ this._detachTransformControls(e), e.parent.remove(e);
1234
720
  }
1235
- _deleteModel(t) {
1236
- this._detachTransformControls(t), t.parent.remove(t);
721
+ _deleteModel(e) {
722
+ this._detachTransformControls(e), e.parent.remove(e);
1237
723
  }
1238
- _deletePrimitive(t) {
1239
- this._detachTransformControls(t), t.parent.remove(t);
724
+ _deletePrimitive(e) {
725
+ this._detachTransformControls(e), e.parent.remove(e);
1240
726
  }
1241
- _deleteGroup(t) {
1242
- this._detachTransformControls(t);
1243
- for (let e = t.members.length - 1; e >= 0; e--)
1244
- this.attach(t.members[e]);
1245
- t.parent.remove(t);
727
+ _deleteGroup(e) {
728
+ this._detachTransformControls(e);
729
+ for (let t = e.members.length - 1; t >= 0; t--)
730
+ this.attach(e.members[t]);
731
+ e.parent.remove(e);
1246
732
  }
1247
- _setParent(t) {
1248
- const e = this.getSceneObject(t);
1249
- if (t.parentId !== null) {
1250
- const n = this.getSceneObject({
1251
- id: t.parentId,
1252
- entityType: t.entityType
733
+ _setParent(e) {
734
+ const t = this.getSceneObject(e);
735
+ if (e.parentId !== null) {
736
+ const s = this.getSceneObject({
737
+ id: e.parentId,
738
+ entityType: e.entityType
1253
739
  });
1254
- if (!n) return;
1255
- n.attach(e);
740
+ if (!s) return;
741
+ s.attach(t);
1256
742
  } else
1257
- this.attach(e);
743
+ this.attach(t);
1258
744
  }
1259
- _detachTransformControls(t) {
1260
- this._findScene(t).children.find((e) => {
1261
- "isTransformControls" in e && e.detach();
745
+ _detachTransformControls(e) {
746
+ this._findScene(e).children.find((t) => {
747
+ "isTransformControls" in t && t.detach();
1262
748
  });
1263
749
  }
1264
- _findScene(t) {
1265
- return t.parent !== null ? this._findScene(t.parent) : t;
750
+ _findScene(e) {
751
+ return e.parent !== null ? this._findScene(e.parent) : e;
1266
752
  }
1267
753
  }
1268
- const ui = "#888888", mi = "#dddddd";
1269
- class pi extends j {
754
+ const me = "#888888", ge = "#dddddd";
755
+ class fe extends p {
1270
756
  constructor() {
1271
757
  super(), this.name = "Grid";
1272
- const s = new Gt(
758
+ const i = new j(
1273
759
  100,
1274
760
  100,
1275
- ui,
1276
- mi
761
+ me,
762
+ ge
1277
763
  );
1278
- s.material.depthTest = !1, s.layers.mask = Ht, this.add(s);
764
+ i.material.depthTest = !1, i.layers.mask = re, this.add(i);
1279
765
  }
1280
- setVisibility(s) {
1281
- this.visible = s;
766
+ setVisibility(i) {
767
+ this.visible = i;
1282
768
  }
1283
769
  }
1284
- class fi extends Ut {
770
+ class pe extends ee {
1285
771
  constructor() {
1286
772
  super();
1287
- a(this, "_root");
1288
- a(this, "_grid");
1289
- this.background = new D(16777215), this._root = new di(), this.add(this._root), this._grid = new pi(), this.add(this._grid);
773
+ r(this, "_root");
774
+ r(this, "_grid");
775
+ this.background = new f(16777215), this._root = new _e(), this.add(this._root), this._grid = new fe(), this.add(this._grid);
1290
776
  }
1291
777
  get root() {
1292
778
  return this._root;
@@ -1294,14 +780,14 @@ class fi extends Ut {
1294
780
  get grid() {
1295
781
  return this._grid;
1296
782
  }
1297
- setBackground(t) {
1298
- this.background = new D(t);
783
+ setBackground(e) {
784
+ this.background = new f(e);
1299
785
  }
1300
786
  computeSceneBB() {
1301
787
  return this.root.computeSceneBB();
1302
788
  }
1303
789
  }
1304
- const Qe = {
790
+ const R = {
1305
791
  canvas: void 0,
1306
792
  antialias: !0,
1307
793
  alpha: !0,
@@ -1309,48 +795,41 @@ const Qe = {
1309
795
  precision: "highp",
1310
796
  stencil: !1,
1311
797
  depth: !0,
1312
- logarithmicDepthBuffer: !1
798
+ logarithmicDepthBuffer: !1,
799
+ shadows: !0,
800
+ shadowQuality: "high"
1313
801
  };
1314
- class gi {
1315
- constructor(s, t, e) {
1316
- a(this, "_webglrenderer");
1317
- a(this, "_settings");
1318
- this._scene = s, this._camera = t, this._settings = {
1319
- ...Qe,
1320
- ...e ?? {}
1321
- }, this._webglrenderer = new Ge({
1322
- canvas: this._settings.canvas,
1323
- antialias: this._settings.antialias,
1324
- alpha: this._settings.alpha,
1325
- powerPreference: this._settings.powerPreference,
1326
- precision: this._settings.precision,
1327
- stencil: this._settings.stencil,
1328
- depth: this._settings.depth,
1329
- logarithmicDepthBuffer: this._settings.logarithmicDepthBuffer
1330
- });
802
+ class we {
803
+ constructor(i, e, t) {
804
+ r(this, "_webglrenderer");
805
+ r(this, "_settings");
806
+ this._scene = i, this._camera = e, this._settings = {
807
+ ...R,
808
+ ...t ?? {}
809
+ }, this._webglrenderer = new L(this._settings), this._webglrenderer.shadowMap.enabled = this._settings.shadows, this._webglrenderer.shadowMap.type = this._settings.shadowQuality === "high" ? te : this._settings.shadowQuality === "medium" ? ie : se;
1331
810
  }
1332
811
  get webglrenderer() {
1333
812
  return this._webglrenderer;
1334
813
  }
1335
- setCanvas(s) {
1336
- this._webglrenderer.dispose(), this._settings.canvas = s, this._webglrenderer = new Ge(this._settings);
814
+ setCanvas(i) {
815
+ this._webglrenderer.dispose(), this._settings.canvas = i, this._webglrenderer = new L(this._settings);
1337
816
  }
1338
817
  render() {
1339
818
  this._webglrenderer.render(this._scene, this._camera);
1340
819
  }
1341
- onResize(s, t) {
1342
- this._webglrenderer.setSize(s, t, !1);
820
+ onResize(i, e) {
821
+ this._webglrenderer.setSize(i, e, !1);
1343
822
  }
1344
823
  dispose() {
1345
824
  this._webglrenderer.dispose();
1346
825
  }
1347
826
  }
1348
- class _i {
827
+ class ye {
1349
828
  constructor() {
1350
- a(this, "_renderer", null);
1351
- a(this, "_lastTime", 0);
1352
- a(this, "_isRunning", !1);
1353
- a(this, "_tickers", []);
829
+ r(this, "_renderer", null);
830
+ r(this, "_lastTime", 0);
831
+ r(this, "_isRunning", !1);
832
+ r(this, "_tickers", []);
1354
833
  }
1355
834
  start() {
1356
835
  this._isRunning || (this._isRunning = !0, this._lastTime = performance.now(), requestAnimationFrame(this._tick.bind(this)));
@@ -1358,82 +837,82 @@ class _i {
1358
837
  stop() {
1359
838
  this._isRunning = !1;
1360
839
  }
1361
- setRenderer(s) {
1362
- this._renderer = s;
840
+ setRenderer(i) {
841
+ this._renderer = i;
1363
842
  }
1364
- addTicker(s) {
1365
- this._tickers.find((t) => t.uuid === s.uuid) || this._tickers.push(s);
843
+ addTicker(i) {
844
+ this._tickers.find((e) => e.uuid === i.uuid) || this._tickers.push(i);
1366
845
  }
1367
- removeTicker(s) {
1368
- const t = this._tickers.findIndex((e) => e.uuid === s.uuid);
1369
- t !== -1 && this._tickers.splice(t, 1);
846
+ removeTicker(i) {
847
+ const e = this._tickers.findIndex((t) => t.uuid === i.uuid);
848
+ e !== -1 && this._tickers.splice(e, 1);
1370
849
  }
1371
850
  dispose() {
1372
- this.stop(), this._tickers.forEach((s) => {
1373
- var t;
1374
- return (t = s.dispose) == null ? void 0 : t.call(s);
851
+ this.stop(), this._tickers.forEach((i) => {
852
+ var e;
853
+ return (e = i.dispose) == null ? void 0 : e.call(i);
1375
854
  }), this._tickers = [], this._isRunning = !1, this._lastTime = 0;
1376
855
  }
1377
- _tick(s) {
1378
- var e;
856
+ _tick(i) {
857
+ var t;
1379
858
  if (!this._isRunning) return;
1380
- const t = (s - this._lastTime) / 1e3;
1381
- this._lastTime = s, this._tickers.forEach((n) => n.tick(t)), (e = this._renderer) == null || e.render(), requestAnimationFrame(this._tick.bind(this));
859
+ const e = (i - this._lastTime) / 1e3;
860
+ this._lastTime = i, this._tickers.forEach((s) => s.tick(e)), (t = this._renderer) == null || t.render(), requestAnimationFrame(this._tick.bind(this));
1382
861
  }
1383
862
  }
1384
- class yi {
1385
- constructor(s, t) {
1386
- a(this, "_resizeObserver");
1387
- a(this, "_width", 0);
1388
- a(this, "_height", 0);
1389
- this._resizeObserver = new ResizeObserver((e) => {
1390
- for (const n of e) {
1391
- const { width: o, height: c } = n.contentRect;
1392
- o === this._width && c === this._height || (s.onResize(o, c), t.onResize(o, c), this._width = o, this._height = c);
863
+ class Ee {
864
+ constructor(i, e) {
865
+ r(this, "_resizeObserver");
866
+ r(this, "_width", 0);
867
+ r(this, "_height", 0);
868
+ this._resizeObserver = new ResizeObserver((t) => {
869
+ for (const s of t) {
870
+ const { width: o, height: a } = s.contentRect;
871
+ o === this._width && a === this._height || (i.onResize(o, a), e.onResize(o, a), this._width = o, this._height = a);
1393
872
  }
1394
- }), this._observeCanvas(s.webglrenderer.domElement);
873
+ }), this._observeCanvas(i.webglrenderer.domElement);
1395
874
  }
1396
- setCanvas(s) {
1397
- this._resizeObserver.disconnect(), this._observeCanvas(s);
875
+ setCanvas(i) {
876
+ this._resizeObserver.disconnect(), this._observeCanvas(i);
1398
877
  }
1399
878
  dispose() {
1400
879
  this._resizeObserver.disconnect();
1401
880
  }
1402
- _observeCanvas(s) {
1403
- if (s.parentElement)
1404
- this._resizeObserver.observe(s.parentElement);
881
+ _observeCanvas(i) {
882
+ if (i.parentElement)
883
+ this._resizeObserver.observe(i.parentElement);
1405
884
  else {
1406
- const t = setInterval(() => {
1407
- s.parentElement && (this._resizeObserver.observe(s.parentElement), clearInterval(t));
885
+ const e = setInterval(() => {
886
+ i.parentElement && (this._resizeObserver.observe(i.parentElement), clearInterval(e));
1408
887
  }, 16);
1409
888
  }
1410
889
  }
1411
890
  }
1412
- const et = {
891
+ const O = {
1413
892
  autoStart: !0,
1414
893
  displayAxes: !1,
1415
- ...$t,
1416
- ...Qe
894
+ ...oe,
895
+ ...R
1417
896
  };
1418
- class bi {
1419
- constructor(s) {
1420
- a(this, "_renderer");
1421
- a(this, "_scene");
1422
- a(this, "_camera");
1423
- a(this, "_resizeManager");
1424
- a(this, "_clock");
1425
- a(this, "_settings");
897
+ class be {
898
+ constructor(i) {
899
+ r(this, "_renderer");
900
+ r(this, "_scene");
901
+ r(this, "_camera");
902
+ r(this, "_resizeManager");
903
+ r(this, "_clock");
904
+ r(this, "_settings");
1426
905
  this._settings = {
1427
- ...et,
1428
- ...s ?? {}
1429
- }, this._scene = new fi(), this._camera = new Qt(this._settings), this._renderer = new gi(
906
+ ...O,
907
+ ...i ?? {}
908
+ }, this._scene = new pe(), this._camera = new ae(this._settings), this._renderer = new we(
1430
909
  this._scene,
1431
910
  this._camera,
1432
911
  this._settings
1433
- ), this._resizeManager = new yi(
912
+ ), this._resizeManager = new Ee(
1434
913
  this._renderer,
1435
914
  this._camera
1436
- ), this._clock = new _i(), this._clock.setRenderer(this._renderer), this._settings.autoStart && this.start();
915
+ ), this._clock = new ye(), this._clock.setRenderer(this._renderer), this._settings.autoStart && this.start();
1437
916
  }
1438
917
  get scene() {
1439
918
  return this._scene;
@@ -1444,8 +923,8 @@ class bi {
1444
923
  get renderer() {
1445
924
  return this._renderer;
1446
925
  }
1447
- setCanvas(s) {
1448
- this._renderer.setCanvas(s), this._resizeManager.setCanvas(s);
926
+ setCanvas(i) {
927
+ this._renderer.setCanvas(i), this._resizeManager.setCanvas(i);
1449
928
  }
1450
929
  get clock() {
1451
930
  return this._clock;
@@ -1460,52 +939,52 @@ class bi {
1460
939
  this._clock.dispose(), this._resizeManager.dispose(), this._renderer.dispose();
1461
940
  }
1462
941
  }
1463
- function x(h, s) {
1464
- const t = (h + "e").split("e");
1465
- return +(t[0] + "e" + (+t[1] + (s || 0)));
942
+ function c(n, i) {
943
+ const e = (n + "e").split("e");
944
+ return +(e[0] + "e" + (+e[1] + (i || 0)));
1466
945
  }
1467
- function wi(h, s = 0) {
1468
- const t = x(h, +s);
1469
- return x(Math.ceil(t), -s);
946
+ function ve(n, i = 0) {
947
+ const e = c(n, +i);
948
+ return c(Math.ceil(e), -i);
1470
949
  }
1471
- function Ei(h, s = 0) {
1472
- const t = x(h, +s);
1473
- return x(Math.floor(t), -s);
950
+ function De(n, i = 0) {
951
+ const e = c(n, +i);
952
+ return c(Math.floor(e), -i);
1474
953
  }
1475
- function tt(h, s = 0) {
1476
- if (h < 0) return -tt(-h, s);
1477
- const t = x(h, +s);
1478
- return x(Math.round(t), -s);
954
+ function A(n, i = 0) {
955
+ if (n < 0) return -A(-n, i);
956
+ const e = c(n, +i);
957
+ return c(Math.round(e), -i);
1479
958
  }
1480
- function Di(h, s, t) {
959
+ function Ie(n, i, e) {
1481
960
  return Math.atan2(
1482
- h.clone().cross(s).dot(t),
1483
- s.clone().dot(h)
961
+ n.clone().cross(i).dot(e),
962
+ i.clone().dot(n)
1484
963
  );
1485
964
  }
1486
- function xi(h, s = 0) {
1487
- const t = x(h, +s);
1488
- return x(Math.round(t), -s).toFixed(s);
965
+ function Se(n, i = 0) {
966
+ const e = c(n, +i);
967
+ return c(Math.round(e), -i).toFixed(i);
1489
968
  }
1490
- function Ti(h, s = 0) {
1491
- const t = x(h, +s);
1492
- return x(Math.trunc(t), -s);
969
+ function Le(n, i = 0) {
970
+ const e = c(n, +i);
971
+ return c(Math.trunc(e), -i);
1493
972
  }
1494
- function Li(h) {
1495
- return (C.radToDeg(h) + 360) % 360;
973
+ function xe(n) {
974
+ return (w.radToDeg(n) + 360) % 360;
1496
975
  }
1497
- function Pi(h) {
1498
- return C.degToRad(h);
976
+ function Ce(n) {
977
+ return w.degToRad(n);
1499
978
  }
1500
- const Bi = {
1501
- ceilExp: wi,
1502
- floorExp: Ei,
1503
- roundExp: tt,
1504
- toFixedExp: xi,
1505
- truncateExp: Ti,
1506
- signedAngleTo: Di,
1507
- radToDeg: Li,
1508
- degToRad: Pi
979
+ const Ae = {
980
+ ceilExp: ve,
981
+ floorExp: De,
982
+ roundExp: A,
983
+ toFixedExp: Se,
984
+ truncateExp: Le,
985
+ signedAngleTo: Ie,
986
+ radToDeg: xe,
987
+ degToRad: Ce
1509
988
  };
1510
989
  window.DIVE = {
1511
990
  instances: [],
@@ -1513,31 +992,32 @@ window.DIVE = {
1513
992
  return window.DIVE.instances[0];
1514
993
  }
1515
994
  };
1516
- const Si = {
1517
- ...et,
1518
- ...se
995
+ const Me = {
996
+ ...O,
997
+ ...U
1519
998
  };
1520
- class it {
1521
- constructor(s) {
999
+ class G {
1000
+ constructor(i) {
1522
1001
  // descriptive members
1523
- a(this, "_settings");
1524
- a(this, "_engine");
1525
- a(this, "orbitController");
1526
- a(this, "axisCamera");
1002
+ r(this, "_instanceId", w.generateUUID());
1003
+ r(this, "_settings");
1004
+ r(this, "_engine");
1005
+ r(this, "orbitController");
1006
+ r(this, "axisCamera");
1527
1007
  this._settings = {
1528
- ...Si,
1529
- ...s ?? {}
1530
- }, this._engine = new bi(s), this.orbitController = new ne(
1008
+ ...Me,
1009
+ ...i ?? {}
1010
+ }, this._engine = new be(i), this.orbitController = new I(
1531
1011
  this._engine.camera,
1532
1012
  this._engine.renderer.webglrenderer.domElement,
1533
1013
  this._settings
1534
- ), this._engine.clock.addTicker(this.orbitController), this._settings.displayAxes ? (this.axisCamera = new ii(
1014
+ ), this._engine.clock.addTicker(this.orbitController), this._settings.displayAxes ? (this.axisCamera = new W(
1535
1015
  this._engine.renderer,
1536
1016
  this._engine.scene,
1537
1017
  this._engine.camera
1538
- ), this._engine.clock.addTicker(this.axisCamera)) : this.axisCamera = null, import("./chunks/package-GVEz369Q.mjs").then((t) => {
1018
+ ), this._engine.clock.addTicker(this.axisCamera)) : this.axisCamera = null, import("./chunks/package-CIkS9WF6.mjs").then((e) => {
1539
1019
  console.log(
1540
- `DIVE ${t.default.version} initialized successfully!`
1020
+ `DIVE ${e.default.version} initialized successfully!`
1541
1021
  ), console.log(`
1542
1022
  @@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
1543
1023
  @@@@+-:::::::---------------------==------------------------------=#@@@@
@@ -1571,15 +1051,15 @@ class it {
1571
1051
  }), window.DIVE.instances.push(this);
1572
1052
  }
1573
1053
  // static members
1574
- static async QuickView(s, t) {
1575
- const e = new it(t);
1576
- e.engine.scene.background = new D(16777215), e.engine.scene.grid.setVisibility(!1), e.engine.scene.root.floor.setVisibility(!1), e.engine.scene.root.floor.setColor(16777215), e.engine.camera.position.set(0, 2, 2), e.orbitController.target.set(0, 0.5, 0);
1577
- const n = new Je();
1578
- n.name = "SceneLight", n.userData.id = C.generateUUID(), n.setEnabled(!0), n.visible = !0, n.setIntensity((t == null ? void 0 : t.lightIntensity) ?? 1), n.setColor(new D(16777215)), e.engine.scene.root.add(n);
1579
- const o = new $e();
1580
- o.name = "object", o.userData.id = C.generateUUID(), o.userData.uri = s, o.visible = !0, e.engine.scene.root.add(o), await o.setFromURL(s);
1581
- const c = e.engine.scene.computeSceneBB(), l = e.orbitController.computeEncompassingView(c);
1582
- return e.engine.camera.position.copy(l.position), e.orbitController.target.copy(l.target), e;
1054
+ static async QuickView(i, e) {
1055
+ const t = new G(e);
1056
+ t.engine.scene.background = new f(16777215), t.engine.scene.grid.setVisibility(!1), t.engine.scene.root.floor.setVisibility(!0), t.engine.camera.position.set(0, 2, 2), t.orbitController.target.set(0, 0.5, 0);
1057
+ const s = new B();
1058
+ s.name = "SceneLight", s.userData.id = w.generateUUID(), s.setEnabled(!0), s.visible = !0, s.setIntensity((e == null ? void 0 : e.lightIntensity) ?? 1), s.setColor(new f(16777215)), t.engine.scene.root.add(s);
1059
+ const o = new k();
1060
+ o.name = "object", o.userData.id = w.generateUUID(), o.userData.uri = i, o.visible = !0, t.engine.scene.root.add(o), await o.setFromURL(i);
1061
+ const a = t.engine.scene.computeSceneBB(), h = t.orbitController.computeEncompassingView(a);
1062
+ return t.engine.camera.position.copy(h.position), t.orbitController.target.copy(h.target), t;
1583
1063
  }
1584
1064
  get engine() {
1585
1065
  return this._engine;
@@ -1587,92 +1067,135 @@ class it {
1587
1067
  get canvas() {
1588
1068
  return this._engine.renderer.webglrenderer.domElement;
1589
1069
  }
1590
- setCanvas(s) {
1591
- this._engine.setCanvas(s), this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.orbitController = new ne(
1070
+ setCanvas(i) {
1071
+ this._engine.setCanvas(i), this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.orbitController = new I(
1592
1072
  this._engine.camera,
1593
- s,
1073
+ i,
1594
1074
  this._settings
1595
1075
  ), this._engine.clock.addTicker(this.orbitController);
1596
1076
  }
1597
1077
  async dispose() {
1598
- return new Promise((s) => {
1599
- this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.axisCamera && (this._engine.clock.removeTicker(this.axisCamera), this.axisCamera.dispose()), s();
1078
+ return new Promise((i) => {
1079
+ this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.axisCamera && (this._engine.clock.removeTicker(this.axisCamera), this.axisCamera.dispose()), window.DIVE.instances = window.DIVE.instances.filter(
1080
+ (e) => e._instanceId !== this._instanceId
1081
+ ), i();
1600
1082
  });
1601
1083
  }
1602
1084
  }
1603
- const We = (h, s) => {
1604
- if (Object.keys(h).length === 0 && Object.keys(s).length === 0)
1085
+ class Ge {
1086
+ constructor() {
1087
+ r(this, "isMovable", !0);
1088
+ }
1089
+ }
1090
+ class ze {
1091
+ constructor() {
1092
+ r(this, "isSelectable", !0);
1093
+ }
1094
+ }
1095
+ const x = (n, i) => {
1096
+ if (Object.keys(n).length === 0 && Object.keys(i).length === 0)
1605
1097
  return {};
1606
- if (typeof h != "object" || typeof s != "object")
1607
- return s;
1608
- let t = {};
1609
- return Object.keys(s).forEach((e) => {
1610
- if (!Object.keys(h).includes(e)) {
1611
- t = { ...t, [e]: s[e] };
1098
+ if (typeof n != "object" || typeof i != "object")
1099
+ return i;
1100
+ let e = {};
1101
+ return Object.keys(i).forEach((t) => {
1102
+ if (!Object.keys(n).includes(t)) {
1103
+ e = { ...e, [t]: i[t] };
1612
1104
  return;
1613
1105
  }
1614
- if (Array.isArray(s[e])) {
1615
- if (!Array.isArray(h[e])) {
1616
- t = { ...t, [e]: s[e] };
1106
+ if (Array.isArray(i[t])) {
1107
+ if (!Array.isArray(n[t])) {
1108
+ e = { ...e, [t]: i[t] };
1617
1109
  return;
1618
1110
  }
1619
- const n = h[e], o = s[e];
1620
- if (n.length === 0 && o.length === 0) {
1621
- t = { ...t };
1111
+ const s = n[t], o = i[t];
1112
+ if (s.length === 0 && o.length === 0) {
1113
+ e = { ...e };
1622
1114
  return;
1623
1115
  }
1624
- if (n.length !== o.length) {
1625
- t = { ...t, [e]: s[e] };
1116
+ if (s.length !== o.length) {
1117
+ e = { ...e, [t]: i[t] };
1626
1118
  return;
1627
1119
  }
1628
- const c = [];
1629
- if (o.forEach((l, p) => {
1630
- const f = We(
1631
- n[p],
1632
- o[p]
1120
+ const a = [];
1121
+ if (o.forEach((h, l) => {
1122
+ const u = x(
1123
+ s[l],
1124
+ o[l]
1633
1125
  );
1634
- Object.keys(f).length && c.push(o[p]);
1635
- }), Object.keys(c).length) {
1636
- t = { ...t, [e]: c };
1126
+ Object.keys(u).length && a.push(o[l]);
1127
+ }), Object.keys(a).length) {
1128
+ e = { ...e, [t]: a };
1637
1129
  return;
1638
1130
  }
1639
1131
  return;
1640
1132
  }
1641
- if (typeof s[e] == "object") {
1642
- if (typeof h[e] != "object") {
1643
- t = { ...t, [e]: s[e] };
1133
+ if (typeof i[t] == "object") {
1134
+ if (typeof n[t] != "object") {
1135
+ e = { ...e, [t]: i[t] };
1644
1136
  return;
1645
1137
  }
1646
- const n = We(
1647
- h[e],
1648
- s[e]
1138
+ const s = x(
1139
+ n[t],
1140
+ i[t]
1649
1141
  );
1650
- if (Object.keys(n).length) {
1651
- t = { ...t, [e]: n };
1142
+ if (Object.keys(s).length) {
1143
+ e = { ...e, [t]: s };
1652
1144
  return;
1653
1145
  }
1654
1146
  }
1655
- h[e] !== s[e] && (t = { ...t, [e]: s[e] });
1656
- }), t;
1147
+ n[t] !== i[t] && (e = { ...e, [t]: i[t] });
1148
+ }), e;
1657
1149
  };
1150
+ function Fe(n, i) {
1151
+ return i.forEach((e) => {
1152
+ Object.getOwnPropertyNames(e.prototype).forEach((s) => {
1153
+ if (s === "constructor")
1154
+ return;
1155
+ const o = Object.getOwnPropertyDescriptor(
1156
+ e.prototype,
1157
+ s
1158
+ );
1159
+ Object.defineProperty(n.prototype, s, o);
1160
+ });
1161
+ const t = new e();
1162
+ Object.getOwnPropertyNames(t).forEach((s) => {
1163
+ const o = Object.getOwnPropertyDescriptor(
1164
+ t,
1165
+ s
1166
+ );
1167
+ Object.defineProperty(n.prototype, s, o);
1168
+ });
1169
+ }), n;
1170
+ }
1658
1171
  export {
1659
- Xi as ARCompatibilityError,
1660
- it as DIVE,
1661
- Si as DIVEDefaultSettings,
1662
- Bi as DIVEMath,
1663
- qi as ESystem,
1664
- Ji as EWebXRUnsupportedReason,
1665
- Ui as FILE_TYPES,
1666
- Qi as FileTypeError,
1667
- ji as NetworkError,
1668
- es as ParseError,
1669
- Hi as SUPPORTED_FILE_TYPES,
1670
- ai as applyMixins,
1671
- Fi as findInterface,
1672
- ge as findSceneRecursive,
1673
- Wi as getFileTypeFromUri,
1674
- w as getModule,
1675
- We as getObjectDelta,
1676
- Yi as implementsInterface,
1677
- Ki as isFileTypeSupported
1172
+ G as DIVE,
1173
+ ye as DIVEClock,
1174
+ Me as DIVEDefaultSettings,
1175
+ be as DIVEEngine,
1176
+ Ae as DIVEMath,
1177
+ Ge as DIVEMovable,
1178
+ ae as DIVEPerspectiveCamera,
1179
+ oe as DIVEPerspectiveCameraDefaultSettings,
1180
+ we as DIVERenderPipeline,
1181
+ R as DIVERenderPipelineDefaultSettings,
1182
+ Ee as DIVEResizeManager,
1183
+ pe as DIVEScene,
1184
+ ze as DIVESelectable,
1185
+ tt as ESystem,
1186
+ it as EWebXRUnsupportedReason,
1187
+ O as EngineDefaultSettings,
1188
+ Ne as FILE_TYPES,
1189
+ Ze as FileTypeError,
1190
+ Je as NetworkError,
1191
+ je as ParseError,
1192
+ Ye as SUPPORTED_FILE_TYPES,
1193
+ Fe as applyMixins,
1194
+ Ke as findInterface,
1195
+ v as findSceneRecursive,
1196
+ $e as getFileTypeFromUri,
1197
+ d as getModule,
1198
+ x as getObjectDelta,
1199
+ qe as implementsInterface,
1200
+ He as isFileTypeSupported
1678
1201
  };