@realsee/five 6.8.0-alpha.2 → 6.8.0-alpha.21

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 (715) hide show
  1. package/AGENTS_READ_ME.md +4 -0
  2. package/AI_CONTEXT.md +4 -0
  3. package/README.md +9 -6
  4. package/{guides → ai_guides}/README.md +12 -2
  5. package/ai_guides/ai-doc-guidelines.md +102 -0
  6. package/{guides → ai_guides}/api.md +24 -1
  7. package/ai_guides/features/3dtile.md +172 -0
  8. package/{guides → ai_guides}/features/camera-animation.md +24 -3
  9. package/{guides → ai_guides}/features/clipper.md +2 -0
  10. package/{guides/features/coordnate-system.md → ai_guides/features/coordinate-system.md} +2 -0
  11. package/{guides → ai_guides}/features/event.md +2 -0
  12. package/{guides → ai_guides}/features/five.md +4 -0
  13. package/ai_guides/features/flowing-light-2d-pass.md +438 -0
  14. package/ai_guides/features/flowing-light-3d-pass.md +420 -0
  15. package/ai_guides/features/gaussian-blur-pass.md +202 -0
  16. package/{guides → ai_guides}/features/gesture.md +3 -0
  17. package/{guides → ai_guides}/features/get-screen-pixels.md +2 -0
  18. package/{guides → ai_guides}/features/image-options.md +3 -0
  19. package/{guides → ai_guides}/features/load-external-model.md +21 -0
  20. package/ai_guides/features/load-progress.md +140 -0
  21. package/ai_guides/features/material.md +153 -0
  22. package/{guides → ai_guides}/features/mode.md +4 -0
  23. package/{guides → ai_guides}/features/model.md +4 -1
  24. package/{guides → ai_guides}/features/move-pano-effect.md +2 -0
  25. package/{guides → ai_guides}/features/multi-work.md +2 -0
  26. package/ai_guides/features/pano-filter.md +148 -0
  27. package/{guides → ai_guides}/features/pano-tile.md +7 -14
  28. package/ai_guides/features/pano-uv.md +131 -0
  29. package/ai_guides/features/parameter.md +153 -0
  30. package/ai_guides/features/plugin.md +210 -0
  31. package/{guides → ai_guides}/features/postprocessing.md +39 -4
  32. package/{guides → ai_guides}/features/raycast.md +11 -0
  33. package/{guides → ai_guides}/features/request-proxy.md +2 -0
  34. package/{guides → ai_guides}/features/screen-project.md +2 -0
  35. package/{guides → ai_guides}/features/state.md +2 -0
  36. package/ai_guides/features/view-layer.md +187 -0
  37. package/{guides → ai_guides}/features/work.md +63 -2
  38. package/{guides → ai_guides}/glossary.md +26 -5
  39. package/{guides → ai_guides}/intro.md +1 -1
  40. package/{guides → ai_guides}/quick-start.md +1 -0
  41. package/ai_guides/release_notes/6.8.md +208 -0
  42. package/{guides → ai_guides}/template.md +17 -3
  43. package/docs/00_FOR_AI_AGENTS.md +11 -0
  44. package/docs/README.md +4 -7
  45. package/docs/assets/hierarchy.js +1 -1
  46. package/docs/assets/navigation.js +1 -1
  47. package/docs/assets/search.js +1 -1
  48. package/docs/classes/five.AdaptiveLuminancePass.html +7 -6
  49. package/docs/classes/five.BoundingMesh.html +2 -2
  50. package/docs/classes/five.Camera.html +1 -1
  51. package/docs/classes/five.EyeDomeLightingPass.html +1 -1
  52. package/docs/classes/five.Five.html +73 -72
  53. package/docs/classes/five.FivePass.html +1 -1
  54. package/docs/classes/five.Histogram.html +19 -0
  55. package/docs/classes/five.InternalWebGLRenderer.html +1 -1
  56. package/docs/classes/five.Model.html +31 -31
  57. package/docs/classes/five.ModelScene.html +1 -1
  58. package/docs/classes/five.NetworkSubscribe.html +1 -1
  59. package/docs/classes/five.PBMContainer.html +1 -1
  60. package/docs/classes/five.PBMCustomShader.html +42 -3
  61. package/docs/classes/five.PBMGSObject.html +5 -3
  62. package/docs/classes/five.PBMGroup.html +1 -1
  63. package/docs/classes/five.PBMMesh.html +1 -1
  64. package/docs/classes/five.PBMMeshMaterial.html +16 -7
  65. package/docs/classes/five.PBMPanoFilter.html +61 -0
  66. package/docs/classes/five.PBMPointCloud.html +1 -1
  67. package/docs/classes/five.PBMPointCloudMaterial.html +5 -6
  68. package/docs/classes/five.PBMSkinnedMesh.html +1 -1
  69. package/docs/classes/five.PBMUpdateable.html +41 -0
  70. package/docs/classes/five.PanoCircleMesh.html +1 -1
  71. package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
  72. package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
  73. package/docs/classes/five.Parameter.html +57 -53
  74. package/docs/classes/five.Scene.html +1 -1
  75. package/docs/classes/five.Subscribe.html +1 -1
  76. package/docs/classes/five.Tile.html +1 -1
  77. package/docs/classes/five.Tile3D.html +30 -26
  78. package/docs/classes/five.TileNode.html +1 -1
  79. package/docs/classes/five.Trajectory.html +1 -1
  80. package/docs/classes/five.TrajectoryNode.html +1 -1
  81. package/docs/classes/five.Work.html +16 -16
  82. package/docs/classes/five.WorkResolvedObserver.html +27 -2
  83. package/docs/classes/gltf-loader.DDSLoader.html +1 -1
  84. package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
  85. package/docs/classes/gltf-loader.GLTFLoader.html +1 -1
  86. package/docs/classes/gltf-loader.GLTFObject.html +1 -1
  87. package/docs/classes/gltf-loader.GLTFParser.html +1 -1
  88. package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
  89. package/docs/classes/line.Line.html +1 -1
  90. package/docs/classes/line.LineGeometry.html +1 -1
  91. package/docs/classes/line.LineMaterial.html +1 -1
  92. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  93. package/docs/classes/line.THREE_Line2.html +1 -1
  94. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  95. package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
  96. package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
  97. package/docs/classes/sticker.Sticker.html +1 -1
  98. package/docs/classes/vfx.Airflow.html +1 -1
  99. package/docs/classes/vfx.Flame.html +1 -1
  100. package/docs/classes/vfx.Particle.html +1 -1
  101. package/docs/classes/vfx.ParticleGPU.html +1 -1
  102. package/docs/classes/vfx.SpotLight.html +1 -1
  103. package/docs/documents/README.html +11 -2
  104. package/docs/documents/ai-doc-guidelines.html +60 -15
  105. package/docs/documents/api.html +40 -15
  106. package/docs/documents/features_3dtile.html +142 -45
  107. package/docs/documents/features_camera-animation.html +62 -5
  108. package/docs/documents/features_clipper.html +3 -0
  109. package/docs/documents/{features_coordnate-system.html → features_coordinate-system.html} +4 -1
  110. package/docs/documents/features_event.html +3 -0
  111. package/docs/documents/features_five.html +4 -0
  112. package/docs/documents/features_flowing-light-2d-pass.html +356 -0
  113. package/docs/documents/features_flowing-light-3d-pass.html +351 -0
  114. package/docs/documents/features_gaussian-blur-pass.html +182 -0
  115. package/docs/documents/features_gesture.html +4 -0
  116. package/docs/documents/features_get-screen-pixels.html +3 -0
  117. package/docs/documents/features_image-options.html +3 -0
  118. package/docs/documents/features_load-external-model.html +25 -2
  119. package/docs/documents/features_load-progress.html +110 -0
  120. package/docs/documents/features_material.html +341 -0
  121. package/docs/documents/features_mode.html +5 -0
  122. package/docs/documents/features_model.html +5 -1
  123. package/docs/documents/features_move-pano-effect.html +3 -0
  124. package/docs/documents/features_multi-work.html +3 -0
  125. package/docs/documents/features_pano-filter.html +122 -0
  126. package/docs/documents/features_pano-tile.html +34 -19
  127. package/docs/documents/features_pano-uv.html +82 -0
  128. package/docs/documents/features_parameter.html +76 -56
  129. package/docs/documents/features_plugin.html +105 -0
  130. package/docs/documents/features_postprocessing.html +22 -5
  131. package/docs/documents/features_raycast.html +4 -1
  132. package/docs/documents/features_request-proxy.html +3 -0
  133. package/docs/documents/features_screen-project.html +3 -0
  134. package/docs/documents/features_state.html +3 -0
  135. package/docs/documents/features_view-layer.html +158 -0
  136. package/docs/documents/features_work.html +63 -2
  137. package/docs/documents/glossary.html +31 -6
  138. package/docs/documents/intro.html +1 -1
  139. package/docs/documents/quick-start.html +1 -0
  140. package/docs/documents/release_notes_6.8.html +189 -0
  141. package/docs/documents/template.html +45 -4
  142. package/docs/functions/five.loadAt3d.html +1 -1
  143. package/docs/functions/five.loadB3dm.html +1 -1
  144. package/docs/functions/five.loadDome.html +1 -1
  145. package/docs/functions/five.loadDomez.html +1 -1
  146. package/docs/functions/five.loadFbx.html +1 -1
  147. package/docs/functions/five.loadGltf.html +1 -1
  148. package/docs/functions/five.loadPbm.html +1 -1
  149. package/docs/functions/five.loadPly.html +1 -1
  150. package/docs/functions/five.loadPnts.html +1 -1
  151. package/docs/functions/five.loadSplat.html +1 -1
  152. package/docs/functions/five.loadSpz.html +1 -1
  153. package/docs/functions/five.loadX3p.html +1 -1
  154. package/docs/functions/five.parseWork.html +1 -1
  155. package/docs/functions/vue.useFiveWorks.html +2 -2
  156. package/docs/hierarchy.html +1 -1
  157. package/docs/index.html +11 -2
  158. package/docs/interfaces/five.AddableObject.html +1 -1
  159. package/docs/interfaces/five.AjaxOptions.html +1 -1
  160. package/docs/interfaces/five.BaseEvent.html +2 -2
  161. package/docs/interfaces/five.EventCallback.html +53 -47
  162. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +9 -9
  163. package/docs/interfaces/five.GestureEvent.html +2 -2
  164. package/docs/interfaces/five.ImageOptions.html +1 -1
  165. package/docs/interfaces/five.IntersectEvent.html +2 -2
  166. package/docs/interfaces/five.IntersectMesh.html +1 -1
  167. package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
  168. package/docs/interfaces/five.Intersection.html +4 -3
  169. package/docs/interfaces/five.LooseWorkWithExtrinsics.html +6 -6
  170. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +9 -9
  171. package/docs/interfaces/five.ModeChangeEvent.html +2 -2
  172. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
  173. package/docs/interfaces/five.ModelEvent.html +2 -2
  174. package/docs/interfaces/five.ModelSceneEvent.html +2 -2
  175. package/docs/interfaces/five.ModelTileEvent.html +8 -0
  176. package/docs/interfaces/five.MovePanoOptions.html +7 -7
  177. package/docs/interfaces/five.NetworkAbortError.html +1 -1
  178. package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
  179. package/docs/interfaces/five.NetworkOptions.html +1 -1
  180. package/docs/interfaces/five.NetworkProxyError.html +1 -1
  181. package/docs/interfaces/five.NetworkResourceEvent.html +2 -2
  182. package/docs/interfaces/five.NetworkResponseError.html +1 -1
  183. package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
  184. package/docs/interfaces/five.ObjectEvent.html +2 -2
  185. package/docs/interfaces/five.PBMClipperParameter.html +2 -2
  186. package/docs/interfaces/five.PBMCustomShaderInitArgs.html +2 -2
  187. package/docs/interfaces/five.PBMCustomShaderSlots.html +2 -2
  188. package/docs/interfaces/five.PBMMaterial.html +1 -1
  189. package/docs/interfaces/five.PBMMeshMaterialParameters.html +5 -3
  190. package/docs/interfaces/five.PBMPanoDepth.html +5 -5
  191. package/docs/interfaces/five.PBMPanoFilterValue.html +6 -0
  192. package/docs/interfaces/five.PBMPanoPicture.html +8 -6
  193. package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +2 -3
  194. package/docs/interfaces/five.PBMRefinedScreen.html +2 -2
  195. package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
  196. package/docs/interfaces/five.PanoEvent.html +2 -2
  197. package/docs/interfaces/five.PanoTextureEvent.html +2 -2
  198. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
  199. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
  200. package/docs/interfaces/five.ParameterMaterialValue.html +42 -38
  201. package/docs/interfaces/five.ParameterTilesetValue.html +15 -15
  202. package/docs/interfaces/five.ParameterValue.html +56 -52
  203. package/docs/interfaces/five.Pose.html +1 -1
  204. package/docs/interfaces/five.RenderEvent.html +2 -2
  205. package/docs/interfaces/five.ResolvedParameterValue.html +56 -52
  206. package/docs/interfaces/five.RgbaData.html +7 -0
  207. package/docs/interfaces/five.SplatData.html +2 -2
  208. package/docs/interfaces/five.State.html +1 -1
  209. package/docs/interfaces/five.StateEvent.html +2 -2
  210. package/docs/interfaces/five.TextureOptions.html +1 -1
  211. package/docs/interfaces/five.Tile3DOptions.html +2 -2
  212. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -7
  213. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
  214. package/docs/interfaces/five.ViewLayer.html +30 -26
  215. package/docs/interfaces/five.WorkCubeImage.html +1 -1
  216. package/docs/interfaces/five.WorkImage.html +1 -1
  217. package/docs/interfaces/five.WorkModel.html +8 -8
  218. package/docs/interfaces/five.WorkModelLayer.html +6 -6
  219. package/docs/interfaces/five.WorkObserver.html +27 -2
  220. package/docs/interfaces/five.WorkTile.html +1 -1
  221. package/docs/interfaces/five.WorksEvent.html +2 -2
  222. package/docs/interfaces/five.XRControllerEvent.html +2 -2
  223. package/docs/interfaces/five.XRGestureEvent.html +2 -2
  224. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
  225. package/docs/interfaces/five.XRSessionEvent.html +2 -2
  226. package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
  227. package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
  228. package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
  229. package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
  230. package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
  231. package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
  232. package/docs/interfaces/plugins.ItemMaskController.html +1 -1
  233. package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
  234. package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
  235. package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
  236. package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
  237. package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
  238. package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
  239. package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
  240. package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
  241. package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
  242. package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
  243. package/docs/interfaces/plugins.TrajectoryController.html +1 -1
  244. package/docs/interfaces/react.FiveInjectionTypes.html +13 -13
  245. package/docs/modules/five.html +1 -1
  246. package/docs/modules.html +1 -1
  247. package/docs/types/five.ControllerEventTypes.html +27 -25
  248. package/docs/types/five.EasingFunction.html +1 -0
  249. package/docs/types/five.EventTypes.html +27 -25
  250. package/docs/types/five.FivePlugin.html +1 -1
  251. package/docs/types/five.FivePluginInit.html +1 -1
  252. package/docs/types/five.FivePluginInstance.html +1 -1
  253. package/docs/types/five.NetworkProgressCallback.html +1 -1
  254. package/docs/types/five.PBMAlphaMode.html +1 -1
  255. package/docs/types/five.PBMColorStyle.html +1 -1
  256. package/docs/types/five.PBMFloorStyle.html +1 -1
  257. package/docs/types/five.PBMMeshShaderType.html +1 -1
  258. package/docs/types/five.PBMPointBack.html +1 -1
  259. package/docs/types/five.PBMPointCloudShaderType.html +1 -1
  260. package/docs/types/five.PBMPointShape.html +1 -1
  261. package/docs/types/five.PBMPointSize.html +1 -1
  262. package/docs/types/five.PBMTransition.html +1 -1
  263. package/docs/types/five.ParseOptions.html +6 -6
  264. package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
  265. package/docs/variables/five.PROXY_CONTROLLER_EVENT_NAMES.html +1 -1
  266. package/five/application/analysis.d.ts +40 -0
  267. package/five/application/controllers.d.ts +41 -0
  268. package/five/application/events-legacy.d.ts +454 -0
  269. package/five/application/events.d.ts +69 -0
  270. package/five/application/five.d.ts +519 -0
  271. package/five/application/fiveInitArgs.d.ts +176 -0
  272. package/five/application/fiveLoadOptions.d.ts +21 -0
  273. package/five/application/generateDefaultVideoElement.d.ts +2 -0
  274. package/five/application/getViewportScale.d.ts +2 -0
  275. package/five/application/initLights.d.ts +3 -0
  276. package/five/application/mode.d.ts +28 -0
  277. package/five/application/renderPoweredByRealsee.d.ts +3 -0
  278. package/five/assets/cardboard-png-data-url.d.ts +2 -0
  279. package/five/assets/gradient-png-data-url.d.ts +2 -0
  280. package/five/assets/loading-png-data-url.d.ts +2 -0
  281. package/five/assets/phone-png-data-url.d.ts +2 -0
  282. package/five/assets/realsee-png-data-url.d.ts +2 -0
  283. package/five/bvh/bvhMath.d.ts +33 -0
  284. package/five/bvh/bvhMesh.d.ts +7 -0
  285. package/five/bvh/bvhNode.d.ts +29 -0
  286. package/five/bvh/bvhObject.d.ts +18 -0
  287. package/five/bvh/bvhPoints.d.ts +6 -0
  288. package/five/bvh/index.d.ts +10 -0
  289. package/five/bvh/worker.d.ts +35 -0
  290. package/five/cardboard/helper.d.ts +2 -0
  291. package/five/cardboard/index.d.ts +13 -0
  292. package/five/cardboard/sensor.d.ts +158 -0
  293. package/five/certificates/hardware.d.ts +1 -0
  294. package/five/controllers/base.d.ts +167 -0
  295. package/five/controllers/events.d.ts +71 -0
  296. package/five/controllers/floorplan.d.ts +119 -0
  297. package/five/controllers/mapview.d.ts +139 -0
  298. package/five/controllers/model.d.ts +57 -0
  299. package/five/controllers/panorama.d.ts +143 -0
  300. package/five/controllers/panoramaLike.d.ts +87 -0
  301. package/five/controllers/topview.d.ts +42 -0
  302. package/five/controllers/vrPanorama.d.ts +56 -0
  303. package/five/controllers/xrPanorama.d.ts +81 -0
  304. package/five/core/camera.d.ts +65 -0
  305. package/five/core/internalWebGLRenderer.d.ts +14 -0
  306. package/five/core/panoVideo.d.ts +18 -0
  307. package/five/core/scene.d.ts +10 -0
  308. package/five/core/tiling.d.ts +43 -0
  309. package/five/declare.d.ts +2 -1
  310. package/five/gaussian-splatting/util/renderData.d.ts +52 -0
  311. package/five/gaussian-splatting/wasm/data.d.ts +20 -0
  312. package/five/gaussian-splatting/wasm/sort.d.ts +18 -0
  313. package/five/gaussian-splatting/worker/dataWorker.d.ts +1 -0
  314. package/five/gaussian-splatting/worker/sortWorker.d.ts +1 -0
  315. package/five/index.d.ts +60 -4637
  316. package/five/index.js +193 -341
  317. package/five/index.mjs +26455 -31011
  318. package/five/meshes/boundingMesh.d.ts +12 -0
  319. package/five/meshes/intersectMesh.d.ts +8 -0
  320. package/five/meshes/panoCircleMesh.d.ts +35 -0
  321. package/five/meshes/panoCircleMeshCustom.d.ts +40 -0
  322. package/five/meshes/panoCircleMeshSolid.d.ts +34 -0
  323. package/five/meshes/panoSphereMesh.d.ts +27 -0
  324. package/five/model/helpers/coordinate-transform.d.ts +3 -0
  325. package/five/model/helpers/ellipsoid-coordinates.d.ts +14 -0
  326. package/five/model/helpers/get-edges-by-sphere.d.ts +8 -0
  327. package/five/model/helpers/get-recommend-tile3d-parameters.d.ts +8 -0
  328. package/five/model/index.d.ts +70 -0
  329. package/five/model/intersection.d.ts +18 -0
  330. package/five/model/loaders/at3d.d.ts +12 -0
  331. package/five/model/loaders/b3dm.d.ts +9 -0
  332. package/five/model/loaders/dome.d.ts +22 -0
  333. package/five/model/loaders/domez.d.ts +11 -0
  334. package/five/model/loaders/fbx.d.ts +8 -0
  335. package/five/model/loaders/glTF-helpers/extensions/CESIUM_RTC.d.ts +9 -0
  336. package/five/model/loaders/glTF-helpers/extensions/EXT_meshopt_compression.d.ts +8 -0
  337. package/five/model/loaders/glTF-helpers/extensions/EXT_texture_webp.d.ts +11 -0
  338. package/five/model/loaders/glTF-helpers/extensions/KHR_animation_pointer.d.ts +6 -0
  339. package/five/model/loaders/glTF-helpers/extensions/KHR_binary_glTF.d.ts +25 -0
  340. package/five/model/loaders/glTF-helpers/extensions/KHR_draco_mesh_compression.d.ts +11 -0
  341. package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz.d.ts +9 -0
  342. package/five/model/loaders/glTF-helpers/extensions/KHR_materials_clearcoat.d.ts +10 -0
  343. package/five/model/loaders/glTF-helpers/extensions/KHR_materials_emissive_strength.d.ts +10 -0
  344. package/five/model/loaders/glTF-helpers/extensions/KHR_materials_sheen.d.ts +10 -0
  345. package/five/model/loaders/glTF-helpers/extensions/KHR_materials_transmission.d.ts +10 -0
  346. package/five/model/loaders/glTF-helpers/extensions/KHR_materials_unlit.d.ts +10 -0
  347. package/five/model/loaders/glTF-helpers/extensions/KHR_mesh_quantization.d.ts +6 -0
  348. package/five/model/loaders/glTF-helpers/extensions/KHR_node_visibility.d.ts +10 -0
  349. package/five/model/loaders/glTF-helpers/extensions/KHR_texture_basisu.d.ts +9 -0
  350. package/five/model/loaders/glTF-helpers/extensions/KHR_texture_transform.d.ts +10 -0
  351. package/five/model/loaders/glTF-helpers/extensions/REALSEE_materials_lightmap.d.ts +7 -0
  352. package/five/model/loaders/glTF-helpers/extensions/base.d.ts +24 -0
  353. package/five/model/loaders/glTF-helpers/glTF.d.ts +713 -0
  354. package/five/model/loaders/glTF-helpers/index.d.ts +47 -0
  355. package/five/model/loaders/glTF-helpers/parser.d.ts +114 -0
  356. package/five/model/loaders/glTF-helpers/type.d.ts +14 -0
  357. package/five/model/loaders/gltf.d.ts +10 -0
  358. package/five/model/loaders/obj.d.ts +9 -0
  359. package/five/model/loaders/pbm.d.ts +26 -0
  360. package/five/model/loaders/ply.d.ts +24 -0
  361. package/five/model/loaders/pnts.d.ts +8 -0
  362. package/five/model/loaders/protobuf/dome.d.ts +540 -0
  363. package/five/model/loaders/protobuf/pbm.d.ts +203 -0
  364. package/five/model/loaders/shared.d.ts +16 -0
  365. package/five/model/loaders/splat.d.ts +8 -0
  366. package/five/model/loaders/spz.d.ts +14 -0
  367. package/five/model/loaders/tile3d-helpers/feature-table.d.ts +15 -0
  368. package/five/model/loaders/tile3d-helpers/gl-type.d.ts +20 -0
  369. package/five/model/loaders/tile3d-helpers/parse-gltf-array-buffer.d.ts +2 -0
  370. package/five/model/loaders/tile3d-helpers/parse-header.d.ts +2 -0
  371. package/five/model/loaders/tile3d-helpers/parse-point-cloud-attributes.d.ts +2 -0
  372. package/five/model/loaders/tile3d-helpers/parse-point-cloud-attributes.worker.d.ts +6 -0
  373. package/five/model/loaders/tile3d-helpers/parse-table.d.ts +3 -0
  374. package/five/model/loaders/tile3d-helpers/tile3d-type.d.ts +35 -0
  375. package/five/model/loaders/x3p.d.ts +22 -0
  376. package/five/model/materials/pbmMaterial.d.ts +137 -0
  377. package/five/model/materials/pbmMeshMaterial.d.ts +126 -0
  378. package/five/model/materials/pbmPointCloudMaterial.d.ts +70 -0
  379. package/five/model/model-scene.d.ts +172 -0
  380. package/five/model/model.d.ts +209 -0
  381. package/five/model/objects/pbmContainer.d.ts +28 -0
  382. package/five/model/objects/pbmGaussianSplattingObject.d.ts +43 -0
  383. package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +55 -0
  384. package/five/model/objects/pbmGaussianSplattingTestMesh.d.ts +7 -0
  385. package/five/model/objects/pbmGroup.d.ts +8 -0
  386. package/five/model/objects/pbmMesh.d.ts +10 -0
  387. package/five/model/objects/pbmPointCloud.d.ts +7 -0
  388. package/five/model/parameter.d.ts +140 -0
  389. package/five/model/shaders/pbm_gaussian_splatting/fragment.d.ts +2 -0
  390. package/five/model/shaders/pbm_gaussian_splatting/vertex.d.ts +2 -0
  391. package/five/model/shaders/pbm_mesh_basic/fragment.d.ts +2 -0
  392. package/five/model/shaders/pbm_mesh_basic/vertex.d.ts +2 -0
  393. package/five/model/shaders/pbm_mesh_none/fragment.d.ts +2 -0
  394. package/five/model/shaders/pbm_mesh_none/vertex.d.ts +2 -0
  395. package/five/model/shaders/pbm_mesh_phong/fragment.d.ts +2 -0
  396. package/five/model/shaders/pbm_mesh_phong/vertex.d.ts +2 -0
  397. package/five/model/shaders/pbm_mesh_standard/fragment.d.ts +2 -0
  398. package/five/model/shaders/pbm_mesh_standard/vertex.d.ts +2 -0
  399. package/five/model/shaders/pbm_pointcloud/fragment.d.ts +2 -0
  400. package/five/model/shaders/pbm_pointcloud/vertex.d.ts +2 -0
  401. package/five/model/tile3d/header.d.ts +88 -0
  402. package/five/model/tile3d/index.d.ts +214 -0
  403. package/five/model/tile3d/tile-cache.d.ts +18 -0
  404. package/five/model/tile3d/tile-content.d.ts +10 -0
  405. package/five/model/tile3d/tile-node.d.ts +24 -0
  406. package/five/model/tile3d/tile-request-scheduler.d.ts +17 -0
  407. package/five/model/tile3d/tile.d.ts +79 -0
  408. package/five/model/tile3d/tileset-base-traverser.d.ts +59 -0
  409. package/five/model/tile3d/tileset-most-detail-traverser.d.ts +14 -0
  410. package/five/model/tile3d/tileset-normal-traverser.d.ts +15 -0
  411. package/five/model/tile3d/tileset-skip-traverser.d.ts +60 -0
  412. package/five/model/tile3d/tileset.d.ts +69 -0
  413. package/five/model/tile3d/trajectory-content.d.ts +9 -0
  414. package/five/model/tile3d/trajectory-node.d.ts +15 -0
  415. package/five/model/tile3d/trajectory.d.ts +30 -0
  416. package/five/model/tile3d/types.d.ts +33 -0
  417. package/five/model/view-layer.d.ts +20 -0
  418. package/five/renderer/five-renderer.d.ts +17 -0
  419. package/five/renderer/index.d.ts +3 -0
  420. package/five/renderer/postprocessing/composer.d.ts +37 -0
  421. package/five/renderer/postprocessing/index.d.ts +7 -0
  422. package/five/renderer/postprocessing/passes/adaptive-luminance-pass.d.ts +17 -0
  423. package/five/renderer/postprocessing/passes/eye-dome-lighting-pass.d.ts +14 -0
  424. package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +36 -0
  425. package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +36 -0
  426. package/five/renderer/postprocessing/passes/gaussian-blur-pass.d.ts +12 -0
  427. package/five/renderer/postprocessing/passes/pass.d.ts +38 -0
  428. package/five/renderer/scene-renderers/point-cloud-high-quality-scene-renderer.d.ts +11 -0
  429. package/five/renderer/scene-renderers/scene-renderer.d.ts +9 -0
  430. package/five/renderer/scene-renderers/ssaa-scene-renderer.d.ts +15 -0
  431. package/five/renderer/tools/full-screen-quad.d.ts +15 -0
  432. package/five/renderer/tools/render-cube-to-equirectangular.d.ts +7 -0
  433. package/five/renderer/tools/render-full-screen-depth.d.ts +2 -0
  434. package/five/renderer/tools/render-full-screen.d.ts +2 -0
  435. package/five/texture/histogram.d.ts +54 -0
  436. package/five/texture/imageBitmap.d.ts +13 -0
  437. package/five/texture/initTexture.d.ts +3 -0
  438. package/five/texture/loader.d.ts +39 -0
  439. package/five/texture/textureData.d.ts +11 -0
  440. package/five/thirdparty/fflate.d.ts +1407 -0
  441. package/five/thirdparty/hammer.d.ts +375 -0
  442. package/five/thirdparty/jsrsasign.d.ts +753 -0
  443. package/five/thirdparty/meshopt_decoder.d.ts +15 -0
  444. package/five/three-version-check.d.ts +1 -0
  445. package/five/types/addableObject.d.ts +12 -0
  446. package/five/types/cube.d.ts +1 -0
  447. package/five/types/gestureInput.d.ts +24 -0
  448. package/five/types/imageOptions.d.ts +20 -0
  449. package/five/types/intersectMeshInterface.d.ts +8 -0
  450. package/five/types/movePanoEffect.d.ts +13 -0
  451. package/five/types/movePanoOptions.d.ts +36 -0
  452. package/five/types/panoCircleMeshInterface.d.ts +34 -0
  453. package/five/types/plugin.d.ts +25 -0
  454. package/five/types/pose.d.ts +17 -0
  455. package/five/types/state.d.ts +20 -0
  456. package/five/types/viewport.d.ts +22 -0
  457. package/five/utils/ajax.d.ts +66 -0
  458. package/five/utils/animationFrameLoop.d.ts +45 -0
  459. package/five/utils/array.d.ts +31 -0
  460. package/five/utils/asyncTaskQueue.d.ts +8 -0
  461. package/five/utils/bufferGeometry.d.ts +33 -0
  462. package/five/utils/calculateProgress.d.ts +39 -0
  463. package/five/utils/calculateThreeMouse.d.ts +13 -0
  464. package/five/utils/canplayVideo.d.ts +2 -0
  465. package/five/utils/clamp.d.ts +2 -0
  466. package/five/utils/clock.d.ts +17 -0
  467. package/five/utils/createSymbol.d.ts +5 -0
  468. package/five/utils/decodeText.d.ts +2 -0
  469. package/five/utils/deepEqual.d.ts +2 -0
  470. package/five/utils/deepFreeze.d.ts +2 -0
  471. package/five/utils/defineProperty.d.ts +9 -0
  472. package/five/utils/detector.d.ts +14 -0
  473. package/five/utils/distance.d.ts +10 -0
  474. package/five/utils/draco.d.ts +26 -0
  475. package/five/utils/easing.d.ts +63 -0
  476. package/five/utils/event.d.ts +159 -0
  477. package/five/utils/formatRad.d.ts +7 -0
  478. package/five/utils/imageSupport.d.ts +6 -0
  479. package/five/utils/imageURL.d.ts +42 -0
  480. package/five/utils/isEmptyObject.d.ts +2 -0
  481. package/five/utils/isNil.d.ts +6 -0
  482. package/five/utils/isNumber.d.ts +2 -0
  483. package/five/utils/isPowerOfTwo.d.ts +2 -0
  484. package/five/utils/isPromise.d.ts +2 -0
  485. package/five/utils/isSimilar.d.ts +6 -0
  486. package/five/utils/json.d.ts +7 -0
  487. package/five/utils/ktx2.d.ts +30 -0
  488. package/five/utils/lzma/index.d.ts +2 -0
  489. package/five/utils/lzma/lzma.d.ts +3 -0
  490. package/five/utils/lzma/lzmaWASM.d.ts +2 -0
  491. package/five/utils/lzma/lzmaWorker.d.ts +14 -0
  492. package/five/utils/memoryUsage.d.ts +29 -0
  493. package/five/utils/motion.d.ts +38 -0
  494. package/five/utils/noop.d.ts +6 -0
  495. package/five/utils/now.d.ts +7 -0
  496. package/five/utils/pano.d.ts +9 -0
  497. package/five/utils/pick.d.ts +3 -0
  498. package/five/utils/poseUtils.d.ts +5 -0
  499. package/five/utils/renderCubeTextureToCubeRenderTarget.d.ts +3 -0
  500. package/five/utils/renderDepth.d.ts +2 -0
  501. package/five/utils/renderTexturesToCubeRenderTarget.d.ts +10 -0
  502. package/five/utils/requestPermission.d.ts +3 -0
  503. package/five/utils/shaderContentFix.d.ts +7 -0
  504. package/five/utils/shaderMaterial.d.ts +20 -0
  505. package/five/utils/stateUtils.d.ts +5 -0
  506. package/five/utils/string-pattern.d.ts +8 -0
  507. package/five/utils/subscribe.d.ts +67 -0
  508. package/five/utils/tileCube.d.ts +19 -0
  509. package/five/utils/toFastProperties.d.ts +1 -0
  510. package/five/utils/typedCache.d.ts +10 -0
  511. package/five/utils/uniform.d.ts +15 -0
  512. package/five/utils/url.d.ts +35 -0
  513. package/five/utils/uuid.d.ts +5 -0
  514. package/five/utils/values.d.ts +2 -0
  515. package/five/utils/vectorCoordinates.d.ts +29 -0
  516. package/five/utils/volume.d.ts +111 -0
  517. package/five/utils/webglError.d.ts +7 -0
  518. package/five/utils/worker.d.ts +26 -0
  519. package/five/webxr/XRControllerModelFactory.d.ts +28 -0
  520. package/five/webxr/motionHelper.d.ts +68 -0
  521. package/five/webxr/xrButton.d.ts +4 -0
  522. package/five/webxr/xrController.d.ts +24 -0
  523. package/five/webxr/xrManager.d.ts +84 -0
  524. package/five/work/_ALLOW_HOST.d.ts +2 -0
  525. package/five/work/index.d.ts +6 -0
  526. package/five/work/keychain.d.ts +5 -0
  527. package/five/work/looseWorkType.d.ts +121 -0
  528. package/five/work/verify.d.ts +7 -0
  529. package/five/work/work.d.ts +236 -0
  530. package/five/work/workFetcher.d.ts +4 -0
  531. package/five/work/workJson.d.ts +3 -0
  532. package/five/work/workJsonType.d.ts +73 -0
  533. package/five/work/workObserverUtils.d.ts +36 -0
  534. package/five/work/workParser.d.ts +6 -0
  535. package/five/work/workResolvedObserver.d.ts +12 -0
  536. package/five/work/workVerify.d.ts +2 -0
  537. package/five/work/works.d.ts +10 -0
  538. package/gltf-loader/gltf-object.d.ts +17 -0
  539. package/gltf-loader/index.d.ts +60 -160
  540. package/gltf-loader/index.js +9 -9
  541. package/gltf-loader/index.mjs +1351 -1451
  542. package/gltf-loader/thirdparty/DDSLoader.d.ts +23 -0
  543. package/gltf-loader/thirdparty/DRACOLoader.d.ts +18 -0
  544. package/gltf-loader/thirdparty/GLTFLoader.d.ts +59 -0
  545. package/line/circle_png.d.ts +1 -0
  546. package/line/index.d.ts +19 -69
  547. package/line/index.js +4 -4
  548. package/line/index.mjs +334 -513
  549. package/line/utils/Line2.d.ts +7 -0
  550. package/line/utils/LineGeometry.d.ts +10 -0
  551. package/line/utils/LineMaterial.d.ts +20 -0
  552. package/line/utils/LineSegments2.d.ts +11 -0
  553. package/line/utils/LineSegmentsGeometry.d.ts +15 -0
  554. package/llms.txt +43 -31
  555. package/package.json +11 -2
  556. package/plugins/BackgroundPlugin/Controller.d.ts +20 -0
  557. package/plugins/BackgroundPlugin/index.d.ts +5 -0
  558. package/plugins/BackgroundPlugin/typings.d.ts +44 -0
  559. package/plugins/BasePlugin/index.d.ts +119 -0
  560. package/plugins/DynamicPathLinePlugin/Controller.d.ts +167 -0
  561. package/plugins/DynamicPathLinePlugin/index.d.ts +5 -0
  562. package/plugins/DynamicPathLinePlugin/line2/Line2.d.ts +7 -0
  563. package/plugins/DynamicPathLinePlugin/line2/LineGeometry.d.ts +10 -0
  564. package/plugins/DynamicPathLinePlugin/line2/LineMaterial.d.ts +17 -0
  565. package/plugins/DynamicPathLinePlugin/line2/LineSegments2.d.ts +11 -0
  566. package/plugins/DynamicPathLinePlugin/line2/LineSegmentsGeometry.d.ts +15 -0
  567. package/plugins/DynamicPathLinePlugin/typing.d.ts +129 -0
  568. package/plugins/DynamicPathLinePlugin/typings.d.ts +72 -0
  569. package/plugins/ItemMaskPlugin/Controller.d.ts +48 -0
  570. package/plugins/ItemMaskPlugin/index.d.ts +5 -0
  571. package/plugins/ItemMaskPlugin/typing.d.ts +58 -0
  572. package/plugins/OrientationPlugin/Controller.d.ts +82 -0
  573. package/plugins/OrientationPlugin/RoundedBoxGeometry.d.ts +11 -0
  574. package/plugins/OrientationPlugin/index.d.ts +6 -0
  575. package/plugins/OrientationPlugin/typing.d.ts +25 -0
  576. package/plugins/PanoAnimePlugin/Controller.d.ts +46 -0
  577. package/plugins/PanoAnimePlugin/index.d.ts +5 -0
  578. package/plugins/PanoAnimePlugin/typing.d.ts +37 -0
  579. package/plugins/PluginTemplate/Controller.d.ts +27 -0
  580. package/plugins/PluginTemplate/index.d.ts +5 -0
  581. package/plugins/PluginTemplate/typing.d.ts +21 -0
  582. package/plugins/TrajectoryPlugin/Controller.d.ts +85 -0
  583. package/plugins/TrajectoryPlugin/index.d.ts +6 -0
  584. package/plugins/TrajectoryPlugin/typing.d.ts +25 -0
  585. package/plugins/index.d.ts +9 -1102
  586. package/plugins/index.js +17 -21
  587. package/plugins/index.mjs +3342 -4245
  588. package/plugins/thirdParty/CSS3DRenderer.d.ts +32 -0
  589. package/plugins/thirdParty/OrbitControls.d.ts +78 -0
  590. package/plugins/utils/absoluteUrl.d.ts +5 -0
  591. package/plugins/utils/clamp.d.ts +2 -0
  592. package/plugins/utils/loadImage.d.ts +1 -0
  593. package/plugins/utils/motion.d.ts +38 -0
  594. package/plugins/utils/now.d.ts +6 -0
  595. package/plugins/utils/uuid.d.ts +5 -0
  596. package/react/canvas.d.ts +19 -0
  597. package/react/context.d.ts +11 -0
  598. package/react/createProvider.d.ts +95 -0
  599. package/react/createStore.d.ts +144 -0
  600. package/react/hooks/unsafe__useFiveInstance.d.ts +9 -0
  601. package/react/hooks/useFiveAction.d.ts +147 -0
  602. package/react/hooks/useFiveCameraDirection.d.ts +7 -0
  603. package/react/hooks/useFiveCameraRaycaster.d.ts +7 -0
  604. package/react/hooks/useFiveCurrentObserver.d.ts +11 -0
  605. package/react/hooks/useFiveCurrentState.d.ts +15 -0
  606. package/react/hooks/useFiveEventCallback.d.ts +12 -0
  607. package/react/hooks/useFiveFloor.d.ts +15 -0
  608. package/react/hooks/useFiveHelper.d.ts +14 -0
  609. package/react/hooks/useFiveModelBounding.d.ts +5 -0
  610. package/react/hooks/useFiveModelEffect.d.ts +14 -0
  611. package/react/hooks/useFiveModelIntersectRaycaster.d.ts +22 -0
  612. package/react/hooks/useFiveModelReadyState.d.ts +8 -0
  613. package/react/hooks/useFiveProject2d.d.ts +20 -0
  614. package/react/hooks/useFiveSceneEffect.d.ts +21 -0
  615. package/react/hooks/useFiveState.d.ts +6 -0
  616. package/react/hooks/useFiveWork.d.ts +29 -0
  617. package/react/index.d.ts +24 -830
  618. package/react/index.js +3 -3
  619. package/react/index.mjs +572 -783
  620. package/react/rendererPool.d.ts +7 -0
  621. package/react/withFive.d.ts +213 -0
  622. package/shader-lib/EvenessPlane/index.d.ts +10 -0
  623. package/shader-lib/PointCloudExpand/index.d.ts +59 -0
  624. package/shader-lib/PolygonCuter/index.d.ts +52 -0
  625. package/shader-lib/PolygonCuter/worker.d.ts +14 -0
  626. package/shader-lib/ShineModel/index.d.ts +7 -0
  627. package/shader-lib/SweepModel/index.d.ts +7 -0
  628. package/shader-lib/index.d.ts +5 -86
  629. package/shader-lib/index.js +13 -14
  630. package/shader-lib/index.mjs +424 -824
  631. package/sticker/geometry.d.ts +3 -0
  632. package/sticker/index.d.ts +68 -71
  633. package/sticker/index.js +3 -3
  634. package/sticker/index.mjs +102 -142
  635. package/umd/five-gltf-loader.js +9 -9
  636. package/umd/five-line.js +4 -4
  637. package/umd/five-plugins.js +17 -21
  638. package/umd/five-react.js +3 -3
  639. package/umd/five-shader-lib.js +13 -14
  640. package/umd/five-sticker.js +3 -3
  641. package/umd/five-vfx.js +21 -21
  642. package/umd/five-vue.js +3 -3
  643. package/umd/five.js +188 -336
  644. package/vfx/airflow/airflow.d.ts +18 -0
  645. package/vfx/airflow/fragment-shader.d.ts +2 -0
  646. package/vfx/airflow/vertex-shader.d.ts +2 -0
  647. package/vfx/common/scale-shader.d.ts +2 -0
  648. package/vfx/common/simplex-noise-shader.d.ts +2 -0
  649. package/vfx/frame/fragment-shader.d.ts +2 -0
  650. package/vfx/frame/frame.d.ts +22 -0
  651. package/vfx/frame/vertex-shader.d.ts +2 -0
  652. package/vfx/index.d.ts +7 -363
  653. package/vfx/index.js +21 -21
  654. package/vfx/index.mjs +454 -910
  655. package/vfx/particle/fragment-shader.d.ts +2 -0
  656. package/vfx/particle/instance.d.ts +36 -0
  657. package/vfx/particle/particle.d.ts +205 -0
  658. package/vfx/particle/utils.d.ts +11 -0
  659. package/vfx/particle/vertex-shader.d.ts +2 -0
  660. package/vfx/particle-gpu/fragment-shader.d.ts +2 -0
  661. package/vfx/particle-gpu/instance.d.ts +36 -0
  662. package/vfx/particle-gpu/particle.d.ts +95 -0
  663. package/vfx/particle-gpu/utils.d.ts +11 -0
  664. package/vfx/particle-gpu/vertex-shader.d.ts +2 -0
  665. package/vfx/spotLight/fragment-shader.d.ts +2 -0
  666. package/vfx/spotLight/spotLight.d.ts +15 -0
  667. package/vfx/spotLight/vertex-shader.d.ts +2 -0
  668. package/vue/context.d.ts +7 -0
  669. package/vue/hooks/FiveCanvas.d.ts +36 -0
  670. package/vue/hooks/FiveProvider.d.ts +35 -0
  671. package/vue/hooks/unsafe__useFiveInject.d.ts +9 -0
  672. package/vue/hooks/useFiveAction.d.ts +178 -0
  673. package/vue/hooks/useFiveCameraDirection.d.ts +8 -0
  674. package/vue/hooks/useFiveCameraRaycaster.d.ts +8 -0
  675. package/vue/hooks/useFiveCurrentObserver.d.ts +12 -0
  676. package/vue/hooks/useFiveCurrentState.d.ts +16 -0
  677. package/vue/hooks/useFiveEventCallback.d.ts +11 -0
  678. package/vue/hooks/useFiveFloor.d.ts +16 -0
  679. package/vue/hooks/useFiveHelper.d.ts +15 -0
  680. package/vue/hooks/useFiveModel.d.ts +7 -0
  681. package/vue/hooks/useFiveModelBounding.d.ts +7 -0
  682. package/vue/hooks/useFiveModelIntersectRaycaster.d.ts +23 -0
  683. package/vue/hooks/useFiveModelReadyState.d.ts +9 -0
  684. package/vue/hooks/useFiveProject2d.d.ts +26 -0
  685. package/vue/hooks/useFiveScene.d.ts +6 -0
  686. package/vue/hooks/useFiveState.d.ts +16 -0
  687. package/vue/hooks/useFiveWork.d.ts +30 -0
  688. package/vue/index.d.ts +23 -467
  689. package/vue/index.js +3 -3
  690. package/vue/index.mjs +309 -301
  691. package/vue/rendererPool.d.ts +10 -0
  692. package/work-downloader/components/model-3d-tile.d.ts +2 -0
  693. package/work-downloader/components/model.d.ts +3 -0
  694. package/work-downloader/components/observer.d.ts +7 -0
  695. package/work-downloader/download.d.ts +16 -0
  696. package/work-downloader/index.d.ts +2 -33
  697. package/work-downloader/index.js +3 -3
  698. package/work-downloader/index.mjs +317 -556
  699. package/work-downloader/type.d.ts +28 -0
  700. package/work-downloader/utils/download-to-file.d.ts +1 -0
  701. package/work-downloader/utils/image-processing.d.ts +7 -0
  702. package/work-downloader/utils/join-url.d.ts +2 -0
  703. package/work-downloader/utils/log.d.ts +1 -0
  704. package/work-downloader/utils/relative-url.d.ts +1 -0
  705. package/docs/documents/five.FivePlugin.plugin.html +0 -60
  706. package/docs/documents/plugin.html +0 -60
  707. package/docs/media/five.ts +0 -2881
  708. package/docs/media/pass.ts +0 -64
  709. package/guides/ai-doc-guidelines.md +0 -72
  710. package/guides/features/3dtile.md +0 -264
  711. package/guides/features/parameter.md +0 -178
  712. package/guides/plugin.md +0 -206
  713. /package/{guides → ai_guides}/release_notes/6.6.md +0 -0
  714. /package/{guides → ai_guides}/release_notes/6.7.md +0 -0
  715. /package/{guides → ai_guides}/support.md +0 -0
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/1/28
5
- * Version: 6.8.0-alpha.2
4
+ * Generated: 3/19/2026
5
+ * Version: 6.8.0-alpha.21
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,13 +252,13 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */(function(re,fe){typeof exports=="object"&&typeof module!="undefined"?fe(exports,require("@realsee/five"),require("three"),require("@realsee/five/plugins")):typeof define=="function"&&define.amd?define(["exports","@realsee/five","three","@realsee/five/plugins"],fe):(re=typeof globalThis!="undefined"?globalThis:re||self,fe(re.FiveSDK_Plugins={},re.FiveSDK,re.THREE,re.FiveSDK_Plugins))})(this,(function(re,fe,D,lt){"use strict";function Jt(v){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(v){for(const e in v)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(v,e);Object.defineProperty(s,e,n.get?n:{enumerable:!0,get:()=>v[e]})}}return s.default=v,Object.freeze(s)}const p=Jt(D);function $t(v){return/^https?:\/\/|^\/\//.test(v)||/^data:/.test(v)}function en(v,s){return $t(s)?s:"".concat(v).concat(s)}re.BasePlugin=void 0,(function(v){var s=(function(){function e(n,t){this.hooks=new fe.Subscribe,this.staticPrefix="//vr-image-4.realsee-cdn.cn",this.five=n,t!=null&&t.staticPrefix&&(this.staticPrefix=t.staticPrefix)}return e.prototype.getCurrentState=function(){return this.state},e.prototype.absoluteUrl=function(n){return en(this.staticPrefix,n)},e})();v.Controller=s})(re.BasePlugin||(re.BasePlugin={}));var ut=function(v,s){return ut=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},ut(v,s)};function de(v,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");ut(v,s);function e(){this.constructor=v}v.prototype=s===null?Object.create(s):(e.prototype=s.prototype,new e)}var N=function(){return N=Object.assign||function(s){for(var e,n=1,t=arguments.length;n<t;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(s[r]=e[r])}return s},N.apply(this,arguments)};function Ce(v,s,e,n){function t(r){return r instanceof e?r:new e(function(l){l(r)})}return new(e||(e=Promise))(function(r,l){function i(d){try{c(n.next(d))}catch(y){l(y)}}function h(d){try{c(n.throw(d))}catch(y){l(y)}}function c(d){d.done?r(d.value):t(d.value).then(i,h)}c((n=n.apply(v,s||[])).next())})}function Oe(v,s){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,t,r,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=i(0),l.throw=i(1),l.return=i(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(c){return function(d){return h([c,d])}}function h(c){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(e=0)),e;)try{if(n=1,t&&(r=c[0]&2?t.return:c[0]?t.throw||((r=t.return)&&r.call(t),0):t.next)&&!(r=r.call(t,c[1])).done)return r;switch(t=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,t=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){e.label=c[1];break}if(c[0]===6&&e.label<r[1]){e.label=r[1],r=c;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(c);break}r[2]&&e.ops.pop(),e.trys.pop();continue}c=s.call(v,e)}catch(d){c=[6,d],t=0}finally{n=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ot(v,s,e){if(e||arguments.length===2)for(var n=0,t=s.length,r;n<t;n++)(r||!(n in s))&&(r||(r=Array.prototype.slice.call(s,0,n)),r[n]=s[n]);return v.concat(r||Array.prototype.slice.call(s))}typeof SuppressedError=="function"&&SuppressedError;function tn(v){return new Promise(function(s,e){var n=new Image;n.onload=function(){n.onload=n.onerror=function(){},s(n)},n.onerror=function(t){n.onload=n.onerror=function(){},e(t)},n.crossOrigin="",n.src=v})}var nn=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),ct=typeof performance!="undefined"?(function(){return nn+performance.now()}):(function(){return Date.now()});function Xe(v,s,e){return v+(s-v)*e}function rn(v,s,e,n){var t=(s*e+2*v)/Math.pow(e,3),r=-(2*s*e+3*v)/Math.pow(e,2),l=s,i=v;return t*Math.pow(n,3)+r*Math.pow(n,2)+l*n+i}function an(v,s,e,n){var t=(s*e+2*v)/Math.pow(e,3),r=-(2*s*e+3*v)/Math.pow(e,2),l=s;return 3*t*Math.pow(n,2)+2*r*n+l}function on(v,s,e,n){var t=n[1]-n[0];return v=He(v,n),s=He(s,n),s-v>t/2?Xe(v+t,s,e):v-s>t/2?Xe(v-t,s,e):Xe(v,s,e)}function He(v,s){var e=s[1]-s[0];return v<s[0]?He(v+e,s):v>=s[1]?He(v-e,s):v}function sn(v,s,e,n){return n?on(v,s,e,n):Xe(v,s,e)}var _t=(function(){function v(s){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=ct(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var e in s){var n=s[e];typeof n=="number"?(this.value[e]=n,this.config[e]={circle:!1}):(this.value[e]=n.value,this.config[e]={circle:n.circle})}this.keyframes=[{progress:0,value:N({},this.value)},{progress:1,value:N({},this.value)}]}return v.prototype.getProgress=function(s){var e=s-this.startTime;return e<0?0:e>=this.duration?1:1-rn(1,this.startVelocity,this.duration,e)},v.prototype.getValue=function(s){for(var e=1;e<this.keyframes.length;e++)if(this.keyframes[e].progress>s){var n=this.keyframes[e-1],t=this.keyframes[e],r={};for(var l in this.config){var i=(s-n.progress)/(t.progress-n.progress);r[l]=sn(n.value[l],t.value[l],i,this.config[l].circle)}return r}return N({},this.keyframes[this.keyframes.length-1].value)},v.prototype.getProgressVelocity=function(s){var e=s-this.startTime;return e>=this.duration?0:an(1,this.startVelocity,this.duration,e)},v.prototype.update=function(s){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(s))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},v.prototype.getKeyFrameSegment=function(s){for(var e=this.getProgress(s),n=1;n<this.keyframes.length;n++)if(this.keyframes[n].progress>e)return[this.keyframes[n-1],this.keyframes[n]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},v.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},v.prototype.set=function(s,e,n,t){var r;n===void 0&&(n=0),isNaN(e)&&(e=0),isNaN(n)&&(n=0),t=t!=null?t:ct();var l=this.getProgress(t),i=this.getValue(l),h={};for(var c in this.config)h[c]=(r=s[c])!==null&&r!==void 0?r:i[c];var d=[{progress:0,value:i},{progress:1,value:h}];return this.setKeyframes(d,e,n,t)},v.prototype.setKeyframes=function(s,e,n,t){var r=this;if(n===void 0&&(n=0),s.length<2)throw new Error("keyframes invalid.");return isNaN(e)&&(e=0),isNaN(n)&&(n=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise(function(l,i){t=t!=null?t:ct(),r.progress=0,r.ended=!1,r.startTime=t,r.startVelocity=n,r.keyframes=s,r.duration=e,e===0?(r.progress=1,r.value=N({},s[s.length-1].value)):r.value=N({},s[0].value),r.callbacks=[l,i]})},v.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},v})(),ln=[{progress:0,value:{scale:0,opacity:0,shadow:2}},{progress:.2,value:{scale:.5,opacity:1,shadow:1}},{progress:.8,value:{scale:2,opacity:0,shadow:.5}},{progress:1,value:{scale:2,opacity:0,shadow:.5}}],un=[{progress:0,value:{scale:0,opacity:0,shadow:2}},{progress:.2,value:{scale:.4,opacity:1,shadow:2}},{progress:.8,value:{scale:1.6,opacity:.4,shadow:.5}},{progress:1,value:{scale:2,opacity:0,shadow:.5}}],cn=`
255
+ */(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@realsee/five`),require(`three`),require(`@realsee/five/plugins`)):typeof define==`function`&&define.amd?define([`exports`,`@realsee/five`,`three`,`@realsee/five/plugins`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.FiveSDK_Plugins={},e.FiveSDK,e.THREE,e.FiveSDK_Plugins))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:i(c(e)),u(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)))(n);function d(e){return/^https?:\/\/|^\/\//.test(e)||/^data:/.test(e)}function f(e,t){return d(t)?t:`${e}${t}`}var p;(function(e){class n{constructor(e,n){this.hooks=new t.Subscribe,this.staticPrefix=`//vr-image-4.realsee-cdn.cn`,this.five=e,n!=null&&n.staticPrefix&&(this.staticPrefix=n.staticPrefix)}getCurrentState(){return this.state}absoluteUrl(e){return f(this.staticPrefix,e)}}e.Controller=n})(p||(p={}));function m(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function h(e){return new Promise((t,n)=>{let r=new Image;r.onload=function(){r.onload=r.onerror=function(){},t(r)},r.onerror=function(e){r.onload=r.onerror=function(){},n(e)},r.crossOrigin=``,r.src=e})}var g=typeof performance<`u`&&performance.timing!==void 0?performance.timing.navigationStart:Date.now(),_=typeof performance<`u`?(()=>g+performance.now()):(()=>Date.now());function v(e,t,n){return e+(t-e)*n}function y(e,t,n,r){let i=(t*n+2*e)/Math.pow(n,3),a=-(2*t*n+3*e)/Math.pow(n,2),o=t,s=e;return i*Math.pow(r,3)+a*Math.pow(r,2)+o*r+s}function b(e,t,n,r){let i=(t*n+2*e)/Math.pow(n,3),a=-(2*t*n+3*e)/Math.pow(n,2),o=t;return 3*i*Math.pow(r,2)+2*a*r+o}function x(e,t,n,r){let i=r[1]-r[0];return e=S(e,r),t=S(t,r),t-e>i/2?v(e+i,t,n):e-t>i/2?v(e-i,t,n):v(e,t,n)}function S(e,t){let n=t[1]-t[0];return e<t[0]?S(e+n,t):e>=t[1]?S(e-n,t):e}function C(e,t,n,r){return r?x(e,t,n,r):v(e,t,n)}var w=class{constructor(e){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=_(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(let t in e){let n=e[t];typeof n==`number`?(this.value[t]=n,this.config[t]={circle:!1}):(this.value[t]=n.value,this.config[t]={circle:n.circle})}this.keyframes=[{progress:0,value:Object.assign({},this.value)},{progress:1,value:Object.assign({},this.value)}]}getProgress(e){let t=e-this.startTime;return t<0?0:t>=this.duration?1:1-y(1,this.startVelocity,this.duration,t)}getValue(e){for(let t=1;t<this.keyframes.length;t++)if(this.keyframes[t].progress>e){let n=this.keyframes[t-1],r=this.keyframes[t],i={};for(let t in this.config){let a=(e-n.progress)/(r.progress-n.progress);i[t]=C(n.value[t],r.value[t],a,this.config[t].circle)}return i}return Object.assign({},this.keyframes[this.keyframes.length-1].value)}getProgressVelocity(e){let t=e-this.startTime;return t>=this.duration?0:b(1,this.startVelocity,this.duration,t)}update(e){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(e))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)}getKeyFrameSegment(e){let t=this.getProgress(e);for(let e=1;e<this.keyframes.length;e++)if(this.keyframes[e].progress>t)return[this.keyframes[e-1],this.keyframes[e]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]}getTargetKeyframe(){return this.keyframes[this.keyframes.length-1]}set(e,t,n=0,r){var i;isNaN(t)&&(t=0),isNaN(n)&&(n=0),r=r==null?_():r;let a=this.getProgress(r),o=this.getValue(a),s={};for(let t in this.config)s[t]=(i=e[t])==null?o[t]:i;let c=[{progress:0,value:o},{progress:1,value:s}];return this.setKeyframes(c,t,n,r)}setKeyframes(e,t,n=0,r){if(e.length<2)throw Error(`keyframes invalid.`);return isNaN(t)&&(t=0),isNaN(n)&&(n=0),this.callbacks&&(this.callbacks[1](Error(`motion aborted.`)),this.callbacks=void 0),new Promise((i,a)=>{r=r==null?_():r,this.progress=0,this.ended=!1,this.startTime=r,this.startVelocity=n,this.keyframes=e,this.duration=t,t===0?(this.progress=1,this.value=Object.assign({},e[e.length-1].value)):this.value=Object.assign({},e[0].value),this.callbacks=[i,a]})}dispose(){this.callbacks&&(this.callbacks[1](Error(`motion dispose.`)),this.callbacks=void 0)}},T=[{progress:0,value:{scale:0,opacity:0,shadow:2}},{progress:.2,value:{scale:.5,opacity:1,shadow:1}},{progress:.8,value:{scale:2,opacity:0,shadow:.5}},{progress:1,value:{scale:2,opacity:0,shadow:.5}}],E=[{progress:0,value:{scale:0,opacity:0,shadow:2}},{progress:.2,value:{scale:.4,opacity:1,shadow:2}},{progress:.8,value:{scale:1.6,opacity:.4,shadow:.5}},{progress:1,value:{scale:2,opacity:0,shadow:.5}}],D=`
256
256
  varying vec2 vUv;
257
257
  void main() {
258
258
  vUv = uv;
259
259
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
260
260
  }
261
- `,fn=`
261
+ `,ee=`
262
262
  varying vec2 vUv;
263
263
  uniform sampler2D map;
264
264
  uniform vec4 color;
@@ -304,7 +304,7 @@ void main() {
304
304
  }
305
305
  }
306
306
  }
307
- `,hn=(function(v){de(s,v);function s(e,n){var t=v.call(this,e)||this;t.canvas=document.createElement("canvas"),t.group=new p.Group,t.wrapper=document.createElement("div"),t.style=document.createElement("style"),t.itemMaskMesh=(function(){var i=new p.Mesh(new p.SphereBufferGeometry(1,60,40),new p.ShaderMaterial({vertexShader:cn,fragmentShader:fn,uniforms:{map:{value:new p.Texture},color:{value:new p.Vector4}},depthWrite:!1,depthTest:!1,transparent:!0}));return i.renderOrder=-3,i.geometry.rotateY(-Math.PI/2),i.geometry.scale(-1,1,1),i})(),t.onFivePanoArrived=function(i){t.state.mode==="mask"&&t.loadPanoMask(i)},t.onFiveWantsMoveToPano=function(i){t.state.mode==="box"&&t.select()},t.loadPanoMask=function(i){return Ce(t,void 0,void 0,function(){var h,c,d,y,S,w,M,E,O,A;return Oe(this,function(b){switch(b.label){case 0:return h=this,c=h.five,d=h.canvas,y=h.itemMaskMesh,S=h.data,w=d.getContext("2d"),M=c.observers[i],E=(A=S==null?void 0:S.object_mask_list.find(function(T){return T.derived_id===String(M.derivedId)}))===null||A===void 0?void 0:A.object_mask_url,E?[4,tn(E)]:[2];case 1:return O=b.sent(),d.width=O.width,d.height=O.height,w==null||w.drawImage(O,0,0,O.width,O.height),y.material.uniforms.map.value.image=O,y.material.uniforms.map.value.minFilter=p.LinearFilter,y.material.uniforms.map.value.needsUpdate=!0,y.position.copy(M.position),y.quaternion.copy(M.quaternion),c.scene.add(y),c.needsRender=!0,[2]}})})},t.onFiveMouseMove=function(i){var h;if(t.state.mode==="mask"&&t.five.state.mode==="Panorama"){var c=t,d=c.five,y=c.itemMaskMesh,S=d.observers[d.state.panoIndex],w=(h=i.pointers[0])===null||h===void 0?void 0:h.raycaster;if(w){var M=w.intersectObjects(t.group.children.filter(function(E){return E.userData.visible_viewpoint.includes(String(S.derivedId))}),!0)[0];M?y.material.uniforms.color.value=M.object.userData.color:y.material.uniforms.color.value=new p.Vector4(0,0,0,1)}}},t.onFiveTapGesture=function(i){var h=t.five,c=h.observers[h.state.panoIndex];if(i){var d=i.intersectObjects(t.group.children.filter(function(w){return w.userData.visible_viewpoint.includes(String(c.derivedId))}),!0)[0];if(d){t.select(d.object.name),t.stopAnimation&&t.stopAnimation(),t.tapPosition=d.point,t.changeTapScreenPosition();var y=new _t({opacity:0,scale:0,shadow:2}),S=new _t({opacity:0,scale:0,shadow:2});return y.setKeyframes(ln,1e3),S.setKeyframes(un,1e3),t.stopAnimation=fe.AnimationFrameLoop.shared.add(function(w,M){var E,O=y.update(w),A=S.update(w);t.wrapper.firstChild.style.opacity="".concat(y.value.opacity),t.wrapper.firstChild.style.transform="scale(".concat(y.value.scale,")"),t.wrapper.firstChild.style.boxShadow="0 0 0 ".concat(y.value.shadow,"px #fff"),t.wrapper.lastChild.style.opacity="".concat(S.value.opacity),t.wrapper.lastChild.style.transform="scale(".concat(S.value.scale,")"),t.wrapper.lastChild.style.boxShadow="0 0 0 ".concat(S.value.shadow,"px #fff"),O&&A&&((E=t.stopAnimation)===null||E===void 0||E.call(t),t.stopAnimation=void 0,h.getElement().parentElement.removeChild(t.wrapper))},!1,0,10),h.getElement().parentElement.appendChild(t.wrapper),!1}}},t.changeTapScreenPosition=function(){if(t.tapPosition){var i=t.tapPosition.clone().project(t.five.camera),h=(i.x+1)/2,c=-(i.y-1)/2;t.wrapper.style.opacity=i.z>0&&i.z<1?"1":"0",t.wrapper.style.transform="translate(".concat(h*100,"%, ").concat(c*100,"%)")}},t.onFiveCameraUpdate=function(i){t.changeTapScreenPosition()},t.dispose=function(){t.disable()},t.five=e;var r={enabled:!0,visible:!0,mode:"box",selectedId:null,selectAll:!1};t.state=Object.assign(r,n==null?void 0:n.initialState);var l=N({},n==null?void 0:n.config);return t._config=l,t.group.rotateX(Math.PI),t.wrapper.className="ItemMaskPlugin",t.wrapper.innerHTML='<span class="ItemMaskPluginCircle"></span><span class="ItemMaskPluginCircle"></span>',t.style.innerHTML=`
307
+ `,O=class extends p.Controller{get config(){return Object.assign({},this._config)}updateState(e,t){let n=this.state;this.state=Object.assign(Object.assign({},this.state),e),this.hooks.emit(`stateChange`,{state:this.state,prevState:n,userAction:t})}constructor(e,r){super(e),this.canvas=document.createElement(`canvas`),this.group=new n.Group,this.wrapper=document.createElement(`div`),this.style=document.createElement(`style`),this.itemMaskMesh=(()=>{let e=new n.Mesh(new n.SphereBufferGeometry(1,60,40),new n.ShaderMaterial({vertexShader:D,fragmentShader:ee,uniforms:{map:{value:new n.Texture},color:{value:new n.Vector4}},depthWrite:!1,depthTest:!1,transparent:!0}));return e.renderOrder=-3,e.geometry.rotateY(-Math.PI/2),e.geometry.scale(-1,1,1),e})(),this.onFivePanoArrived=e=>{this.state.mode===`mask`&&this.loadPanoMask(e)},this.onFiveWantsMoveToPano=e=>{this.state.mode===`box`&&this.select()},this.loadPanoMask=e=>m(this,void 0,void 0,function*(){var t;let{five:r,canvas:i,itemMaskMesh:a,data:o}=this,s=i.getContext(`2d`),c=r.observers[e],l=(t=o==null?void 0:o.object_mask_list.find(e=>e.derived_id===String(c.derivedId)))==null?void 0:t.object_mask_url;if(!l)return;let u=yield h(l);i.width=u.width,i.height=u.height,s==null||s.drawImage(u,0,0,u.width,u.height),a.material.uniforms.map.value.image=u,a.material.uniforms.map.value.minFilter=n.LinearFilter,a.material.uniforms.map.value.needsUpdate=!0,a.position.copy(c.position),a.quaternion.copy(c.quaternion),r.scene.add(a),r.needsRender=!0}),this.onFiveMouseMove=e=>{var t;if(this.state.mode!==`mask`||this.five.state.mode!==`Panorama`)return;let{five:r,itemMaskMesh:i}=this,a=r.observers[r.state.panoIndex],o=(t=e.pointers[0])==null?void 0:t.raycaster;if(o){let[e]=o.intersectObjects(this.group.children.filter(e=>e.userData.visible_viewpoint.includes(String(a.derivedId))),!0);e?i.material.uniforms.color.value=e.object.userData.color:i.material.uniforms.color.value=new n.Vector4(0,0,0,1)}},this.onFiveTapGesture=e=>{let{five:n}=this,r=n.observers[n.state.panoIndex];if(e){let[i]=e.intersectObjects(this.group.children.filter(e=>e.userData.visible_viewpoint.includes(String(r.derivedId))),!0);if(i){this.select(i.object.name),this.stopAnimation&&this.stopAnimation(),this.tapPosition=i.point,this.changeTapScreenPosition();let e=new w({opacity:0,scale:0,shadow:2}),r=new w({opacity:0,scale:0,shadow:2});return e.setKeyframes(T,1e3),r.setKeyframes(E,1e3),this.stopAnimation=t.AnimationFrameLoop.shared.add((t,i,...a)=>{var o;let s=e.update(t),c=r.update(t);this.wrapper.firstChild.style.opacity=`${e.value.opacity}`,this.wrapper.firstChild.style.transform=`scale(${e.value.scale})`,this.wrapper.firstChild.style.boxShadow=`0 0 0 ${e.value.shadow}px #fff`,this.wrapper.lastChild.style.opacity=`${r.value.opacity}`,this.wrapper.lastChild.style.transform=`scale(${r.value.scale})`,this.wrapper.lastChild.style.boxShadow=`0 0 0 ${r.value.shadow}px #fff`,s&&c&&((o=this.stopAnimation)==null||o.call(this),this.stopAnimation=void 0,n.getElement().parentElement.removeChild(this.wrapper))},!1,0,10),n.getElement().parentElement.appendChild(this.wrapper),!1}}},this.changeTapScreenPosition=()=>{if(!this.tapPosition)return;let e=this.tapPosition.clone().project(this.five.camera),t=(e.x+1)/2,n=-(e.y-1)/2;this.wrapper.style.opacity=e.z>0&&e.z<1?`1`:`0`,this.wrapper.style.transform=`translate(${t*100}%, ${n*100}%)`},this.onFiveCameraUpdate=e=>{this.changeTapScreenPosition()},this.dispose=()=>{this.disable()},this.five=e,this.state=Object.assign({enabled:!0,visible:!0,mode:`box`,selectedId:null,selectAll:!1},r==null?void 0:r.initialState),this._config=Object.assign({},r==null?void 0:r.config),this.group.rotateX(Math.PI),this.wrapper.className=`ItemMaskPlugin`,this.wrapper.innerHTML=`<span class="ItemMaskPluginCircle"></span><span class="ItemMaskPluginCircle"></span>`,this.style.innerHTML=`
308
308
  .ItemMaskPlugin {
309
309
  position: absolute;
310
310
  top: 0;
@@ -322,7 +322,7 @@ void main() {
322
322
  border-radius: 50%;
323
323
  box-shadow: 0px 0px 0px 2px #fff;
324
324
  }
325
- `,t.state.enabled&&t._enable({userAction:!1}),t}return Object.defineProperty(s.prototype,"config",{get:function(){return N({},this._config)},enumerable:!1,configurable:!0}),s.prototype.updateState=function(e,n){var t=this.state;this.state=N(N({},this.state),e),this.hooks.emit("stateChange",{state:this.state,prevState:t,userAction:n})},s.prototype.load=function(e){return Ce(this,void 0,void 0,function(){var n,t,r=this;return Oe(this,function(l){return this.data=e,n=e.data_list.map(function(i){var h,c=i.position.end.map(function(C){return Number(C)}),d=i.position.start.map(function(C){return Number(C)}),y=Math.abs(c[0]-d[0]),S=Math.abs(c[1]-d[1]),w=Math.abs(c[2]-d[2]),M=c[0]/2+d[0]/2,E=c[1]/2+d[1]/2,O=c[2]/2+d[2]/2,A=new p.Vector3(M,E,O),b=new p.BoxBufferGeometry(y,S,w),T=new p.ShaderMaterial({vertexShader:`
325
+ `,this.state.enabled&&this._enable({userAction:!1})}load(e){return m(this,void 0,void 0,function*(){this.data=e;let t=e.data_list.map(e=>{let t=e.position.end.map(e=>Number(e)),r=e.position.start.map(e=>Number(e)),i=Math.abs(t[0]-r[0]),a=Math.abs(t[1]-r[1]),o=Math.abs(t[2]-r[2]),s=t[0]/2+r[0]/2,c=t[1]/2+r[1]/2,l=t[2]/2+r[2]/2,u=new n.Vector3(s,c,l),d=new n.BoxBufferGeometry(i,a,o),f=new n.ShaderMaterial({vertexShader:`
326
326
  varying vec2 vUv;
327
327
  void main() {
328
328
  vUv = uv;
@@ -347,13 +347,9 @@ void main() {
347
347
  gl_FragColor = vec4(1.0, 1.0, 1.0, alpha / 4.0 * opacity);
348
348
  }
349
349
  }
350
- `,side:p.DoubleSide,visible:r.state.selectedId==="".concat(i.category_name).concat(i.index),uniforms:{opacity:{value:r.state.mode==="box"?1:0}},depthWrite:!1,depthTest:!1,transparent:!0}),f=new p.Mesh(b,T);return f.position.copy(A),f.name="".concat(i.category_name).concat(i.index),f.userData.color=new((h=p.Vector4).bind.apply(h,Ot(Ot([void 0],i.mask_color.map(function(C){return C/255}).reverse(),!1),[1],!1))),f.userData.visible_viewpoint=Object.keys(i.visible_viewpoint),f}),(t=this.group).add.apply(t,n),[2]})})},s.prototype.setState=function(e,n){n===void 0&&(n={});var t=this.state,r=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,r),e.enabled!==void 0&&t.enabled!==e.enabled){var l={userAction:r};e.enabled?this._enable(l):this._disable(l)}},s.prototype.setMode=function(e){this.updateState({mode:e},!1),e==="mask"?(this.group.children.forEach(function(n){n.material.uniforms.opacity.value=0}),this.loadPanoMask(this.five.state.panoIndex)):e==="box"&&(this.itemMaskMesh.material.uniforms.color.value=new p.Vector4(0,0,0,1),this.group.children.forEach(function(n){n.material.uniforms.opacity.value=1}),this.five.needsRender=!0)},s.prototype.select=function(e,n){var t=this,r;this.updateState({selectedId:e!=null?e:null},(r=n==null?void 0:n.userAction)!==null&&r!==void 0?r:!1),this.group.children.forEach(function(l){l.material.visible=t.state.selectAll||l.name===e}),this.five.needsRender=!0},s.prototype.selectAll=function(e){e===void 0&&(e=!0),this.updateState({selectAll:!!e},!1),this.select()},s.prototype._enable=function(e){this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.on("gesture.mousemove",this.onFiveMouseMove),this.five.on("wantsTapGesture",this.onFiveTapGesture),this.five.on("cameraUpdate",this.onFiveCameraUpdate),this.five.scene.add(this.group),document.head.appendChild(this.style)},s.prototype._disable=function(e){this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.off("gesture.mousemove",this.onFiveMouseMove),this.five.off("wantsTapGesture",this.onFiveTapGesture),this.five.off("cameraUpdate",this.onFiveCameraUpdate),this.five.scene.remove(this.group),document.head.removeChild(this.style)},s.prototype.enable=function(e){var n;if(!this.state.enabled){var t=(n=e==null?void 0:e.userAction)!==null&&n!==void 0?n:!0;this.updateState({enabled:!0},t),this._enable({userAction:t})}},s.prototype.disable=function(e){var n;if(this.state.enabled!==!1){var t=(n=e==null?void 0:e.userAction)!==null&&n!==void 0?n:!0;this.updateState({enabled:!1},t),this._disable({userAction:t})}},s})(re.BasePlugin.Controller),vn=function(v,s){return new hn(v,s)};/*! Hammer.JS - v2.0.7 - 2016-04-22
351
- * http://hammerjs.github.io/
352
- *
353
- * Copyright (c) 2016 Jorik Tangelder;
354
- * Licensed under the MIT license */var ft=(function(v,s,e,n){var t=["","webkit","Moz","MS","ms","o"],r=s.createElement?s.createElement("div"):n,l="function",i=Math.round,h=Math.abs,c=Date.now;function d(a,o,u){return setTimeout(b(a,u),o)}function y(a,o,u){return Array.isArray(a)?(S(a,u[o],u),!0):!1}function S(a,o,u){var g;if(a)if(a.forEach)a.forEach(o,u);else if(a.length!==n)for(g=0;g<a.length;)o.call(u,a[g],g,a),g++;else for(g in a)a.hasOwnProperty(g)&&o.call(u,a[g],g,a)}function w(a,o,u){var g="DEPRECATED METHOD: "+o+`
355
- `+u+` AT
356
- `;return function(){var P=new Error("get-stack-trace"),_=P&&P.stack?P.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",V=v.console&&(v.console.warn||v.console.log);return V&&V.call(v.console,g,_),a.apply(this,arguments)}}var M;typeof Object.assign!="function"?M=function(o){if(o===n||o===null)throw new TypeError("Cannot convert undefined or null to object");for(var u=Object(o),g=1;g<arguments.length;g++){var P=arguments[g];if(P!==n&&P!==null)for(var _ in P)P.hasOwnProperty(_)&&(u[_]=P[_])}return u}:M=Object.assign;var E=w(function(o,u,g){for(var P=Object.keys(u),_=0;_<P.length;)(!g||g&&o[P[_]]===n)&&(o[P[_]]=u[P[_]]),_++;return o},"extend","Use `assign`."),O=w(function(o,u){return E(o,u,!0)},"merge","Use `assign`.");function A(a,o,u){var g=o.prototype,P;P=a.prototype=Object.create(g),P.constructor=a,P._super=g,u&&M(P,u)}function b(a,o){return function(){return a.apply(o,arguments)}}function T(a,o){return typeof a==l?a.apply(o&&o[0]||n,o):a}function f(a,o){return a===n?o:a}function C(a,o,u){S(W(o),function(g){a.addEventListener(g,u,!1)})}function x(a,o,u){S(W(o),function(g){a.removeEventListener(g,u,!1)})}function F(a,o){for(;a;){if(a==o)return!0;a=a.parentNode}return!1}function G(a,o){return a.indexOf(o)>-1}function W(a){return a.trim().split(/\s+/g)}function Y(a,o,u){if(a.indexOf&&!u)return a.indexOf(o);for(var g=0;g<a.length;){if(u&&a[g][u]==o||!u&&a[g]===o)return g;g++}return-1}function Z(a){return Array.prototype.slice.call(a,0)}function J(a,o,u){for(var g=[],P=[],_=0;_<a.length;){var V=a[_][o];Y(P,V)<0&&g.push(a[_]),P[_]=V,_++}return g=g.sort(function(ve,ie){return ve[o]>ie[o]}),g}function j(a,o){for(var u,g,P=o[0].toUpperCase()+o.slice(1),_=0;_<t.length;){if(u=t[_],g=u?u+P:o,g in a)return g;_++}return n}var X=1;function L(){return X++}function k(a){var o=a.ownerDocument||a;return o.defaultView||o.parentWindow||v}var I=/mobile|tablet|ip(ad|hone|od)|android/i,B="ontouchstart"in v,K=j(v,"PointerEvent")!==n,ee=B&&I.test(navigator.userAgent),Q="touch",U="pen",ae="mouse",q="kinect",H=25,z=1,ue=2,$=4,te=8,_e=1,Se=2,ke=4,Fe=8,Ee=16,he=Se|ke,me=Fe|Ee,ze=he|me,Ge=["x","y"],Le=["clientX","clientY"];function ce(a,o){var u=this;this.manager=a,this.callback=o,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(g){T(a.options.enable,[a])&&u.handler(g)},this.init()}ce.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(k(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(k(this.element),this.evWin,this.domHandler)}};function Je(a){var o,u=a.options.inputClass;return u?o=u:K?o=wt:ee?o=nt:B?o=At:o=tt,new o(a,$e)}function $e(a,o,u){var g=u.pointers.length,P=u.changedPointers.length,_=o&z&&g-P===0,V=o&($|te)&&g-P===0;u.isFirst=!!_,u.isFinal=!!V,_&&(a.session={}),u.eventType=o,m(a,u),a.emit("hammer.input",u),a.recognize(u),a.session.prevInput=u}function m(a,o){var u=a.session,g=o.pointers,P=g.length;u.firstInput||(u.firstInput=oe(o)),P>1&&!u.firstMultiple?u.firstMultiple=oe(o):P===1&&(u.firstMultiple=!1);var _=u.firstInput,V=u.firstMultiple,se=V?V.center:_.center,ve=o.center=ye(g);o.timeStamp=c(),o.deltaTime=o.timeStamp-_.timeStamp,o.angle=bt(se,ve),o.distance=et(se,ve),R(u,o),o.offsetDirection=Te(o.deltaX,o.deltaY);var ie=Re(o.deltaTime,o.deltaX,o.deltaY);o.overallVelocityX=ie.x,o.overallVelocityY=ie.y,o.overallVelocity=h(ie.x)>h(ie.y)?ie.x:ie.y,o.scale=V?On(V.pointers,g):1,o.rotation=V?Cn(V.pointers,g):0,o.maxPointers=u.prevInput?o.pointers.length>u.prevInput.maxPointers?o.pointers.length:u.prevInput.maxPointers:o.pointers.length,ne(u,o);var we=a.element;F(o.srcEvent.target,we)&&(we=o.srcEvent.target),o.target=we}function R(a,o){var u=o.center,g=a.offsetDelta||{},P=a.prevDelta||{},_=a.prevInput||{};(o.eventType===z||_.eventType===$)&&(P=a.prevDelta={x:_.deltaX||0,y:_.deltaY||0},g=a.offsetDelta={x:u.x,y:u.y}),o.deltaX=P.x+(u.x-g.x),o.deltaY=P.y+(u.y-g.y)}function ne(a,o){var u=a.lastInterval||o,g=o.timeStamp-u.timeStamp,P,_,V,se;if(o.eventType!=te&&(g>H||u.velocity===n)){var ve=o.deltaX-u.deltaX,ie=o.deltaY-u.deltaY,we=Re(g,ve,ie);_=we.x,V=we.y,P=h(we.x)>h(we.y)?we.x:we.y,se=Te(ve,ie),a.lastInterval=o}else P=u.velocity,_=u.velocityX,V=u.velocityY,se=u.direction;o.velocity=P,o.velocityX=_,o.velocityY=V,o.direction=se}function oe(a){for(var o=[],u=0;u<a.pointers.length;)o[u]={clientX:i(a.pointers[u].clientX),clientY:i(a.pointers[u].clientY)},u++;return{timeStamp:c(),pointers:o,center:ye(o),deltaX:a.deltaX,deltaY:a.deltaY}}function ye(a){var o=a.length;if(o===1)return{x:i(a[0].clientX),y:i(a[0].clientY)};for(var u=0,g=0,P=0;P<o;)u+=a[P].clientX,g+=a[P].clientY,P++;return{x:i(u/o),y:i(g/o)}}function Re(a,o,u){return{x:o/a||0,y:u/a||0}}function Te(a,o){return a===o?_e:h(a)>=h(o)?a<0?Se:ke:o<0?Fe:Ee}function et(a,o,u){u||(u=Ge);var g=o[u[0]]-a[u[0]],P=o[u[1]]-a[u[1]];return Math.sqrt(g*g+P*P)}function bt(a,o,u){u||(u=Ge);var g=o[u[0]]-a[u[0]],P=o[u[1]]-a[u[1]];return Math.atan2(P,g)*180/Math.PI}function Cn(a,o){return bt(o[1],o[0],Le)+bt(a[1],a[0],Le)}function On(a,o){return et(o[0],o[1],Le)/et(a[0],a[1],Le)}var _n={mousedown:z,mousemove:ue,mouseup:$},kn="mousedown",Fn="mousemove mouseup";function tt(){this.evEl=kn,this.evWin=Fn,this.pressed=!1,ce.apply(this,arguments)}A(tt,ce,{handler:function(o){var u=_n[o.type];u&z&&(o.button===0||o.button===2)&&(this.pressed=!0),u&ue&&o.which!==1&&(u=$),this.pressed&&(u&$&&(this.pressed=!1),this.callback(this.manager,u,{pointers:[o],changedPointers:[o],pointerType:ae,srcEvent:o}))}});var Ut={pointerdown:z,pointermove:ue,pointerup:$,pointercancel:te,pointerout:te},Ln={2:Q,3:U,4:ae,5:q},Vt="pointerdown",jt="pointermove pointerup pointercancel";v.MSPointerEvent&&!v.PointerEvent&&(Vt="MSPointerDown",jt="MSPointerMove MSPointerUp MSPointerCancel");function wt(){this.evEl=Vt,this.evWin=jt,ce.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}A(wt,ce,{handler:function(o){var u=this.store,g=!1,P=!1,_=o.type.toLowerCase().replace("ms",""),V=Ut[_],se=Ln[o.pointerType]||o.pointerType,ve=se==Q,ie=Y(u,o.pointerId,"pointerId");V&z&&(o.button===0||o.button===2||ve)?ie<0&&(u.push(o),ie=u.length-1):V&($|te)?g=!0:!ve&&o.buttons===0&&(g=!0,P=!0,V=Ut.pointerup),!(ie<0)&&(P||(u[ie]=o),this.callback(this.manager,V,{pointers:u,changedPointers:[o],pointerType:se,srcEvent:u[ie]}),g&&u.splice(ie,1))}});var In={touchstart:z,touchmove:ue,touchend:$,touchcancel:te},Dn="touchstart",Nn="touchstart touchmove touchend touchcancel";function zt(){this.evTarget=Dn,this.evWin=Nn,this.started=!1,ce.apply(this,arguments)}A(zt,ce,{handler:function(o){var u=In[o.type];if(u===z&&(this.started=!0),!!this.started){var g=Bn.call(this,o,u);u&($|te)&&g[0].length-g[1].length===0&&(this.started=!1),this.callback(this.manager,u,{pointers:g[0],changedPointers:g[1],pointerType:Q,srcEvent:o})}}});function Bn(a,o){var u=Z(a.touches),g=Z(a.changedTouches);return o&($|te)&&(u=J(u.concat(g),"identifier")),[u,g]}var Un={touchstart:z,touchmove:ue,touchend:$,touchcancel:te},Vn="touchstart touchmove touchend touchcancel";function nt(){this.evTarget=Vn,this.targetIds={},ce.apply(this,arguments)}A(nt,ce,{handler:function(o){var u=Un[o.type],g=jn.call(this,o,u);g&&this.callback(this.manager,u,{pointers:g[0],changedPointers:g[1],pointerType:Q,srcEvent:o})}});function jn(a,o){var u=Z(a.touches),g=this.targetIds;if(o&(z|ue)&&u.length===1)return g[u[0].identifier]=!0,[u,u];var P,_,V=Z(a.changedTouches),se=[],ve=this.target;if(_=u.filter(function(ie){return F(ie.target,ve)}),o===z)for(P=0;P<_.length;)g[_[P].identifier]=!0,P++;for(P=0;P<V.length;)g[V[P].identifier]&&se.push(V[P]),o&($|te)&&delete g[V[P].identifier],P++;if(se.length)return[J(_.concat(se),"identifier"),se]}var zn=2500,Gt=25;function At(){ce.apply(this,arguments);var a=b(this.handler,this);this.touch=new nt(this.manager,a),this.mouse=new tt(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}A(At,ce,{handler:function(o,u,g){var P=g.pointerType==Q,_=g.pointerType==ae;if(!(_&&g.sourceCapabilities&&g.sourceCapabilities.firesTouchEvents)){if(P)Gn.call(this,u,g);else if(_&&Rn.call(this,g))return;this.callback(o,u,g)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Gn(a,o){a&z?(this.primaryTouch=o.changedPointers[0].identifier,Rt.call(this,o)):a&($|te)&&Rt.call(this,o)}function Rt(a){var o=a.changedPointers[0];if(o.identifier===this.primaryTouch){var u={x:o.clientX,y:o.clientY};this.lastTouches.push(u);var g=this.lastTouches,P=function(){var _=g.indexOf(u);_>-1&&g.splice(_,1)};setTimeout(P,zn)}}function Rn(a){for(var o=a.srcEvent.clientX,u=a.srcEvent.clientY,g=0;g<this.lastTouches.length;g++){var P=this.lastTouches[g],_=Math.abs(o-P.x),V=Math.abs(u-P.y);if(_<=Gt&&V<=Gt)return!0}return!1}var Yt=r?j(r.style,"touchAction"):n,Wt=Yt!==n,Kt="compute",Xt="auto",Tt="manipulation",Ie="none",Ye="pan-x",We="pan-y",rt=Wn();function Pt(a,o){this.manager=a,this.set(o)}Pt.prototype={set:function(a){a==Kt&&(a=this.compute()),Wt&&this.manager.element.style&&rt[a]&&(this.manager.element.style[Yt]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return S(this.manager.recognizers,function(o){T(o.options.enable,[o])&&(a=a.concat(o.getTouchAction()))}),Yn(a.join(" "))},preventDefaults:function(a){var o=a.srcEvent,u=a.offsetDirection;if(this.manager.session.prevented){o.preventDefault();return}var g=this.actions,P=G(g,Ie)&&!rt[Ie],_=G(g,We)&&!rt[We],V=G(g,Ye)&&!rt[Ye];if(P){var se=a.pointers.length===1,ve=a.distance<2,ie=a.deltaTime<250;if(se&&ve&&ie)return}if(!(V&&_)&&(P||_&&u&he||V&&u&me))return this.preventSrc(o)},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};function Yn(a){if(G(a,Ie))return Ie;var o=G(a,Ye),u=G(a,We);return o&&u?Ie:o||u?o?Ye:We:G(a,Tt)?Tt:Xt}function Wn(){if(!Wt)return!1;var a={},o=v.CSS&&v.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(u){a[u]=o?v.CSS.supports("touch-action",u):!0}),a}var at=1,pe=2,Ne=4,xe=8,Pe=xe,Ke=16,be=32;function Me(a){this.options=M({},this.defaults,a||{}),this.id=L(),this.manager=null,this.options.enable=f(this.options.enable,!0),this.state=at,this.simultaneous={},this.requireFail=[]}Me.prototype={defaults:{},set:function(a){return M(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(y(a,"recognizeWith",this))return this;var o=this.simultaneous;return a=it(a,this),o[a.id]||(o[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return y(a,"dropRecognizeWith",this)?this:(a=it(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(y(a,"requireFailure",this))return this;var o=this.requireFail;return a=it(a,this),Y(o,a)===-1&&(o.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(y(a,"dropRequireFailure",this))return this;a=it(a,this);var o=Y(this.requireFail,a);return o>-1&&this.requireFail.splice(o,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){var o=this,u=this.state;function g(P){o.manager.emit(P,a)}u<xe&&g(o.options.event+Ht(u)),g(o.options.event),a.additionalEvent&&g(a.additionalEvent),u>=xe&&g(o.options.event+Ht(u))},tryEmit:function(a){if(this.canEmit())return this.emit(a);this.state=be},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(be|at)))return!1;a++}return!0},recognize:function(a){var o=M({},a);if(!T(this.options.enable,[this,o])){this.reset(),this.state=be;return}this.state&(Pe|Ke|be)&&(this.state=at),this.state=this.process(o),this.state&(pe|Ne|xe|Ke)&&this.tryEmit(o)},process:function(a){},getTouchAction:function(){},reset:function(){}};function Ht(a){return a&Ke?"cancel":a&xe?"end":a&Ne?"move":a&pe?"start":""}function qt(a){return a==Ee?"down":a==Fe?"up":a==Se?"left":a==ke?"right":""}function it(a,o){var u=o.manager;return u?u.get(a):a}function ge(){Me.apply(this,arguments)}A(ge,Me,{defaults:{pointers:1},attrTest:function(a){var o=this.options.pointers;return o===0||a.pointers.length===o},process:function(a){var o=this.state,u=a.eventType,g=o&(pe|Ne),P=this.attrTest(a);return g&&(u&te||!P)?o|Ke:g||P?u&$?o|xe:o&pe?o|Ne:pe:be}});function ot(){ge.apply(this,arguments),this.pX=null,this.pY=null}A(ot,ge,{defaults:{event:"pan",threshold:10,pointers:1,direction:ze},getTouchAction:function(){var a=this.options.direction,o=[];return a&he&&o.push(We),a&me&&o.push(Ye),o},directionTest:function(a){var o=this.options,u=!0,g=a.distance,P=a.direction,_=a.deltaX,V=a.deltaY;return P&o.direction||(o.direction&he?(P=_===0?_e:_<0?Se:ke,u=_!=this.pX,g=Math.abs(a.deltaX)):(P=V===0?_e:V<0?Fe:Ee,u=V!=this.pY,g=Math.abs(a.deltaY))),a.direction=P,u&&g>o.threshold&&P&o.direction},attrTest:function(a){return ge.prototype.attrTest.call(this,a)&&(this.state&pe||!(this.state&pe)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var o=qt(a.direction);o&&(a.additionalEvent=this.options.event+o),this._super.emit.call(this,a)}});function Mt(){ge.apply(this,arguments)}A(Mt,ge,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ie]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&pe)},emit:function(a){if(a.scale!==1){var o=a.scale<1?"in":"out";a.additionalEvent=this.options.event+o}this._super.emit.call(this,a)}});function St(){Me.apply(this,arguments),this._timer=null,this._input=null}A(St,Me,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Xt]},process:function(a){var o=this.options,u=a.pointers.length===o.pointers,g=a.distance<o.threshold,P=a.deltaTime>o.time;if(this._input=a,!g||!u||a.eventType&($|te)&&!P)this.reset();else if(a.eventType&z)this.reset(),this._timer=d(function(){this.state=Pe,this.tryEmit()},o.time,this);else if(a.eventType&$)return Pe;return be},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===Pe&&(a&&a.eventType&$?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}});function Et(){ge.apply(this,arguments)}A(Et,ge,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ie]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&pe)}});function xt(){ge.apply(this,arguments)}A(xt,ge,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:he|me,pointers:1},getTouchAction:function(){return ot.prototype.getTouchAction.call(this)},attrTest:function(a){var o=this.options.direction,u;return o&(he|me)?u=a.overallVelocity:o&he?u=a.overallVelocityX:o&me&&(u=a.overallVelocityY),this._super.attrTest.call(this,a)&&o&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&h(u)>this.options.velocity&&a.eventType&$},emit:function(a){var o=qt(a.offsetDirection);o&&this.manager.emit(this.options.event+o,a),this.manager.emit(this.options.event,a)}});function st(){Me.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}A(st,Me,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Tt]},process:function(a){var o=this.options,u=a.pointers.length===o.pointers,g=a.distance<o.threshold,P=a.deltaTime<o.time;if(this.reset(),a.eventType&z&&this.count===0)return this.failTimeout();if(g&&P&&u){if(a.eventType!=$)return this.failTimeout();var _=this.pTime?a.timeStamp-this.pTime<o.interval:!0,V=!this.pCenter||et(this.pCenter,a.center)<o.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,!V||!_?this.count=1:this.count+=1,this._input=a;var se=this.count%o.taps;if(se===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=Pe,this.tryEmit()},o.interval,this),pe):Pe}return be},failTimeout:function(){return this._timer=d(function(){this.state=be},this.options.interval,this),be},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Pe&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Be(a,o){return o=o||{},o.recognizers=f(o.recognizers,Be.defaults.preset),new Ct(a,o)}Be.VERSION="2.0.7",Be.defaults={domEvents:!1,touchAction:Kt,enable:!0,inputTarget:null,inputClass:null,preset:[[Et,{enable:!1}],[Mt,{enable:!1},["rotate"]],[xt,{direction:he}],[ot,{direction:he},["swipe"]],[st],[st,{event:"doubletap",taps:2},["tap"]],[St]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Kn=1,Zt=2;function Ct(a,o){this.options=M({},Be.defaults,o||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=Je(this),this.touchAction=new Pt(this,this.options.touchAction),Qt(this,!0),S(this.options.recognizers,function(u){var g=this.add(new u[0](u[1]));u[2]&&g.recognizeWith(u[2]),u[3]&&g.requireFailure(u[3])},this)}Ct.prototype={set:function(a){return M(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?Zt:Kn},recognize:function(a){var o=this.session;if(!o.stopped){this.touchAction.preventDefaults(a);var u,g=this.recognizers,P=o.curRecognizer;(!P||P&&P.state&Pe)&&(P=o.curRecognizer=null);for(var _=0;_<g.length;)u=g[_],o.stopped!==Zt&&(!P||u==P||u.canRecognizeWith(P))?u.recognize(a):u.reset(),!P&&u.state&(pe|Ne|xe)&&(P=o.curRecognizer=u),_++}},get:function(a){if(a instanceof Me)return a;for(var o=this.recognizers,u=0;u<o.length;u++)if(o[u].options.event==a)return o[u];return null},add:function(a){if(y(a,"add",this))return this;var o=this.get(a.options.event);return o&&this.remove(o),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(y(a,"remove",this))return this;if(a=this.get(a),a){var o=this.recognizers,u=Y(o,a);u!==-1&&(o.splice(u,1),this.touchAction.update())}return this},on:function(a,o){if(a!==n&&o!==n){var u=this.handlers;return S(W(a),function(g){u[g]=u[g]||[],u[g].push(o)}),this}},off:function(a,o){if(a!==n){var u=this.handlers;return S(W(a),function(g){o?u[g]&&u[g].splice(Y(u[g],o),1):delete u[g]}),this}},emit:function(a,o){this.options.domEvents&&Xn(a,o);var u=this.handlers[a]&&this.handlers[a].slice();if(!(!u||!u.length)){o.type=a,o.preventDefault=function(){o.srcEvent.preventDefault()};for(var g=0;g<u.length;)u[g](o),g++}},destroy:function(){this.element&&Qt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Qt(a,o){var u=a.element;if(u.style){var g;S(a.options.cssProps,function(P,_){g=j(u.style,_),o?(a.oldCssProps[g]=u.style[g],u.style[g]=P):u.style[g]=a.oldCssProps[g]||""}),o||(a.oldCssProps={})}}function Xn(a,o){var u=s.createEvent("Event");u.initEvent(a,!0,!0),u.gesture=o,o.target.dispatchEvent(u)}return M(Be,{INPUT_START:z,INPUT_MOVE:ue,INPUT_END:$,INPUT_CANCEL:te,STATE_POSSIBLE:at,STATE_BEGAN:pe,STATE_CHANGED:Ne,STATE_ENDED:xe,STATE_RECOGNIZED:Pe,STATE_CANCELLED:Ke,STATE_FAILED:be,DIRECTION_NONE:_e,DIRECTION_LEFT:Se,DIRECTION_RIGHT:ke,DIRECTION_UP:Fe,DIRECTION_DOWN:Ee,DIRECTION_HORIZONTAL:he,DIRECTION_VERTICAL:me,DIRECTION_ALL:ze,Manager:Ct,Input:ce,TouchAction:Pt,TouchInput:nt,MouseInput:tt,PointerEventInput:wt,TouchMouseInput:At,SingleTouchInput:zt,Recognizer:Me,AttrRecognizer:ge,Tap:st,Pan:ot,Swipe:xt,Pinch:Mt,Rotate:Et,Press:St,on:C,off:x,each:S,merge:O,extend:E,assign:M,inherit:A,bindFn:b,prefixed:j}),Be})(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{}),De=function(v,s){s===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),s===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=v,this.domElement=s,this.enabled=!0,this.target=new D.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:D.MOUSE.ROTATE,MIDDLE:D.MOUSE.DOLLY,RIGHT:D.MOUSE.PAN},this.touches={ONE:D.TOUCH.ROTATE,TWO:D.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return c.phi},this.getAzimuthalAngle=function(){return c.theta},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(n),e.update(),i=l.NONE},this.update=(function(){var m=new D.Vector3,R=new D.Quaternion().setFromUnitVectors(v.up,new D.Vector3(0,1,0)),ne=R.clone().inverse(),oe=new D.Vector3,ye=new D.Quaternion;return function(){var Te=e.object.position;return m.copy(Te).sub(e.target),m.applyQuaternion(R),c.setFromVector3(m),e.autoRotate&&i===l.NONE&&W(F()),e.enableDamping?(c.theta+=d.theta*e.dampingFactor,c.phi+=d.phi*e.dampingFactor):(c.theta+=d.theta,c.phi+=d.phi),c.theta=Math.max(e.minAzimuthAngle,Math.min(e.maxAzimuthAngle,c.theta)),c.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,c.phi)),c.makeSafe(),c.radius*=y,c.radius=Math.max(e.minDistance,Math.min(e.maxDistance,c.radius)),e.enableDamping===!0?e.target.addScaledVector(S,e.dampingFactor):e.target.add(S),m.setFromSpherical(c),m.applyQuaternion(ne),Te.copy(e.target).add(m),e.object.lookAt(e.target),e.enableDamping===!0?(d.theta*=1-e.dampingFactor,d.phi*=1-e.dampingFactor,S.multiplyScalar(1-e.dampingFactor)):(d.set(0,0,0),S.set(0,0,0)),y=1,w||oe.distanceToSquared(e.object.position)>h||8*(1-ye.dot(e.object.quaternion))>h?(e.dispatchEvent(n),oe.copy(e.object.position),ye.copy(e.object.quaternion),w=!1,!0):!1}})(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",$e,!1),e.domElement.removeEventListener("mousedown",Ee,!1),e.domElement.removeEventListener("wheel",ze,!1),e.domElement.removeEventListener("touchstart",Le,!1),e.domElement.removeEventListener("touchend",Je,!1),e.domElement.removeEventListener("touchmove",ce,!1),document.removeEventListener("mousemove",he,!1),document.removeEventListener("mouseup",me,!1),e.domElement.removeEventListener("keydown",Ge,!1)};var e=this,n={type:"change"},t={type:"start"},r={type:"end"},l={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},i=l.NONE,h=1e-6,c=new D.Spherical,d=new D.Spherical,y=1,S=new D.Vector3,w=!1,M=new D.Vector2,E=new D.Vector2,O=new D.Vector2,A=new D.Vector2,b=new D.Vector2,T=new D.Vector2,f=new D.Vector2,C=new D.Vector2,x=new D.Vector2;function F(){return 2*Math.PI/60/60*e.autoRotateSpeed}function G(){return Math.pow(.95,e.zoomSpeed)}function W(m){d.theta-=m}function Y(m){d.phi-=m}var Z=(function(){var m=new D.Vector3;return function(ne,oe){m.setFromMatrixColumn(oe,0),m.multiplyScalar(-ne),S.add(m)}})(),J=(function(){var m=new D.Vector3;return function(ne,oe){e.screenSpacePanning===!0?m.setFromMatrixColumn(oe,1):(m.setFromMatrixColumn(oe,0),m.crossVectors(e.object.up,m)),m.multiplyScalar(ne),S.add(m)}})(),j=(function(){var m=new D.Vector3;return function(ne,oe){var ye=e.domElement;if(e.object.isPerspectiveCamera){var Re=e.object.position;m.copy(Re).sub(e.target);var Te=m.length();Te*=Math.tan(e.object.fov/2*Math.PI/180),Z(2*ne*Te/ye.clientHeight,e.object.matrix),J(2*oe*Te/ye.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(Z(ne*(e.object.right-e.object.left)/e.object.zoom/ye.clientWidth,e.object.matrix),J(oe*(e.object.top-e.object.bottom)/e.object.zoom/ye.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}})();function X(m){e.object.isPerspectiveCamera?y/=m:e.object.isOrthographicCamera?(e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom*m)),e.object.updateProjectionMatrix(),w=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function L(m){e.object.isPerspectiveCamera?y*=m:e.object.isOrthographicCamera?(e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/m)),e.object.updateProjectionMatrix(),w=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function k(m){M.set(m.clientX,m.clientY)}function I(m){f.set(m.clientX,m.clientY)}function B(m){A.set(m.clientX,m.clientY)}function K(m){E.set(m.clientX,m.clientY),O.subVectors(E,M).multiplyScalar(e.rotateSpeed);var R=e.domElement;W(2*Math.PI*O.x/R.clientHeight),Y(2*Math.PI*O.y/R.clientHeight),M.copy(E),e.update()}function ee(m){C.set(m.clientX,m.clientY),x.subVectors(C,f),x.y>0?X(G()):x.y<0&&L(G()),f.copy(C),e.update()}function Q(m){b.set(m.clientX,m.clientY),T.subVectors(b,A).multiplyScalar(e.panSpeed),j(T.x,T.y),A.copy(b),e.update()}function U(m){m.deltaY<0?L(G()):m.deltaY>0&&X(G()),e.update()}function ae(m){var R=!1;switch(m.keyCode){case e.keys.UP:j(0,e.keyPanSpeed),R=!0;break;case e.keys.BOTTOM:j(0,-e.keyPanSpeed),R=!0;break;case e.keys.LEFT:j(e.keyPanSpeed,0),R=!0;break;case e.keys.RIGHT:j(-e.keyPanSpeed,0),R=!0;break}R&&(m.preventDefault(),e.update())}function q(m){if(m.touches.length==1)M.set(m.touches[0].pageX,m.touches[0].pageY);else{var R=.5*(m.touches[0].pageX+m.touches[1].pageX),ne=.5*(m.touches[0].pageY+m.touches[1].pageY);M.set(R,ne)}}function H(m){if(m.touches.length==1)A.set(m.touches[0].pageX,m.touches[0].pageY);else{var R=.5*(m.touches[0].pageX+m.touches[1].pageX),ne=.5*(m.touches[0].pageY+m.touches[1].pageY);A.set(R,ne)}}function z(m){var R=m.touches[0].pageX-m.touches[1].pageX,ne=m.touches[0].pageY-m.touches[1].pageY,oe=Math.sqrt(R*R+ne*ne);f.set(0,oe)}function ue(m){e.enableZoom&&z(m),e.enablePan&&H(m)}function $(m){e.enableZoom&&z(m),e.enableRotate&&q(m)}function te(m){if(m.touches.length==1)E.set(m.touches[0].pageX,m.touches[0].pageY);else{var R=.5*(m.touches[0].pageX+m.touches[1].pageX),ne=.5*(m.touches[0].pageY+m.touches[1].pageY);E.set(R,ne)}O.subVectors(E,M).multiplyScalar(e.rotateSpeed);var oe=e.domElement;W(2*Math.PI*O.x/oe.clientHeight),Y(2*Math.PI*O.y/oe.clientHeight),M.copy(E)}function _e(m){if(m.touches.length==1)b.set(m.touches[0].pageX,m.touches[0].pageY);else{var R=.5*(m.touches[0].pageX+m.touches[1].pageX),ne=.5*(m.touches[0].pageY+m.touches[1].pageY);b.set(R,ne)}T.subVectors(b,A).multiplyScalar(e.panSpeed),j(T.x,T.y),A.copy(b)}function Se(m){var R=m.touches[0].pageX-m.touches[1].pageX,ne=m.touches[0].pageY-m.touches[1].pageY,oe=Math.sqrt(R*R+ne*ne);C.set(0,oe),x.set(0,Math.pow(C.y/f.y,e.zoomSpeed)),X(x.y),f.copy(C)}function ke(m){e.enableZoom&&Se(m),e.enablePan&&_e(m)}function Fe(m){e.enableZoom&&Se(m),e.enableRotate&&te(m)}function Ee(m){if(e.enabled!==!1){m.preventDefault(),e.domElement.focus?e.domElement.focus():window.focus();var R;switch(m.button){case 0:R=e.mouseButtons.LEFT;break;case 1:R=e.mouseButtons.MIDDLE;break;case 2:R=e.mouseButtons.RIGHT;break;default:R=-1}switch(R){case D.MOUSE.DOLLY:if(e.enableZoom===!1)return;I(m),i=l.DOLLY;break;case D.MOUSE.ROTATE:if(m.ctrlKey||m.metaKey||m.shiftKey){if(e.enablePan===!1)return;B(m),i=l.PAN}else{if(e.enableRotate===!1)return;k(m),i=l.ROTATE}break;case D.MOUSE.PAN:if(m.ctrlKey||m.metaKey||m.shiftKey){if(e.enableRotate===!1)return;k(m),i=l.ROTATE}else{if(e.enablePan===!1)return;B(m),i=l.PAN}break;default:i=l.NONE}i!==l.NONE&&(document.addEventListener("mousemove",he,!1),document.addEventListener("mouseup",me,!1),e.dispatchEvent(t))}}function he(m){if(e.enabled!==!1)switch(m.preventDefault(),i){case l.ROTATE:if(e.enableRotate===!1)return;K(m);break;case l.DOLLY:if(e.enableZoom===!1)return;ee(m);break;case l.PAN:if(e.enablePan===!1)return;Q(m);break}}function me(m){e.enabled!==!1&&(document.removeEventListener("mousemove",he,!1),document.removeEventListener("mouseup",me,!1),e.dispatchEvent(r),i=l.NONE)}function ze(m){e.enabled===!1||e.enableZoom===!1||i!==l.NONE&&i!==l.ROTATE||(m.preventDefault(),m.stopPropagation(),e.dispatchEvent(t),U(m),e.dispatchEvent(r))}function Ge(m){e.enabled===!1||e.enableKeys===!1||e.enablePan===!1||ae(m)}function Le(m){if(e.enabled!==!1){switch(m.preventDefault(),m.touches.length){case 1:switch(e.touches.ONE){case D.TOUCH.ROTATE:if(e.enableRotate===!1)return;q(m),i=l.TOUCH_ROTATE;break;case D.TOUCH.PAN:if(e.enablePan===!1)return;H(m),i=l.TOUCH_PAN;break;default:i=l.NONE}break;case 2:switch(e.touches.TWO){case D.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;ue(m),i=l.TOUCH_DOLLY_PAN;break;case D.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;$(m),i=l.TOUCH_DOLLY_ROTATE;break;default:i=l.NONE}break;default:i=l.NONE}i!==l.NONE&&e.dispatchEvent(t)}}function ce(m){if(e.enabled!==!1)switch(m.preventDefault(),m.stopPropagation(),i){case l.TOUCH_ROTATE:if(e.enableRotate===!1)return;te(m),e.update();break;case l.TOUCH_PAN:if(e.enablePan===!1)return;_e(m),e.update();break;case l.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;ke(m),e.update();break;case l.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Fe(m),e.update();break;default:i=l.NONE}}function Je(m){e.enabled!==!1&&(e.dispatchEvent(r),i=l.NONE)}function $e(m){e.enabled!==!1&&m.preventDefault()}e.domElement.addEventListener("contextmenu",$e,!1),e.domElement.addEventListener("mousedown",Ee,!1),e.domElement.addEventListener("wheel",ze,!1),e.domElement.addEventListener("touchstart",Le,!1),e.domElement.addEventListener("touchend",Je,!1),e.domElement.addEventListener("touchmove",ce,!1),e.domElement.addEventListener("keydown",Ge,!1),e.domElement.tabIndex===-1&&(e.domElement.tabIndex=0),this.update()};De.prototype=Object.create(D.EventDispatcher.prototype),De.prototype.constructor=De;var ht=function(v,s){De.call(this,v,s),this.mouseButtons.LEFT=D.MOUSE.PAN,this.mouseButtons.RIGHT=D.MOUSE.ROTATE,this.touches.ONE=D.TOUCH.PAN,this.touches.TWO=D.TOUCH.DOLLY_ROTATE};ht.prototype=Object.create(D.EventDispatcher.prototype),ht.prototype.constructor=ht;var Ae=function(v){D.Object3D.call(this),this.element=v,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.addEventListener("removed",function(){this.traverse(function(s){s.element instanceof Element&&s.element.parentNode!==null&&s.element.parentNode.removeChild(s.element)})})};Ae.prototype=Object.create(D.Object3D.prototype),Ae.prototype.constructor=Ae;var qe=function(v){Ae.call(this,v)};qe.prototype=Object.create(Ae.prototype),qe.prototype.constructor=qe;var kt=function(){var v=this,s,e,n,t,r=new D.Matrix4,l={camera:{fov:0,style:""},objects:new WeakMap},i=document.createElement("div");i.style.overflow="hidden",this.domElement=i;var h=document.createElement("div");h.style.WebkitTransformStyle="preserve-3d",h.style.transformStyle="preserve-3d",h.style.pointerEvents="none",i.appendChild(h);var c=/Trident/i.test(navigator.userAgent);this.getSize=function(){return{width:s,height:e}},this.setSize=function(A,b){s=A,e=b,n=s/2,t=e/2,i.style.width=A+"px",i.style.height=b+"px",h.style.width=A+"px",h.style.height=b+"px"};function d(A){return Math.abs(A)<1e-10?0:A}function y(A){var b=A.elements;return"matrix3d("+d(b[0])+","+d(-b[1])+","+d(b[2])+","+d(b[3])+","+d(b[4])+","+d(-b[5])+","+d(b[6])+","+d(b[7])+","+d(b[8])+","+d(-b[9])+","+d(b[10])+","+d(b[11])+","+d(b[12])+","+d(-b[13])+","+d(b[14])+","+d(b[15])+")"}function S(A,b){var T=A.elements,f="matrix3d("+d(T[0])+","+d(T[1])+","+d(T[2])+","+d(T[3])+","+d(-T[4])+","+d(-T[5])+","+d(-T[6])+","+d(-T[7])+","+d(T[8])+","+d(T[9])+","+d(T[10])+","+d(T[11])+","+d(T[12])+","+d(T[13])+","+d(T[14])+","+d(T[15])+")";return c?"translate(-50%,-50%)translate("+n+"px,"+t+"px)"+b+f:"translate(-50%,-50%)"+f}function w(A,b,T,f){if(A instanceof Ae){A.onBeforeRender(v,b,T);var C;A instanceof qe?(r.copy(T.matrixWorldInverse),r.transpose(),r.copyPosition(A.matrixWorld),r.scale(A.scale),r.elements[3]=0,r.elements[7]=0,r.elements[11]=0,r.elements[15]=1,C=S(r,f)):C=S(A.matrixWorld,f);var x=A.element,F=l.objects.get(A);if(F===void 0||F.style!==C){x.style.WebkitTransform=C,x.style.transform=C;var G={style:C};c&&(G.distanceToCameraSquared=M(T,A)),l.objects.set(A,G)}x.style.display=A.visible?"":"none",x.parentNode!==h&&h.appendChild(x),A.onAfterRender(v,b,T)}for(var W=0,Y=A.children.length;W<Y;W++)w(A.children[W],b,T,f)}var M=(function(){var A=new D.Vector3,b=new D.Vector3;return function(T,f){return A.setFromMatrixPosition(T.matrixWorld),b.setFromMatrixPosition(f.matrixWorld),A.distanceToSquared(b)}})();function E(A){var b=[];return A.traverse(function(T){T instanceof Ae&&b.push(T)}),b}function O(A){for(var b=E(A).sort(function(x,F){var G=l.objects.get(x).distanceToCameraSquared,W=l.objects.get(F).distanceToCameraSquared;return G-W}),T=b.length,f=0,C=b.length;f<C;f++)b[f].element.style.zIndex=T-f}this.render=function(A,b){var T=b.projectionMatrix.elements[5]*t;if(l.camera.fov!==T&&(b.isPerspectiveCamera?(i.style.WebkitPerspective=T+"px",i.style.perspective=T+"px"):(i.style.WebkitPerspective="",i.style.perspective=""),l.camera.fov=T),A.autoUpdate===!0&&A.updateMatrixWorld(),b.parent===null&&b.updateMatrixWorld(),b.isOrthographicCamera)var f=-(b.right+b.left)/2,C=(b.top+b.bottom)/2;var x=b.isOrthographicCamera?"scale("+T+")translate("+d(f)+"px,"+d(C)+"px)"+y(b.matrixWorldInverse):"translateZ("+T+"px)"+y(b.matrixWorldInverse),F=x+"translate("+n+"px,"+t+"px)";l.camera.style!==F&&!c&&(h.style.WebkitTransform=F,h.style.transform=F,l.camera.style=F),w(A,A,b,x),c&&O(A)}};function Ft(v,s,e){var n=s.getBoundingClientRect(),t=n.top,r=n.left,l=n.width,i=n.height;return new p.Vector2((v.x-r)/l*2-1,-(v.y-t)/i*2+1)}var Lt=(function(v){de(s,v);function s(e,n,t,r,l){var i=v.call(this)||this;i.type="RoundedBoxGeometry",l=isNaN(l)?1:Math.max(1,Math.floor(l)),e=isNaN(e)?1:e,n=isNaN(n)?1:n,t=isNaN(t)?1:t,r=isNaN(r)?.15:r,r=Math.min(r,Math.min(e,Math.min(n,Math.min(t)))/2);var h=e/2-r,c=n/2-r,d=t/2-r;i.parameters={width:e,height:n,depth:t,radius:r,radiusSegments:l};var y=l+1,S=y*l+1<<3,w=new p.BufferAttribute(new Float32Array(S*3),3),M=new p.BufferAttribute(new Float32Array(S*3),3),E=[],O=[];new p.Vector3;var A=new p.Vector3,b=[],T=[],f=[],C=y*l,x=y*l+1;F(),W(),G(),Y(),J(),Z();function F(){for(var L=[new p.Vector3(1,1,1),new p.Vector3(1,1,-1),new p.Vector3(-1,1,-1),new p.Vector3(-1,1,1),new p.Vector3(1,-1,1),new p.Vector3(1,-1,-1),new p.Vector3(-1,-1,-1),new p.Vector3(-1,-1,1)],k=0;k<8;k++)E.push([]),O.push([]);for(var I=Math.PI/2,B=new p.Vector3(h,c,d),K=0;K<=l;K++){var ee=K/l,Q=ee*I,U=Math.cos(Q),ae=Math.sin(Q);if(K==l){A.set(0,1,0);var q=A.clone().multiplyScalar(r).add(B);E[0].push(q),b.push(q);var H=A.clone();O[0].push(H),T.push(H);continue}for(var z=0;z<=l;z++){var ue=z/l,$=ue*I;A.x=U*Math.cos($),A.y=ae,A.z=U*Math.sin($);var q=A.clone().multiplyScalar(r).add(B);E[0].push(q),b.push(q);var H=A.clone().normalize();O[0].push(H),T.push(H)}}for(var te=1;te<8;te++)for(var k=0;k<E[0].length;k++){var q=E[0][k].clone().multiply(L[te]);E[te].push(q),b.push(q);var H=O[0][k].clone().multiply(L[te]);O[te].push(H),T.push(H)}}function G(){for(var L=[!0,!1,!0,!1,!1,!0,!1,!0],k=y*(l-1),I=0;I<8;I++){for(var B=x*I,K=0;K<l-1;K++)for(var ee=K*y,Q=(K+1)*y,U=0;U<l;U++){var ae=U+1,q=B+ee+U,H=B+ee+ae,z=B+Q+U,ue=B+Q+ae;L[I]?(f.push(q),f.push(z),f.push(H),f.push(H),f.push(z),f.push(ue)):(f.push(q),f.push(H),f.push(z),f.push(H),f.push(ue),f.push(z))}for(var U=0;U<l;U++){var q=B+k+U,H=B+k+U+1,z=B+C;L[I]?(f.push(q),f.push(z),f.push(H)):(f.push(q),f.push(H),f.push(z))}}}function W(){var L=C,k=C+x,I=C+x*2,B=C+x*3;f.push(L),f.push(k),f.push(I),f.push(L),f.push(I),f.push(B),L=C+x*4,k=C+x*5,I=C+x*6,B=C+x*7,f.push(L),f.push(I),f.push(k),f.push(L),f.push(B),f.push(I),L=0,k=x,I=x*4,B=x*5,f.push(L),f.push(I),f.push(k),f.push(k),f.push(I),f.push(B),L=x*2,k=x*3,I=x*6,B=x*7,f.push(L),f.push(I),f.push(k),f.push(k),f.push(I),f.push(B),L=l,k=l+x*3,I=l+x*4,B=l+x*7,f.push(L),f.push(k),f.push(I),f.push(k),f.push(B),f.push(I),L=l+x,k=l+x*2,I=l+x*5,B=l+x*6,f.push(L),f.push(I),f.push(k),f.push(k),f.push(I),f.push(B)}function Y(){for(var L=0;L<4;L++)for(var k=L*x,I=4*x+k,B=(L&1)===1,K=0;K<l;K++){var ee=K+1,Q=k+K,U=k+ee,ae=I+K,q=I+ee;B?(f.push(Q),f.push(ae),f.push(U),f.push(U),f.push(ae),f.push(q)):(f.push(Q),f.push(U),f.push(ae),f.push(U),f.push(q),f.push(ae))}}function Z(){for(var L=[0,2,4,6],k=[1,3,5,7],I=0;I<4;I++)for(var B=x*L[I],K=x*k[I],ee=1>=I,Q=0;Q<l;Q++){var U=Q*y,ae=(Q+1)*y,q=B+U,H=B+ae,z=K+U,ue=K+ae;ee?(f.push(q),f.push(z),f.push(H),f.push(H),f.push(z),f.push(ue)):(f.push(q),f.push(H),f.push(z),f.push(H),f.push(ue),f.push(z))}}function J(){for(var L=l-1,k=[0,1,4,5],I=[3,2,7,6],B=[0,1,1,0],K=0;K<4;K++)for(var ee=k[K]*x,Q=I[K]*x,U=0;U<=L;U++){var ae=ee+l+U*y,q=ee+(U!=L?l+(U+1)*y:x-1),H=Q+l+U*y,z=Q+(U!=L?l+(U+1)*y:x-1);B[K]?(f.push(ae),f.push(H),f.push(q),f.push(q),f.push(H),f.push(z)):(f.push(ae),f.push(q),f.push(H),f.push(q),f.push(z),f.push(H))}}for(var j=0,X=0;X<b.length;X++)w.setXYZ(j,b[X].x,b[X].y,b[X].z),M.setXYZ(j,T[X].x,T[X].y,T[X].z),j++;return i.setIndex(new p.BufferAttribute(new Uint16Array(f),1)),i.setAttribute("position",w),i.setAttribute("normal",M),i}return s})(p.BufferGeometry);function Ue(v,s){return typeof v!="number"||typeof s!="number"?!1:Math.abs(v-s)<.001}function Ve(v,s,e,n){n===void 0&&(n=function(r){return r});var t=n(e);return v*(1-t)+s*t}var le=Number((Math.PI/2).toFixed(5));function dn(v,s,e){var n=new p.Shape;return n.moveTo(e,0),n.lineTo(v-e,0),n.absarc(v-e,e,e,-le,0,!1),n.lineTo(v,s-e),n.absarc(v-e,s-e,e,0,le,!1),n.lineTo(e,s),n.absarc(e,s-e,e,le,Math.PI,!1),n.lineTo(0,e),n.absarc(e,e,e,Math.PI,Math.PI*1.5,!1),n}var je=function(v){var s=document.createElement("div");s.innerText=v;var e=new Ae(s);return e.name=v,e.scale.set(.3,.3,.3),s.style.pointerEvents="none",s.style.backfaceVisibility="hidden",e},Ze=function(v){var s=new p.PlaneGeometry(5,5),e=new p.MeshBasicMaterial({transparent:!0,opacity:0}),n=new p.Mesh(s,e),t=document.createElement("div");t.innerText=v;var r=new Ae(t);return r.name=v,r.scale.set(.3,.3,.3),t.style.color="#ffffff",t.style.opacity="0.5",t.style.pointerEvents="none",t.style.backfaceVisibility="hidden",n.rotateX(-le),n.add(r),n},pn=(function(v){de(s,v);function s(e,n){var t=v.call(this,e)||this;t.camera=new fe.Camera(90),t.scene=new p.Scene,t.renderer=new p.WebGLRenderer({antialias:!0,alpha:!0}),t.css3drenderer=new kt,t.ambientLight=new p.AmbientLight(16777215,.7),t.wrapper=document.createElement("div"),t.arrows=document.createElement("div"),t.arrowLeft=document.createElement("div"),t.arrowRight=document.createElement("div"),t.arrowFront=document.createElement("div"),t.arrowBack=document.createElement("div"),t.arrowTop=document.createElement("div"),t.arrowBottom=document.createElement("div"),t.spherical=null,t.dragging=!1,t.style=document.createElement("style"),t.directionalLight=new p.DirectionalLight(16777215,.2),t.box=new p.Mesh(new Lt(8,8,8,.5,20),new p.MeshPhongMaterial({color:16777215})),t.faces=new p.Group,t.orient=function(i){var h=i.longitude,c=i.latitude;t.dragging=!1,t.spherical=null,t.controls.enableDamping=!1,t.five.setState(Object.assign({latitude:c},h!==void 0?{longitude:h+t.config.fixedLongitude}:{})),t.five.ready().then(function(){t.controls.enableDamping=!0,t.setState({arrowsVisible:!0})})},t.onRenderFrame=function(){var i,h,c,d,y;if(t.renderer.render(t.scene,t.camera),t.css3drenderer.render(t.scene,t.camera),t.directionalLight.position.copy(t.camera.position),(i=t.controls)===null||i===void 0||i.update(),t.dragging){t.camera.computePose(),t.updateByCamera();var S=t.camera.pose,w=S.longitude,M=S.latitude;t.five.setState({longitude:w,latitude:M},!0),t.updateArrows({longitude:w,latitude:M})}else if(t.spherical&&(!Ue(t.spherical.pi,(h=t.controls)===null||h===void 0?void 0:h.getPolarAngle())||!Ue(t.spherical.theta,(c=t.controls)===null||c===void 0?void 0:c.getAzimuthalAngle()))){t.spherical={pi:(d=t.controls)===null||d===void 0?void 0:d.getPolarAngle(),theta:(y=t.controls)===null||y===void 0?void 0:y.getAzimuthalAngle()},t.camera.computePose(),t.updateByCamera();var E=t.camera.pose,w=E.longitude,M=E.latitude;t.five.setState({longitude:w,latitude:M},!0),t.updateArrows({longitude:w,latitude:M})}else t.spherical=null},t.onTapGesture=function(i){var h=i.pointers[0].clientX,c=i.pointers[0].clientY,d=Ft({x:h,y:c},t.wrapper),y=new p.Raycaster;y.setFromCamera(d,t.camera);var S=y.intersectObjects(t.faces.children,!1)[0];if(S){var w=S.object.userData,M=w.longitude,E=w.latitude;t.orient({longitude:M,latitude:E})}},t.onFiveWantsGesture=function(){if(t.spherical)return!1},t.onFiveModeChange=function(i){t.controls&&(t.controls.maxPolarAngle=i==="Topview"?0:le)},t.onCameraUpdate=function(i){var h=i.state;if(!t.dragging&&!t.spherical){var c=h.longitude,d=h.latitude;t.camera.pose.longitude===c&&t.camera.pose.latitude===d||(t.camera.setFromPose({longitude:c,latitude:d,distance:20,offset:new p.Vector3(0,0,0)}),t.updateByCamera(),t.updateArrows({longitude:c,latitude:d}))}},t.onPanStart=function(i){t.dragging=!0,t.spherical={}},t.onMouseMove=function(i){if(!t.dragging){var h=Ft({x:i.clientX,y:i.clientY},t.wrapper),c=new p.Raycaster;c.setFromCamera(h,t.camera);var d=c.intersectObjects(t.faces.children,!1)[0];t.faces.children.forEach(function(y){y.material.opacity=0,y.children[0].element.style.color=""}),d&&(d.object.material.opacity=.3,d.object.children[0].element.style.color="#336dff")}},t.onPanEnd=function(i){t.dragging=!1,t.spherical={pi:t.controls.getPolarAngle(),theta:t.controls.getAzimuthalAngle()}},t.dispose=function(){t.disable()},t.five=e;var r={enabled:!1,visible:!0,arrowsVisible:!1};t.state=Object.assign(r,n==null?void 0:n.initialState);var l=N({fixedLongitude:0,orthoView:!0},n==null?void 0:n.config);return t._config=l,t.state.enabled&&t._enable({userAction:!1}),t.mc=new ft.Manager(t.wrapper),t.mc.add(new ft.Tap({interval:410})),t.mc.add(new ft.Pan({threshold:10,pointers:0})),t.camera.setFromPose({distance:20,offset:new p.Vector3(0,0,0),longitude:e.camera.pose.latitude,latitude:e.camera.pose.latitude}),t.cylinder=new p.Mesh(new p.CylinderGeometry(13.2,14,.01,50,1,!0),new p.ShaderMaterial({uniforms:{radiusTop:{value:13.2},radiusBottom:{value:14},opacity:{value:1}},vertexShader:`
350
+ `,side:n.DoubleSide,visible:this.state.selectedId===`${e.category_name}${e.index}`,uniforms:{opacity:{value:this.state.mode===`box`?1:0}},depthWrite:!1,depthTest:!1,transparent:!0}),p=new n.Mesh(d,f);return p.position.copy(u),p.name=`${e.category_name}${e.index}`,p.userData.color=new n.Vector4(...e.mask_color.map(e=>e/255).reverse(),1),p.userData.visible_viewpoint=Object.keys(e.visible_viewpoint),p});this.group.add(...t)})}setState(e,t={}){let n=this.state,r=t.userAction===void 0?!0:t.userAction;if(this.updateState(e,r),e.enabled!==void 0&&n.enabled!==e.enabled){let t={userAction:r};e.enabled?this._enable(t):this._disable(t)}}setMode(e){this.updateState({mode:e},!1),e===`mask`?(this.group.children.forEach(e=>{e.material.uniforms.opacity.value=0}),this.loadPanoMask(this.five.state.panoIndex)):e===`box`&&(this.itemMaskMesh.material.uniforms.color.value=new n.Vector4(0,0,0,1),this.group.children.forEach(e=>{e.material.uniforms.opacity.value=1}),this.five.needsRender=!0)}select(e,t){var n;this.updateState({selectedId:e==null?null:e},(n=t==null?void 0:t.userAction)==null?!1:n),this.group.children.forEach(t=>{t.material.visible=this.state.selectAll||t.name===e}),this.five.needsRender=!0}selectAll(e=!0){this.updateState({selectAll:!!e},!1),this.select()}_enable(e){this.five.on(`panoArrived`,this.onFivePanoArrived),this.five.on(`wantsMoveToPano`,this.onFiveWantsMoveToPano),this.five.on(`gesture.mousemove`,this.onFiveMouseMove),this.five.on(`wantsTapGesture`,this.onFiveTapGesture),this.five.on(`cameraUpdate`,this.onFiveCameraUpdate),this.five.scene.add(this.group),document.head.appendChild(this.style)}_disable(e){this.five.off(`panoArrived`,this.onFivePanoArrived),this.five.off(`wantsMoveToPano`,this.onFiveWantsMoveToPano),this.five.off(`gesture.mousemove`,this.onFiveMouseMove),this.five.off(`wantsTapGesture`,this.onFiveTapGesture),this.five.off(`cameraUpdate`,this.onFiveCameraUpdate),this.five.scene.remove(this.group),document.head.removeChild(this.style)}enable(e){var t;if(this.state.enabled)return;let n=(t=e==null?void 0:e.userAction)==null?!0:t;this.updateState({enabled:!0},n),this._enable({userAction:n})}disable(e){var t;if(this.state.enabled===!1)return;let n=(t=e==null?void 0:e.userAction)==null?!0:t;this.updateState({enabled:!1},n),this._disable({userAction:n})}},k=(e,t)=>new O(e,t),A=(function(e,t,n,r){"use strict";var i=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],a=t.createElement?t.createElement(`div`):r,o=`function`,s=Math.round,c=Math.abs,l=Date.now;function u(e,t,n){return setTimeout(v(e,n),t)}function d(e,t,n){return Array.isArray(e)?(f(e,n[t],n),!0):!1}function f(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==r)for(i=0;i<e.length;)t.call(n,e[i],i,e),i++;else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function p(t,n,r){var i=`DEPRECATED METHOD: `+n+`
351
+ `+r+` AT
352
+ `;return function(){var n=Error(`get-stack-trace`),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,``).replace(/^\s+at\s+/gm,``).replace(/^Object.<anonymous>\s*\(/gm,`{anonymous}()@`):`Unknown Stack Trace`,a=e.console&&(e.console.warn||e.console.log);return a&&a.call(e.console,i,r),t.apply(this,arguments)}}var m=typeof Object.assign==`function`?Object.assign:function(e){if(e===r||e===null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==r&&i!==null)for(var a in i)i.hasOwnProperty(a)&&(t[a]=i[a])}return t},h=p(function(e,t,n){for(var i=Object.keys(t),a=0;a<i.length;)(!n||n&&e[i[a]]===r)&&(e[i[a]]=t[i[a]]),a++;return e},`extend`,"Use `assign`."),g=p(function(e,t){return h(e,t,!0)},`merge`,"Use `assign`.");function _(e,t,n){var r=t.prototype,i=e.prototype=Object.create(r);i.constructor=e,i._super=r,n&&m(i,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function y(e,t){return typeof e==o?e.apply(t&&t[0]||r,t):e}function b(e,t){return e===r?t:e}function x(e,t,n){f(T(t),function(t){e.addEventListener(t,n,!1)})}function S(e,t,n){f(T(t),function(t){e.removeEventListener(t,n,!1)})}function C(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function w(e,t){return e.indexOf(t)>-1}function T(e){return e.trim().split(/\s+/g)}function E(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function D(e){return Array.prototype.slice.call(e,0)}function ee(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];E(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}function O(e,t){for(var n,a,o=t[0].toUpperCase()+t.slice(1),s=0;s<i.length;){if(n=i[s],a=n?n+o:t,a in e)return a;s++}return r}var k=1;function A(){return k++}function j(t){var n=t.ownerDocument||t;return n.defaultView||n.parentWindow||e}var te=/mobile|tablet|ip(ad|hone|od)|android/i,M=`ontouchstart`in e,N=O(e,`PointerEvent`)!==r,ne=M&&te.test(navigator.userAgent),P=`touch`,re=`pen`,F=`mouse`,I=`kinect`,L=25,R=1,z=2,B=4,V=8,ie=1,H=2,U=4,W=8,ae=16,G=H|U,K=W|ae,oe=G|K,se=[`x`,`y`],ce=[`clientX`,`clientY`];function q(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){y(e.options.enable,[e])&&n.handler(t)},this.init()}q.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(j(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(j(this.element),this.evWin,this.domHandler)}};function le(e){var t;return t=e.options.inputClass||(N?Ae:ne?Re:M?He:Te),new t(e,ue)}function ue(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&R&&r-i===0,o=t&(B|V)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,de(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function de(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||(n.firstInput=me(t)),i>1&&!n.firstMultiple?n.firstMultiple=me(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,u=t.center=he(r);t.timeStamp=l(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=ye(s,u),t.distance=ve(s,u),fe(n,t),t.offsetDirection=_e(t.deltaX,t.deltaY);var d=ge(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=c(d.x)>c(d.y)?d.x:d.y,t.scale=o?xe(o.pointers,r):1,t.rotation=o?be(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,pe(n,t);var f=e.element;C(t.srcEvent.target,f)&&(f=t.srcEvent.target),t.target=f}function fe(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===R||a.eventType===B)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function pe(e,t){var n=e.lastInterval||t,i=t.timeStamp-n.timeStamp,a,o,s,l;if(t.eventType!=V&&(i>L||n.velocity===r)){var u=t.deltaX-n.deltaX,d=t.deltaY-n.deltaY,f=ge(i,u,d);o=f.x,s=f.y,a=c(f.x)>c(f.y)?f.x:f.y,l=_e(u,d),e.lastInterval=t}else a=n.velocity,o=n.velocityX,s=n.velocityY,l=n.direction;t.velocity=a,t.velocityX=o,t.velocityY=s,t.direction=l}function me(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:s(e.pointers[n].clientX),clientY:s(e.pointers[n].clientY)},n++;return{timeStamp:l(),pointers:t,center:he(t),deltaX:e.deltaX,deltaY:e.deltaY}}function he(e){var t=e.length;if(t===1)return{x:s(e[0].clientX),y:s(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:s(n/t),y:s(r/t)}}function ge(e,t,n){return{x:t/e||0,y:n/e||0}}function _e(e,t){return e===t?ie:c(e)>=c(t)?e<0?H:U:t<0?W:ae}function ve(e,t,n){n||(n=se);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function ye(e,t,n){n||(n=se);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function be(e,t){return ye(t[1],t[0],ce)+ye(e[1],e[0],ce)}function xe(e,t){return ve(t[0],t[1],ce)/ve(e[0],e[1],ce)}var Se={mousedown:R,mousemove:z,mouseup:B},Ce=`mousedown`,we=`mousemove mouseup`;function Te(){this.evEl=Ce,this.evWin=we,this.pressed=!1,q.apply(this,arguments)}_(Te,q,{handler:function(e){var t=Se[e.type];t&R&&(e.button===0||e.button===2)&&(this.pressed=!0),t&z&&e.which!==1&&(t=B),this.pressed&&(t&B&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:F,srcEvent:e}))}});var Ee={pointerdown:R,pointermove:z,pointerup:B,pointercancel:V,pointerout:V},De={2:P,3:re,4:F,5:I},Oe=`pointerdown`,ke=`pointermove pointerup pointercancel`;e.MSPointerEvent&&!e.PointerEvent&&(Oe=`MSPointerDown`,ke=`MSPointerMove MSPointerUp MSPointerCancel`);function Ae(){this.evEl=Oe,this.evWin=ke,q.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}_(Ae,q,{handler:function(e){var t=this.store,n=!1,r=!1,i=Ee[e.type.toLowerCase().replace(`ms`,``)],a=De[e.pointerType]||e.pointerType,o=a==P,s=E(t,e.pointerId,`pointerId`);i&R&&(e.button===0||e.button===2||o)?s<0&&(t.push(e),s=t.length-1):i&(B|V)?n=!0:!o&&e.buttons===0&&(n=!0,r=!0,i=Ee.pointerup),!(s<0)&&(r||(t[s]=e),this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:t[s]}),n&&t.splice(s,1))}});var je={touchstart:R,touchmove:z,touchend:B,touchcancel:V},Me=`touchstart`,Ne=`touchstart touchmove touchend touchcancel`;function Pe(){this.evTarget=Me,this.evWin=Ne,this.started=!1,q.apply(this,arguments)}_(Pe,q,{handler:function(e){var t=je[e.type];if(t===R&&(this.started=!0),this.started){var n=Fe.call(this,e,t);t&(B|V)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:P,srcEvent:e})}}});function Fe(e,t){var n=D(e.touches),r=D(e.changedTouches);return t&(B|V)&&(n=ee(n.concat(r),`identifier`,!0)),[n,r]}var Ie={touchstart:R,touchmove:z,touchend:B,touchcancel:V},Le=`touchstart touchmove touchend touchcancel`;function Re(){this.evTarget=Le,this.targetIds={},q.apply(this,arguments)}_(Re,q,{handler:function(e){var t=Ie[e.type],n=ze.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:P,srcEvent:e})}});function ze(e,t){var n=D(e.touches),r=this.targetIds;if(t&(R|z)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=D(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return C(e.target,c)}),t===R)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&s.push(o[i]),t&(B|V)&&delete r[o[i].identifier],i++;if(s.length)return[ee(a.concat(s),`identifier`,!0),s]}var Be=2500,Ve=25;function He(){q.apply(this,arguments);var e=v(this.handler,this);this.touch=new Re(this.manager,e),this.mouse=new Te(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}_(He,q,{handler:function(e,t,n){var r=n.pointerType==P,i=n.pointerType==F;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)Ue.call(this,t,n);else if(i&&Ge.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Ue(e,t){e&R?(this.primaryTouch=t.changedPointers[0].identifier,We.call(this,t)):e&(B|V)&&We.call(this,t)}function We(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},Be)}}function Ge(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=Ve&&o<=Ve)return!0}return!1}var Ke=a?O(a.style,`touchAction`):r,qe=Ke!==r,Je=`compute`,Ye=`auto`,Xe=`manipulation`,Ze=`none`,Qe=`pan-x`,$e=`pan-y`,et=rt();function tt(e,t){this.manager=e,this.set(t)}tt.prototype={set:function(e){e==Je&&(e=this.compute()),qe&&this.manager.element.style&&et[e]&&(this.manager.element.style[Ke]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return f(this.manager.recognizers,function(t){y(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),nt(e.join(` `))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented){t.preventDefault();return}var r=this.actions,i=w(r,Ze)&&!et[Ze],a=w(r,$e)&&!et[$e],o=w(r,Qe)&&!et[Qe];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!(o&&a)&&(i||a&&n&G||o&&n&K))return this.preventSrc(t)},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};function nt(e){if(w(e,Ze))return Ze;var t=w(e,Qe),n=w(e,$e);return t&&n?Ze:t||n?t?Qe:$e:w(e,Xe)?Xe:Ye}function rt(){if(!qe)return!1;var t={},n=e.CSS&&e.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(r){t[r]=n?e.CSS.supports(`touch-action`,r):!0}),t}var it=1,J=2,at=4,Y=8,X=Y,ot=16,Z=32;function Q(e){this.options=m({},this.defaults,e||{}),this.id=A(),this.manager=null,this.options.enable=b(this.options.enable,!0),this.state=it,this.simultaneous={},this.requireFail=[]}Q.prototype={defaults:{},set:function(e){return m(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=lt(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,`dropRecognizeWith`,this)?this:(e=lt(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(d(e,`requireFailure`,this))return this;var t=this.requireFail;return e=lt(e,this),E(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,`dropRequireFailure`,this))return this;e=lt(e,this);var t=E(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<Y&&r(t.options.event+st(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=Y&&r(t.options.event+st(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Z},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(Z|it)))return!1;e++}return!0},recognize:function(e){var t=m({},e);if(!y(this.options.enable,[this,t])){this.reset(),this.state=Z;return}this.state&(X|ot|Z)&&(this.state=it),this.state=this.process(t),this.state&(J|at|Y|ot)&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}};function st(e){return e&ot?`cancel`:e&Y?`end`:e&at?`move`:e&J?`start`:``}function ct(e){return e==ae?`down`:e==W?`up`:e==H?`left`:e==U?`right`:``}function lt(e,t){var n=t.manager;return n?n.get(e):e}function $(){Q.apply(this,arguments)}_($,Q,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=t&(J|at),i=this.attrTest(e);return r&&(n&V||!i)?t|ot:r||i?n&B?t|Y:t&J?t|at:J:Z}});function ut(){$.apply(this,arguments),this.pX=null,this.pY=null}_(ut,$,{defaults:{event:`pan`,threshold:10,pointers:1,direction:oe},getTouchAction:function(){var e=this.options.direction,t=[];return e&G&&t.push($e),e&K&&t.push(Qe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&G?(i=a===0?ie:a<0?H:U,n=a!=this.pX,r=Math.abs(e.deltaX)):(i=o===0?ie:o<0?W:ae,n=o!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return $.prototype.attrTest.call(this,e)&&(this.state&J||!(this.state&J)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ct(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}});function dt(){$.apply(this,arguments)}_(dt,$,{defaults:{event:`pinch`,threshold:0,pointers:2},getTouchAction:function(){return[Ze]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&J)},emit:function(e){if(e.scale!==1){var t=e.scale<1?`in`:`out`;e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}});function ft(){Q.apply(this,arguments),this._timer=null,this._input=null}_(ft,Q,{defaults:{event:`press`,pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ye]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(B|V)&&!i)this.reset();else if(e.eventType&R)this.reset(),this._timer=u(function(){this.state=X,this.tryEmit()},t.time,this);else if(e.eventType&B)return X;return Z},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===X&&(e&&e.eventType&B?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function pt(){$.apply(this,arguments)}_(pt,$,{defaults:{event:`rotate`,threshold:0,pointers:2},getTouchAction:function(){return[Ze]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&J)}});function mt(){$.apply(this,arguments)}_(mt,$,{defaults:{event:`swipe`,threshold:10,velocity:.3,direction:G|K,pointers:1},getTouchAction:function(){return ut.prototype.getTouchAction.call(this)},attrTest:function(e){var t=this.options.direction,n;return t&(G|K)?n=e.overallVelocity:t&G?n=e.overallVelocityX:t&K&&(n=e.overallVelocityY),this._super.attrTest.call(this,e)&&t&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(n)>this.options.velocity&&e.eventType&B},emit:function(e){var t=ct(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}});function ht(){Q.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}_(ht,Q,{defaults:{event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Xe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),e.eventType&R&&this.count===0)return this.failTimeout();if(r&&i&&n){if(e.eventType!=B)return this.failTimeout();var a=this.pTime?e.timeStamp-this.pTime<t.interval:!0,o=!this.pCenter||ve(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!o||!a?this.count=1:this.count+=1,this._input=e,this.count%t.taps===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=X,this.tryEmit()},t.interval,this),J):X}return Z},failTimeout:function(){return this._timer=u(function(){this.state=Z},this.options.interval,this),Z},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==X&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function gt(e,t){return t=t||{},t.recognizers=b(t.recognizers,gt.defaults.preset),new yt(e,t)}gt.VERSION=`2.0.7`,gt.defaults={domEvents:!1,touchAction:Je,enable:!0,inputTarget:null,inputClass:null,preset:[[pt,{enable:!1}],[dt,{enable:!1},[`rotate`]],[mt,{direction:G}],[ut,{direction:G},[`swipe`]],[ht],[ht,{event:`doubletap`,taps:2},[`tap`]],[ft]],cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}};var _t=1,vt=2;function yt(e,t){this.options=m({},gt.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=le(this),this.touchAction=new tt(this,this.options.touchAction),bt(this,!0),f(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}yt.prototype={set:function(e){return m(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?vt:_t},recognize:function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&X)&&(i=t.curRecognizer=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==vt&&(!i||n==i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(J|at|Y)&&(i=t.curRecognizer=n),a++}},get:function(e){if(e instanceof Q)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(d(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,`remove`,this))return this;if(e=this.get(e),e){var t=this.recognizers,n=E(t,e);n!==-1&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==r&&t!==r){var n=this.handlers;return f(T(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==r){var n=this.handlers;return f(T(e),function(e){t?n[e]&&n[e].splice(E(n[e],t),1):delete n[e]}),this}},emit:function(e,t){this.options.domEvents&&xt(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(!(!n||!n.length)){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&bt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function bt(e,t){var n=e.element;if(n.style){var r;f(e.options.cssProps,function(i,a){r=O(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function xt(e,n){var r=t.createEvent(`Event`);r.initEvent(e,!0,!0),r.gesture=n,n.target.dispatchEvent(r)}return m(gt,{INPUT_START:R,INPUT_MOVE:z,INPUT_END:B,INPUT_CANCEL:V,STATE_POSSIBLE:it,STATE_BEGAN:J,STATE_CHANGED:at,STATE_ENDED:Y,STATE_RECOGNIZED:X,STATE_CANCELLED:ot,STATE_FAILED:Z,DIRECTION_NONE:ie,DIRECTION_LEFT:H,DIRECTION_RIGHT:U,DIRECTION_UP:W,DIRECTION_DOWN:ae,DIRECTION_HORIZONTAL:G,DIRECTION_VERTICAL:K,DIRECTION_ALL:oe,Manager:yt,Input:q,TouchAction:tt,TouchInput:Re,MouseInput:Te,PointerEventInput:Ae,TouchMouseInput:He,SingleTouchInput:Pe,Recognizer:Q,AttrRecognizer:$,Tap:ht,Pan:ut,Swipe:mt,Pinch:dt,Rotate:pt,Press:ft,on:x,off:S,each:f,merge:g,extend:h,assign:m,inherit:_,bindFn:v,prefixed:O}),gt})(typeof window<`u`?window:{},typeof document<`u`?document:{},`Hammer`),j=function(e,t){t===void 0&&console.warn(`THREE.OrbitControls: The second parameter "domElement" is now mandatory.`),t===document&&console.error(`THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.`),this.object=e,this.domElement=t,this.enabled=!0,this.target=new n.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:n.MOUSE.ROTATE,MIDDLE:n.MOUSE.DOLLY,RIGHT:n.MOUSE.PAN},this.touches={ONE:n.TOUCH.ROTATE,TWO:n.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return u.phi},this.getAzimuthalAngle=function(){return u.theta},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),c=s.NONE},this.update=function(){var t=new n.Vector3,a=new n.Quaternion().setFromUnitVectors(e.up,new n.Vector3(0,1,0)),o=a.clone().inverse(),h=new n.Vector3,g=new n.Quaternion;return function(){var e=r.object.position;return t.copy(e).sub(r.target),t.applyQuaternion(a),u.setFromVector3(t),r.autoRotate&&c===s.NONE&&E(w()),r.enableDamping?(u.theta+=d.theta*r.dampingFactor,u.phi+=d.phi*r.dampingFactor):(u.theta+=d.theta,u.phi+=d.phi),u.theta=Math.max(r.minAzimuthAngle,Math.min(r.maxAzimuthAngle,u.theta)),u.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,u.phi)),u.makeSafe(),u.radius*=f,u.radius=Math.max(r.minDistance,Math.min(r.maxDistance,u.radius)),r.enableDamping===!0?r.target.addScaledVector(p,r.dampingFactor):r.target.add(p),t.setFromSpherical(u),t.applyQuaternion(o),e.copy(r.target).add(t),r.object.lookAt(r.target),r.enableDamping===!0?(d.theta*=1-r.dampingFactor,d.phi*=1-r.dampingFactor,p.multiplyScalar(1-r.dampingFactor)):(d.set(0,0,0),p.set(0,0,0)),f=1,m||h.distanceToSquared(r.object.position)>l||8*(1-g.dot(r.object.quaternion))>l?(r.dispatchEvent(i),h.copy(r.object.position),g.copy(r.object.quaternion),m=!1,!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener(`contextmenu`,de,!1),r.domElement.removeEventListener(`mousedown`,G,!1),r.domElement.removeEventListener(`wheel`,se,!1),r.domElement.removeEventListener(`touchstart`,q,!1),r.domElement.removeEventListener(`touchend`,ue,!1),r.domElement.removeEventListener(`touchmove`,le,!1),document.removeEventListener(`mousemove`,K,!1),document.removeEventListener(`mouseup`,oe,!1),r.domElement.removeEventListener(`keydown`,ce,!1)};var r=this,i={type:`change`},a={type:`start`},o={type:`end`},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},c=s.NONE,l=1e-6,u=new n.Spherical,d=new n.Spherical,f=1,p=new n.Vector3,m=!1,h=new n.Vector2,g=new n.Vector2,_=new n.Vector2,v=new n.Vector2,y=new n.Vector2,b=new n.Vector2,x=new n.Vector2,S=new n.Vector2,C=new n.Vector2;function w(){return 2*Math.PI/60/60*r.autoRotateSpeed}function T(){return Math.pow(.95,r.zoomSpeed)}function E(e){d.theta-=e}function D(e){d.phi-=e}var ee=function(){var e=new n.Vector3;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),p.add(e)}}(),O=function(){var e=new n.Vector3;return function(t,n){r.screenSpacePanning===!0?e.setFromMatrixColumn(n,1):(e.setFromMatrixColumn(n,0),e.crossVectors(r.object.up,e)),e.multiplyScalar(t),p.add(e)}}(),k=function(){var e=new n.Vector3;return function(t,n){var i=r.domElement;if(r.object.isPerspectiveCamera){var a=r.object.position;e.copy(a).sub(r.target);var o=e.length();o*=Math.tan(r.object.fov/2*Math.PI/180),ee(2*t*o/i.clientHeight,r.object.matrix),O(2*n*o/i.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(ee(t*(r.object.right-r.object.left)/r.object.zoom/i.clientWidth,r.object.matrix),O(n*(r.object.top-r.object.bottom)/r.object.zoom/i.clientHeight,r.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),r.enablePan=!1)}}();function A(e){r.object.isPerspectiveCamera?f/=e:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*e)),r.object.updateProjectionMatrix(),m=!0):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),r.enableZoom=!1)}function j(e){r.object.isPerspectiveCamera?f*=e:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/e)),r.object.updateProjectionMatrix(),m=!0):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),r.enableZoom=!1)}function te(e){h.set(e.clientX,e.clientY)}function M(e){x.set(e.clientX,e.clientY)}function N(e){v.set(e.clientX,e.clientY)}function ne(e){g.set(e.clientX,e.clientY),_.subVectors(g,h).multiplyScalar(r.rotateSpeed);var t=r.domElement;E(2*Math.PI*_.x/t.clientHeight),D(2*Math.PI*_.y/t.clientHeight),h.copy(g),r.update()}function P(e){S.set(e.clientX,e.clientY),C.subVectors(S,x),C.y>0?A(T()):C.y<0&&j(T()),x.copy(S),r.update()}function re(e){y.set(e.clientX,e.clientY),b.subVectors(y,v).multiplyScalar(r.panSpeed),k(b.x,b.y),v.copy(y),r.update()}function F(e){e.deltaY<0?j(T()):e.deltaY>0&&A(T()),r.update()}function I(e){var t=!1;switch(e.keyCode){case r.keys.UP:k(0,r.keyPanSpeed),t=!0;break;case r.keys.BOTTOM:k(0,-r.keyPanSpeed),t=!0;break;case r.keys.LEFT:k(r.keyPanSpeed,0),t=!0;break;case r.keys.RIGHT:k(-r.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),r.update())}function L(e){if(e.touches.length==1)h.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);h.set(t,n)}}function R(e){if(e.touches.length==1)v.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);v.set(t,n)}}function z(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);x.set(0,r)}function B(e){r.enableZoom&&z(e),r.enablePan&&R(e)}function V(e){r.enableZoom&&z(e),r.enableRotate&&L(e)}function ie(e){if(e.touches.length==1)g.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);g.set(t,n)}_.subVectors(g,h).multiplyScalar(r.rotateSpeed);var i=r.domElement;E(2*Math.PI*_.x/i.clientHeight),D(2*Math.PI*_.y/i.clientHeight),h.copy(g)}function H(e){if(e.touches.length==1)y.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);y.set(t,n)}b.subVectors(y,v).multiplyScalar(r.panSpeed),k(b.x,b.y),v.copy(y)}function U(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(t*t+n*n);S.set(0,i),C.set(0,Math.pow(S.y/x.y,r.zoomSpeed)),A(C.y),x.copy(S)}function W(e){r.enableZoom&&U(e),r.enablePan&&H(e)}function ae(e){r.enableZoom&&U(e),r.enableRotate&&ie(e)}function G(e){if(r.enabled!==!1){e.preventDefault(),r.domElement.focus?r.domElement.focus():window.focus();var t;switch(e.button){case 0:t=r.mouseButtons.LEFT;break;case 1:t=r.mouseButtons.MIDDLE;break;case 2:t=r.mouseButtons.RIGHT;break;default:t=-1}switch(t){case n.MOUSE.DOLLY:if(r.enableZoom===!1)return;M(e),c=s.DOLLY;break;case n.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(r.enablePan===!1)return;N(e),c=s.PAN}else{if(r.enableRotate===!1)return;te(e),c=s.ROTATE}break;case n.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(r.enableRotate===!1)return;te(e),c=s.ROTATE}else{if(r.enablePan===!1)return;N(e),c=s.PAN}break;default:c=s.NONE}c!==s.NONE&&(document.addEventListener(`mousemove`,K,!1),document.addEventListener(`mouseup`,oe,!1),r.dispatchEvent(a))}}function K(e){if(r.enabled!==!1)switch(e.preventDefault(),c){case s.ROTATE:if(r.enableRotate===!1)return;ne(e);break;case s.DOLLY:if(r.enableZoom===!1)return;P(e);break;case s.PAN:if(r.enablePan===!1)return;re(e);break}}function oe(e){r.enabled!==!1&&(document.removeEventListener(`mousemove`,K,!1),document.removeEventListener(`mouseup`,oe,!1),r.dispatchEvent(o),c=s.NONE)}function se(e){r.enabled===!1||r.enableZoom===!1||c!==s.NONE&&c!==s.ROTATE||(e.preventDefault(),e.stopPropagation(),r.dispatchEvent(a),F(e),r.dispatchEvent(o))}function ce(e){r.enabled===!1||r.enableKeys===!1||r.enablePan===!1||I(e)}function q(e){if(r.enabled!==!1){switch(e.preventDefault(),e.touches.length){case 1:switch(r.touches.ONE){case n.TOUCH.ROTATE:if(r.enableRotate===!1)return;L(e),c=s.TOUCH_ROTATE;break;case n.TOUCH.PAN:if(r.enablePan===!1)return;R(e),c=s.TOUCH_PAN;break;default:c=s.NONE}break;case 2:switch(r.touches.TWO){case n.TOUCH.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;B(e),c=s.TOUCH_DOLLY_PAN;break;case n.TOUCH.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;V(e),c=s.TOUCH_DOLLY_ROTATE;break;default:c=s.NONE}break;default:c=s.NONE}c!==s.NONE&&r.dispatchEvent(a)}}function le(e){if(r.enabled!==!1)switch(e.preventDefault(),e.stopPropagation(),c){case s.TOUCH_ROTATE:if(r.enableRotate===!1)return;ie(e),r.update();break;case s.TOUCH_PAN:if(r.enablePan===!1)return;H(e),r.update();break;case s.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;W(e),r.update();break;case s.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ae(e),r.update();break;default:c=s.NONE}}function ue(e){r.enabled!==!1&&(r.dispatchEvent(o),c=s.NONE)}function de(e){r.enabled!==!1&&e.preventDefault()}r.domElement.addEventListener(`contextmenu`,de,!1),r.domElement.addEventListener(`mousedown`,G,!1),r.domElement.addEventListener(`wheel`,se,!1),r.domElement.addEventListener(`touchstart`,q,!1),r.domElement.addEventListener(`touchend`,ue,!1),r.domElement.addEventListener(`touchmove`,le,!1),r.domElement.addEventListener(`keydown`,ce,!1),r.domElement.tabIndex===-1&&(r.domElement.tabIndex=0),this.update()};j.prototype=Object.create(n.EventDispatcher.prototype),j.prototype.constructor=j;var te=function(e,t){j.call(this,e,t),this.mouseButtons.LEFT=n.MOUSE.PAN,this.mouseButtons.RIGHT=n.MOUSE.ROTATE,this.touches.ONE=n.TOUCH.PAN,this.touches.TWO=n.TOUCH.DOLLY_ROTATE};te.prototype=Object.create(n.EventDispatcher.prototype),te.prototype.constructor=te;var M=function(e){n.Object3D.call(this),this.element=e,this.element.style.position=`absolute`,this.element.style.pointerEvents=`auto`,this.addEventListener(`removed`,function(){this.traverse(function(e){e.element instanceof Element&&e.element.parentNode!==null&&e.element.parentNode.removeChild(e.element)})})};M.prototype=Object.create(n.Object3D.prototype),M.prototype.constructor=M;var N=function(e){M.call(this,e)};N.prototype=Object.create(M.prototype),N.prototype.constructor=N;var ne=function(){var e=this,t,r,i,a,o=new n.Matrix4,s={camera:{fov:0,style:``},objects:new WeakMap},c=document.createElement(`div`);c.style.overflow=`hidden`,this.domElement=c;var l=document.createElement(`div`);l.style.WebkitTransformStyle=`preserve-3d`,l.style.transformStyle=`preserve-3d`,l.style.pointerEvents=`none`,c.appendChild(l);var u=/Trident/i.test(navigator.userAgent);this.getSize=function(){return{width:t,height:r}},this.setSize=function(e,n){t=e,r=n,i=t/2,a=r/2,c.style.width=e+`px`,c.style.height=n+`px`,l.style.width=e+`px`,l.style.height=n+`px`};function d(e){return Math.abs(e)<1e-10?0:e}function f(e){var t=e.elements;return`matrix3d(`+d(t[0])+`,`+d(-t[1])+`,`+d(t[2])+`,`+d(t[3])+`,`+d(t[4])+`,`+d(-t[5])+`,`+d(t[6])+`,`+d(t[7])+`,`+d(t[8])+`,`+d(-t[9])+`,`+d(t[10])+`,`+d(t[11])+`,`+d(t[12])+`,`+d(-t[13])+`,`+d(t[14])+`,`+d(t[15])+`)`}function p(e,t){var n=e.elements,r=`matrix3d(`+d(n[0])+`,`+d(n[1])+`,`+d(n[2])+`,`+d(n[3])+`,`+d(-n[4])+`,`+d(-n[5])+`,`+d(-n[6])+`,`+d(-n[7])+`,`+d(n[8])+`,`+d(n[9])+`,`+d(n[10])+`,`+d(n[11])+`,`+d(n[12])+`,`+d(n[13])+`,`+d(n[14])+`,`+d(n[15])+`)`;return u?`translate(-50%,-50%)translate(`+i+`px,`+a+`px)`+t+r:`translate(-50%,-50%)`+r}function m(t,n,r,i){if(t instanceof M){t.onBeforeRender(e,n,r);var a;t instanceof N?(o.copy(r.matrixWorldInverse),o.transpose(),o.copyPosition(t.matrixWorld),o.scale(t.scale),o.elements[3]=0,o.elements[7]=0,o.elements[11]=0,o.elements[15]=1,a=p(o,i)):a=p(t.matrixWorld,i);var c=t.element,d=s.objects.get(t);if(d===void 0||d.style!==a){c.style.WebkitTransform=a,c.style.transform=a;var f={style:a};u&&(f.distanceToCameraSquared=h(r,t)),s.objects.set(t,f)}c.style.display=t.visible?``:`none`,c.parentNode!==l&&l.appendChild(c),t.onAfterRender(e,n,r)}for(var g=0,_=t.children.length;g<_;g++)m(t.children[g],n,r,i)}var h=function(){var e=new n.Vector3,t=new n.Vector3;return function(n,r){return e.setFromMatrixPosition(n.matrixWorld),t.setFromMatrixPosition(r.matrixWorld),e.distanceToSquared(t)}}();function g(e){var t=[];return e.traverse(function(e){e instanceof M&&t.push(e)}),t}function _(e){for(var t=g(e).sort(function(e,t){return s.objects.get(e).distanceToCameraSquared-s.objects.get(t).distanceToCameraSquared}),n=t.length,r=0,i=t.length;r<i;r++)t[r].element.style.zIndex=n-r}this.render=function(e,t){var n=t.projectionMatrix.elements[5]*a;if(s.camera.fov!==n&&(t.isPerspectiveCamera?(c.style.WebkitPerspective=n+`px`,c.style.perspective=n+`px`):(c.style.WebkitPerspective=``,c.style.perspective=``),s.camera.fov=n),e.autoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.updateMatrixWorld(),t.isOrthographicCamera)var r=-(t.right+t.left)/2,o=(t.top+t.bottom)/2;var p=t.isOrthographicCamera?`scale(`+n+`)translate(`+d(r)+`px,`+d(o)+`px)`+f(t.matrixWorldInverse):`translateZ(`+n+`px)`+f(t.matrixWorldInverse),h=p+`translate(`+i+`px,`+a+`px)`;s.camera.style!==h&&!u&&(l.style.WebkitTransform=h,l.style.transform=h,s.camera.style=h),m(e,e,t,p),u&&_(e)}};function P(e,t,r){let{top:i,left:a,width:o,height:s}=t.getBoundingClientRect();return r&&(a+=o*r.left,i+=s*(1-r.bottom-r.height),o*=r.width,s*=r.height),new n.Vector2((e.x-a)/o*2-1,-(e.y-i)/s*2+1)}var re=class extends n.BufferGeometry{constructor(e,t,r,i,a){super(),this.type=`RoundedBoxGeometry`,a=isNaN(a)?1:Math.max(1,Math.floor(a)),e=isNaN(e)?1:e,t=isNaN(t)?1:t,r=isNaN(r)?1:r,i=isNaN(i)?.15:i,i=Math.min(i,Math.min(e,Math.min(t,Math.min(r)))/2);let o=e/2-i,s=t/2-i,c=r/2-i;this.parameters={width:e,height:t,depth:r,radius:i,radiusSegments:a};let l=a+1,u=l*a+1<<3,d=new n.BufferAttribute(new Float32Array(u*3),3),f=new n.BufferAttribute(new Float32Array(u*3),3),p=[],m=[];new n.Vector3;let h=new n.Vector3,g=[],_=[],v=[],y=l*a,b=l*a+1;x(),C(),S(),w(),E(),T();function x(){let e=[new n.Vector3(1,1,1),new n.Vector3(1,1,-1),new n.Vector3(-1,1,-1),new n.Vector3(-1,1,1),new n.Vector3(1,-1,1),new n.Vector3(1,-1,-1),new n.Vector3(-1,-1,-1),new n.Vector3(-1,-1,1)];for(let e=0;e<8;e++)p.push([]),m.push([]);let t=Math.PI/2,r=new n.Vector3(o,s,c);for(let e=0;e<=a;e++){let n=e/a*t,o=Math.cos(n),s=Math.sin(n);if(e==a){h.set(0,1,0);let e=h.clone().multiplyScalar(i).add(r);p[0].push(e),g.push(e);let t=h.clone();m[0].push(t),_.push(t);continue}for(let e=0;e<=a;e++){let n=e/a*t;h.x=o*Math.cos(n),h.y=s,h.z=o*Math.sin(n);let c=h.clone().multiplyScalar(i).add(r);p[0].push(c),g.push(c);let l=h.clone().normalize();m[0].push(l),_.push(l)}}for(let t=1;t<8;t++)for(let n=0;n<p[0].length;n++){let r=p[0][n].clone().multiply(e[t]);p[t].push(r),g.push(r);let i=m[0][n].clone().multiply(e[t]);m[t].push(i),_.push(i)}}function S(){let e=[!0,!1,!0,!1,!1,!0,!1,!0],t=l*(a-1);for(let n=0;n<8;n++){let r=b*n;for(let t=0;t<a-1;t++){let i=t*l,o=(t+1)*l;for(let t=0;t<a;t++){let a=t+1,s=r+i+t,c=r+i+a,l=r+o+t,u=r+o+a;e[n]?(v.push(s),v.push(l),v.push(c),v.push(c),v.push(l),v.push(u)):(v.push(s),v.push(c),v.push(l),v.push(c),v.push(u),v.push(l))}}for(let i=0;i<a;i++){let a=r+t+i,o=r+t+i+1,s=r+y;e[n]?(v.push(a),v.push(s),v.push(o)):(v.push(a),v.push(o),v.push(s))}}}function C(){let e=y,t=y+b,n=y+b*2,r=y+b*3;v.push(e),v.push(t),v.push(n),v.push(e),v.push(n),v.push(r),e=y+b*4,t=y+b*5,n=y+b*6,r=y+b*7,v.push(e),v.push(n),v.push(t),v.push(e),v.push(r),v.push(n),e=0,t=b,n=b*4,r=b*5,v.push(e),v.push(n),v.push(t),v.push(t),v.push(n),v.push(r),e=b*2,t=b*3,n=b*6,r=b*7,v.push(e),v.push(n),v.push(t),v.push(t),v.push(n),v.push(r),e=a,t=a+b*3,n=a+b*4,r=a+b*7,v.push(e),v.push(t),v.push(n),v.push(t),v.push(r),v.push(n),e=a+b,t=a+b*2,n=a+b*5,r=a+b*6,v.push(e),v.push(n),v.push(t),v.push(t),v.push(n),v.push(r)}function w(){for(let e=0;e<4;e++){let t=e*b,n=4*b+t,r=(e&1)==1;for(let e=0;e<a;e++){let i=e+1,a=t+e,o=t+i,s=n+e,c=n+i;r?(v.push(a),v.push(s),v.push(o),v.push(o),v.push(s),v.push(c)):(v.push(a),v.push(o),v.push(s),v.push(o),v.push(c),v.push(s))}}}function T(){let e=[0,2,4,6],t=[1,3,5,7];for(let n=0;n<4;n++){let r=b*e[n],i=b*t[n],o=1>=n;for(let e=0;e<a;e++){let t=e*l,n=(e+1)*l,a=r+t,s=r+n,c=i+t,u=i+n;o?(v.push(a),v.push(c),v.push(s),v.push(s),v.push(c),v.push(u)):(v.push(a),v.push(s),v.push(c),v.push(s),v.push(u),v.push(c))}}}function E(){let e=a-1,t=[0,1,4,5],n=[3,2,7,6],r=[0,1,1,0];for(let i=0;i<4;i++){let o=t[i]*b,s=n[i]*b;for(let t=0;t<=e;t++){let n=o+a+t*l,c=o+(t==e?b-1:a+(t+1)*l),u=s+a+t*l,d=s+(t==e?b-1:a+(t+1)*l);r[i]?(v.push(n),v.push(u),v.push(c),v.push(c),v.push(u),v.push(d)):(v.push(n),v.push(c),v.push(u),v.push(c),v.push(d),v.push(u))}}}let D=0;for(let e=0;e<g.length;e++)d.setXYZ(D,g[e].x,g[e].y,g[e].z),f.setXYZ(D,_[e].x,_[e].y,_[e].z),D++;this.setIndex(new n.BufferAttribute(new Uint16Array(v),1)),this.setAttribute(`position`,d),this.setAttribute(`normal`,f)}};function F(e,t){return typeof e!=`number`||typeof t!=`number`?!1:Math.abs(e-t)<.001}function I(e,t,n,r=e=>e){let i=r(n);return e*(1-i)+t*i}var L=Number((Math.PI/2).toFixed(5));function R(e,t,r){let i=new n.Shape;return i.moveTo(r,0),i.lineTo(e-r,0),i.absarc(e-r,r,r,-L,0,!1),i.lineTo(e,t-r),i.absarc(e-r,t-r,r,0,L,!1),i.lineTo(r,t),i.absarc(r,t-r,r,L,Math.PI,!1),i.lineTo(0,r),i.absarc(r,r,r,Math.PI,Math.PI*1.5,!1),i}var z=e=>{let t=document.createElement(`div`);t.innerText=e;let n=new M(t);return n.name=e,n.scale.set(.3,.3,.3),t.style.pointerEvents=`none`,t.style.backfaceVisibility=`hidden`,n},B=e=>{let t=new n.PlaneGeometry(5,5),r=new n.MeshBasicMaterial({transparent:!0,opacity:0}),i=new n.Mesh(t,r),a=document.createElement(`div`);a.innerText=e;let o=new M(a);return o.name=e,o.scale.set(.3,.3,.3),a.style.color=`#ffffff`,a.style.opacity=`0.5`,a.style.pointerEvents=`none`,a.style.backfaceVisibility=`hidden`,i.rotateX(-L),i.add(o),i},V=class extends p.Controller{get config(){return Object.assign({},this._config)}updateState(e,t){let n=this.state;this.state=Object.assign(Object.assign({},this.state),e),typeof e.arrowsVisible==`boolean`&&this.handleArrowsVisible(e.arrowsVisible),this.hooks.emit(`stateChange`,{state:this.state,prevState:n,userAction:t})}constructor(e,r){super(e),this.camera=new t.Camera(90),this.scene=new n.Scene,this.renderer=new n.WebGLRenderer({antialias:!0,alpha:!0}),this.css3drenderer=new ne,this.ambientLight=new n.AmbientLight(16777215,.7),this.wrapper=document.createElement(`div`),this.arrows=document.createElement(`div`),this.arrowLeft=document.createElement(`div`),this.arrowRight=document.createElement(`div`),this.arrowFront=document.createElement(`div`),this.arrowBack=document.createElement(`div`),this.arrowTop=document.createElement(`div`),this.arrowBottom=document.createElement(`div`),this.spherical=null,this.dragging=!1,this.style=document.createElement(`style`),this.directionalLight=new n.DirectionalLight(16777215,.2),this.box=new n.Mesh(new re(8,8,8,.5,20),new n.MeshPhongMaterial({color:16777215})),this.faces=new n.Group,this.orient=({longitude:e,latitude:t})=>{this.dragging=!1,this.spherical=null,this.controls.enableDamping=!1,this.five.setState(Object.assign({latitude:t},e===void 0?{}:{longitude:e+this.config.fixedLongitude})),this.five.ready().then(()=>{this.controls.enableDamping=!0,this.setState({arrowsVisible:!0})})},this.onRenderFrame=()=>{var e,t,n,r,i;if(this.renderer.render(this.scene,this.camera),this.css3drenderer.render(this.scene,this.camera),this.directionalLight.position.copy(this.camera.position),(e=this.controls)==null||e.update(),this.dragging){this.camera.computePose(),this.updateByCamera();let{longitude:e,latitude:t}=this.camera.pose;this.five.setState({longitude:e,latitude:t},!0),this.updateArrows({longitude:e,latitude:t})}else if(this.spherical&&(!F(this.spherical.pi,(t=this.controls)==null?void 0:t.getPolarAngle())||!F(this.spherical.theta,(n=this.controls)==null?void 0:n.getAzimuthalAngle()))){this.spherical={pi:(r=this.controls)==null?void 0:r.getPolarAngle(),theta:(i=this.controls)==null?void 0:i.getAzimuthalAngle()},this.camera.computePose(),this.updateByCamera();let{longitude:e,latitude:t}=this.camera.pose;this.five.setState({longitude:e,latitude:t},!0),this.updateArrows({longitude:e,latitude:t})}else this.spherical=null},this.onTapGesture=e=>{let t=e.pointers[0].clientX,r=e.pointers[0].clientY,i=P({x:t,y:r},this.wrapper),a=new n.Raycaster;a.setFromCamera(i,this.camera);let[o]=a.intersectObjects(this.faces.children,!1);if(o){let{longitude:e,latitude:t}=o.object.userData;this.orient({longitude:e,latitude:t})}},this.onFiveWantsGesture=()=>{if(this.spherical)return!1},this.onFiveModeChange=e=>{this.controls&&(this.controls.maxPolarAngle=e===`Topview`?0:L)},this.onCameraUpdate=({state:e})=>{if(this.dragging||this.spherical)return;let{longitude:t,latitude:r}=e;this.camera.pose.longitude===t&&this.camera.pose.latitude===r||(this.camera.setFromPose({longitude:t,latitude:r,distance:20,offset:new n.Vector3(0,0,0)}),this.updateByCamera(),this.updateArrows({longitude:t,latitude:r}))},this.onPanStart=e=>{this.dragging=!0,this.spherical={}},this.onMouseMove=e=>{if(this.dragging)return;let t=P({x:e.clientX,y:e.clientY},this.wrapper),r=new n.Raycaster;r.setFromCamera(t,this.camera);let[i]=r.intersectObjects(this.faces.children,!1);this.faces.children.forEach(e=>{e.material.opacity=0,e.children[0].element.style.color=``}),i&&(i.object.material.opacity=.3,i.object.children[0].element.style.color=`#336dff`)},this.onPanEnd=e=>{this.dragging=!1,this.spherical={pi:this.controls.getPolarAngle(),theta:this.controls.getAzimuthalAngle()}},this.dispose=()=>{this.disable()},this.five=e,this.state=Object.assign({enabled:!1,visible:!0,arrowsVisible:!1},r==null?void 0:r.initialState),this._config=Object.assign({fixedLongitude:0,orthoView:!0},r==null?void 0:r.config),this.state.enabled&&this._enable({userAction:!1}),this.mc=new A.Manager(this.wrapper),this.mc.add(new A.Tap({interval:410})),this.mc.add(new A.Pan({threshold:10,pointers:0})),this.camera.setFromPose({distance:20,offset:new n.Vector3(0,0,0),longitude:e.camera.pose.latitude,latitude:e.camera.pose.latitude}),this.cylinder=new n.Mesh(new n.CylinderGeometry(13.2,14,.01,50,1,!0),new n.ShaderMaterial({uniforms:{radiusTop:{value:13.2},radiusBottom:{value:14},opacity:{value:1}},vertexShader:`
357
353
  varying vec3 pos;
358
354
  varying mat4 vViewMatrix;
359
355
  void main() {
@@ -383,7 +379,7 @@ void main() {
383
379
  vec4 color = mix(color1, color2, z);
384
380
  gl_FragColor = color;
385
381
  }
386
- `,transparent:!0})),t.init(),t}return Object.defineProperty(s.prototype,"config",{get:function(){return N({},this._config)},enumerable:!1,configurable:!0}),s.prototype.updateState=function(e,n){var t=this.state;this.state=N(N({},this.state),e),typeof e.arrowsVisible=="boolean"&&this.handleArrowsVisible(e.arrowsVisible),this.hooks.emit("stateChange",{state:this.state,prevState:t,userAction:n})},s.prototype.appendTo=function(e){if(e){e.appendChild(this.wrapper);var n=this.wrapper.getBoundingClientRect(),t=n.width,r=n.height;this.renderer.setSize(t,r),this.css3drenderer.setSize(t,r)}},s.prototype.init=function(){this.renderer.setClearAlpha(0),this.renderer.domElement.style.outline="none",this.initDom(),this.initFaces(),this.initControls(),this.initLights();var e=this.cylinder;e.position.y=-3;var n=Ze("西");n.position.set(-19,0,0),e.add(n);var t=Ze("东");t.position.set(19,0,0),e.add(t);var r=Ze("北");r.position.set(0,0,-19),e.add(r);var l=Ze("南");l.position.set(0,0,19),e.add(l),this.updateByCamera(),this.scene.add(e,this.box,this.faces),this.scene.rotation.y=this.config.fixedLongitude},s.prototype.initDom=function(){this.style.innerHTML=`
382
+ `,transparent:!0})),this.init()}appendTo(e){if(!e)return;e.appendChild(this.wrapper);let{width:t,height:n}=this.wrapper.getBoundingClientRect();this.renderer.setSize(t,n),this.css3drenderer.setSize(t,n)}init(){this.renderer.setClearAlpha(0),this.renderer.domElement.style.outline=`none`,this.initDom(),this.initFaces(),this.initControls(),this.initLights();let e=this.cylinder;e.position.y=-3;let t=B(`西`);t.position.set(-19,0,0),e.add(t);let n=B(`东`);n.position.set(19,0,0),e.add(n);let r=B(`北`);r.position.set(0,0,-19),e.add(r);let i=B(`南`);i.position.set(0,0,19),e.add(i),this.updateByCamera(),this.scene.add(e,this.box,this.faces),this.scene.rotation.y=this.config.fixedLongitude}initDom(){this.style.innerHTML=`
387
383
  .OrientationPlugin .OrientationArrows {
388
384
  position: absolute;
389
385
  top: 0;
@@ -483,7 +479,7 @@ void main() {
483
479
  border-color: transparent transparent var(--color) transparent;
484
480
  transform: translate(0, -15px);
485
481
  }
486
- `,this.wrapper.className="OrientationPlugin",this.arrows.className="OrientationArrows",this.wrapper.style.cssText="position: relative; width: 100%; height: 100%",this.wrapper.appendChild(this.arrows),this.arrowLeft.className=this.arrowRight.className=this.arrowTop.className=this.arrowBack.className=this.arrowFront.className="OrientationArrow",this.arrowBottom.className="OrientationArrow disabled",this.arrowBack.innerText="后",this.arrowFront.innerText="前",this.arrowLeft.innerText="左",this.arrowRight.innerText="右",this.arrowTop.innerText="上",this.arrowBottom.innerText="下",this.css3drenderer.domElement.style.cssText="position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; color: #00000090;"},s.prototype.bindEvents=function(){var e=this;this.five.on("renderFrame",this.onRenderFrame),this.five.on("camera.update",this.onCameraUpdate),this.five.on("wantsGesture",this.onFiveWantsGesture),this.five.on("modeChange",this.onFiveModeChange),this.mc.on("tap",this.onTapGesture),this.mc.on("panstart",this.onPanStart),this.mc.on("panend",this.onPanEnd),this.wrapper.addEventListener("mousemove",this.onMouseMove),this.arrowTop.onclick=function(){return e.orient({longitude:0,latitude:le})},this.arrowLeft.onclick=function(){return e.orient({longitude:-le,latitude:0})},this.arrowRight.onclick=function(){return e.orient({longitude:le,latitude:0})},this.arrowFront.onclick=function(){return e.orient({longitude:0,latitude:0})},this.arrowBack.onclick=function(){return e.orient({longitude:Math.PI,latitude:0})}},s.prototype.unbindEvents=function(){this.five.off("renderFrame",this.onRenderFrame),this.five.off("camera.update",this.onCameraUpdate),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("modeChange",this.onFiveModeChange),this.mc.off("tap",this.onTapGesture),this.mc.off("panstart",this.onPanStart),this.mc.off("panend",this.onPanEnd),this.wrapper.removeEventListener("mousemove",this.onMouseMove),this.arrowTop.onclick=null,this.arrowLeft.onclick=null,this.arrowRight.onclick=null,this.arrowFront.onclick=null,this.arrowBack.onclick=null},s.prototype.updateByCamera=function(){var e=Ve(.2,1,this.camera.pose.latitude/Math.PI*2,function(i){return i*i}),n=Ve(11,13,this.camera.pose.latitude/Math.PI*2,function(i){return i*i}),t=Ve(12,15,this.camera.pose.latitude/Math.PI*2,function(i){return i*i}),r=Ve(13,19,this.camera.pose.latitude/Math.PI*2,function(i){return i*i}),l=Ve(-.2,.5,this.camera.pose.latitude/Math.PI*2,function(i){return i*i});this.cylinder.geometry=new p.CylinderGeometry(n,t,.01,50,1,!0),this.cylinder.material.uniforms.radiusTop.value=n,this.cylinder.material.uniforms.radiusBottom.value=t,this.cylinder.material.needsUpdate=!0,this.cylinder.children.forEach(function(i){i.position.normalize().multiplyScalar(r),i.scale.set(e,e,e);var h=i.children[0];h&&(h.element.style.opacity=l.toString())})},s.prototype.updateArrows=function(e){e.longitude;var n=e.latitude,t=le-n<.02;this.setState({arrowsVisible:t})},s.prototype.handleArrowsVisible=function(e){var n=this;if(this.state.enabled)if(this.cylinder.material.uniforms.opacity.value=e?.4:1,this.cylinder.material.needsUpdate=!0,e){var t=this.five.getCurrentState(),r=t.longitude,l=t.latitude;if(le-l<.03)this.five.state.mode==="Topview"||this.five.state.mode==="Mapview"?(this.faces.getObjectByName("上").element.className="active",this.arrows.innerHTML="",this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowFront),this.arrows.style.transform="rotate(".concat((r-this.config.fixedLongitude)/Math.PI*180,"deg)")):(this.arrows.innerHTML="",this.faces.getObjectByName("上").element.className="");else{switch(this.arrows.innerHTML="",this.arrows.appendChild(this.arrowTop),this.config.orthoView&&this.five.ready().then(function(){n.five.controller.cameraType="orthographic",n.five.ready().then(function(){return n.five.controller.cameraMotion.ended=!1})}),!0){case Ue(0,r-this.config.fixedLongitude):this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("前").element.className="active";break;case Ue(le,r-this.config.fixedLongitude):this.arrows.appendChild(this.arrowFront),this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("右").element.className="active";break;case Ue(Math.PI,r-this.config.fixedLongitude):this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("后").element.className="active";break;default:this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowFront),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("左").element.className="active";break}this.arrows.style.transform=""}this.arrows.style.display="block"}else this.config.orthoView&&(this.five.controller.cameraType="auto",this.five.ready().then(function(){return n.five.controller.cameraMotion.ended=!1})),this.arrows.style.display="none",this.faces.children.forEach(function(i){i.children[0].element.className=""})},s.prototype.setState=function(e,n){n===void 0&&(n={});var t=this.state,r=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,r),e.enabled!==void 0&&t.enabled!==e.enabled){var l={userAction:r};e.enabled?this._enable(l):this._disable(l)}},s.prototype.initLights=function(){this.directionalLight.target=this.box,this.scene.add(this.ambientLight,this.directionalLight)},s.prototype.initFaces=function(){var e=dn(7,7,.5),n=new p.ShapeGeometry(e);n.translate(-3.5,-3.5,0);var t=new p.Mesh(n,new p.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));t.userData={longitude:0,latitude:0},t.position.z=4.1,t.add(je("前"));var r=new p.Mesh(n,new p.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));r.rotateY(Math.PI),r.position.z=-4.1,r.add(je("后")),r.userData={longitude:Math.PI,latitude:0};var l=new p.Mesh(n,new p.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));l.rotateY(le),l.position.x=4.1,l.add(je("右")),l.userData={longitude:le,latitude:0};var i=new p.Mesh(n,new p.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));i.rotateY(-le),i.position.x=-4.1,i.add(je("左")),i.userData={longitude:-le,latitude:0};var h=new p.Mesh(n,new p.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));h.rotateX(-le),h.position.y=4.1,h.add(je("上")),h.userData={longitude:0,latitude:le},this.faces.add(t,r,i,l,h)},s.prototype.initControls=function(){var e=this.controls=new De(this.camera,this.renderer.domElement);e.enableZoom=!1,e.enableDamping=!0,e.enablePan=!1,e.maxPolarAngle=le,e.dampingFactor=.15,e.rotateSpeed=.25},s.prototype.load=function(e){return Ce(this,void 0,void 0,function(){return Oe(this,function(n){return[2]})})},s.prototype._enable=function(e){var n=this.five.getCurrentState(),t=n.longitude,r=n.latitude;this.camera.setFromPose({longitude:t,latitude:r,distance:20,offset:new p.Vector3(0,0,0)}),this.updateByCamera(),this.wrapper.appendChild(this.renderer.domElement),this.wrapper.appendChild(this.css3drenderer.domElement),this.bindEvents()},s.prototype._disable=function(e){this.wrapper.removeChild(this.renderer.domElement),this.wrapper.removeChild(this.css3drenderer.domElement),this.unbindEvents()},s.prototype.enable=function(e){var n;if(!this.state.enabled){var t=(n=e==null?void 0:e.userAction)!==null&&n!==void 0?n:!0;this.updateState({enabled:!0},t),this._enable({userAction:t}),document.head.appendChild(this.style)}},s.prototype.disable=function(e){var n;if(this.state.enabled!==!1){var t=(n=e==null?void 0:e.userAction)!==null&&n!==void 0?n:!0;this.updateState({enabled:!1},t),this._disable({userAction:t}),document.head.removeChild(this.style)}},s})(re.BasePlugin.Controller),mn=function(v,s){return new pn(v,s)},gn=(function(v){de(s,v);function s(e,n){var t=v.call(this,e)||this;return t.data={},t.pluginName="BackgroundPlugin",t._onFiveCameraUpdate=function(r){var l=(Math.PI/2-Math.max(r.latitude,0))/(Math.PI/2),i=Math.max(.2-l,0)*10;t.gradientBg&&(t.gradientBg.style.transform="translateY(-".concat((1-l)*50,"%)")),t.groundBg&&(t.groundBg.style.backgroundImage="radial-gradient(circle, #2E303350 ".concat(i*100,"%, transparent ").concat(i*120,"%)"))},t._addEventListener=function(){t.five.on("cameraUpdate",t._onFiveCameraUpdate)},t._removeEventListener=function(){t.five.off("cameraUpdate",t._onFiveCameraUpdate)},t.load=function(){return Ce(t,void 0,void 0,function(){return Oe(this,function(r){return[2]})})},t.setState=function(r,l){},t.enable=function(){var r,l=(r=t.five.getElement())===null||r===void 0?void 0:r.parentNode;if(!l){t.five.ready().then(function(){return t.enable()});return}t.state.enabled||(t._onFiveCameraUpdate(t.five.getPose(),!1),t.gradientBg&&l.appendChild(t.gradientBg),t.groundBg&&l.appendChild(t.groundBg),t.style&&document.head.appendChild(t.style),t._addEventListener(),t.hooks.emit("enable",{userAction:!0}),t.state.enabled=!0)},t.disable=function(r){var l,i,h,c;t.state.enabled&&((i=(l=t.gradientBg)===null||l===void 0?void 0:l.parentNode)===null||i===void 0||i.removeChild(t.gradientBg),(c=(h=t.groundBg)===null||h===void 0?void 0:h.parentNode)===null||c===void 0||c.removeChild(t.groundBg),t.style&&document.head.removeChild(t.style),t._removeEventListener(),t.hooks.emit("disable",{userAction:!0}),t.state.enabled=!1)},t.dispose=function(){t._removeEventListener(),t.hooks.emit("disable",{userAction:!0}),t.state.enabled=!1},t.state={enabled:!1},typeof document=="undefined"||(t.gradientBg=document.createElement("div"),t.groundBg=document.createElement("div"),t.style=document.createElement("style"),t.gradientBg.className="BackgroundPluginBg",t.groundBg.className="BackgroundPluginGroundBg",t.style.innerHTML=`
482
+ `,this.wrapper.className=`OrientationPlugin`,this.arrows.className=`OrientationArrows`,this.wrapper.style.cssText=`position: relative; width: 100%; height: 100%`,this.wrapper.appendChild(this.arrows),this.arrowLeft.className=this.arrowRight.className=this.arrowTop.className=this.arrowBack.className=this.arrowFront.className=`OrientationArrow`,this.arrowBottom.className=`OrientationArrow disabled`,this.arrowBack.innerText=`后`,this.arrowFront.innerText=`前`,this.arrowLeft.innerText=`左`,this.arrowRight.innerText=`右`,this.arrowTop.innerText=`上`,this.arrowBottom.innerText=`下`,this.css3drenderer.domElement.style.cssText=`position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; color: #00000090;`}bindEvents(){this.five.on(`renderFrame`,this.onRenderFrame),this.five.on(`camera.update`,this.onCameraUpdate),this.five.on(`wantsGesture`,this.onFiveWantsGesture),this.five.on(`modeChange`,this.onFiveModeChange),this.mc.on(`tap`,this.onTapGesture),this.mc.on(`panstart`,this.onPanStart),this.mc.on(`panend`,this.onPanEnd),this.wrapper.addEventListener(`mousemove`,this.onMouseMove),this.arrowTop.onclick=()=>this.orient({longitude:0,latitude:L}),this.arrowLeft.onclick=()=>this.orient({longitude:-L,latitude:0}),this.arrowRight.onclick=()=>this.orient({longitude:L,latitude:0}),this.arrowFront.onclick=()=>this.orient({longitude:0,latitude:0}),this.arrowBack.onclick=()=>this.orient({longitude:Math.PI,latitude:0})}unbindEvents(){this.five.off(`renderFrame`,this.onRenderFrame),this.five.off(`camera.update`,this.onCameraUpdate),this.five.off(`wantsGesture`,this.onFiveWantsGesture),this.five.off(`modeChange`,this.onFiveModeChange),this.mc.off(`tap`,this.onTapGesture),this.mc.off(`panstart`,this.onPanStart),this.mc.off(`panend`,this.onPanEnd),this.wrapper.removeEventListener(`mousemove`,this.onMouseMove),this.arrowTop.onclick=null,this.arrowLeft.onclick=null,this.arrowRight.onclick=null,this.arrowFront.onclick=null,this.arrowBack.onclick=null}updateByCamera(){let e=I(.2,1,this.camera.pose.latitude/Math.PI*2,e=>e*e),t=I(11,13,this.camera.pose.latitude/Math.PI*2,e=>e*e),r=I(12,15,this.camera.pose.latitude/Math.PI*2,e=>e*e),i=I(13,19,this.camera.pose.latitude/Math.PI*2,e=>e*e),a=I(-.2,.5,this.camera.pose.latitude/Math.PI*2,e=>e*e);this.cylinder.geometry=new n.CylinderGeometry(t,r,.01,50,1,!0),this.cylinder.material.uniforms.radiusTop.value=t,this.cylinder.material.uniforms.radiusBottom.value=r,this.cylinder.material.needsUpdate=!0,this.cylinder.children.forEach(t=>{t.position.normalize().multiplyScalar(i),t.scale.set(e,e,e);let n=t.children[0];n&&(n.element.style.opacity=a.toString())})}updateArrows({longitude:e,latitude:t}){let n=L-t<.02;this.setState({arrowsVisible:n})}handleArrowsVisible(e){if(this.state.enabled)if(this.cylinder.material.uniforms.opacity.value=e?.4:1,this.cylinder.material.needsUpdate=!0,e){let{longitude:e,latitude:t}=this.five.getCurrentState();if(L-t<.03)this.five.state.mode===`Topview`||this.five.state.mode===`Mapview`?(this.faces.getObjectByName(`上`).element.className=`active`,this.arrows.innerHTML=``,this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowFront),this.arrows.style.transform=`rotate(${(e-this.config.fixedLongitude)/Math.PI*180}deg)`):(this.arrows.innerHTML=``,this.faces.getObjectByName(`上`).element.className=``);else{switch(this.arrows.innerHTML=``,this.arrows.appendChild(this.arrowTop),this.config.orthoView&&this.five.ready().then(()=>{this.five.controller.cameraType=`orthographic`,this.five.ready().then(()=>this.five.controller.cameraMotion.ended=!1)}),!0){case F(0,e-this.config.fixedLongitude):this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName(`前`).element.className=`active`;break;case F(L,e-this.config.fixedLongitude):this.arrows.appendChild(this.arrowFront),this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName(`右`).element.className=`active`;break;case F(Math.PI,e-this.config.fixedLongitude):this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName(`后`).element.className=`active`;break;default:this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowFront),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName(`左`).element.className=`active`;break}this.arrows.style.transform=``}this.arrows.style.display=`block`}else this.config.orthoView&&(this.five.controller.cameraType=`auto`,this.five.ready().then(()=>this.five.controller.cameraMotion.ended=!1)),this.arrows.style.display=`none`,this.faces.children.forEach(e=>{e.children[0].element.className=``})}setState(e,t={}){let n=this.state,r=t.userAction===void 0?!0:t.userAction;if(this.updateState(e,r),e.enabled!==void 0&&n.enabled!==e.enabled){let t={userAction:r};e.enabled?this._enable(t):this._disable(t)}}initLights(){this.directionalLight.target=this.box,this.scene.add(this.ambientLight,this.directionalLight)}initFaces(){let e=R(7,7,.5),t=new n.ShapeGeometry(e);t.translate(-3.5,-3.5,0);let r=new n.Mesh(t,new n.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));r.userData={longitude:0,latitude:0},r.position.z=4.1,r.add(z(`前`));let i=new n.Mesh(t,new n.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));i.rotateY(Math.PI),i.position.z=-4.1,i.add(z(`后`)),i.userData={longitude:Math.PI,latitude:0};let a=new n.Mesh(t,new n.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));a.rotateY(L),a.position.x=4.1,a.add(z(`右`)),a.userData={longitude:L,latitude:0};let o=new n.Mesh(t,new n.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));o.rotateY(-L),o.position.x=-4.1,o.add(z(`左`)),o.userData={longitude:-L,latitude:0};let s=new n.Mesh(t,new n.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));s.rotateX(-L),s.position.y=4.1,s.add(z(`上`)),s.userData={longitude:0,latitude:L},this.faces.add(r,i,o,a,s)}initControls(){let e=this.controls=new j(this.camera,this.renderer.domElement);e.enableZoom=!1,e.enableDamping=!0,e.enablePan=!1,e.maxPolarAngle=L,e.dampingFactor=.15,e.rotateSpeed=.25}load(e){return m(this,void 0,void 0,function*(){})}_enable(e){let{longitude:t,latitude:r}=this.five.getCurrentState();this.camera.setFromPose({longitude:t,latitude:r,distance:20,offset:new n.Vector3(0,0,0)}),this.updateByCamera(),this.wrapper.appendChild(this.renderer.domElement),this.wrapper.appendChild(this.css3drenderer.domElement),this.bindEvents()}_disable(e){this.wrapper.removeChild(this.renderer.domElement),this.wrapper.removeChild(this.css3drenderer.domElement),this.unbindEvents()}enable(e){var t;if(this.state.enabled)return;let n=(t=e==null?void 0:e.userAction)==null?!0:t;this.updateState({enabled:!0},n),this._enable({userAction:n}),document.head.appendChild(this.style)}disable(e){var t;if(this.state.enabled===!1)return;let n=(t=e==null?void 0:e.userAction)==null?!0:t;this.updateState({enabled:!1},n),this._disable({userAction:n}),document.head.removeChild(this.style)}},ie=(e,t)=>new V(e,t),H=class extends r.BasePlugin.Controller{constructor(e,t){super(e),this.data={},this.pluginName=`BackgroundPlugin`,this._onFiveCameraUpdate=e=>{let t=(Math.PI/2-Math.max(e.latitude,0))/(Math.PI/2),n=Math.max(.2-t,0)*10;this.gradientBg&&(this.gradientBg.style.transform=`translateY(-${(1-t)*50}%)`),this.groundBg&&(this.groundBg.style.backgroundImage=`radial-gradient(circle, #2E303350 ${n*100}%, transparent ${n*120}%)`)},this._addEventListener=()=>{this.five.on(`cameraUpdate`,this._onFiveCameraUpdate)},this._removeEventListener=()=>{this.five.off(`cameraUpdate`,this._onFiveCameraUpdate)},this.load=()=>m(this,void 0,void 0,function*(){}),this.setState=(e,t={})=>{},this.enable=()=>{var e;let t=(e=this.five.getElement())==null?void 0:e.parentNode;if(!t){this.five.ready().then(()=>this.enable());return}this.state.enabled||(this._onFiveCameraUpdate(this.five.getPose(),!1),this.gradientBg&&t.appendChild(this.gradientBg),this.groundBg&&t.appendChild(this.groundBg),this.style&&document.head.appendChild(this.style),this._addEventListener(),this.hooks.emit(`enable`,{userAction:!0}),this.state.enabled=!0)},this.disable=(e={})=>{var t,n,r,i;this.state.enabled&&((n=(t=this.gradientBg)==null?void 0:t.parentNode)==null||n.removeChild(this.gradientBg),(i=(r=this.groundBg)==null?void 0:r.parentNode)==null||i.removeChild(this.groundBg),this.style&&document.head.removeChild(this.style),this._removeEventListener(),this.hooks.emit(`disable`,{userAction:!0}),this.state.enabled=!1)},this.dispose=()=>{this._removeEventListener(),this.hooks.emit(`disable`,{userAction:!0}),this.state.enabled=!1},this.state={enabled:!1},!(typeof document>`u`)&&(this.gradientBg=document.createElement(`div`),this.groundBg=document.createElement(`div`),this.style=document.createElement(`style`),this.gradientBg.className=`BackgroundPluginBg`,this.groundBg.className=`BackgroundPluginGroundBg`,this.style.innerHTML=`
487
483
  .BackgroundPluginBg {
488
484
  position: absolute;
489
485
  top: 0;
@@ -504,7 +500,7 @@ void main() {
504
500
  z-index: -1;
505
501
  pointerEvents: none;
506
502
  }
507
- `,t.enable()),t}return s})(lt.BasePlugin.Controller),yn=function(v,s){return new gn(v,s)};new p.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);var vt=(function(){function v(s,e,n,t,r){this.R=s,this.Q=e,this.A=n,this.B=t,this.C=r,this.cov=NaN,this.x=NaN}return v.prototype.filter=function(s,e){if(e===void 0&&(e=0),isNaN(this.x))this.x=1/this.C*s,this.cov=1/this.C*this.Q*(1/this.C);else{var n=this.A*this.x+this.B*e,t=this.A*this.cov*this.A+this.R,r=t*this.C*(1/(this.C*t*this.C+this.Q));this.x=n+r*(s-this.C*n),this.cov=t-r*this.C*t}return this.x},v})(),bn=(function(v){de(s,v);function s(e,n){var t=v.call(this,e)||this;t.dispose=function(){t.disable()},t.five=e;var r={enabled:!0,visible:!0};t.state=Object.assign(r,n==null?void 0:n.initialState);var l=N({},n==null?void 0:n.config);return t._config=l,t.state.enabled&&t._enable({userAction:!1}),t.cancelAnimation=null,t.skipStart=0,t.skipEnd=0,t.location=0,t.totalDistance=0,t.trajectory=null,t.currentKeyFrame=null,t.nextKeyframe=null,t.nextButOneKeyframe=null,t.keyframes=[],t.rate=t.config.rate||1,t.virualCamera=t.five.camera.clone(),t.playingState={keyframeIndex:null,progress:null},t.timeArray=null,t.startTimestamp=null,t.playbackStartTime=null,t.playbackEndTime=null,Object.defineProperties(t,{currentDistance:{get:function(){return this._currentDistance},set:function(i){this._currentDistance=i}}}),t}return Object.defineProperty(s.prototype,"config",{get:function(){return N({},this._config)},enumerable:!1,configurable:!0}),s.prototype.updateState=function(e,n){var t=this.state;this.state=N(N({},this.state),e),this.hooks.emit("stateChange",{state:this.state,prevState:t,userAction:n})},s.prototype.load=function(e){return Ce(this,void 0,void 0,function(){return Oe(this,function(n){return[2]})})},s.prototype.loadTrajectory=function(e){this.trajectory=e,this.cancelAnimation&&this.cancelAnimation(),this.playingState.keyframeIndex=null,this.playingState.progress=null;var n=.01,t=.1,r=1,l=0,i=1,h=new vt(n,t,r,l,i),c=new vt(n,t,r,l,i),d=new vt(n,t,r,l,i);if(this.trajectory&&this.trajectory.content.loadState==="READY"){var y=this.trajectory.content.data.positionArray;this.timeArray=this.trajectory.content.data.timeArray;for(var S=new Float32Array(y.length/3),w=0;w<S.length;w++)if(w===0)S[w]=0;else{var M=new p.Vector3(y[w-3],y[w-2],y[w-1]),E=new p.Vector3(y[w],y[w+1],y[w+2]);S[w]=E.distanceTo(M)+S[w-1]}this.totalDistance=S[S.length-1];for(var w=0;w<S.length;w++){for(var O=new p.Vector3(0,0,0),A=0,b=w-5;b<w+6;b++)b>=0&&b<S.length&&(O.add(new p.Vector3(y[b*3],y[b*3+1],y[b*3+2])),A++);O.divideScalar(A).applyMatrix4(e.transform);var T=h.filter(O.x),f=c.filter(O.y),C=d.filter(O.z),x={position:new p.Vector3(T,f,C),location:S[w]};this.keyframes.push(x)}}else throw new Error("trajectory content is not ready")},s.prototype.setPlayingState=function(e){(e.keyframeIndex!==null||e.progress!==null)&&(this.cancelAnimation&&this.cancelAnimation(),this.playingState.keyframeIndex=e.keyframeIndex?e.keyframeIndex:this.playingState.keyframeIndex,this.playingState.progress=e.progress?e.progress:this.playingState.progress,this.play())},s.prototype._enable=function(e){},s.prototype.play=function(){var e=this,n=this.keyframes.length;if(n<2)throw new Error("keyframes length must be greater than 2");var t={keyframeIndex:null,progress:null};this.playingState.keyframeIndex!==null&&this.playingState.progress!==null?(t.keyframeIndex=this.playingState.keyframeIndex,t.progress=this.playingState.progress):this.playingState.keyframeIndex===null&&this.playingState.progress===null&&(this.playingState.keyframeIndex=this.skipStart,this.playingState.progress=0,this.virualCamera.position.copy(this.keyframes[this.playingState.keyframeIndex].position.clone()),this.virualCamera.lookAt(this.keyframes[1].position.clone()),this.virualCamera.computePose(),this.five.setState(N({},this.virualCamera.pose)));var r=this.playingState.keyframeIndex,l=0;this.cancelAnimation=fe.AnimationFrameLoop.shared.add(function(i,h){if(r===n-1-e.skipEnd&&e.cancelAnimation){e.cancelAnimation();return}e.currentKeyFrame=e.keyframes[r],e.nextKeyframe=e.keyframes[r+1],r+2<=n-1?e.nextButOneKeyframe=e.keyframes[r+2]:e.nextButOneKeyframe=null;var c=e.currentKeyFrame.position.clone(),d=e.nextKeyframe.position.clone(),y=e.nextKeyframe.position.clone().sub(e.currentKeyFrame.position.clone()).normalize(),S=c.clone().add(y.clone().multiplyScalar(.01)),w=new p.Vector3;e.nextButOneKeyframe!==null?w=e.nextButOneKeyframe.position.clone().sub(e.nextKeyframe.position.clone()).normalize():w.copy(y);var M=d.clone().add(w.clone().multiplyScalar(.01));l+=h/1e3*e.rate;var E=l/c.distanceTo(d);E=E>=1?1:E,t.keyframeIndex!==null&&t.progress!==null&&(E=t.progress,t.keyframeIndex=null,t.progress=null);var O=c.clone().lerp(d,E),A=S.clone().lerp(M,E);e.virualCamera.position.copy(O),e.virualCamera.lookAt(A),e.virualCamera.updateMatrixWorld(),e.virualCamera.updateMatrix(),e.virualCamera.computePose(),e.five.setState(N({},e.virualCamera.pose)),e.location=e.keyframes[r].location+c.clone().distanceTo(O),E===1?(l=0,r++,e.playingState.keyframeIndex=r,e.playingState.progress=0):(e.playingState.keyframeIndex=r,e.playingState.progress=E)})},s.prototype.pause=function(){var e;if(this.cancelAnimation){if(this.playingState.keyframeIndex!==null&&this.playingState.keyframeIndex>=0&&this.playingState.keyframeIndex<this.keyframes.length){var n=this.playingState.keyframeIndex,t=(e=this.playingState.progress)!==null&&e!==void 0?e:0,r=this.keyframes[n],l=n+1<this.keyframes.length?this.keyframes[n+1]:r,i=r.position.clone(),h=l.position.clone(),c=i.clone().lerp(h,t),d=h.clone().sub(i).normalize(),y=c.clone().add(d.multiplyScalar(.01));this.virualCamera.position.copy(c),this.virualCamera.lookAt(y),this.virualCamera.updateMatrixWorld(),this.virualCamera.updateMatrix(),this.virualCamera.computePose(),this.five.setState(N({},this.virualCamera.pose))}else if(this.currentKeyFrame&&this.nextKeyframe){var i=this.currentKeyFrame.position.clone(),h=this.nextKeyframe.position.clone(),c=i.clone(),d=h.clone().sub(i).normalize(),y=c.clone().add(d.multiplyScalar(.01));this.virualCamera.position.copy(c),this.virualCamera.lookAt(y),this.virualCamera.updateMatrixWorld(),this.virualCamera.updateMatrix(),this.virualCamera.computePose(),this.five.setState(N({},this.virualCamera.pose))}this.cancelAnimation()}this.startTimestamp=null},s.prototype.playByTimestamp=function(){var e=this,n;if(!this.trajectory||!this.timeArray||this.timeArray.length===0)throw new Error("Trajectory or timeArray is not available");var t=this.keyframes.length;if(t<2)throw new Error("keyframes length must be greater than 2");this.cancelAnimation&&this.cancelAnimation();var r=this.skipStart,l=this.timeArray.length-1-this.skipEnd;if(r>=l||r<0||l>=this.timeArray.length)throw new Error("Invalid skipStart or skipEnd values");this.playbackStartTime=this.timeArray[r],this.playbackEndTime=this.timeArray[l],this.playbackEndTime-this.playbackStartTime;var i,h=0,c=null;if(this.playingState.keyframeIndex!==null&&this.playingState.keyframeIndex>=r&&this.playingState.keyframeIndex<t-this.skipEnd){i=this.playingState.keyframeIndex,h=(n=this.playingState.progress)!==null&&n!==void 0?n:0;var d=this.timeArray[i],y=i+1<this.timeArray.length?this.timeArray[i+1]:d,S=y-d;c=d+S*h}else i=this.skipStart,i>=t-1-this.skipEnd&&(i=t-1-this.skipEnd-1),i<0&&(i=0),c=null;var w=this.playbackStartTime;if(c!==null){var M=c-w;this.startTimestamp=Date.now()-M/this.rate}else this.startTimestamp=Date.now();if(h>0&&i+1<t){var E=this.keyframes[i].position.clone(),O=this.keyframes[i+1].position.clone(),A=E.clone().lerp(O,h),b=O.clone().sub(E).normalize(),T=A.clone().add(b.multiplyScalar(.01));this.virualCamera.position.copy(A),this.virualCamera.lookAt(T)}else this.virualCamera.position.copy(this.keyframes[i].position.clone()),i+1<t&&this.virualCamera.lookAt(this.keyframes[i+1].position.clone());this.virualCamera.computePose(),this.five.setState(N({},this.virualCamera.pose)),this.cancelAnimation=fe.AnimationFrameLoop.shared.add(function(f,C){if(e.startTimestamp){var x=Date.now()-e.startTimestamp,F=w+x*e.rate;if(e.playbackEndTime&&F>=e.playbackEndTime){var G=t-1-e.skipEnd;if(G>0&&G<t){if(e.currentKeyFrame=e.keyframes[G-1],e.nextKeyframe=e.keyframes[G],e.virualCamera.position.copy(e.nextKeyframe.position.clone()),G+1<t)e.virualCamera.lookAt(e.keyframes[G+1].position.clone());else{var W=e.nextKeyframe.position.clone().sub(e.currentKeyFrame.position.clone()).normalize();e.virualCamera.lookAt(e.nextKeyframe.position.clone().add(W.multiplyScalar(.01)))}e.virualCamera.computePose(),e.five.setState(N({},e.virualCamera.pose))}e.cancelAnimation&&(e.cancelAnimation(),e.startTimestamp=null);return}var Y=e.findKeyFrameByTimestamp(F);if(!(Y===void 0||Y>=t-1-e.skipEnd)&&(Y!==i&&(i=Y),!(i>=t-1-e.skipEnd)&&(e.currentKeyFrame=e.keyframes[i],e.nextKeyframe=e.keyframes[i+1],i+2<=t-1?e.nextButOneKeyframe=e.keyframes[i+2]:e.nextButOneKeyframe=null,!!e.timeArray))){var Z=e.timeArray[i],J=e.timeArray[i+1],j=J-Z,X=j>0?(F-Z)/j:0,L=Math.max(0,Math.min(1,X)),k=e.currentKeyFrame.position.clone(),I=e.nextKeyframe.position.clone(),B=e.nextKeyframe.position.clone().sub(e.currentKeyFrame.position.clone()).normalize(),K=k.clone().add(B.clone().multiplyScalar(.01)),ee=new p.Vector3;e.nextButOneKeyframe!==null?ee=e.nextButOneKeyframe.position.clone().sub(e.nextKeyframe.position.clone()).normalize():ee.copy(B);var Q=I.clone().add(ee.clone().multiplyScalar(.01)),U=k.clone().lerp(I,L),ae=K.clone().lerp(Q,L);e.virualCamera.position.copy(U),e.virualCamera.lookAt(ae),e.virualCamera.updateMatrixWorld(),e.virualCamera.updateMatrix(),e.virualCamera.computePose(),e.five.setState(N({},e.virualCamera.pose)),e.playingState.keyframeIndex=i,e.playingState.progress=L,e.location=e.keyframes[i].location+k.clone().distanceTo(U),e.playingState.keyframeIndex=i,e.playingState.progress=L}}})},s.prototype.findKeyFrameByLocation=function(e){if(this.keyframes.length!==0){for(var n=0,t=this.keyframes.length-1;n<=t;){var r=Math.floor((n+t)/2);if(this.keyframes[r].location===e)return r;this.keyframes[r].location<e?n=r+1:t=r-1}return{keyframeIndex:n-1,progress:0}}},s.prototype.findKeyFrameByTimestamp=function(e){if(!(!this.timeArray||this.timeArray.length===0||this.keyframes.length===0)){for(var n=0,t=this.timeArray.length-1,r=0,l=Math.abs(this.timeArray[0]-e);n<=t;){var i=Math.floor((n+t)/2),h=this.timeArray[i],c=Math.abs(h-e);if(c<l&&(l=c,r=i),h===e)return i;h<e?n=i+1:t=i-1}if(r>0){var d=Math.abs(this.timeArray[r-1]-e);d<l&&(r=r-1)}if(r<this.timeArray.length-1){var y=Math.abs(this.timeArray[r+1]-e);y<l&&(r=r+1)}return r}},s.prototype.resetPlayingState=function(){this.playingState.keyframeIndex=null,this.playingState.progress=null},s.prototype.getTotalTime=function(){if(!this.timeArray||this.timeArray.length===0)return null;var e=this.skipStart,n=this.timeArray.length-1-this.skipEnd;if(e>=n||e<0||n>=this.timeArray.length)return null;var t=this.timeArray[e],r=this.timeArray[n];return r-t},s.prototype.setPlayingStateByTimestamp=function(e){var n=this;if(!this.trajectory||!this.timeArray||this.timeArray.length===0)throw new Error("Trajectory or timeArray is not available");var t=this.keyframes.length;if(e<0||e>=t)throw new Error("Invalid keyframeIndex");this.cancelAnimation&&this.cancelAnimation();var r=this.skipStart,l=this.timeArray.length-1-this.skipEnd;if(r>=l||r<0||l>=this.timeArray.length)throw new Error("Invalid skipStart or skipEnd values");this.playbackStartTime=this.timeArray[r],this.playbackEndTime=this.timeArray[l];var i=this.timeArray[e],h=i-this.playbackStartTime;if(this.startTimestamp=Date.now()-h/this.rate,this.playingState.keyframeIndex=e,this.playingState.progress=0,this.virualCamera.position.copy(this.keyframes[e].position.clone()),e+1<t)this.virualCamera.lookAt(this.keyframes[e+1].position.clone());else if(e>0){var c=this.keyframes[e].position.clone().sub(this.keyframes[e-1].position.clone()).normalize();this.virualCamera.lookAt(this.keyframes[e].position.clone().add(c.multiplyScalar(.01)))}this.virualCamera.computePose(),this.five.setState(N({},this.virualCamera.pose));var d=this.playbackStartTime,y=e;this.cancelAnimation=fe.AnimationFrameLoop.shared.add(function(S,w){if(!(n.timeArray===null||n.timeArray.length===0)&&n.startTimestamp){var M=Date.now()-n.startTimestamp,E=d+M*n.rate;if(n.playbackEndTime&&E>=n.playbackEndTime){var O=t-1-n.skipEnd;if(O>0&&O<t){if(n.currentKeyFrame=n.keyframes[O-1],n.nextKeyframe=n.keyframes[O],n.virualCamera.position.copy(n.nextKeyframe.position.clone()),O+1<t)n.virualCamera.lookAt(n.keyframes[O+1].position.clone());else{var A=n.nextKeyframe.position.clone().sub(n.currentKeyFrame.position.clone()).normalize();n.virualCamera.lookAt(n.nextKeyframe.position.clone().add(A.multiplyScalar(.01)))}n.virualCamera.computePose(),n.five.setState(N({},n.virualCamera.pose))}n.cancelAnimation&&(n.cancelAnimation(),n.startTimestamp=null);return}var b=n.findKeyFrameByTimestamp(E);if(!(b===void 0||b>=t-1-n.skipEnd)&&(b!==y&&(y=b),!(y>=t-1-n.skipEnd))){n.currentKeyFrame=n.keyframes[y],n.nextKeyframe=n.keyframes[y+1],y+2<=t-1?n.nextButOneKeyframe=n.keyframes[y+2]:n.nextButOneKeyframe=null;var T=n.currentKeyFrame.position.clone(),f=n.nextKeyframe.position.clone(),C=n.nextKeyframe.position.clone().sub(n.currentKeyFrame.position.clone()).normalize(),x=T.clone().add(C.clone().multiplyScalar(.01)),F=new p.Vector3;n.nextButOneKeyframe!==null?F=n.nextButOneKeyframe.position.clone().sub(n.nextKeyframe.position.clone()).normalize():F.copy(C);var G=f.clone().add(F.clone().multiplyScalar(.01)),W=n.timeArray[y],Y=n.timeArray[y+1],Z=Y-W,J=0;if(Z>0){var j=E-W;J=Math.max(0,Math.min(1,j/Z))}var X=J*J*(3-2*J),L=T.clone().lerp(f,X),k=x.clone().lerp(G,X);n.virualCamera.position.copy(L),n.virualCamera.lookAt(k),n.virualCamera.computePose(),n.five.setState(N({},n.virualCamera.pose))}}})},s.prototype._disable=function(e){},s.prototype.enable=function(e){var n;if(!this.state.enabled){var t=(n=e==null?void 0:e.userAction)!==null&&n!==void 0?n:!0;this.updateState({enabled:!0},t),this._enable({userAction:t})}},s.prototype.disable=function(e){var n;if(this.state.enabled!==!1){var t=(n=e==null?void 0:e.userAction)!==null&&n!==void 0?n:!0;this.updateState({enabled:!1},t),this._disable({userAction:t})}},s})(re.BasePlugin.Controller),wn=function(v,s){return new bn(v,s)};function It(v,s,e){return v<s?s:v>e?e:v}var An=`
503
+ `,this.enable())}},U=(e,t)=>new H(e,t);new n.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);var W=class{constructor(e,t,n,r,i){this.R=e,this.Q=t,this.A=n,this.B=r,this.C=i,this.cov=NaN,this.x=NaN}filter(e,t=0){if(isNaN(this.x))this.x=1/this.C*e,this.cov=1/this.C*this.Q*(1/this.C);else{let n=this.A*this.x+this.B*t,r=this.A*this.cov*this.A+this.R,i=r*this.C*(1/(this.C*r*this.C+this.Q));this.x=n+i*(e-this.C*n),this.cov=r-i*this.C*r}return this.x}},ae=class extends p.Controller{get config(){return Object.assign({},this._config)}updateState(e,t){let n=this.state;this.state=Object.assign(Object.assign({},this.state),e),this.hooks.emit(`stateChange`,{state:this.state,prevState:n,userAction:t})}constructor(e,t){super(e),this.dispose=()=>{this.disable()},this.five=e,this.state=Object.assign({enabled:!0,visible:!0},t==null?void 0:t.initialState),this._config=Object.assign({},t==null?void 0:t.config),this.state.enabled&&this._enable({userAction:!1}),this.cancelAnimation=null,this.skipStart=0,this.skipEnd=0,this.location=0,this.totalDistance=0,this.trajectory=null,this.currentKeyFrame=null,this.nextKeyframe=null,this.nextButOneKeyframe=null,this.keyframes=[],this.rate=this.config.rate||1,this.virualCamera=this.five.camera.clone(),this.playingState={keyframeIndex:null,progress:null},this.timeArray=null,this.startTimestamp=null,this.playbackStartTime=null,this.playbackEndTime=null,Object.defineProperties(this,{currentDistance:{get(){return this._currentDistance},set(e){this._currentDistance=e}}})}load(e){return m(this,void 0,void 0,function*(){})}loadTrajectory(e){this.trajectory=e,this.cancelAnimation&&this.cancelAnimation(),this.playingState.keyframeIndex=null,this.playingState.progress=null;let t=.01,r=.1,i=new W(t,r,1,0,1),a=new W(t,r,1,0,1),o=new W(t,r,1,0,1);if(this.trajectory&&this.trajectory.content.loadState===`READY`){let t=this.trajectory.content.data.positionArray;this.timeArray=this.trajectory.content.data.timeArray;let r=new Float32Array(t.length/3);for(let e=0;e<r.length;e++)if(e===0)r[e]=0;else{let i=new n.Vector3(t[e-3],t[e-2],t[e-1]);r[e]=new n.Vector3(t[e],t[e+1],t[e+2]).distanceTo(i)+r[e-1]}this.totalDistance=r[r.length-1];for(let s=0;s<r.length;s++){let c=new n.Vector3(0,0,0),l=0;for(let e=s-5;e<s+6;e++)e>=0&&e<r.length&&(c.add(new n.Vector3(t[e*3],t[e*3+1],t[e*3+2])),l++);c.divideScalar(l).applyMatrix4(e.transform);let u=i.filter(c.x),d=a.filter(c.y),f=o.filter(c.z),p={position:new n.Vector3(u,d,f),location:r[s]};this.keyframes.push(p)}}else throw Error(`trajectory content is not ready`)}setPlayingState(e){(e.keyframeIndex!==null||e.progress!==null)&&(this.cancelAnimation&&this.cancelAnimation(),this.playingState.keyframeIndex=e.keyframeIndex?e.keyframeIndex:this.playingState.keyframeIndex,this.playingState.progress=e.progress?e.progress:this.playingState.progress,this.play())}_enable(e){}play(){let e=this.keyframes.length;if(e<2)throw Error(`keyframes length must be greater than 2`);let r={keyframeIndex:null,progress:null};this.playingState.keyframeIndex!==null&&this.playingState.progress!==null?(r.keyframeIndex=this.playingState.keyframeIndex,r.progress=this.playingState.progress):this.playingState.keyframeIndex===null&&this.playingState.progress===null&&(this.playingState.keyframeIndex=this.skipStart,this.playingState.progress=0,this.virualCamera.position.copy(this.keyframes[this.playingState.keyframeIndex].position.clone()),this.virualCamera.lookAt(this.keyframes[1].position.clone()),this.virualCamera.computePose(),this.five.setState(Object.assign({},this.virualCamera.pose)));let i=this.playingState.keyframeIndex,a=0;this.cancelAnimation=t.AnimationFrameLoop.shared.add((t,o)=>{if(i===e-1-this.skipEnd&&this.cancelAnimation){this.cancelAnimation();return}this.currentKeyFrame=this.keyframes[i],this.nextKeyframe=this.keyframes[i+1],i+2<=e-1?this.nextButOneKeyframe=this.keyframes[i+2]:this.nextButOneKeyframe=null;let s=this.currentKeyFrame.position.clone(),c=this.nextKeyframe.position.clone(),l=this.nextKeyframe.position.clone().sub(this.currentKeyFrame.position.clone()).normalize(),u=s.clone().add(l.clone().multiplyScalar(.01)),d=new n.Vector3;this.nextButOneKeyframe===null?d.copy(l):d=this.nextButOneKeyframe.position.clone().sub(this.nextKeyframe.position.clone()).normalize();let f=c.clone().add(d.clone().multiplyScalar(.01));a+=o/1e3*this.rate;let p=a/s.distanceTo(c);p=p>=1?1:p,r.keyframeIndex!==null&&r.progress!==null&&(p=r.progress,r.keyframeIndex=null,r.progress=null);let m=s.clone().lerp(c,p),h=u.clone().lerp(f,p);this.virualCamera.position.copy(m),this.virualCamera.lookAt(h),this.virualCamera.updateMatrixWorld(),this.virualCamera.updateMatrix(),this.virualCamera.computePose(),this.five.setState(Object.assign({},this.virualCamera.pose)),this.location=this.keyframes[i].location+s.clone().distanceTo(m),p===1?(a=0,i++,this.playingState.keyframeIndex=i,this.playingState.progress=0):(this.playingState.keyframeIndex=i,this.playingState.progress=p)})}pause(){var e;if(this.cancelAnimation){if(this.playingState.keyframeIndex!==null&&this.playingState.keyframeIndex>=0&&this.playingState.keyframeIndex<this.keyframes.length){let t=this.playingState.keyframeIndex,n=(e=this.playingState.progress)==null?0:e,r=this.keyframes[t],i=t+1<this.keyframes.length?this.keyframes[t+1]:r,a=r.position.clone(),o=i.position.clone(),s=a.clone().lerp(o,n),c=o.clone().sub(a).normalize(),l=s.clone().add(c.multiplyScalar(.01));this.virualCamera.position.copy(s),this.virualCamera.lookAt(l),this.virualCamera.updateMatrixWorld(),this.virualCamera.updateMatrix(),this.virualCamera.computePose(),this.five.setState(Object.assign({},this.virualCamera.pose))}else if(this.currentKeyFrame&&this.nextKeyframe){let e=this.currentKeyFrame.position.clone(),t=this.nextKeyframe.position.clone(),n=e.clone(),r=t.clone().sub(e).normalize(),i=n.clone().add(r.multiplyScalar(.01));this.virualCamera.position.copy(n),this.virualCamera.lookAt(i),this.virualCamera.updateMatrixWorld(),this.virualCamera.updateMatrix(),this.virualCamera.computePose(),this.five.setState(Object.assign({},this.virualCamera.pose))}this.cancelAnimation()}this.startTimestamp=null}playByTimestamp(){var e;if(!this.trajectory||!this.timeArray||this.timeArray.length===0)throw Error(`Trajectory or timeArray is not available`);let r=this.keyframes.length;if(r<2)throw Error(`keyframes length must be greater than 2`);this.cancelAnimation&&this.cancelAnimation();let i=this.skipStart,a=this.timeArray.length-1-this.skipEnd;if(i>=a||i<0||a>=this.timeArray.length)throw Error(`Invalid skipStart or skipEnd values`);this.playbackStartTime=this.timeArray[i],this.playbackEndTime=this.timeArray[a],this.playbackEndTime-this.playbackStartTime;let o,s=0,c=null;if(this.playingState.keyframeIndex!==null&&this.playingState.keyframeIndex>=i&&this.playingState.keyframeIndex<r-this.skipEnd){o=this.playingState.keyframeIndex,s=(e=this.playingState.progress)==null?0:e;let t=this.timeArray[o];c=t+((o+1<this.timeArray.length?this.timeArray[o+1]:t)-t)*s}else o=this.skipStart,o>=r-1-this.skipEnd&&(o=r-1-this.skipEnd-1),o<0&&(o=0),c=null;let l=this.playbackStartTime;if(c!==null){let e=c-l;this.startTimestamp=Date.now()-e/this.rate}else this.startTimestamp=Date.now();if(s>0&&o+1<r){let e=this.keyframes[o].position.clone(),t=this.keyframes[o+1].position.clone(),n=e.clone().lerp(t,s),r=t.clone().sub(e).normalize(),i=n.clone().add(r.multiplyScalar(.01));this.virualCamera.position.copy(n),this.virualCamera.lookAt(i)}else this.virualCamera.position.copy(this.keyframes[o].position.clone()),o+1<r&&this.virualCamera.lookAt(this.keyframes[o+1].position.clone());this.virualCamera.computePose(),this.five.setState(Object.assign({},this.virualCamera.pose)),this.cancelAnimation=t.AnimationFrameLoop.shared.add((e,t)=>{if(!this.startTimestamp)return;let i=l+(Date.now()-this.startTimestamp)*this.rate;if(this.playbackEndTime&&i>=this.playbackEndTime){let e=r-1-this.skipEnd;if(e>0&&e<r){if(this.currentKeyFrame=this.keyframes[e-1],this.nextKeyframe=this.keyframes[e],this.virualCamera.position.copy(this.nextKeyframe.position.clone()),e+1<r)this.virualCamera.lookAt(this.keyframes[e+1].position.clone());else{let e=this.nextKeyframe.position.clone().sub(this.currentKeyFrame.position.clone()).normalize();this.virualCamera.lookAt(this.nextKeyframe.position.clone().add(e.multiplyScalar(.01)))}this.virualCamera.computePose(),this.five.setState(Object.assign({},this.virualCamera.pose))}this.cancelAnimation&&(this.cancelAnimation(),this.startTimestamp=null);return}let a=this.findKeyFrameByTimestamp(i);if(a===void 0||a>=r-1-this.skipEnd||(a!==o&&(o=a),o>=r-1-this.skipEnd)||(this.currentKeyFrame=this.keyframes[o],this.nextKeyframe=this.keyframes[o+1],o+2<=r-1?this.nextButOneKeyframe=this.keyframes[o+2]:this.nextButOneKeyframe=null,!this.timeArray))return;let s=this.timeArray[o],c=this.timeArray[o+1]-s,u=c>0?(i-s)/c:0,d=Math.max(0,Math.min(1,u)),f=this.currentKeyFrame.position.clone(),p=this.nextKeyframe.position.clone(),m=this.nextKeyframe.position.clone().sub(this.currentKeyFrame.position.clone()).normalize(),h=f.clone().add(m.clone().multiplyScalar(.01)),g=new n.Vector3;this.nextButOneKeyframe===null?g.copy(m):g=this.nextButOneKeyframe.position.clone().sub(this.nextKeyframe.position.clone()).normalize();let _=p.clone().add(g.clone().multiplyScalar(.01)),v=f.clone().lerp(p,d),y=h.clone().lerp(_,d);this.virualCamera.position.copy(v),this.virualCamera.lookAt(y),this.virualCamera.updateMatrixWorld(),this.virualCamera.updateMatrix(),this.virualCamera.computePose(),this.five.setState(Object.assign({},this.virualCamera.pose)),this.playingState.keyframeIndex=o,this.playingState.progress=d,this.location=this.keyframes[o].location+f.clone().distanceTo(v),this.playingState.keyframeIndex=o,this.playingState.progress=d})}findKeyFrameByLocation(e){if(this.keyframes.length===0)return;let t=0,n=this.keyframes.length-1;for(;t<=n;){let r=Math.floor((t+n)/2);if(this.keyframes[r].location===e)return r;this.keyframes[r].location<e?t=r+1:n=r-1}return{keyframeIndex:t-1,progress:0}}findKeyFrameByTimestamp(e){if(!this.timeArray||this.timeArray.length===0||this.keyframes.length===0)return;let t=0,n=this.timeArray.length-1,r=0,i=Math.abs(this.timeArray[0]-e);for(;t<=n;){let a=Math.floor((t+n)/2),o=this.timeArray[a],s=Math.abs(o-e);if(s<i&&(i=s,r=a),o===e)return a;o<e?t=a+1:n=a-1}return r>0&&Math.abs(this.timeArray[r-1]-e)<i&&--r,r<this.timeArray.length-1&&Math.abs(this.timeArray[r+1]-e)<i&&(r+=1),r}resetPlayingState(){this.playingState.keyframeIndex=null,this.playingState.progress=null}getTotalTime(){if(!this.timeArray||this.timeArray.length===0)return null;let e=this.skipStart,t=this.timeArray.length-1-this.skipEnd;if(e>=t||e<0||t>=this.timeArray.length)return null;let n=this.timeArray[e];return this.timeArray[t]-n}setPlayingStateByTimestamp(e){if(!this.trajectory||!this.timeArray||this.timeArray.length===0)throw Error(`Trajectory or timeArray is not available`);let r=this.keyframes.length;if(e<0||e>=r)throw Error(`Invalid keyframeIndex`);this.cancelAnimation&&this.cancelAnimation();let i=this.skipStart,a=this.timeArray.length-1-this.skipEnd;if(i>=a||i<0||a>=this.timeArray.length)throw Error(`Invalid skipStart or skipEnd values`);this.playbackStartTime=this.timeArray[i],this.playbackEndTime=this.timeArray[a];let o=this.timeArray[e]-this.playbackStartTime;if(this.startTimestamp=Date.now()-o/this.rate,this.playingState.keyframeIndex=e,this.playingState.progress=0,this.virualCamera.position.copy(this.keyframes[e].position.clone()),e+1<r)this.virualCamera.lookAt(this.keyframes[e+1].position.clone());else if(e>0){let t=this.keyframes[e].position.clone().sub(this.keyframes[e-1].position.clone()).normalize();this.virualCamera.lookAt(this.keyframes[e].position.clone().add(t.multiplyScalar(.01)))}this.virualCamera.computePose(),this.five.setState(Object.assign({},this.virualCamera.pose));let s=this.playbackStartTime,c=e;this.cancelAnimation=t.AnimationFrameLoop.shared.add((e,t)=>{if(this.timeArray===null||this.timeArray.length===0||!this.startTimestamp)return;let i=s+(Date.now()-this.startTimestamp)*this.rate;if(this.playbackEndTime&&i>=this.playbackEndTime){let e=r-1-this.skipEnd;if(e>0&&e<r){if(this.currentKeyFrame=this.keyframes[e-1],this.nextKeyframe=this.keyframes[e],this.virualCamera.position.copy(this.nextKeyframe.position.clone()),e+1<r)this.virualCamera.lookAt(this.keyframes[e+1].position.clone());else{let e=this.nextKeyframe.position.clone().sub(this.currentKeyFrame.position.clone()).normalize();this.virualCamera.lookAt(this.nextKeyframe.position.clone().add(e.multiplyScalar(.01)))}this.virualCamera.computePose(),this.five.setState(Object.assign({},this.virualCamera.pose))}this.cancelAnimation&&(this.cancelAnimation(),this.startTimestamp=null);return}let a=this.findKeyFrameByTimestamp(i);if(a===void 0||a>=r-1-this.skipEnd||(a!==c&&(c=a),c>=r-1-this.skipEnd))return;this.currentKeyFrame=this.keyframes[c],this.nextKeyframe=this.keyframes[c+1],c+2<=r-1?this.nextButOneKeyframe=this.keyframes[c+2]:this.nextButOneKeyframe=null;let o=this.currentKeyFrame.position.clone(),l=this.nextKeyframe.position.clone(),u=this.nextKeyframe.position.clone().sub(this.currentKeyFrame.position.clone()).normalize(),d=o.clone().add(u.clone().multiplyScalar(.01)),f=new n.Vector3;this.nextButOneKeyframe===null?f.copy(u):f=this.nextButOneKeyframe.position.clone().sub(this.nextKeyframe.position.clone()).normalize();let p=l.clone().add(f.clone().multiplyScalar(.01)),m=this.timeArray[c],h=this.timeArray[c+1]-m,g=0;if(h>0){let e=i-m;g=Math.max(0,Math.min(1,e/h))}let _=g*g*(3-2*g),v=o.clone().lerp(l,_),y=d.clone().lerp(p,_);this.virualCamera.position.copy(v),this.virualCamera.lookAt(y),this.virualCamera.computePose(),this.five.setState(Object.assign({},this.virualCamera.pose))})}_disable(e){}enable(e){var t;if(this.state.enabled)return;let n=(t=e==null?void 0:e.userAction)==null?!0:t;this.updateState({enabled:!0},n),this._enable({userAction:n})}disable(e){var t;if(this.state.enabled===!1)return;let n=(t=e==null?void 0:e.userAction)==null?!0:t;this.updateState({enabled:!1},n),this._disable({userAction:n})}},G=(e,t)=>new ae(e,t);function K(e,t,n){return e<t?t:e>n?n:e}var oe=`
508
504
  varying vec2 vUv;
509
505
  varying vec3 vPosition;
510
506
  void main() {
@@ -512,7 +508,7 @@ void main() {
512
508
  vPosition = position;
513
509
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
514
510
  }
515
- `,Tn=`
511
+ `,se=`
516
512
  varying vec2 vUv;
517
513
  uniform sampler2D map;
518
514
  uniform float progress;
@@ -531,7 +527,7 @@ void main() {
531
527
  }
532
528
  gl_FragColor.a = gl_FragColor.a * opacity;
533
529
  }
534
- `,Pn=[1,5,2,6,3,7,4,8,9,13,10,14,11,15,12,16],dt=512,pt=512,Qe=128,Mn=(function(v){de(s,v);function s(e,n){var t=v.call(this,e)||this;t.group=new p.Group,t.mesh=(function(){var i=new p.CylinderGeometry(.12,.12,1,32,1,!0);i.translate(0,.5,0);var h=new p.ShaderMaterial({vertexShader:An,fragmentShader:Tn,uniforms:{map:{value:new p.Texture},progress:{value:0},opacity:{value:0}},transparent:!0,depthTest:!1}),c=new p.Mesh(i,h);return c})(),t.panoMesh=new fe.PanoCircleMesh({scale:1.5}),t.stop=function(){},t.drawLine=function(i,h){if(t.ctx){var c=(function(){var S,w=dt/16|0;return w*((S=Pn[i])!==null&&S!==void 0?S:0)})(),d=(1-(h+i*150)%1200/1200)*(pt+Qe),y=t.ctx.createLinearGradient(0,d-Qe,0,d);y.addColorStop(0,"rgba(255,255,255,0)"),y.addColorStop(.5,"rgba(255,255,255,1)"),y.addColorStop(1,"rgba(255,255,255,0)"),t.ctx.fillStyle=y,t.ctx.fillRect(c,d-Qe,3,Qe)}},t.anime=function(i){if(t.ctx&&t.startTime){t.ctx.clearRect(0,0,dt,pt);for(var h=0;h<16;h++)t.drawLine(h,i-t.startTime);var c=It((i-t.startTime)/1e3,0,1),d=It((i-t.startTime)/300,0,t.config.maxOpacity);t.panoMesh.setOpacity(d),t.mesh.material.uniforms.progress.value=c,t.mesh.material.uniforms.opacity.value=d,t.mesh.material.uniforms.map.value.needsUpdate=!0,t.five.needsRender=!0}},t.dispose=function(){t.disable()},t.five=e;var r={enabled:!1,visible:!0};t.state=Object.assign(r,n==null?void 0:n.initialState);var l=N(N({},n==null?void 0:n.config),{maxOpacity:1});return t._config=l,typeof document=="undefined"||(t.canvas=document.createElement("canvas"),t.ctx=t.canvas.getContext("2d"),t.canvas.width=dt,t.canvas.height=pt,t.ctx.shadowColor="rgba(255,255,255,0.5)",t.ctx.shadowBlur=6,t.ctx.shadowOffsetX=0,t.ctx.shadowOffsetY=0,t.mesh.material.uniforms.map.value=new p.CanvasTexture(t.canvas),t.group.add(t.mesh),t.panoMesh.setProgress(1),t.panoMesh.setOpacity(0),t.group.add(t.panoMesh),t.state.enabled&&t._enable({userAction:!1})),t}return Object.defineProperty(s.prototype,"config",{get:function(){return N({},this._config)},enumerable:!1,configurable:!0}),s.prototype.updateState=function(e,n){var t=this.state;this.state=N(N({},this.state),e),this.hooks.emit("stateChange",{state:this.state,prevState:t,userAction:n})},s.prototype.updateConfig=function(e,n){var t;n===void 0&&(n={});var r=this.config,l=N(N({},r),e);this._config=l,this.hooks.emit("configChange",{prevConfig:r,config:l,userAction:(t=n.userAction)!==null&&t!==void 0?t:!0})},s.prototype.load=function(e){return Ce(this,void 0,void 0,function(){return Oe(this,function(n){return[2]})})},s.prototype._enable=function(e){var n=this;this.mesh.position.copy(this.five.observers[this.five.state.panoIndex].standingPosition),this.panoMesh.position.copy(this.five.observers[this.five.state.panoIndex].standingPosition),this.five.ready().then(function(){n.five.scene.add(n.group),n.stop=fe.AnimationFrameLoop.shared.add(function(t,r){n.startTime||(n.startTime=t),n.panoMesh.updateTime(t,r),n.anime(t)})})},s.prototype._disable=function(e){this.five.scene.remove(this.group),this.panoMesh.setOpacity(0),this.startTime=void 0,this.stop(),this.five.needsRender=!0},s.prototype.enable=function(e){var n;if(this.ctx&&!this.state.enabled&&this.five.observers[this.five.state.panoIndex]){var t=(n=e==null?void 0:e.userAction)!==null&&n!==void 0?n:!0;this.updateState({enabled:!0},t),this._enable({userAction:t})}},s.prototype.disable=function(e){var n;if(this.state.enabled!==!1){var t=(n=e==null?void 0:e.userAction)!==null&&n!==void 0?n:!0;this.updateState({enabled:!1},t),this._disable({userAction:t})}},s.prototype.setState=function(e,n){n===void 0&&(n={});var t=this.state,r=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,r),e.enabled!==void 0&&t.enabled!==e.enabled){var l={userAction:r};e.enabled?this._enable(l):this._disable(l)}},s})(lt.BasePlugin.Controller),Sn=function(v,s){return new Mn(v,s)},mt=(function(v){de(s,v);function s(){var e=v.call(this)||this;e.type="LineSegmentsGeometry";var n=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],r=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(r),e.setAttribute("position",new p.Float32BufferAttribute(n,3)),e.setAttribute("uv",new p.Float32BufferAttribute(t,2)),e}return s.prototype.applyMatrix4=function(e){var n=this.attributes.instanceStart,t=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(e),t.applyMatrix4(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},s.prototype.setPositions=function(e){var n;e instanceof Float32Array?n=e:Array.isArray(e)?n=new Float32Array(e):n=new Float32Array;var t=new p.InstancedInterleavedBuffer(n,6,1);return this.setAttribute("instanceStart",new p.InterleavedBufferAttribute(t,3,0)),this.setAttribute("instanceEnd",new p.InterleavedBufferAttribute(t,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},s.prototype.setColors=function(e){var n;e instanceof Float32Array?n=e:Array.isArray(e)?n=new Float32Array(e):n=new Float32Array;var t=new p.InstancedInterleavedBuffer(n,6,1);return this.setAttribute("instanceColorStart",new p.InterleavedBufferAttribute(t,3,0)),this.setAttribute("instanceColorEnd",new p.InterleavedBufferAttribute(t,3,3)),this},s.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},s.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},s.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new p.WireframeGeometry(e.geometry)),this},s.prototype.fromLineSegments=function(e){var n=e.geometry;if(n instanceof p.Geometry){var t=new p.BufferGeometry().fromGeometry(n);this.setPositions(t.attributes.position.array)}else n instanceof p.BufferGeometry&&this.setPositions(n.attributes.position.array);return this},s.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new p.Box3);var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){var t=new p.Box3;this.boundingBox.setFromBufferAttribute(e),t.setFromBufferAttribute(n),this.boundingBox.union(t)}},s.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new p.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){var t=this.boundingSphere.center;this.boundingBox.getCenter(t);for(var r=0,l=new p.Vector3,i=0,h=e.count;i<h;i++)l.fromBufferAttribute(e,i),r=Math.max(r,t.distanceToSquared(l)),l.fromBufferAttribute(n,i),r=Math.max(r,t.distanceToSquared(l));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},s.prototype.toJSON=function(){},s})(p.InstancedBufferGeometry);Object.assign(mt.prototype,{isLineSegmentsGeometry:!0});var gt={uniforms:p.UniformsUtils.merge([p.UniformsLib.common,p.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new p.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1},totalLength:{value:1},animationProgress:{value:0},time:{value:0},waveAmp:{value:.15},waveFreq:{value:5},waveDir:{value:2},startOffset:{value:0},endOffset:{value:0},range:{value:.3}}]),vertexShader:`
530
+ `,ce=[1,5,2,6,3,7,4,8,9,13,10,14,11,15,12,16],q=512,le=512,ue=128,de=class extends r.BasePlugin.Controller{get config(){return Object.assign({},this._config)}updateState(e,t){let n=this.state;this.state=Object.assign(Object.assign({},this.state),e),this.hooks.emit(`stateChange`,{state:this.state,prevState:n,userAction:t})}updateConfig(e,t={}){var n;let r=this.config,i=Object.assign(Object.assign({},r),e);this._config=i,this.hooks.emit(`configChange`,{prevConfig:r,config:i,userAction:(n=t.userAction)==null?!0:n})}constructor(e,r){super(e),this.group=new n.Group,this.mesh=(()=>{let e=new n.CylinderGeometry(.12,.12,1,32,1,!0);e.translate(0,.5,0);let t=new n.ShaderMaterial({vertexShader:oe,fragmentShader:se,uniforms:{map:{value:new n.Texture},progress:{value:0},opacity:{value:0}},transparent:!0,depthTest:!1});return new n.Mesh(e,t)})(),this.panoMesh=new t.PanoCircleMesh({scale:1.5}),this.stop=()=>{},this.drawLine=(e,t)=>{if(!this.ctx)return;let n=(()=>{var t;return(q/16|0)*((t=ce[e])==null?0:t)})(),r=(1-(t+e*150)%1200/1200)*(le+ue),i=this.ctx.createLinearGradient(0,r-ue,0,r);i.addColorStop(0,`rgba(255,255,255,0)`),i.addColorStop(.5,`rgba(255,255,255,1)`),i.addColorStop(1,`rgba(255,255,255,0)`),this.ctx.fillStyle=i,this.ctx.fillRect(n,r-ue,3,ue)},this.anime=e=>{if(!this.ctx||!this.startTime)return;this.ctx.clearRect(0,0,q,le);for(let t=0;t<16;t++)this.drawLine(t,e-this.startTime);let t=K((e-this.startTime)/1e3,0,1),n=K((e-this.startTime)/300,0,this.config.maxOpacity);this.panoMesh.setOpacity(n),this.mesh.material.uniforms.progress.value=t,this.mesh.material.uniforms.opacity.value=n,this.mesh.material.uniforms.map.value.needsUpdate=!0,this.five.needsRender=!0},this.dispose=()=>{this.disable()},this.five=e,this.state=Object.assign({enabled:!1,visible:!0},r==null?void 0:r.initialState),this._config=Object.assign(Object.assign({},r==null?void 0:r.config),{maxOpacity:1}),!(typeof document>`u`)&&(this.canvas=document.createElement(`canvas`),this.ctx=this.canvas.getContext(`2d`),this.canvas.width=q,this.canvas.height=le,this.ctx.shadowColor=`rgba(255,255,255,0.5)`,this.ctx.shadowBlur=6,this.ctx.shadowOffsetX=0,this.ctx.shadowOffsetY=0,this.mesh.material.uniforms.map.value=new n.CanvasTexture(this.canvas),this.group.add(this.mesh),this.panoMesh.setProgress(1),this.panoMesh.setOpacity(0),this.group.add(this.panoMesh),this.state.enabled&&this._enable({userAction:!1}))}load(e){return m(this,void 0,void 0,function*(){})}_enable(e){this.mesh.position.copy(this.five.observers[this.five.state.panoIndex].standingPosition),this.panoMesh.position.copy(this.five.observers[this.five.state.panoIndex].standingPosition),this.five.ready().then(()=>{this.five.scene.add(this.group),this.stop=t.AnimationFrameLoop.shared.add((e,t)=>{this.startTime||(this.startTime=e),this.panoMesh.updateTime(e,t),this.anime(e)})})}_disable(e){this.five.scene.remove(this.group),this.panoMesh.setOpacity(0),this.startTime=void 0,this.stop(),this.five.needsRender=!0}enable(e){var t;if(!this.ctx||this.state.enabled||!this.five.observers[this.five.state.panoIndex])return;let n=(t=e==null?void 0:e.userAction)==null?!0:t;this.updateState({enabled:!0},n),this._enable({userAction:n})}disable(e){var t;if(this.state.enabled===!1)return;let n=(t=e==null?void 0:e.userAction)==null?!0:t;this.updateState({enabled:!1},n),this._disable({userAction:n})}setState(e,t={}){let n=this.state,r=t.userAction===void 0?!0:t.userAction;if(this.updateState(e,r),e.enabled!==void 0&&n.enabled!==e.enabled){let t={userAction:r};e.enabled?this._enable(t):this._disable(t)}}},fe=(e,t)=>new de(e,t),pe=class extends n.InstancedBufferGeometry{constructor(){super(),this.type=`LineSegmentsGeometry`,this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute(`position`,new n.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute(`uv`,new n.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){let t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;t=e instanceof Float32Array?e:Array.isArray(e)?new Float32Array(e):new Float32Array;let r=new n.InstancedInterleavedBuffer(t,6,1);return this.setAttribute(`instanceStart`,new n.InterleavedBufferAttribute(r,3,0)),this.setAttribute(`instanceEnd`,new n.InterleavedBufferAttribute(r,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;t=e instanceof Float32Array?e:Array.isArray(e)?new Float32Array(e):new Float32Array;let r=new n.InstancedInterleavedBuffer(t,6,1);return this.setAttribute(`instanceColorStart`,new n.InterleavedBufferAttribute(r,3,0)),this.setAttribute(`instanceColorEnd`,new n.InterleavedBufferAttribute(r,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new n.WireframeGeometry(e.geometry)),this}fromLineSegments(e){var t=e.geometry;if(t instanceof n.Geometry){let e=new n.BufferGeometry().fromGeometry(t);this.setPositions(e.attributes.position.array)}else t instanceof n.BufferGeometry&&this.setPositions(t.attributes.position.array);return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new n.Box3);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){let r=new n.Box3;this.boundingBox.setFromBufferAttribute(e),r.setFromBufferAttribute(t),this.boundingBox.union(r)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new n.Sphere),this.boundingBox===null&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){let r=this.boundingSphere.center;this.boundingBox.getCenter(r);let i=0,a=new n.Vector3;for(let n=0,o=e.count;n<o;n++)a.fromBufferAttribute(e,n),i=Math.max(i,r.distanceToSquared(a)),a.fromBufferAttribute(t,n),i=Math.max(i,r.distanceToSquared(a));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error(`THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.`,this)}}toJSON(){}};Object.assign(pe.prototype,{isLineSegmentsGeometry:!0});var me={uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new n.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1},totalLength:{value:1},animationProgress:{value:0},time:{value:0},waveAmp:{value:.15},waveFreq:{value:5},waveDir:{value:2},startOffset:{value:0},endOffset:{value:0},range:{value:.3}}]),vertexShader:`
535
531
  #include <common>
536
532
  #include <color_pars_vertex>
537
533
  #include <fog_pars_vertex>
@@ -728,7 +724,7 @@ void main() {
728
724
  #include <fog_fragment>
729
725
  #include <premultiplied_alpha_fragment>
730
726
  }
731
- `},yt=(function(v){de(s,v);function s(e){var n=v.call(this,{uniforms:p.UniformsUtils.clone(gt.uniforms),vertexShader:gt.vertexShader,fragmentShader:gt.fragmentShader,clipping:!0})||this;return n.type="LineMaterial",n.dashed=!1,Object.defineProperties(n,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(t){this.uniforms.time.value=t}},waveAmp:{enumerable:!0,get:function(){return this.uniforms.waveAmp.value},set:function(t){this.uniforms.waveAmp.value=t}},waveFreq:{enumerable:!0,get:function(){return this.uniforms.waveFreq.value},set:function(t){this.uniforms.waveFreq.value=t}},waveDir:{enumerable:!0,get:function(){return this.uniforms.waveDir.value},set:function(t){this.uniforms.waveDir.value=t}},startOffset:{enumerable:!0,get:function(){return this.uniforms.startOffset.value},set:function(t){this.uniforms.startOffset.value=t}},endOffset:{enumerable:!0,get:function(){return this.uniforms.endOffset.value},set:function(t){this.uniforms.endOffset.value=t}},range:{enumerable:!0,get:function(){return this.uniforms.range.value},set:function(t){this.uniforms.range.value=t}},animationProgress:{enumerable:!0,get:function(){return this.uniforms.animationProgress.value},set:function(t){this.uniforms.animationProgress.value=t}}}),n.setValues(e),n}return s})(p.ShaderMaterial);Object.assign(yt.prototype,{isLineMaterial:!0});var Dt=(function(v){de(s,v);function s(e,n){var t=v.call(this)||this;return t.type="LineSegments2",t.geometry=e!==void 0?e:new mt,t.material=n!==void 0?n:new yt({color:Math.random()*16777215}),t}return s.prototype.computeLineDistances=function(){for(var e=this.geometry,n=e.attributes.instanceStart,t=e.attributes.instanceEnd,r=new Float32Array(2*n.count),l=new p.Vector3,i=new p.Vector3,h=0,c=0,d=n.count;c<d;c++)l.fromBufferAttribute(n,c),i.fromBufferAttribute(t,c),h+=l.distanceTo(i);this.material.uniforms.totalLength.value=h;for(var c=0,y=0,d=n.count;c<d;c++,y+=2){l.fromBufferAttribute(n,c),i.fromBufferAttribute(t,c);var S=l.distanceTo(i);r[y]=y===0?0:r[y-1],r[y+1]=r[y]+S}var w=new p.InstancedInterleavedBuffer(r,2,1);return e.setAttribute("instanceDistanceStart",new p.InterleavedBufferAttribute(w,1,0)),e.setAttribute("instanceDistanceEnd",new p.InterleavedBufferAttribute(w,1,1)),this},s.prototype.raycast=function(e,n){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var t=e.ray,r=e.camera,l=r.projectionMatrix,i=this.geometry,h=this.material,c=h.resolution,d=h.linewidth,y=i.attributes.instanceStart,S=i.attributes.instanceEnd,w=new p.Vector4,M=new p.Vector4,E=new p.Vector4,O=new p.Vector3,A=new p.Matrix4,b=new p.Line3,T=new p.Vector3;t.at(1,E),E.w=1,E.applyMatrix4(r.matrixWorldInverse),E.applyMatrix4(l),E.multiplyScalar(1/E.w),E.x*=c.x/2,E.y*=c.y/2,E.z=0,O.copy(E);var f=this.matrixWorld;A.multiplyMatrices(r.matrixWorldInverse,f);for(var C=0,x=y.count;C<x;C++){w.fromBufferAttribute(y,C),M.fromBufferAttribute(S,C),w.w=1,M.w=1,w.applyMatrix4(A),M.applyMatrix4(A),w.applyMatrix4(l),M.applyMatrix4(l),w.multiplyScalar(1/w.w),M.multiplyScalar(1/M.w);var F=w.z<-1&&M.z<-1,G=w.z>1&&M.z>1;if(!(F||G)){w.x*=c.x/2,w.y*=c.y/2,M.x*=c.x/2,M.y*=c.y/2,b.start.copy(w),b.start.z=0,b.end.copy(M),b.end.z=0;var W=b.closestPointToPointParameter(O,!0);b.at(W,T);var Y=p.MathUtils.lerp(w.z,M.z,W),Z=Y>=-1&&Y<=1,J=O.distanceTo(T)<d*.5;if(Z&&J){b.start.fromBufferAttribute(y,C),b.end.fromBufferAttribute(S,C),b.start.applyMatrix4(f),b.end.applyMatrix4(f);var j=new p.Vector3,X=new p.Vector3;t.distanceSqToSegment(b.start,b.end,X,j),n.push({point:X,pointOnLine:j,distance:t.origin.distanceTo(X),object:this,faceIndex:C})}}}},s})(p.Mesh);Object.assign(Dt.prototype,{isLineSegments2:!0});var Nt=(function(v){de(s,v);function s(e,n){var t=v.call(this,e,n)||this;return t.type="Line2",t}return s})(Dt);Object.assign(Nt.prototype,{isLine2:!0});var Bt=(function(v){de(s,v);function s(){var e=v.call(this)||this;return e.type="LineGeometry",e}return s.prototype.setPositions=function(e){for(var n=e.length-3,t=new Float32Array(2*n),r=0;r<n;r+=3)t[2*r]=e[r],t[2*r+1]=e[r+1],t[2*r+2]=e[r+2],t[2*r+3]=e[r+3],t[2*r+4]=e[r+4],t[2*r+5]=e[r+5];return v.prototype.setPositions.call(this,t),this},s.prototype.setColors=function(e){for(var n=e.length-3,t=new Float32Array(2*n),r=0;r<n;r+=3)t[2*r]=e[r],t[2*r+1]=e[r+1],t[2*r+2]=e[r+2],t[2*r+3]=e[r+3],t[2*r+4]=e[r+4],t[2*r+5]=e[r+5];return v.prototype.setColors.call(this,t),this},s.prototype.fromLine=function(e){var n=e.geometry;if(n instanceof p.Geometry){var t=new p.BufferGeometry().fromGeometry(n);this.setPositions(t.attributes.position.array)}else n instanceof p.BufferGeometry&&this.setPositions(n.attributes.position.array);return this},s.prototype.copy=function(){return this},s})(mt);Object.assign(Bt.prototype,{isLineGeometry:!0});var En=(function(v){de(s,v);function s(e,n){var t=v.call(this,e)||this;t.paths=new Map,t.up=new p.Vector3(0,1,0);var r={enabled:!0,visible:!0,playing:!1};t.state=Object.assign(r,n==null?void 0:n.initialState);var l={lineCount:6,spacing:.02,lineWidth:2,color:16777215,speed:2,range:.3,waveAmp:.05,waveFreq:20,particleCount:50,maxDistance:.1,lineYOffset:.1,subMeshWidth:.3,subMeshColor:65535,subMeshOpacity:.3,subMeshMaxOpacity:.5,subMeshSegmentInterval:3,subMeshHighlightWidth:1};return t._config=N(N({},l),n==null?void 0:n.config),n!=null&&n.paths&&n.paths.length>0&&n.paths.forEach(function(i){t.addPath(i)}),t.state.enabled&&t._enable({userAction:!1}),t}return Object.defineProperty(s.prototype,"config",{get:function(){return N({},this._config)},enumerable:!1,configurable:!0}),s.prototype.updateState=function(e,n){var t=this.state;this.state=N(N({},this.state),e),this.hooks.emit("stateChange",{state:this.state,prevState:t,userAction:n})},s.prototype.load=function(e,n){return Ce(this,void 0,void 0,function(){var t,r=this;return Oe(this,function(l){return this.clearAllPaths(),e.paths.forEach(function(i){var h,c,d=i.points.map(function(y){return new p.Vector3(y.x,y.y,y.z)});r.addPath({id:i.id,points:d,enabled:(h=i.enabled)!==null&&h!==void 0?h:!0,visible:(c=i.visible)!==null&&c!==void 0?c:!0,color:i.color,lineWidth:i.lineWidth,speed:i.speed})}),t=new Map,this.paths.forEach(function(i,h){t.set(h,i.config)}),this.data={paths:t},this.hooks.emit("dataLoaded",this.data),n&&this.setState(n),[2]})})},s.prototype.addPath=function(e){var n,t,r,l,i,h,c,d;if(e.points.length<2)return console.warn("DynamicPathLinePlugin: 路径 ".concat(e.id," 至少需要2个点")),!1;if(this.paths.has(e.id))return console.warn("DynamicPathLinePlugin: 路径 ".concat(e.id," 已存在")),!1;var y=new p.CatmullRomCurve3(e.points),S=(n=e.subMeshColor)!==null&&n!==void 0?n:this._config.subMeshColor,w=(t=e.subMeshWidth)!==null&&t!==void 0?t:this._config.subMeshWidth,M=(r=e.subMeshOpacity)!==null&&r!==void 0?r:this._config.subMeshOpacity,E=(l=e.enableSubMesh)!==null&&l!==void 0?l:!0,O=(i=e.speed)!==null&&i!==void 0?i:this._config.speed,A=(h=e.range)!==null&&h!==void 0?h:this._config.range,b=this.createLines(e,y,A),T=this.createParticles(),f=T.particles,C=T.particleGeometry,x=T.particleMaterial,F=T.particleInfos,G=T.particlePositions,W=this.createSubMeshGeometry(e,y,w),Y=y.getLength(),Z=this.createSubMeshMaterial(S,M,Y,A);Z.uniforms.totalLength.value=Y;var J=new p.Mesh(W,Z);J.visible=E,this.five.scene.add(J);var j={id:e.id,config:e,curve:y,lines:b,particles:f,particleGeometry:C,particleMaterial:x,particleInfos:F,particlePositions:G,enabled:(c=e.enabled)!==null&&c!==void 0?c:!0,visible:(d=e.visible)!==null&&d!==void 0?d:!0,startOffset:0,endOffset:0,lastAnimationProgress:0,cycleStartTime:performance.now()/1e3,isInitialAnimation:!0,isPathlineInitialAnimation:!0,subMeshUnfoldProgress:0,subMeshUnfoldStarted:!1,subMeshUnfoldStartTime:0,lastUpdateTime:performance.now()/1e3,subMesh:J,subMeshGeometry:W,subMeshMaterial:Z,subMeshColor:S,subMeshWidth:w,subMeshOpacity:M,speed:O,animationId:null,enableSubMesh:E,isPaused:!1,pausedProgress:0,pausedTime:0};this.paths.set(e.id,j);var X=this.data,L=new Map;return this.paths.forEach(function(k,I){L.set(I,k.config)}),this.data={paths:L},this.hooks.emit("dataChange",this.data,X),this.hooks.emit("pathAdd",e.id,e),this.state.playing&&this.startPathAnimation(e.id),!0},s.prototype.removePath=function(e){var n=this.paths.get(e);if(!n)return console.warn("DynamicPathLinePlugin: 路径 ".concat(e," 不存在")),!1;this.stopPathAnimation(e),this.disposePathResources(n),this.paths.delete(e);var t=this.data,r=new Map;return this.paths.forEach(function(l,i){r.set(i,l.config)}),this.data={paths:r},this.hooks.emit("dataChange",this.data,t),this.hooks.emit("pathRemove",e),!0},s.prototype.enablePath=function(e){var n=this.paths.get(e);return n?(n.enabled=!0,this.hooks.emit("pathEnable",e),!0):(console.warn("DynamicPathLinePlugin: 路径 ".concat(e," 不存在")),!1)},s.prototype.disablePath=function(e){var n=this.paths.get(e);return n?(n.enabled=!1,this.hooks.emit("pathDisable",e),!0):(console.warn("DynamicPathLinePlugin: 路径 ".concat(e," 不存在")),!1)},s.prototype.showPath=function(e){var n=this.paths.get(e);return n?(n.visible=!0,n.lines.forEach(function(t){return t.visible=!0}),n.particles.visible=!0,n.subMesh.visible=!0,this.hooks.emit("pathShow",e),!0):(console.warn("DynamicPathLinePlugin: 路径 ".concat(e," 不存在")),!1)},s.prototype.hidePath=function(e){var n=this.paths.get(e);return n?(n.visible=!1,n.lines.forEach(function(t){return t.visible=!1}),n.particles.visible=!1,n.subMesh.visible=!1,this.hooks.emit("pathHide",e),!0):(console.warn("DynamicPathLinePlugin: 路径 ".concat(e," 不存在")),!1)},s.prototype.getPathIds=function(){return Array.from(this.paths.keys())},s.prototype.getPathConfig=function(e){var n=this.paths.get(e);return n?N({},n.config):void 0},s.prototype.clearAllPaths=function(){var e=this;this.paths.forEach(function(r,l){e.stopPathAnimation(l),e.disposePathResources(r)}),this.paths.clear();var n=this.data,t=new Map;this.paths.forEach(function(r,l){t.set(l,r.config)}),this.data={paths:t},this.hooks.emit("dataChange",this.data,n)},s.prototype.getPositions=function(e,n){for(var t=[],r=[],l=0,i=[],h=0;h<=n;h++){var c=h/n,d=e.getPoint(c);i.push(d.clone()),h>0&&(l+=d.distanceTo(i[h-1]))}for(var y=0,h=0;h<n;h++){h>0&&(y+=i[h].distanceTo(i[h-1]));var S=y/l;t.push(i[h].x,i[h].y,i[h].z),r.push(S)}return{positions:t,distanceProgress:r}},s.prototype.createLines=function(e,n,t){for(var r=this,l,i,h=[],c=e.points.length*40,d=this._config,y=d.lineCount,S=d.spacing,w=d.waveAmp,M=d.waveFreq,E=d.lineYOffset,O=(l=e.lineWidth)!==null&&l!==void 0?l:this._config.lineWidth,A=(i=e.color)!==null&&i!==void 0?i:this._config.color,b=n.getLength(),T=t/b,f=function(F){var G=(F-(y-1)/2)*S,W=e.points.map(function(L,k){var I=k/(e.points.length-1),B=n.getTangent(I).normalize(),K=new p.Vector3().crossVectors(r.up,B).normalize(),ee=G*Math.abs((k-e.points.length/2)/e.points.length-.5)*-1;return L.clone().addScaledVector(K,G+ee).add(new p.Vector3(0,E+.02*(F%2===0?1:0),0))}),Y=new p.CatmullRomCurve3(W),Z=C.getPositions(Y,c).positions,J=new Bt;J.setPositions(Z);var j=new yt({color:A,linewidth:O*(F%2===0?1:.5),transparent:!0,opacity:1,depthWrite:!1});j.resolution.set(C.five.camera.resolution.x,C.five.camera.resolution.y),F===0?j.waveDir=1:F===1?j.waveDir=2:F===2?j.waveDir=0:F===3?j.waveDir=3:F===4&&(j.waveDir=1),j.waveAmp=w,j.waveFreq=M,Object.assign(j.uniforms,{time:{value:0},startOffset:{value:0},range:{value:T}});var X=new Nt(J,j);X.computeLineDistances(),h.push(X),C.five.scene.add(X)},C=this,x=0;x<y;x++)f(x);return h},s.prototype.createParticleMaterial=function(){return new p.ShaderMaterial({transparent:!0,blending:p.AdditiveBlending,depthWrite:!1,uniforms:{pointTexture:{value:new p.TextureLoader().load("https://threejs.org/examples/textures/sprites/circle.png")}},vertexShader:`
727
+ `},he=class extends n.ShaderMaterial{constructor(e){super({uniforms:n.UniformsUtils.clone(me.uniforms),vertexShader:me.vertexShader,fragmentShader:me.fragmentShader,clipping:!0}),this.type=`LineMaterial`,this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get(){return this.uniforms.diffuse.value},set(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get(){return this.uniforms.linewidth.value},set(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get(){return this.uniforms.dashScale.value},set(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get(){return this.uniforms.dashSize.value},set(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get(){return this.uniforms.gapSize.value},set(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(e){this.uniforms.resolution.value.copy(e)}},time:{enumerable:!0,get(){return this.uniforms.time.value},set(e){this.uniforms.time.value=e}},waveAmp:{enumerable:!0,get(){return this.uniforms.waveAmp.value},set(e){this.uniforms.waveAmp.value=e}},waveFreq:{enumerable:!0,get(){return this.uniforms.waveFreq.value},set(e){this.uniforms.waveFreq.value=e}},waveDir:{enumerable:!0,get(){return this.uniforms.waveDir.value},set(e){this.uniforms.waveDir.value=e}},startOffset:{enumerable:!0,get(){return this.uniforms.startOffset.value},set(e){this.uniforms.startOffset.value=e}},endOffset:{enumerable:!0,get(){return this.uniforms.endOffset.value},set(e){this.uniforms.endOffset.value=e}},range:{enumerable:!0,get(){return this.uniforms.range.value},set(e){this.uniforms.range.value=e}},animationProgress:{enumerable:!0,get(){return this.uniforms.animationProgress.value},set(e){this.uniforms.animationProgress.value=e}}}),this.setValues(e)}};Object.assign(he.prototype,{isLineMaterial:!0});var ge=class extends n.Mesh{constructor(e,t){super(),this.type=`LineSegments2`,this.geometry=e===void 0?new pe:e,this.material=t===void 0?new he({color:Math.random()*16777215}):t}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*t.count),a=new n.Vector3,o=new n.Vector3,s=0;for(let e=0,n=t.count;e<n;e++)a.fromBufferAttribute(t,e),o.fromBufferAttribute(r,e),s+=a.distanceTo(o);this.material.uniforms.totalLength.value=s;for(let e=0,n=0,s=t.count;e<s;e++,n+=2){a.fromBufferAttribute(t,e),o.fromBufferAttribute(r,e);let s=a.distanceTo(o);i[n]=n===0?0:i[n-1],i[n+1]=i[n]+s}let c=new n.InstancedInterleavedBuffer(i,2,1);return e.setAttribute(`instanceDistanceStart`,new n.InterleavedBufferAttribute(c,1,0)),e.setAttribute(`instanceDistanceEnd`,new n.InterleavedBufferAttribute(c,1,1)),this}raycast(e,t){e.camera===null&&console.error(`LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.`);let r=e.ray,i=e.camera,a=i.projectionMatrix,o=this.geometry,s=this.material,c=s.resolution,l=s.linewidth,u=o.attributes.instanceStart,d=o.attributes.instanceEnd,f=new n.Vector4,p=new n.Vector4,m=new n.Vector4,h=new n.Vector3,g=new n.Matrix4,_=new n.Line3,v=new n.Vector3;r.at(1,m),m.w=1,m.applyMatrix4(i.matrixWorldInverse),m.applyMatrix4(a),m.multiplyScalar(1/m.w),m.x*=c.x/2,m.y*=c.y/2,m.z=0,h.copy(m);let y=this.matrixWorld;g.multiplyMatrices(i.matrixWorldInverse,y);for(var b=0,x=u.count;b<x;b++){f.fromBufferAttribute(u,b),p.fromBufferAttribute(d,b),f.w=1,p.w=1,f.applyMatrix4(g),p.applyMatrix4(g),f.applyMatrix4(a),p.applyMatrix4(a),f.multiplyScalar(1/f.w),p.multiplyScalar(1/p.w);var S=f.z<-1&&p.z<-1,C=f.z>1&&p.z>1;if(S||C)continue;f.x*=c.x/2,f.y*=c.y/2,p.x*=c.x/2,p.y*=c.y/2,_.start.copy(f),_.start.z=0,_.end.copy(p),_.end.z=0;let e=_.closestPointToPointParameter(h,!0);_.at(e,v);let i=n.MathUtils.lerp(f.z,p.z,e),o=i>=-1&&i<=1;var w=h.distanceTo(v)<l*.5;if(o&&w){_.start.fromBufferAttribute(u,b),_.end.fromBufferAttribute(d,b),_.start.applyMatrix4(y),_.end.applyMatrix4(y);var T=new n.Vector3,E=new n.Vector3;r.distanceSqToSegment(_.start,_.end,E,T),t.push({point:E,pointOnLine:T,distance:r.origin.distanceTo(E),object:this,faceIndex:b})}}}};Object.assign(ge.prototype,{isLineSegments2:!0});var _e=class extends ge{constructor(e,t){super(e,t),this.type=`Line2`}};Object.assign(_e.prototype,{isLine2:!0});var ve=class extends pe{constructor(){super(),this.type=`LineGeometry`}setPositions(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setPositions(n),this}setColors(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setColors(n),this}fromLine(e){let t=e.geometry;if(t instanceof n.Geometry){let e=new n.BufferGeometry().fromGeometry(t);this.setPositions(e.attributes.position.array)}else t instanceof n.BufferGeometry&&this.setPositions(t.attributes.position.array);return this}copy(){return this}};Object.assign(ve.prototype,{isLineGeometry:!0});var ye=class extends r.BasePlugin.Controller{get config(){return Object.assign({},this._config)}updateState(e,t){let n=this.state;this.state=Object.assign(Object.assign({},this.state),e),this.hooks.emit(`stateChange`,{state:this.state,prevState:n,userAction:t})}constructor(e,t){super(e),this.paths=new Map,this.up=new n.Vector3(0,1,0),this.state=Object.assign({enabled:!0,visible:!0,playing:!1},t==null?void 0:t.initialState),this._config=Object.assign(Object.assign({},{lineCount:6,spacing:.02,lineWidth:2,color:16777215,speed:2,range:.3,waveAmp:.05,waveFreq:20,particleCount:50,maxDistance:.1,lineYOffset:.1,subMeshWidth:.3,subMeshColor:65535,subMeshOpacity:.3,subMeshMaxOpacity:.5,subMeshSegmentInterval:3,subMeshHighlightWidth:1}),t==null?void 0:t.config),t!=null&&t.paths&&t.paths.length>0&&t.paths.forEach(e=>{this.addPath(e)}),this.state.enabled&&this._enable({userAction:!1})}load(e,t){return m(this,void 0,void 0,function*(){this.clearAllPaths(),e.paths.forEach(e=>{var t,r;let i=e.points.map(e=>new n.Vector3(e.x,e.y,e.z));this.addPath({id:e.id,points:i,enabled:(t=e.enabled)==null?!0:t,visible:(r=e.visible)==null?!0:r,color:e.color,lineWidth:e.lineWidth,speed:e.speed})});let r=new Map;this.paths.forEach((e,t)=>{r.set(t,e.config)}),this.data={paths:r},this.hooks.emit(`dataLoaded`,this.data),t&&this.setState(t)})}addPath(e){var t,r,i,a,o,s,c,l;if(e.points.length<2)return console.warn(`DynamicPathLinePlugin: 路径 ${e.id} 至少需要2个点`),!1;if(this.paths.has(e.id))return console.warn(`DynamicPathLinePlugin: 路径 ${e.id} 已存在`),!1;let u=new n.CatmullRomCurve3(e.points),d=(t=e.subMeshColor)==null?this._config.subMeshColor:t,f=(r=e.subMeshWidth)==null?this._config.subMeshWidth:r,p=(i=e.subMeshOpacity)==null?this._config.subMeshOpacity:i,m=(a=e.enableSubMesh)==null?!0:a,h=(o=e.speed)==null?this._config.speed:o,g=(s=e.range)==null?this._config.range:s,_=this.createLines(e,u,g),{particles:v,particleGeometry:y,particleMaterial:b,particleInfos:x,particlePositions:S}=this.createParticles(),C=this.createSubMeshGeometry(e,u,f),w=u.getLength(),T=this.createSubMeshMaterial(d,p,w,g);T.uniforms.totalLength.value=w;let E=new n.Mesh(C,T);E.visible=m,this.five.scene.add(E);let D={id:e.id,config:e,curve:u,lines:_,particles:v,particleGeometry:y,particleMaterial:b,particleInfos:x,particlePositions:S,enabled:(c=e.enabled)==null?!0:c,visible:(l=e.visible)==null?!0:l,startOffset:0,endOffset:0,lastAnimationProgress:0,cycleStartTime:performance.now()/1e3,isInitialAnimation:!0,isPathlineInitialAnimation:!0,subMeshUnfoldProgress:0,subMeshUnfoldStarted:!1,subMeshUnfoldStartTime:0,lastUpdateTime:performance.now()/1e3,subMesh:E,subMeshGeometry:C,subMeshMaterial:T,subMeshColor:d,subMeshWidth:f,subMeshOpacity:p,speed:h,animationId:null,enableSubMesh:m,isPaused:!1,pausedProgress:0,pausedTime:0};this.paths.set(e.id,D);let ee=this.data,O=new Map;return this.paths.forEach((e,t)=>{O.set(t,e.config)}),this.data={paths:O},this.hooks.emit(`dataChange`,this.data,ee),this.hooks.emit(`pathAdd`,e.id,e),this.state.playing&&this.startPathAnimation(e.id),!0}removePath(e){let t=this.paths.get(e);if(!t)return console.warn(`DynamicPathLinePlugin: 路径 ${e} 不存在`),!1;this.stopPathAnimation(e),this.disposePathResources(t),this.paths.delete(e);let n=this.data,r=new Map;return this.paths.forEach((e,t)=>{r.set(t,e.config)}),this.data={paths:r},this.hooks.emit(`dataChange`,this.data,n),this.hooks.emit(`pathRemove`,e),!0}enablePath(e){let t=this.paths.get(e);return t?(t.enabled=!0,this.hooks.emit(`pathEnable`,e),!0):(console.warn(`DynamicPathLinePlugin: 路径 ${e} 不存在`),!1)}disablePath(e){let t=this.paths.get(e);return t?(t.enabled=!1,this.hooks.emit(`pathDisable`,e),!0):(console.warn(`DynamicPathLinePlugin: 路径 ${e} 不存在`),!1)}showPath(e){let t=this.paths.get(e);return t?(t.visible=!0,t.lines.forEach(e=>e.visible=!0),t.particles.visible=!0,t.subMesh.visible=!0,this.hooks.emit(`pathShow`,e),!0):(console.warn(`DynamicPathLinePlugin: 路径 ${e} 不存在`),!1)}hidePath(e){let t=this.paths.get(e);return t?(t.visible=!1,t.lines.forEach(e=>e.visible=!1),t.particles.visible=!1,t.subMesh.visible=!1,this.hooks.emit(`pathHide`,e),!0):(console.warn(`DynamicPathLinePlugin: 路径 ${e} 不存在`),!1)}getPathIds(){return Array.from(this.paths.keys())}getPathConfig(e){let t=this.paths.get(e);return t?Object.assign({},t.config):void 0}clearAllPaths(){this.paths.forEach((e,t)=>{this.stopPathAnimation(t),this.disposePathResources(e)}),this.paths.clear();let e=this.data,t=new Map;this.paths.forEach((e,n)=>{t.set(n,e.config)}),this.data={paths:t},this.hooks.emit(`dataChange`,this.data,e)}getPositions(e,t){let n=[],r=[],i=0,a=[];for(let n=0;n<=t;n++){let r=n/t,o=e.getPoint(r);a.push(o.clone()),n>0&&(i+=o.distanceTo(a[n-1]))}let o=0;for(let e=0;e<t;e++){e>0&&(o+=a[e].distanceTo(a[e-1]));let t=o/i;n.push(a[e].x,a[e].y,a[e].z),r.push(t)}return{positions:n,distanceProgress:r}}createLines(e,t,r){var i,a;let o=[],s=e.points.length*40,{lineCount:c,spacing:l,waveAmp:u,waveFreq:d,lineYOffset:f}=this._config,p=(i=e.lineWidth)==null?this._config.lineWidth:i,m=(a=e.color)==null?this._config.color:a,h=r/t.getLength();for(let r=0;r<c;r++){let i=(r-(c-1)/2)*l,a=e.points.map((a,o)=>{let s=o/(e.points.length-1),c=t.getTangent(s).normalize(),l=new n.Vector3().crossVectors(this.up,c).normalize(),u=i*Math.abs((o-e.points.length/2)/e.points.length-.5)*-1;return a.clone().addScaledVector(l,i+u).add(new n.Vector3(0,f+.02*(r%2==0?1:0),0))}),g=new n.CatmullRomCurve3(a),{positions:_}=this.getPositions(g,s),v=new ve;v.setPositions(_);let y=new he({color:m,linewidth:p*(r%2==0?1:.5),transparent:!0,opacity:1,depthWrite:!1});y.resolution.set(this.five.camera.resolution.x,this.five.camera.resolution.y),r===0?y.waveDir=1:r===1?y.waveDir=2:r===2?y.waveDir=0:r===3?y.waveDir=3:r===4&&(y.waveDir=1),y.waveAmp=u,y.waveFreq=d,Object.assign(y.uniforms,{time:{value:0},startOffset:{value:0},range:{value:h}});let b=new _e(v,y);b.computeLineDistances(),o.push(b),this.five.scene.add(b)}return o}createParticleMaterial(){return new n.ShaderMaterial({transparent:!0,blending:n.AdditiveBlending,depthWrite:!1,uniforms:{pointTexture:{value:new n.TextureLoader().load(`https://threejs.org/examples/textures/sprites/circle.png`)}},vertexShader:`
732
728
  attribute float size;
733
729
  varying vec2 vUv;
734
730
  void main() {
@@ -743,7 +739,7 @@ void main() {
743
739
  gl_FragColor = texture2D(pointTexture, gl_PointCoord);
744
740
  gl_FragColor.a *= 0.15;
745
741
  }
746
- `})},s.prototype.createParticles=function(){for(var e=this._config.particleCount,n=new Float32Array(e*3),t=new p.BufferGeometry,r=this.createParticleMaterial(),l=new p.Points(t,r),i=new Float32Array(e),h=[],c=0;c<e;c++)n[c*3]=9999,n[c*3+1]=9999,n[c*3+2]=9999,i[c]=p.MathUtils.randFloat(3,9),h.push({velocity:new p.Vector3,life:3+Math.random()*2,age:0,active:!1,alpha:0,startPos:new p.Vector3});return t.setAttribute("position",new p.BufferAttribute(n,3)),t.setAttribute("size",new p.BufferAttribute(i,1)),l.frustumCulled=!1,this.five.scene.add(l),{particles:l,particleGeometry:t,particleMaterial:r,particleInfos:h,particlePositions:n}},s.prototype.createSubMeshGeometry=function(e,n,t){for(var r=e.points.length*40,l=new p.BufferGeometry,i=n.getPoints(r),h=[],c=[],d=[],y=[],S=0,w=[0],M=1;M<i.length;M++)S+=i[M].distanceTo(i[M-1]),w.push(S);for(var E=S,M=0;M<i.length;M++){var O=i[M],A=M/(i.length-1),b=n.getTangent(A).normalize(),T=new p.Vector3().crossVectors(this.up,b).normalize(),f=t/2,C=O.clone().addScaledVector(T,-f);h.push(C.x,C.y,C.z),c.push(0,w[M]/E),y.push(w[M]/E);var x=O.clone().addScaledVector(T,f);h.push(x.x,x.y,x.z),c.push(1,w[M]/E),y.push(w[M]/E)}for(var M=0;M<i.length-1;M++){var F=M*2;d.push(F,F+1,F+2),d.push(F+1,F+3,F+2)}return l.setAttribute("position",new p.Float32BufferAttribute(h,3)),l.setAttribute("uv",new p.Float32BufferAttribute(c,2)),l.setAttribute("distanceProgress",new p.Float32BufferAttribute(y,1)),l.setIndex(d),l.computeVertexNormals(),l},s.prototype.createAlphaMapTexture=function(e,n,t,r,l){for(var i=1024,h=1,c=i*h,d=new Uint8Array(c),y=1/e,S=t/e,w=n/S,M=w/2,E=0;E<i;E++){var O=E/i,A=Math.floor(O/y),b=(O-A*y)/y,T=0,f=b;if(f>.5&&(f=1-f),f<M){var C=1-f/M,x=C;T=r+(l-r)*x}else T=r;d[E]=Math.floor(T*255)}var F=new p.DataTexture(d,i,h,p.RedFormat);return F.needsUpdate=!0,F.wrapS=p.RepeatWrapping,F.wrapT=p.ClampToEdgeWrapping,F.minFilter=p.LinearFilter,F.magFilter=p.LinearFilter,F},s.prototype.createSubMeshMaterial=function(e,n,t,r){var l=this._config,i=l.subMeshSegmentInterval,h=l.subMeshHighlightWidth,c=l.subMeshMaxOpacity,d=Math.max(1,Math.round(t/i)),y=r/t,S=this.createAlphaMapTexture(d,h,t,n,c);return new p.ShaderMaterial({transparent:!0,side:p.BackSide,depthWrite:!1,uniforms:{baseColor:{value:new p.Color(e)},baseOpacity:{value:n},globalOpacity:{value:1},animationProgress:{value:0},range:{value:y},startOffset:{value:0},endOffset:{value:0},totalLength:{value:1},unfoldProgress:{value:0},alphaMap:{value:S}},vertexShader:`
742
+ `})}createParticles(){let{particleCount:e}=this._config,t=new Float32Array(e*3),r=new n.BufferGeometry,i=this.createParticleMaterial(),a=new n.Points(r,i),o=new Float32Array(e),s=[];for(let r=0;r<e;r++)t[r*3]=9999,t[r*3+1]=9999,t[r*3+2]=9999,o[r]=n.MathUtils.randFloat(3,9),s.push({velocity:new n.Vector3,life:3+Math.random()*2,age:0,active:!1,alpha:0,startPos:new n.Vector3});return r.setAttribute(`position`,new n.BufferAttribute(t,3)),r.setAttribute(`size`,new n.BufferAttribute(o,1)),a.frustumCulled=!1,this.five.scene.add(a),{particles:a,particleGeometry:r,particleMaterial:i,particleInfos:s,particlePositions:t}}createSubMeshGeometry(e,t,r){let i=e.points.length*40,a=new n.BufferGeometry,o=t.getPoints(i),s=[],c=[],l=[],u=[],d=0,f=[0];for(let e=1;e<o.length;e++)d+=o[e].distanceTo(o[e-1]),f.push(d);let p=d;for(let e=0;e<o.length;e++){let i=o[e],a=e/(o.length-1),l=t.getTangent(a).normalize(),d=new n.Vector3().crossVectors(this.up,l).normalize(),m=r/2,h=i.clone().addScaledVector(d,-m);s.push(h.x,h.y,h.z),c.push(0,f[e]/p),u.push(f[e]/p);let g=i.clone().addScaledVector(d,m);s.push(g.x,g.y,g.z),c.push(1,f[e]/p),u.push(f[e]/p)}for(let e=0;e<o.length-1;e++){let t=e*2;l.push(t,t+1,t+2),l.push(t+1,t+3,t+2)}return a.setAttribute(`position`,new n.Float32BufferAttribute(s,3)),a.setAttribute(`uv`,new n.Float32BufferAttribute(c,2)),a.setAttribute(`distanceProgress`,new n.Float32BufferAttribute(u,1)),a.setIndex(l),a.computeVertexNormals(),a}createAlphaMapTexture(e,t,r,i,a){let o=1024;o*1;let s=new Uint8Array(1024),c=1/e,l=t/(r/e)/2;for(let e=0;e<o;e++){let t=e/o,n=(t-Math.floor(t/c)*c)/c,r=0,u=n;if(u>.5&&(u=1-u),u<l){let e=1-u/l;r=i+(a-i)*e}else r=i;s[e]=Math.floor(r*255)}let u=new n.DataTexture(s,o,1,n.RedFormat);return u.needsUpdate=!0,u.wrapS=n.RepeatWrapping,u.wrapT=n.ClampToEdgeWrapping,u.minFilter=n.LinearFilter,u.magFilter=n.LinearFilter,u}createSubMeshMaterial(e,t,r,i){let{subMeshSegmentInterval:a,subMeshHighlightWidth:o,subMeshMaxOpacity:s}=this._config,c=Math.max(1,Math.round(r/a)),l=i/r,u=this.createAlphaMapTexture(c,o,r,t,s);return new n.ShaderMaterial({transparent:!0,side:n.BackSide,depthWrite:!1,uniforms:{baseColor:{value:new n.Color(e)},baseOpacity:{value:t},globalOpacity:{value:1},animationProgress:{value:0},range:{value:l},startOffset:{value:0},endOffset:{value:0},totalLength:{value:1},unfoldProgress:{value:0},alphaMap:{value:u}},vertexShader:`
747
743
  attribute float distanceProgress;
748
744
  varying vec2 vUv;
749
745
  varying float vDistanceProgress;
@@ -812,4 +808,4 @@ void main() {
812
808
 
813
809
  gl_FragColor = vec4(baseColor, sampledAlpha * globalOpacity);
814
810
  }
815
- `})},s.prototype.projectPointsToScreen=function(e,n){for(var t=[],r=0,l=0;l<e.length;l++){var i=e[l];l>0&&(r+=i.distanceTo(e[l-1]));var h=i.clone().project(n),c=h.x<-1||h.x>1||h.y<-1||h.y>1||h.z<-1||h.z>1;t.push({point:i.clone(),screenPos:new p.Vector2(h.x,h.y),distanceFromStart:r,isOffscreen:c})}return t},s.prototype.findNearestOffscreenPoint=function(e){for(var n=-1,t=0,r=-1,l=0;l<e.length;l++)if(!e[l].isOffscreen){r=l;break}if(r===-1)return null;for(var l=r-1;l>=0;l--)if(e[l].isOffscreen){n=l,t=e[l].distanceFromStart;break}return n===-1?{index:0,distance:0}:{index:n,distance:t}},s.prototype.findFarestOffscreenPoint=function(e){for(var n,t=((n=e[e.length-1])===null||n===void 0?void 0:n.distanceFromStart)||0,r=-1,l=e.length-1;l>=0;l--)if(!e[l].isOffscreen){r=l;break}if(r===-1)return null;var i=r+1;return i<e.length&&e[i].isOffscreen?{index:i,distance:e[i].distanceFromStart,totalLength:t}:{index:e.length-1,distance:t,totalLength:t}},s.prototype.updatePathAnimation=function(e){var n,t,r=this.paths.get(e);if(!(!r||!r.enabled)){var l=performance.now()/1e3,i=this._config,h=i.particleCount,c=i.maxDistance,d=((n=r.lines[0])===null||n===void 0?void 0:n.material.uniforms.totalLength.value)||1,y=Math.max(.01,d-r.startOffset-r.endOffset),S=r.speed,w=(l-r.cycleStartTime)*S/y%1;if(r.isInitialAnimation){var M=w*y;if(r.enableSubMesh&&M>=1&&!r.subMeshUnfoldStarted&&(r.subMeshUnfoldStarted=!0,r.subMeshUnfoldStartTime=l),r.enableSubMesh&&r.subMeshUnfoldStarted&&r.subMeshUnfoldProgress<1&&!r.isPaused){var E=(t=r.config.range)!==null&&t!==void 0?t:this._config.range,O=l-r.subMeshUnfoldStartTime;r.subMeshUnfoldProgress=Math.min(1,O*S/(y-2*E)),r.subMeshMaterial.uniforms.unfoldProgress.value=r.subMeshUnfoldProgress}w<r.lastAnimationProgress&&(r.isPathlineInitialAnimation=!1,(!r.enableSubMesh||r.subMeshUnfoldProgress>=1)&&(r.isInitialAnimation=!1))}else r.enableSubMesh&&(r.subMeshMaterial.uniforms.unfoldProgress.value=1);if(r.lastAnimationProgress=w,r.lastUpdateTime=l,r.isPathlineInitialAnimation&&r.lines.forEach(function(Y){Y.material.uniforms.time.value=l,Y.material.uniforms.animationProgress.value=w}),r.isPathlineInitialAnimation){var A=null,b=1/0;if(r.lines.forEach(function(Y){for(var Z=Y.geometry,J=Z.attributes.instanceDistanceStart,j=Z.attributes.instanceDistanceEnd,X=J.count,L=0;L<X;L++){var k=J.getX(L)/Y.material.uniforms.totalLength.value,I=j.getX(L)/Y.material.uniforms.totalLength.value;if(w>=k&&w<=I){var B=(w-k)/(I-k),K=new p.Vector3().fromBufferAttribute(Z.attributes.instanceStart,L),ee=new p.Vector3().fromBufferAttribute(Z.attributes.instanceEnd,L),Q=new p.Vector3().lerpVectors(K,ee,B),U=Math.abs(w-(k+I)/2);U<b&&(b=U,A=Q)}}}),A)for(var T=0;T<h;T++){var f=r.particleInfos[T];!f.active&&Math.random()<.05&&(f.active=!0,f.age=0,f.life=3+Math.random()*2,f.velocity.set((Math.random()-.5)*1e-4,(Math.random()-.5)*1e-4,(Math.random()-.5)*1e-4),r.particlePositions[T*3]=A.x,r.particlePositions[T*3+1]=A.y,r.particlePositions[T*3+2]=A.z,f.startPos.copy(A),f.alpha=0)}for(var T=0;T<h;T++){var f=r.particleInfos[T];if(f.active){f.age+=.016;var C=r.particlePositions[T*3]-f.startPos.x,x=r.particlePositions[T*3+1]-f.startPos.y,F=r.particlePositions[T*3+2]-f.startPos.z,G=Math.sqrt(C*C+x*x+F*F);(G>=c||f.age>=f.life)&&(f.active=!1,r.particlePositions[T*3]=9999,r.particlePositions[T*3+1]=9999,r.particlePositions[T*3+2]=9999,f.alpha=0),f.velocity.x+=(Math.random()-.5)*1e-4,f.velocity.z+=(Math.random()-.5)*1e-4,f.velocity.y+=1e-4,f.velocity.multiplyScalar(.99),r.particlePositions[T*3]+=f.velocity.x,r.particlePositions[T*3+1]+=f.velocity.y,r.particlePositions[T*3+2]+=f.velocity.z;var W=f.age/f.life;W<.2?f.alpha=W/.2:W>.8?f.alpha=(1-W)/.2:f.alpha=1}}r.particleGeometry.attributes.position.needsUpdate=!0,r.particleMaterial.opacity=.6}r.enableSubMesh&&(r.subMeshMaterial.uniforms.animationProgress.value=w),this.five.needsRender=!0}},s.prototype.startPathAnimation=function(e,n){var t=this,r,l,i=this.paths.get(e);if(!i)return console.warn("DynamicPathLinePlugin: 路径 ".concat(e," 不存在")),!1;if(i.animationId!==null)return!1;var h=(r=n==null?void 0:n.startPointIndex)!==null&&r!==void 0?r:0,c=(l=n==null?void 0:n.fromStart)!==null&&l!==void 0?l:!1;if(!i.isPaused||c){var d=0,y=h;if(y>0){var S=i.config.points;y>=S.length&&(console.warn("DynamicPathLinePlugin: startPointIndex ".concat(y," 超出范围,路径只有 ").concat(S.length," 个点")),y=S.length-1);for(var w=0;w<y;w++)d+=S[w].distanceTo(S[w+1])}i.startOffset=d,i.lines.forEach(function(T){T.material.uniforms.startOffset.value=d}),i.enableSubMesh&&(i.subMeshMaterial.uniforms.startOffset.value=d)}var M=performance.now()/1e3;if(!c&&i.isPaused&&i.pausedProgress>0){var E=i.curve.getLength(),O=Math.max(.01,E-i.startOffset-i.endOffset),A=i.speed;if(i.cycleStartTime=M-i.pausedProgress*O/A,i.subMeshUnfoldStarted&&i.subMeshUnfoldProgress<1){var b=i.pausedTime-i.subMeshUnfoldStartTime;i.subMeshUnfoldStartTime=M-b}i.isPaused=!1}else i.cycleStartTime=M,i.isPaused=!1,i.pausedProgress=0;return i.lastUpdateTime=M,this.highlightPath(e,!0),i.animationId=fe.AnimationFrameLoop.shared.add(function(){t.updatePathAnimation(e)}),!0},s.prototype.stopPathAnimation=function(e,n){n===void 0&&(n=!1);var t=this.paths.get(e);if(!t)return console.warn("DynamicPathLinePlugin: 路径 ".concat(e," 不存在")),!1;if(this.highlightPath(e,!1),t.animationId!==null){if(n){var r=performance.now()/1e3,l=t.curve.getLength(),i=Math.max(.01,l-t.startOffset-t.endOffset),h=t.speed;if(t.pausedProgress=(r-t.cycleStartTime)*h/i%1,t.pausedTime=r,t.isPaused=!0,t.subMeshUnfoldStarted&&t.subMeshUnfoldProgress<1){var c=r-t.subMeshUnfoldStartTime;t.subMeshUnfoldStartTime=r-c}}else t.isPaused=!1,t.pausedProgress=0,t.pausedTime=0;t.animationId(),t.animationId=null}return!0},s.prototype._enable=function(e){this.paths.size>0&&this.state.playing&&this.play()},s.prototype._disable=function(e){this.pause()},s.prototype.enable=function(e){var n;if(!this.state.enabled){var t=(n=e==null?void 0:e.userAction)!==null&&n!==void 0?n:!0;this.updateState({enabled:!0},t),this._enable({userAction:t})}},s.prototype.disable=function(e){var n;if(this.state.enabled!==!1){var t=(n=e==null?void 0:e.userAction)!==null&&n!==void 0?n:!0;this.updateState({enabled:!1},t),this._disable({userAction:t})}},s.prototype.show=function(e){var n,t=(n=e==null?void 0:e.userAction)!==null&&n!==void 0?n:!0;this.paths.forEach(function(r){r.lines.forEach(function(l){return l.visible=!0}),r.particles.visible=!0,r.subMesh.visible=!0}),this.updateState({visible:!0},t)},s.prototype.hide=function(e){var n,t=(n=e==null?void 0:e.userAction)!==null&&n!==void 0?n:!0;this.paths.forEach(function(r){r.lines.forEach(function(l){return l.visible=!1}),r.particles.visible=!1,r.subMesh.visible=!1}),this.updateState({visible:!1},t)},s.prototype.setState=function(e,n){var t;t=n==null?void 0:n.userAction,e.enabled!==void 0&&e.enabled!==this.state.enabled&&(e.enabled?this.enable(n):this.disable(n)),e.visible!==void 0&&e.visible!==this.state.visible&&(e.visible?this.show(n):this.hide(n))},s.prototype.play=function(e){var n=this;e===void 0&&(e=!1),this.paths.forEach(function(t,r){n.startPathAnimation(r,{fromStart:e})}),this.updateState({playing:!0},!1),this.hooks.emit("animationStart")},s.prototype.pause=function(){var e=this;this.paths.forEach(function(n,t){e.stopPathAnimation(t,!0)}),this.updateState({playing:!1},!1),this.hooks.emit("animationStop")},s.prototype.reset=function(){var e=this;this.paths.forEach(function(n,t){e.stopPathAnimation(t)}),this.paths.forEach(function(n){n.isInitialAnimation=!0,n.isPathlineInitialAnimation=!0,n.subMeshUnfoldProgress=0,n.subMeshUnfoldStarted=!1,n.subMeshUnfoldStartTime=0,n.lastAnimationProgress=0,n.cycleStartTime=performance.now()/1e3,n.lastUpdateTime=performance.now()/1e3,n.startOffset=0,n.endOffset=0,n.isPaused=!1,n.pausedProgress=0,n.pausedTime=0,n.lines.forEach(function(i){i.visible=!0,i.material.uniforms.time.value=0,i.material.uniforms.animationProgress.value=0,i.material.uniforms.startOffset.value=0,i.material.uniforms.endOffset.value=0}),n.particles.visible=!0;for(var t=e._config.particleCount,r=0;r<t;r++){var l=n.particleInfos[r];l.active=!1,l.age=0,l.alpha=0,n.particlePositions[r*3]=9999,n.particlePositions[r*3+1]=9999,n.particlePositions[r*3+2]=9999}n.particleGeometry.attributes.position.needsUpdate=!0,n.subMeshMaterial&&(n.subMeshMaterial.uniforms.unfoldProgress.value=0,n.subMeshMaterial.uniforms.animationProgress.value=0,n.subMeshMaterial.uniforms.startOffset.value=0,n.subMeshMaterial.uniforms.endOffset.value=0)})},s.prototype.highlightPath=function(e,n){var t=this,r=this.paths.get(e);if(r)var l=r.lines,i=0,h=250,c=fe.AnimationFrameLoop.shared.add(function(d,y){i=Math.min(1,i+y/h),n?(l.forEach(function(S){S.material.uniforms.opacity.value=.3+i*.7}),r.particleMaterial.opacity=.3+i*.7,r.enableSubMesh&&(r.subMeshMaterial.uniforms.globalOpacity.value=.3+i*.7)):(l.forEach(function(S){S.material.uniforms.opacity.value=1-i*.7}),r.particleMaterial.opacity=.6*(1-i*.7),r.enableSubMesh&&(r.subMeshMaterial.uniforms.globalOpacity.value=1-i*.7)),t.five.needsRender=!0,i===1&&c()})},s.prototype.updateScreenProjection=function(e){var n=this,t=function(l){var i=n.projectPointsToScreen(l.config.points,n.five.camera),h=n.findNearestOffscreenPoint(i);h&&(l.startOffset=h.distance);var c=n.findFarestOffscreenPoint(i);c&&(l.endOffset=c.totalLength-c.distance),l.lines.forEach(function(d){d.material.uniforms.startOffset.value=l.startOffset,d.material.uniforms.endOffset.value=l.endOffset}),l.subMeshMaterial.uniforms.startOffset.value=l.startOffset,l.subMeshMaterial.uniforms.endOffset.value=l.endOffset,l.cycleStartTime=performance.now()/1e3,l.lastAnimationProgress=0};if(e){var r=this.paths.get(e);r&&t(r)}else this.paths.forEach(function(l){l.enabled&&t(l)})},s.prototype.disposePathResources=function(e){var n=this;e.lines.forEach(function(t){n.five.scene.remove(t),t.geometry.dispose(),t.material.dispose()}),this.five.scene.remove(e.particles),e.particleGeometry.dispose(),e.particleMaterial.dispose(),this.five.scene.remove(e.subMesh),e.subMeshGeometry.dispose(),e.subMeshMaterial.dispose()},s.prototype.dispose=function(){this.pause(),this.clearAllPaths(),this.hooks.emit("dispose")},s})(lt.BasePlugin.Controller),xn=function(v,s){return new En(v,s)};re.BackgroundPlugin=yn,re.CSS3DRenderer=kt,re.DynamicPathLinePlugin=xn,re.ItemMaskPlugin=vn,re.OrbitControls=De,re.OrientationPlugin=mn,re.PanoAnimePlugin=Sn,re.RoundedBoxGeometry=Lt,re.TrajectoryPlugin=wn,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})}));
811
+ `})}projectPointsToScreen(e,t){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a];a>0&&(i+=o.distanceTo(e[a-1]));let s=o.clone().project(t),c=s.x<-1||s.x>1||s.y<-1||s.y>1||s.z<-1||s.z>1;r.push({point:o.clone(),screenPos:new n.Vector2(s.x,s.y),distanceFromStart:i,isOffscreen:c})}return r}findNearestOffscreenPoint(e){let t=-1,n=0,r=-1;for(let t=0;t<e.length;t++)if(!e[t].isOffscreen){r=t;break}if(r===-1)return null;for(let i=r-1;i>=0;i--)if(e[i].isOffscreen){t=i,n=e[i].distanceFromStart;break}return t===-1?{index:0,distance:0}:{index:t,distance:n}}findFarestOffscreenPoint(e){var t;let n=((t=e[e.length-1])==null?void 0:t.distanceFromStart)||0,r=-1;for(let t=e.length-1;t>=0;t--)if(!e[t].isOffscreen){r=t;break}if(r===-1)return null;let i=r+1;return i<e.length&&e[i].isOffscreen?{index:i,distance:e[i].distanceFromStart,totalLength:n}:{index:e.length-1,distance:n,totalLength:n}}updatePathAnimation(e){var t,r;let i=this.paths.get(e);if(!i||!i.enabled)return;let a=performance.now()/1e3,{particleCount:o,maxDistance:s}=this._config,c=((t=i.lines[0])==null?void 0:t.material.uniforms.totalLength.value)||1,l=Math.max(.01,c-i.startOffset-i.endOffset),u=i.speed,d=(a-i.cycleStartTime)*u/l%1;if(i.isInitialAnimation){let e=d*l;if(i.enableSubMesh&&e>=1&&!i.subMeshUnfoldStarted&&(i.subMeshUnfoldStarted=!0,i.subMeshUnfoldStartTime=a),i.enableSubMesh&&i.subMeshUnfoldStarted&&i.subMeshUnfoldProgress<1&&!i.isPaused){let e=(r=i.config.range)==null?this._config.range:r,t=a-i.subMeshUnfoldStartTime;i.subMeshUnfoldProgress=Math.min(1,t*u/(l-2*e)),i.subMeshMaterial.uniforms.unfoldProgress.value=i.subMeshUnfoldProgress}d<i.lastAnimationProgress&&(i.isPathlineInitialAnimation=!1,(!i.enableSubMesh||i.subMeshUnfoldProgress>=1)&&(i.isInitialAnimation=!1))}else i.enableSubMesh&&(i.subMeshMaterial.uniforms.unfoldProgress.value=1);if(i.lastAnimationProgress=d,i.lastUpdateTime=a,i.isPathlineInitialAnimation&&i.lines.forEach(e=>{e.material.uniforms.time.value=a,e.material.uniforms.animationProgress.value=d}),i.isPathlineInitialAnimation){let e=null,t=1/0;if(i.lines.forEach(r=>{let i=r.geometry,a=i.attributes.instanceDistanceStart,o=i.attributes.instanceDistanceEnd,s=a.count;for(let c=0;c<s;c++){let s=a.getX(c)/r.material.uniforms.totalLength.value,l=o.getX(c)/r.material.uniforms.totalLength.value;if(d>=s&&d<=l){let r=(d-s)/(l-s),a=new n.Vector3().fromBufferAttribute(i.attributes.instanceStart,c),o=new n.Vector3().fromBufferAttribute(i.attributes.instanceEnd,c),u=new n.Vector3().lerpVectors(a,o,r),f=Math.abs(d-(s+l)/2);f<t&&(t=f,e=u)}}}),e)for(let t=0;t<o;t++){let n=i.particleInfos[t];!n.active&&Math.random()<.05&&(n.active=!0,n.age=0,n.life=3+Math.random()*2,n.velocity.set((Math.random()-.5)*1e-4,(Math.random()-.5)*1e-4,(Math.random()-.5)*1e-4),i.particlePositions[t*3]=e.x,i.particlePositions[t*3+1]=e.y,i.particlePositions[t*3+2]=e.z,n.startPos.copy(e),n.alpha=0)}for(let e=0;e<o;e++){let t=i.particleInfos[e];if(t.active){t.age+=.016;let n=i.particlePositions[e*3]-t.startPos.x,r=i.particlePositions[e*3+1]-t.startPos.y,a=i.particlePositions[e*3+2]-t.startPos.z;(Math.sqrt(n*n+r*r+a*a)>=s||t.age>=t.life)&&(t.active=!1,i.particlePositions[e*3]=9999,i.particlePositions[e*3+1]=9999,i.particlePositions[e*3+2]=9999,t.alpha=0),t.velocity.x+=(Math.random()-.5)*1e-4,t.velocity.z+=(Math.random()-.5)*1e-4,t.velocity.y+=1e-4,t.velocity.multiplyScalar(.99),i.particlePositions[e*3]+=t.velocity.x,i.particlePositions[e*3+1]+=t.velocity.y,i.particlePositions[e*3+2]+=t.velocity.z;let o=t.age/t.life;o<.2?t.alpha=o/.2:o>.8?t.alpha=(1-o)/.2:t.alpha=1}}i.particleGeometry.attributes.position.needsUpdate=!0,i.particleMaterial.opacity=.6}i.enableSubMesh&&(i.subMeshMaterial.uniforms.animationProgress.value=d),this.five.needsRender=!0}startPathAnimation(e,n){var r,i;let a=this.paths.get(e);if(!a)return console.warn(`DynamicPathLinePlugin: 路径 ${e} 不存在`),!1;if(a.animationId!==null)return!1;let o=(r=n==null?void 0:n.startPointIndex)==null?0:r,s=(i=n==null?void 0:n.fromStart)==null?!1:i;if(!a.isPaused||s){let e=0,t=o;if(t>0){let n=a.config.points;t>=n.length&&(console.warn(`DynamicPathLinePlugin: startPointIndex ${t} 超出范围,路径只有 ${n.length} 个点`),t=n.length-1);for(let r=0;r<t;r++)e+=n[r].distanceTo(n[r+1])}a.startOffset=e,a.lines.forEach(t=>{t.material.uniforms.startOffset.value=e}),a.enableSubMesh&&(a.subMeshMaterial.uniforms.startOffset.value=e)}let c=performance.now()/1e3;if(!s&&a.isPaused&&a.pausedProgress>0){let e=a.curve.getLength(),t=Math.max(.01,e-a.startOffset-a.endOffset),n=a.speed;a.cycleStartTime=c-a.pausedProgress*t/n,a.subMeshUnfoldStarted&&a.subMeshUnfoldProgress<1&&(a.subMeshUnfoldStartTime=c-(a.pausedTime-a.subMeshUnfoldStartTime)),a.isPaused=!1}else a.cycleStartTime=c,a.isPaused=!1,a.pausedProgress=0;return a.lastUpdateTime=c,this.highlightPath(e,!0),a.animationId=t.AnimationFrameLoop.shared.add(()=>{this.updatePathAnimation(e)}),!0}stopPathAnimation(e,t=!1){let n=this.paths.get(e);if(!n)return console.warn(`DynamicPathLinePlugin: 路径 ${e} 不存在`),!1;if(this.highlightPath(e,!1),n.animationId!==null){if(t){let e=performance.now()/1e3,t=n.curve.getLength(),r=Math.max(.01,t-n.startOffset-n.endOffset),i=n.speed;n.pausedProgress=(e-n.cycleStartTime)*i/r%1,n.pausedTime=e,n.isPaused=!0,n.subMeshUnfoldStarted&&n.subMeshUnfoldProgress<1&&(n.subMeshUnfoldStartTime=e-(e-n.subMeshUnfoldStartTime))}else n.isPaused=!1,n.pausedProgress=0,n.pausedTime=0;n.animationId(),n.animationId=null}return!0}_enable(e){this.paths.size>0&&this.state.playing&&this.play()}_disable(e){this.pause()}enable(e){var t;if(this.state.enabled)return;let n=(t=e==null?void 0:e.userAction)==null?!0:t;this.updateState({enabled:!0},n),this._enable({userAction:n})}disable(e){var t;if(this.state.enabled===!1)return;let n=(t=e==null?void 0:e.userAction)==null?!0:t;this.updateState({enabled:!1},n),this._disable({userAction:n})}show(e){var t;let n=(t=e==null?void 0:e.userAction)==null?!0:t;this.paths.forEach(e=>{e.lines.forEach(e=>e.visible=!0),e.particles.visible=!0,e.subMesh.visible=!0}),this.updateState({visible:!0},n)}hide(e){var t;let n=(t=e==null?void 0:e.userAction)==null?!0:t;this.paths.forEach(e=>{e.lines.forEach(e=>e.visible=!1),e.particles.visible=!1,e.subMesh.visible=!1}),this.updateState({visible:!1},n)}setState(e,t){t==null||t.userAction,e.enabled!==void 0&&e.enabled!==this.state.enabled&&(e.enabled?this.enable(t):this.disable(t)),e.visible!==void 0&&e.visible!==this.state.visible&&(e.visible?this.show(t):this.hide(t))}play(e=!1){this.paths.forEach((t,n)=>{this.startPathAnimation(n,{fromStart:e})}),this.updateState({playing:!0},!1),this.hooks.emit(`animationStart`)}pause(){this.paths.forEach((e,t)=>{this.stopPathAnimation(t,!0)}),this.updateState({playing:!1},!1),this.hooks.emit(`animationStop`)}reset(){this.paths.forEach((e,t)=>{this.stopPathAnimation(t)}),this.paths.forEach(e=>{e.isInitialAnimation=!0,e.isPathlineInitialAnimation=!0,e.subMeshUnfoldProgress=0,e.subMeshUnfoldStarted=!1,e.subMeshUnfoldStartTime=0,e.lastAnimationProgress=0,e.cycleStartTime=performance.now()/1e3,e.lastUpdateTime=performance.now()/1e3,e.startOffset=0,e.endOffset=0,e.isPaused=!1,e.pausedProgress=0,e.pausedTime=0,e.lines.forEach(e=>{e.visible=!0,e.material.uniforms.time.value=0,e.material.uniforms.animationProgress.value=0,e.material.uniforms.startOffset.value=0,e.material.uniforms.endOffset.value=0}),e.particles.visible=!0;let t=this._config.particleCount;for(let n=0;n<t;n++){let t=e.particleInfos[n];t.active=!1,t.age=0,t.alpha=0,e.particlePositions[n*3]=9999,e.particlePositions[n*3+1]=9999,e.particlePositions[n*3+2]=9999}e.particleGeometry.attributes.position.needsUpdate=!0,e.subMeshMaterial&&(e.subMeshMaterial.uniforms.unfoldProgress.value=0,e.subMeshMaterial.uniforms.animationProgress.value=0,e.subMeshMaterial.uniforms.startOffset.value=0,e.subMeshMaterial.uniforms.endOffset.value=0)})}highlightPath(e,n){let r=this.paths.get(e);if(!r)return;let i=r.lines,a=0,o=t.AnimationFrameLoop.shared.add((e,t)=>{a=Math.min(1,a+t/250),n?(i.forEach(e=>{e.material.uniforms.opacity.value=.3+a*.7}),r.particleMaterial.opacity=.3+a*.7,r.enableSubMesh&&(r.subMeshMaterial.uniforms.globalOpacity.value=.3+a*.7)):(i.forEach(e=>{e.material.uniforms.opacity.value=1-a*.7}),r.particleMaterial.opacity=.6*(1-a*.7),r.enableSubMesh&&(r.subMeshMaterial.uniforms.globalOpacity.value=1-a*.7)),this.five.needsRender=!0,a===1&&o()})}updateScreenProjection(e){let t=e=>{let t=this.projectPointsToScreen(e.config.points,this.five.camera),n=this.findNearestOffscreenPoint(t);n&&(e.startOffset=n.distance);let r=this.findFarestOffscreenPoint(t);r&&(e.endOffset=r.totalLength-r.distance),e.lines.forEach(t=>{t.material.uniforms.startOffset.value=e.startOffset,t.material.uniforms.endOffset.value=e.endOffset}),e.subMeshMaterial.uniforms.startOffset.value=e.startOffset,e.subMeshMaterial.uniforms.endOffset.value=e.endOffset,e.cycleStartTime=performance.now()/1e3,e.lastAnimationProgress=0};if(e){let n=this.paths.get(e);n&&t(n)}else this.paths.forEach(e=>{e.enabled&&t(e)})}disposePathResources(e){e.lines.forEach(e=>{this.five.scene.remove(e),e.geometry.dispose(),e.material.dispose()}),this.five.scene.remove(e.particles),e.particleGeometry.dispose(),e.particleMaterial.dispose(),this.five.scene.remove(e.subMesh),e.subMeshGeometry.dispose(),e.subMeshMaterial.dispose()}dispose(){this.pause(),this.clearAllPaths(),this.hooks.emit(`dispose`)}};e.BackgroundPlugin=U,Object.defineProperty(e,`BasePlugin`,{enumerable:!0,get:function(){return p}}),e.CSS3DRenderer=ne,e.DynamicPathLinePlugin=(e,t)=>new ye(e,t),e.ItemMaskPlugin=k,e.OrbitControls=j,e.OrientationPlugin=ie,e.PanoAnimePlugin=fe,e.RoundedBoxGeometry=re,e.TrajectoryPlugin=G});