@shopware-ag/dive 2.0.1-beta.1 → 2.0.1-beta.11

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 (280) hide show
  1. package/build/chunks/AssetCache-CsfCIl9J.mjs +79 -0
  2. package/build/chunks/AssetCache-DGLqbo2B.cjs +1 -0
  3. package/build/chunks/AssetExporter-DsbC2rqv.cjs +164 -0
  4. package/build/{src/modules/asset/exporter/AssetExporter.mjs → chunks/AssetExporter-brT7ogoM.mjs} +22 -21
  5. package/build/chunks/AssetLoader-DvF8gL8a.mjs +2341 -0
  6. package/build/chunks/AssetLoader-H_GSIMop.cjs +4 -0
  7. package/build/chunks/FileTypes-CHutqD19.cjs +30 -0
  8. package/build/chunks/FileTypes-IBuu9ohV.mjs +1057 -0
  9. package/build/chunks/MathUtils-CBW56ZuG.cjs +1 -0
  10. package/build/chunks/MathUtils-CFGjHuVF.mjs +159 -0
  11. package/build/chunks/OrbitController-BQ6SV1O_.mjs +1159 -0
  12. package/build/chunks/OrbitController-CpFQ3A1H.cjs +1 -0
  13. package/build/chunks/{PerspectiveCamera-sm4_81KJ.mjs → PerspectiveCamera-PMJPzAn3.mjs} +2 -2
  14. package/build/chunks/PovSchema-Co9FznEz.cjs +1 -0
  15. package/build/chunks/PovSchema-DWWvr_ED.mjs +10 -0
  16. package/build/chunks/{SelectTool-Bd8cC9nb.mjs → SelectTool-BU0vTDXg.mjs} +44 -39
  17. package/build/chunks/SelectTool-CAqDMcoM.cjs +1 -0
  18. package/build/chunks/draco_decoder-Bh9flJPu.cjs +1 -0
  19. package/build/chunks/draco_decoder-CEzwqP9o.mjs +38 -0
  20. package/build/chunks/draco_decoder-DtHHc5d0.mjs +4 -0
  21. package/build/chunks/draco_decoder-DvYjcLz_.cjs +35 -0
  22. package/build/chunks/draco_wasm_wrapper-FoEVV9af.cjs +118 -0
  23. package/build/chunks/draco_wasm_wrapper-yQy2VLhb.mjs +121 -0
  24. package/build/chunks/fflate.module-DHdJvhNh.cjs +6 -0
  25. package/build/chunks/fflate.module-xyO_T3Zm.mjs +602 -0
  26. package/build/chunks/findInterface-C6mrvf_t.cjs +1 -0
  27. package/build/chunks/findInterface-DbJ5qzbc.mjs +11 -0
  28. package/build/chunks/isFileTypeSupported-BSpswPHU.mjs +12 -0
  29. package/build/chunks/isFileTypeSupported-CrEqYiv9.cjs +1 -0
  30. package/build/chunks/network-error-BONfHWQq.mjs +14 -0
  31. package/build/chunks/network-error-CdDXil5g.cjs +1 -0
  32. package/build/chunks/package-CmvmIjT5.cjs +1 -0
  33. package/build/chunks/package-DSKqbNMb.mjs +39 -0
  34. package/build/chunks/parse-error-DfOPyLWM.mjs +14 -0
  35. package/build/chunks/parse-error-Dy_EE4rL.cjs +1 -0
  36. package/build/dive.cjs +1 -30
  37. package/build/dive.mjs +674 -1535
  38. package/build/plugins/animation/index.cjs +1 -0
  39. package/build/plugins/animation/index.d.ts +2 -0
  40. package/build/plugins/animation/index.mjs +126 -0
  41. package/build/plugins/ar/index.cjs +1 -0
  42. package/build/plugins/ar/index.d.ts +2 -0
  43. package/build/plugins/ar/index.mjs +207 -0
  44. package/build/plugins/assetcache/index.cjs +1 -0
  45. package/build/plugins/assetcache/index.d.ts +2 -0
  46. package/build/plugins/assetcache/index.mjs +5 -0
  47. package/build/plugins/assetconverter/index.d.ts +2 -0
  48. package/build/plugins/assetexporter/index.cjs +1 -0
  49. package/build/plugins/assetexporter/index.d.ts +2 -0
  50. package/build/plugins/assetexporter/index.mjs +4 -0
  51. package/build/plugins/assetloader/index.cjs +1 -0
  52. package/build/plugins/assetloader/index.d.ts +2 -0
  53. package/build/plugins/assetloader/index.mjs +6 -0
  54. package/build/plugins/mediacreator/index.cjs +1 -0
  55. package/build/plugins/mediacreator/index.d.ts +2 -0
  56. package/build/{src/modules/mediacreator/MediaCreator.mjs → plugins/mediacreator/index.mjs} +4 -4
  57. package/build/plugins/orbitcontroller/index.cjs +1 -0
  58. package/build/plugins/orbitcontroller/index.d.ts +2 -0
  59. package/build/plugins/orbitcontroller/index.mjs +5 -0
  60. package/build/plugins/orientationdisplay/index.cjs +1 -0
  61. package/build/plugins/orientationdisplay/index.d.ts +2 -0
  62. package/build/plugins/orientationdisplay/index.mjs +5 -0
  63. package/build/plugins/state/index.cjs +27 -0
  64. package/build/plugins/state/index.d.ts +2 -0
  65. package/build/plugins/state/index.mjs +4266 -0
  66. package/build/plugins/systeminfo/index.cjs +1 -0
  67. package/build/plugins/systeminfo/index.d.ts +2 -0
  68. package/build/{chunks/SystemInfo-DPAQG-S5.mjs → plugins/systeminfo/index.mjs} +48 -51
  69. package/build/plugins/toolbox/index.cjs +1 -0
  70. package/build/plugins/toolbox/index.d.ts +2 -0
  71. package/build/{src/modules/toolbox/Toolbox.mjs → plugins/toolbox/index.mjs} +29 -23
  72. package/build/src/components/boundingbox/BoundingBox.d.ts +136 -0
  73. package/build/src/components/gizmo/Gizmo.d.ts +1 -1
  74. package/build/src/components/gizmo/handles/AxisHandle.d.ts +1 -1
  75. package/build/src/components/gizmo/handles/RadialHandle.d.ts +1 -1
  76. package/build/src/components/gizmo/handles/ScaleHandle.d.ts +1 -1
  77. package/build/src/components/gizmo/rotate/RotateGizmo.d.ts +2 -2
  78. package/build/src/components/gizmo/scale/ScaleGizmo.d.ts +2 -2
  79. package/build/src/components/gizmo/translate/TranslateGizmo.d.ts +2 -2
  80. package/build/src/components/group/Group.d.ts +4 -4
  81. package/build/src/components/model/Model.d.ts +2 -2
  82. package/build/src/components/node/Node.d.ts +7 -7
  83. package/build/src/components/primitive/Primitive.d.ts +3 -3
  84. package/build/src/components/root/Root.d.ts +5 -7
  85. package/build/src/core/Dive.d.ts +5 -4
  86. package/build/src/engine/clock/Clock.d.ts +1 -0
  87. package/build/src/engine/index.d.ts +6 -0
  88. package/build/src/engine/renderer/Renderer.d.ts +47 -7
  89. package/build/src/engine/scene/xrroot/XRRoot.d.ts +2 -2
  90. package/build/src/engine/scene/xrroot/xrlightroot/XRLightRoot.d.ts +2 -2
  91. package/build/src/error/file-content/file-content-error.d.ts +4 -0
  92. package/build/src/error/index.d.ts +4 -0
  93. package/build/src/error/network/network-error.d.ts +1 -1
  94. package/build/src/error/parse/parse-error.d.ts +2 -1
  95. package/build/src/events/dispatcher/EventDispatcher.d.ts +6 -0
  96. package/build/src/events/index.d.ts +1 -0
  97. package/build/src/helpers/deepClone/deepClone.d.ts +34 -0
  98. package/build/src/helpers/index.d.ts +5 -4
  99. package/build/src/index.d.ts +5 -5
  100. package/build/src/interfaces/Draggable.d.ts +1 -1
  101. package/build/src/plugins/animation/index.d.ts +2 -0
  102. package/build/src/{modules/animation → plugins/animation/src}/animator/Animator.d.ts +2 -3
  103. package/build/src/plugins/animation/src/index.d.ts +3 -0
  104. package/build/src/plugins/animation/src/system/AnimationSystem.d.ts +23 -0
  105. package/build/src/plugins/ar/index.d.ts +4 -0
  106. package/build/src/plugins/ar/src/ARSystem.d.ts +24 -0
  107. package/build/src/plugins/ar/src/arquicklook/ARQuickLook.d.ts +15 -0
  108. package/build/src/plugins/ar/src/error/ar-errors.d.ts +24 -0
  109. package/build/src/{modules/ar → plugins/ar/src}/sceneviewer/SceneViewer.d.ts +10 -0
  110. package/build/src/{modules/ar → plugins/ar/src}/webxr/WebXR.d.ts +4 -4
  111. package/build/src/{modules/ar → plugins/ar/src}/webxr/controller/WebXRController.d.ts +5 -5
  112. package/build/src/{modules/ar → plugins/ar/src}/webxr/crosshair/WebXRCrosshair.d.ts +2 -2
  113. package/build/src/{modules/ar → plugins/ar/src}/webxr/origin/WebXROrigin.d.ts +4 -4
  114. package/build/src/{modules/ar → plugins/ar/src}/webxr/overlay/Overlay.d.ts +2 -2
  115. package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/WebXRRaycaster.d.ts +8 -8
  116. package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +4 -4
  117. package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +4 -4
  118. package/build/src/{modules/ar → plugins/ar/src}/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +3 -3
  119. package/build/src/plugins/assetcache/index.d.ts +1 -0
  120. package/build/src/plugins/assetcache/src/cache/AssetCache.d.ts +12 -0
  121. package/build/src/plugins/assetcache/src/chunk/Chunk.d.ts +16 -0
  122. package/build/src/plugins/assetcache/src/index.d.ts +2 -0
  123. package/build/src/plugins/assetconverter/index.d.ts +1 -0
  124. package/build/src/plugins/assetconverter/src/AssetConverter.d.ts +13 -0
  125. package/build/src/plugins/assetexporter/index.d.ts +1 -0
  126. package/build/src/{modules/asset/exporter → plugins/assetexporter/src}/AssetExporter.d.ts +0 -17
  127. package/build/src/plugins/assetloader/index.d.ts +3 -0
  128. package/build/src/plugins/assetloader/src/draco/DracoLoader.d.ts +10 -0
  129. package/build/src/plugins/assetloader/src/loader/AssetLoader.d.ts +14 -0
  130. package/build/src/plugins/mediacreator/index.d.ts +1 -0
  131. package/build/src/plugins/mediacreator/src/MediaCreator.d.ts +15 -0
  132. package/build/src/plugins/orbitcontroller/index.d.ts +1 -0
  133. package/build/src/plugins/orbitcontroller/src/OrbitController.d.ts +45 -0
  134. package/build/src/plugins/orientationdisplay/index.d.ts +2 -0
  135. package/build/src/plugins/orientationdisplay/src/OrientationDisplay.d.ts +18 -0
  136. package/build/src/plugins/orientationdisplay/src/axes/Axes.d.ts +6 -0
  137. package/build/src/plugins/state/index.d.ts +4 -0
  138. package/build/src/{modules/state → plugins/state/src}/State.d.ts +4 -27
  139. package/build/src/{modules/state → plugins/state/src}/actions/action.d.ts +1 -1
  140. package/build/src/{modules/state → plugins/state/src}/actions/ar/launchar.d.ts +2 -2
  141. package/build/src/{modules/state → plugins/state/src}/actions/camera/computeencompassingview.d.ts +1 -1
  142. package/build/src/{modules/state → plugins/state/src}/actions/camera/getcameratransform.d.ts +1 -1
  143. package/build/src/{modules/state → plugins/state/src}/actions/camera/lockcamera.d.ts +1 -1
  144. package/build/src/{modules/state → plugins/state/src}/actions/camera/movecamera.d.ts +3 -3
  145. package/build/src/{modules/state → plugins/state/src}/actions/camera/setcameralayer.d.ts +1 -1
  146. package/build/src/{modules/state → plugins/state/src}/actions/camera/setcameratransform.d.ts +1 -1
  147. package/build/src/{modules/state → plugins/state/src}/actions/camera/zoomcamera.d.ts +1 -1
  148. package/build/src/{modules/state → plugins/state/src}/actions/media/generatemedia.d.ts +1 -1
  149. package/build/src/plugins/state/src/actions/object/addobject.d.ts +9 -0
  150. package/build/src/plugins/state/src/actions/object/deleteobject.d.ts +13 -0
  151. package/build/src/plugins/state/src/actions/object/deselectobject.d.ts +13 -0
  152. package/build/src/{modules/state → plugins/state/src}/actions/object/dropit.d.ts +3 -3
  153. package/build/src/{modules/state → plugins/state/src}/actions/object/getallobjects.d.ts +3 -2
  154. package/build/src/plugins/state/src/actions/object/getobjects.d.ts +13 -0
  155. package/build/src/{modules/state → plugins/state/src}/actions/object/modelloaded.d.ts +1 -1
  156. package/build/src/{modules/state → plugins/state/src}/actions/object/placeonfloor.d.ts +3 -3
  157. package/build/src/plugins/state/src/actions/object/selectobject.d.ts +13 -0
  158. package/build/src/plugins/state/src/actions/object/setparent.d.ts +23 -0
  159. package/build/src/plugins/state/src/actions/object/updateobject.d.ts +13 -0
  160. package/build/src/{modules/state → plugins/state/src}/actions/renderer/startrender.d.ts +1 -1
  161. package/build/src/{modules/state → plugins/state/src}/actions/scene/exportscene.d.ts +4 -4
  162. package/build/src/plugins/state/src/actions/scene/getallscenedata.d.ts +9 -0
  163. package/build/src/{modules/state → plugins/state/src}/actions/scene/setbackground.d.ts +1 -1
  164. package/build/src/{modules/state → plugins/state/src}/actions/scene/updatescene.d.ts +1 -1
  165. package/build/src/{modules/state → plugins/state/src}/actions/toolbox/setgizmomode.d.ts +1 -1
  166. package/build/src/{modules/state → plugins/state/src}/actions/toolbox/setgizmoscalelinked.d.ts +1 -1
  167. package/build/src/plugins/state/src/actions/toolbox/setgizmovisible.d.ts +8 -0
  168. package/build/src/{modules/state → plugins/state/src}/actions/toolbox/usetool.d.ts +2 -2
  169. package/build/src/plugins/state/types/ActionTypes.d.ts +17 -0
  170. package/build/src/{types/SceneType.d.ts → plugins/state/types/StateExportFileType.d.ts} +1 -1
  171. package/build/src/plugins/state/types/StateSceneData.d.ts +19 -0
  172. package/build/src/plugins/state/types/index.d.ts +1 -0
  173. package/build/src/plugins/systeminfo/index.d.ts +2 -0
  174. package/build/src/{modules/systeminfo → plugins/systeminfo/src}/SystemInfo.d.ts +22 -32
  175. package/build/src/plugins/toolbox/index.d.ts +4 -0
  176. package/build/src/{modules/toolbox → plugins/toolbox/src}/BaseTool.d.ts +4 -6
  177. package/build/src/{modules/toolbox → plugins/toolbox/src}/Toolbox.d.ts +8 -17
  178. package/build/src/{modules/toolbox → plugins/toolbox/src}/select/SelectTool.d.ts +7 -11
  179. package/build/src/{modules/toolbox → plugins/toolbox/src}/transform/TransformTool.d.ts +6 -10
  180. package/build/src/types/components/DIVELight.d.ts +4 -0
  181. package/build/src/types/components/DIVESceneObject.d.ts +6 -0
  182. package/build/src/types/components/index.d.ts +2 -0
  183. package/build/src/types/index.d.ts +2 -5
  184. package/build/src/types/schema/BaseEntitySchema.d.ts +8 -0
  185. package/build/src/types/schema/EntitySchema.d.ts +11 -0
  186. package/build/src/types/schema/EntityTypeSchema.d.ts +1 -0
  187. package/build/src/types/schema/GeometrySchema.d.ts +7 -0
  188. package/build/src/types/schema/GeometryTypeSchema.d.ts +1 -0
  189. package/build/src/types/schema/GroupSchema.d.ts +11 -0
  190. package/build/src/types/schema/LightSchema.d.ts +28 -0
  191. package/build/src/{modules/state/types/COMMaterial.d.ts → types/schema/MaterialSchema.d.ts} +1 -1
  192. package/build/src/types/schema/ModelSchema.d.ts +14 -0
  193. package/build/src/types/schema/PovSchema.d.ts +10 -0
  194. package/build/src/types/schema/PrimitiveSchema.d.ts +14 -0
  195. package/build/src/types/schema/index.d.ts +11 -0
  196. package/package.json +59 -41
  197. package/build/chunks/FileTypes-BjZ0rrIV.cjs +0 -1
  198. package/build/chunks/FileTypes-qgYnI0Jg.mjs +0 -30
  199. package/build/chunks/ModuleRegistry-NyNtjHb2.cjs +0 -1
  200. package/build/chunks/ModuleRegistry-RSub8W0G.mjs +0 -13
  201. package/build/chunks/SelectTool-BAXTVyWs.cjs +0 -1
  202. package/build/chunks/SystemInfo-oX-NNneO.cjs +0 -1
  203. package/build/chunks/findInterface-BEdL2iUQ.cjs +0 -1
  204. package/build/chunks/findInterface-OrXgmwxj.mjs +0 -18
  205. package/build/chunks/index-C_uFFwT2.mjs +0 -5
  206. package/build/chunks/index-DAwIH9xh.cjs +0 -1
  207. package/build/chunks/package-BHjZWYD6.mjs +0 -39
  208. package/build/chunks/package-JHvTSNgQ.cjs +0 -1
  209. package/build/chunks/parse-error-2f5qpXP5.cjs +0 -6
  210. package/build/chunks/parse-error-DRBVHL9E.mjs +0 -614
  211. package/build/src/error/ar-compatibility/ar-compatibility-error.d.ts +0 -12
  212. package/build/src/modules/ModuleRegistry.d.ts +0 -19
  213. package/build/src/modules/animation/AnimationSystem.cjs +0 -1
  214. package/build/src/modules/animation/AnimationSystem.d.ts +0 -36
  215. package/build/src/modules/animation/AnimationSystem.mjs +0 -95
  216. package/build/src/modules/ar/ARSystem.cjs +0 -1
  217. package/build/src/modules/ar/ARSystem.d.ts +0 -71
  218. package/build/src/modules/ar/ARSystem.mjs +0 -163
  219. package/build/src/modules/ar/arquicklook/ARQuickLook.d.ts +0 -7
  220. package/build/src/modules/asset/converter/AssetConverter.d.ts +0 -30
  221. package/build/src/modules/asset/draco/README.md +0 -32
  222. package/build/src/modules/asset/draco/draco_decoder.js +0 -33
  223. package/build/src/modules/asset/draco/draco_decoder.wasm +0 -0
  224. package/build/src/modules/asset/draco/draco_encoder.js +0 -33
  225. package/build/src/modules/asset/draco/draco_wasm_wrapper.js +0 -116
  226. package/build/src/modules/asset/draco/gltf/draco_decoder.js +0 -33
  227. package/build/src/modules/asset/draco/gltf/draco_decoder.wasm +0 -0
  228. package/build/src/modules/asset/draco/gltf/draco_encoder.js +0 -33
  229. package/build/src/modules/asset/draco/gltf/draco_wasm_wrapper.js +0 -116
  230. package/build/src/modules/asset/exporter/AssetExporter.cjs +0 -164
  231. package/build/src/modules/asset/loader/AssetLoader.cjs +0 -3
  232. package/build/src/modules/asset/loader/AssetLoader.d.ts +0 -29
  233. package/build/src/modules/asset/loader/AssetLoader.mjs +0 -2154
  234. package/build/src/modules/axiscamera/AxisCamera.d.ts +0 -21
  235. package/build/src/modules/controller/orbit/OrbitController.d.ts +0 -30
  236. package/build/src/modules/events/EventExecutor.d.ts +0 -5
  237. package/build/src/modules/mediacreator/MediaCreator.cjs +0 -1
  238. package/build/src/modules/mediacreator/MediaCreator.d.ts +0 -44
  239. package/build/src/modules/state/State.cjs +0 -27
  240. package/build/src/modules/state/State.mjs +0 -4296
  241. package/build/src/modules/state/actions/object/addobject.d.ts +0 -8
  242. package/build/src/modules/state/actions/object/deleteobject.d.ts +0 -12
  243. package/build/src/modules/state/actions/object/deselectobject.d.ts +0 -12
  244. package/build/src/modules/state/actions/object/getobjects.d.ts +0 -12
  245. package/build/src/modules/state/actions/object/selectobject.d.ts +0 -12
  246. package/build/src/modules/state/actions/object/setparent.d.ts +0 -22
  247. package/build/src/modules/state/actions/object/updateobject.d.ts +0 -12
  248. package/build/src/modules/state/actions/scene/getallscenedata.d.ts +0 -9
  249. package/build/src/modules/state/actions/toolbox/setgizmovisible.d.ts +0 -8
  250. package/build/src/modules/state/types/ActionTypes.d.ts +0 -18
  251. package/build/src/modules/state/types/COMBaseEntity.d.ts +0 -8
  252. package/build/src/modules/state/types/COMEntity.d.ts +0 -11
  253. package/build/src/modules/state/types/COMEntityType.d.ts +0 -1
  254. package/build/src/modules/state/types/COMGeometry.d.ts +0 -7
  255. package/build/src/modules/state/types/COMGeometryType.d.ts +0 -1
  256. package/build/src/modules/state/types/COMGroup.d.ts +0 -11
  257. package/build/src/modules/state/types/COMLight.d.ts +0 -28
  258. package/build/src/modules/state/types/COMModel.d.ts +0 -14
  259. package/build/src/modules/state/types/COMPov.d.ts +0 -10
  260. package/build/src/modules/state/types/COMPrimitive.d.ts +0 -14
  261. package/build/src/modules/state/types/index.d.ts +0 -11
  262. package/build/src/modules/systeminfo/SystemInfo.cjs +0 -1
  263. package/build/src/modules/systeminfo/SystemInfo.mjs +0 -5
  264. package/build/src/modules/toolbox/Toolbox.cjs +0 -1
  265. package/build/src/types/SceneData.d.ts +0 -19
  266. package/build/src/types/SceneObjects.d.ts +0 -9
  267. package/build/src/types/UUID.d.ts +0 -1
  268. /package/build/{src/modules/asset/converter/AssetConverter.cjs → plugins/assetconverter/index.cjs} +0 -0
  269. /package/build/{src/modules/asset/converter/AssetConverter.mjs → plugins/assetconverter/index.mjs} +0 -0
  270. /package/build/src/{modules/animation → plugins/animation/src}/types/AnimatorParameters.d.ts +0 -0
  271. /package/build/src/{modules/state → plugins/state/src}/ActionRegistry.d.ts +0 -0
  272. /package/build/src/{modules/state → plugins/state/src}/actions/ar/index.d.ts +0 -0
  273. /package/build/src/{modules/state → plugins/state/src}/actions/camera/index.d.ts +0 -0
  274. /package/build/src/{modules/state → plugins/state/src}/actions/index.d.ts +0 -0
  275. /package/build/src/{modules/state → plugins/state/src}/actions/media/index.d.ts +0 -0
  276. /package/build/src/{modules/state → plugins/state/src}/actions/object/index.d.ts +0 -0
  277. /package/build/src/{modules/state → plugins/state/src}/actions/renderer/index.d.ts +0 -0
  278. /package/build/src/{modules/state → plugins/state/src}/actions/scene/index.d.ts +0 -0
  279. /package/build/src/{modules/state → plugins/state/src}/actions/toolbox/index.d.ts +0 -0
  280. /package/build/src/{types/info → plugins/systeminfo/types}/index.d.ts +0 -0
@@ -0,0 +1,1159 @@
1
+ var ie = Object.defineProperty;
2
+ var se = (S, e, i) => e in S ? ie(S, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : S[e] = i;
3
+ var z = (S, e, i) => se(S, typeof e != "symbol" ? e + "" : e, i);
4
+ import { Ray as ne, Plane as oe, MathUtils as ae, EventDispatcher as re, Vector3 as b, MOUSE as H, TOUCH as F, Spherical as St, Quaternion as ht, Vector2 as D, Object3D as he, Box3 as Rt, Box3Helper as ce, Sphere as le, SphereGeometry as ue, Mesh as pe, MeshBasicMaterial as me } from "three";
5
+ import { c as Nt, M as nt } from "./MathUtils-CFGjHuVF.mjs";
6
+ import { P as de } from "./VisibilityLayerMask-CXgt1fJc.mjs";
7
+ const At = { type: "change" }, ot = { type: "start" }, jt = { type: "end" }, G = new ne(), kt = new oe(), ye = Math.cos(70 * ae.DEG2RAD);
8
+ class xe extends re {
9
+ constructor(e, i) {
10
+ super(), this.object = e, this.domElement = i, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new b(), this.cursor = new b(), 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: H.ROTATE, MIDDLE: H.DOLLY, RIGHT: H.PAN }, this.touches = { ONE: F.ROTATE, TWO: F.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
11
+ return r.phi;
12
+ }, this.getAzimuthalAngle = function() {
13
+ return r.theta;
14
+ }, this.getDistance = function() {
15
+ return this.object.position.distanceTo(this.target);
16
+ }, this.listenToKeyEvents = function(s) {
17
+ s.addEventListener("keydown", st), this._domElementKeyEvents = s;
18
+ }, this.stopListenToKeyEvents = function() {
19
+ this._domElementKeyEvents.removeEventListener("keydown", st), this._domElementKeyEvents = null;
20
+ }, this.saveState = function() {
21
+ t.target0.copy(t.target), t.position0.copy(t.object.position), t.zoom0 = t.object.zoom;
22
+ }, this.reset = function() {
23
+ t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(At), t.update(), n = o.NONE;
24
+ }, this.update = function() {
25
+ const s = new b(), l = new ht().setFromUnitVectors(e.up, new b(0, 1, 0)), x = l.clone().invert(), _ = new b(), w = new ht(), L = new b(), T = 2 * Math.PI;
26
+ return function(ee = null) {
27
+ const Dt = t.object.position;
28
+ s.copy(Dt).sub(t.target), s.applyQuaternion(l), r.setFromVector3(s), t.autoRotate && n === o.NONE && B(It(ee)), t.enableDamping ? (r.theta += p.theta * t.dampingFactor, r.phi += p.phi * t.dampingFactor) : (r.theta += p.theta, r.phi += p.phi);
29
+ let j = t.minAzimuthAngle, k = t.maxAzimuthAngle;
30
+ isFinite(j) && isFinite(k) && (j < -Math.PI ? j += T : j > Math.PI && (j -= T), k < -Math.PI ? k += T : k > Math.PI && (k -= T), j <= k ? r.theta = Math.max(j, Math.min(k, r.theta)) : r.theta = r.theta > (j + k) / 2 ? Math.max(j, r.theta) : Math.min(k, r.theta)), r.phi = Math.max(t.minPolarAngle, Math.min(t.maxPolarAngle, r.phi)), r.makeSafe(), t.enableDamping === !0 ? t.target.addScaledVector(c, t.dampingFactor) : t.target.add(c), t.target.sub(t.cursor), t.target.clampLength(t.minTargetRadius, t.maxTargetRadius), t.target.add(t.cursor);
31
+ let X = !1;
32
+ if (t.zoomToCursor && N || t.object.isOrthographicCamera)
33
+ r.radius = et(r.radius);
34
+ else {
35
+ const O = r.radius;
36
+ r.radius = et(r.radius * a), X = O != r.radius;
37
+ }
38
+ if (s.setFromSpherical(r), s.applyQuaternion(x), Dt.copy(t.target).add(s), t.object.lookAt(t.target), t.enableDamping === !0 ? (p.theta *= 1 - t.dampingFactor, p.phi *= 1 - t.dampingFactor, c.multiplyScalar(1 - t.dampingFactor)) : (p.set(0, 0, 0), c.set(0, 0, 0)), t.zoomToCursor && N) {
39
+ let O = null;
40
+ if (t.object.isPerspectiveCamera) {
41
+ const K = s.length();
42
+ O = et(K * a);
43
+ const Q = K - O;
44
+ t.object.position.addScaledVector(R, Q), t.object.updateMatrixWorld(), X = !!Q;
45
+ } else if (t.object.isOrthographicCamera) {
46
+ const K = new b(f.x, f.y, 0);
47
+ K.unproject(t.object);
48
+ const Q = t.object.zoom;
49
+ t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / a)), t.object.updateProjectionMatrix(), X = Q !== t.object.zoom;
50
+ const Ct = new b(f.x, f.y, 0);
51
+ Ct.unproject(t.object), t.object.position.sub(Ct).add(K), t.object.updateMatrixWorld(), O = s.length();
52
+ } else
53
+ console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), t.zoomToCursor = !1;
54
+ O !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(O).add(t.object.position) : (G.origin.copy(t.object.position), G.direction.set(0, 0, -1).transformDirection(t.object.matrix), Math.abs(t.object.up.dot(G.direction)) < ye ? e.lookAt(t.target) : (kt.setFromNormalAndCoplanarPoint(t.object.up, t.target), G.intersectPlane(kt, t.target))));
55
+ } else if (t.object.isOrthographicCamera) {
56
+ const O = t.object.zoom;
57
+ t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / a)), O !== t.object.zoom && (t.object.updateProjectionMatrix(), X = !0);
58
+ }
59
+ return a = 1, N = !1, X || _.distanceToSquared(t.object.position) > d || 8 * (1 - w.dot(t.object.quaternion)) > d || L.distanceToSquared(t.target) > d ? (t.dispatchEvent(At), _.copy(t.object.position), w.copy(t.object.quaternion), L.copy(t.target), !0) : !1;
60
+ };
61
+ }(), this.dispose = function() {
62
+ t.domElement.removeEventListener("contextmenu", Tt), t.domElement.removeEventListener("pointerdown", zt), t.domElement.removeEventListener("pointercancel", U), t.domElement.removeEventListener("wheel", bt), t.domElement.removeEventListener("pointermove", it), t.domElement.removeEventListener("pointerup", U), t.domElement.getRootNode().removeEventListener("keydown", Mt, { capture: !0 }), t._domElementKeyEvents !== null && (t._domElementKeyEvents.removeEventListener("keydown", st), t._domElementKeyEvents = null);
63
+ };
64
+ const t = this, o = {
65
+ NONE: -1,
66
+ ROTATE: 0,
67
+ DOLLY: 1,
68
+ PAN: 2,
69
+ TOUCH_ROTATE: 3,
70
+ TOUCH_PAN: 4,
71
+ TOUCH_DOLLY_PAN: 5,
72
+ TOUCH_DOLLY_ROTATE: 6
73
+ };
74
+ let n = o.NONE;
75
+ const d = 1e-6, r = new St(), p = new St();
76
+ let a = 1;
77
+ const c = new b(), u = new D(), m = new D(), h = new D(), y = new D(), E = new D(), M = new D(), P = new D(), A = new D(), C = new D(), R = new b(), f = new D();
78
+ let N = !1;
79
+ const g = [], Z = {};
80
+ let $ = !1;
81
+ function It(s) {
82
+ return s !== null ? 2 * Math.PI / 60 * t.autoRotateSpeed * s : 2 * Math.PI / 60 / 60 * t.autoRotateSpeed;
83
+ }
84
+ function q(s) {
85
+ const l = Math.abs(s * 0.01);
86
+ return Math.pow(0.95, t.zoomSpeed * l);
87
+ }
88
+ function B(s) {
89
+ p.theta -= s;
90
+ }
91
+ function W(s) {
92
+ p.phi -= s;
93
+ }
94
+ const ct = function() {
95
+ const s = new b();
96
+ return function(x, _) {
97
+ s.setFromMatrixColumn(_, 0), s.multiplyScalar(-x), c.add(s);
98
+ };
99
+ }(), lt = function() {
100
+ const s = new b();
101
+ return function(x, _) {
102
+ t.screenSpacePanning === !0 ? s.setFromMatrixColumn(_, 1) : (s.setFromMatrixColumn(_, 0), s.crossVectors(t.object.up, s)), s.multiplyScalar(x), c.add(s);
103
+ };
104
+ }(), I = function() {
105
+ const s = new b();
106
+ return function(x, _) {
107
+ const w = t.domElement;
108
+ if (t.object.isPerspectiveCamera) {
109
+ const L = t.object.position;
110
+ s.copy(L).sub(t.target);
111
+ let T = s.length();
112
+ T *= Math.tan(t.object.fov / 2 * Math.PI / 180), ct(2 * x * T / w.clientHeight, t.object.matrix), lt(2 * _ * T / w.clientHeight, t.object.matrix);
113
+ } else t.object.isOrthographicCamera ? (ct(x * (t.object.right - t.object.left) / t.object.zoom / w.clientWidth, t.object.matrix), lt(_ * (t.object.top - t.object.bottom) / t.object.zoom / w.clientHeight, t.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), t.enablePan = !1);
114
+ };
115
+ }();
116
+ function v(s) {
117
+ t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? a /= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
118
+ }
119
+ function ut(s) {
120
+ t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? a *= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
121
+ }
122
+ function tt(s, l) {
123
+ if (!t.zoomToCursor)
124
+ return;
125
+ N = !0;
126
+ const x = t.domElement.getBoundingClientRect(), _ = s - x.left, w = l - x.top, L = x.width, T = x.height;
127
+ f.x = _ / L * 2 - 1, f.y = -(w / T) * 2 + 1, R.set(f.x, f.y, 1).unproject(t.object).sub(t.object.position).normalize();
128
+ }
129
+ function et(s) {
130
+ return Math.max(t.minDistance, Math.min(t.maxDistance, s));
131
+ }
132
+ function pt(s) {
133
+ u.set(s.clientX, s.clientY);
134
+ }
135
+ function Yt(s) {
136
+ tt(s.clientX, s.clientX), P.set(s.clientX, s.clientY);
137
+ }
138
+ function mt(s) {
139
+ y.set(s.clientX, s.clientY);
140
+ }
141
+ function Ht(s) {
142
+ m.set(s.clientX, s.clientY), h.subVectors(m, u).multiplyScalar(t.rotateSpeed);
143
+ const l = t.domElement;
144
+ B(2 * Math.PI * h.x / l.clientHeight), W(2 * Math.PI * h.y / l.clientHeight), u.copy(m), t.update();
145
+ }
146
+ function Ft(s) {
147
+ A.set(s.clientX, s.clientY), C.subVectors(A, P), C.y > 0 ? v(q(C.y)) : C.y < 0 && ut(q(C.y)), P.copy(A), t.update();
148
+ }
149
+ function Zt(s) {
150
+ E.set(s.clientX, s.clientY), M.subVectors(E, y).multiplyScalar(t.panSpeed), I(M.x, M.y), y.copy(E), t.update();
151
+ }
152
+ function Bt(s) {
153
+ tt(s.clientX, s.clientY), s.deltaY < 0 ? ut(q(s.deltaY)) : s.deltaY > 0 && v(q(s.deltaY)), t.update();
154
+ }
155
+ function Ut(s) {
156
+ let l = !1;
157
+ switch (s.code) {
158
+ case t.keys.UP:
159
+ s.ctrlKey || s.metaKey || s.shiftKey ? W(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : I(0, t.keyPanSpeed), l = !0;
160
+ break;
161
+ case t.keys.BOTTOM:
162
+ s.ctrlKey || s.metaKey || s.shiftKey ? W(-2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : I(0, -t.keyPanSpeed), l = !0;
163
+ break;
164
+ case t.keys.LEFT:
165
+ s.ctrlKey || s.metaKey || s.shiftKey ? B(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : I(t.keyPanSpeed, 0), l = !0;
166
+ break;
167
+ case t.keys.RIGHT:
168
+ s.ctrlKey || s.metaKey || s.shiftKey ? B(-2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : I(-t.keyPanSpeed, 0), l = !0;
169
+ break;
170
+ }
171
+ l && (s.preventDefault(), t.update());
172
+ }
173
+ function dt(s) {
174
+ if (g.length === 1)
175
+ u.set(s.pageX, s.pageY);
176
+ else {
177
+ const l = Y(s), x = 0.5 * (s.pageX + l.x), _ = 0.5 * (s.pageY + l.y);
178
+ u.set(x, _);
179
+ }
180
+ }
181
+ function yt(s) {
182
+ if (g.length === 1)
183
+ y.set(s.pageX, s.pageY);
184
+ else {
185
+ const l = Y(s), x = 0.5 * (s.pageX + l.x), _ = 0.5 * (s.pageY + l.y);
186
+ y.set(x, _);
187
+ }
188
+ }
189
+ function xt(s) {
190
+ const l = Y(s), x = s.pageX - l.x, _ = s.pageY - l.y, w = Math.sqrt(x * x + _ * _);
191
+ P.set(0, w);
192
+ }
193
+ function Xt(s) {
194
+ t.enableZoom && xt(s), t.enablePan && yt(s);
195
+ }
196
+ function Kt(s) {
197
+ t.enableZoom && xt(s), t.enableRotate && dt(s);
198
+ }
199
+ function _t(s) {
200
+ if (g.length == 1)
201
+ m.set(s.pageX, s.pageY);
202
+ else {
203
+ const x = Y(s), _ = 0.5 * (s.pageX + x.x), w = 0.5 * (s.pageY + x.y);
204
+ m.set(_, w);
205
+ }
206
+ h.subVectors(m, u).multiplyScalar(t.rotateSpeed);
207
+ const l = t.domElement;
208
+ B(2 * Math.PI * h.x / l.clientHeight), W(2 * Math.PI * h.y / l.clientHeight), u.copy(m);
209
+ }
210
+ function ft(s) {
211
+ if (g.length === 1)
212
+ E.set(s.pageX, s.pageY);
213
+ else {
214
+ const l = Y(s), x = 0.5 * (s.pageX + l.x), _ = 0.5 * (s.pageY + l.y);
215
+ E.set(x, _);
216
+ }
217
+ M.subVectors(E, y).multiplyScalar(t.panSpeed), I(M.x, M.y), y.copy(E);
218
+ }
219
+ function gt(s) {
220
+ const l = Y(s), x = s.pageX - l.x, _ = s.pageY - l.y, w = Math.sqrt(x * x + _ * _);
221
+ A.set(0, w), C.set(0, Math.pow(A.y / P.y, t.zoomSpeed)), v(C.y), P.copy(A);
222
+ const L = (s.pageX + l.x) * 0.5, T = (s.pageY + l.y) * 0.5;
223
+ tt(L, T);
224
+ }
225
+ function Vt(s) {
226
+ t.enableZoom && gt(s), t.enablePan && ft(s);
227
+ }
228
+ function qt(s) {
229
+ t.enableZoom && gt(s), t.enableRotate && _t(s);
230
+ }
231
+ function zt(s) {
232
+ t.enabled !== !1 && (g.length === 0 && (t.domElement.setPointerCapture(s.pointerId), t.domElement.addEventListener("pointermove", it), t.domElement.addEventListener("pointerup", U)), !te(s) && ($t(s), s.pointerType === "touch" ? Et(s) : Wt(s)));
233
+ }
234
+ function it(s) {
235
+ t.enabled !== !1 && (s.pointerType === "touch" ? Jt(s) : Qt(s));
236
+ }
237
+ function U(s) {
238
+ switch (vt(s), g.length) {
239
+ case 0:
240
+ t.domElement.releasePointerCapture(s.pointerId), t.domElement.removeEventListener("pointermove", it), t.domElement.removeEventListener("pointerup", U), t.dispatchEvent(jt), n = o.NONE;
241
+ break;
242
+ case 1:
243
+ const l = g[0], x = Z[l];
244
+ Et({ pointerId: l, pageX: x.x, pageY: x.y });
245
+ break;
246
+ }
247
+ }
248
+ function Wt(s) {
249
+ let l;
250
+ switch (s.button) {
251
+ case 0:
252
+ l = t.mouseButtons.LEFT;
253
+ break;
254
+ case 1:
255
+ l = t.mouseButtons.MIDDLE;
256
+ break;
257
+ case 2:
258
+ l = t.mouseButtons.RIGHT;
259
+ break;
260
+ default:
261
+ l = -1;
262
+ }
263
+ switch (l) {
264
+ case H.DOLLY:
265
+ if (t.enableZoom === !1) return;
266
+ Yt(s), n = o.DOLLY;
267
+ break;
268
+ case H.ROTATE:
269
+ if (s.ctrlKey || s.metaKey || s.shiftKey) {
270
+ if (t.enablePan === !1) return;
271
+ mt(s), n = o.PAN;
272
+ } else {
273
+ if (t.enableRotate === !1) return;
274
+ pt(s), n = o.ROTATE;
275
+ }
276
+ break;
277
+ case H.PAN:
278
+ if (s.ctrlKey || s.metaKey || s.shiftKey) {
279
+ if (t.enableRotate === !1) return;
280
+ pt(s), n = o.ROTATE;
281
+ } else {
282
+ if (t.enablePan === !1) return;
283
+ mt(s), n = o.PAN;
284
+ }
285
+ break;
286
+ default:
287
+ n = o.NONE;
288
+ }
289
+ n !== o.NONE && t.dispatchEvent(ot);
290
+ }
291
+ function Qt(s) {
292
+ switch (n) {
293
+ case o.ROTATE:
294
+ if (t.enableRotate === !1) return;
295
+ Ht(s);
296
+ break;
297
+ case o.DOLLY:
298
+ if (t.enableZoom === !1) return;
299
+ Ft(s);
300
+ break;
301
+ case o.PAN:
302
+ if (t.enablePan === !1) return;
303
+ Zt(s);
304
+ break;
305
+ }
306
+ }
307
+ function bt(s) {
308
+ t.enabled === !1 || t.enableZoom === !1 || n !== o.NONE || (s.preventDefault(), t.dispatchEvent(ot), Bt(Gt(s)), t.dispatchEvent(jt));
309
+ }
310
+ function Gt(s) {
311
+ const l = s.deltaMode, x = {
312
+ clientX: s.clientX,
313
+ clientY: s.clientY,
314
+ deltaY: s.deltaY
315
+ };
316
+ switch (l) {
317
+ case 1:
318
+ x.deltaY *= 16;
319
+ break;
320
+ case 2:
321
+ x.deltaY *= 100;
322
+ break;
323
+ }
324
+ return s.ctrlKey && !$ && (x.deltaY *= 10), x;
325
+ }
326
+ function Mt(s) {
327
+ s.key === "Control" && ($ = !0, t.domElement.getRootNode().addEventListener("keyup", wt, { passive: !0, capture: !0 }));
328
+ }
329
+ function wt(s) {
330
+ s.key === "Control" && ($ = !1, t.domElement.getRootNode().removeEventListener("keyup", wt, { passive: !0, capture: !0 }));
331
+ }
332
+ function st(s) {
333
+ t.enabled === !1 || t.enablePan === !1 || Ut(s);
334
+ }
335
+ function Et(s) {
336
+ switch (Pt(s), g.length) {
337
+ case 1:
338
+ switch (t.touches.ONE) {
339
+ case F.ROTATE:
340
+ if (t.enableRotate === !1) return;
341
+ dt(s), n = o.TOUCH_ROTATE;
342
+ break;
343
+ case F.PAN:
344
+ if (t.enablePan === !1) return;
345
+ yt(s), n = o.TOUCH_PAN;
346
+ break;
347
+ default:
348
+ n = o.NONE;
349
+ }
350
+ break;
351
+ case 2:
352
+ switch (t.touches.TWO) {
353
+ case F.DOLLY_PAN:
354
+ if (t.enableZoom === !1 && t.enablePan === !1) return;
355
+ Xt(s), n = o.TOUCH_DOLLY_PAN;
356
+ break;
357
+ case F.DOLLY_ROTATE:
358
+ if (t.enableZoom === !1 && t.enableRotate === !1) return;
359
+ Kt(s), n = o.TOUCH_DOLLY_ROTATE;
360
+ break;
361
+ default:
362
+ n = o.NONE;
363
+ }
364
+ break;
365
+ default:
366
+ n = o.NONE;
367
+ }
368
+ n !== o.NONE && t.dispatchEvent(ot);
369
+ }
370
+ function Jt(s) {
371
+ switch (Pt(s), n) {
372
+ case o.TOUCH_ROTATE:
373
+ if (t.enableRotate === !1) return;
374
+ _t(s), t.update();
375
+ break;
376
+ case o.TOUCH_PAN:
377
+ if (t.enablePan === !1) return;
378
+ ft(s), t.update();
379
+ break;
380
+ case o.TOUCH_DOLLY_PAN:
381
+ if (t.enableZoom === !1 && t.enablePan === !1) return;
382
+ Vt(s), t.update();
383
+ break;
384
+ case o.TOUCH_DOLLY_ROTATE:
385
+ if (t.enableZoom === !1 && t.enableRotate === !1) return;
386
+ qt(s), t.update();
387
+ break;
388
+ default:
389
+ n = o.NONE;
390
+ }
391
+ }
392
+ function Tt(s) {
393
+ t.enabled !== !1 && s.preventDefault();
394
+ }
395
+ function $t(s) {
396
+ g.push(s.pointerId);
397
+ }
398
+ function vt(s) {
399
+ delete Z[s.pointerId];
400
+ for (let l = 0; l < g.length; l++)
401
+ if (g[l] == s.pointerId) {
402
+ g.splice(l, 1);
403
+ return;
404
+ }
405
+ }
406
+ function te(s) {
407
+ for (let l = 0; l < g.length; l++)
408
+ if (g[l] == s.pointerId) return !0;
409
+ return !1;
410
+ }
411
+ function Pt(s) {
412
+ let l = Z[s.pointerId];
413
+ l === void 0 && (l = new D(), Z[s.pointerId] = l), l.set(s.pageX, s.pageY);
414
+ }
415
+ function Y(s) {
416
+ const l = s.pointerId === g[0] ? g[1] : g[0];
417
+ return Z[l];
418
+ }
419
+ t.domElement.addEventListener("contextmenu", Tt), t.domElement.addEventListener("pointerdown", zt), t.domElement.addEventListener("pointercancel", U), t.domElement.addEventListener("wheel", bt, { passive: !1 }), t.domElement.getRootNode().addEventListener("keydown", Mt, { passive: !0, capture: !0 }), this.update();
420
+ }
421
+ }
422
+ class _e {
423
+ constructor(e = 0, i = 0, t = 0, o = 1) {
424
+ this.isQuaternion = !0, this._x = e, this._y = i, this._z = t, this._w = o;
425
+ }
426
+ static slerpFlat(e, i, t, o, n, d, r) {
427
+ let p = t[o + 0], a = t[o + 1], c = t[o + 2], u = t[o + 3];
428
+ const m = n[d + 0], h = n[d + 1], y = n[d + 2], E = n[d + 3];
429
+ if (r === 0) {
430
+ e[i + 0] = p, e[i + 1] = a, e[i + 2] = c, e[i + 3] = u;
431
+ return;
432
+ }
433
+ if (r === 1) {
434
+ e[i + 0] = m, e[i + 1] = h, e[i + 2] = y, e[i + 3] = E;
435
+ return;
436
+ }
437
+ if (u !== E || p !== m || a !== h || c !== y) {
438
+ let M = 1 - r;
439
+ const P = p * m + a * h + c * y + u * E, A = P >= 0 ? 1 : -1, C = 1 - P * P;
440
+ if (C > Number.EPSILON) {
441
+ const f = Math.sqrt(C), N = Math.atan2(f, P * A);
442
+ M = Math.sin(M * N) / f, r = Math.sin(r * N) / f;
443
+ }
444
+ const R = r * A;
445
+ if (p = p * M + m * R, a = a * M + h * R, c = c * M + y * R, u = u * M + E * R, M === 1 - r) {
446
+ const f = 1 / Math.sqrt(p * p + a * a + c * c + u * u);
447
+ p *= f, a *= f, c *= f, u *= f;
448
+ }
449
+ }
450
+ e[i] = p, e[i + 1] = a, e[i + 2] = c, e[i + 3] = u;
451
+ }
452
+ static multiplyQuaternionsFlat(e, i, t, o, n, d) {
453
+ const r = t[o], p = t[o + 1], a = t[o + 2], c = t[o + 3], u = n[d], m = n[d + 1], h = n[d + 2], y = n[d + 3];
454
+ return e[i] = r * y + c * u + p * h - a * m, e[i + 1] = p * y + c * m + a * u - r * h, e[i + 2] = a * y + c * h + r * m - p * u, e[i + 3] = c * y - r * u - p * m - a * h, e;
455
+ }
456
+ get x() {
457
+ return this._x;
458
+ }
459
+ set x(e) {
460
+ this._x = e, this._onChangeCallback();
461
+ }
462
+ get y() {
463
+ return this._y;
464
+ }
465
+ set y(e) {
466
+ this._y = e, this._onChangeCallback();
467
+ }
468
+ get z() {
469
+ return this._z;
470
+ }
471
+ set z(e) {
472
+ this._z = e, this._onChangeCallback();
473
+ }
474
+ get w() {
475
+ return this._w;
476
+ }
477
+ set w(e) {
478
+ this._w = e, this._onChangeCallback();
479
+ }
480
+ set(e, i, t, o) {
481
+ return this._x = e, this._y = i, this._z = t, this._w = o, this._onChangeCallback(), this;
482
+ }
483
+ clone() {
484
+ return new this.constructor(this._x, this._y, this._z, this._w);
485
+ }
486
+ copy(e) {
487
+ return this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this._onChangeCallback(), this;
488
+ }
489
+ setFromEuler(e, i = !0) {
490
+ const t = e._x, o = e._y, n = e._z, d = e._order, r = Math.cos, p = Math.sin, a = r(t / 2), c = r(o / 2), u = r(n / 2), m = p(t / 2), h = p(o / 2), y = p(n / 2);
491
+ switch (d) {
492
+ case "XYZ":
493
+ this._x = m * c * u + a * h * y, this._y = a * h * u - m * c * y, this._z = a * c * y + m * h * u, this._w = a * c * u - m * h * y;
494
+ break;
495
+ case "YXZ":
496
+ this._x = m * c * u + a * h * y, this._y = a * h * u - m * c * y, this._z = a * c * y - m * h * u, this._w = a * c * u + m * h * y;
497
+ break;
498
+ case "ZXY":
499
+ this._x = m * c * u - a * h * y, this._y = a * h * u + m * c * y, this._z = a * c * y + m * h * u, this._w = a * c * u - m * h * y;
500
+ break;
501
+ case "ZYX":
502
+ this._x = m * c * u - a * h * y, this._y = a * h * u + m * c * y, this._z = a * c * y - m * h * u, this._w = a * c * u + m * h * y;
503
+ break;
504
+ case "YZX":
505
+ this._x = m * c * u + a * h * y, this._y = a * h * u + m * c * y, this._z = a * c * y - m * h * u, this._w = a * c * u - m * h * y;
506
+ break;
507
+ case "XZY":
508
+ this._x = m * c * u - a * h * y, this._y = a * h * u - m * c * y, this._z = a * c * y + m * h * u, this._w = a * c * u + m * h * y;
509
+ break;
510
+ default:
511
+ console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + d);
512
+ }
513
+ return i === !0 && this._onChangeCallback(), this;
514
+ }
515
+ setFromAxisAngle(e, i) {
516
+ const t = i / 2, o = Math.sin(t);
517
+ return this._x = e.x * o, this._y = e.y * o, this._z = e.z * o, this._w = Math.cos(t), this._onChangeCallback(), this;
518
+ }
519
+ setFromRotationMatrix(e) {
520
+ const i = e.elements, t = i[0], o = i[4], n = i[8], d = i[1], r = i[5], p = i[9], a = i[2], c = i[6], u = i[10], m = t + r + u;
521
+ if (m > 0) {
522
+ const h = 0.5 / Math.sqrt(m + 1);
523
+ this._w = 0.25 / h, this._x = (c - p) * h, this._y = (n - a) * h, this._z = (d - o) * h;
524
+ } else if (t > r && t > u) {
525
+ const h = 2 * Math.sqrt(1 + t - r - u);
526
+ this._w = (c - p) / h, this._x = 0.25 * h, this._y = (o + d) / h, this._z = (n + a) / h;
527
+ } else if (r > u) {
528
+ const h = 2 * Math.sqrt(1 + r - t - u);
529
+ this._w = (n - a) / h, this._x = (o + d) / h, this._y = 0.25 * h, this._z = (p + c) / h;
530
+ } else {
531
+ const h = 2 * Math.sqrt(1 + u - t - r);
532
+ this._w = (d - o) / h, this._x = (n + a) / h, this._y = (p + c) / h, this._z = 0.25 * h;
533
+ }
534
+ return this._onChangeCallback(), this;
535
+ }
536
+ setFromUnitVectors(e, i) {
537
+ let t = e.dot(i) + 1;
538
+ return t < Number.EPSILON ? (t = 0, Math.abs(e.x) > Math.abs(e.z) ? (this._x = -e.y, this._y = e.x, this._z = 0, this._w = t) : (this._x = 0, this._y = -e.z, this._z = e.y, this._w = t)) : (this._x = e.y * i.z - e.z * i.y, this._y = e.z * i.x - e.x * i.z, this._z = e.x * i.y - e.y * i.x, this._w = t), this.normalize();
539
+ }
540
+ angleTo(e) {
541
+ return 2 * Math.acos(Math.abs(Nt(this.dot(e), -1, 1)));
542
+ }
543
+ rotateTowards(e, i) {
544
+ const t = this.angleTo(e);
545
+ if (t === 0) return this;
546
+ const o = Math.min(1, i / t);
547
+ return this.slerp(e, o), this;
548
+ }
549
+ identity() {
550
+ return this.set(0, 0, 0, 1);
551
+ }
552
+ invert() {
553
+ return this.conjugate();
554
+ }
555
+ conjugate() {
556
+ return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;
557
+ }
558
+ dot(e) {
559
+ return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w;
560
+ }
561
+ lengthSq() {
562
+ return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
563
+ }
564
+ length() {
565
+ return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
566
+ }
567
+ normalize() {
568
+ let e = this.length();
569
+ return e === 0 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (e = 1 / e, this._x = this._x * e, this._y = this._y * e, this._z = this._z * e, this._w = this._w * e), this._onChangeCallback(), this;
570
+ }
571
+ multiply(e) {
572
+ return this.multiplyQuaternions(this, e);
573
+ }
574
+ premultiply(e) {
575
+ return this.multiplyQuaternions(e, this);
576
+ }
577
+ multiplyQuaternions(e, i) {
578
+ const t = e._x, o = e._y, n = e._z, d = e._w, r = i._x, p = i._y, a = i._z, c = i._w;
579
+ return this._x = t * c + d * r + o * a - n * p, this._y = o * c + d * p + n * r - t * a, this._z = n * c + d * a + t * p - o * r, this._w = d * c - t * r - o * p - n * a, this._onChangeCallback(), this;
580
+ }
581
+ slerp(e, i) {
582
+ if (i === 0) return this;
583
+ if (i === 1) return this.copy(e);
584
+ const t = this._x, o = this._y, n = this._z, d = this._w;
585
+ let r = d * e._w + t * e._x + o * e._y + n * e._z;
586
+ if (r < 0 ? (this._w = -e._w, this._x = -e._x, this._y = -e._y, this._z = -e._z, r = -r) : this.copy(e), r >= 1)
587
+ return this._w = d, this._x = t, this._y = o, this._z = n, this;
588
+ const p = 1 - r * r;
589
+ if (p <= Number.EPSILON) {
590
+ const h = 1 - i;
591
+ return this._w = h * d + i * this._w, this._x = h * t + i * this._x, this._y = h * o + i * this._y, this._z = h * n + i * this._z, this.normalize(), this;
592
+ }
593
+ const a = Math.sqrt(p), c = Math.atan2(a, r), u = Math.sin((1 - i) * c) / a, m = Math.sin(i * c) / a;
594
+ return this._w = d * u + this._w * m, this._x = t * u + this._x * m, this._y = o * u + this._y * m, this._z = n * u + this._z * m, this._onChangeCallback(), this;
595
+ }
596
+ slerpQuaternions(e, i, t) {
597
+ return this.copy(e).slerp(i, t);
598
+ }
599
+ random() {
600
+ const e = 2 * Math.PI * Math.random(), i = 2 * Math.PI * Math.random(), t = Math.random(), o = Math.sqrt(1 - t), n = Math.sqrt(t);
601
+ return this.set(
602
+ o * Math.sin(e),
603
+ o * Math.cos(e),
604
+ n * Math.sin(i),
605
+ n * Math.cos(i)
606
+ );
607
+ }
608
+ equals(e) {
609
+ return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w;
610
+ }
611
+ fromArray(e, i = 0) {
612
+ return this._x = e[i], this._y = e[i + 1], this._z = e[i + 2], this._w = e[i + 3], this._onChangeCallback(), this;
613
+ }
614
+ toArray(e = [], i = 0) {
615
+ return e[i] = this._x, e[i + 1] = this._y, e[i + 2] = this._z, e[i + 3] = this._w, e;
616
+ }
617
+ fromBufferAttribute(e, i) {
618
+ return this._x = e.getX(i), this._y = e.getY(i), this._z = e.getZ(i), this._w = e.getW(i), this._onChangeCallback(), this;
619
+ }
620
+ toJSON() {
621
+ return this.toArray();
622
+ }
623
+ _onChange(e) {
624
+ return this._onChangeCallback = e, this;
625
+ }
626
+ _onChangeCallback() {
627
+ }
628
+ *[Symbol.iterator]() {
629
+ yield this._x, yield this._y, yield this._z, yield this._w;
630
+ }
631
+ }
632
+ class J {
633
+ constructor(e = 0, i = 0, t = 0) {
634
+ J.prototype.isVector3 = !0, this.x = e, this.y = i, this.z = t;
635
+ }
636
+ set(e, i, t) {
637
+ return t === void 0 && (t = this.z), this.x = e, this.y = i, this.z = t, this;
638
+ }
639
+ setScalar(e) {
640
+ return this.x = e, this.y = e, this.z = e, this;
641
+ }
642
+ setX(e) {
643
+ return this.x = e, this;
644
+ }
645
+ setY(e) {
646
+ return this.y = e, this;
647
+ }
648
+ setZ(e) {
649
+ return this.z = e, this;
650
+ }
651
+ setComponent(e, i) {
652
+ switch (e) {
653
+ case 0:
654
+ this.x = i;
655
+ break;
656
+ case 1:
657
+ this.y = i;
658
+ break;
659
+ case 2:
660
+ this.z = i;
661
+ break;
662
+ default:
663
+ throw new Error("index is out of range: " + e);
664
+ }
665
+ return this;
666
+ }
667
+ getComponent(e) {
668
+ switch (e) {
669
+ case 0:
670
+ return this.x;
671
+ case 1:
672
+ return this.y;
673
+ case 2:
674
+ return this.z;
675
+ default:
676
+ throw new Error("index is out of range: " + e);
677
+ }
678
+ }
679
+ clone() {
680
+ return new this.constructor(this.x, this.y, this.z);
681
+ }
682
+ copy(e) {
683
+ return this.x = e.x, this.y = e.y, this.z = e.z, this;
684
+ }
685
+ add(e) {
686
+ return this.x += e.x, this.y += e.y, this.z += e.z, this;
687
+ }
688
+ addScalar(e) {
689
+ return this.x += e, this.y += e, this.z += e, this;
690
+ }
691
+ addVectors(e, i) {
692
+ return this.x = e.x + i.x, this.y = e.y + i.y, this.z = e.z + i.z, this;
693
+ }
694
+ addScaledVector(e, i) {
695
+ return this.x += e.x * i, this.y += e.y * i, this.z += e.z * i, this;
696
+ }
697
+ sub(e) {
698
+ return this.x -= e.x, this.y -= e.y, this.z -= e.z, this;
699
+ }
700
+ subScalar(e) {
701
+ return this.x -= e, this.y -= e, this.z -= e, this;
702
+ }
703
+ subVectors(e, i) {
704
+ return this.x = e.x - i.x, this.y = e.y - i.y, this.z = e.z - i.z, this;
705
+ }
706
+ multiply(e) {
707
+ return this.x *= e.x, this.y *= e.y, this.z *= e.z, this;
708
+ }
709
+ multiplyScalar(e) {
710
+ return this.x *= e, this.y *= e, this.z *= e, this;
711
+ }
712
+ multiplyVectors(e, i) {
713
+ return this.x = e.x * i.x, this.y = e.y * i.y, this.z = e.z * i.z, this;
714
+ }
715
+ applyEuler(e) {
716
+ return this.applyQuaternion(Ot.setFromEuler(e));
717
+ }
718
+ applyAxisAngle(e, i) {
719
+ return this.applyQuaternion(Ot.setFromAxisAngle(e, i));
720
+ }
721
+ applyMatrix3(e) {
722
+ const i = this.x, t = this.y, o = this.z, n = e.elements;
723
+ return this.x = n[0] * i + n[3] * t + n[6] * o, this.y = n[1] * i + n[4] * t + n[7] * o, this.z = n[2] * i + n[5] * t + n[8] * o, this;
724
+ }
725
+ applyNormalMatrix(e) {
726
+ return this.applyMatrix3(e).normalize();
727
+ }
728
+ applyMatrix4(e) {
729
+ const i = this.x, t = this.y, o = this.z, n = e.elements, d = 1 / (n[3] * i + n[7] * t + n[11] * o + n[15]);
730
+ return this.x = (n[0] * i + n[4] * t + n[8] * o + n[12]) * d, this.y = (n[1] * i + n[5] * t + n[9] * o + n[13]) * d, this.z = (n[2] * i + n[6] * t + n[10] * o + n[14]) * d, this;
731
+ }
732
+ applyQuaternion(e) {
733
+ const i = this.x, t = this.y, o = this.z, n = e.x, d = e.y, r = e.z, p = e.w, a = 2 * (d * o - r * t), c = 2 * (r * i - n * o), u = 2 * (n * t - d * i);
734
+ return this.x = i + p * a + d * u - r * c, this.y = t + p * c + r * a - n * u, this.z = o + p * u + n * c - d * a, this;
735
+ }
736
+ project(e) {
737
+ return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix);
738
+ }
739
+ unproject(e) {
740
+ return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld);
741
+ }
742
+ transformDirection(e) {
743
+ const i = this.x, t = this.y, o = this.z, n = e.elements;
744
+ return this.x = n[0] * i + n[4] * t + n[8] * o, this.y = n[1] * i + n[5] * t + n[9] * o, this.z = n[2] * i + n[6] * t + n[10] * o, this.normalize();
745
+ }
746
+ divide(e) {
747
+ return this.x /= e.x, this.y /= e.y, this.z /= e.z, this;
748
+ }
749
+ divideScalar(e) {
750
+ return this.multiplyScalar(1 / e);
751
+ }
752
+ min(e) {
753
+ return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this;
754
+ }
755
+ max(e) {
756
+ return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this;
757
+ }
758
+ clamp(e, i) {
759
+ return this.x = Math.max(e.x, Math.min(i.x, this.x)), this.y = Math.max(e.y, Math.min(i.y, this.y)), this.z = Math.max(e.z, Math.min(i.z, this.z)), this;
760
+ }
761
+ clampScalar(e, i) {
762
+ return this.x = Math.max(e, Math.min(i, this.x)), this.y = Math.max(e, Math.min(i, this.y)), this.z = Math.max(e, Math.min(i, this.z)), this;
763
+ }
764
+ clampLength(e, i) {
765
+ const t = this.length();
766
+ return this.divideScalar(t || 1).multiplyScalar(Math.max(e, Math.min(i, t)));
767
+ }
768
+ floor() {
769
+ return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
770
+ }
771
+ ceil() {
772
+ return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;
773
+ }
774
+ round() {
775
+ return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;
776
+ }
777
+ roundToZero() {
778
+ return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;
779
+ }
780
+ negate() {
781
+ return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;
782
+ }
783
+ dot(e) {
784
+ return this.x * e.x + this.y * e.y + this.z * e.z;
785
+ }
786
+ // TODO lengthSquared?
787
+ lengthSq() {
788
+ return this.x * this.x + this.y * this.y + this.z * this.z;
789
+ }
790
+ length() {
791
+ return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
792
+ }
793
+ manhattanLength() {
794
+ return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
795
+ }
796
+ normalize() {
797
+ return this.divideScalar(this.length() || 1);
798
+ }
799
+ setLength(e) {
800
+ return this.normalize().multiplyScalar(e);
801
+ }
802
+ lerp(e, i) {
803
+ return this.x += (e.x - this.x) * i, this.y += (e.y - this.y) * i, this.z += (e.z - this.z) * i, this;
804
+ }
805
+ lerpVectors(e, i, t) {
806
+ return this.x = e.x + (i.x - e.x) * t, this.y = e.y + (i.y - e.y) * t, this.z = e.z + (i.z - e.z) * t, this;
807
+ }
808
+ cross(e) {
809
+ return this.crossVectors(this, e);
810
+ }
811
+ crossVectors(e, i) {
812
+ const t = e.x, o = e.y, n = e.z, d = i.x, r = i.y, p = i.z;
813
+ return this.x = o * p - n * r, this.y = n * d - t * p, this.z = t * r - o * d, this;
814
+ }
815
+ projectOnVector(e) {
816
+ const i = e.lengthSq();
817
+ if (i === 0) return this.set(0, 0, 0);
818
+ const t = e.dot(this) / i;
819
+ return this.copy(e).multiplyScalar(t);
820
+ }
821
+ projectOnPlane(e) {
822
+ return at.copy(this).projectOnVector(e), this.sub(at);
823
+ }
824
+ reflect(e) {
825
+ return this.sub(at.copy(e).multiplyScalar(2 * this.dot(e)));
826
+ }
827
+ angleTo(e) {
828
+ const i = Math.sqrt(this.lengthSq() * e.lengthSq());
829
+ if (i === 0) return Math.PI / 2;
830
+ const t = this.dot(e) / i;
831
+ return Math.acos(Nt(t, -1, 1));
832
+ }
833
+ distanceTo(e) {
834
+ return Math.sqrt(this.distanceToSquared(e));
835
+ }
836
+ distanceToSquared(e) {
837
+ const i = this.x - e.x, t = this.y - e.y, o = this.z - e.z;
838
+ return i * i + t * t + o * o;
839
+ }
840
+ manhattanDistanceTo(e) {
841
+ return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z);
842
+ }
843
+ setFromSpherical(e) {
844
+ return this.setFromSphericalCoords(e.radius, e.phi, e.theta);
845
+ }
846
+ setFromSphericalCoords(e, i, t) {
847
+ const o = Math.sin(i) * e;
848
+ return this.x = o * Math.sin(t), this.y = Math.cos(i) * e, this.z = o * Math.cos(t), this;
849
+ }
850
+ setFromCylindrical(e) {
851
+ return this.setFromCylindricalCoords(e.radius, e.theta, e.y);
852
+ }
853
+ setFromCylindricalCoords(e, i, t) {
854
+ return this.x = e * Math.sin(i), this.y = t, this.z = e * Math.cos(i), this;
855
+ }
856
+ setFromMatrixPosition(e) {
857
+ const i = e.elements;
858
+ return this.x = i[12], this.y = i[13], this.z = i[14], this;
859
+ }
860
+ setFromMatrixScale(e) {
861
+ const i = this.setFromMatrixColumn(e, 0).length(), t = this.setFromMatrixColumn(e, 1).length(), o = this.setFromMatrixColumn(e, 2).length();
862
+ return this.x = i, this.y = t, this.z = o, this;
863
+ }
864
+ setFromMatrixColumn(e, i) {
865
+ return this.fromArray(e.elements, i * 4);
866
+ }
867
+ setFromMatrix3Column(e, i) {
868
+ return this.fromArray(e.elements, i * 3);
869
+ }
870
+ setFromEuler(e) {
871
+ return this.x = e._x, this.y = e._y, this.z = e._z, this;
872
+ }
873
+ setFromColor(e) {
874
+ return this.x = e.r, this.y = e.g, this.z = e.b, this;
875
+ }
876
+ equals(e) {
877
+ return e.x === this.x && e.y === this.y && e.z === this.z;
878
+ }
879
+ fromArray(e, i = 0) {
880
+ return this.x = e[i], this.y = e[i + 1], this.z = e[i + 2], this;
881
+ }
882
+ toArray(e = [], i = 0) {
883
+ return e[i] = this.x, e[i + 1] = this.y, e[i + 2] = this.z, e;
884
+ }
885
+ fromBufferAttribute(e, i) {
886
+ return this.x = e.getX(i), this.y = e.getY(i), this.z = e.getZ(i), this;
887
+ }
888
+ random() {
889
+ return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
890
+ }
891
+ randomDirection() {
892
+ const e = Math.random() * Math.PI * 2, i = Math.random() * 2 - 1, t = Math.sqrt(1 - i * i);
893
+ return this.x = t * Math.cos(e), this.y = i, this.z = t * Math.sin(e), this;
894
+ }
895
+ *[Symbol.iterator]() {
896
+ yield this.x, yield this.y, yield this.z;
897
+ }
898
+ }
899
+ const at = /* @__PURE__ */ new J(), Ot = /* @__PURE__ */ new _e();
900
+ class fe extends he {
901
+ constructor() {
902
+ super();
903
+ z(this, "isSelectable", !0);
904
+ z(this, "isMovable", !0);
905
+ z(this, "isDIVENode", !0);
906
+ z(this, "gizmo", null);
907
+ z(this, "_positionWorldBuffer");
908
+ z(this, "_boundingBox");
909
+ this.layers.mask = de, this._positionWorldBuffer = new b(), this._boundingBox = new Rt();
910
+ }
911
+ setPosition(i) {
912
+ if (!this.parent) {
913
+ this.position.set(i.x, i.y, i.z);
914
+ return;
915
+ }
916
+ const t = new b(i.x, i.y, i.z);
917
+ this.position.copy(this.parent.worldToLocal(t)), "isDIVEGroup" in this.parent && this.parent.updateLineTo(this);
918
+ }
919
+ setRotation(i) {
920
+ this.rotation.set(i.x, i.y, i.z);
921
+ }
922
+ setScale(i) {
923
+ this.scale.set(i.x, i.y, i.z);
924
+ }
925
+ setVisibility(i) {
926
+ this.visible = i;
927
+ }
928
+ setToWorldOrigin() {
929
+ this.position.set(0, 0, 0), import("../plugins/state/index.mjs").then(({ State: i }) => {
930
+ var t;
931
+ (t = i.get(this.userData.id)) == null || t.performAction("UPDATE_OBJECT", {
932
+ id: this.userData.id,
933
+ position: this.getWorldPosition(this._positionWorldBuffer),
934
+ rotation: this.rotation,
935
+ scale: this.scale
936
+ });
937
+ });
938
+ }
939
+ /**
940
+ * Can be called when the object is moved from a foreign object (gizmo, parent, etc.) to update the object's position.
941
+ */
942
+ onMove() {
943
+ import("../plugins/state/index.mjs").then(({ State: i }) => {
944
+ var t;
945
+ (t = i.get(this.userData.id)) == null || t.performAction("UPDATE_OBJECT", {
946
+ id: this.userData.id,
947
+ position: this.getWorldPosition(this._positionWorldBuffer),
948
+ rotation: this.rotation,
949
+ scale: this.scale
950
+ });
951
+ });
952
+ }
953
+ onSelect() {
954
+ import("../plugins/state/index.mjs").then(({ State: i }) => {
955
+ var t;
956
+ (t = i.get(this.userData.id)) == null || t.performAction("SELECT_OBJECT", {
957
+ id: this.userData.id
958
+ });
959
+ });
960
+ }
961
+ onDeselect() {
962
+ import("../plugins/state/index.mjs").then(({ State: i }) => {
963
+ var t;
964
+ (t = i.get(this.userData.id)) == null || t.performAction("DESELECT_OBJECT", {
965
+ id: this.userData.id
966
+ });
967
+ });
968
+ }
969
+ }
970
+ class ge extends fe {
971
+ /**
972
+ * Creates a new BoundingBox instance for the specified 3D object.
973
+ *
974
+ * The constructor computes both a bounding box and bounding sphere for the given object.
975
+ * It handles complex objects with multiple meshes and nested transformations.
976
+ *
977
+ * @param object - The 3D object to compute bounding volumes for
978
+ * @param axisAligned - Whether to create an axis-aligned bounding box (true) or oriented bounding box (false). Defaults to false.
979
+ * @param wireframeColor - The color for the wireframe helpers. Can be a hex number or ColorRepresentation. Defaults to green (0x00ff00).
980
+ *
981
+ * @example
982
+ * ```typescript
983
+ * // Create an oriented bounding box (aligned with object's rotation)
984
+ * const obb = new BoundingBox(mesh, false, 0x00ff00);
985
+ *
986
+ * // Create an axis-aligned bounding box (aligned with world coordinates)
987
+ * const aabb = new BoundingBox(mesh, true, 0xff0000);
988
+ *
989
+ * // Use default green color
990
+ * const defaultBox = new BoundingBox(mesh);
991
+ * ```
992
+ */
993
+ constructor(i, t = !1, o = 65280) {
994
+ super();
995
+ /** The computed bounding box (Box3) */
996
+ z(this, "_box");
997
+ /** The computed bounding sphere (Sphere) */
998
+ z(this, "_sphere");
999
+ /** The center point of the bounding box */
1000
+ z(this, "_center");
1001
+ /** The radius of the bounding sphere */
1002
+ z(this, "_radius");
1003
+ /** Visual helper for the bounding box wireframe */
1004
+ z(this, "_boxHelper");
1005
+ /** Visual helper for the bounding sphere wireframe */
1006
+ z(this, "_sphereHelper");
1007
+ /** The dimensions (width, height, depth) of the bounding box */
1008
+ z(this, "_size");
1009
+ const n = new Rt();
1010
+ t ? n.setFromObject(i) : (i.updateWorldMatrix(!0, !0), i.traverse((r) => {
1011
+ if (r.isMesh) {
1012
+ const p = r, a = p.geometry.clone();
1013
+ a.applyMatrix4(p.matrixWorld);
1014
+ const c = p.getWorldQuaternion(new ht()).invert();
1015
+ a.applyQuaternion(c), a.computeBoundingBox(), a.boundingBox && n.union(a.boundingBox);
1016
+ }
1017
+ })), this.rotation.copy(i.rotation), this._box = n, this._size = n.getSize(new b()), this._center = n.getCenter(new b()), this._boxHelper = new ce(this._box, o), this._boxHelper.visible = !1, this.add(this._boxHelper), this._sphere = n.getBoundingSphere(new le()), this._radius = this._sphere.radius;
1018
+ const d = new ue(this._radius, 32, 32);
1019
+ d.translate(this._center.x, this._center.y, this._center.z), this._sphereHelper = new pe(
1020
+ d,
1021
+ new me({ color: o, wireframe: !0 })
1022
+ ), this._sphereHelper.visible = !1, this.add(this._sphereHelper);
1023
+ }
1024
+ /**
1025
+ * Gets the computed bounding box.
1026
+ * @returns The Box3 instance representing the bounding box
1027
+ */
1028
+ get box() {
1029
+ return this._box;
1030
+ }
1031
+ /**
1032
+ * Gets the computed bounding sphere.
1033
+ * @returns The Sphere instance representing the bounding sphere
1034
+ */
1035
+ get sphere() {
1036
+ return this._sphere;
1037
+ }
1038
+ /**
1039
+ * Gets the center point of the bounding box.
1040
+ * @returns A Vector3 representing the center coordinates
1041
+ */
1042
+ get center() {
1043
+ return this._center;
1044
+ }
1045
+ /**
1046
+ * Gets the radius of the bounding sphere.
1047
+ * @returns The radius as a number
1048
+ */
1049
+ get radius() {
1050
+ return this._radius;
1051
+ }
1052
+ /**
1053
+ * Gets the dimensions of the bounding box.
1054
+ * @returns A Vector3 representing width, height, and depth
1055
+ */
1056
+ get size() {
1057
+ return this._size;
1058
+ }
1059
+ /**
1060
+ * Sets the visibility of the bounding box wireframe helper.
1061
+ *
1062
+ * @param visible - Whether the box helper should be visible
1063
+ *
1064
+ * @example
1065
+ * ```typescript
1066
+ * const boundingBox = new BoundingBox(mesh);
1067
+ *
1068
+ * // Show the bounding box wireframe
1069
+ * boundingBox.setBoxHelperVisible(true);
1070
+ *
1071
+ * // Hide the bounding box wireframe
1072
+ * boundingBox.setBoxHelperVisible(false);
1073
+ * ```
1074
+ */
1075
+ setBoxHelperVisible(i) {
1076
+ this._boxHelper.visible = i;
1077
+ }
1078
+ /**
1079
+ * Sets the visibility of the bounding sphere wireframe helper.
1080
+ *
1081
+ * @param visible - Whether the sphere helper should be visible
1082
+ *
1083
+ * @example
1084
+ * ```typescript
1085
+ * const boundingBox = new BoundingBox(mesh);
1086
+ *
1087
+ * // Show the bounding sphere wireframe
1088
+ * boundingBox.setSphereHelperVisible(true);
1089
+ *
1090
+ * // Hide the bounding sphere wireframe
1091
+ * boundingBox.setSphereHelperVisible(false);
1092
+ * ```
1093
+ */
1094
+ setSphereHelperVisible(i) {
1095
+ this._sphereHelper.visible = i;
1096
+ }
1097
+ }
1098
+ const rt = {
1099
+ enableDamping: !0,
1100
+ dampingFactor: 0.05
1101
+ }, V = class V extends xe {
1102
+ constructor(i, t, o = rt) {
1103
+ super(i, t);
1104
+ z(this, "uuid", nt.generateUUID());
1105
+ z(this, "object");
1106
+ this.domElement = t, this.domElement = t, this.object = i, this.enableDamping = o.enableDamping ?? rt.enableDamping, this.dampingFactor = o.dampingFactor ?? rt.dampingFactor, this.object.position.set(0, 2, 2), this.target.copy({ x: 0, y: 0.5, z: 0 }), this.update();
1107
+ }
1108
+ tick() {
1109
+ this.enabled && this.update();
1110
+ }
1111
+ /**
1112
+ * Computes the camera position and target to perfectly fit a bounding sphere into the camera's frustum.
1113
+ * This robust approach ensures the entire object is always visible, regardless of rotation or aspect ratio.
1114
+ *
1115
+ * @param bb - The bounding box to encompass
1116
+ * @param padding - Optional padding factor to add space around the object depending on the object's bounding sphere diameter (default: 0.0 = no padding)
1117
+ * @returns Object containing the calculated camera position and target
1118
+ */
1119
+ computeEncompassingView(i, t = 0) {
1120
+ const o = i.center, d = i.sphere.radius, r = this.object.fov * Math.PI / 180, p = this.object.aspect, a = r / 2, c = Math.atan(Math.tan(a) * p), u = d / Math.sin(a), m = d / Math.sin(c), h = Math.max(u, m) * (1 + t), y = this.object.position.clone().sub(this.target).normalize(), E = y.length() > 1e-3 ? y : new J(0, 0, 1);
1121
+ return {
1122
+ position: o.clone().add(E.multiplyScalar(h)),
1123
+ target: o
1124
+ };
1125
+ }
1126
+ /**
1127
+ * Focus the camera on a specific object by computing its bounding box
1128
+ * @param object - The object to focus on
1129
+ * @param padding - Optional padding factor to add space around the object depending on the object's bounding sphere diameter (default: 0.0 = no padding)
1130
+ */
1131
+ focusOnObject(i, t = 0) {
1132
+ const o = new ge(i, !1, 65280), n = this.computeEncompassingView(o, t);
1133
+ this.object.position.copy(n.position), this.target.copy(n.target), this.update();
1134
+ }
1135
+ zoomIn(i) {
1136
+ const t = i || V.DEFAULT_ZOOM_FACTOR, { minDistance: o, maxDistance: n } = this;
1137
+ this.minDistance = this.maxDistance = nt.clamp(
1138
+ this.getDistance() - t,
1139
+ o + t,
1140
+ n - t
1141
+ ), this.update(), this.minDistance = o, this.maxDistance = n;
1142
+ }
1143
+ zoomOut(i) {
1144
+ const t = i || V.DEFAULT_ZOOM_FACTOR, { minDistance: o, maxDistance: n } = this;
1145
+ this.minDistance = this.maxDistance = nt.clamp(
1146
+ this.getDistance() + t,
1147
+ o + t,
1148
+ n - t
1149
+ ), this.update(), this.minDistance = o, this.maxDistance = n;
1150
+ }
1151
+ };
1152
+ z(V, "DEFAULT_ZOOM_FACTOR", 1);
1153
+ let Lt = V;
1154
+ export {
1155
+ ge as B,
1156
+ fe as D,
1157
+ rt as O,
1158
+ Lt as a
1159
+ };