@realsee/dnalogel 3.59.8 → 3.59.9

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 (436) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/index.cjs.js +12 -8
  3. package/dist/index.js +16 -12
  4. package/dist/index.umd.js +12 -8
  5. package/docs/classes/AreaMakerPluginType.AreaMakerController.html +2 -2
  6. package/docs/classes/AreaMakerPluginType.AreaMakerItem.html +2 -2
  7. package/docs/classes/CSS3DRender.html +2 -2
  8. package/docs/classes/GuideLineItem.GuideLineItem.html +2 -2
  9. package/docs/classes/GuideLineModeItem.GuideLineModeItem.html +26 -26
  10. package/docs/classes/ModelMakerPluginInstance.html +2 -2
  11. package/docs/classes/ModelRoomLabelController.html +2 -2
  12. package/docs/classes/MoveController.html +2 -2
  13. package/docs/classes/Object3DHelperController.html +2 -2
  14. package/docs/classes/PaintBrush.html +2 -2
  15. package/docs/classes/PanoMeasurePluginLine.html +2 -2
  16. package/docs/classes/PanoMeasurePluginModel.html +2 -2
  17. package/docs/classes/PanoMeasurePluginPoint.html +2 -2
  18. package/docs/classes/PanoMeasurePluginPolyline.html +2 -2
  19. package/docs/classes/PanoTagPluginController.html +2 -2
  20. package/docs/classes/Sculpt.html +2 -2
  21. package/docs/classes/Util.BetterTween.html +2 -2
  22. package/docs/classes/Util.FiveDomEvents.html +2 -2
  23. package/docs/classes/Util.FivePuppet.html +2 -2
  24. package/docs/classes/Util.Interval.html +2 -2
  25. package/docs/classes/Util.LightTag.html +2 -2
  26. package/docs/classes/Util.LineSegments.html +2 -2
  27. package/docs/classes/Util.Magnifier.html +2 -2
  28. package/docs/classes/Util.Object3D.html +2 -2
  29. package/docs/classes/Util.PointHelper.html +2 -2
  30. package/docs/classes/Util.PointSelector.html +2 -2
  31. package/docs/classes/Util.PointSelectorHelper.html +2 -2
  32. package/docs/classes/Util.Rectangle.html +2 -2
  33. package/docs/classes/Util.sculpt.BaseEditor.html +2 -2
  34. package/docs/classes/Util.sculpt.BoxMesh.html +2 -2
  35. package/docs/classes/Util.sculpt.BoxMeshEditor.html +2 -2
  36. package/docs/classes/Util.sculpt.CircleMesh.html +2 -2
  37. package/docs/classes/Util.sculpt.CircleMeshEditor.html +2 -2
  38. package/docs/classes/Util.sculpt.CircleWithEdgeMesh.html +2 -2
  39. package/docs/classes/Util.sculpt.CylinderMesh.html +2 -2
  40. package/docs/classes/Util.sculpt.CylinderMeshEditor.html +2 -2
  41. package/docs/classes/Util.sculpt.LineMesh.html +2 -2
  42. package/docs/classes/Util.sculpt.PointMesh.html +2 -2
  43. package/docs/classes/Util.sculpt.PolygonMesh.html +2 -2
  44. package/docs/classes/Util.sculpt.PrismMesh.html +2 -2
  45. package/docs/classes/Util.sculpt.PrismMeshEditor.html +2 -2
  46. package/docs/classes/Util.sculpt.RectangleMesh.html +2 -2
  47. package/docs/classes/Util.sculpt.RectangleMeshEditor.html +2 -2
  48. package/docs/classes/Util.sculpt.RectangleWithEdgeMesh.html +2 -2
  49. package/docs/classes/WalkController.html +2 -2
  50. package/docs/enums/CameraMovementEffect.html +2 -2
  51. package/docs/enums/ContentType.html +2 -2
  52. package/docs/enums/DIRECTION.html +2 -2
  53. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +2 -2
  54. package/docs/enums/DimensionType.html +2 -2
  55. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +2 -2
  56. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +2 -2
  57. package/docs/enums/PaintBrushTypeEnum.html +2 -2
  58. package/docs/enums/PointType.html +2 -2
  59. package/docs/enums/Rotation.html +2 -2
  60. package/docs/functions/AreaMakerPlugin.html +1 -1
  61. package/docs/functions/CSS3DRenderPlugin.html +1 -1
  62. package/docs/functions/CameraMovementPlugin.html +2 -2
  63. package/docs/functions/CruisePlugin.html +1 -1
  64. package/docs/functions/CurrentPanoImagePlugin.html +1 -1
  65. package/docs/functions/GuideLinePlugin.html +1 -1
  66. package/docs/functions/ItemLabelPlugin.html +1 -1
  67. package/docs/functions/MapviewFloorplanPlugin.html +1 -1
  68. package/docs/functions/ModelChassisCompassPlugin.html +2 -2
  69. package/docs/functions/ModelEntryDoorGuidePlugin.html +2 -2
  70. package/docs/functions/ModelFloorplanPlugin.html +1 -1
  71. package/docs/functions/ModelItemLabelPlugin.html +1 -1
  72. package/docs/functions/ModelMakerPlugin.html +1 -1
  73. package/docs/functions/ModelRoomLabelPlugin.html +1 -1
  74. package/docs/functions/ModelTVVideoPlugin.html +1 -1
  75. package/docs/functions/ModelViewPlugin.html +2 -2
  76. package/docs/functions/MovePlugin.html +1 -1
  77. package/docs/functions/Object3DHelperPlugin.html +1 -1
  78. package/docs/functions/PanoCompassPlugin.html +1 -1
  79. package/docs/functions/PanoCursorRaycasterPlugin.html +2 -2
  80. package/docs/functions/PanoDoorLabelPlugin.html +1 -1
  81. package/docs/functions/PanoFloorplanRadarPlugin.html +1 -1
  82. package/docs/functions/PanoMeasurePlugin.html +1 -1
  83. package/docs/functions/PanoRulerPlugin.html +2 -2
  84. package/docs/functions/PanoRulerProPlugin.html +2 -2
  85. package/docs/functions/PanoSpatialTagPlugin.html +2 -2
  86. package/docs/functions/PanoTagPlugin.html +1 -1
  87. package/docs/functions/PanoVideoPlugin.html +2 -2
  88. package/docs/functions/PipelinePlugin.html +1 -1
  89. package/docs/functions/SculptPlugin.html +2 -2
  90. package/docs/functions/TopviewFloorplanPlugin.html +1 -1
  91. package/docs/functions/Util.absoluteUrl.html +2 -2
  92. package/docs/functions/Util.awaitNextFrame.html +1 -1
  93. package/docs/functions/Util.blink.html +2 -2
  94. package/docs/functions/Util.bounding.html +1 -1
  95. package/docs/functions/Util.boundingBox.html +1 -1
  96. package/docs/functions/Util.boundingSphere.html +1 -1
  97. package/docs/functions/Util.boxVertex.html +2 -2
  98. package/docs/functions/Util.boxVertexes.html +1 -1
  99. package/docs/functions/Util.checkFiveModelLoaded.html +2 -2
  100. package/docs/functions/Util.convexHull.html +2 -2
  101. package/docs/functions/Util.equal.html +2 -2
  102. package/docs/functions/Util.fiveModelIsLoaded.html +2 -2
  103. package/docs/functions/Util.getCoordsFromClient.html +1 -1
  104. package/docs/functions/Util.getCoordsFromElement.html +1 -1
  105. package/docs/functions/Util.getFrameTime.html +2 -2
  106. package/docs/functions/Util.inside.html +1 -1
  107. package/docs/functions/Util.isAbsoluteURL.html +1 -1
  108. package/docs/functions/Util.isModelLike.html +1 -1
  109. package/docs/functions/Util.isNil.html +2 -2
  110. package/docs/functions/Util.isPanoramaLike.html +1 -1
  111. package/docs/functions/Util.lookObject.html +2 -2
  112. package/docs/functions/Util.lookPoint.html +2 -2
  113. package/docs/functions/Util.nextFrame.html +1 -1
  114. package/docs/functions/Util.notNil.html +2 -2
  115. package/docs/functions/Util.reblink.html +2 -2
  116. package/docs/functions/Util.requestAnimationFrameInterval.html +2 -2
  117. package/docs/functions/Util.sculpt.createBox.html +1 -1
  118. package/docs/functions/Util.sculpt.createCircle.html +1 -1
  119. package/docs/functions/Util.sculpt.createCylinder.html +1 -1
  120. package/docs/functions/Util.sculpt.createLine.html +2 -2
  121. package/docs/functions/Util.sculpt.createPoint.html +1 -1
  122. package/docs/functions/Util.sculpt.createPolygon.html +1 -1
  123. package/docs/functions/Util.sculpt.createPrism.html +1 -1
  124. package/docs/functions/Util.sculpt.createRectangle.html +2 -2
  125. package/docs/functions/Util.tag.html +1 -1
  126. package/docs/functions/Util.tweenProgress.html +1 -1
  127. package/docs/functions/Util.uuid.html +2 -2
  128. package/docs/functions/Util.waitFiveModelLoaded.html +2 -2
  129. package/docs/functions/Util.worldBounding.html +1 -1
  130. package/docs/functions/Util.worldBoundingBox.html +1 -1
  131. package/docs/functions/Util.worldBoundingSphere.html +1 -1
  132. package/docs/functions/createPolyline.html +2 -2
  133. package/docs/functions/pluginFlag.html +1 -1
  134. package/docs/hierarchy.html +1 -1
  135. package/docs/index.html +2 -2
  136. package/docs/interfaces/AreaMakerPluginType.AnimeOptions.html +2 -2
  137. package/docs/interfaces/AreaMakerPluginType.Config.html +2 -2
  138. package/docs/interfaces/AreaMakerPluginType.EventMap.html +2 -2
  139. package/docs/interfaces/AreaMakerPluginType.Params.html +2 -2
  140. package/docs/interfaces/AreaMakerPluginType.ServerAreaMakerItem.html +2 -2
  141. package/docs/interfaces/AreaMakerPluginType.ServerAreaMakerItemV1.html +2 -2
  142. package/docs/interfaces/AreaMakerPluginType.ServerDataV1.html +2 -2
  143. package/docs/interfaces/AreaMakerPluginType.ServerDataV2.html +2 -2
  144. package/docs/interfaces/AreaMakerPluginType.ShowHideOptions.html +2 -2
  145. package/docs/interfaces/AreaMakerPluginType.State.html +2 -2
  146. package/docs/interfaces/CSS3DRenderPluginEventMap.html +2 -2
  147. package/docs/interfaces/CSS3DRenderPluginState.html +2 -2
  148. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  149. package/docs/interfaces/ContentTypeMapInterface.html +2 -2
  150. package/docs/interfaces/CruisePluginTypes.Config.html +2 -2
  151. package/docs/interfaces/CruisePluginTypes.CruiseKeyframe.html +2 -2
  152. package/docs/interfaces/CruisePluginTypes.EventMap.html +2 -2
  153. package/docs/interfaces/CruisePluginTypes.GuildLineConfig.html +2 -2
  154. package/docs/interfaces/CruisePluginTypes.MoveAction.html +2 -2
  155. package/docs/interfaces/CruisePluginTypes.MoveWithKeyframesAction.html +2 -2
  156. package/docs/interfaces/CruisePluginTypes.MoveWithPanoIndexAction.html +2 -2
  157. package/docs/interfaces/CruisePluginTypes.PluginData.html +2 -2
  158. package/docs/interfaces/CruisePluginTypes.PluginServerData.html +2 -2
  159. package/docs/interfaces/CruisePluginTypes.PluginState.html +2 -2
  160. package/docs/interfaces/CurrentPanoImagePluginType.Config.html +2 -2
  161. package/docs/interfaces/CurrentPanoImagePluginType.EventMap.html +2 -2
  162. package/docs/interfaces/CurrentPanoImagePluginType.Params.html +2 -2
  163. package/docs/interfaces/CurrentPanoImagePluginType.ShowHideOptions.html +2 -2
  164. package/docs/interfaces/CurrentPanoImagePluginType.State.html +2 -2
  165. package/docs/interfaces/FloorplanBounding.html +2 -2
  166. package/docs/interfaces/FloorplanData.html +2 -2
  167. package/docs/interfaces/FloorplanEntrance.html +2 -2
  168. package/docs/interfaces/FloorplanExtraObject.html +2 -2
  169. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  170. package/docs/interfaces/FloorplanFloorData.html +2 -2
  171. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  172. package/docs/interfaces/FloorplanObserver.html +2 -2
  173. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  174. package/docs/interfaces/FloorplanPosition.html +2 -2
  175. package/docs/interfaces/FloorplanRoomItem.html +2 -2
  176. package/docs/interfaces/FloorplanRoomLabelItem.html +2 -2
  177. package/docs/interfaces/FloorplanServerBounding.html +2 -2
  178. package/docs/interfaces/FloorplanServerComputedData.html +2 -2
  179. package/docs/interfaces/FloorplanServerData.html +2 -2
  180. package/docs/interfaces/FloorplanServerDoorItem.html +2 -2
  181. package/docs/interfaces/FloorplanServerDoorPosition.html +2 -2
  182. package/docs/interfaces/FloorplanServerEntrance.html +2 -2
  183. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  184. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  185. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  186. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  187. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  188. package/docs/interfaces/FloorplanServerRoomItem.html +2 -2
  189. package/docs/interfaces/FloorplanServerRoomLabelItem.html +2 -2
  190. package/docs/interfaces/GuideLineModeItem.GuideLineTagContainer.html +2 -2
  191. package/docs/interfaces/GuideLinePluginType.CatmullRomCurve3.html +2 -2
  192. package/docs/interfaces/GuideLinePluginType.EventMap.html +2 -2
  193. package/docs/interfaces/GuideLinePluginType.GuideLineGeometryStyle.html +2 -2
  194. package/docs/interfaces/GuideLinePluginType.GuideLineItemContainer.html +2 -2
  195. package/docs/interfaces/GuideLinePluginType.GuideLineMaterialStyle.html +2 -2
  196. package/docs/interfaces/GuideLinePluginType.GuideLineMeshStyle.html +2 -2
  197. package/docs/interfaces/GuideLinePluginType.LineGeometriesConfig.html +2 -2
  198. package/docs/interfaces/GuideLinePluginType.ModelGuideLineStyle.html +2 -2
  199. package/docs/interfaces/GuideLinePluginType.ModelGuideLineTagData.html +2 -2
  200. package/docs/interfaces/GuideLinePluginType.PanoramaGuideLineStyle.html +2 -2
  201. package/docs/interfaces/GuideLinePluginType.PluginDataV2.html +1 -1
  202. package/docs/interfaces/GuideLinePluginType.PluginServerData.html +2 -2
  203. package/docs/interfaces/GuideLinePluginType.PluginState.html +2 -2
  204. package/docs/interfaces/GuideLinePluginType.Route.html +2 -2
  205. package/docs/interfaces/GuideLinePluginType.RouteConfig.html +2 -2
  206. package/docs/interfaces/HelperOffset.html +2 -2
  207. package/docs/interfaces/ImagePlaneGroup.html +2 -2
  208. package/docs/interfaces/ItemLabelPluginData.html +2 -2
  209. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +2 -2
  210. package/docs/interfaces/ItemLabelPluginParametersType.html +2 -2
  211. package/docs/interfaces/MinMax.html +2 -2
  212. package/docs/interfaces/ModelChassisCompassPluginData.html +2 -2
  213. package/docs/interfaces/ModelChassisCompassPluginExportType.html +2 -2
  214. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +2 -2
  215. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +2 -2
  216. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +2 -2
  217. package/docs/interfaces/ModelItemLabelPluginData.html +2 -2
  218. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +2 -2
  219. package/docs/interfaces/ModelItemLabelPluginParametersType.html +2 -2
  220. package/docs/interfaces/ModelMakerPluginType.EventMap.html +2 -2
  221. package/docs/interfaces/ModelMakerPluginType.ServerBaseItem.html +2 -2
  222. package/docs/interfaces/ModelMakerPluginType.ServerBoxItem.html +2 -2
  223. package/docs/interfaces/ModelMakerPluginType.ServerData.html +2 -2
  224. package/docs/interfaces/ModelMakerPluginType.ServerPrismItem.html +2 -2
  225. package/docs/interfaces/ModelMakerPluginType.ServerTrianglesItem.html +2 -2
  226. package/docs/interfaces/ModelMakerPluginType.State.html +2 -2
  227. package/docs/interfaces/ModelRoomLabelPluginData.html +2 -2
  228. package/docs/interfaces/ModelTVVideoPluginData.html +2 -2
  229. package/docs/interfaces/ModelTVVideoPluginExportType.html +2 -2
  230. package/docs/interfaces/ModelTVVideoPluginParameterType.html +2 -2
  231. package/docs/interfaces/ModelViewPluginExportType.html +2 -2
  232. package/docs/interfaces/Object3DHelperState.html +2 -2
  233. package/docs/interfaces/ObjectHelperControllers.html +2 -2
  234. package/docs/interfaces/PaintBrushAction.html +2 -2
  235. package/docs/interfaces/PaintBrushConfigs.html +2 -2
  236. package/docs/interfaces/PaintBrushState.html +2 -2
  237. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +2 -2
  238. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  239. package/docs/interfaces/PanoMeasureParameterType.html +2 -2
  240. package/docs/interfaces/PanoMeasurePluginLineJson.html +2 -2
  241. package/docs/interfaces/PanoMeasurePluginOpenParameter.html +2 -2
  242. package/docs/interfaces/PanoMeasurePluginPointJson.html +2 -2
  243. package/docs/interfaces/PanoMeasurePluginPolylineJson.html +2 -2
  244. package/docs/interfaces/PanoRulerPluginExportType.html +2 -2
  245. package/docs/interfaces/PanoRulerPluginOptions.html +2 -2
  246. package/docs/interfaces/PanoRulerPluginParameterType.html +2 -2
  247. package/docs/interfaces/PanoRulerProPluginExportType.html +2 -2
  248. package/docs/interfaces/PanoRulerProPluginOptions.html +2 -2
  249. package/docs/interfaces/PanoRulerProPluginParameterType.html +2 -2
  250. package/docs/interfaces/PanoRulerProPluginState.html +2 -2
  251. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  252. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  253. package/docs/interfaces/PanoSpatialTagPluginData.html +2 -2
  254. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +2 -2
  255. package/docs/interfaces/PanoSpatialTagPluginExportType.html +2 -2
  256. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +2 -2
  257. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +2 -2
  258. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +2 -2
  259. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +2 -2
  260. package/docs/interfaces/PanoVideoPluginType.LoadParams.html +2 -2
  261. package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +2 -2
  262. package/docs/interfaces/PanoVideoPluginType.PluginData.html +2 -2
  263. package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +2 -2
  264. package/docs/interfaces/PanoVideoPluginType.PluginState.html +2 -2
  265. package/docs/interfaces/PanoVideoPluginType.VideoItem.html +2 -2
  266. package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +2 -2
  267. package/docs/interfaces/PluginEventMap.html +2 -2
  268. package/docs/interfaces/Point.html +2 -2
  269. package/docs/interfaces/Room.html +2 -2
  270. package/docs/interfaces/RoomInfo.html +2 -2
  271. package/docs/interfaces/RoomLabel.html +2 -2
  272. package/docs/interfaces/RoomRules.html +1 -1
  273. package/docs/interfaces/Rooms.html +1 -1
  274. package/docs/interfaces/Scissor.html +2 -2
  275. package/docs/interfaces/State.html +2 -2
  276. package/docs/interfaces/TagCacheInterface.html +2 -2
  277. package/docs/interfaces/TagConfig.html +2 -2
  278. package/docs/interfaces/TagGLTFObjectGroup.html +2 -2
  279. package/docs/interfaces/TagIconUrl.html +2 -2
  280. package/docs/interfaces/TagObjectGroup.html +2 -2
  281. package/docs/interfaces/TagStyle.html +2 -2
  282. package/docs/interfaces/Tags.html +2 -2
  283. package/docs/interfaces/TemporaryState.html +2 -2
  284. package/docs/interfaces/Util.AnimeInstance.html +2 -2
  285. package/docs/interfaces/Util.BlinkAnimeOptions.html +2 -2
  286. package/docs/interfaces/Util.EventHandlerConfig.html +2 -2
  287. package/docs/interfaces/Util.FiveDomEvent.html +2 -2
  288. package/docs/interfaces/Util.FiveDomEventMap.html +2 -2
  289. package/docs/interfaces/Util.MagnifierParameter.html +2 -2
  290. package/docs/interfaces/Util.MouseGroupParameter.html +2 -2
  291. package/docs/interfaces/Util.PointIntersection.html +2 -2
  292. package/docs/interfaces/Util.PointSelectorHelperConfig.html +2 -2
  293. package/docs/interfaces/Util.ReBlinkAnimeOptions.html +2 -2
  294. package/docs/modules/AreaMakerPluginType.html +2 -2
  295. package/docs/modules/CruisePluginTypes.html +2 -2
  296. package/docs/modules/CurrentPanoImagePluginType.html +2 -2
  297. package/docs/modules/GuideLineItem.html +2 -2
  298. package/docs/modules/GuideLineModeItem.html +2 -2
  299. package/docs/modules/GuideLinePluginType.html +2 -2
  300. package/docs/modules/ModelMakerPluginType.html +2 -2
  301. package/docs/modules/PanoVideoPluginType.html +2 -2
  302. package/docs/modules/SculptData.html +2 -2
  303. package/docs/modules/Util.html +2 -2
  304. package/docs/modules/Util.sculpt.html +2 -2
  305. package/docs/modules.html +2 -2
  306. package/docs/types/AddObject3DHelperConfig.html +2 -2
  307. package/docs/types/AreaMakerPluginType.AreaMakerItemEventMap.html +2 -2
  308. package/docs/types/AreaMakerPluginType.ItemRenderer.html +1 -1
  309. package/docs/types/AreaMakerPluginType.PluginData.html +2 -2
  310. package/docs/types/AreaMakerPluginType.ServerData.html +2 -2
  311. package/docs/types/ArrayPosition.html +1 -1
  312. package/docs/types/AudioAppearance.html +1 -1
  313. package/docs/types/CSS3DRenderExportType.html +1 -1
  314. package/docs/types/CSS3DRenderPluginExportType.html +1 -1
  315. package/docs/types/CSS3DRenderPluginParameterType.html +1 -1
  316. package/docs/types/ClassFunctionParameters.html +1 -1
  317. package/docs/types/Color.html +1 -1
  318. package/docs/types/ContentTypeConfigKey.html +1 -1
  319. package/docs/types/ContentTypeConfigKeySplit.html +1 -1
  320. package/docs/types/ContentTypeMap.html +1 -1
  321. package/docs/types/Create3DDomContainerReturnType.html +1 -1
  322. package/docs/types/Create3DElementReturnType.html +1 -1
  323. package/docs/types/CruisePluginExportType.html +1 -1
  324. package/docs/types/CruisePluginTypes.CruiseData.html +2 -2
  325. package/docs/types/CruisePluginTypes.MoveEffect.html +1 -1
  326. package/docs/types/CurrentPanoImagePluginExportType.html +1 -1
  327. package/docs/types/DeprecatedMediaPlaneProperty.html +2 -2
  328. package/docs/types/DeprecatedTagProperty.html +2 -2
  329. package/docs/types/Direction-1.html +1 -1
  330. package/docs/types/Direction4.html +1 -1
  331. package/docs/types/ElementRenderer.html +2 -2
  332. package/docs/types/FloorplanRuleLabels.html +2 -2
  333. package/docs/types/FloorplanServerRuleLabels.html +1 -1
  334. package/docs/types/GuideLinePluginExportType.html +1 -1
  335. package/docs/types/GuideLinePluginType.GuideLineItem.html +2 -2
  336. package/docs/types/GuideLinePluginType.GuideLineItemEventMap.html +1 -1
  337. package/docs/types/GuideLinePluginType.GuideLineModeItemMode.html +1 -1
  338. package/docs/types/GuideLinePluginType.GuideLineStyle.html +2 -2
  339. package/docs/types/GuideLinePluginType.ModelGuideLineTag.html +2 -2
  340. package/docs/types/GuideLinePluginType.PathItem.html +2 -2
  341. package/docs/types/GuideLinePluginType.PluginData.html +2 -2
  342. package/docs/types/HelperEventMap.html +1 -1
  343. package/docs/types/InternalHelperEventMap.html +1 -1
  344. package/docs/types/MapviewFloorplanPluginParameterType.html +1 -1
  345. package/docs/types/MapviewFloorplanPluginReturnType.html +1 -1
  346. package/docs/types/MediaData.html +2 -2
  347. package/docs/types/MediaStore.html +1 -1
  348. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +1 -1
  349. package/docs/types/ModelFloorplanPluginParameterType.html +1 -1
  350. package/docs/types/ModelFloorplanPluginReturnType.html +1 -1
  351. package/docs/types/ModelId.html +1 -1
  352. package/docs/types/ModelMakerPluginType.ElementRenderer.html +1 -1
  353. package/docs/types/ModelMakerPluginType.ItemType.html +1 -1
  354. package/docs/types/ModelRoomLabelPluginParameters.html +1 -1
  355. package/docs/types/ModelRoomLabelPluginReturnType.html +1 -1
  356. package/docs/types/MoveArgs.html +2 -2
  357. package/docs/types/MoveOpts.html +2 -2
  358. package/docs/types/Object3DHelperEventMap.html +1 -1
  359. package/docs/types/ObjectFit.html +1 -1
  360. package/docs/types/PaintBrushEventMap.html +1 -1
  361. package/docs/types/PanoCompassPluginData.html +1 -1
  362. package/docs/types/PanoCompassPluginExportType.html +1 -1
  363. package/docs/types/PanoCompassPluginParameterType.html +1 -1
  364. package/docs/types/PanoFloorplanRadarPluginParameterType.html +1 -1
  365. package/docs/types/PanoFloorplanRadarPluginReturnType.html +1 -1
  366. package/docs/types/PanoIndex.html +1 -1
  367. package/docs/types/PanoMeasurePluginEvent.html +1 -1
  368. package/docs/types/PanoMeasureReturnType.html +1 -1
  369. package/docs/types/PanoSpatialTagPluginId.html +1 -1
  370. package/docs/types/PanoTagPluginExportInterface.html +1 -1
  371. package/docs/types/PanoTagPluginParamsInterface.html +1 -1
  372. package/docs/types/PanoVideoPluginParameterType.html +1 -1
  373. package/docs/types/PanoVideoPluginReturnType.html +1 -1
  374. package/docs/types/PickTagContentTypeInContentTypeConfigKey.html +2 -2
  375. package/docs/types/PipelinePluginParameterType.html +1 -1
  376. package/docs/types/PipelinePluginReturnType.html +1 -1
  377. package/docs/types/PlaneTag.html +2 -2
  378. package/docs/types/Point2DTag.html +2 -2
  379. package/docs/types/Point3DTag.html +2 -2
  380. package/docs/types/PointTagInstance.html +1 -1
  381. package/docs/types/Position.html +1 -1
  382. package/docs/types/PositionFrom.html +1 -1
  383. package/docs/types/RotateArgs.html +2 -2
  384. package/docs/types/RotateOpts.html +2 -2
  385. package/docs/types/RuleLabelsKey.html +1 -1
  386. package/docs/types/RuleLabelsValue.html +1 -1
  387. package/docs/types/ScaleCallback.html +1 -1
  388. package/docs/types/ScalePosition.html +2 -2
  389. package/docs/types/SculptData.BoxData.html +1 -1
  390. package/docs/types/SculptData.CircleData.html +1 -1
  391. package/docs/types/SculptData.CylinderData.html +1 -1
  392. package/docs/types/SculptData.PointData.html +1 -1
  393. package/docs/types/SculptData.PolygonData.html +1 -1
  394. package/docs/types/SculptData.PolylineData.html +1 -1
  395. package/docs/types/SculptData.PrismData.html +1 -1
  396. package/docs/types/SculptData.RectangleData.html +1 -1
  397. package/docs/types/StickType.html +1 -1
  398. package/docs/types/Tag.html +2 -2
  399. package/docs/types/Tag2D.html +2 -2
  400. package/docs/types/Tag3D.html +2 -2
  401. package/docs/types/TagClickParams.html +1 -1
  402. package/docs/types/TagConfigByKey.html +1 -1
  403. package/docs/types/TagContentType.html +1 -1
  404. package/docs/types/TagContentTypeMapping.html +1 -1
  405. package/docs/types/TagDimensionType.html +1 -1
  406. package/docs/types/TagElement.html +2 -2
  407. package/docs/types/TagEvents.html +1 -1
  408. package/docs/types/TagGLTFObject.html +1 -1
  409. package/docs/types/TagHooks.html +1 -1
  410. package/docs/types/TagId.html +1 -1
  411. package/docs/types/TagInstance.html +1 -1
  412. package/docs/types/TagPointType.html +2 -2
  413. package/docs/types/TagRendererMap.html +1 -1
  414. package/docs/types/TopviewFloorplanPluginParameterType.html +1 -1
  415. package/docs/types/TopviewFloorplanPluginReturnType.html +1 -1
  416. package/docs/types/Util.ActionIfNoModelUnderMouse.html +1 -1
  417. package/docs/types/Util.PointSelectorConfig.html +1 -1
  418. package/docs/types/WorkCode.html +1 -1
  419. package/docs/variables/FLOOR_TYPE_MAP.html +2 -2
  420. package/docs/variables/PLUGIN.html +1 -1
  421. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +2 -2
  422. package/docs/variables/ROOM_TYPE_MAP.html +2 -2
  423. package/docs/variables/Util.animeMap.html +1 -1
  424. package/docs/variables/defaultGlobalConfig.html +1 -1
  425. package/docs/variables/itemLabelPluginServerParams.html +1 -1
  426. package/docs/variables/modelItemLabelPluginServerParams.html +1 -1
  427. package/docs/variables/modelRoomLabelPluginServerParams.html +1 -1
  428. package/libs/GuideLinePlugin/GuideLineModeItem/index.js +16 -12
  429. package/libs/GuideLinePlugin/utils/createLineGeometry.js +39 -39
  430. package/libs/Sculpt/Meshes/LineWithDots.js +11 -11
  431. package/libs/Sculpt/Meshes/Polyline.js +2 -2
  432. package/libs/base/BasePlugin.js +1 -1
  433. package/libs/shared-utils/five/FiveDomEvents.js +16 -16
  434. package/libs/shared-utils/logger.js +1 -1
  435. package/libs/shared-utils/three/closeVectors.js +2 -2
  436. package/package.json +1 -1
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(K,Q){typeof exports=="object"&&typeof module!="undefined"?Q(exports,require("three"),require("three/examples/jsm/renderers/CSS3DRenderer"),require("@realsee/five/line"),require("animejs"),require("@realsee/five"),require("hammerjs"),require("three/examples/jsm/loaders/FBXLoader"),require("earcut"),require("@realsee/five/gltf-loader")):typeof define=="function"&&define.amd?define(["exports","three","three/examples/jsm/renderers/CSS3DRenderer","@realsee/five/line","animejs","@realsee/five","hammerjs","three/examples/jsm/loaders/FBXLoader","earcut","@realsee/five/gltf-loader"],Q):(K=typeof globalThis!="undefined"?globalThis:K||self,Q(K.dnalogel={},K.THREE,K.CSS3DRenderer,K.Line,K.anime,K.FiveSDK,K.Hammer,K.FBXLoader,K.earcut,K.GLTFLoader))})(this,function(K,Q,We,yt,Xi,Xe,ys,In,mi,ws){"use strict";var Yx=Object.defineProperty,Xx=Object.defineProperties;var Zx=Object.getOwnPropertyDescriptors;var Yr=Object.getOwnPropertySymbols;var vp=Object.prototype.hasOwnProperty,Ap=Object.prototype.propertyIsEnumerable;var Xr=Math.pow,Jc=(K,Q,We)=>Q in K?Yx(K,Q,{enumerable:!0,configurable:!0,writable:!0,value:We}):K[Q]=We,x=(K,Q)=>{for(var We in Q||(Q={}))vp.call(Q,We)&&Jc(K,We,Q[We]);if(Yr)for(var We of Yr(Q))Ap.call(Q,We)&&Jc(K,We,Q[We]);return K},ie=(K,Q)=>Xx(K,Zx(Q));var Yi=(K,Q)=>{var We={};for(var yt in K)vp.call(K,yt)&&Q.indexOf(yt)<0&&(We[yt]=K[yt]);if(K!=null&&Yr)for(var yt of Yr(K))Q.indexOf(yt)<0&&Ap.call(K,yt)&&(We[yt]=K[yt]);return We};var d=(K,Q,We)=>(Jc(K,typeof Q!="symbol"?Q+"":Q,We),We);var H=(K,Q,We)=>new Promise((yt,Xi)=>{var Xe=mi=>{try{In(We.next(mi))}catch(ws){Xi(ws)}},ys=mi=>{try{In(We.throw(mi))}catch(ws){Xi(ws)}},In=mi=>mi.done?yt(mi.value):Promise.resolve(mi.value).then(Xe,ys);In((We=We.apply(K,Q)).next())});function wp(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const b=wp(Q);function Cp(){console.debug("%c %c@realsee/dnalogel %cv3.59.8",["background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')","background-repeat: no-repeat","background-position: 0 center","padding-left: 8px"].join(";"),"","background-color: #12ce9b;color:black;padding:0 6px;border-radius: 3px")}function Pp(){const n=typeof OffscreenCanvas!="undefined",t=n&&new OffscreenCanvas(1,1).getContext("webgl")!==null;n&&!t&&Object.assign(window,{OffscreenCanvas:function(e,i){const s=document.createElement("canvas");return s.width=e,s.height=i,s}})}function qc(){}const Kc=()=>Promise.resolve(),$c={__queue:Promise.resolve()};function Ip(n=Kc){$c.__queue=$c.__queue.then(n).catch(Kc)}function Ao(n,t,e){const i=n.x,s=n.y,o=Math.floor(i/t*1e4)/1e4,r=Math.floor(s/e*1e4)/1e4;return{x:o,y:r}}function Zr(n,t,e){const{x:i,y:s}=n,o=i*t,r=s*e;return{x:o,y:r}}function bo(n){if(n.length<2)return{};const t=n.slice(-2),e=t[0],i={x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2};return{control:e,end:i}}function Mp(n,t,e=qc){new Promise(i=>{setTimeout(()=>{e(),i(!0)},t*n)})}const Ep=window,eh=window.requestAnimationFrame||Ep.webkitRequestAnimationFrame||(n=>setTimeout(n,16));function yo(n,t=0){t<=0?eh(n):eh(()=>yo(n,t-1))}var ti=Object.freeze({Linear:Object.freeze({None:function(n){return n},In:function(n){return this.None(n)},Out:function(n){return this.None(n)},InOut:function(n){return this.None(n)}}),Quadratic:Object.freeze({In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}}),Cubic:Object.freeze({In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}}),Quartic:Object.freeze({In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}}),Quintic:Object.freeze({In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}}),Sinusoidal:Object.freeze({In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}}),Exponential:Object.freeze({In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}}),Circular:Object.freeze({In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}}),Elastic:Object.freeze({In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(n){var t=1.70158;return n===1?1:n*n*((t+1)*n-t)},Out:function(n){var t=1.70158;return n===0?0:--n*n*((t+1)*n+t)+1},InOut:function(n){var t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}}),Bounce:Object.freeze({In:function(n){return 1-ti.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?ti.Bounce.In(n*2)*.5:ti.Bounce.Out(n*2-1)*.5+.5}}),generatePow:function(n){return n===void 0&&(n=4),n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return Math.pow(t,n)},Out:function(t){return 1-Math.pow(1-t,n)},InOut:function(t){return t<.5?Math.pow(t*2,n)/2:(1-Math.pow(2-t*2,n))/2+.5}}}}),Mn=function(){return performance.now()},th=function(){function n(){this._tweens={},this._tweensAddedDuringUpdate={}}return n.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},n.prototype.removeAll=function(){this._tweens={}},n.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},n.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},n.prototype.update=function(t,e){t===void 0&&(t=Mn()),e===void 0&&(e=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var s=0;s<i.length;s++){var o=this._tweens[i[s]],r=!e;o&&o.update(t,r)===!1&&!e&&delete this._tweens[i[s]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},n}(),Zi={Linear:function(n,t){var e=n.length-1,i=e*t,s=Math.floor(i),o=Zi.Utils.Linear;return t<0?o(n[0],n[1],i):t>1?o(n[e],n[e-1],e-i):o(n[s],n[s+1>e?e:s+1],i-s)},Bezier:function(n,t){for(var e=0,i=n.length-1,s=Math.pow,o=Zi.Utils.Bernstein,r=0;r<=i;r++)e+=s(1-t,i-r)*s(t,r)*n[r]*o(i,r);return e},CatmullRom:function(n,t){var e=n.length-1,i=e*t,s=Math.floor(i),o=Zi.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(s=Math.floor(i=e*(1+t))),o(n[(s-1+e)%e],n[s],n[(s+1)%e],n[(s+2)%e],i-s)):t<0?n[0]-(o(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[e]-(o(n[e],n[e],n[e-1],n[e-1],i-e)-n[e]):o(n[s?s-1:0],n[s],n[e<s+1?e:s+1],n[e<s+2?e:s+2],i-s)},Utils:{Linear:function(n,t,e){return(t-n)*e+n},Bernstein:function(n,t){var e=Zi.Utils.Factorial;return e(n)/e(t)/e(n-t)},Factorial:function(){var n=[1];return function(t){var e=1;if(n[t])return n[t];for(var i=t;i>1;i--)e*=i;return n[t]=e,e}}(),CatmullRom:function(n,t,e,i,s){var o=(e-n)*.5,r=(i-t)*.5,a=s*s,l=s*a;return(2*t-2*e+o+r)*l+(-3*t+3*e-2*o-r)*a+o*s+t}}},Jr=function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n}(),qr=new th,wo=function(){function n(t,e){e===void 0&&(e=qr),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=ti.Linear.None,this._interpolationFunction=Zi.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Jr.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return n.prototype.getId=function(){return this._id},n.prototype.isPlaying=function(){return this._isPlaying},n.prototype.isPaused=function(){return this._isPaused},n.prototype.getDuration=function(){return this._duration},n.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},n.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},n.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},n.prototype.start=function(t,e){if(t===void 0&&(t=Mn()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var s={};for(var o in this._valuesEnd)s[o]=this._valuesEnd[o];this._valuesEnd=s}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},n.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},n.prototype._setupProperties=function(t,e,i,s,o){for(var r in i){var a=t[r],l=Array.isArray(a),c=l?"array":typeof a,h=!l&&Array.isArray(i[r]);if(!(c==="undefined"||c==="function")){if(h){var u=i[r];if(u.length===0)continue;for(var f=[a],m=0,v=u.length;m<v;m+=1){var p=this._handleRelativeValue(a,u[m]);if(isNaN(p)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}f.push(p)}h&&(i[r]=f)}if((c==="object"||l)&&a&&!h){e[r]=l?[]:{};var g=a;for(var A in g)e[r][A]=g[A];s[r]=l?[]:{};var u=i[r];if(!this._isDynamic){var w={};for(var A in u)w[A]=u[A];i[r]=u=w}this._setupProperties(g,e[r],u,s[r],o)}else(typeof e[r]=="undefined"||o)&&(e[r]=a),l||(e[r]*=1),h?s[r]=i[r].slice().reverse():s[r]=e[r]||0}}},n.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},n.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},n.prototype.pause=function(t){return t===void 0&&(t=Mn()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},n.prototype.resume=function(t){return t===void 0&&(t=Mn()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},n.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},n.prototype.group=function(t){return t===void 0&&(t=qr),this._group=t,this},n.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},n.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},n.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},n.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},n.prototype.easing=function(t){return t===void 0&&(t=ti.Linear.None),this._easingFunction=t,this},n.prototype.interpolation=function(t){return t===void 0&&(t=Zi.Linear),this._interpolationFunction=t,this},n.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},n.prototype.onStart=function(t){return this._onStartCallback=t,this},n.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},n.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},n.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},n.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},n.prototype.onStop=function(t){return this._onStopCallback=t,this},n.prototype.update=function(t,e){var i=this,s;if(t===void 0&&(t=Mn()),e===void 0&&(e=!0),this._isPaused)return!0;var o,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,l=this._duration+((s=this._repeatDelayTime)!==null&&s!==void 0?s:this._delayTime),c=this._duration+this._repeat*l,h=function(){if(i._duration===0||a>c)return 1;var g=Math.trunc(a/l),A=a-g*l,w=Math.min(A/i._duration,1);return w===0&&a===i._duration?1:w},u=h(),f=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||a>=this._duration)if(this._repeat>0){var m=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=m);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*m,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var v=0,p=this._chainedTweens.length;v<p;v++)this._chainedTweens[v].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},n.prototype._updateProperties=function(t,e,i,s){for(var o in i)if(e[o]!==void 0){var r=e[o]||0,a=i[o],l=Array.isArray(t[o]),c=Array.isArray(a),h=!l&&c;h?t[o]=this._interpolationFunction(a,s):typeof a=="object"&&a?this._updateProperties(t[o],r,a,s):(a=this._handleRelativeValue(r,a),typeof a=="number"&&(t[o]=r+(a-r)*s))}},n.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},n.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},n}(),kp="23.1.1",xp=Jr.nextId,ii=qr,Dp=ii.getAll.bind(ii),Sp=ii.removeAll.bind(ii),Lp=ii.add.bind(ii),ih=ii.remove.bind(ii),Tp=ii.update.bind(ii),nh={Easing:ti,Group:th,Interpolation:Zi,now:Mn,Sequence:Jr,nextId:xp,Tween:wo,VERSION:kp,getAll:Dp,removeAll:Sp,add:Lp,remove:ih,update:Tp};function zp(n,t,e,i=ti.Linear.None){const s=new wo(n).to(t,e).easing(i).start();function o(r){s.update(r)&&requestAnimationFrame(o)}return requestAnimationFrame(o),s}var gi=(n=>(n.Drawline="Drawline",n.Undo="Undo",n.Exit="Exit",n))(gi||{});const Cs=Symbol("$$PAINT_BRUSH_EVENT$$");function Co(n){return n[Cs]||(n[Cs]={}),n[Cs]}function jp(n){n[Cs]||delete n[Cs]}let Op=class{hasListener(t){const e=Co(this);return e&&e[t]&&e[t].length>0}on(t,e,i){const s=Co(this);return s[t]||(s[t]=[]),s[t].push([e,i||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){jp(this);return}const i=Co(this);if(i[t]||(i[t]=[]),e===void 0){i[t].length=0;return}let s=0;for(;s<i[t].length&&i[t][s][0]!==e;s++);s<i[t].length&&i[t].splice(s,1)}emit(t,...e){let i=!1;const o=Co(this)[t]||[];for(let r of o.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(i=!0)}return i}};function xi(){return((1+Math.random())*65536|0).toString(16).substring(1)}function ct(){return(xi()+xi()+"-"+xi()+"-4"+xi().substr(0,3)+"-"+xi()+"-"+xi()+xi()+xi()).toLowerCase()}const Vp=`
1
+ (function(K,Q){typeof exports=="object"&&typeof module!="undefined"?Q(exports,require("three"),require("three/examples/jsm/renderers/CSS3DRenderer"),require("@realsee/five/line"),require("animejs"),require("@realsee/five"),require("hammerjs"),require("three/examples/jsm/loaders/FBXLoader"),require("earcut"),require("@realsee/five/gltf-loader")):typeof define=="function"&&define.amd?define(["exports","three","three/examples/jsm/renderers/CSS3DRenderer","@realsee/five/line","animejs","@realsee/five","hammerjs","three/examples/jsm/loaders/FBXLoader","earcut","@realsee/five/gltf-loader"],Q):(K=typeof globalThis!="undefined"?globalThis:K||self,Q(K.dnalogel={},K.THREE,K.CSS3DRenderer,K.Line,K.anime,K.FiveSDK,K.Hammer,K.FBXLoader,K.earcut,K.GLTFLoader))})(this,function(K,Q,We,yt,Xi,Xe,ys,In,mi,ws){"use strict";var Yx=Object.defineProperty,Xx=Object.defineProperties;var Zx=Object.getOwnPropertyDescriptors;var Yr=Object.getOwnPropertySymbols;var vp=Object.prototype.hasOwnProperty,Ap=Object.prototype.propertyIsEnumerable;var Xr=Math.pow,Jc=(K,Q,We)=>Q in K?Yx(K,Q,{enumerable:!0,configurable:!0,writable:!0,value:We}):K[Q]=We,x=(K,Q)=>{for(var We in Q||(Q={}))vp.call(Q,We)&&Jc(K,We,Q[We]);if(Yr)for(var We of Yr(Q))Ap.call(Q,We)&&Jc(K,We,Q[We]);return K},ie=(K,Q)=>Xx(K,Zx(Q));var Yi=(K,Q)=>{var We={};for(var yt in K)vp.call(K,yt)&&Q.indexOf(yt)<0&&(We[yt]=K[yt]);if(K!=null&&Yr)for(var yt of Yr(K))Q.indexOf(yt)<0&&Ap.call(K,yt)&&(We[yt]=K[yt]);return We};var d=(K,Q,We)=>(Jc(K,typeof Q!="symbol"?Q+"":Q,We),We);var H=(K,Q,We)=>new Promise((yt,Xi)=>{var Xe=mi=>{try{In(We.next(mi))}catch(ws){Xi(ws)}},ys=mi=>{try{In(We.throw(mi))}catch(ws){Xi(ws)}},In=mi=>mi.done?yt(mi.value):Promise.resolve(mi.value).then(Xe,ys);In((We=We.apply(K,Q)).next())});function wp(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const b=wp(Q);function Cp(){console.debug("%c %c@realsee/dnalogel %cv3.59.9",["background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')","background-repeat: no-repeat","background-position: 0 center","padding-left: 8px"].join(";"),"","background-color: #12ce9b;color:black;padding:0 6px;border-radius: 3px")}function Pp(){const n=typeof OffscreenCanvas!="undefined",t=n&&new OffscreenCanvas(1,1).getContext("webgl")!==null;n&&!t&&Object.assign(window,{OffscreenCanvas:function(e,i){const s=document.createElement("canvas");return s.width=e,s.height=i,s}})}function qc(){}const Kc=()=>Promise.resolve(),$c={__queue:Promise.resolve()};function Ip(n=Kc){$c.__queue=$c.__queue.then(n).catch(Kc)}function Ao(n,t,e){const i=n.x,s=n.y,o=Math.floor(i/t*1e4)/1e4,r=Math.floor(s/e*1e4)/1e4;return{x:o,y:r}}function Zr(n,t,e){const{x:i,y:s}=n,o=i*t,r=s*e;return{x:o,y:r}}function bo(n){if(n.length<2)return{};const t=n.slice(-2),e=t[0],i={x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2};return{control:e,end:i}}function Mp(n,t,e=qc){new Promise(i=>{setTimeout(()=>{e(),i(!0)},t*n)})}const Ep=window,eh=window.requestAnimationFrame||Ep.webkitRequestAnimationFrame||(n=>setTimeout(n,16));function yo(n,t=0){t<=0?eh(n):eh(()=>yo(n,t-1))}var ti=Object.freeze({Linear:Object.freeze({None:function(n){return n},In:function(n){return this.None(n)},Out:function(n){return this.None(n)},InOut:function(n){return this.None(n)}}),Quadratic:Object.freeze({In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}}),Cubic:Object.freeze({In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}}),Quartic:Object.freeze({In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}}),Quintic:Object.freeze({In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}}),Sinusoidal:Object.freeze({In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}}),Exponential:Object.freeze({In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}}),Circular:Object.freeze({In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}}),Elastic:Object.freeze({In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(n){var t=1.70158;return n===1?1:n*n*((t+1)*n-t)},Out:function(n){var t=1.70158;return n===0?0:--n*n*((t+1)*n+t)+1},InOut:function(n){var t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}}),Bounce:Object.freeze({In:function(n){return 1-ti.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?ti.Bounce.In(n*2)*.5:ti.Bounce.Out(n*2-1)*.5+.5}}),generatePow:function(n){return n===void 0&&(n=4),n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return Math.pow(t,n)},Out:function(t){return 1-Math.pow(1-t,n)},InOut:function(t){return t<.5?Math.pow(t*2,n)/2:(1-Math.pow(2-t*2,n))/2+.5}}}}),Mn=function(){return performance.now()},th=function(){function n(){this._tweens={},this._tweensAddedDuringUpdate={}}return n.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},n.prototype.removeAll=function(){this._tweens={}},n.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},n.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},n.prototype.update=function(t,e){t===void 0&&(t=Mn()),e===void 0&&(e=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var s=0;s<i.length;s++){var o=this._tweens[i[s]],r=!e;o&&o.update(t,r)===!1&&!e&&delete this._tweens[i[s]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},n}(),Zi={Linear:function(n,t){var e=n.length-1,i=e*t,s=Math.floor(i),o=Zi.Utils.Linear;return t<0?o(n[0],n[1],i):t>1?o(n[e],n[e-1],e-i):o(n[s],n[s+1>e?e:s+1],i-s)},Bezier:function(n,t){for(var e=0,i=n.length-1,s=Math.pow,o=Zi.Utils.Bernstein,r=0;r<=i;r++)e+=s(1-t,i-r)*s(t,r)*n[r]*o(i,r);return e},CatmullRom:function(n,t){var e=n.length-1,i=e*t,s=Math.floor(i),o=Zi.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(s=Math.floor(i=e*(1+t))),o(n[(s-1+e)%e],n[s],n[(s+1)%e],n[(s+2)%e],i-s)):t<0?n[0]-(o(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[e]-(o(n[e],n[e],n[e-1],n[e-1],i-e)-n[e]):o(n[s?s-1:0],n[s],n[e<s+1?e:s+1],n[e<s+2?e:s+2],i-s)},Utils:{Linear:function(n,t,e){return(t-n)*e+n},Bernstein:function(n,t){var e=Zi.Utils.Factorial;return e(n)/e(t)/e(n-t)},Factorial:function(){var n=[1];return function(t){var e=1;if(n[t])return n[t];for(var i=t;i>1;i--)e*=i;return n[t]=e,e}}(),CatmullRom:function(n,t,e,i,s){var o=(e-n)*.5,r=(i-t)*.5,a=s*s,l=s*a;return(2*t-2*e+o+r)*l+(-3*t+3*e-2*o-r)*a+o*s+t}}},Jr=function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n}(),qr=new th,wo=function(){function n(t,e){e===void 0&&(e=qr),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=ti.Linear.None,this._interpolationFunction=Zi.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Jr.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return n.prototype.getId=function(){return this._id},n.prototype.isPlaying=function(){return this._isPlaying},n.prototype.isPaused=function(){return this._isPaused},n.prototype.getDuration=function(){return this._duration},n.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},n.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},n.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},n.prototype.start=function(t,e){if(t===void 0&&(t=Mn()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var s={};for(var o in this._valuesEnd)s[o]=this._valuesEnd[o];this._valuesEnd=s}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},n.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},n.prototype._setupProperties=function(t,e,i,s,o){for(var r in i){var a=t[r],l=Array.isArray(a),c=l?"array":typeof a,h=!l&&Array.isArray(i[r]);if(!(c==="undefined"||c==="function")){if(h){var u=i[r];if(u.length===0)continue;for(var f=[a],m=0,v=u.length;m<v;m+=1){var p=this._handleRelativeValue(a,u[m]);if(isNaN(p)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}f.push(p)}h&&(i[r]=f)}if((c==="object"||l)&&a&&!h){e[r]=l?[]:{};var g=a;for(var A in g)e[r][A]=g[A];s[r]=l?[]:{};var u=i[r];if(!this._isDynamic){var w={};for(var A in u)w[A]=u[A];i[r]=u=w}this._setupProperties(g,e[r],u,s[r],o)}else(typeof e[r]=="undefined"||o)&&(e[r]=a),l||(e[r]*=1),h?s[r]=i[r].slice().reverse():s[r]=e[r]||0}}},n.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},n.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},n.prototype.pause=function(t){return t===void 0&&(t=Mn()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},n.prototype.resume=function(t){return t===void 0&&(t=Mn()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},n.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},n.prototype.group=function(t){return t===void 0&&(t=qr),this._group=t,this},n.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},n.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},n.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},n.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},n.prototype.easing=function(t){return t===void 0&&(t=ti.Linear.None),this._easingFunction=t,this},n.prototype.interpolation=function(t){return t===void 0&&(t=Zi.Linear),this._interpolationFunction=t,this},n.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},n.prototype.onStart=function(t){return this._onStartCallback=t,this},n.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},n.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},n.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},n.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},n.prototype.onStop=function(t){return this._onStopCallback=t,this},n.prototype.update=function(t,e){var i=this,s;if(t===void 0&&(t=Mn()),e===void 0&&(e=!0),this._isPaused)return!0;var o,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,l=this._duration+((s=this._repeatDelayTime)!==null&&s!==void 0?s:this._delayTime),c=this._duration+this._repeat*l,h=function(){if(i._duration===0||a>c)return 1;var g=Math.trunc(a/l),A=a-g*l,w=Math.min(A/i._duration,1);return w===0&&a===i._duration?1:w},u=h(),f=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||a>=this._duration)if(this._repeat>0){var m=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=m);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*m,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var v=0,p=this._chainedTweens.length;v<p;v++)this._chainedTweens[v].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},n.prototype._updateProperties=function(t,e,i,s){for(var o in i)if(e[o]!==void 0){var r=e[o]||0,a=i[o],l=Array.isArray(t[o]),c=Array.isArray(a),h=!l&&c;h?t[o]=this._interpolationFunction(a,s):typeof a=="object"&&a?this._updateProperties(t[o],r,a,s):(a=this._handleRelativeValue(r,a),typeof a=="number"&&(t[o]=r+(a-r)*s))}},n.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},n.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},n}(),kp="23.1.1",xp=Jr.nextId,ii=qr,Dp=ii.getAll.bind(ii),Sp=ii.removeAll.bind(ii),Lp=ii.add.bind(ii),ih=ii.remove.bind(ii),Tp=ii.update.bind(ii),nh={Easing:ti,Group:th,Interpolation:Zi,now:Mn,Sequence:Jr,nextId:xp,Tween:wo,VERSION:kp,getAll:Dp,removeAll:Sp,add:Lp,remove:ih,update:Tp};function zp(n,t,e,i=ti.Linear.None){const s=new wo(n).to(t,e).easing(i).start();function o(r){s.update(r)&&requestAnimationFrame(o)}return requestAnimationFrame(o),s}var gi=(n=>(n.Drawline="Drawline",n.Undo="Undo",n.Exit="Exit",n))(gi||{});const Cs=Symbol("$$PAINT_BRUSH_EVENT$$");function Co(n){return n[Cs]||(n[Cs]={}),n[Cs]}function jp(n){n[Cs]||delete n[Cs]}let Op=class{hasListener(t){const e=Co(this);return e&&e[t]&&e[t].length>0}on(t,e,i){const s=Co(this);return s[t]||(s[t]=[]),s[t].push([e,i||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){jp(this);return}const i=Co(this);if(i[t]||(i[t]=[]),e===void 0){i[t].length=0;return}let s=0;for(;s<i[t].length&&i[t][s][0]!==e;s++);s<i[t].length&&i[t].splice(s,1)}emit(t,...e){let i=!1;const o=Co(this)[t]||[];for(let r of o.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(i=!0)}return i}};function xi(){return((1+Math.random())*65536|0).toString(16).substring(1)}function ct(){return(xi()+xi()+"-"+xi()+"-4"+xi().substr(0,3)+"-"+xi()+"-"+xi()+xi()+xi()).toLowerCase()}const Vp=`
2
2
  <style type="text/css">
3
3
 
4
4
  #_gl_paintBrush {
@@ -432,7 +432,7 @@ void main() {
432
432
  float match = 1.0 - uv.x;
433
433
  gl_FragColor = vec4(1.0,1.0,1.0,match);
434
434
  }
435
- `;function Iv(){const n=new b.PlaneGeometry(.4,.4),t=yv,e=new b.TextureLoader().load(t);e.encoding=b.sRGBEncoding,e.minFilter=b.LinearFilter;const i=new b.MeshBasicMaterial({map:e,transparent:!0,depthTest:!1});return new b.Mesh(n,i)}function Mv(){const n=new b.CurvePath;n.add(new b.LineCurve3(new b.Vector3(0,0,0),new b.Vector3(0,0,.1)));const t=new b.TubeGeometry(n,8,.003),e=new b.ShaderMaterial({vertexShader:Cv,fragmentShader:Pv,depthTest:!1,transparent:!0});return new b.Mesh(t,e)}function Ev(){const n=new b.SphereGeometry(.01,20,20),t=new b.MeshBasicMaterial({color:10349931,depthTest:!1,transparent:!0,side:b.DoubleSide}),e=new b.Mesh(n,t);return e.position.set(0,0,.1),e}function kv(){const t=new Th({pointerEvents:"none",cornerPoints:[new b.Vector3(-.2,.2,0),new b.Vector3(-.2,-.2,0),new b.Vector3(.2,-.2,0),new b.Vector3(.2,.2,0)]}),e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e.style.backgroundImage=`url(${Ah})`,e.style.backgroundSize="100%",e.style.backgroundRepeat="no-repeat",t.container.appendChild(e),t}class bh extends b.Object3D{constructor(e){super();d(this,"planeMesh");d(this,"lineMesh");d(this,"ballMesh");d(this,"borderMesh");d(this,"five");this.planeMesh=Iv(),this.lineMesh=Mv(),this.ballMesh=Ev(),this.borderMesh=kv(),this.addEventListener("added",()=>{this.add(this.planeMesh,this.lineMesh,this.ballMesh,this.borderMesh)}),this.addEventListener("removed",()=>{this.remove(this.planeMesh,this.lineMesh,this.ballMesh,this.borderMesh)}),hh(e),this.five=e}updateWithIntersect(e){var s;const i=(s=e==null?void 0:e.face)!=null&&s.normal?new b.Vector3().addVectors(e.point,e.face.normal):this.five.camera.position;this.position.copy(e.point),this.lookAt(i)}show(){this.visible=!0,this.borderMesh.parent||this.add(this.borderMesh)}hide(){this.visible=!1,this.remove(this.borderMesh)}dispose(){var e;(e=this.planeMesh.material.map)==null||e.dispose()}}class yh extends b.Object3D{constructor(){super(...arguments);d(this,"children",[])}getRaycastIntersects(e){const i=[];return this.raycast(e,i),i}getRaycastIntersection(e){return this.getRaycastIntersects(e)[0]}}class wh extends Q.LineSegments{constructor(t,e){super(t,e)}}const ha=new b.Vector3;class xv extends b.Sphere{expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;ha.subVectors(t,this.center);const e=ha.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),s=(i-this.radius)*.5;this.center.addScaledVector(ha,s/i),this.radius+=s}return this}}function Dv(n){const{max:t,min:e}=n;return[new b.Vector3(t.x,t.y,t.z),new b.Vector3(e.x,t.y,t.z),new b.Vector3(e.x,e.y,t.z),new b.Vector3(t.x,e.y,t.z),new b.Vector3(t.x,t.y,e.z),new b.Vector3(e.x,t.y,e.z),new b.Vector3(e.x,e.y,e.z),new b.Vector3(t.x,e.y,e.z)]}function Si(n,t){const{max:e,min:i}=n;switch(t){case 0:return new b.Vector3(e.x,e.y,e.z);case 1:return new b.Vector3(i.x,e.y,e.z);case 2:return new b.Vector3(i.x,i.y,e.z);case 3:return new b.Vector3(e.x,i.y,e.z);case 4:return new b.Vector3(e.x,e.y,i.z);case 5:return new b.Vector3(i.x,e.y,i.z);case 6:return new b.Vector3(i.x,i.y,i.z);case 7:return new b.Vector3(e.x,i.y,i.z)}}function xn(n){return da(n,"box3")}function Ch(n){return da(n,"sphere")}function Sv(n){return Lo(n,"box3")}function Ph(n){return Lo(n,"sphere")}function Lo(n,t){const e=t==="box3"?new b.Box3:new xv,i=new b.Vector3;if(n.updateWorldMatrix(!1,!1),n.traverse(s=>{var r;if(s.name==="shadow"||s.type==="Line2")return;const o=s.geometry;if(s.updateWorldMatrix(!1,!1),o!==void 0){const a=(r=o==null?void 0:o.attributes)==null?void 0:r.position;if(a)for(let l=0,c=a.count;l<c;l++)i.fromBufferAttribute(a,l).applyMatrix4(s.matrixWorld),e.expandByPoint(i);else o.vertices&&o.vertices.forEach(l=>{const c=l.clone().applyMatrix4(s.matrixWorld);e.expandByPoint(c)})}}),!e.isEmpty())return e}function da(n,t){const e=Lo(n,t);return e&&e.applyMatrix4(Lv(n.matrixWorld.clone())),e}const Lv=n=>{const t=n.elements,e=t[0],i=t[1],s=t[2],o=t[3],r=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=t[9],f=t[10],m=t[11],v=t[12],p=t[13],g=t[14],A=t[15],w=u*g*c-p*f*c+p*l*m-a*g*m-u*l*A+a*f*A,I=v*f*c-h*g*c-v*l*m+r*g*m+h*l*A-r*f*A,C=h*p*c-v*u*c+v*a*m-r*p*m-h*a*A+r*u*A,M=v*u*l-h*p*l-v*a*f+r*p*f+h*a*g-r*u*g,E=e*w+i*I+s*C+o*M;if(E===0)return n.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/E;return t[0]=w*S,t[1]=(p*f*o-u*g*o-p*s*m+i*g*m+u*s*A-i*f*A)*S,t[2]=(a*g*o-p*l*o+p*s*c-i*g*c-a*s*A+i*l*A)*S,t[3]=(u*l*o-a*f*o-u*s*c+i*f*c+a*s*m-i*l*m)*S,t[4]=I*S,t[5]=(h*g*o-v*f*o+v*s*m-e*g*m-h*s*A+e*f*A)*S,t[6]=(v*l*o-r*g*o-v*s*c+e*g*c+r*s*A-e*l*A)*S,t[7]=(r*f*o-h*l*o+h*s*c-e*f*c-r*s*m+e*l*m)*S,t[8]=C*S,t[9]=(v*u*o-h*p*o-v*i*m+e*p*m+h*i*A-e*u*A)*S,t[10]=(r*p*o-v*a*o+v*i*c-e*p*c-r*i*A+e*a*A)*S,t[11]=(h*a*o-r*u*o-h*i*c+e*u*c+r*i*m-e*a*m)*S,t[12]=M*S,t[13]=(h*p*s-v*u*s+v*i*f-e*p*f-h*i*g+e*u*g)*S,t[14]=(v*a*s-r*p*s-v*i*l+e*p*l+r*i*g-e*a*g)*S,t[15]=(r*u*s-h*a*s+h*i*l-e*u*l-r*i*f+e*a*f)*S,n},Ut=new Map,xs=new Map;function Tv(n){Ai(n).forEach(e=>{var i,s,o;Ut.has(e)||(e instanceof HTMLElement?Ut.set(e,{opacity:e.style.opacity===""?void 0:e.style.opacity,visible:{display:e.style.display,visibility:e.style.visibility}}):e.isObject3D&&(e.material?e.material instanceof b.ShaderMaterial?Ut.set(e,{opacity:(i=e.material.uniforms.opacity)==null?void 0:i.value,transparent:e.material.transparent,visible:e.visible}):Ut.set(e,{opacity:(s=e.material)==null?void 0:s.opacity,transparent:(o=e.material)==null?void 0:o.transparent,visible:e.visible}):Ut.set(e,{visible:e.visible})))})}function Ih(n){Ai(n).forEach(e=>{const i=Ut.get(e);i&&(e instanceof HTMLElement&&(e.style.opacity=i.opacity===void 0?"":i.opacity,e.style.display=i.visible.display,e.style.visibility=i.visible.visibility),e.isObject3D&&(e.visible=i.visible,e.material&&(e.material instanceof b.ShaderMaterial?(e.material.uniforms.opacity&&(e.material.uniforms.opacity.value=i.opacity),e.material.transparent=i.transparent):(e.material.opacity=i.opacity,e.material.transparent=i.transparent))),Ut.delete(e))})}function To(n,t){var a;const e=(a=t==null?void 0:t.traverseTHREEObject)!=null?a:!0;let i=Ai(n);const s=[];i.forEach(l=>{l&&(l instanceof HTMLElement?s.push(l):l.isObject3D&&(e?(s.push(l),l.traverse(c=>{c&&s.push(c)})):s.push(l)))}),i=[...new Set(s.filter(Boolean))],Tv(i);const o=Xi(x({targets:i,duration:300,easing:"linear",direction:"alternate",loop:4,autoplay:!1,update:l=>{var c;l.animatables.forEach(h=>{var v;const u=h.target;if(!Ut.has(u))return;const m=Number((v=Ut.get(u).opacity)!=null?v:1)*(100-l.progress)/100;u instanceof HTMLElement?u.style.opacity=String(m):u.material&&(u.material instanceof b.ShaderMaterial?(u.material.uniforms.opacity&&(u.material.uniforms.opacity.value=m),u.material.transparent=!0):(u.material.opacity=m,u.material.transparent=!0))}),(c=t==null?void 0:t.updateRender)==null||c.call(t)}},t));o.preComplete=()=>{o!=null&&o.completed||(o==null||o.pause(),Ih(i),setTimeout(()=>{var l;return(l=t==null?void 0:t.updateRender)==null?void 0:l.call(t)}))};const r=xs.get(n);return r==null||r.pause(),r==null||r.seek(0),xs.set(n,o),o.play(),o.finished.then(()=>{var l;Ih(i),setTimeout(()=>{xs.get(n)===o&&xs.delete(n)},1e3),(l=t==null?void 0:t.updateRender)==null||l.call(t)}),o}function Mh(n,t){return To(n,x({update:e=>{var i;e.animatables.forEach(s=>{const o=s.target;if(!Ut.has(o))return;const r=Ut.get(o),l=(Number(r==null?void 0:r.opacity)||Number(t==null?void 0:t.maxOpacity)||1)*(e.progress/100);o instanceof HTMLElement?(o.style.opacity=String(l),o.style.visibility="visible"):o.isObject3D&&(Ai(n).includes(o)&&(o.visible=!0),o.material&&(o.material instanceof b.ShaderMaterial?(o.material.uniforms.opacity&&(o.material.uniforms.opacity.value=l),o.material.transparent=!0):(o.material.opacity=l,o.material.transparent=!0)))}),(i=t==null?void 0:t.updateRender)==null||i.call(t)}},t))}const ua=Math.PI*2;function fa(n){return(n%ua+ua)%ua}function Ds(n){return{longitude:fa(-Math.atan2(n.x,-n.z)),latitude:-Math.asin(n.y/1)}}function zv(n,t,e){return H(this,null,function*(){var w,I,C;if(!t)return;const i=Ph(t);if(!i)return;const s=new Io(n),o=(w=e==null?void 0:e.scale)!=null?w:1.4,r=i.center,a=n.camera.position.clone().sub(r).setY(0).normalize(),l=n.state.mode==="Mapview"?n.state.fov:60,h=Math.max(1.5,i.radius*o),u=h*(1/Math.tan(b.MathUtils.degToRad(l/2)));let f=0;const m=[],v=M=>{const E=b.MathUtils.degToRad(M);return a.clone().applyAxisAngle(new b.Vector3(0,1,0),E).clone().multiplyScalar(u).add(new b.Vector3(0,h,0)).add(r)};for(;f!==360;){let M=0;const E=v(f),S=R=>{const U=R.distanceTo(E),j=new b.Raycaster(R,E.clone().sub(R).normalize()),Y=s.model.intersectRaycaster(j,void 0,!0)[0],N=Y==null?void 0:Y.distance;ke(N)?N>U&&(M+=1):M+=1},L=i.clampPoint(E,new b.Vector3);S(L);const W=new b.Vector3(r.x,E.y,r.z);if(S(W),ke(m[M])&&f>m[M]||(m[M]=f),M===2)break;f+=30}const p=v((C=(I=m[2])!=null?I:m[1])!=null?C:0),g=p.distanceTo(r),A=Ds(r.clone().sub(p).normalize());if(n.state.mode==="Mapview")return n.updateCamera(x({offset:r,distance:g},A),800);n.setState(x({mode:"Mapview",offset:r,distance:g},A)),yield n.ready()})}function Eh(n,t,e){return H(this,null,function*(){var p,g;if(!t)return;const i=(p=e==null?void 0:e.distance)!=null?p:3,s=new Io(n),o=n.camera.position.clone().sub(t).setY(0).normalize(),r=n.state.mode==="Mapview"?n.state.fov:60,a=i,l=a*Math.cos(b.MathUtils.degToRad(r/2)),c=a*Math.sin(b.MathUtils.degToRad(r/2));let h=0;const u=[],f=A=>{const w=b.MathUtils.degToRad(A);return o.clone().applyAxisAngle(new b.Vector3(0,1,0),w).clone().multiplyScalar(l).add(new b.Vector3(0,c,0)).add(t)};for(;h!==360;){let A=0;const w=f(h);if((C=>{const M=C.distanceTo(w),E=new b.Raycaster(C,w.clone().sub(C).normalize()),S=s.model.intersectRaycaster(E,void 0,!0)[0],L=S==null?void 0:S.distance;ke(L)?L>M&&(A+=1):A+=1})(t),u[A]=h,A===1)break;h+=30}const m=f((g=u[1])!=null?g:0),v=Ds(t.clone().sub(m).normalize());if(n.state.mode==="Mapview")return n.updateCamera(x({offset:t,distance:i},v),800);n.setState(x({mode:"Mapview",offset:t,distance:i},v)),yield n.ready()})}function ni(n){return H(this,null,function*(){return new Promise(t=>{if(kh(n))t();else{const e=i=>{const s=Qt(n);i===s&&(n.off("modelLoaded",e),t())};n.on("modelLoaded",e)}})})}function kh(n){var t;return(t=Qt(n))==null?void 0:t.loaded}function xh(n,t){const{top:e,left:i,width:s,height:o}=t.getBoundingClientRect();return new b.Vector2((n.x-i)/s*2-1,-(n.y-e)/o*2+1)}class Ss{constructor(t,e){d(this,"five");d(this,"dragging",!1);d(this,"boundObject",{});d(this,"config");d(this,"lastMouseDownEvent");d(this,"lastTouchEvent");d(this,"handleWantsGesture",(t,e)=>{var s;if(e.length!==1)return;const i=e[0];if(i.raycaster){const o=new ia;o.ray=i.raycaster.ray,o.near=i.raycaster.near,o.far=i.raycaster.far,o.camera=i.raycaster.camera,o.layers=i.raycaster.layers,o.params=i.raycaster.params,i.raycaster=o}if(i){if(t==="mouseMove"&&this.onDomEvent("hover",i),t==="tap"){let o;o||(o=(s=this.lastMouseDownEvent)!=null?s:this.lastTouchEvent),o||(o=new MouseEvent("click",{clientX:i.x,clientY:i.y}));const r=this.onDomEvent("click",i,o),a=this.onDomEvent("wantDblclick",i,o,this.boundObject.dblclick);if(r===!1||a===!1)return!1}if(this.dragging)return!1}});d(this,"handleDomEvent",(t,e,i)=>{const s={x:e.clientX,y:e.clientY};this.onDomEvent(t,s,e,i)});d(this,"handleMouseEvent",t=>{this.handleDomEvent(t.type,t)});d(this,"handleMousedown",t=>{this.lastMouseDownEvent=t,this.handleDomEvent("mousedown",t),this.handleDomEvent("dragstart",t,this.haveDragEventObject)});d(this,"handleTouchStart",t=>{this.lastTouchEvent=t});d(this,"handleMouseup",t=>{var e;this.dragging=!1,(e=this.haveDragEventObject)==null||e.forEach(i=>{i._dragging&&(i._dragging=!1,this.notify({eventName:"dragend",object:i,originEvent:t,raycaster:this.getRaycaster({x:t.clientX,y:t.clientY})}))}),this.handleDomEvent("mouseup",t)});d(this,"handleMousemove",t=>{var e;this.dragging&&((e=this.boundObject.drag)==null||e.forEach(i=>{i._dragging&&this.notify({eventName:"drag",object:i,originEvent:t,raycaster:this.getRaycaster({x:t.clientX,y:t.clientY})})}))});d(this,"onDomEvent",(t,e,i,s=this.boundObject[t])=>{var f,m,v,p,g;if(!e||!s||(s==null?void 0:s.length)===0)return;const o=[];((f=this.config)==null?void 0:f.fiveModels)!==null&&((m=this.config)!=null&&m.fiveModels?o.push(...this.config.fiveModels):o.push(this.model));const r=o.filter(A=>A.loaded),a=(v=e.raycaster)!=null?v:this.getRaycaster(e);a.params.Points.threshold=.02;const l=a.intersectObjects(s,!0),c=[];r.forEach(A=>{const w=A.intersectRaycaster(a);c.push(...w)});const h=.01;if(c.length>0&&l.length>0&&c[0].distance+h<l[0].distance)return;const u=(p=l==null?void 0:l[0])==null?void 0:p.object;if(t==="wantDblclick")return!1;if((!u||!this.objectIsBound(u))&&t==="hover")for(const A of(g=this.boundObject.hover)!=null?g:[])A._hovered&&this.notify({eventName:"unHover",object:A});if(u&&u&&this.notify({eventName:t,object:u,originEvent:i,raycaster:a,intersects:l}))return!1});d(this,"objectIsBound",t=>{let e=t._domEvent,i=t.parent;for(;typeof e=="undefined"&&i;)e=i._domEvent,i=i.parent;return!!e});d(this,"notify",t=>{var v,p,g;const{eventName:e,object:i,originEvent:s,raycaster:o,intersects:r}=t;if(!i)return!1;let a=!1,l=[];const c=[],h=()=>{const A=r.slice(1);return A[0]?this.notify(ie(x({},t),{object:A[0].object,intersects:A})):!1};let u=i;for(c.push(u);u.parent;)u=u.parent,c.push(u);const f=c.at(-1);if((v=this.config)!=null&&v.noEmitWhenNotInScene&&f.type!=="Scene")return h();let m=!1;for(const A of c){if(a)break;A.draggable&&(e==="dragstart"&&(A._dragging=!0,this.dragging=!0),e==="dragend"&&(A._dragging=!1,this.dragging=!1));const w=A._domEvent;if(!w)continue;const I=w[`${e}Handler`];if(I)for(const[C,M]of I){if(M!=null&&M.noEmitWhenNotInScene&&f.type!=="Scene"||((p=this.config)!=null&&p.noEmitWhenHide||M!=null&&M.noEmitWhenHide)&&!Kr(A))continue;if(m=!0,e==="hover"){if(A._hovered)continue;A._hovered=!0;for(const S of(g=this.boundObject.hover)!=null?g:[])S!==A&&S._hovered&&this.notify({eventName:"unHover",object:S})}if(e==="unHover"){if(!A._hovered)continue;A._hovered=!1}const E=C({type:e,target:A,origDomEvent:s,raycaster:o,intersects:r,stopPropagation:()=>{a=!0}});l.push(E!=null?E:!0)}}if(m===!1)return h();if(e==="click"||e==="wantDblclick")return l.some(A=>A===!0)});this.five=t,this.config=e,t.on("wantsGesture",this.handleWantsGesture),document.addEventListener("mousedown",this.handleMousedown),document.addEventListener("touchstart",this.handleTouchStart),document.addEventListener("dblclick",this.handleMouseEvent),document.addEventListener("mouseup",this.handleMouseup),document.addEventListener("mousemove",this.handleMousemove)}get haveDragEventObject(){return[...new Set([this.boundObject.dragend,this.boundObject.drag,this.boundObject.dragstart].flat())].filter(Boolean)}get model(){return Qt(this.five)}addAutoBindEventListener(t,e,i,s){const o=()=>this.addEventListener(t,e,i,s),r=()=>this.removeEventListener(t,e,i,s);return t.addEventListener("added",o),t.addEventListener("removed",r),t.addEventListener("dispose",r),()=>{t.removeEventListener("added",o),t.removeEventListener("removed",r),t.removeEventListener("dispose",r)}}addEventListener(t,e,i,s){t._domEvent||(t._domEvent={}),t._domEvent[`${e}Handler`]||(t._domEvent[`${e}Handler`]=[]),this.boundObject[e]||(this.boundObject[e]=[]),this.boundObject[e].includes(t)||this.boundObject[e].push(t),t._domEvent[`${e}Handler`].push([i,x({noEmitWhenHide:!1,noEmitWhenNotInScene:!1},s)])}removeEventListener(t,e,i,...s){var r,a;if(!t._domEvent||(e===void 0&&(Object.keys(this.boundObject).forEach(l=>{var h,u;const c=(h=this.boundObject[l])==null?void 0:h.findIndex(f=>f===t);c!==-1&&((u=this.boundObject[l])==null||u.splice(c,1))}),t._domEvent={}),!t._domEvent[`${e}Handler`]))return;if(i===void 0){delete t._domEvent[`${e}Handler`];return}const o=t._domEvent[`${e}Handler`].findIndex(l=>l[0]===i);if(o!==-1&&(t._domEvent[`${e}Handler`].splice(o,1),t._domEvent[`${e}Handler`].length===0&&delete t._domEvent[`${e}Handler`],t._domEvent&&Object.keys(t._domEvent).length===0&&delete t._domEvent,!t._domEvent)){const l=(r=this.boundObject[e])==null?void 0:r.findIndex(c=>c===t);l!==-1&&((a=this.boundObject[e])==null||a.splice(l,1))}}clear(){this.boundObject={}}dispose(){var t;(t=this.five)==null||t.off("wantsGesture",this.handleWantsGesture),document.removeEventListener("mousedown",this.handleMousedown),document.removeEventListener("touchstart",this.handleTouchStart),document.removeEventListener("mouseup",this.handleMouseup),document.removeEventListener("mousemove",this.handleMousemove),this.boundObject={}}toJSON(){return{boundObject:this.boundObject}}getRaycaster(t){const e=this.five.getElement();if(!e)return;const i=xh(t,e),s=new ia;return s.setFromCamera(i,this.five.camera),s}}function jv(n){return n.model?n.work?n.model.loaded?n.model.name!==n.work.model.file?{result:!1,msg:"five.model.name 与 five.work.model.file 不一致"}:{result:!0,msg:""}:{result:!1,msg:"five.model 未加载完成"}:{result:!1,msg:"five 数据未加载"}:{result:!1,msg:"five.model 不存在"}}function Dh(n){return/^https?:\/\/|^\/\//.test(n)||/^data:/.test(n)}function ma(n,t){return Dh(t)?t:`${n}${t}`}class Dn extends wo{constructor(){super(...arguments);d(this,"disposeMethods",[]);d(this,"animationFrameDisposer");d(this,"onDispose",e=>(this.disposeMethods.push(e),this));d(this,"play",()=>{var e;return this.start(0),(e=this.animationFrameDisposer)==null||e.call(this),this.animationFrameDisposer=Ln(i=>this.update(i)),this});d(this,"stop",()=>{var e;return super.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this});d(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(i=>i()),this.disposeMethods=[],ih(this)})}}function Ls(n,t=ti.Linear.None){const e=new Dn({progress:0}).to({progress:1});return n!==void 0&&e.duration(n),t!==void 0&&e.easing(t),e}const Sn=window.requestAnimationFrame||(n=>setTimeout(n,16)),Ov=window.cancelAnimationFrame||clearTimeout;function Ts(n,t=0){t<=0?Sn(n):Sn(()=>Ts(n,t-1))}function Vv(){return H(this,null,function*(){return new Promise(n=>{Sn(()=>n())})})}function Ln(n,t=60){let e=-1,i=0,s=-1;const o=1e3/t;function r(a){s===-1&&(s=a),e=Sn(r),!(a-i<o)&&(i=a,n==null||n(a-s))}return e=Sn(r),function(){Ov(e)}}function Bv(){const n=Date.now();return new Promise(t=>{Sn(()=>{t(Date.now()-n)})})}function zo(n){return Object.prototype.toString.call(n)==="[object Object]"}function jo(n,t){return n===t?!0:typeof n!=typeof t?!1:!!(Number.isNaN(n)&&Number.isNaN(t))}function _v(n,t){const e=Object.getOwnPropertyNames(n),i=Object.getOwnPropertyNames(t);if(e.length!==i.length)return!1;for(let s=0,o=e.length;s<o;s++){const r=e[s];if(!jo(n[r],t[r]))return!1}return!0}function Rv(n,t){if(n.length!==t.length)return!1;for(let e=0,i=n.length;e<i;e++)if(!jo(n[e],t[e]))return!1;return!0}function Fv(n,t){return jo(n,t)?!0:zo(n)&&zo(t)?_v(n,t):Array.isArray(n)&&Array.isArray(t)?Rv(n,t):!1}function ga(n,t){return jo(n,t)?!0:zo(n)&&zo(t)?Gv(n,t):Array.isArray(n)&&Array.isArray(t)?Nv(n,t):!1}function Nv(n,t){if(n.length!==t.length)return!1;for(let e=0,i=n.length;e<i;e++)if(!ga(n[e],t[e]))return!1;return!0}function Gv(n,t){const e=Object.getOwnPropertyNames(n),i=Object.getOwnPropertyNames(t);if(e.length!==i.length)return!1;for(let s=0,o=e.length;s<o;s++){const r=e[s];if(!ga(n[r],t[r]))return!1}return!0}function wt(n,t,e={deep:!1}){return e.deep?ga(n,t):Fv(n,t)}const Qv=new b.Vector2;class Wv{constructor(t,e){d(this,"scene",new b.Scene);d(this,"five");d(this,"renderer");d(this,"cancelRequestAnimationFrameId");d(this,"camera",new b.Camera);d(this,"domInited",!1);d(this,"canvasWrapper");d(this,"params");d(this,"_rendererCache");d(this,"_cameraCache");d(this,"animate",()=>{var s,o,r;if(this.cancelRequestAnimationFrameId=requestAnimationFrame(this.animate),!this.five.renderer)return;const t=this.five.renderer.getSize(Qv),e=t.toArray().join(",");e!==this._rendererCache&&(this._rendererCache=e,this.renderer.setSize(t.x,t.y));const i=this.five.camera.projectionMatrix.toArray().join(",")+this.five.camera.matrixWorld.toArray().join(",");if(i!==this._cameraCache&&(this._cameraCache=i,this.camera.copy(this.five.camera)),this.renderer.render(this.scene,this.camera),!this.domInited){const a=(s=this.five.getElement())==null?void 0:s.parentElement;a&&(this.canvasWrapper=document.createElement("div"),this.canvasWrapper.classList.add("five-puppet"),this.canvasWrapper.style.position="absolute",this.canvasWrapper.style.pointerEvents="none",this.canvasWrapper.style.left="0",this.canvasWrapper.style.top="0",this.canvasWrapper.style.zIndex=`${(r=(o=this.params)==null?void 0:o.zIndex)!=null?r:1}`,this.canvasWrapper.appendChild(this.renderer.domElement),a.appendChild(this.canvasWrapper),this.domInited=!0)}});d(this,"stopAnimate",()=>{this.cancelRequestAnimationFrameId&&cancelAnimationFrame(this.cancelRequestAnimationFrameId)});d(this,"destory",()=>{var t;this.stopAnimate(),this.renderer.dispose(),this.renderer.domElement.remove(),(t=this.canvasWrapper)==null||t.remove()});this.five=t,this.params=e,this.renderer=new Xe.InternalWebGLRenderer({webgl2:!0,pixelRatio:window.devicePixelRatio,backgroundAlpha:0,backgroundColor:0}),this.renderer.domElement.style.pointerEvents="none",this.renderer.setSize(1,1),window.__FIVEPUPPET_DEBUG__=this,this.animate()}}const Sh=1,Lh=`CSS3DObjectPlus@${Sh}`,Hv=.00216,Uv=.003;let Th=class extends We.CSS3DObject{constructor(e){var M,E,S,L,W;if(Dt(e.cornerPoints)&&Dt(e.width))throw new Error("cornerPoints and width cannot be both empty");const i=(M=e.container)!=null?M:document.createElement("div"),s=(E=e.cornerPoints)!=null?E:(()=>{const R=e.width/2;return[new Q.Vector3(-R,R,0),new Q.Vector3(-R,-R,0),new Q.Vector3(R,-R,0),new Q.Vector3(R,R,0)]})(),o=(S=e.ratio)!=null?S:Uv,r=(L=e.dpr)!=null?L:1,a=(W=e.pointerEvents)!=null?W:"auto",l=Math.max(Hv,o),c=s[0].distanceTo(s[1]),h=s[1].distanceTo(s[2]),u=En(c/o*r),f=En(h/o*r),m=Ot(...s);let v;if(l===o)i.style.width=`${u}px`,i.style.height=`${f}px`,v=i;else{const R=document.createElement("div");R.style.width=`${u}px`,R.style.height=`${f}px`,R.style.pointerEvents="none";const U=o/l;i.style.position="absolute",i.style.left="0",i.style.top="0",i.style.width=`${U*u}px`,i.style.height=`${U*f}px`,R.appendChild(i),v=R}super(v);d(this,"version",Sh);d(this,"isCSS3DObjectPlus",!0);d(this,"isCSS3DObject",!0);d(this,"name",Lh);d(this,"container");d(this,"width");d(this,"height");d(this,"domWidthPx");d(this,"domHeightPx");d(this,"cornerPoints");d(this,"centerPosition");d(this,"ratio");d(this,"mode","front");d(this,"hooks",new ht);d(this,"opacityMesh");d(this,"selfVisible",!0);d(this,"setVisible",e=>{this.selfVisible=e,this.visible=Kr(this.parent)&&this.selfVisible,this.opacityMesh&&(this.opacityMesh.visible=this.visible)});d(this,"updateVisible",()=>{this.setVisible(this.selfVisible)});d(this,"createOpacityMesh",e=>{const{domWidthPx:i,domHeightPx:s}=e,o=new sh(i,s);return o.position.copy(e.position),o.rotation.copy(e.rotation),o.scale.copy(e.scale),o});if(i.style.pointerEvents=a,Object.assign(i.style,e.style),this.scale.set(l,l,l),this.cornerPoints=s,this.ratio=o,this.container=i,e.mode&&(this.mode=e.mode),l===o)this.width=c,this.height=h,this.domWidthPx=u,this.domHeightPx=f,this.centerPosition=m;else{const R=o/l;this.width=R*c,this.height=R*h,this.domWidthPx=R*u,this.domHeightPx=R*f,this.centerPosition=new Q.Vector3().subVectors(m,s[0]).multiplyScalar(R).add(s[0])}i.classList.add(`${Lh}__container`);const p=new Q.Vector3().subVectors(s[1],s[0]),g=new Q.Vector3().subVectors(s[3],s[0]),A=new Q.Vector3().crossVectors(p,g).normalize();this.lookAt(A);const w=this.up.clone().applyQuaternion(this.quaternion),I=g.clone(),C=new Q.Vector3().crossVectors(w,I).normalize();this.rotateOnWorldAxis(C,w.angleTo(I)),this.position.copy(m),this.addEventListener("added",()=>{var R;this.mode==="front"&&((R=this.opacityMesh)==null||R.removeFromParent())}),this.addEventListener("removed",()=>{var R;(R=this.opacityMesh)==null||R.removeFromParent()})}removeFromParent(){var i;const e=this.parent;return e!==null&&e.remove(this),(i=this.opacityMesh)==null||i.removeFromParent(),this}removeOpacityMesh(){var e;return(e=this.opacityMesh)==null||e.removeFromParent(),this.opacityMesh=void 0,this}dispose(){var e;this.container.remove(),this.removeFromParent(),(e=this.opacityMesh)==null||e.removeFromParent()}getOpacityMesh(){if(this.opacityMesh)return this.opacityMesh;{const e=this.createOpacityMesh(this);return this.opacityMesh=e,e}}applyMatrix4(e){var i;super.applyMatrix4(e),(i=this.opacityMesh)==null||i.applyMatrix4(e)}applyQuaternion(e){var i;return super.applyQuaternion(e),(i=this.opacityMesh)==null||i.applyQuaternion(e),this}applyScaleMatrix4(e){var i;this.scale.applyMatrix4(e),(i=this.opacityMesh)==null||i.scale.applyMatrix4(e)}};function Tn(n){const t=[];return Ai(n).forEach(i=>{i.traverse(s=>{(s.isCSS3DObjectPlus||s.isCSS3DObject||s.isCSS3DSprite)&&t.push(s)})}),t}class Yv extends b.Scene{constructor(){super()}add(...t){return super.add(...t),Tn(t).forEach(e=>{e.mode="front"}),this}}class Xv extends b.Scene{constructor(e){super();d(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return super.add(...e),Tn(e).forEach(i=>{i.mode="behind",this.scene.add(i.getOpacityMesh())}),this}remove(...e){return Tn(e).forEach(i=>{var s;(s=i.opacityMesh)==null||s.removeFromParent(),i.opacityMesh=null}),super.remove(...e),this}}class zh extends b.Group{constructor(e){super();d(this,"isCSS3DGroup",!0);d(this,"mode");d(this,"CSS3DObjectLength",0);this.mode=e}add(...e){return Tn(e).forEach(i=>{i.mode=this.mode}),super.add(...e),this.updateLength(),this}setVisible(e){this.visible=e,this.traverse(i=>{i.isCSS3DObjectPlus&&i.updateVisible()})}remove(...e){return super.remove(...e),this.updateLength(),this}updateLength(){this.CSS3DObjectLength=Tn(this).length}}class Zv extends zh{constructor(){super("front")}}class Jv extends zh{constructor(e){super("behind");d(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return Tn(e).forEach(i=>{this.scene.add(i.getOpacityMesh())}),super.add(...e),this}}const qv=3,pa="CSS3DRenderer",zs=`${pa}@${qv}`,zn=()=>{console.error(`${zs} is disposed`)},ot={css3DObjects:[],frontModeStore:{css3DRenderer:new Ps},behindModeStore:{css3DRenderer:new Ps}};function jh(n){return ot.css3DObjects.find(t=>t.id===n)}function Kv(n){ot.frontModeStore.css3DRenderer.setWrapper(n)}function $v(n){ot.behindModeStore.css3DRenderer.setWrapper(n)}class jn{constructor(t){d(this,"hooks",new ht);d(this,"state",{enabled:!0,visible:!0,disposed:!1});d(this,"_scene");d(this,"store",{frontModeGroup:new Zv});d(this,"create3DElement",(t,e,i)=>{if(this.state.disposed)return zn();const s=(()=>{const M={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none",wrapperStyle:{}};return Object.assign(M,i)})(),o=e.map(De);if((o==null?void 0:o.length)<4)return console.error(`${zs}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:h,pointerEvents:u,wrapperStyle:f}=s;let m=!1;const v=this.createObject(o,{ratio:r,dpr:a,container:h,mode:l,pointerEvents:u,wrapperStyle:f});ot.css3DObjects.push(v),s.scene&&this.setScene(s.scene);const p=()=>{if(m)return;const M=v.mode==="front"?this.getFrontCSS3DObjectGroup():this.getBehindCSS3DObjectGroup();M&&M.add(v)},g=()=>{m||(p(),this.render(t),this.hooks.emit("render"))},A=M=>this.setVisibleById(v.id,M),w=M=>this.setEnabledById(v.id,M),I=()=>(m=!0,v.removeFromParent(),!0),C=l==="front"?ot.frontModeStore.css3DRenderer:ot.behindModeStore.css3DRenderer;return c&&g(),{id:v.uuid,container:h,css3DObject:v,render:c?void 0:g,show:()=>A(!0),hide:()=>A(!1),setVisible:A,enable:()=>w(!0),disable:()=>w(!1),setEnabled:w,dispose:I,appendToElement:M=>C.setWrapper(M)}});d(this,"setVisibleById",(t,e)=>{var i;(i=jh(t))==null||i.setVisible(e)});d(this,"setEnabledById",(t,e)=>{const i=jh(t);if(!i)return;const s=i.mode==="front"?this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}):this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1});s&&(e?s.add(i):s.remove(i))});d(this,"createObject",(t,e)=>{const i=new Th(ie(x({cornerPoints:t},e),{style:e.wrapperStyle}));return i.element.classList.add(`${pa}__container`),i.element.id=`${pa}__container--${i.uuid}`,i});t&&this.setScene(t)}get scene(){return this._scene||console.error("scene doesn't exist!, please call setScene(scene) first"),this._scene}static get frontModeCSS3DRenderer(){return ot.frontModeStore.css3DRenderer}static get behindModeCSS3DRenderer(){return ot.behindModeStore.css3DRenderer}get frontModeCSS3DRenderer(){return ot.frontModeStore.css3DRenderer}get behindModeCSS3DRenderer(){return ot.behindModeStore.css3DRenderer}setScene(t){this._scene=t}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return zn();const i=x({},this.state);this.state=Object.assign(this.state,t),i.visible!==this.state.visible&&(t.visible?this.handleShow():this.handleHide()),i.enabled!==this.state.enabled&&(t.enabled?this.handleEnable():this.handleDisable()),i.disposed!==this.state.disposed&&this.handleDispose(),this.hooks.emit("stateChange",{state:this.state,prevState:i,userAction:e.userAction})}dispose(){this.setState({disposed:!0}),this.hooks.emit("dispose")}show(){return H(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return zn();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})})}hide(){return H(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return zn();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return zn();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return zn();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}getFrontCSS3DScene({createSceneIfNotExists:t=!1}={}){var i;const e=(i=ot.frontModeStore)==null?void 0:i.css3DScene;if(e)return e;if(t){const s=new Yv;ot.frontModeStore.css3DScene=s}return ot.frontModeStore.css3DScene}getBehindCSS3DScene({createSceneIfNotExists:t=!1}={}){var i,s;const e=(i=ot.behindModeStore)==null?void 0:i.css3DScene;if(e)return e;if(t){const o=(s=ot.behindModeStore.scene)!=null?s:this.scene;if(!o){console.error(`${zs}: scene is required when mode is behind`);return}const r=new Xv(o);ot.behindModeStore.css3DScene=r,ot.behindModeStore.scene=o}return ot.behindModeStore.css3DScene}getFrontCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){const e=this.getFrontCSS3DScene({createSceneIfNotExists:t});return t&&e&&(e.getObjectById(this.store.frontModeGroup.id)||e.add(this.store.frontModeGroup)),this.store.frontModeGroup}getBehindCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){var i;const e=this.getBehindCSS3DScene({createSceneIfNotExists:t});if(t&&e&&this.scene){const s=(i=this.store.behindModeGroup)!=null?i:new Jv(this.scene);this.store.behindModeGroup=s,e.getObjectById(s.id)||e.add(s)}return this.store.behindModeGroup}render(t){var e,i;if(this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}).CSS3DObjectLength>0){const s=this.getFrontCSS3DScene({createSceneIfNotExists:!0});if(!s)return console.error(`${zs}: css3DScene is required when mode is front`);ot.frontModeStore.css3DRenderer.renderEveryFrame(s,t)}if(((i=(e=this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1}))==null?void 0:e.CSS3DObjectLength)!=null?i:0)>0){const s=this.getBehindCSS3DScene({createSceneIfNotExists:!0});if(!s)return console.error(`${zs}: css3DScene is required when mode is behind`);ot.behindModeStore.css3DRenderer.renderEveryFrame(s,t)}}handleShow(){return H(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!0),(t=this.store.behindModeGroup)==null||t.setVisible(!0)})}handleHide(){return H(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!1),(t=this.store.behindModeGroup)==null||t.setVisible(!1)})}handleEnable(){var t,e;(t=this.getFrontCSS3DScene())==null||t.add(this.store.frontModeGroup),this.store.behindModeGroup&&((e=this.getBehindCSS3DScene())==null||e.add(this.store.behindModeGroup))}handleDisable(){var t,e,i;this.store.frontModeGroup.children.forEach(s=>{s instanceof We.CSS3DObject&&s.element instanceof Element&&s.element.parentNode!==null&&s.element.remove()}),(t=this.store.behindModeGroup)==null||t.children.forEach(s=>{s instanceof We.CSS3DObject&&s.element instanceof Element&&s.element.parentNode!==null&&s.element.remove()}),(e=this.getFrontCSS3DScene())==null||e.remove(this.store.frontModeGroup),this.store.behindModeGroup&&((i=this.getBehindCSS3DScene())==null||i.remove(this.store.behindModeGroup))}handleDispose(){this.handleDisable()}}d(jn,"setFrontModeContainer",Kv),d(jn,"setBehindModeContainer",$v);const Yt=document.createElement("div");Yt.classList.add("behindFiveElement"),Yt.style.position="absolute",Yt.style.top="0",Yt.style.left="0",Yt.style.width="100%",Yt.style.height="100%",Yt.style.pointerEvents="none";function va(n){var i,s,o,r,a;const t=(a=(s=Aa(n.getElement()))!=null?s:Aa((i=n.getElement())==null?void 0:i.parentElement))!=null?a:Aa((r=(o=n.getElement())==null?void 0:o.parentElement)==null?void 0:r.parentElement),e=t==null?void 0:t.parentElement;if(e)return e.contains(Yt)||t.parentElement.insertBefore(Yt,t),Yt;console.error("Can not find a valid element to insert behindFiveElement. How to fix it: https://github.com/realsee-developer/dnalogel/tree/main/plugins/src/CSS3DRenderPlugin/README.md")}function Aa(n){var a;if(!n)return;const t=(a=n.style.position)!=null?a:getComputedStyle(n).position;if(t!=="fixed"&&t!=="absolute"&&t!=="relative")return;const e=getComputedStyle(n),i=e.backgroundColor,s=e.backgroundImage;if(!(i!=="transparent"&&i!=="rgba(0, 0, 0, 0)"&&i!==""||s!=="none"&&s!==""))return n}const Oh="v2.0.1",Vh=`CSS3DRenderPlugin@${Oh}`;let e0=class extends jn{constructor(e){super();d(this,"five");d(this,"behindFiveContainer");d(this,"frontFiveContainer");d(this,"VERSION",Oh);d(this,"staticPrefix","//vr-image-4.realsee-cdn.cn");d(this,"created3DElementResults",[]);d(this,"create3DDomContainer",(e,i)=>{if(this.state.disposed)return;const s=(()=>{var u;(i==null?void 0:i.dpr)!==void 0&&console.warn(`${Vh}: please use "config.devicePixelRatio" replace "config.dpr"`);const h={ratio:.00216,devicePixelRatio:(u=i==null?void 0:i.dpr)!=null?u:1,mode:"front",autoRender:!0,wrapperStyle:{}};return Object.assign(h,i,(i==null?void 0:i.mode)==="behind"?{scene:this.five.scene}:void 0)})(),{autoRender:o}=s;s.mode==="behind"&&s.behindFiveContainer&&(this.behindFiveContainer=s.behindFiveContainer);const r=this.create3DElement(this.five.camera,e,ie(x({},s),{autoRender:!1}));if(!r)return;const a=r.dispose;r.dispose=()=>(this.created3DElementResults.includes(r)&&this.created3DElementResults.splice(this.created3DElementResults.indexOf(r),1),a());const l=()=>{var u,f;const h=r.css3DObject.mode==="front"?(f=this.frontFiveContainer)!=null?f:(u=this.five.getElement())==null?void 0:u.parentElement:this.getBehindFiveElement();if(!h)return console.error(`${Vh}: wrapper is ${h}; mode is ${r.css3DObject.mode}`);r.appendToElement(h),r.render(),this.created3DElementResults.push(r)},c=()=>{r.css3DObject.mode==="front"&&l(),r.css3DObject.mode==="behind"&&ni(this.five).then(()=>l())};return o&&c(),ie(x({},r),{render:o?void 0:c})});this.five=e}disposeAll(){return this.dispose()}setState(...e){const i=super.setState(...e);return this.five.needsRender=!0,i}appendToFrontFiveContainer(e){this.frontFiveContainer=e,this.created3DElementResults.forEach(i=>{i.css3DObject.mode==="front"&&i.appendToElement(e)})}appendToBehindFiveContainer(e){this.behindFiveContainer=e,this.created3DElementResults.forEach(i=>{i.css3DObject.mode==="behind"&&i.appendToElement(e)})}getBehindFiveElement(){return this.behindFiveContainer?this.behindFiveContainer:(this.behindFiveContainer=va(this.five),this.behindFiveContainer)}absoluteUrl(e){return ma(this.staticPrefix,e)}clear(){this.created3DElementResults.forEach(e=>{e.dispose()}),this.created3DElementResults=[]}};const Oo=n=>new e0(n);class Bh extends yt.Line{constructor(...t){super(...t)}toJSON(){return{type:"FiveLine",points:this.points.toJSON()}}}function ba(n,t,e=new Q.Vector3(1,1,1),i=!1){const s=new Bh(n,t);return s.setMaterial({dashed:i,color:e,linewidth:1}),s.remove(s.points),s}const t0=n=>{const t={intersection:null,disposers:[]},e=h=>{t.intersection=h},i=()=>{t.intersection=null};n.on("modelLoaded",()=>{n.on("intersectionOnModelUpdate",e),n.on("intersectionHidden",i)}),n.on("dispose",()=>{n.off("intersectionOnModelUpdate",e),n.off("intersectionHidden",i)});const s=(h,u=2,f=.1)=>{const m=u/2,p=c(h,f),g=new Q.Group;g.add(ba(new Q.Vector3(p.x+m,p.y,p.z),new Q.Vector3(p.x-m,p.y,p.z),new Q.Vector3(1,0,0)),ba(new Q.Vector3(p.x,p.y+m,p.z),new Q.Vector3(p.x,p.y-m,p.z),new Q.Vector3(0,1,0)),ba(new Q.Vector3(p.x,p.y,p.z+m),new Q.Vector3(p.x,p.y,p.z-m),new Q.Vector3(0,0,1))),n.scene.add(g),n.needsRender=!0;const A=()=>{n.scene.remove(g)};return t.disposers.push(A),{clear:A,pointAxesHelperMesh:g}},o=(h,u=0)=>{var A,w;const f=(A=n==null?void 0:n.camera)==null?void 0:A.position;if(!f)return!1;const m=h.distanceTo(f),v=h.sub(f).normalize(),p=new Q.Raycaster(f,v),g=(w=n.model.intersectRaycaster(p))==null?void 0:w[0];return!(g&&g.distance+u<m)},r=()=>t.intersection,a=()=>{var h,u;(u=(h=t.disposers)==null?void 0:h.forEach)==null||u.call(h,f=>f==null?void 0:f()),n.off("intersectionOnModelUpdate",e),n.off("intersectionHidden",i)},l=a,c=(h,u)=>{const f=h.clone();return n.camera.position.clone().sub(f).setLength(u).add(f)};return{intersection:r,pointAxesHelper:s,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:o}};function $(){}const bi=n=>n;function gt(n,t){for(const e in t)n[e]=t[e];return n}function i0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function _h(n){return n()}function Rh(){return Object.create(null)}function rt(n){n.forEach(_h)}function si(n){return typeof n=="function"}function he(n,t){return n!=n?t==t:n!==t||n&&typeof n=="object"||typeof n=="function"}let Vo;function ft(n,t){return Vo||(Vo=document.createElement("a")),Vo.href=t,n===Vo.href}function n0(n){return Object.keys(n).length===0}function On(n,t,e,i){if(n){const s=Fh(n,t,e,i);return n[0](s)}}function Fh(n,t,e,i){return n[1]&&i?gt(e.ctx.slice(),n[1](i(t))):e.ctx}function Vn(n,t,e,i){if(n[2]&&i){const s=n[2](i(e));if(t.dirty===void 0)return s;if(typeof s=="object"){const o=[],r=Math.max(t.dirty.length,s.length);for(let a=0;a<r;a+=1)o[a]=t.dirty[a]|s[a];return o}return t.dirty|s}return t.dirty}function Bn(n,t,e,i,s,o){if(s){const r=Fh(t,e,i,o);n.p(r,s)}}function _n(n){if(n.ctx.length>32){const t=[],e=n.ctx.length/32;for(let i=0;i<e;i++)t[i]=-1;return t}return-1}function it(n){return n==null?"":n}function Xt(n){return n&&si(n.destroy)?n.destroy:$}function Nh(n){const t=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return t?[parseFloat(t[1]),t[2]||"px"]:[n,"px"]}const Gh=typeof window!="undefined";let ya=Gh?()=>window.performance.now():()=>Date.now(),wa=Gh?n=>requestAnimationFrame(n):$;const Rn=new Set;function Qh(n){Rn.forEach(t=>{t.c(n)||(Rn.delete(t),t.f())}),Rn.size!==0&&wa(Qh)}function Ca(n){let t;return Rn.size===0&&wa(Qh),{promise:new Promise(e=>{Rn.add(t={c:n,f:e})}),abort(){Rn.delete(t)}}}function O(n,t){n.appendChild(t)}function ge(n,t,e){const i=Pa(n);if(!i.getElementById(t)){const s=T("style");s.id=t,s.textContent=e,Wh(i,s)}}function Pa(n){if(!n)return document;const t=n.getRootNode?n.getRootNode():n.ownerDocument;return t&&t.host?t:n.ownerDocument}function s0(n){const t=T("style");return Wh(Pa(n),t),t.sheet}function Wh(n,t){return O(n.head||n,t),t.sheet}function B(n,t,e){n.insertBefore(t,e||null)}function V(n){n.parentNode&&n.parentNode.removeChild(n)}function Zt(n,t){for(let e=0;e<n.length;e+=1)n[e]&&n[e].d(t)}function T(n){return document.createElement(n)}function Ne(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Se(n){return document.createTextNode(n)}function te(){return Se(" ")}function Ee(){return Se("")}function Ce(n,t,e,i){return n.addEventListener(t,e,i),()=>n.removeEventListener(t,e,i)}function o0(n){return function(t){return t.stopPropagation(),n.call(this,t)}}function P(n,t,e){e==null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}function r0(n){return Array.from(n.childNodes)}function Te(n,t){t=""+t,n.data!==t&&(n.data=t)}function z(n,t,e,i){e===null?n.style.removeProperty(t):n.style.setProperty(t,e,i?"important":"")}let Bo;function a0(){if(Bo===void 0){Bo=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(n){Bo=!0}}return Bo}function Ia(n,t){getComputedStyle(n).position==="static"&&(n.style.position="relative");const i=T("iframe");i.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),i.setAttribute("aria-hidden","true"),i.tabIndex=-1;const s=a0();let o;return s?(i.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",o=Ce(window,"message",r=>{r.source===i.contentWindow&&t()})):(i.src="about:blank",i.onload=()=>{o=Ce(i.contentWindow,"resize",t),t()}),O(n,i),()=>{(s||o&&i.contentWindow)&&o(),V(i)}}function ne(n,t,e){n.classList[e?"add":"remove"](t)}function Hh(n,t,{bubbles:e=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,e,i,t),s}class _o{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,e,i=null){this.e||(this.is_svg?this.e=Ne(e.nodeName):this.e=T(e.nodeType===11?"TEMPLATE":e.nodeName),this.t=e.tagName!=="TEMPLATE"?e:e.content,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)B(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(V)}}const Ro=new Map;let Fo=0;function l0(n){let t=5381,e=n.length;for(;e--;)t=(t<<5)-t^n.charCodeAt(e);return t>>>0}function c0(n,t){const e={stylesheet:s0(t),rules:{}};return Ro.set(n,e),e}function No(n,t,e,i,s,o,r,a=0){const l=16.666/i;let c=`{
435
+ `;function Iv(){const n=new b.PlaneGeometry(.4,.4),t=yv,e=new b.TextureLoader().load(t);e.encoding=b.sRGBEncoding,e.minFilter=b.LinearFilter;const i=new b.MeshBasicMaterial({map:e,transparent:!0,depthTest:!1});return new b.Mesh(n,i)}function Mv(){const n=new b.CurvePath;n.add(new b.LineCurve3(new b.Vector3(0,0,0),new b.Vector3(0,0,.1)));const t=new b.TubeGeometry(n,8,.003),e=new b.ShaderMaterial({vertexShader:Cv,fragmentShader:Pv,depthTest:!1,transparent:!0});return new b.Mesh(t,e)}function Ev(){const n=new b.SphereGeometry(.01,20,20),t=new b.MeshBasicMaterial({color:10349931,depthTest:!1,transparent:!0,side:b.DoubleSide}),e=new b.Mesh(n,t);return e.position.set(0,0,.1),e}function kv(){const t=new Th({pointerEvents:"none",cornerPoints:[new b.Vector3(-.2,.2,0),new b.Vector3(-.2,-.2,0),new b.Vector3(.2,-.2,0),new b.Vector3(.2,.2,0)]}),e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e.style.backgroundImage=`url(${Ah})`,e.style.backgroundSize="100%",e.style.backgroundRepeat="no-repeat",t.container.appendChild(e),t}class bh extends b.Object3D{constructor(e){super();d(this,"planeMesh");d(this,"lineMesh");d(this,"ballMesh");d(this,"borderMesh");d(this,"five");this.planeMesh=Iv(),this.lineMesh=Mv(),this.ballMesh=Ev(),this.borderMesh=kv(),this.addEventListener("added",()=>{this.add(this.planeMesh,this.lineMesh,this.ballMesh,this.borderMesh)}),this.addEventListener("removed",()=>{this.remove(this.planeMesh,this.lineMesh,this.ballMesh,this.borderMesh)}),hh(e),this.five=e}updateWithIntersect(e){var s;const i=(s=e==null?void 0:e.face)!=null&&s.normal?new b.Vector3().addVectors(e.point,e.face.normal):this.five.camera.position;this.position.copy(e.point),this.lookAt(i)}show(){this.visible=!0,this.borderMesh.parent||this.add(this.borderMesh)}hide(){this.visible=!1,this.remove(this.borderMesh)}dispose(){var e;(e=this.planeMesh.material.map)==null||e.dispose()}}class yh extends b.Object3D{constructor(){super(...arguments);d(this,"children",[])}getRaycastIntersects(e){const i=[];return this.raycast(e,i),i}getRaycastIntersection(e){return this.getRaycastIntersects(e)[0]}}class wh extends Q.LineSegments{constructor(t,e){super(t,e)}}const ha=new b.Vector3;class xv extends b.Sphere{expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;ha.subVectors(t,this.center);const e=ha.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),s=(i-this.radius)*.5;this.center.addScaledVector(ha,s/i),this.radius+=s}return this}}function Dv(n){const{max:t,min:e}=n;return[new b.Vector3(t.x,t.y,t.z),new b.Vector3(e.x,t.y,t.z),new b.Vector3(e.x,e.y,t.z),new b.Vector3(t.x,e.y,t.z),new b.Vector3(t.x,t.y,e.z),new b.Vector3(e.x,t.y,e.z),new b.Vector3(e.x,e.y,e.z),new b.Vector3(t.x,e.y,e.z)]}function Si(n,t){const{max:e,min:i}=n;switch(t){case 0:return new b.Vector3(e.x,e.y,e.z);case 1:return new b.Vector3(i.x,e.y,e.z);case 2:return new b.Vector3(i.x,i.y,e.z);case 3:return new b.Vector3(e.x,i.y,e.z);case 4:return new b.Vector3(e.x,e.y,i.z);case 5:return new b.Vector3(i.x,e.y,i.z);case 6:return new b.Vector3(i.x,i.y,i.z);case 7:return new b.Vector3(e.x,i.y,i.z)}}function xn(n){return da(n,"box3")}function Ch(n){return da(n,"sphere")}function Sv(n){return Lo(n,"box3")}function Ph(n){return Lo(n,"sphere")}function Lo(n,t){const e=t==="box3"?new b.Box3:new xv,i=new b.Vector3;if(n.updateWorldMatrix(!1,!1),n.traverse(s=>{var r;if(s.name==="shadow"||s.type==="Line2")return;const o=s.geometry;if(s.updateWorldMatrix(!1,!1),o!==void 0){const a=(r=o==null?void 0:o.attributes)==null?void 0:r.position;if(a)for(let l=0,c=a.count;l<c;l++)i.fromBufferAttribute(a,l).applyMatrix4(s.matrixWorld),e.expandByPoint(i);else o.vertices&&o.vertices.forEach(l=>{const c=l.clone().applyMatrix4(s.matrixWorld);e.expandByPoint(c)})}}),!e.isEmpty())return e}function da(n,t){const e=Lo(n,t);return e&&e.applyMatrix4(Lv(n.matrixWorld.clone())),e}const Lv=n=>{const t=n.elements,e=t[0],i=t[1],s=t[2],o=t[3],r=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=t[9],f=t[10],m=t[11],v=t[12],p=t[13],g=t[14],A=t[15],w=u*g*c-p*f*c+p*l*m-a*g*m-u*l*A+a*f*A,I=v*f*c-h*g*c-v*l*m+r*g*m+h*l*A-r*f*A,C=h*p*c-v*u*c+v*a*m-r*p*m-h*a*A+r*u*A,M=v*u*l-h*p*l-v*a*f+r*p*f+h*a*g-r*u*g,E=e*w+i*I+s*C+o*M;if(E===0)return n.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/E;return t[0]=w*S,t[1]=(p*f*o-u*g*o-p*s*m+i*g*m+u*s*A-i*f*A)*S,t[2]=(a*g*o-p*l*o+p*s*c-i*g*c-a*s*A+i*l*A)*S,t[3]=(u*l*o-a*f*o-u*s*c+i*f*c+a*s*m-i*l*m)*S,t[4]=I*S,t[5]=(h*g*o-v*f*o+v*s*m-e*g*m-h*s*A+e*f*A)*S,t[6]=(v*l*o-r*g*o-v*s*c+e*g*c+r*s*A-e*l*A)*S,t[7]=(r*f*o-h*l*o+h*s*c-e*f*c-r*s*m+e*l*m)*S,t[8]=C*S,t[9]=(v*u*o-h*p*o-v*i*m+e*p*m+h*i*A-e*u*A)*S,t[10]=(r*p*o-v*a*o+v*i*c-e*p*c-r*i*A+e*a*A)*S,t[11]=(h*a*o-r*u*o-h*i*c+e*u*c+r*i*m-e*a*m)*S,t[12]=M*S,t[13]=(h*p*s-v*u*s+v*i*f-e*p*f-h*i*g+e*u*g)*S,t[14]=(v*a*s-r*p*s-v*i*l+e*p*l+r*i*g-e*a*g)*S,t[15]=(r*u*s-h*a*s+h*i*l-e*u*l-r*i*f+e*a*f)*S,n},Ut=new Map,xs=new Map;function Tv(n){Ai(n).forEach(e=>{var i,s,o;Ut.has(e)||(e instanceof HTMLElement?Ut.set(e,{opacity:e.style.opacity===""?void 0:e.style.opacity,visible:{display:e.style.display,visibility:e.style.visibility}}):e.isObject3D&&(e.material?e.material instanceof b.ShaderMaterial?Ut.set(e,{opacity:(i=e.material.uniforms.opacity)==null?void 0:i.value,transparent:e.material.transparent,visible:e.visible}):Ut.set(e,{opacity:(s=e.material)==null?void 0:s.opacity,transparent:(o=e.material)==null?void 0:o.transparent,visible:e.visible}):Ut.set(e,{visible:e.visible})))})}function Ih(n){Ai(n).forEach(e=>{const i=Ut.get(e);i&&(e instanceof HTMLElement&&(e.style.opacity=i.opacity===void 0?"":i.opacity,e.style.display=i.visible.display,e.style.visibility=i.visible.visibility),e.isObject3D&&(e.visible=i.visible,e.material&&(e.material instanceof b.ShaderMaterial?(e.material.uniforms.opacity&&(e.material.uniforms.opacity.value=i.opacity),e.material.transparent=i.transparent):(e.material.opacity=i.opacity,e.material.transparent=i.transparent))),Ut.delete(e))})}function To(n,t){var a;const e=(a=t==null?void 0:t.traverseTHREEObject)!=null?a:!0;let i=Ai(n);const s=[];i.forEach(l=>{l&&(l instanceof HTMLElement?s.push(l):l.isObject3D&&(e?(s.push(l),l.traverse(c=>{c&&s.push(c)})):s.push(l)))}),i=[...new Set(s.filter(Boolean))],Tv(i);const o=Xi(x({targets:i,duration:300,easing:"linear",direction:"alternate",loop:4,autoplay:!1,update:l=>{var c;l.animatables.forEach(h=>{var v;const u=h.target;if(!Ut.has(u))return;const m=Number((v=Ut.get(u).opacity)!=null?v:1)*(100-l.progress)/100;u instanceof HTMLElement?u.style.opacity=String(m):u.material&&(u.material instanceof b.ShaderMaterial?(u.material.uniforms.opacity&&(u.material.uniforms.opacity.value=m),u.material.transparent=!0):(u.material.opacity=m,u.material.transparent=!0))}),(c=t==null?void 0:t.updateRender)==null||c.call(t)}},t));o.preComplete=()=>{o!=null&&o.completed||(o==null||o.pause(),Ih(i),setTimeout(()=>{var l;return(l=t==null?void 0:t.updateRender)==null?void 0:l.call(t)}))};const r=xs.get(n);return r==null||r.pause(),r==null||r.seek(0),xs.set(n,o),o.play(),o.finished.then(()=>{var l;Ih(i),setTimeout(()=>{xs.get(n)===o&&xs.delete(n)},1e3),(l=t==null?void 0:t.updateRender)==null||l.call(t)}),o}function Mh(n,t){return To(n,x({update:e=>{var i;e.animatables.forEach(s=>{const o=s.target;if(!Ut.has(o))return;const r=Ut.get(o),l=(Number(r==null?void 0:r.opacity)||Number(t==null?void 0:t.maxOpacity)||1)*(e.progress/100);o instanceof HTMLElement?(o.style.opacity=String(l),o.style.visibility="visible"):o.isObject3D&&(Ai(n).includes(o)&&(o.visible=!0),o.material&&(o.material instanceof b.ShaderMaterial?(o.material.uniforms.opacity&&(o.material.uniforms.opacity.value=l),o.material.transparent=!0):(o.material.opacity=l,o.material.transparent=!0)))}),(i=t==null?void 0:t.updateRender)==null||i.call(t)}},t))}const ua=Math.PI*2;function fa(n){return(n%ua+ua)%ua}function Ds(n){return{longitude:fa(-Math.atan2(n.x,-n.z)),latitude:-Math.asin(n.y/1)}}function zv(n,t,e){return H(this,null,function*(){var w,I,C;if(!t)return;const i=Ph(t);if(!i)return;const s=new Io(n),o=(w=e==null?void 0:e.scale)!=null?w:1.4,r=i.center,a=n.camera.position.clone().sub(r).setY(0).normalize(),l=n.state.mode==="Mapview"?n.state.fov:60,h=Math.max(1.5,i.radius*o),u=h*(1/Math.tan(b.MathUtils.degToRad(l/2)));let f=0;const m=[],v=M=>{const E=b.MathUtils.degToRad(M);return a.clone().applyAxisAngle(new b.Vector3(0,1,0),E).clone().multiplyScalar(u).add(new b.Vector3(0,h,0)).add(r)};for(;f!==360;){let M=0;const E=v(f),S=R=>{const U=R.distanceTo(E),j=new b.Raycaster(R,E.clone().sub(R).normalize()),Y=s.model.intersectRaycaster(j,void 0,!0)[0],N=Y==null?void 0:Y.distance;ke(N)?N>U&&(M+=1):M+=1},L=i.clampPoint(E,new b.Vector3);S(L);const W=new b.Vector3(r.x,E.y,r.z);if(S(W),ke(m[M])&&f>m[M]||(m[M]=f),M===2)break;f+=30}const p=v((C=(I=m[2])!=null?I:m[1])!=null?C:0),g=p.distanceTo(r),A=Ds(r.clone().sub(p).normalize());if(n.state.mode==="Mapview")return n.updateCamera(x({offset:r,distance:g},A),800);n.setState(x({mode:"Mapview",offset:r,distance:g},A)),yield n.ready()})}function Eh(n,t,e){return H(this,null,function*(){var p,g;if(!t)return;const i=(p=e==null?void 0:e.distance)!=null?p:3,s=new Io(n),o=n.camera.position.clone().sub(t).setY(0).normalize(),r=n.state.mode==="Mapview"?n.state.fov:60,a=i,l=a*Math.cos(b.MathUtils.degToRad(r/2)),c=a*Math.sin(b.MathUtils.degToRad(r/2));let h=0;const u=[],f=A=>{const w=b.MathUtils.degToRad(A);return o.clone().applyAxisAngle(new b.Vector3(0,1,0),w).clone().multiplyScalar(l).add(new b.Vector3(0,c,0)).add(t)};for(;h!==360;){let A=0;const w=f(h);if((C=>{const M=C.distanceTo(w),E=new b.Raycaster(C,w.clone().sub(C).normalize()),S=s.model.intersectRaycaster(E,void 0,!0)[0],L=S==null?void 0:S.distance;ke(L)?L>M&&(A+=1):A+=1})(t),u[A]=h,A===1)break;h+=30}const m=f((g=u[1])!=null?g:0),v=Ds(t.clone().sub(m).normalize());if(n.state.mode==="Mapview")return n.updateCamera(x({offset:t,distance:i},v),800);n.setState(x({mode:"Mapview",offset:t,distance:i},v)),yield n.ready()})}function ni(n){return H(this,null,function*(){return new Promise(t=>{if(kh(n))t();else{const e=i=>{const s=Qt(n);i===s&&(n.off("modelLoaded",e),t())};n.on("modelLoaded",e)}})})}function kh(n){var t;return(t=Qt(n))==null?void 0:t.loaded}function xh(n,t){const{top:e,left:i,width:s,height:o}=t.getBoundingClientRect();return new b.Vector2((n.x-i)/s*2-1,-(n.y-e)/o*2+1)}class Ss{constructor(t,e){d(this,"five");d(this,"dragging",!1);d(this,"boundObject",{});d(this,"config");d(this,"lastMouseDownEvent");d(this,"lastTouchEvent");d(this,"handleWantsGesture",(t,e)=>{var s;if(e.length!==1)return;const i=e[0];if(i.raycaster){const o=new ia;o.ray=i.raycaster.ray,o.near=i.raycaster.near,o.far=i.raycaster.far,o.camera=i.raycaster.camera,o.layers=i.raycaster.layers,o.params=i.raycaster.params,i.raycaster=o}if(i){if(t==="mouseMove"&&this.onDomEvent("hover",i),t==="tap"){let o;o||(o=(s=this.lastMouseDownEvent)!=null?s:this.lastTouchEvent),o||(o=new MouseEvent("click",{clientX:i.x,clientY:i.y}));const r=this.onDomEvent("click",i,o),a=this.onDomEvent("wantDblclick",i,o,this.boundObject.dblclick);if(r===!1||a===!1)return!1}if(this.dragging)return!1}});d(this,"handleDomEvent",(t,e,i)=>{const s={x:e.clientX,y:e.clientY};this.onDomEvent(t,s,e,i)});d(this,"handleMouseEvent",t=>{this.handleDomEvent(t.type,t)});d(this,"handleMousedown",t=>{this.lastMouseDownEvent=t,this.handleDomEvent("mousedown",t),this.handleDomEvent("dragstart",t,this.haveDragEventObject)});d(this,"handleTouchStart",t=>{this.lastTouchEvent=t});d(this,"handleMouseup",t=>{var e;this.dragging=!1,(e=this.haveDragEventObject)==null||e.forEach(i=>{i._dragging&&(i._dragging=!1,this.notify({eventName:"dragend",object:i,originEvent:t,raycaster:this.getRaycaster({x:t.clientX,y:t.clientY})}))}),this.handleDomEvent("mouseup",t)});d(this,"handleMousemove",t=>{var e;this.dragging&&((e=this.boundObject.drag)==null||e.forEach(i=>{i._dragging&&this.notify({eventName:"drag",object:i,originEvent:t,raycaster:this.getRaycaster({x:t.clientX,y:t.clientY})})}))});d(this,"onDomEvent",(t,e,i,s=this.boundObject[t])=>{var f,m,v,p,g;if(!e||!s||(s==null?void 0:s.length)===0)return;const o=[];((f=this.config)==null?void 0:f.fiveModels)!==null&&((m=this.config)!=null&&m.fiveModels?o.push(...this.config.fiveModels):o.push(this.model));const r=o.filter(A=>A.loaded),a=(v=e.raycaster)!=null?v:this.getRaycaster(e);a.params.Points.threshold=.02;const l=a.intersectObjects(s,!0),c=[];r.forEach(A=>{const w=A.intersectRaycaster(a);c.push(...w)});const h=.01;if(c.length>0&&l.length>0&&c[0].distance+h<l[0].distance)return;const u=(p=l==null?void 0:l[0])==null?void 0:p.object;if(t==="wantDblclick")return!1;if((!u||!this.objectIsBound(u))&&t==="hover")for(const A of(g=this.boundObject.hover)!=null?g:[])A._hovered&&this.notify({eventName:"unHover",object:A});if(u&&u&&this.notify({eventName:t,object:u,originEvent:i,raycaster:a,intersects:l}))return!1});d(this,"objectIsBound",t=>{let e=t._domEvent,i=t.parent;for(;typeof e=="undefined"&&i;)e=i._domEvent,i=i.parent;return!!e});d(this,"notify",t=>{var v,p,g;const{eventName:e,object:i,originEvent:s,raycaster:o,intersects:r}=t;if(!i)return!1;let a=!1,l=[];const c=[],h=()=>{const A=r.slice(1);return A[0]?this.notify(ie(x({},t),{object:A[0].object,intersects:A})):!1};let u=i;for(c.push(u);u.parent;)u=u.parent,c.push(u);const f=c[c.length-1];if((v=this.config)!=null&&v.noEmitWhenNotInScene&&f.type!=="Scene")return h();let m=!1;for(const A of c){if(a)break;A.draggable&&(e==="dragstart"&&(A._dragging=!0,this.dragging=!0),e==="dragend"&&(A._dragging=!1,this.dragging=!1));const w=A._domEvent;if(!w)continue;const I=w[`${e}Handler`];if(I)for(const[C,M]of I){if(M!=null&&M.noEmitWhenNotInScene&&f.type!=="Scene"||((p=this.config)!=null&&p.noEmitWhenHide||M!=null&&M.noEmitWhenHide)&&!Kr(A))continue;if(m=!0,e==="hover"){if(A._hovered)continue;A._hovered=!0;for(const S of(g=this.boundObject.hover)!=null?g:[])S!==A&&S._hovered&&this.notify({eventName:"unHover",object:S})}if(e==="unHover"){if(!A._hovered)continue;A._hovered=!1}const E=C({type:e,target:A,origDomEvent:s,raycaster:o,intersects:r,stopPropagation:()=>{a=!0}});l.push(E!=null?E:!0)}}if(m===!1)return h();if(e==="click"||e==="wantDblclick")return l.some(A=>A===!0)});this.five=t,this.config=e,t.on("wantsGesture",this.handleWantsGesture),document.addEventListener("mousedown",this.handleMousedown),document.addEventListener("touchstart",this.handleTouchStart),document.addEventListener("dblclick",this.handleMouseEvent),document.addEventListener("mouseup",this.handleMouseup),document.addEventListener("mousemove",this.handleMousemove)}get haveDragEventObject(){return[...new Set([this.boundObject.dragend,this.boundObject.drag,this.boundObject.dragstart].flat())].filter(Boolean)}get model(){return Qt(this.five)}addAutoBindEventListener(t,e,i,s){const o=()=>this.addEventListener(t,e,i,s),r=()=>this.removeEventListener(t,e,i,s);return t.addEventListener("added",o),t.addEventListener("removed",r),t.addEventListener("dispose",r),()=>{t.removeEventListener("added",o),t.removeEventListener("removed",r),t.removeEventListener("dispose",r)}}addEventListener(t,e,i,s){t._domEvent||(t._domEvent={}),t._domEvent[`${e}Handler`]||(t._domEvent[`${e}Handler`]=[]),this.boundObject[e]||(this.boundObject[e]=[]),this.boundObject[e].includes(t)||this.boundObject[e].push(t),t._domEvent[`${e}Handler`].push([i,x({noEmitWhenHide:!1,noEmitWhenNotInScene:!1},s)])}removeEventListener(t,e,i,...s){var r,a;if(!t._domEvent||(e===void 0&&(Object.keys(this.boundObject).forEach(l=>{var h,u;const c=(h=this.boundObject[l])==null?void 0:h.findIndex(f=>f===t);c!==-1&&((u=this.boundObject[l])==null||u.splice(c,1))}),t._domEvent={}),!t._domEvent[`${e}Handler`]))return;if(i===void 0){delete t._domEvent[`${e}Handler`];return}const o=t._domEvent[`${e}Handler`].findIndex(l=>l[0]===i);if(o!==-1&&(t._domEvent[`${e}Handler`].splice(o,1),t._domEvent[`${e}Handler`].length===0&&delete t._domEvent[`${e}Handler`],t._domEvent&&Object.keys(t._domEvent).length===0&&delete t._domEvent,!t._domEvent)){const l=(r=this.boundObject[e])==null?void 0:r.findIndex(c=>c===t);l!==-1&&((a=this.boundObject[e])==null||a.splice(l,1))}}clear(){this.boundObject={}}dispose(){var t;(t=this.five)==null||t.off("wantsGesture",this.handleWantsGesture),document.removeEventListener("mousedown",this.handleMousedown),document.removeEventListener("touchstart",this.handleTouchStart),document.removeEventListener("mouseup",this.handleMouseup),document.removeEventListener("mousemove",this.handleMousemove),this.boundObject={}}toJSON(){return{boundObject:this.boundObject}}getRaycaster(t){const e=this.five.getElement();if(!e)return;const i=xh(t,e),s=new ia;return s.setFromCamera(i,this.five.camera),s}}function jv(n){return n.model?n.work?n.model.loaded?n.model.name!==n.work.model.file?{result:!1,msg:"five.model.name 与 five.work.model.file 不一致"}:{result:!0,msg:""}:{result:!1,msg:"five.model 未加载完成"}:{result:!1,msg:"five 数据未加载"}:{result:!1,msg:"five.model 不存在"}}function Dh(n){return/^https?:\/\/|^\/\//.test(n)||/^data:/.test(n)}function ma(n,t){return Dh(t)?t:`${n}${t}`}class Dn extends wo{constructor(){super(...arguments);d(this,"disposeMethods",[]);d(this,"animationFrameDisposer");d(this,"onDispose",e=>(this.disposeMethods.push(e),this));d(this,"play",()=>{var e;return this.start(0),(e=this.animationFrameDisposer)==null||e.call(this),this.animationFrameDisposer=Ln(i=>this.update(i)),this});d(this,"stop",()=>{var e;return super.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this});d(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(i=>i()),this.disposeMethods=[],ih(this)})}}function Ls(n,t=ti.Linear.None){const e=new Dn({progress:0}).to({progress:1});return n!==void 0&&e.duration(n),t!==void 0&&e.easing(t),e}const Sn=window.requestAnimationFrame||(n=>setTimeout(n,16)),Ov=window.cancelAnimationFrame||clearTimeout;function Ts(n,t=0){t<=0?Sn(n):Sn(()=>Ts(n,t-1))}function Vv(){return H(this,null,function*(){return new Promise(n=>{Sn(()=>n())})})}function Ln(n,t=60){let e=-1,i=0,s=-1;const o=1e3/t;function r(a){s===-1&&(s=a),e=Sn(r),!(a-i<o)&&(i=a,n==null||n(a-s))}return e=Sn(r),function(){Ov(e)}}function Bv(){const n=Date.now();return new Promise(t=>{Sn(()=>{t(Date.now()-n)})})}function zo(n){return Object.prototype.toString.call(n)==="[object Object]"}function jo(n,t){return n===t?!0:typeof n!=typeof t?!1:!!(Number.isNaN(n)&&Number.isNaN(t))}function _v(n,t){const e=Object.getOwnPropertyNames(n),i=Object.getOwnPropertyNames(t);if(e.length!==i.length)return!1;for(let s=0,o=e.length;s<o;s++){const r=e[s];if(!jo(n[r],t[r]))return!1}return!0}function Rv(n,t){if(n.length!==t.length)return!1;for(let e=0,i=n.length;e<i;e++)if(!jo(n[e],t[e]))return!1;return!0}function Fv(n,t){return jo(n,t)?!0:zo(n)&&zo(t)?_v(n,t):Array.isArray(n)&&Array.isArray(t)?Rv(n,t):!1}function ga(n,t){return jo(n,t)?!0:zo(n)&&zo(t)?Gv(n,t):Array.isArray(n)&&Array.isArray(t)?Nv(n,t):!1}function Nv(n,t){if(n.length!==t.length)return!1;for(let e=0,i=n.length;e<i;e++)if(!ga(n[e],t[e]))return!1;return!0}function Gv(n,t){const e=Object.getOwnPropertyNames(n),i=Object.getOwnPropertyNames(t);if(e.length!==i.length)return!1;for(let s=0,o=e.length;s<o;s++){const r=e[s];if(!ga(n[r],t[r]))return!1}return!0}function wt(n,t,e={deep:!1}){return e.deep?ga(n,t):Fv(n,t)}const Qv=new b.Vector2;class Wv{constructor(t,e){d(this,"scene",new b.Scene);d(this,"five");d(this,"renderer");d(this,"cancelRequestAnimationFrameId");d(this,"camera",new b.Camera);d(this,"domInited",!1);d(this,"canvasWrapper");d(this,"params");d(this,"_rendererCache");d(this,"_cameraCache");d(this,"animate",()=>{var s,o,r;if(this.cancelRequestAnimationFrameId=requestAnimationFrame(this.animate),!this.five.renderer)return;const t=this.five.renderer.getSize(Qv),e=t.toArray().join(",");e!==this._rendererCache&&(this._rendererCache=e,this.renderer.setSize(t.x,t.y));const i=this.five.camera.projectionMatrix.toArray().join(",")+this.five.camera.matrixWorld.toArray().join(",");if(i!==this._cameraCache&&(this._cameraCache=i,this.camera.copy(this.five.camera)),this.renderer.render(this.scene,this.camera),!this.domInited){const a=(s=this.five.getElement())==null?void 0:s.parentElement;a&&(this.canvasWrapper=document.createElement("div"),this.canvasWrapper.classList.add("five-puppet"),this.canvasWrapper.style.position="absolute",this.canvasWrapper.style.pointerEvents="none",this.canvasWrapper.style.left="0",this.canvasWrapper.style.top="0",this.canvasWrapper.style.zIndex=`${(r=(o=this.params)==null?void 0:o.zIndex)!=null?r:1}`,this.canvasWrapper.appendChild(this.renderer.domElement),a.appendChild(this.canvasWrapper),this.domInited=!0)}});d(this,"stopAnimate",()=>{this.cancelRequestAnimationFrameId&&cancelAnimationFrame(this.cancelRequestAnimationFrameId)});d(this,"destory",()=>{var t;this.stopAnimate(),this.renderer.dispose(),this.renderer.domElement.remove(),(t=this.canvasWrapper)==null||t.remove()});this.five=t,this.params=e,this.renderer=new Xe.InternalWebGLRenderer({webgl2:!0,pixelRatio:window.devicePixelRatio,backgroundAlpha:0,backgroundColor:0}),this.renderer.domElement.style.pointerEvents="none",this.renderer.setSize(1,1),window.__FIVEPUPPET_DEBUG__=this,this.animate()}}const Sh=1,Lh=`CSS3DObjectPlus@${Sh}`,Hv=.00216,Uv=.003;let Th=class extends We.CSS3DObject{constructor(e){var M,E,S,L,W;if(Dt(e.cornerPoints)&&Dt(e.width))throw new Error("cornerPoints and width cannot be both empty");const i=(M=e.container)!=null?M:document.createElement("div"),s=(E=e.cornerPoints)!=null?E:(()=>{const R=e.width/2;return[new Q.Vector3(-R,R,0),new Q.Vector3(-R,-R,0),new Q.Vector3(R,-R,0),new Q.Vector3(R,R,0)]})(),o=(S=e.ratio)!=null?S:Uv,r=(L=e.dpr)!=null?L:1,a=(W=e.pointerEvents)!=null?W:"auto",l=Math.max(Hv,o),c=s[0].distanceTo(s[1]),h=s[1].distanceTo(s[2]),u=En(c/o*r),f=En(h/o*r),m=Ot(...s);let v;if(l===o)i.style.width=`${u}px`,i.style.height=`${f}px`,v=i;else{const R=document.createElement("div");R.style.width=`${u}px`,R.style.height=`${f}px`,R.style.pointerEvents="none";const U=o/l;i.style.position="absolute",i.style.left="0",i.style.top="0",i.style.width=`${U*u}px`,i.style.height=`${U*f}px`,R.appendChild(i),v=R}super(v);d(this,"version",Sh);d(this,"isCSS3DObjectPlus",!0);d(this,"isCSS3DObject",!0);d(this,"name",Lh);d(this,"container");d(this,"width");d(this,"height");d(this,"domWidthPx");d(this,"domHeightPx");d(this,"cornerPoints");d(this,"centerPosition");d(this,"ratio");d(this,"mode","front");d(this,"hooks",new ht);d(this,"opacityMesh");d(this,"selfVisible",!0);d(this,"setVisible",e=>{this.selfVisible=e,this.visible=Kr(this.parent)&&this.selfVisible,this.opacityMesh&&(this.opacityMesh.visible=this.visible)});d(this,"updateVisible",()=>{this.setVisible(this.selfVisible)});d(this,"createOpacityMesh",e=>{const{domWidthPx:i,domHeightPx:s}=e,o=new sh(i,s);return o.position.copy(e.position),o.rotation.copy(e.rotation),o.scale.copy(e.scale),o});if(i.style.pointerEvents=a,Object.assign(i.style,e.style),this.scale.set(l,l,l),this.cornerPoints=s,this.ratio=o,this.container=i,e.mode&&(this.mode=e.mode),l===o)this.width=c,this.height=h,this.domWidthPx=u,this.domHeightPx=f,this.centerPosition=m;else{const R=o/l;this.width=R*c,this.height=R*h,this.domWidthPx=R*u,this.domHeightPx=R*f,this.centerPosition=new Q.Vector3().subVectors(m,s[0]).multiplyScalar(R).add(s[0])}i.classList.add(`${Lh}__container`);const p=new Q.Vector3().subVectors(s[1],s[0]),g=new Q.Vector3().subVectors(s[3],s[0]),A=new Q.Vector3().crossVectors(p,g).normalize();this.lookAt(A);const w=this.up.clone().applyQuaternion(this.quaternion),I=g.clone(),C=new Q.Vector3().crossVectors(w,I).normalize();this.rotateOnWorldAxis(C,w.angleTo(I)),this.position.copy(m),this.addEventListener("added",()=>{var R;this.mode==="front"&&((R=this.opacityMesh)==null||R.removeFromParent())}),this.addEventListener("removed",()=>{var R;(R=this.opacityMesh)==null||R.removeFromParent()})}removeFromParent(){var i;const e=this.parent;return e!==null&&e.remove(this),(i=this.opacityMesh)==null||i.removeFromParent(),this}removeOpacityMesh(){var e;return(e=this.opacityMesh)==null||e.removeFromParent(),this.opacityMesh=void 0,this}dispose(){var e;this.container.remove(),this.removeFromParent(),(e=this.opacityMesh)==null||e.removeFromParent()}getOpacityMesh(){if(this.opacityMesh)return this.opacityMesh;{const e=this.createOpacityMesh(this);return this.opacityMesh=e,e}}applyMatrix4(e){var i;super.applyMatrix4(e),(i=this.opacityMesh)==null||i.applyMatrix4(e)}applyQuaternion(e){var i;return super.applyQuaternion(e),(i=this.opacityMesh)==null||i.applyQuaternion(e),this}applyScaleMatrix4(e){var i;this.scale.applyMatrix4(e),(i=this.opacityMesh)==null||i.scale.applyMatrix4(e)}};function Tn(n){const t=[];return Ai(n).forEach(i=>{i.traverse(s=>{(s.isCSS3DObjectPlus||s.isCSS3DObject||s.isCSS3DSprite)&&t.push(s)})}),t}class Yv extends b.Scene{constructor(){super()}add(...t){return super.add(...t),Tn(t).forEach(e=>{e.mode="front"}),this}}class Xv extends b.Scene{constructor(e){super();d(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return super.add(...e),Tn(e).forEach(i=>{i.mode="behind",this.scene.add(i.getOpacityMesh())}),this}remove(...e){return Tn(e).forEach(i=>{var s;(s=i.opacityMesh)==null||s.removeFromParent(),i.opacityMesh=null}),super.remove(...e),this}}class zh extends b.Group{constructor(e){super();d(this,"isCSS3DGroup",!0);d(this,"mode");d(this,"CSS3DObjectLength",0);this.mode=e}add(...e){return Tn(e).forEach(i=>{i.mode=this.mode}),super.add(...e),this.updateLength(),this}setVisible(e){this.visible=e,this.traverse(i=>{i.isCSS3DObjectPlus&&i.updateVisible()})}remove(...e){return super.remove(...e),this.updateLength(),this}updateLength(){this.CSS3DObjectLength=Tn(this).length}}class Zv extends zh{constructor(){super("front")}}class Jv extends zh{constructor(e){super("behind");d(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return Tn(e).forEach(i=>{this.scene.add(i.getOpacityMesh())}),super.add(...e),this}}const qv=3,pa="CSS3DRenderer",zs=`${pa}@${qv}`,zn=()=>{console.error(`${zs} is disposed`)},ot={css3DObjects:[],frontModeStore:{css3DRenderer:new Ps},behindModeStore:{css3DRenderer:new Ps}};function jh(n){return ot.css3DObjects.find(t=>t.id===n)}function Kv(n){ot.frontModeStore.css3DRenderer.setWrapper(n)}function $v(n){ot.behindModeStore.css3DRenderer.setWrapper(n)}class jn{constructor(t){d(this,"hooks",new ht);d(this,"state",{enabled:!0,visible:!0,disposed:!1});d(this,"_scene");d(this,"store",{frontModeGroup:new Zv});d(this,"create3DElement",(t,e,i)=>{if(this.state.disposed)return zn();const s=(()=>{const M={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none",wrapperStyle:{}};return Object.assign(M,i)})(),o=e.map(De);if((o==null?void 0:o.length)<4)return console.error(`${zs}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:h,pointerEvents:u,wrapperStyle:f}=s;let m=!1;const v=this.createObject(o,{ratio:r,dpr:a,container:h,mode:l,pointerEvents:u,wrapperStyle:f});ot.css3DObjects.push(v),s.scene&&this.setScene(s.scene);const p=()=>{if(m)return;const M=v.mode==="front"?this.getFrontCSS3DObjectGroup():this.getBehindCSS3DObjectGroup();M&&M.add(v)},g=()=>{m||(p(),this.render(t),this.hooks.emit("render"))},A=M=>this.setVisibleById(v.id,M),w=M=>this.setEnabledById(v.id,M),I=()=>(m=!0,v.removeFromParent(),!0),C=l==="front"?ot.frontModeStore.css3DRenderer:ot.behindModeStore.css3DRenderer;return c&&g(),{id:v.uuid,container:h,css3DObject:v,render:c?void 0:g,show:()=>A(!0),hide:()=>A(!1),setVisible:A,enable:()=>w(!0),disable:()=>w(!1),setEnabled:w,dispose:I,appendToElement:M=>C.setWrapper(M)}});d(this,"setVisibleById",(t,e)=>{var i;(i=jh(t))==null||i.setVisible(e)});d(this,"setEnabledById",(t,e)=>{const i=jh(t);if(!i)return;const s=i.mode==="front"?this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}):this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1});s&&(e?s.add(i):s.remove(i))});d(this,"createObject",(t,e)=>{const i=new Th(ie(x({cornerPoints:t},e),{style:e.wrapperStyle}));return i.element.classList.add(`${pa}__container`),i.element.id=`${pa}__container--${i.uuid}`,i});t&&this.setScene(t)}get scene(){return this._scene||console.error("scene doesn't exist!, please call setScene(scene) first"),this._scene}static get frontModeCSS3DRenderer(){return ot.frontModeStore.css3DRenderer}static get behindModeCSS3DRenderer(){return ot.behindModeStore.css3DRenderer}get frontModeCSS3DRenderer(){return ot.frontModeStore.css3DRenderer}get behindModeCSS3DRenderer(){return ot.behindModeStore.css3DRenderer}setScene(t){this._scene=t}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return zn();const i=x({},this.state);this.state=Object.assign(this.state,t),i.visible!==this.state.visible&&(t.visible?this.handleShow():this.handleHide()),i.enabled!==this.state.enabled&&(t.enabled?this.handleEnable():this.handleDisable()),i.disposed!==this.state.disposed&&this.handleDispose(),this.hooks.emit("stateChange",{state:this.state,prevState:i,userAction:e.userAction})}dispose(){this.setState({disposed:!0}),this.hooks.emit("dispose")}show(){return H(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return zn();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})})}hide(){return H(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return zn();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return zn();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return zn();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}getFrontCSS3DScene({createSceneIfNotExists:t=!1}={}){var i;const e=(i=ot.frontModeStore)==null?void 0:i.css3DScene;if(e)return e;if(t){const s=new Yv;ot.frontModeStore.css3DScene=s}return ot.frontModeStore.css3DScene}getBehindCSS3DScene({createSceneIfNotExists:t=!1}={}){var i,s;const e=(i=ot.behindModeStore)==null?void 0:i.css3DScene;if(e)return e;if(t){const o=(s=ot.behindModeStore.scene)!=null?s:this.scene;if(!o){console.error(`${zs}: scene is required when mode is behind`);return}const r=new Xv(o);ot.behindModeStore.css3DScene=r,ot.behindModeStore.scene=o}return ot.behindModeStore.css3DScene}getFrontCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){const e=this.getFrontCSS3DScene({createSceneIfNotExists:t});return t&&e&&(e.getObjectById(this.store.frontModeGroup.id)||e.add(this.store.frontModeGroup)),this.store.frontModeGroup}getBehindCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){var i;const e=this.getBehindCSS3DScene({createSceneIfNotExists:t});if(t&&e&&this.scene){const s=(i=this.store.behindModeGroup)!=null?i:new Jv(this.scene);this.store.behindModeGroup=s,e.getObjectById(s.id)||e.add(s)}return this.store.behindModeGroup}render(t){var e,i;if(this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}).CSS3DObjectLength>0){const s=this.getFrontCSS3DScene({createSceneIfNotExists:!0});if(!s)return console.error(`${zs}: css3DScene is required when mode is front`);ot.frontModeStore.css3DRenderer.renderEveryFrame(s,t)}if(((i=(e=this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1}))==null?void 0:e.CSS3DObjectLength)!=null?i:0)>0){const s=this.getBehindCSS3DScene({createSceneIfNotExists:!0});if(!s)return console.error(`${zs}: css3DScene is required when mode is behind`);ot.behindModeStore.css3DRenderer.renderEveryFrame(s,t)}}handleShow(){return H(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!0),(t=this.store.behindModeGroup)==null||t.setVisible(!0)})}handleHide(){return H(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!1),(t=this.store.behindModeGroup)==null||t.setVisible(!1)})}handleEnable(){var t,e;(t=this.getFrontCSS3DScene())==null||t.add(this.store.frontModeGroup),this.store.behindModeGroup&&((e=this.getBehindCSS3DScene())==null||e.add(this.store.behindModeGroup))}handleDisable(){var t,e,i;this.store.frontModeGroup.children.forEach(s=>{s instanceof We.CSS3DObject&&s.element instanceof Element&&s.element.parentNode!==null&&s.element.remove()}),(t=this.store.behindModeGroup)==null||t.children.forEach(s=>{s instanceof We.CSS3DObject&&s.element instanceof Element&&s.element.parentNode!==null&&s.element.remove()}),(e=this.getFrontCSS3DScene())==null||e.remove(this.store.frontModeGroup),this.store.behindModeGroup&&((i=this.getBehindCSS3DScene())==null||i.remove(this.store.behindModeGroup))}handleDispose(){this.handleDisable()}}d(jn,"setFrontModeContainer",Kv),d(jn,"setBehindModeContainer",$v);const Yt=document.createElement("div");Yt.classList.add("behindFiveElement"),Yt.style.position="absolute",Yt.style.top="0",Yt.style.left="0",Yt.style.width="100%",Yt.style.height="100%",Yt.style.pointerEvents="none";function va(n){var i,s,o,r,a;const t=(a=(s=Aa(n.getElement()))!=null?s:Aa((i=n.getElement())==null?void 0:i.parentElement))!=null?a:Aa((r=(o=n.getElement())==null?void 0:o.parentElement)==null?void 0:r.parentElement),e=t==null?void 0:t.parentElement;if(e)return e.contains(Yt)||t.parentElement.insertBefore(Yt,t),Yt;console.error("Can not find a valid element to insert behindFiveElement. How to fix it: https://github.com/realsee-developer/dnalogel/tree/main/plugins/src/CSS3DRenderPlugin/README.md")}function Aa(n){var a;if(!n)return;const t=(a=n.style.position)!=null?a:getComputedStyle(n).position;if(t!=="fixed"&&t!=="absolute"&&t!=="relative")return;const e=getComputedStyle(n),i=e.backgroundColor,s=e.backgroundImage;if(!(i!=="transparent"&&i!=="rgba(0, 0, 0, 0)"&&i!==""||s!=="none"&&s!==""))return n}const Oh="v2.0.1",Vh=`CSS3DRenderPlugin@${Oh}`;let e0=class extends jn{constructor(e){super();d(this,"five");d(this,"behindFiveContainer");d(this,"frontFiveContainer");d(this,"VERSION",Oh);d(this,"staticPrefix","//vr-image-4.realsee-cdn.cn");d(this,"created3DElementResults",[]);d(this,"create3DDomContainer",(e,i)=>{if(this.state.disposed)return;const s=(()=>{var u;(i==null?void 0:i.dpr)!==void 0&&console.warn(`${Vh}: please use "config.devicePixelRatio" replace "config.dpr"`);const h={ratio:.00216,devicePixelRatio:(u=i==null?void 0:i.dpr)!=null?u:1,mode:"front",autoRender:!0,wrapperStyle:{}};return Object.assign(h,i,(i==null?void 0:i.mode)==="behind"?{scene:this.five.scene}:void 0)})(),{autoRender:o}=s;s.mode==="behind"&&s.behindFiveContainer&&(this.behindFiveContainer=s.behindFiveContainer);const r=this.create3DElement(this.five.camera,e,ie(x({},s),{autoRender:!1}));if(!r)return;const a=r.dispose;r.dispose=()=>(this.created3DElementResults.includes(r)&&this.created3DElementResults.splice(this.created3DElementResults.indexOf(r),1),a());const l=()=>{var u,f;const h=r.css3DObject.mode==="front"?(f=this.frontFiveContainer)!=null?f:(u=this.five.getElement())==null?void 0:u.parentElement:this.getBehindFiveElement();if(!h)return console.error(`${Vh}: wrapper is ${h}; mode is ${r.css3DObject.mode}`);r.appendToElement(h),r.render(),this.created3DElementResults.push(r)},c=()=>{r.css3DObject.mode==="front"&&l(),r.css3DObject.mode==="behind"&&ni(this.five).then(()=>l())};return o&&c(),ie(x({},r),{render:o?void 0:c})});this.five=e}disposeAll(){return this.dispose()}setState(...e){const i=super.setState(...e);return this.five.needsRender=!0,i}appendToFrontFiveContainer(e){this.frontFiveContainer=e,this.created3DElementResults.forEach(i=>{i.css3DObject.mode==="front"&&i.appendToElement(e)})}appendToBehindFiveContainer(e){this.behindFiveContainer=e,this.created3DElementResults.forEach(i=>{i.css3DObject.mode==="behind"&&i.appendToElement(e)})}getBehindFiveElement(){return this.behindFiveContainer?this.behindFiveContainer:(this.behindFiveContainer=va(this.five),this.behindFiveContainer)}absoluteUrl(e){return ma(this.staticPrefix,e)}clear(){this.created3DElementResults.forEach(e=>{e.dispose()}),this.created3DElementResults=[]}};const Oo=n=>new e0(n);class Bh extends yt.Line{constructor(...t){super(...t)}toJSON(){return{type:"FiveLine",points:this.points.toJSON()}}}function ba(n,t,e=new Q.Vector3(1,1,1),i=!1){const s=new Bh(n,t);return s.setMaterial({dashed:i,color:e,linewidth:1}),s.remove(s.points),s}const t0=n=>{const t={intersection:null,disposers:[]},e=h=>{t.intersection=h},i=()=>{t.intersection=null};n.on("modelLoaded",()=>{n.on("intersectionOnModelUpdate",e),n.on("intersectionHidden",i)}),n.on("dispose",()=>{n.off("intersectionOnModelUpdate",e),n.off("intersectionHidden",i)});const s=(h,u=2,f=.1)=>{const m=u/2,p=c(h,f),g=new Q.Group;g.add(ba(new Q.Vector3(p.x+m,p.y,p.z),new Q.Vector3(p.x-m,p.y,p.z),new Q.Vector3(1,0,0)),ba(new Q.Vector3(p.x,p.y+m,p.z),new Q.Vector3(p.x,p.y-m,p.z),new Q.Vector3(0,1,0)),ba(new Q.Vector3(p.x,p.y,p.z+m),new Q.Vector3(p.x,p.y,p.z-m),new Q.Vector3(0,0,1))),n.scene.add(g),n.needsRender=!0;const A=()=>{n.scene.remove(g)};return t.disposers.push(A),{clear:A,pointAxesHelperMesh:g}},o=(h,u=0)=>{var A,w;const f=(A=n==null?void 0:n.camera)==null?void 0:A.position;if(!f)return!1;const m=h.distanceTo(f),v=h.sub(f).normalize(),p=new Q.Raycaster(f,v),g=(w=n.model.intersectRaycaster(p))==null?void 0:w[0];return!(g&&g.distance+u<m)},r=()=>t.intersection,a=()=>{var h,u;(u=(h=t.disposers)==null?void 0:h.forEach)==null||u.call(h,f=>f==null?void 0:f()),n.off("intersectionOnModelUpdate",e),n.off("intersectionHidden",i)},l=a,c=(h,u)=>{const f=h.clone();return n.camera.position.clone().sub(f).setLength(u).add(f)};return{intersection:r,pointAxesHelper:s,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:o}};function $(){}const bi=n=>n;function gt(n,t){for(const e in t)n[e]=t[e];return n}function i0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function _h(n){return n()}function Rh(){return Object.create(null)}function rt(n){n.forEach(_h)}function si(n){return typeof n=="function"}function he(n,t){return n!=n?t==t:n!==t||n&&typeof n=="object"||typeof n=="function"}let Vo;function ft(n,t){return Vo||(Vo=document.createElement("a")),Vo.href=t,n===Vo.href}function n0(n){return Object.keys(n).length===0}function On(n,t,e,i){if(n){const s=Fh(n,t,e,i);return n[0](s)}}function Fh(n,t,e,i){return n[1]&&i?gt(e.ctx.slice(),n[1](i(t))):e.ctx}function Vn(n,t,e,i){if(n[2]&&i){const s=n[2](i(e));if(t.dirty===void 0)return s;if(typeof s=="object"){const o=[],r=Math.max(t.dirty.length,s.length);for(let a=0;a<r;a+=1)o[a]=t.dirty[a]|s[a];return o}return t.dirty|s}return t.dirty}function Bn(n,t,e,i,s,o){if(s){const r=Fh(t,e,i,o);n.p(r,s)}}function _n(n){if(n.ctx.length>32){const t=[],e=n.ctx.length/32;for(let i=0;i<e;i++)t[i]=-1;return t}return-1}function it(n){return n==null?"":n}function Xt(n){return n&&si(n.destroy)?n.destroy:$}function Nh(n){const t=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return t?[parseFloat(t[1]),t[2]||"px"]:[n,"px"]}const Gh=typeof window!="undefined";let ya=Gh?()=>window.performance.now():()=>Date.now(),wa=Gh?n=>requestAnimationFrame(n):$;const Rn=new Set;function Qh(n){Rn.forEach(t=>{t.c(n)||(Rn.delete(t),t.f())}),Rn.size!==0&&wa(Qh)}function Ca(n){let t;return Rn.size===0&&wa(Qh),{promise:new Promise(e=>{Rn.add(t={c:n,f:e})}),abort(){Rn.delete(t)}}}function O(n,t){n.appendChild(t)}function ge(n,t,e){const i=Pa(n);if(!i.getElementById(t)){const s=T("style");s.id=t,s.textContent=e,Wh(i,s)}}function Pa(n){if(!n)return document;const t=n.getRootNode?n.getRootNode():n.ownerDocument;return t&&t.host?t:n.ownerDocument}function s0(n){const t=T("style");return Wh(Pa(n),t),t.sheet}function Wh(n,t){return O(n.head||n,t),t.sheet}function B(n,t,e){n.insertBefore(t,e||null)}function V(n){n.parentNode&&n.parentNode.removeChild(n)}function Zt(n,t){for(let e=0;e<n.length;e+=1)n[e]&&n[e].d(t)}function T(n){return document.createElement(n)}function Ne(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Se(n){return document.createTextNode(n)}function te(){return Se(" ")}function Ee(){return Se("")}function Ce(n,t,e,i){return n.addEventListener(t,e,i),()=>n.removeEventListener(t,e,i)}function o0(n){return function(t){return t.stopPropagation(),n.call(this,t)}}function P(n,t,e){e==null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}function r0(n){return Array.from(n.childNodes)}function Te(n,t){t=""+t,n.data!==t&&(n.data=t)}function z(n,t,e,i){e===null?n.style.removeProperty(t):n.style.setProperty(t,e,i?"important":"")}let Bo;function a0(){if(Bo===void 0){Bo=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(n){Bo=!0}}return Bo}function Ia(n,t){getComputedStyle(n).position==="static"&&(n.style.position="relative");const i=T("iframe");i.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),i.setAttribute("aria-hidden","true"),i.tabIndex=-1;const s=a0();let o;return s?(i.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",o=Ce(window,"message",r=>{r.source===i.contentWindow&&t()})):(i.src="about:blank",i.onload=()=>{o=Ce(i.contentWindow,"resize",t),t()}),O(n,i),()=>{(s||o&&i.contentWindow)&&o(),V(i)}}function ne(n,t,e){n.classList[e?"add":"remove"](t)}function Hh(n,t,{bubbles:e=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,e,i,t),s}class _o{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,e,i=null){this.e||(this.is_svg?this.e=Ne(e.nodeName):this.e=T(e.nodeType===11?"TEMPLATE":e.nodeName),this.t=e.tagName!=="TEMPLATE"?e:e.content,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)B(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(V)}}const Ro=new Map;let Fo=0;function l0(n){let t=5381,e=n.length;for(;e--;)t=(t<<5)-t^n.charCodeAt(e);return t>>>0}function c0(n,t){const e={stylesheet:s0(t),rules:{}};return Ro.set(n,e),e}function No(n,t,e,i,s,o,r,a=0){const l=16.666/i;let c=`{
436
436
  `;for(let g=0;g<=1;g+=l){const A=t+(e-t)*o(g);c+=g*100+`%{${r(A,1-A)}}
437
437
  `}const h=c+`100% {${r(e,1-e)}}
438
438
  }`,u=`__svelte_${l0(h)}_${a}`,f=Pa(n),{stylesheet:m,rules:v}=Ro.get(f)||c0(f,n);v[u]||(v[u]=!0,m.insertRule(`@keyframes ${u} ${h}`,m.cssRules.length));const p=n.style.animation||"";return n.style.animation=`${p?`${p}, `:""}${u} ${i}ms linear ${s}ms 1 both`,Fo+=1,u}function Go(n,t){const e=(n.style.animation||"").split(", "),i=e.filter(t?o=>o.indexOf(t)<0:o=>o.indexOf("__svelte")===-1),s=e.length-i.length;s&&(n.style.animation=i.join(", "),Fo-=s,Fo||h0())}function h0(){wa(()=>{Fo||(Ro.forEach(n=>{const{ownerNode:t}=n.stylesheet;t&&V(t)}),Ro.clear())})}let js;function yi(n){js=n}function Li(){if(!js)throw new Error("Function called outside component initialization");return js}function Uh(n){Li().$$.before_update.push(n)}function Et(n){Li().$$.on_mount.push(n)}function Yh(n){Li().$$.after_update.push(n)}function Ft(n){Li().$$.on_destroy.push(n)}function Qo(){const n=Li();return(t,e,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[t];if(s){const o=Hh(t,e,{cancelable:i});return s.slice().forEach(r=>{r.call(n,o)}),!o.defaultPrevented}return!0}}function Ma(n,t){return Li().$$.context.set(n,t),t}function Ti(n){return Li().$$.context.get(n)}function Fn(n,t){const e=n.$$.callbacks[t.type];e&&e.slice().forEach(i=>i.call(this,t))}const Nn=[],Qe=[];let Gn=[];const Ea=[],Xh=Promise.resolve();let ka=!1;function Zh(){ka||(ka=!0,Xh.then(Sa))}function Jh(){return Zh(),Xh}function nt(n){Gn.push(n)}function xa(n){Ea.push(n)}const Da=new Set;let Qn=0;function Sa(){if(Qn!==0)return;const n=js;do{try{for(;Qn<Nn.length;){const t=Nn[Qn];Qn++,yi(t),d0(t.$$)}}catch(t){throw Nn.length=0,Qn=0,t}for(yi(null),Nn.length=0,Qn=0;Qe.length;)Qe.pop()();for(let t=0;t<Gn.length;t+=1){const e=Gn[t];Da.has(e)||(Da.add(e),e())}Gn.length=0}while(Nn.length);for(;Ea.length;)Ea.pop()();ka=!1,Da.clear(),yi(n)}function d0(n){if(n.fragment!==null){n.update(),rt(n.before_update);const t=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,t),n.after_update.forEach(nt)}}function u0(n){const t=[],e=[];Gn.forEach(i=>n.indexOf(i)===-1?t.push(i):e.push(i)),e.forEach(i=>i()),Gn=t}let Os;function La(){return Os||(Os=Promise.resolve(),Os.then(()=>{Os=null})),Os}function qi(n,t,e){n.dispatchEvent(Hh(`${t?"intro":"outro"}${e}`))}const Wo=new Set;let oi;function fe(){oi={r:0,c:[],p:oi}}function me(){oi.r||rt(oi.c),oi=oi.p}function D(n,t){n&&n.i&&(Wo.delete(n),n.i(t))}function _(n,t,e,i){if(n&&n.o){if(Wo.has(n))return;Wo.add(n),oi.c.push(()=>{Wo.delete(n),i&&(e&&n.d(1),i())}),n.o(t)}else i&&i()}const Ta={duration:0};function zi(n,t,e){const i={direction:"in"};let s=t(n,e,i),o=!1,r,a,l=0;function c(){r&&Go(n,r)}function h(){const{delay:f=0,duration:m=300,easing:v=bi,tick:p=$,css:g}=s||Ta;g&&(r=No(n,0,1,m,f,v,g,l++)),p(0,1);const A=ya()+f,w=A+m;a&&a.abort(),o=!0,nt(()=>qi(n,!0,"start")),a=Ca(I=>{if(o){if(I>=w)return p(1,0),qi(n,!0,"end"),c(),o=!1;if(I>=A){const C=v((I-A)/m);p(C,1-C)}}return o})}let u=!1;return{start(){u||(u=!0,Go(n),si(s)?(s=s(i),La().then(h)):h())},invalidate(){u=!1},end(){o&&(c(),o=!1)}}}function Wn(n,t,e){const i={direction:"out"};let s=t(n,e,i),o=!0,r;const a=oi;a.r+=1;function l(){const{delay:c=0,duration:h=300,easing:u=bi,tick:f=$,css:m}=s||Ta;m&&(r=No(n,1,0,h,c,u,m));const v=ya()+c,p=v+h;nt(()=>qi(n,!1,"start")),Ca(g=>{if(o){if(g>=p)return f(0,1),qi(n,!1,"end"),--a.r||rt(a.c),!1;if(g>=v){const A=u((g-v)/h);f(1-A,A)}}return o})}return si(s)?La().then(()=>{s=s(i),l()}):l(),{end(c){c&&s.tick&&s.tick(1,0),o&&(r&&Go(n,r),o=!1)}}}function ri(n,t,e,i){const s={direction:"both"};let o=t(n,e,s),r=i?0:1,a=null,l=null,c=null;function h(){c&&Go(n,c)}function u(m,v){const p=m.b-r;return v*=Math.abs(p),{a:r,b:m.b,d:p,duration:v,start:m.start,end:m.start+v,group:m.group}}function f(m){const{delay:v=0,duration:p=300,easing:g=bi,tick:A=$,css:w}=o||Ta,I={start:ya()+v,b:m};m||(I.group=oi,oi.r+=1),a||l?l=I:(w&&(h(),c=No(n,r,m,p,v,g,w)),m&&A(0,1),a=u(I,p),nt(()=>qi(n,m,"start")),Ca(C=>{if(l&&C>l.start&&(a=u(l,p),l=null,qi(n,a.b,"start"),w&&(h(),c=No(n,r,a.b,a.duration,0,g,o.css))),a){if(C>=a.end)A(r=a.b,1-r),qi(n,a.b,"end"),l||(a.b?h():--a.group.r||rt(a.group.c)),a=null;else if(C>=a.start){const M=C-a.start;r=a.a+a.d*g(M/a.duration),A(r,1-r)}}return!!(a||l)}))}return{run(m){si(o)?La().then(()=>{o=o(s),f(m)}):f(m)},end(){h(),a=l=null}}}function Ho(n,t){const e=t.token={};function i(s,o,r,a){if(t.token!==e)return;t.resolved=a;let l=t.ctx;r!==void 0&&(l=l.slice(),l[r]=a);const c=s&&(t.current=s)(l);let h=!1;t.block&&(t.blocks?t.blocks.forEach((u,f)=>{f!==o&&u&&(fe(),_(u,1,1,()=>{t.blocks[f]===u&&(t.blocks[f]=null)}),me())}):t.block.d(1),c.c(),D(c,1),c.m(t.mount(),t.anchor),h=!0),t.block=c,t.blocks&&(t.blocks[o]=c),h&&Sa()}if(i0(n)){const s=Li();if(n.then(o=>{yi(s),i(t.then,1,t.value,o),yi(null)},o=>{if(yi(s),i(t.catch,2,t.error,o),yi(null),!t.hasCatch)throw o}),t.current!==t.pending)return i(t.pending,0),!0}else{if(t.current!==t.then)return i(t.then,1,t.value,n),!0;t.resolved=n}}function qh(n,t,e){const i=t.slice(),{resolved:s}=n;n.current===n.then&&(i[n.value]=s),n.current===n.catch&&(i[n.error]=s),n.block.p(i,e)}const f0=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function za(n,t){n.d(1),t.delete(n.key)}function ji(n,t){_(n,1,1,()=>{t.delete(n.key)})}function Jt(n,t,e,i,s,o,r,a,l,c,h,u){let f=n.length,m=o.length,v=f;const p={};for(;v--;)p[n[v].key]=v;const g=[],A=new Map,w=new Map,I=[];for(v=m;v--;){const S=u(s,o,v),L=e(S);let W=r.get(L);W?i&&I.push(()=>W.p(S,t)):(W=c(L,S),W.c()),A.set(L,g[v]=W),L in p&&w.set(L,Math.abs(v-p[L]))}const C=new Set,M=new Set;function E(S){D(S,1),S.m(a,h),r.set(S.key,S),h=S.first,m--}for(;f&&m;){const S=g[m-1],L=n[f-1],W=S.key,R=L.key;S===L?(h=S.first,f--,m--):A.has(R)?!r.has(W)||C.has(W)?E(S):M.has(R)?f--:w.get(W)>w.get(R)?(M.add(W),E(S)):(C.add(R),f--):(l(L,r),f--)}for(;f--;){const S=n[f];A.has(S.key)||l(S,r)}for(;m;)E(g[m-1]);return rt(I),g}function Ct(n,t){const e={},i={},s={$$scope:1};let o=n.length;for(;o--;){const r=n[o],a=t[o];if(a){for(const l in r)l in a||(i[l]=1);for(const l in a)s[l]||(e[l]=a[l],s[l]=1);n[o]=a}else for(const l in r)s[l]=1}for(const r in i)r in e||(e[r]=void 0);return e}function Kh(n){return typeof n=="object"&&n!==null?n:{}}function ja(n,t,e){const i=n.$$.props[t];i!==void 0&&(n.$$.bound[i]=e,e(n.$$.ctx[i]))}function re(n){n&&n.c()}function se(n,t,e,i){const{fragment:s,after_update:o}=n.$$;s&&s.m(t,e),i||nt(()=>{const r=n.$$.on_mount.map(_h).filter(si);n.$$.on_destroy?n.$$.on_destroy.push(...r):rt(r),n.$$.on_mount=[]}),o.forEach(nt)}function oe(n,t){const e=n.$$;e.fragment!==null&&(u0(e.after_update),rt(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function m0(n,t){n.$$.dirty[0]===-1&&(Nn.push(n),Zh(),n.$$.dirty.fill(0)),n.$$.dirty[t/31|0]|=1<<t%31}function de(n,t,e,i,s,o,r,a=[-1]){const l=js;yi(n);const c=n.$$={fragment:null,ctx:[],props:o,update:$,not_equal:s,bound:Rh(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Rh(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};r&&r(c.root);let h=!1;if(c.ctx=e?e(n,t.props||{},(u,f,...m)=>{const v=m.length?m[0]:f;return c.ctx&&s(c.ctx[u],c.ctx[u]=v)&&(!c.skip_bound&&c.bound[u]&&c.bound[u](v),h&&m0(n,u)),f}):[],c.update(),h=!0,rt(c.before_update),c.fragment=i?i(c.ctx):!1,t.target){if(t.hydrate){const u=r0(t.target);c.fragment&&c.fragment.l(u),u.forEach(V)}else c.fragment&&c.fragment.c();t.intro&&D(n.$$.fragment),se(n,t.target,t.anchor,t.customElement),Sa()}yi(l)}class ue{$destroy(){oe(this,1),this.$destroy=$}$on(t,e){if(!si(e))return $;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(e),()=>{const s=i.indexOf(e);s!==-1&&i.splice(s,1)}}$set(t){this.$$set&&!n0(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const g0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAYAAACZ1L+0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAYKADAAQAAAABAAAAPAAAAABU0H2EAAARRElEQVR4Ad2czY9cRZbFq1yFoQGDNCzwuAENohl54dkgdrNh34tZ8GciFi31nwEsmAEhhAWD1GMJCZgx5sMfUHN+J+NE3XfrZWWVcVVLHVLmuXG/74148V5m2bm/N8bR0dH+Bx988Po333zzbz///PONg4ODa+I9I9y/cuXKgV77h4eH+1KH3hP/yv7+vuBAsG+5UCIpCkMzDQ962Eu80Q1P/KmHT82v8IocZFL4pslDvL3fNARHoPI2wtbrV1jBIf9N8SEZ0UUP2wFHv2ocSc/2ouEz8PVooJXQ0/j10aNHoH2Idj4PHz4k1n29/k+5/u3ll1/+r7fffvtLzfGzd8ibjK6+9957f5ajf1XzH9y7d+8Xjf9FRs1SdvNBBg2SDQ1xh9ALH4yN0M2BNZrKwtFc9Fmkquuma5HJBzvLiIONBnx40B7QIzTdxCcNwj3dYlEoUmabAU+UFZDpxah22Ng2NjQXH0LrwccGwyEzXfWhWQwSYQHYuFevXj14/vnn37h79+7Nr7766gup/FX5PnAj33///f/46aef3vj444/vfPbZZz9IYGMcnDbkhEYQL001Hfsu775i+7j6LID6cDQWYo8mabGMxOr+e/ye3y7989p3/9jfvHnz2q1bt25oMb549913/3Lwzjvv/Mu3337775988smdzz///AcVQ+IecsAOp8OOHRpkiJniWQnrBJmwc7EF8atxBA2ihx/obf7Qqa+un+aDI0f7k08nU+PLj3PBR+qpcvFdd3BNP7YgI7mnHqHzBRndv1hH33///QNtlAcvvfTSq999992dQzFu/vjjj/c//fTTu1z+unT2wDFoHN13QbVg5CQS3tBfQGwHoo+chltPto4FMsR3nKCZ7a3KyDM+UOOyHzV4xxAHOTjGqfVcVv23b9++++abb/4TvT+8f//+dS3ALzqj3MxgMq6IjAUC4as4CrbdmLtA8S2vttA0D5vSxNBnOvLwK1vO4K3+FSY+Z/Ol71RiC8JI7iBzcrus+nWfvf/iiy/+86Eux2u6JO6RQBoTFCvFOGEKkcyFRZ+kt+kP/pRHF9xiD3uOrs8OFW9eoaFBxorcsfGDvOdTeJCRTxQruT/x+rXxH6nvzx1qRx+I4FHJQZxJeat8CqCY0vCarG+AnK86++whdDlzeQrZKieWhmCTC3GgEy+x01DiKHfuK6vxYhfcYj/zKWVPMrnAwE98RCG+mZPHafVVOX71hPRUHkOpnMe9+SSBQ5wpgJF5mlGTgp+R5oHwhj/7Za7kzQMZ8RPsBaZYEH3k6KbotfySQ/Tjg7lsXQ/IQFc5Chb5zgUR/8LqJyi99QJA0CySFc4znUTFm3d2Cq8FuYryFhk42HLh3bz1zI4N+qGLvXkJMXKcDer6yE+7IuInuObvMusn/iHNz4DBqoMM0W4gyJxmsgijqSfkyNALdv3YRl51oXfFP4u+fCjd43xTQ/wLtx5Zu+L3euI78VJXsOvX+hXrijbL3qEIP1lEObuKhENnR+IgvDU5vD7wGx4Fyn4ucHzFfy8I2/Dio2JkIPyu3+XEp2iQ0ePvqm+X3E7b27b64ZPHYRrCE0R/jq68kfB80mBOQhWhTxu9YHTTfOi+QGLZf7Dbd/3UAjK6PDwL9dafmi6zfm0Ob8xDVkIJs7O5ErxDQQaFhMdctHVB5o8xfLXJzo0dC1wfKxefK1b8L+xHHuGhHjobgzzDO+Fu1Dw/V6RWkHGR9avv5LW5CRNs7Aaf8Qq82mAZUNh8CkEPXvRDDz3cLob4zB0YAjvF3Wrf/fcdK3nyxt2k0WNoR/MlopG54i820Iq/RT3Y1DHqemL1cxX4JkxiXAkECBK4N6Ams0ZjCz+Y8xZkcCSEx3xXPOTJAf3kFv/dfkWOja9i7ImvMW/ChXbe3V9igxjuGskrmFrX6lcsP+FwBPn40WJAsihGgvWEkIe3JpetiwUZTz31lBsOMihE9NzxZpY3GoTtaNSk40/ooyXY84UfHm57fHjKH/DoDYotiEJqBZnDD29NTp74Bxk9fq8f3XwOIHM7z6rbw+bNwcc8tDG6YNGvpNxu/xwwZPOKobj4xEnobf536cvOVwDI6PrJLXl0uY3U94FA6CdSvxbKR5C3DcFJJFiCTrLvmJ4w9hr2g5Fo72aQgX7Fy9ZX7Bw/Z9rh5FrHk6yfJnGlH1+PilQbVOkkUXnQNDAIjV4wNhUjA3nFFqx05B2zuGClo9fj4xNe/IcG18Yu/S6vNUDjM7jmPzJwvPb5HCB6NoTLnoRjn0e41UuOhKTvRsagouSLpw49lXAu8ue6qjbpWuBkniScC2zyrPn253hkqs06Q3+Rb3IH1/yJd6H1c0XxFDSPIAVMM50QSdXRG4St5EmSQk2D1S70sE8MGriwj942PK//7mclXnJPvsntwuvX8cPfyTdfRSRRGqQifckO3lkSig4moV1Ab3iX94aOZ/bFB7ORk/2tPLfPZ/+R7wJoeGIg6PmkVjDy8Mxo9QzehO5PgvPUzx/19w71xqOhX3jm0akOjqfM04wR2OxKR28bsuLckEGGbH1EgAwVf64PZvgh/23+5JIdjuvVI7Q/JqJ4WfVrM/km7A9iKtw3tVHQbBDNogCQwWJoLjheFAvGW2QgrNGYc/09IDGwD5143f9afuJJfZNfaDD5YJMFgy9acCxnVxb5hdVPUNWz+RxAQF7sQKFvVKMBvoGpIKa+hNFJg80sb5GBg51mbBwUXUj8xIZ56GLvRUDGGDnOBj2G/vSxzd8l1/+P9/cAdn92dF8gFrAeWdLzgoBZkPCY46f6g85VuCbPxgx2/diCel1Rfnv+KgLFKCdpAoQG1wJikySRrw10wt+1g+MLxGaX/136tWD8Sf/EkRIfyNFPzcxDX0T9o9/H34YmYMXxVMKNEbaPIyVpNGPc3ESvHjFDZ0IvCEGKg+4LJFb8Grt915d8+tjiD/YcXT+5BC+yfi28Nyb/LKV+DpjJQZBgbbjoxWMdH6hGkrYLnQVbONtM+nP3QgX/YkRnIRuTyLwgK/qnynu+sl/s+B7wIuvXFeAa+JOkdw1NY+WTVE+GueQuEGQuGy8IyBxbaJB5H6MgirZIeosFHXbTXnqLfEaO9XPCqZ8DkmdwJd+5yUiox1vJ/4nXf66/B+xqAOcaSQfzSAcy1OBFwbsajjxNwT40OPwt5OJl8SxHpw42m8b83FDo6Y/cR14n4j3J+hWDmJvvglTQiS+3yJREakKhwTU5x5ps5ueG0CADu3Hi2R59mgIyQo9GmR8ecvKpuCsfdOsgTnKq/NA9P+IlBjqhQeZd3v0nFsjATkOw+YM8vMXfAyIEEVK8du/8ICVWjhZj35HY1NH9VRl0CglSUHwiDw0y7+NJ6/d8L7p+5X/y7wFJgmI5OrjscoTsagCNrPaiafLc4bI/1wLSYGIG1/yfdoX0BcxCBvsCdv8XWb9iubbN8+XoLAkRNAWLnfMwRwZ2bjIm0OiCw8Xc1ZlXjG30Y5t48MOrdqGzuCC87q/L9b2O6wHR7wsi/XnsISf2ZdVP7nrtLz6IKUHvWDAJJWnmocE1Obw6uj4yAkeH3SsdN2Hw3CjUorOCUxZbkBHfQfiiHQM5DRYvm+pEPefV7/6IUUdigeEnt8z974LE5PFqPmKJtgEJ5c6PAToN0bMdfOlPH8z76AmPONO+P6cTOzx8df/JDVyTm1neejyJEjt1LR6LL7h+paMv47QL544Sgx0yG60Es1vmCpZ6TjSEAtOkoXeiwFL0CXv95wg3HGTI1+I/TKw0fLFBbFTeej7UJ3Fqwn+uCltdZv3qu8Jrg+vMIyG/uFxF+7JNHfWSGQnOAtDVoMlWt8PNBzrPdzVsRX6uvwcQRDHn5uj+JE5u3mTopgZsyZuck/9l1q+4zm3+PYDEuCmRDJgEw2POYqBXF8WK4y0yMPxK54kFHCMfihyw2/d4XR4nwa6v3J0riE6P3+WpFWQonnsBMrp/M8vbWn7wolLji08vl1/GESBJxagizrKLKj90ZCC8+AKjU7H76/boklNsKEA686b9GPq2xcfa+DvU73uAk6I4VoTkQIZon+Egc/FphnnMV+TRCy7uCV0fHywCyOhHyC79jdXxO75kM4/I0GD866a+9dtd6pbupdSvWJu/BygxN1Tz2SwlcaYGVpvjNiwpdJac41m3J254aIU+xUc2w8xXZuHhIrTlaS7I6P53xd8lt9P2ti13jhrJlkdQlINJMj7rGTZ4+Zpi7uLoriF+dZmnKVapsXb5J2nsQYy7Puzw1uQOWN66fnIJolrp+AbHeOz645cHaBdFYfG6DTHKLkCHT40kAzJCJ8EuT/O2xdrlv9uzEOERP3T8n9cfPk4bu/ydp/7kmK+js3MWBfVk0nwQmQJ6QUDm8MNjzpnOIoCMQfvjPvNe0C7/StpPJSCDHRwec9m7DnDMrYhf5skt+ca2+Lv0+t0ZdhJDiczHIBKuvFGAi1YBTCctPc9pKEQQvmjrDb5peAzioQsOuenYd3nPB3l4a/bw6hh559GXDWEaRK/7i28QOfaQT6J+Umdj5LsgYs9iErDySIDGYJQGhc4OQ+e0sWK/2LEUJl+zwNAgg3wqkmdyDD885n3gBxfFn+nhluae6m8lf/dC/pxXj9fn1Z5aefFJ2I2twjjk6NBjm/+bz3BGQMgEzCPf5hJoEfETv03kKTKIgviNT0Shz+Q/seIPB3X0fLp+l190/Sw494Bc9v57LkkosAvmi7B8P1MLCS3bxXP3SkE+guQzJosFFN8NBqNQEf/Mg12fBuEbHONU/+Q3/AUXC07d8ncp9XPlkotvwiN5ijEz2BOCnyaXQsyLjxSZecXYFp3YptE0JrxqGjqyVf2V/KIX7Efo/PBHgNQdvMj66YGOoH3+WYqLKk1JsTtvkr1gzjSONJCBT1a6+q40eoo/9WWyeK6OL5Ax/Edn2uKDEd9BM8tbzxe98IraJJM7CBP98JjHFmR+3vqxOXzmmWceaKU337CxGhqCTUVolIGMabAnhGgUb71iahI7fFf7FIFCb3j/18voiuemdd/Mu/+uE1sQWfeX3MBuyzx5B39P/fRcr4dcAT9p5bxl4zhIgNqgnlRkILKuf1654tIUCk2oLJYbQpr0ZqRrGt30C1tk4FnyQYccray31B3s9UQviG104IUGmZ8mH5v+3qF2w51nn332TzHCsI7KJzEVm6akEVuPhLWGhUeM0CAjvkHmxCM+uCYPD2R0f2Ilt7lB4tMGZ3i7qPqfe+65P6j3X1y5du3aZ3rSefrGjRsvkNxpI80AeTGC0NgGoakvuFYrtvDjD11okBF6m3yjdfze9eM7sbPQIC8sg8detlPdP7XCy8ASOh6IC534Qf126Au6Aq7S+0P9jOJ/f/jhh7dfeeWVN1C4c+cOv5zoxsQgKD7O/OgIT3OLgrrkLAMR9EuQYsXLlWO5ePNMJ25s7Fhv8EIraduDDOJI7kfh6FT98M6Ka/GrLbE0/131X79+/YVXX331+tNPP32b3nt1tGhXP/rooz/ruf9N/YzWQ/2e2c8Cfg7Wz8RC9WkeE8pj/rQltMRH/jXdsdreAEp04mg8u22zYhvZ9IPueLE4puMLfnjRKzKCbD4ZHv9oK/mwaPOlm/ukkbFwjKLj428j8t8DEEvN9xJoJuhsDI9lxOeHXr3zE8cGm7fpQMfNgR54ntXmYXzx1ltvbX64VUl4SH//66+/fl2/5ndLC/BHMV/Q6ypN06Bm3lgFaKMcEbj+bDHN88/curvewF4hjhNWasrwhy/0waIPjylyYjp49Ag++NhFhi7F+jeEFcc/H6w5TYbnxo2OoufXmNPcX+XWv4QLMo+taJkfeY4gvtRs/n8vzY/cssxB5CyKxi96/aB+/Y9+KfE/X3vttS8lI7e9/wfu514OAjYP0QAAAABJRU5ErkJggg==";function p0(n){ge(n,"svelte-1d7uzh5",".room-label-item.svelte-1d7uzh5{position:absolute;font-size:0.5rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.room-label-item__text.svelte-1d7uzh5{position:absolute;left:0;top:-4rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.25rem;min-width:2rem;padding:0 0.375rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-1d7uzh5{position:absolute;top:-2.75rem;height:3rem;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-1d7uzh5{font-size:0.625rem}")}function v0(n){let t,e,i=n[0].name+"",s,o,r,a,l;return{c(){t=T("div"),e=T("span"),s=Se(i),o=te(),r=T("div"),P(e,"class","room-label-item__text svelte-1d7uzh5"),z(e,"background-image","url("+g0+")"),ne(e,"wide",n[0].name.length>3),P(r,"class","room-label-item__bar svelte-1d7uzh5"),P(t,"class","room-label-item svelte-1d7uzh5"),z(t,"z-index",n[0].zIndex),z(t,"transform",n[0].transform),z(t,"opacity",n[0].visible?1:0)},m(c,h){B(c,t,h),O(t,e),O(e,s),O(t,o),O(t,r),a||(l=Ce(e,"click",n[1]),a=!0)},p(c,[h]){h&1&&i!==(i=c[0].name+"")&&Te(s,i),h&1&&ne(e,"wide",c[0].name.length>3),h&1&&z(t,"z-index",c[0].zIndex),h&1&&z(t,"transform",c[0].transform),h&1&&z(t,"opacity",c[0].visible?1:0)},i:$,o:$,d(c){c&&V(t),a=!1,l()}}}function A0(n,t,e){let{five:i}=t,{roomLabel:s}=t;function o(){i.setState({panoIndex:s.panoIndex,mode:"Panorama",longitude:s.longitude})}return n.$$set=r=>{"five"in r&&e(2,i=r.five),"roomLabel"in r&&e(0,s=r.roomLabel)},[s,o,i]}class b0 extends ue{constructor(t){super(),de(this,t,A0,v0,he,{five:2,roomLabel:0},p0)}}var $h=function(){if(typeof Map!="undefined")return Map;function n(t,e){var i=-1;return t.some(function(s,o){return s[0]===e?(i=o,!0):!1}),i}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(e){var i=n(this.__entries__,e),s=this.__entries__[i];return s&&s[1]},t.prototype.set=function(e,i){var s=n(this.__entries__,e);~s?this.__entries__[s][1]=i:this.__entries__.push([e,i])},t.prototype.delete=function(e){var i=this.__entries__,s=n(i,e);~s&&i.splice(s,1)},t.prototype.has=function(e){return!!~n(this.__entries__,e)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,i){i===void 0&&(i=null);for(var s=0,o=this.__entries__;s<o.length;s++){var r=o[s];e.call(i,r[1],r[0])}},t}()}(),Oa=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,Uo=function(){return typeof global!="undefined"&&global.Math===Math?global:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),y0=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Uo):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),w0=2;function C0(n,t){var e=!1,i=!1,s=0;function o(){e&&(e=!1,n()),i&&a()}function r(){y0(o)}function a(){var l=Date.now();if(e){if(l-s<w0)return;i=!0}else e=!0,i=!1,setTimeout(r,t);s=l}return a}var P0=20,I0=["top","right","bottom","left","width","height","size","weight"],M0=typeof MutationObserver!="undefined",E0=function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=C0(this.refresh.bind(this),P0)}return n.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},n.prototype.removeObserver=function(t){var e=this.observers_,i=e.indexOf(t);~i&&e.splice(i,1),!e.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},n.prototype.updateObservers_=function(){var t=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return t.forEach(function(e){return e.broadcastActive()}),t.length>0},n.prototype.connect_=function(){!Oa||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),M0?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!Oa||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(t){var e=t.propertyName,i=e===void 0?"":e,s=I0.some(function(o){return!!~i.indexOf(o)});s&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),ed=function(n,t){for(var e=0,i=Object.keys(t);e<i.length;e++){var s=i[e];Object.defineProperty(n,s,{value:t[s],enumerable:!1,writable:!1,configurable:!0})}return n},Hn=function(n){var t=n&&n.ownerDocument&&n.ownerDocument.defaultView;return t||Uo},td=Xo(0,0,0,0);function Yo(n){return parseFloat(n)||0}function id(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return t.reduce(function(i,s){var o=n["border-"+s+"-width"];return i+Yo(o)},0)}function k0(n){for(var t=["top","right","bottom","left"],e={},i=0,s=t;i<s.length;i++){var o=s[i],r=n["padding-"+o];e[o]=Yo(r)}return e}function x0(n){var t=n.getBBox();return Xo(0,0,t.width,t.height)}function D0(n){var t=n.clientWidth,e=n.clientHeight;if(!t&&!e)return td;var i=Hn(n).getComputedStyle(n),s=k0(i),o=s.left+s.right,r=s.top+s.bottom,a=Yo(i.width),l=Yo(i.height);if(i.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=id(i,"left","right")+o),Math.round(l+r)!==e&&(l-=id(i,"top","bottom")+r)),!L0(n)){var c=Math.round(a+o)-t,h=Math.round(l+r)-e;Math.abs(c)!==1&&(a-=c),Math.abs(h)!==1&&(l-=h)}return Xo(s.left,s.top,a,l)}var S0=function(){return typeof SVGGraphicsElement!="undefined"?function(n){return n instanceof Hn(n).SVGGraphicsElement}:function(n){return n instanceof Hn(n).SVGElement&&typeof n.getBBox=="function"}}();function L0(n){return n===Hn(n).document.documentElement}function T0(n){return Oa?S0(n)?x0(n):D0(n):td}function z0(n){var t=n.x,e=n.y,i=n.width,s=n.height,o=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,r=Object.create(o.prototype);return ed(r,{x:t,y:e,width:i,height:s,top:e,right:t+i,bottom:s+e,left:t}),r}function Xo(n,t,e,i){return{x:n,y:t,width:e,height:i}}var j0=function(){function n(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Xo(0,0,0,0),this.target=t}return n.prototype.isActive=function(){var t=T0(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},n}(),O0=function(){function n(t,e){var i=z0(e);ed(this,{target:t,contentRect:i})}return n}(),V0=function(){function n(t,e,i){if(this.activeObservations_=[],this.observations_=new $h,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=i}return n.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof Hn(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new j0(t)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof Hn(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(i){return new O0(i.target,i.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),nd=typeof WeakMap!="undefined"?new WeakMap:new $h,sd=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var e=E0.getInstance(),i=new V0(t,e,this);nd.set(this,i)}return n}();["observe","unobserve","disconnect"].forEach(function(n){sd.prototype[n]=function(){var t;return(t=nd.get(this))[n].apply(t,arguments)}});var B0=function(){return typeof Uo.ResizeObserver!="undefined"?Uo.ResizeObserver:sd}();function Oi(n){new B0((e,i)=>{var s,o,r,a,l,c;for(const h of e){const{borderBoxSize:u,contentRect:f}=h,m=(r=(o=(s=u==null?void 0:u[0])==null?void 0:s.inlineSize)!=null?o:f.width)!=null?r:n.clientWidth,v=(c=(l=(a=u==null?void 0:u[0])==null?void 0:a.blockSize)!=null?l:f.height)!=null?c:n.clientHeight;n.dispatchEvent(new CustomEvent("clientWidth",{detail:m})),n.dispatchEvent(new CustomEvent("clientHeight",{detail:v}))}}).observe(n)}const{Map:_0}=f0;function R0(n){ge(n,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function od(n,t,e){const i=n.slice();return i[13]=t[e],i}function rd(n,t){let e,i,s;return i=new b0({props:{roomLabel:t[13],five:t[1]}}),{key:n,first:null,c(){e=Ee(),re(i.$$.fragment),this.first=e},m(o,r){B(o,e,r),se(i,o,r),s=!0},p(o,r){t=o;const a={};r&1&&(a.roomLabel=t[13]),r&2&&(a.five=t[1]),i.$set(a)},i(o){s||(D(i.$$.fragment,o),s=!0)},o(o){_(i.$$.fragment,o),s=!1},d(o){o&&V(e),oe(i,o)}}}function F0(n){let t,e=[],i=new _0,s,o,r,a=n[0];const l=c=>c[13].id;for(let c=0;c<a.length;c+=1){let h=od(n,a,c),u=l(h);i.set(u,e[c]=rd(u,h))}return{c(){t=T("div");for(let c=0;c<e.length;c+=1)e[c].c();P(t,"class","room-labels-container svelte-9eg4zi")},m(c,h){B(c,t,h);for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(t,null);s=!0,o||(r=[Xt(Oi.call(null,t)),Ce(t,"clientWidth",n[6]),Ce(t,"clientHeight",n[7])],o=!0)},p(c,[h]){h&3&&(a=c[0],fe(),e=Jt(e,h,l,1,c,a,i,t,ji,rd,null,od),me())},i(c){if(!s){for(let h=0;h<a.length;h+=1)D(e[h]);s=!0}},o(c){for(let h=0;h<e.length;h+=1)_(e[h]);s=!1},d(c){c&&V(t);for(let h=0;h<e.length;h+=1)e[h].d();o=!1,rt(r)}}}function N0(n,t,e){var g;let i,{five:s}=t,{roomLabels:o}=t,r,a,l=(g=s.model.shownFloor)!=null?g:null;function c(A){if(!(l===null||A.floorIndex===l))return!1;const I=new Q.Raycaster,C=s.camera.position.clone(),M=new Q.Vector3(A.position.x,A.position.y,A.position.z),E=M.distanceTo(C);I.set(C.clone(),M.clone().sub(C).normalize());const[S]=s.model.intersectRaycaster(I);return!(S&&S.distance+1<E)}function h(A,w){const C=new Q.Vector3(A.position.x,A.position.y,A.position.z).clone().project(s.camera),M=Math.ceil((C.x+1)/2*w.x),E=Math.ceil((-C.y+1)/2*w.y);return`translate(${M}px, ${E}px)`}function u(A){const{rendererSize:w}=A,I=new Map;function C(E){const S=I.get(E.id);if(S)return S;const{x:L,y:W,z:R}=E.position,U=new Q.Vector3(L,W,R).clone().distanceTo(s.camera.position);return I.set(E.id,U),U}return o.map(E=>{const S=c(E),L=S?h(E,w):E.transform,W=C(E),U=o.filter(j=>j.visible&&C(j)<W).length*10;return ie(x({},E),{visible:S,transform:L,zIndex:U})})}function f(){e(0,o=u({rendererSize:i,shownFloor:l}))}function m(A){e(4,l=A)}s.on("cameraUpdate",f),s.on("modelShownFloorChange",m),Yh(()=>{e(0,o=u({rendererSize:i,shownFloor:l}))}),Ft(()=>{s.off("cameraUpdate",f),s.off("modelShownFloorChange",m)});const v=A=>{e(2,r=A.detail)},p=A=>{e(3,a=A.detail)};return n.$$set=A=>{"five"in A&&e(1,s=A.five),"roomLabels"in A&&e(0,o=A.roomLabels)},n.$$.update=()=>{n.$$.dirty&12&&e(5,i={x:r,y:a}),n.$$.dirty&48&&e(0,o=u({rendererSize:i,shownFloor:l}))},[o,s,r,a,l,i,v,p]}class G0 extends ue{constructor(t){super(),de(this,t,N0,F0,he,{five:1,roomLabels:0},R0)}}function Q0(n){return n.model_room_labels.map(({id:t,pano_index:e,floor_index:i,name:s,position:o,longitude:r})=>({id:t,name:s,position:o,longitude:r,panoIndex:e,floorIndex:i,zIndex:0,visible:!1,transform:""}))}class W0{constructor(t){d(this,"five");d(this,"enabled",!0);d(this,"fiveModeEnabled");d(this,"app");d(this,"wrapper");d(this,"roomLabels",[]);d(this,"container",document.createElement("div"));d(this,"onFiveModeChange",t=>{if(!this.checkFiveMode(t)){this.fiveModeEnabled=!1,this.render();return}this.five.once("initAnimationEnded",()=>{this.fiveModeEnabled=this.checkFiveMode(this.five.getCurrentState().mode),this.render()})});this.five=t,this.fiveModeEnabled=this.checkFiveMode(t.getCurrentState().mode),this.container.classList.add("model-room-label-plugin-container"),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="absolute",this.container.style.pointerEvents="none",this.container.style.left="0",this.container.style.top="0",this.container.style.zIndex="5",this.five.once("dispose",()=>this.dispose()),this.five.on("modeChange",this.onFiveModeChange),this.render()}dispose(){this.five.off("modeChange",this.onFiveModeChange),this.container.remove()}load(t){this.roomLabels=Q0(t),this.render()}appendTo(t){return this.wrapper=t,t.appendChild(this.container),this.render(),this}disable(){return this.enabled=!1,this.render(),this}enable(){return this.enabled=!0,this.render(),this}checkFiveMode(t){return t==="Floorplan"||t==="Mapview"}render(){var t;if(this.wrapper){if(!this.enabled||!this.fiveModeEnabled){(t=this.app)==null||t.$destroy(),this.app=void 0;return}this.app?this.app.$set({five:this.five,roomLabels:this.roomLabels}):this.app=new G0({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const H0=n=>new W0(n),U0={name:"ModelRoomLabelPlugin",version:0};var Vi=(n=>(n[n.FLOOR=1]="FLOOR",n[n.CEILING=2]="CEILING",n[n.BOUNDING_CENTER=3]="BOUNDING_CENTER",n))(Vi||{});function Ki(n){return H(this,null,function*(){try{return[null,yield n]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}})}function Un(n){return n<.5?4*n*n*n:.5*Math.pow(2*n-2,3)+1}function ad(n){const t=n-1;return t*t*t+1}function mt(n,{delay:t=0,duration:e=400,easing:i=bi}={}){const s=+getComputedStyle(n).opacity;return{delay:t,duration:e,easing:i,css:o=>`opacity: ${o*s}`}}function ld(n,{delay:t=0,duration:e=400,easing:i=ad,x:s=0,y:o=0,opacity:r=0}={}){const a=getComputedStyle(n),l=+a.opacity,c=a.transform==="none"?"":a.transform,h=l*(1-r),[u,f]=Nh(s),[m,v]=Nh(o);return{delay:t,duration:e,easing:i,css:(p,g)=>`
@@ -449,7 +449,7 @@ void main() {
449
449
  svg [type='lineItemGroup'] g g g g {
450
450
  stroke: #ffffff;
451
451
  }</style>
452
- `;return n.$$set=o=>{"content"in o&&e(0,i=o.content)},[i,s]}class eA extends ue{constructor(t){super(),de(this,t,$0,K0,he,{content:0},q0)}}function tA(n){ge(n,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function iA(n){let t,e;return t=new J0({props:{url:n[1].url}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&2&&(o.url=i[1].url),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function nA(n){let t,e;return t=new eA({props:{content:n[0]}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.content=i[0]),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function sA(n){let t,e,i,s;const o=[nA,iA],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(n))&&(i=r[e]=o[e](n)),{c(){t=T("div"),i&&i.c(),P(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){B(l,t,c),~e&&r[e].m(t,null),s=!0},p(l,[c]){let h=e;e=a(l),e===h?~e&&r[e].p(l,c):(i&&(fe(),_(r[h],1,1,()=>{r[h]=null}),me()),~e?(i=r[e],i?i.p(l,c):(i=r[e]=o[e](l),i.c()),D(i,1),i.m(t,null)):i=null)},i(l){s||(D(i),s=!0)},o(l){_(i),s=!1},d(l){l&&V(t),~e&&r[e].d()}}}function oA(n,t,e){let i,s,{floorIndex:o}=t,{floorplanData:r}=t;return n.$$set=a=>{"floorIndex"in a&&e(2,o=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},n.$$.update=()=>{var a,l;n.$$.dirty&12&&e(1,i=r.outlines[o]),n.$$.dirty&12&&e(0,s=(l=(a=r.outlines)==null?void 0:a[o])==null?void 0:l.svgContent)},[s,i,o,r]}class cd extends ue{constructor(t){super(),de(this,t,oA,sA,he,{floorIndex:2,floorplanData:3},tA)}}function rA(n){ge(n,"svelte-9vzn2f",".floorplan-plugin__room-label-item.svelte-9vzn2f{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-part1.svelte-9vzn2f{display:flex;flex-flow:column;align-items:center;color:#fff;white-space:nowrap}.floorplan-plugin__room-area.svelte-9vzn2f{opacity:0.6;line-height:1.25;margin-top:0.125rem}")}function aA(n){let t,e=n[15].outerHTML+"",i;return{c(){t=new _o(!1),i=Ee(),t.a=i},m(s,o){t.m(e,s,o),B(s,i,o)},p(s,o){o[0]&32768&&e!==(e=s[15].outerHTML+"")&&t.p(e)},d(s){s&&V(i),s&&t.d()}}}function lA(n){let t,e,i,s,o,r,a=n[1]&&hd(n),l=n[0]&&dd(n),c=n[2]&&ud(n);return{c(){t=T("div"),a&&a.c(),e=te(),l&&l.c(),i=te(),c&&c.c(),s=Ee(),P(t,"class","floorplan-plugin__room-part1 svelte-9vzn2f"),z(t,"opacity",n[11]?"1":"0")},m(h,u){B(h,t,u),a&&a.m(t,null),O(t,e),l&&l.m(t,null),B(h,i,u),c&&c.m(h,u),B(h,s,u),o||(r=[Xt(Oi.call(null,t)),Ce(t,"clientWidth",n[32]),Ce(t,"clientHeight",n[33])],o=!0)},p(h,u){h[1]?a?a.p(h,u):(a=hd(h),a.c(),a.m(t,e)):a&&(a.d(1),a=null),h[0]?l?l.p(h,u):(l=dd(h),l.c(),l.m(t,null)):l&&(l.d(1),l=null),u[0]&2048&&z(t,"opacity",h[11]?"1":"0"),h[2]?c?c.p(h,u):(c=ud(h),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null)},d(h){h&&V(t),a&&a.d(),l&&l.d(),h&&V(i),c&&c.d(h),h&&V(s),o=!1,rt(r)}}}function hd(n){let t,e=n[3].name+"",i;return{c(){t=T("span"),i=Se(e),P(t,"class","floorplan-plugin__room-name")},m(s,o){B(s,t,o),O(t,i)},p(s,o){o[0]&8&&e!==(e=s[3].name+"")&&Te(i,e)},d(s){s&&V(t)}}}function dd(n){let t,e;return{c(){t=T("span"),e=Se(n[14]),P(t,"class","floorplan-plugin__room-area svelte-9vzn2f"),z(t,"font-size",n[19])},m(i,s){B(i,t,s),O(t,e)},p(i,s){s[0]&16384&&Te(e,i[14])},d(i){i&&V(t)}}}function ud(n){let t,e;return{c(){t=T("span"),e=Se(n[13]),P(t,"class","floorplan-plugin__room-size"),z(t,"font-size",n[19]),z(t,"opacity",n[10]?"0.6":"0")},m(i,s){B(i,t,s),O(t,e)},p(i,s){s[0]&8192&&Te(e,i[13]),s[0]&1024&&z(t,"opacity",i[10]?"0.6":"0")},d(i){i&&V(t)}}}function cA(n){let t,e,i;function s(a,l){if(a[4]===void 0)return lA;if(a[15])return aA}let o=s(n),r=o&&o(n);return{c(){t=T("div"),r&&r.c(),P(t,"class","floorplan-plugin__room-label-item svelte-9vzn2f"),z(t,"left",n[16]),z(t,"top",n[17]),z(t,"font-size",n[18]),z(t,"opacity",n[12]?"1":"0"),z(t,"transform",n[9]?"translate(-50%, calc(-50% + 6px))":"translate(-50%, -50%)")},m(a,l){B(a,t,l),r&&r.m(t,null),e||(i=[Xt(Oi.call(null,t)),Ce(t,"clientWidth",n[34]),Ce(t,"clientHeight",n[35])],e=!0)},p(a,l){o===(o=s(a))&&r?r.p(a,l):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null))),l[0]&4096&&z(t,"opacity",a[12]?"1":"0"),l[0]&512&&z(t,"transform",a[9]?"translate(-50%, calc(-50% + 6px))":"translate(-50%, -50%)")},i:$,o:$,d(a){a&&V(t),r&&r.d(),e=!1,rt(i)}}}function hA(n,t){const e=n[0],i=n[1];let s=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){const a=t[o][0],l=t[o][1],c=t[r][0],h=t[r][1];l>i!=h>i&&e<(c-a)*(i-l)/(h-l)+a&&(s=!s)}return s}function dA(n,t,e){let i,s,o,r,a,l,c,h,u,f,m,v,p,{pxmm:g}=t,{roomAreaEnable:A}=t,{roomNameEnable:w}=t,{roomDimensionEnable:I}=t,{room:C}=t,{hoveredRoom:M}=t,{getRoomAreaText:E}=t,{getRoomDimensionText:S}=t,{getLabelElement:L}=t,{adaptiveRoomLabelVisibleEnable:W}=t;function R(ee,be){if(be.width===0||be.height===0)return()=>!1;const je=ee.path.map(({x:Be,y:Ue})=>[Be,Ue]),ve=ee.roomLabel.position,{x:qe,y:Oe}=ve,{width:Le,height:st}=be,ce=Le/2,Pe=st/2;return function(Ue){const dt=qe*Ue,tt=Oe*Ue,at=je.map(([Me,Ke])=>[Me*Ue,Ke*Ue]);return[[dt+ce,tt-Pe],[dt-ce,tt-Pe],[dt-ce,tt+Pe],[dt+ce,tt+Pe]].every(Me=>hA(Me,at))}}const U=document.body.clientWidth,j=document.body.clientHeight,Y=C.roomLabel,N=Y.positionInImage.x*100+"%",G=Y.positionInImage.y*100+"%",X=(U<500||j<500?10:14)+"px",J=(U<500||j<500?8:12)+"px";let q=0,le=0,ae=0,Ie=0,Ae=!1;M.subscribe(function(be){e(25,Ae=!!be&&be.id===C.id)});const pe=ee=>{e(7,ae=ee.detail)},Fe=ee=>{e(8,Ie=ee.detail)},we=ee=>{e(5,q=ee.detail)},Ye=ee=>{e(6,le=ee.detail)};return n.$$set=ee=>{"pxmm"in ee&&e(20,g=ee.pxmm),"roomAreaEnable"in ee&&e(0,A=ee.roomAreaEnable),"roomNameEnable"in ee&&e(1,w=ee.roomNameEnable),"roomDimensionEnable"in ee&&e(2,I=ee.roomDimensionEnable),"room"in ee&&e(3,C=ee.room),"hoveredRoom"in ee&&e(21,M=ee.hoveredRoom),"getRoomAreaText"in ee&&e(22,E=ee.getRoomAreaText),"getRoomDimensionText"in ee&&e(23,S=ee.getRoomDimensionText),"getLabelElement"in ee&&e(4,L=ee.getLabelElement),"adaptiveRoomLabelVisibleEnable"in ee&&e(24,W=ee.adaptiveRoomLabelVisibleEnable)},n.$$.update=()=>{var ee,be;n.$$.dirty[0]&24&&e(15,i=L==null?void 0:L(C)),n.$$.dirty[0]&4194312&&e(14,s=C.size?E(C.size):""),n.$$.dirty[0]&8388616&&e(13,o=C!=null&&C.dimension?S((ee=C.dimension)==null?void 0:ee.width,(be=C.dimension)==null?void 0:be.height):""),n.$$.dirty[0]&384&&e(31,r={width:ae,height:Ie}),n.$$.dirty[0]&8|n.$$.dirty[1]&1&&e(30,a=r?R(C,r):void 0),n.$$.dirty[0]&1091567616&&e(27,l=W?!!(a!=null&&a(g)):!0),n.$$.dirty[0]&96&&e(29,c={width:q,height:le}),n.$$.dirty[0]&536870920&&e(28,h=c?R(C,c):void 0),n.$$.dirty[0]&286261248&&e(26,u=W?!!(h!=null&&h(g)):!0),n.$$.dirty[0]&234881024&&e(12,f=u||l||Ae),n.$$.dirty[0]&167772160&&e(11,m=l||Ae),n.$$.dirty[0]&100663296&&e(10,v=u||Ae),n.$$.dirty[0]&201326592&&e(9,p=l&&!u)},[A,w,I,C,L,q,le,ae,Ie,p,v,m,f,o,s,i,N,G,X,J,g,M,E,S,W,Ae,u,l,h,c,a,r,pe,Fe,we,Ye]}class uA extends ue{constructor(t){super(),de(this,t,dA,cA,he,{pxmm:20,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,room:3,hoveredRoom:21,getRoomAreaText:22,getRoomDimensionText:23,getLabelElement:4,adaptiveRoomLabelVisibleEnable:24},rA,[-1,-1])}}function fA(n){ge(n,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function fd(n,t,e){const i=n.slice();return i[14]=t[e],i}function md(n){let t,e=[],i=new Map,s,o,r,a=n[10];const l=c=>c[14].id;for(let c=0;c<a.length;c+=1){let h=fd(n,a,c),u=l(h);i.set(u,e[c]=gd(u,h))}return{c(){t=T("div");for(let c=0;c<e.length;c+=1)e[c].c();P(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,h){B(c,t,h);for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(t,null);s=!0,o||(r=[Xt(Oi.call(null,t)),Ce(t,"clientWidth",n[13])],o=!0)},p(c,h){h&1791&&(a=c[10],fe(),e=Jt(e,h,l,1,c,a,i,t,ji,gd,null,fd),me())},i(c){if(!s){for(let h=0;h<a.length;h+=1)D(e[h]);s=!0}},o(c){for(let h=0;h<e.length;h+=1)_(e[h]);s=!1},d(c){c&&V(t);for(let h=0;h<e.length;h+=1)e[h].d();o=!1,rt(r)}}}function gd(n,t){let e,i,s;const o=[{pxmm:t[9],room:t[14],hoveredRoom:t[3],roomAreaEnable:t[0],roomNameEnable:t[1],roomDimensionEnable:t[2],getLabelElement:t[6],getRoomAreaText:t[4],getRoomDimensionText:t[5],adaptiveRoomLabelVisibleEnable:t[7]}];let r={};for(let a=0;a<o.length;a+=1)r=gt(r,o[a]);return i=new uA({props:r}),{key:n,first:null,c(){e=Ee(),re(i.$$.fragment),this.first=e},m(a,l){B(a,e,l),se(i,a,l),s=!0},p(a,l){t=a;const c=l&1791?Ct(o,[{pxmm:t[9],room:t[14],hoveredRoom:t[3],roomAreaEnable:t[0],roomNameEnable:t[1],roomDimensionEnable:t[2],getLabelElement:t[6],getRoomAreaText:t[4],getRoomDimensionText:t[5],adaptiveRoomLabelVisibleEnable:t[7]}]):{};i.$set(c)},i(a){s||(D(i.$$.fragment,a),s=!0)},o(a){_(i.$$.fragment,a),s=!1},d(a){a&&V(e),oe(i,a)}}}function mA(n){let t,e,i=n[10]&&md(n);return{c(){i&&i.c(),t=Ee()},m(s,o){i&&i.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[10]?i?(i.p(s,o),o&1024&&D(i,1)):(i=md(s),i.c(),D(i,1),i.m(t.parentNode,t)):i&&(fe(),_(i,1,1,()=>{i=null}),me())},i(s){e||(D(i),e=!0)},o(s){_(i),e=!1},d(s){i&&i.d(s),s&&V(t)}}}function gA(n,t,e){let i,{floorIndex:s}=t,{roomAreaEnable:o}=t,{roomNameEnable:r}=t,{roomDimensionEnable:a}=t,{floorplanData:l}=t,{hoveredRoom:c}=t,{getRoomAreaText:h}=t,{getRoomDimensionText:u}=t,{getLabelElement:f}=t,{adaptiveRoomLabelVisibleEnable:m}=t,v=0,p=0;const g=A=>{e(8,v=A.detail)};return n.$$set=A=>{"floorIndex"in A&&e(11,s=A.floorIndex),"roomAreaEnable"in A&&e(0,o=A.roomAreaEnable),"roomNameEnable"in A&&e(1,r=A.roomNameEnable),"roomDimensionEnable"in A&&e(2,a=A.roomDimensionEnable),"floorplanData"in A&&e(12,l=A.floorplanData),"hoveredRoom"in A&&e(3,c=A.hoveredRoom),"getRoomAreaText"in A&&e(4,h=A.getRoomAreaText),"getRoomDimensionText"in A&&e(5,u=A.getRoomDimensionText),"getLabelElement"in A&&e(6,f=A.getLabelElement),"adaptiveRoomLabelVisibleEnable"in A&&e(7,m=A.adaptiveRoomLabelVisibleEnable)},n.$$.update=()=>{if(n.$$.dirty&6144&&e(10,i=l.floorDatas[s].rooms),n.$$.dirty&4352){const{max:A,min:w}=l.bounding,I=A.x-w.x;e(9,p=v/I)}},[o,r,a,c,h,u,f,m,v,p,i,s,l,g]}class pA extends ue{constructor(t){super(),de(this,t,gA,mA,he,{floorIndex:11,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,floorplanData:12,hoveredRoom:3,getRoomAreaText:4,getRoomDimensionText:5,getLabelElement:6,adaptiveRoomLabelVisibleEnable:7},fA)}}function vA(n){ge(n,"svelte-1fuyezq",".floorplan-plugin__rule-labels.svelte-1fuyezq.svelte-1fuyezq{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-1fuyezq.svelte-1fuyezq{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-1fuyezq.svelte-1fuyezq{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-1fuyezq.svelte-1fuyezq{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-1fuyezq.svelte-1fuyezq{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-1fuyezq.svelte-1fuyezq{background:#fff;opacity:0.2;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-1fuyezq.svelte-1fuyezq{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-scale-wrapper.svelte-1fuyezq{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-1fuyezq.svelte-1fuyezq{position:absolute;background:#fff;opacity:0.2;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-scale.svelte-1fuyezq{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-1fuyezq.svelte-1fuyezq{position:absolute}.floorplan-plugin__rule-labels--top.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-1fuyezq.svelte-1fuyezq{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-text-item.svelte-1fuyezq{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-1fuyezq.svelte-1fuyezq{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.35}")}function pd(n,t,e){const i=n.slice();return i[11]=t[e],i[13]=e,i}function vd(n,t,e){const i=n.slice();return i[14]=t[e],i}function Ad(n){let t;return{c(){t=T("div"),P(t,"class","floorplan-plugin__rule-scale svelte-1fuyezq"),z(t,"left",n[14].left*100+"%"),z(t,"bottom",n[14].bottom*100+"%")},m(e,i){B(e,t,i)},p:$,d(e){e&&V(t)}}}function bd(n,t){let e,i,s=t[1](t[11].distance)+"",o,r;return{key:n,first:null,c(){e=T("div"),i=T("div"),o=Se(s),r=te(),P(i,"class","floorplan-plugin__rule-text svelte-1fuyezq"),ne(i,"is-row",t[2]),P(e,"class","floorplan-plugin__rule-text-item svelte-1fuyezq"),z(e,"left",t[11].left*100+"%"),z(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){B(a,e,l),O(e,i),O(i,o),O(e,r)},p(a,l){t=a,l&2&&s!==(s=t[1](t[11].distance)+"")&&Te(o,s)},d(a){a&&V(e)}}}function AA(n){let t,e,i,s,o,r,a=[],l=new Map,c,h=n[3],u=[];for(let v=0;v<h.length;v+=1)u[v]=Ad(vd(n,h,v));let f=n[4];const m=v=>v[13];for(let v=0;v<f.length;v+=1){let p=pd(n,f,v),g=m(p);l.set(g,a[v]=bd(g,p))}return{c(){t=T("div"),e=T("div"),i=te(),s=T("div");for(let v=0;v<u.length;v+=1)u[v].c();o=te(),r=T("div");for(let v=0;v<a.length;v+=1)a[v].c();P(e,"class","floorplan-plugin__rule-line svelte-1fuyezq"),P(s,"class","floorplan-plugin__rule-scale-wrapper svelte-1fuyezq"),ne(s,"is-row",n[2]),P(r,"class","floorplan-plugin__rule-text-wrapper svelte-1fuyezq"),P(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+n[0]+" svelte-1fuyezq"),ne(t,"is-row",n[2]),z(t,"width",n[2]?"100%":1/16+"rem"),z(t,"height",n[2]?1/16+"rem":"100%")},m(v,p){B(v,t,p),O(t,e),O(t,i),O(t,s);for(let g=0;g<u.length;g+=1)u[g]&&u[g].m(s,null);O(t,o),O(t,r);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(r,null)},p(v,[p]){if(p&8){h=v[3];let g;for(g=0;g<h.length;g+=1){const A=vd(v,h,g);u[g]?u[g].p(A,p):(u[g]=Ad(A),u[g].c(),u[g].m(s,null))}for(;g<u.length;g+=1)u[g].d(1);u.length=h.length}p&22&&(f=v[4],a=Jt(a,p,m,1,v,f,l,r,za,bd,null,pd)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+v[0]+" svelte-1fuyezq")&&P(t,"class",c),p&5&&ne(t,"is-row",v[2])},i:$,o:$,d(v){v&&V(t),Zt(u,v);for(let p=0;p<a.length;p+=1)a[p].d()}}}const Xn=1e3,Zn=180;function bA(n,t,e){let{type:i}=t,{data:s}=t,{bounding:o}=t,{getRuleDistanceText:r}=t;const a=i==="top"||i==="bottom",l=o.max.x-o.min.x-(Xn-Zn)*2,c=o.max.y-o.min.y-(Xn-Zn)*2,h=s.map(([v,p])=>a?[v.x,p.x]:[v.y,p.y]).flat().sort().filter((v,p,g)=>p===0?!0:v!==g[p-1]),u=h.map(v=>{const p=a?(v-o.min.x-Xn+Zn)/l:0,g=a?0:(v-o.min.y-Xn+Zn)/c;return{left:p,bottom:g}});u.unshift({left:0,bottom:0}),u.push(a?{left:1,bottom:0}:{left:0,bottom:1});const f=h[h.length-1]-h[0],m=h.map((v,p,g)=>{const A=p===0?0:v-g[p-1],w=p===0?0:(v+g[p-1])/2,I=a?(w-o.min.x-Xn+Zn)/l:0,C=a?0:(w-o.min.y-Xn+Zn)/c;return{left:I,bottom:C,distance:A}}).filter(({distance:v})=>v/f>.1);return n.$$set=v=>{"type"in v&&e(0,i=v.type),"data"in v&&e(5,s=v.data),"bounding"in v&&e(6,o=v.bounding),"getRuleDistanceText"in v&&e(1,r=v.getRuleDistanceText)},[i,r,a,u,m,s,o]}class yA extends ue{constructor(t){super(),de(this,t,bA,AA,he,{type:0,data:5,bounding:6,getRuleDistanceText:1},vA)}}function wA(n){ge(n,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function yd(n,t,e){const i=n.slice();return i[13]=t[e][0],i[14]=t[e][1],i}function wd(n,t){let e,i,s;const o=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<o.length;a+=1)r=gt(r,o[a]);return i=new yA({props:r}),{key:n,first:null,c(){e=Ee(),re(i.$$.fragment),this.first=e},m(a,l){B(a,e,l),se(i,a,l),s=!0},p(a,l){t=a;const c=l&19?Ct(o,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};i.$set(c)},i(a){s||(D(i.$$.fragment,a),s=!0)},o(a){_(i.$$.fragment,a),s=!1},d(a){a&&V(e),oe(i,a)}}}function CA(n){let t,e=[],i=new Map,s,o=n[4];const r=a=>a[13];for(let a=0;a<o.length;a+=1){let l=yd(n,o,a),c=r(l);i.set(c,e[a]=wd(c,l))}return{c(){t=T("div");for(let a=0;a<e.length;a+=1)e[a].c();P(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),z(t,"width",n[3]),z(t,"height",n[2])},m(a,l){B(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(a,[l]){l&19&&(o=a[4],fe(),e=Jt(e,l,r,1,a,o,i,t,ji,wd,null,yd),me()),l&8&&z(t,"width",a[3]),l&4&&z(t,"height",a[2])},i(a){if(!s){for(let l=0;l<o.length;l+=1)D(e[l]);s=!0}},o(a){for(let l=0;l<e.length;l+=1)_(e[l]);s=!1},d(a){a&&V(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Cd=1e3,Pd=180;function PA(n,t,e){let i,s,o,r,a,l,c,h,u,f,{floorIndex:m}=t,{floorplanData:v}=t,{getRuleDistanceText:p}=t;return n.$$set=g=>{"floorIndex"in g&&e(5,m=g.floorIndex),"floorplanData"in g&&e(6,v=g.floorplanData),"getRuleDistanceText"in g&&e(0,p=g.getRuleDistanceText)},n.$$.update=()=>{n.$$.dirty&64&&e(1,i=v.bounding),n.$$.dirty&96&&e(11,s=v.floorDatas[m].rules),n.$$.dirty&2048&&e(12,o=Object.keys(s)),n.$$.dirty&6144&&e(4,r=o.map(g=>[g,s[g]])),n.$$.dirty&2&&e(9,a=i.max.x-i.min.x),n.$$.dirty&2&&e(7,l=i.max.y-i.min.y),n.$$.dirty&2&&e(10,c=i.max.x-i.min.x-(Cd-Pd)*2),n.$$.dirty&2&&e(8,h=i.max.y-i.min.y-(Cd-Pd)*2),n.$$.dirty&1536&&e(3,u=c/a*100+"%"),n.$$.dirty&384&&e(2,f=h/l*100+"%")},[p,i,f,u,r,m,v,l,h,a,c,s,o]}class IA extends ue{constructor(t){super(),de(this,t,PA,CA,he,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},wA)}}function Jo(n,t={}){let e="";const{needZ:i,needA:s}=t;return(i?n.slice().concat(n[0]):n.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,h=l+","+c;return a===0?(e+="M"+h,e):s!=null&&s[a]?(e+="A"+s[a]+","+h,e):(e+="L"+h,e)}),e+(i?"Z":"")}function Id({x:n,y:t},e){const{max:i,min:s}=e;return{x:n-s.x,y:i.y-t}}function MA(n,t){const e=n.x*1e3+t.bounding.origin.x,i=-n.z*1e3+t.bounding.origin.y;return{x:e,y:i}}function EA(n,t){const e=t.bounding,i=e.max.x-e.min.x,s=e.max.y-e.min.y;return{x:(n.x-e.min.x)/i,y:(e.max.y-n.y)/s}}function kA(n,t){return Math.max(...t.work.observers.map(i=>n.z>=i.standingPosition.z?i.floorIndex:0))}function xA(n){let t;return{c(){t=Ne("path"),P(t,"d",n[0]),P(t,"fill","#2F313A")},m(e,i){B(e,t,i)},p(e,[i]){i&1&&P(t,"d",e[0])},i:$,o:$,d(e){e&&V(t)}}}function DA(n,t,e){let i,{path:s}=t;return n.$$set=o=>{"path"in o&&e(1,s=o.path)},n.$$.update=()=>{n.$$.dirty&2&&e(0,i=Jo(s,{needZ:!0}))},[i,s]}class SA extends ue{constructor(t){super(),de(this,t,DA,xA,he,{path:1})}}function LA(n){let t,e,i,s,o,r;return{c(){t=Ne("defs"),e=Ne("pattern"),i=Ne("rect"),s=Ne("path"),o=te(),r=Ne("path"),P(i,"x","0"),P(i,"y","0"),P(i,"width",n[1]),P(i,"height",n[1]),P(i,"fill","#323747"),P(s,"d",n[2]),P(s,"stroke","#ffffff"),P(s,"stroke-opacity","0.06"),P(s,"stroke-width","0.5"),P(s,"fill","none"),P(e,"id","fpm-room-pattern-0"),P(e,"x","0"),P(e,"y","0"),P(e,"width",n[1]),P(e,"height",n[1]),P(e,"patternUnits","userSpaceOnUse"),P(e,"patternTransform","scale(50 50)"),P(r,"d",n[0]),P(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){B(a,t,l),O(t,e),O(e,i),O(e,s),B(a,o,l),B(a,r,l)},p(a,[l]){l&1&&P(r,"d",a[0])},i:$,o:$,d(a){a&&V(t),a&&V(o),a&&V(r)}}}const Ba=6;function TA(n,t,e){let i,{path:s}=t;const o=Ba*2,r=`M0 ${Ba} h ${o} M${Ba} 0 v ${o}`;return n.$$set=a=>{"path"in a&&e(3,s=a.path)},n.$$.update=()=>{n.$$.dirty&8&&e(0,i=Jo(s,{needZ:!0}))},[i,o,r,s]}class zA extends ue{constructor(t){super(),de(this,t,TA,LA,he,{path:3})}}function jA(n){let t,e,i,s,o,r,a,l,c,h,u;return{c(){t=Ne("defs"),e=Ne("pattern"),i=Ne("rect"),s=Ne("pattern"),o=Ne("rect"),r=te(),a=Ne("path"),l=te(),c=Ne("path"),h=te(),u=Ne("path"),P(i,"x","0"),P(i,"y","0"),P(i,"width","6"),P(i,"height","50"),P(i,"fill","none"),P(i,"stroke","#4B4B57"),P(i,"stroke-width","0.5"),P(e,"id","room-material-pattern-1"),P(e,"x","0"),P(e,"y","0"),P(e,"width","12"),P(e,"height","50"),P(e,"patternUnits","userSpaceOnUse"),P(e,"patternTransform","scale(50 50)"),P(o,"x","0"),P(o,"y","0"),P(o,"width","6"),P(o,"height","50"),P(o,"fill","none"),P(o,"stroke","#4B4B57"),P(o,"stroke-width","0.5"),P(s,"id","room-material-pattern-2"),P(s,"x","6"),P(s,"y","25"),P(s,"width","12"),P(s,"height","50"),P(s,"patternUnits","userSpaceOnUse"),P(s,"patternTransform","scale(50 50)"),P(a,"d",n[0]),P(a,"fill","#43434D"),P(c,"d",n[0]),P(c,"fill","url(#room-material-pattern-1)"),P(u,"d",n[0]),P(u,"fill","url(#room-material-pattern-2)")},m(f,m){B(f,t,m),O(t,e),O(e,i),O(t,s),O(s,o),B(f,r,m),B(f,a,m),B(f,l,m),B(f,c,m),B(f,h,m),B(f,u,m)},p(f,[m]){m&1&&P(a,"d",f[0]),m&1&&P(c,"d",f[0]),m&1&&P(u,"d",f[0])},i:$,o:$,d(f){f&&V(t),f&&V(r),f&&V(a),f&&V(l),f&&V(c),f&&V(h),f&&V(u)}}}function OA(n,t,e){let i,{path:s}=t;return n.$$set=o=>{"path"in o&&e(1,s=o.path)},n.$$.update=()=>{n.$$.dirty&2&&e(0,i=Jo(s,{needZ:!0}))},[i,s]}class VA extends ue{constructor(t){super(),de(this,t,OA,jA,he,{path:1})}}function BA(n){ge(n,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Md(n,t,e){const i=n.slice();return i[5]=t[e],i}function _A(n){let t,e;return t=new zA({props:{path:n[5].path}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.path=i[5].path),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function RA(n){let t,e;return t=new VA({props:{path:n[5].path}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.path=i[5].path),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function FA(n){let t,e;return t=new SA({props:{path:n[5].path}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.path=i[5].path),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function Ed(n){let t,e,i,s;const o=[FA,RA,_A],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(n),i=r[e]=o[e](n),{c(){t=Ne("svg"),i.c(),P(t,"width","100%"),P(t,"height","100%"),P(t,"viewBox",`0 0 ${n[1]} ${n[2]}`),P(t,"class","svelte-1dykexu")},m(l,c){B(l,t,c),r[e].m(t,null),s=!0},p(l,c){let h=e;e=a(l),e===h?r[e].p(l,c):(fe(),_(r[h],1,1,()=>{r[h]=null}),me(),i=r[e],i?i.p(l,c):(i=r[e]=o[e](l),i.c()),D(i,1),i.m(t,null))},i(l){s||(D(i),s=!0)},o(l){_(i),s=!1},d(l){l&&V(t),r[e].d()}}}function NA(n){let t,e,i=n[0],s=[];for(let r=0;r<i.length;r+=1)s[r]=Ed(Md(n,i,r));const o=r=>_(s[r],1,1,()=>{s[r]=null});return{c(){t=T("div");for(let r=0;r<s.length;r+=1)s[r].c();P(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){B(r,t,a);for(let l=0;l<s.length;l+=1)s[l]&&s[l].m(t,null);e=!0},p(r,[a]){if(a&7){i=r[0];let l;for(l=0;l<i.length;l+=1){const c=Md(r,i,l);s[l]?(s[l].p(c,a),D(s[l],1)):(s[l]=Ed(c),s[l].c(),D(s[l],1),s[l].m(t,null))}for(fe(),l=i.length;l<s.length;l+=1)o(l);me()}},i(r){if(!e){for(let a=0;a<i.length;a+=1)D(s[a]);e=!0}},o(r){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)_(s[a]);e=!1},d(r){r&&V(t),Zt(s,r)}}}function GA(n,t,e){let i,{floorIndex:s}=t,{floorplanData:o}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return n.$$set=l=>{"floorIndex"in l&&e(3,s=l.floorIndex),"floorplanData"in l&&e(4,o=l.floorplanData)},n.$$.update=()=>{n.$$.dirty&24&&e(0,i=o.floorDatas[s].rooms.map(l=>ie(x({},l),{path:l.path.map(c=>Id(c,o.bounding))})))},[i,r,a,s,o]}class QA extends ue{constructor(t){super(),de(this,t,GA,NA,he,{floorIndex:3,floorplanData:4},BA)}}function WA(n){ge(n,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function HA(n){let t,e,i,s;return{c(){t=Ne("path"),P(t,"d",n[5]),P(t,"fill","#fff"),P(t,"style",n[2]),P(t,"id",e=`${n[1]}_${n[0].id}`),P(t,"class","svelte-qq2273")},m(o,r){B(o,t,r),i||(s=[Ce(t,"mouseenter",n[3]),Ce(t,"mouseleave",n[4])],i=!0)},p(o,[r]){r&4&&P(t,"style",o[2]),r&3&&e!==(e=`${o[1]}_${o[0].id}`)&&P(t,"id",e)},i:$,o:$,d(o){o&&V(t),i=!1,rt(s)}}}function UA(n,t,e){let i,s,{room:o}=t,{floorIndex:r}=t,{floorplanData:a}=t,{highlightData:l}=t,{hoveredRoom:c}=t;function h(){c==null||c.set(o)}function u(){c==null||c.set(void 0)}const{bounding:f}=a,m=Jo(o.path,{needZ:!0,format:v=>Id(v,f)});return n.$$set=v=>{"room"in v&&e(0,o=v.room),"floorIndex"in v&&e(1,r=v.floorIndex),"floorplanData"in v&&e(6,a=v.floorplanData),"highlightData"in v&&e(7,l=v.highlightData),"hoveredRoom"in v&&e(8,c=v.hoveredRoom)},n.$$.update=()=>{n.$$.dirty&131&&e(9,i=l[`${r}_${o.id}`]),n.$$.dirty&512&&e(2,s=i?`fill: ${i.color}; --opacity: ${i.opacity}; pointer-events: ${i.disabled?"none":"auto"}`:null)},[o,r,s,h,u,m,a,l,c,i]}class YA extends ue{constructor(t){super(),de(this,t,UA,HA,he,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},WA)}}function XA(n){ge(n,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function kd(n,t,e){const i=n.slice();return i[6]=t[e],i}function xd(n,t){let e,i,s;const o=[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}];let r={};for(let a=0;a<o.length;a+=1)r=gt(r,o[a]);return i=new YA({props:r}),{key:n,first:null,c(){e=Ee(),re(i.$$.fragment),this.first=e},m(a,l){B(a,e,l),se(i,a,l),s=!0},p(a,l){t=a;const c=l&15?Ct(o,[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}]):{};i.$set(c)},i(a){s||(D(i.$$.fragment,a),s=!0)},o(a){_(i.$$.fragment,a),s=!1},d(a){a&&V(e),oe(i,a)}}}function ZA(n){let t,e,i=[],s=new Map,o,r=n[1].floorDatas[n[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=kd(n,r,l),h=a(c);s.set(h,i[l]=xd(h,c))}return{c(){t=T("div"),e=Ne("svg");for(let l=0;l<i.length;l+=1)i[l].c();P(e,"width","100%"),P(e,"height","100%"),P(e,"viewBox",`0 0 ${n[4]} ${n[5]}`),P(e,"class","svelte-1kqo6e4"),P(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){B(l,t,c),O(t,e);for(let h=0;h<i.length;h+=1)i[h]&&i[h].m(e,null);o=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,fe(),i=Jt(i,c,a,1,l,r,s,e,ji,xd,null,kd),me())},i(l){if(!o){for(let c=0;c<r.length;c+=1)D(i[c]);o=!0}},o(l){for(let c=0;c<i.length;c+=1)_(i[c]);o=!1},d(l){l&&V(t);for(let c=0;c<i.length;c+=1)i[c].d()}}}function JA(n,t,e){let{floorIndex:i}=t,{floorplanData:s}=t,{highlightData:o}=t,{hoveredRoom:r}=t;const a=s.bounding.max.x-s.bounding.min.x,l=s.bounding.max.y-s.bounding.min.y;return n.$$set=c=>{"floorIndex"in c&&e(0,i=c.floorIndex),"floorplanData"in c&&e(1,s=c.floorplanData),"highlightData"in c&&e(2,o=c.highlightData),"hoveredRoom"in c&&e(3,r=c.hoveredRoom)},[i,s,o,r,a,l]}class Dd extends ue{constructor(t){super(),de(this,t,JA,ZA,he,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},XA)}}function qA(n){ge(n,"svelte-1lm20n5",".missing-floor.svelte-1lm20n5{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;flex-direction:column;align-items:center}.text.svelte-1lm20n5{margin-top:0.75rem;color:#fff;opacity:0.3}")}function Sd(n){let t,e=n[0].text+"",i;return{c(){t=T("span"),i=Se(e),P(t,"class","text svelte-1lm20n5"),z(t,"font-size",n[0].textFontSize+"px")},m(s,o){B(s,t,o),O(t,i)},p(s,o){o&1&&e!==(e=s[0].text+"")&&Te(i,e),o&1&&z(t,"font-size",s[0].textFontSize+"px")},d(s){s&&V(t)}}}function KA(n){let t,e,i,s,o=n[0].text&&Sd(n);return{c(){t=T("div"),e=T("img"),s=te(),o&&o.c(),P(e,"class","image"),P(e,"alt","缺省楼层展位图"),ft(e.src,i=n[0].imageURL)||P(e,"src",i),z(e,"width",n[0].imageWidth+"px"),z(e,"height",n[0].imageHeight+"px"),P(t,"class","missing-floor svelte-1lm20n5")},m(r,a){B(r,t,a),O(t,e),O(t,s),o&&o.m(t,null)},p(r,[a]){a&1&&!ft(e.src,i=r[0].imageURL)&&P(e,"src",i),a&1&&z(e,"width",r[0].imageWidth+"px"),a&1&&z(e,"height",r[0].imageHeight+"px"),r[0].text?o?o.p(r,a):(o=Sd(r),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},i:$,o:$,d(r){r&&V(t),o&&o.d()}}}function $A(n,t,e){let{missingFloorConfig:i}=t;return n.$$set=s=>{"missingFloorConfig"in s&&e(0,i=s.missingFloorConfig)},[i]}class eb extends ue{constructor(t){super(),de(this,t,$A,KA,he,{missingFloorConfig:0},qA)}}const Bi="data:image/png;base64,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";function qo(n){return n*180/Math.PI}function tb(n){ge(n,"svelte-17hhq1b",".floorplan__camera-position.svelte-17hhq1b{pointer-events:none;position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17hhq1b{position:absolute;background-repeat:no-repeat;background-size:100%}")}function ib(n){let t,e;return{c(){t=T("div"),e=T("div"),P(e,"class","floorplan__camera-rotate svelte-17hhq1b"),z(e,"background-image",`url(${n[0]||Bi})`),z(e,"width",n[4]),z(e,"height",n[4]),z(e,"left","-"+n[4]),z(e,"top","-"+n[4]),z(e,"transform",`rotate(${n[3]}deg)`),z(e,"transform-origin",`${n[4]} ${n[4]}`),P(t,"class","floorplan__camera-position svelte-17hhq1b"),z(t,"left",n[1]),z(t,"top",n[2])},m(i,s){B(i,t,s),O(t,e)},p(i,[s]){s&1&&z(e,"background-image",`url(${i[0]||Bi})`);const o=s&1;o&&z(e,"width",i[4]),o&&z(e,"height",i[4]),o&&z(e,"left","-"+i[4]),o&&z(e,"top","-"+i[4]),o&&z(e,"transform",`rotate(${i[3]}deg)`),o&&z(e,"transform-origin",`${i[4]} ${i[4]}`)},i:$,o:$,d(i){i&&V(t)}}}function nb(n,t,e){let{panoIndex:i}=t,{floorplanData:s}=t,{lastPanoramaLongitude:o}=t,{cameraImageUrl:r}=t;const{observers:a}=s,l=a[i],c=l.positionInImage.x,h=l.positionInImage.y,u=c*100+"%",f=h*100+"%",m=-qo(o)+45,v=document.body.clientWidth,p=document.body.clientHeight,A=`${(v<500||p<500?17:37)/16}rem`;return n.$$set=w=>{"panoIndex"in w&&e(5,i=w.panoIndex),"floorplanData"in w&&e(6,s=w.floorplanData),"lastPanoramaLongitude"in w&&e(7,o=w.lastPanoramaLongitude),"cameraImageUrl"in w&&e(0,r=w.cameraImageUrl)},[r,u,f,m,A,i,s,o]}let sb=class extends ue{constructor(t){super(),de(this,t,nb,ib,he,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},tb)}};const ob="data:image/png;base64,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";function rb(n){ge(n,"svelte-rpkaro",".floorplan-plugin__compass.svelte-rpkaro{position:absolute;left:50%;top:-2.875rem;width:14.4375rem;height:2.5625rem;will-change:opacity;transform-origin:center 11.5rem}.floorplan-plugin__compass-image.svelte-rpkaro{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-rpkaro{position:absolute;left:50%;top:0.9375rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.625rem;color:#fff}")}function ab(n){let t,e,i,s,o;return{c(){t=T("div"),e=T("div"),i=te(),s=T("span"),o=Se(n[0]),P(e,"class","floorplan-plugin__compass-image svelte-rpkaro"),z(e,"background-image",`url(${ob})`),P(s,"class","floorplan-plugin__compass-text svelte-rpkaro"),P(t,"class","floorplan-plugin__compass svelte-rpkaro"),z(t,"transform",n[2])},m(r,a){B(r,t,a),O(t,e),O(t,i),O(t,s),O(s,o)},p(r,a){a&1&&Te(o,r[0])},d(r){r&&V(t)}}}function lb(n){let t,e=n[1]&&ab(n);return{c(){e&&e.c(),t=Ee()},m(i,s){e&&e.m(i,s),B(i,t,s)},p(i,[s]){i[1]&&e.p(i,s)},i:$,o:$,d(i){e&&e.d(i),i&&V(t)}}}function cb(n,t,e){var c;let{floorplanData:i}=t,{northDesc:s}=t;const o=(c=i.entrance)==null?void 0:c.northRad,r=typeof o=="number",l=`translateX(-50%) translateZ(10px) rotate(${-(o?qo(o):0)+90}deg)`;return n.$$set=h=>{"floorplanData"in h&&e(3,i=h.floorplanData),"northDesc"in h&&e(0,s=h.northDesc)},[s,r,l,i]}class hb extends ue{constructor(t){super(),de(this,t,cb,lb,he,{floorplanData:3,northDesc:0},rb)}}function db(n){ge(n,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function ub(n){let t,e,i,s,o,r,a,l,c,h;const u=[{floorIndex:n[2],floorplanData:n[11]}];let f={};for(let C=0;C<u.length;C+=1)f=gt(f,u[C]);t=new QA({props:f});let m=(n[3]||n[5])&&Ld(n);const v=[{floorplanData:n[11],floorIndex:n[2]}];let p={};for(let C=0;C<v.length;C+=1)p=gt(p,v[C]);s=new cd({props:p});let g=n[6]&&Td(n),A=n[10]&&zd(n),w=n[4]&&jd(n),I=n[22]&&Od(n);return{c(){re(t.$$.fragment),e=te(),m&&m.c(),i=te(),re(s.$$.fragment),o=te(),g&&g.c(),r=te(),A&&A.c(),a=te(),w&&w.c(),l=te(),I&&I.c(),c=Ee()},m(C,M){se(t,C,M),B(C,e,M),m&&m.m(C,M),B(C,i,M),se(s,C,M),B(C,o,M),g&&g.m(C,M),B(C,r,M),A&&A.m(C,M),B(C,a,M),w&&w.m(C,M),B(C,l,M),I&&I.m(C,M),B(C,c,M),h=!0},p(C,M){const E=M&2052?Ct(u,[{floorIndex:C[2],floorplanData:C[11]}]):{};t.$set(E),C[3]||C[5]?m?(m.p(C,M),M&40&&D(m,1)):(m=Ld(C),m.c(),D(m,1),m.m(i.parentNode,i)):m&&(fe(),_(m,1,1,()=>{m=null}),me());const S=M&2052?Ct(v,[{floorplanData:C[11],floorIndex:C[2]}]):{};s.$set(S),C[6]?g?(g.p(C,M),M&64&&D(g,1)):(g=Td(C),g.c(),D(g,1),g.m(r.parentNode,r)):g&&(fe(),_(g,1,1,()=>{g=null}),me()),C[10]?A?(A.p(C,M),M&1024&&D(A,1)):(A=zd(C),A.c(),D(A,1),A.m(a.parentNode,a)):A&&(fe(),_(A,1,1,()=>{A=null}),me()),C[4]?w?(w.p(C,M),M&16&&D(w,1)):(w=jd(C),w.c(),D(w,1),w.m(l.parentNode,l)):w&&(fe(),_(w,1,1,()=>{w=null}),me()),C[22]?I?(I.p(C,M),M&4194304&&D(I,1)):(I=Od(C),I.c(),D(I,1),I.m(c.parentNode,c)):I&&(fe(),_(I,1,1,()=>{I=null}),me())},i(C){h||(D(t.$$.fragment,C),D(m),D(s.$$.fragment,C),D(g),D(A),D(w),D(I),h=!0)},o(C){_(t.$$.fragment,C),_(m),_(s.$$.fragment,C),_(g),_(A),_(w),_(I),h=!1},d(C){oe(t,C),C&&V(e),m&&m.d(C),C&&V(i),oe(s,C),C&&V(o),g&&g.d(C),C&&V(r),A&&A.d(C),C&&V(a),w&&w.d(C),C&&V(l),I&&I.d(C),C&&V(c)}}}function fb(n){let t,e;return t=new eb({props:{missingFloorConfig:n[18]}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&262144&&(o.missingFloorConfig=i[18]),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function Ld(n){let t,e;const i=[{floorIndex:n[2],floorplanData:n[11],hoveredRoom:n[24],highlightData:n[17]}];let s={};for(let o=0;o<i.length;o+=1)s=gt(s,i[o]);return t=new Dd({props:s}),{c(){re(t.$$.fragment)},m(o,r){se(t,o,r),e=!0},p(o,r){const a=r&16910340?Ct(i,[{floorIndex:o[2],floorplanData:o[11],hoveredRoom:o[24],highlightData:o[17]}]):{};t.$set(a)},i(o){e||(D(t.$$.fragment,o),e=!0)},o(o){_(t.$$.fragment,o),e=!1},d(o){oe(t,o)}}}function Td(n){let t,e;const i=[{floorplanData:n[11],roomAreaEnable:n[7],roomNameEnable:n[8],roomDimensionEnable:n[9],floorIndex:n[2],getRoomAreaText:n[12],getRoomDimensionText:n[13],getLabelElement:n[14],hoveredRoom:n[24],adaptiveRoomLabelVisibleEnable:n[16]}];let s={};for(let o=0;o<i.length;o+=1)s=gt(s,i[o]);return t=new pA({props:s}),{c(){re(t.$$.fragment)},m(o,r){se(t,o,r),e=!0},p(o,r){const a=r&16874372?Ct(i,[{floorplanData:o[11],roomAreaEnable:o[7],roomNameEnable:o[8],roomDimensionEnable:o[9],floorIndex:o[2],getRoomAreaText:o[12],getRoomDimensionText:o[13],getLabelElement:o[14],hoveredRoom:o[24],adaptiveRoomLabelVisibleEnable:o[16]}]):{};t.$set(a)},i(o){e||(D(t.$$.fragment,o),e=!0)},o(o){_(t.$$.fragment,o),e=!1},d(o){oe(t,o)}}}function zd(n){let t,e;const i=[{floorplanData:n[11],floorIndex:n[2],getRuleDistanceText:n[15]}];let s={};for(let o=0;o<i.length;o+=1)s=gt(s,i[o]);return t=new IA({props:s}),{c(){re(t.$$.fragment)},m(o,r){se(t,o,r),e=!0},p(o,r){const a=r&34820?Ct(i,[{floorplanData:o[11],floorIndex:o[2],getRuleDistanceText:o[15]}]):{};t.$set(a)},i(o){e||(D(t.$$.fragment,o),e=!0)},o(o){_(t.$$.fragment,o),e=!1},d(o){oe(t,o)}}}function jd(n){let t,e;const i=[{panoIndex:n[0],floorplanData:n[11],lastPanoramaLongitude:n[19],cameraImageUrl:n[20]}];let s={};for(let o=0;o<i.length;o+=1)s=gt(s,i[o]);return t=new sb({props:s}),{c(){re(t.$$.fragment)},m(o,r){se(t,o,r),e=!0},p(o,r){const a=r&1574913?Ct(i,[{panoIndex:o[0],floorplanData:o[11],lastPanoramaLongitude:o[19],cameraImageUrl:o[20]}]):{};t.$set(a)},i(o){e||(D(t.$$.fragment,o),e=!0)},o(o){_(t.$$.fragment,o),e=!1},d(o){oe(t,o)}}}function Od(n){let t,e;return t=new hb({props:{floorplanData:n[11],northDesc:n[21]}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&2048&&(o.floorplanData=i[11]),s&2097152&&(o.northDesc=i[21]),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function mb(n){let t,e,i,s,o;const r=[fb,ub],a=[];function l(c,h){return c[23]?1:0}return e=l(n),i=a[e]=r[e](n),{c(){t=T("div"),i.c(),P(t,"class",s=it(`floorplan-plugin__floor${n[1]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(c,h){B(c,t,h),a[e].m(t,null),o=!0},p(c,[h]){let u=e;e=l(c),e===u?a[e].p(c,h):(fe(),_(a[u],1,1,()=>{a[u]=null}),me(),i=a[e],i?i.p(c,h):(i=a[e]=r[e](c),i.c()),D(i,1),i.m(t,null)),(!o||h&2&&s!==(s=it(`floorplan-plugin__floor${c[1]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&P(t,"class",s)},i(c){o||(D(i),o=!0)},o(c){_(i),o=!1},d(c){c&&V(t),a[e].d()}}}function gb(n,t,e){let i,s,{panoIndex:o}=t,{isCurrent:r}=t,{floorIndex:a}=t,{highlightEnable:l}=t,{cameraEnable:c}=t,{hoverEnable:h}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:f}=t,{roomNameEnable:m}=t,{roomDimensionEnable:v}=t,{ruleLabelsEnable:p}=t,{floorplanData:g}=t,{getRoomAreaText:A}=t,{getRoomDimensionText:w}=t,{getLabelElement:I}=t,{getRuleDistanceText:C}=t,{adaptiveRoomLabelVisibleEnable:M}=t,{highlightData:E}=t,{missingFloorConfig:S}=t,{lastPanoramaLongitude:L}=t,{cameraImageUrl:W}=t,{northDesc:R}=t,{compassEnable:U}=t,{store:j=void 0}=t;const Y=Va(void 0);return Y.subscribe(N=>{j&&e(25,j.roomOnMouse=N,j)}),n.$$set=N=>{"panoIndex"in N&&e(0,o=N.panoIndex),"isCurrent"in N&&e(1,r=N.isCurrent),"floorIndex"in N&&e(2,a=N.floorIndex),"highlightEnable"in N&&e(3,l=N.highlightEnable),"cameraEnable"in N&&e(4,c=N.cameraEnable),"hoverEnable"in N&&e(5,h=N.hoverEnable),"roomLabelsEnable"in N&&e(6,u=N.roomLabelsEnable),"roomAreaEnable"in N&&e(7,f=N.roomAreaEnable),"roomNameEnable"in N&&e(8,m=N.roomNameEnable),"roomDimensionEnable"in N&&e(9,v=N.roomDimensionEnable),"ruleLabelsEnable"in N&&e(10,p=N.ruleLabelsEnable),"floorplanData"in N&&e(11,g=N.floorplanData),"getRoomAreaText"in N&&e(12,A=N.getRoomAreaText),"getRoomDimensionText"in N&&e(13,w=N.getRoomDimensionText),"getLabelElement"in N&&e(14,I=N.getLabelElement),"getRuleDistanceText"in N&&e(15,C=N.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in N&&e(16,M=N.adaptiveRoomLabelVisibleEnable),"highlightData"in N&&e(17,E=N.highlightData),"missingFloorConfig"in N&&e(18,S=N.missingFloorConfig),"lastPanoramaLongitude"in N&&e(19,L=N.lastPanoramaLongitude),"cameraImageUrl"in N&&e(20,W=N.cameraImageUrl),"northDesc"in N&&e(21,R=N.northDesc),"compassEnable"in N&&e(22,U=N.compassEnable),"store"in N&&e(25,j=N.store)},n.$$.update=()=>{n.$$.dirty&2052&&e(26,i=g.floorDatas[a]),n.$$.dirty&67108864&&e(23,s=i.rooms.length>0)},[o,r,a,l,c,h,u,f,m,v,p,g,A,w,I,C,M,E,S,L,W,R,U,s,Y,j,i]}let pb=class extends ue{constructor(t){super(),de(this,t,gb,mb,he,{panoIndex:0,isCurrent:1,floorIndex:2,highlightEnable:3,cameraEnable:4,hoverEnable:5,roomLabelsEnable:6,roomAreaEnable:7,roomNameEnable:8,roomDimensionEnable:9,ruleLabelsEnable:10,floorplanData:11,getRoomAreaText:12,getRoomDimensionText:13,getLabelElement:14,getRuleDistanceText:15,adaptiveRoomLabelVisibleEnable:16,highlightData:17,missingFloorConfig:18,lastPanoramaLongitude:19,cameraImageUrl:20,northDesc:21,compassEnable:22,store:25},db)}};function vb(n){ge(n,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function Vd(n,t,e){const i=n.slice();return i[25]=t[e],i}function Bd(n){let t,e,i,s=n[14].floorDatas,o=[];for(let a=0;a<s.length;a+=1)o[a]=_d(Vd(n,s,a));const r=a=>_(o[a],1,1,()=>{o[a]=null});return{c(){t=T("div");for(let a=0;a<o.length;a+=1)o[a].c();P(t,"class","floorplan-main svelte-86bqav")},m(a,l){B(a,t,l);for(let c=0;c<o.length;c+=1)o[c]&&o[c].m(t,null);i=!0},p(a,l){if(n=a,l&33554428){s=n[14].floorDatas;let c;for(c=0;c<s.length;c+=1){const h=Vd(n,s,c);o[c]?(o[c].p(h,l),D(o[c],1)):(o[c]=_d(h),o[c].c(),D(o[c],1),o[c].m(t,null))}for(fe(),c=s.length;c<o.length;c+=1)r(c);me()}},i(a){if(!i){for(let l=0;l<s.length;l+=1)D(o[l]);e||nt(()=>{e=zi(t,mt,{duration:n[0],easing:bi}),e.start()}),i=!0}},o(a){o=o.filter(Boolean);for(let l=0;l<o.length;l+=1)_(o[l]);i=!1},d(a){a&&V(t),Zt(o,a)}}}function _d(n){let t,e;const i=[{hoverEnable:n[6],highlightEnable:n[7],floorplanData:n[14],getRoomAreaText:n[17],getRoomDimensionText:n[18],getLabelElement:n[19],getRuleDistanceText:n[20],roomLabelsEnable:n[9],roomAreaEnable:n[10],roomNameEnable:n[11],roomDimensionEnable:n[12],ruleLabelsEnable:n[13],adaptiveRoomLabelVisibleEnable:n[21],highlightData:n[22],missingFloorConfig:n[23],panoIndex:n[3],cameraEnable:n[5],cameraImageUrl:n[16],lastPanoramaLongitude:n[15],compassEnable:n[8],northDesc:n[2],store:n[24]},{floorIndex:n[25].floorIndex},{isCurrent:n[25].floorIndex===n[4]}];let s={};for(let o=0;o<i.length;o+=1)s=gt(s,i[o]);return t=new pb({props:s}),{c(){re(t.$$.fragment)},m(o,r){se(t,o,r),e=!0},p(o,r){const a=r&33554428?Ct(i,[r&33554412&&{hoverEnable:o[6],highlightEnable:o[7],floorplanData:o[14],getRoomAreaText:o[17],getRoomDimensionText:o[18],getLabelElement:o[19],getRuleDistanceText:o[20],roomLabelsEnable:o[9],roomAreaEnable:o[10],roomNameEnable:o[11],roomDimensionEnable:o[12],ruleLabelsEnable:o[13],adaptiveRoomLabelVisibleEnable:o[21],highlightData:o[22],missingFloorConfig:o[23],panoIndex:o[3],cameraEnable:o[5],cameraImageUrl:o[16],lastPanoramaLongitude:o[15],compassEnable:o[8],northDesc:o[2],store:o[24]},r&16384&&{floorIndex:o[25].floorIndex},r&16400&&{isCurrent:o[25].floorIndex===o[4]}]):{};t.$set(a)},i(o){e||(D(t.$$.fragment,o),e=!0)},o(o){_(t.$$.fragment,o),e=!1},d(o){oe(t,o)}}}function Ab(n){let t,e,i=n[1]&&Bd(n);return{c(){i&&i.c(),t=Ee()},m(s,o){i&&i.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[1]?i?(i.p(s,o),o&2&&D(i,1)):(i=Bd(s),i.c(),D(i,1),i.m(t.parentNode,t)):i&&(fe(),_(i,1,1,()=>{i=null}),me())},i(s){e||(D(i),e=!0)},o(s){_(i),e=!1},d(s){i&&i.d(s),s&&V(t)}}}function bb(n,t,e){let{duration:i=0}=t,{visible:s}=t,{northDesc:o}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:h}=t,{compassEnable:u}=t,{roomLabelsEnable:f}=t,{roomAreaEnable:m}=t,{roomNameEnable:v}=t,{roomDimensionEnable:p}=t,{ruleLabelsEnable:g}=t,{floorplanData:A}=t,{lastPanoramaLongitude:w}=t,{cameraImageUrl:I}=t,{getRoomAreaText:C}=t,{getRoomDimensionText:M}=t,{getLabelElement:E}=t,{getRuleDistanceText:S}=t,{adaptiveRoomLabelVisibleEnable:L}=t,{highlightData:W}=t,{missingFloorConfig:R}=t,{store:U=void 0}=t;return n.$$set=j=>{"duration"in j&&e(0,i=j.duration),"visible"in j&&e(1,s=j.visible),"northDesc"in j&&e(2,o=j.northDesc),"panoIndex"in j&&e(3,r=j.panoIndex),"floorIndex"in j&&e(4,a=j.floorIndex),"cameraEnable"in j&&e(5,l=j.cameraEnable),"hoverEnable"in j&&e(6,c=j.hoverEnable),"highlightEnable"in j&&e(7,h=j.highlightEnable),"compassEnable"in j&&e(8,u=j.compassEnable),"roomLabelsEnable"in j&&e(9,f=j.roomLabelsEnable),"roomAreaEnable"in j&&e(10,m=j.roomAreaEnable),"roomNameEnable"in j&&e(11,v=j.roomNameEnable),"roomDimensionEnable"in j&&e(12,p=j.roomDimensionEnable),"ruleLabelsEnable"in j&&e(13,g=j.ruleLabelsEnable),"floorplanData"in j&&e(14,A=j.floorplanData),"lastPanoramaLongitude"in j&&e(15,w=j.lastPanoramaLongitude),"cameraImageUrl"in j&&e(16,I=j.cameraImageUrl),"getRoomAreaText"in j&&e(17,C=j.getRoomAreaText),"getRoomDimensionText"in j&&e(18,M=j.getRoomDimensionText),"getLabelElement"in j&&e(19,E=j.getLabelElement),"getRuleDistanceText"in j&&e(20,S=j.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in j&&e(21,L=j.adaptiveRoomLabelVisibleEnable),"highlightData"in j&&e(22,W=j.highlightData),"missingFloorConfig"in j&&e(23,R=j.missingFloorConfig),"store"in j&&e(24,U=j.store)},[i,s,o,r,a,l,c,h,u,f,m,v,p,g,A,w,I,C,M,E,S,L,W,R,U]}let _a=class extends ue{constructor(t){super(),de(this,t,bb,Ab,he,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,roomDimensionEnable:12,ruleLabelsEnable:13,floorplanData:14,lastPanoramaLongitude:15,cameraImageUrl:16,getRoomAreaText:17,getRoomDimensionText:18,getLabelElement:19,getRuleDistanceText:20,adaptiveRoomLabelVisibleEnable:21,highlightData:22,missingFloorConfig:23,store:24},vb)}};const yb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function wb(n){return H(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(s){return H(this,null,function*(){const o={index:s.index,url:s.url,svgUrl:s.svg_url};if(s.svg_url){const r=yield fetch(s.svg_url,{headers:t}).then(a=>a.text());o.svgContent=r}return o})};return yield Promise.all(n.map(e))})}function Cb(n){const t={id:n.id,size:n.size,name:n.name,path:n.path,roomType:n.room_type,floorType:n.floor_type,roomLabel:{position:n.room_label.position,positionInImage:n.room_label.position_in_image},observerIndexs:n.observer_indexs};return n.dimension&&Object.assign(t,{dimension:n.dimension}),t}function Pb(n){return{floorName:n.floor_name,floorIndex:n.floor_index,rooms:n.rooms.map(Cb),rules:n.rules}}function Ib(n){return{index:n.index,floorIndex:n.floor_index,position:n.position,positionInImage:n.position_in_image}}function Mb(n){return{rad:n.rad,position:n.position,positionInImage:n.position_in_image,northRad:n.north_rad,roomId:n.room_id,floorIndex:n.floor_index}}function _i(n){return H(this,null,function*(){const t=yield wb(n.outlines),e=n.computed_data.bounding,i=n.computed_data.floor_datas.map(Pb),s=n.computed_data.entrance?Mb(n.computed_data.entrance):null;return{outlines:t,entrance:s,bounding:e,floorDatas:i,observers:n.computed_data.observers.map(Ib)}})}function Eb(n,t,e){return n.map(s=>{const o=s.position,r=s.icon?s.icon:{url:yb,width:45,height:48},a=kA(o,t),l=MA(o,e),c=EA(l,e);return{floorIndex:a,icon:r,id:s.id,position:l,positionInImage:c}})}function kb(n,t){return t(n),n}function Jn(n,t){return kb({},e=>{for(const i in n)t.indexOf(i)===-1&&(e[i]=n[i])})}function Rd(n,t){const e=Math.max(...n.work.observers.map(i=>i.floorIndex));return t>e?n.model.bounding.max.y:Math.max(...n.work.observers.filter(i=>i.floorIndex===t).map(i=>i.standingPosition.y))}function Ra(n,t,e=Vi.BOUNDING_CENTER){const i=Rd(n,t),s=Rd(n,t+1);return e===Vi.BOUNDING_CENTER?(n.model.bounding.max.y+n.model.bounding.min.y)/2:e===Vi.CEILING?s:i}function Fa(n,t,e,i){const s=Ra(n,e,i==null?void 0:i.attachedTo),o=new b.Vector3(0,s,0),r=new b.Vector3(1,s,0),a=o.clone().project(n.camera),l=r.clone().project(n.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}let Ri=class{constructor(t,e){d(this,"VERSION","3.59.8");d(this,"NAME");d(this,"five");d(this,"workUtil");d(this,"fiveUtil");d(this,"hooks",new ht);d(this,"staticPrefix","//vr-image-4.realsee-cdn.cn");this.five=t,this.fiveUtil=new Io(t),this.workUtil=this.fiveUtil.workUtil,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}set workCode(t){this.workUtil.workCode=t,this.onWorkCodeChange()}get workCode(){return this.workUtil.workCode}updateFive(t){this.five=t,this.fiveUtil.five=t,this.workUtil.five=t}getCurrentState(){return this.state}absoluteUrl(t){return ma(this.staticPrefix,t)}onWorkCodeChange(){}},wi=class extends Ri{};var St=(n=>(n.UnknownError="UnknownError",n.DataNotLoaded="DataNotLoaded",n.UpdateSizeError="UpdateSizeError",n.BreakOffByHide="BreakOffByHide",n.BreakOffByDisable="BreakOffByDisable",n.ModelNotLoaded="ModelNotLoaded",n.ChangeModeError="ChangeModeError",n.UpdateCameraError="UpdateCameraError",n))(St||{});const Fd=500,xb=80;function $i(n,t,e=4){return Math.abs(n-t)<Math.pow(10,-e)}function Nd(n,t,e=4){const i=Math.PI*2,s=n%i,o=t%i,r=Math.min(s,o),a=Math.max(s,o);return $i(r,a,e)||$i(r+i,a,e)}Object.assign(window,{nearlyEqual:$i,nearlyEqualRad:Nd});function Db(n){return Object.prototype.toString.call(n)==="[object Object]"}function Gd(n){return Db(n)&&!!n.isVector3}function Na(n,t){return H(this,null,function*(){const[e]=yield Ki(n.changeMode(...t));if(e)throw new Error("change mode canceled");yield new Promise(r=>{n.once("initAnimationWillStart",()=>{n.once("initAnimationEnded",()=>r())})});const i=t[1];if(!i)return!0;const s=n.getCurrentState();if(!Sb(i,s))throw new Error("pose 与预期不符")})}function Sb(n,t){return Object.keys(n).every(e=>{const i=t[e],s=n[e];return i===void 0||s===void 0?!0:e==="longitude"||e==="latitude"?Nd(i,s,2):typeof i=="number"&&typeof s=="number"?$i(i,s,2):Gd(s)&&Gd(i)?s.distanceTo(i)<.01:i===s})}function Lb(n,t){if(n.currentMode!==t.mode)return!1;const{latitude:e,longitude:i,fov:s,offset:o}=t,{latitude:r,longitude:a,offset:l}=n.getCurrentState(),c=n.camera.fov;return!(!$i(e,r,2)||!$i(i,a,2)||o!==void 0&&o.distanceTo(l)>.01||!$i(s,c,2))}function Qd(n,t,e=!0){return H(this,null,function*(){if(Lb(n,t)===!0)return;const s=n.getCurrentState();if(s.mode!==t.mode){const[h]=yield Ki(Na(n,[t.mode,t,void 0,e]));if(h)throw h;return}const{latitude:o,longitude:r,fov:a}=s,l=Math.min(1e3,Math.max(200,Math.abs(o-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,typeof t.fov=="number"?Math.abs(a-t.fov)*10:1/0)),[c]=yield Ki(n.updateCamera(Jn(t,["mode"]),l,e));if(c)throw new Error(St.UpdateCameraError)})}function qn(n,t,e=300){var s,o;const i=n.getElement();if(i){i.style.opacity=t+"";for(let r=0;r<((o=(s=i.parentElement)==null?void 0:s.children)==null?void 0:o.length);r++){const a=i.parentElement.children[r];a instanceof HTMLElement&&a.dataset.infive==="1"&&(a.style.opacity=t+"")}i.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(r=>i.addEventListener("transitionend",r,{once:!0})),new Promise(r=>setTimeout(r,e))]).then(()=>{i.style.transition="none"})}}function Tb(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return i||s}function zb(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return i&&s}let jb=class extends wi{constructor(e,i){var l,c,h;super(e);d(this,"name","modelFloorplanPlugin");d(this,"state");d(this,"data");d(this,"showState");d(this,"showPromise");d(this,"app");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"selector");d(this,"showRejection");d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"defaultMissingFloorConfig");d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(this,"highlightData",{});d(this,"store",{roomOnMouse:null});d(this,"dispose",()=>{var e,i;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(i=this.container)==null||i.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});d(this,"show",(...i)=>H(this,[...i],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));d(this,"hide",(...i)=>H(this,[...i],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));d(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper)return!1;const{min:e,max:i}=this.data.bounding,s=i.x-e.x,o=i.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Fa(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);return this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c}),!0});d(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});d(this,"unhighlight",()=>{this.highlightData={},this.render()});d(this,"_disable",e=>{var s,o,r;const{userAction:i}=e;this.hooks.emit("disable",{userAction:i}),(s=this.showRejection)==null||s.call(this,St.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});d(this,"_enable",e=>{const{userAction:i}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i}))});d(this,"_show",e=>H(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(St.ModelNotLoaded);if(!this.data)throw new Error(St.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=x(x({},i),e),o=()=>H(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield Ki(Qd(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(St.UnknownError);if(!this.updateSize())throw new Error(St.UpdateSizeError);this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=o().then(()=>{this.showPromise=void 0,this.showRejection=void 0;const a=s.modelOpacity,l=s.immediately?0:Fd;qn(this.five,a,l),this.render(l),this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}),this.showPromise}));d(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,St.BreakOffByHide),this.showPromise=void 0;const s=x(x({},{userAction:!0,isAutoHide:!1}),e);qn(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});d(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click",this.store.roomOnMouse))return!1});d(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});d(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});d(this,"onFiveInteriaPan",(e,i)=>{if(!i||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();s.mode==="Floorplan"&&(this.state.visible||zb(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});d(this,"onFivePanoArrived",e=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=e,this.floorIndex=this.workUtil.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,i)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();Tb(s)&&(this.updateState({visible:!1},i),this._hide({userAction:i,isAutoHide:!0}))});d(this,"onFiveWantsGesture",(e,i)=>{if(this.state.visible&&(i.length>1||e==="mouseWheel"))return!1});d(this,"onFiveWantsPanGesture",(e,i)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&i&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});d(this,"onFiveWantsTapGesture",()=>this.handleClick());d(this,"onFiveWantsChangeMode",(e,i)=>{i==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});d(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:xb/((l=i==null?void 0:i.scale)!=null?l:1)},this.defaultMissingFloorConfig={imageURL:this.staticPrefix+"/release/web/saas/missing-floorplan.e274c596.png",imageWidth:200,imageHeight:120,text:(h=(c=i.i18n)==null?void 0:c.call(i,"暂无平面图"))!=null?h:"暂无平面图",textFontSize:14};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomDimensionEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:Bi,attachedTo:Vi.BOUNDING_CENTER,getLabelElement:void 0,missingFloorConfig:x(x({},this.defaultMissingFloorConfig),i.missingFloorConfig),i18n:u=>u,getRoomAreaText:u=>(u/1e6).toFixed(1)+"㎡",getRoomDimensionText:(u,f)=>(u/1e3).toFixed(1)+"m × "+(f/1e3).toFixed(1)+"m",getRuleDistanceText:u=>u.toString()},o=i?Jn(i,["selector","scale"]):{},r=x(x({},s.missingFloorConfig),o.missingFloorConfig),a=ie(x(x({},s),o),{missingFloorConfig:r});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),e.once("dispose",this.dispose),this.addEventListener()}load(e,i,s=!0){return H(this,null,function*(){function o(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const r=e;r&&Dt(r.version)&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield _i(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,s),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,i=!0){this.updateState({config:e},i),this.render()}formatData(e){return H(this,null,function*(){return yield _i(e.data)})}updateState(e,i){var a;const s=this.state,o=(a=e.config)!=null&&a.missingFloorConfig?x(x({},s.config.missingFloorConfig),e.config.missingFloorConfig):s.config.missingFloorConfig,r=e.config?ie(x(x({},s.config),e.config),{missingFloorConfig:o}):s.config;this.state=ie(x(x({},this.state),e),{config:r}),!wt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0||this.showPromise)return;const i=ie(x({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData,store:this.store});if(this.app)return this.app.$set(i);this.app=new _a({target:this.container,intro:!0,props:i})}};const Ob=(n,t)=>new jb(n,t);function Vb(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return i||s}function Bb(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return i&&s}let _b=class extends wi{constructor(e,i){var l,c;super(e);d(this,"name","modelFloorplanPlugin");d(this,"state");d(this,"data");d(this,"showState");d(this,"showPromise");d(this,"app");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"selector");d(this,"showRejection");d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"defaultMissingFloorConfig");d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(this,"highlightData",{});d(this,"store",{roomOnMouse:null});d(this,"dispose",()=>{var e,i;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(i=this.container)==null||i.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});d(this,"show",(...i)=>H(this,[...i],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));d(this,"hide",(...i)=>H(this,[...i],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));d(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper)return!1;const{min:e,max:i}=this.data.bounding,s=i.x-e.x,o=i.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Fa(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);return this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c}),!0});d(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});d(this,"unhighlight",()=>{this.highlightData={},this.render()});d(this,"_disable",e=>{var s,o,r;const{userAction:i}=e;this.hooks.emit("disable",{userAction:i}),(s=this.showRejection)==null||s.call(this,St.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});d(this,"_enable",e=>{const{userAction:i}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i}))});d(this,"_show",e=>H(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.fiveUtil.model)!=null&&r.loaded))throw new Error(St.ModelNotLoaded);if(!this.data)throw new Error(St.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=x(x({},i),e),o=()=>H(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield Ki(Qd(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(St.UnknownError);if(!this.updateSize())throw new Error(St.UpdateSizeError);this.updatePosition(),this.floorIndex=s.floorIndex,this.fiveUtil.model.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=o().then(()=>{this.showPromise=void 0,this.showRejection=void 0;const a=s.modelOpacity,l=s.immediately?0:Fd;qn(this.five,a,l),this.render(l),this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}),this.showPromise}));d(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,St.BreakOffByHide),this.showPromise=void 0;const s=x(x({},{userAction:!0,isAutoHide:!1}),e);qn(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});d(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click",this.store.roomOnMouse))return!1});d(this,"onFiveModelLoaded",()=>{const i=this.five.model.bounding.getCenter(new b.Vector3);if(this.showState.offset=i,this.state.enabled===!1||this.wrapper||!this.selector)return;const s=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!s)throw new Error("不正确的父容器选择器");this.wrapper=s,s.append(this.container)});d(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});d(this,"onFiveInteriaPan",(e,i)=>{if(!i||this.state.visible||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();s.mode===this.showState.mode&&Bb(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))});d(this,"onFivePanoArrived",e=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=e,this.floorIndex=this.workUtil.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,i)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Vb(s)&&(this.updateState({visible:!1},i),this._hide({userAction:i}))});d(this,"onFiveWantsPanGesture",(e,i)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&i&&this.state.visible)return this.five.updateCamera(Jn(this.showState,["offset"]),0),!1});d(this,"onFiveWantsTapGesture",()=>this.handleClick());d(this,"onFiveWantsChangeMode",(e,i)=>{i==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});d(this,"onModelShownFloorChange",e=>{var i;if(this.floorIndex!==e){if(e===null){const s=this.five.getCurrentState().panoIndex;this.floorIndex=(i=this.five.work)==null?void 0:i.observers[s].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2},this.defaultMissingFloorConfig={imageURL:this.staticPrefix+"/release/web/saas/missing-floorplan.e274c596.png",imageWidth:200,imageHeight:120,text:(c=(l=i.i18n)==null?void 0:l.call(i,"暂无平面图"))!=null?c:"暂无平面图",textFontSize:14};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomDimensionEnable:!0,cameraImageUrl:Bi,attachedTo:Vi.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:x(x({},this.defaultMissingFloorConfig),i.missingFloorConfig),i18n:h=>h,getRoomAreaText:h=>(h/1e6).toFixed(1)+"㎡",getRoomDimensionText:(h,u)=>(h/1e3).toFixed(1)+"m × "+(u/1e3).toFixed(1)+"m",getRuleDistanceText:h=>h.toString()},o=i?Jn(i,["selector","scale"]):{},r=x(x({},s.missingFloorConfig),o.missingFloorConfig),a=ie(x(x({},s),o),{missingFloorConfig:r});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),ni(e).then(this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,i,s=!0){return H(this,null,function*(){function o(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const r=e;r&&Dt(r.version)&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield _i(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,s),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,i=!0){this.updateState({config:e},i),this.render()}updatePosition(){var a;const e=Ra(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.fiveUtil.model)==null?void 0:a.bounding.getCenter(new b.Vector3).setY(e);if(!i)return;const s=i.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}formatData(e){return H(this,null,function*(){return yield _i(e.data)})}updateState(e,i){var a;const s=this.state,o=(a=e.config)!=null&&a.missingFloorConfig?x(x({},s.config.missingFloorConfig),e.config.missingFloorConfig):s.config.missingFloorConfig,r=e.config?ie(x(x({},s.config),e.config),{missingFloorConfig:o}):s.config;this.state=ie(x(x({},this.state),e),{config:r}),!wt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0||this.showPromise)return;const i=ie(x({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData,store:this.store});if(this.app)return this.app.$set(i);this.app=new _a({target:this.container,intro:!0,props:i})}};const Rb=(n,t)=>new _b(n,t);let Fb=class extends wi{constructor(e,i){var l,c;super(e);d(this,"name","topviewFloorplanPlugin");d(this,"state");d(this,"data");d(this,"app");d(this,"selector");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"defaultMissingFloorConfig");d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(this,"highlightData",{});d(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return!1;const{min:e,max:i}=this.data.bounding,s=i.x-e.x,o=i.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Fa(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);return this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c}),!0});d(this,"dispose",()=>{var e,i;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(i=this.container)==null||i.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});d(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});d(this,"unhighlight",()=>{this.highlightData={},this.render()});d(this,"_disable",e=>{var s,o;const{userAction:i}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,(o=this.container)==null||o.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:i})});d(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});d(this,"onFiveModeChange",(...[e,,,,i])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},i),this._hide({userAction:i}))});d(this,"onFivePanoArrived",e=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,i)=>{this.state.visible&&(this.updatePosition(),this.updateSize())});d(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});d(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});d(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:i}=this.five.getCurrentState();i==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});d(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.defaultMissingFloorConfig={imageURL:this.staticPrefix+"/release/web/saas/missing-floorplan.e274c596.png",imageWidth:200,imageHeight:120,text:(c=(l=i.i18n)==null?void 0:l.call(i,"暂无平面图"))!=null?c:"暂无平面图",textFontSize:14};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomDimensionEnable:!0,cameraImageUrl:Bi,attachedTo:Vi.BOUNDING_CENTER,getLabelElement:void 0,missingFloorConfig:x(x({},this.defaultMissingFloorConfig),i.missingFloorConfig),i18n:h=>h,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:h=>(h/1e6).toFixed(1)+"㎡",getRoomDimensionText:(h,u)=>(h/1e3).toFixed(1)+"m × "+(u/1e3).toFixed(1)+"m",getRuleDistanceText:h=>h.toString()},o=i?Jn(i,["selector","scale"]):{},r=x(x({},s.missingFloorConfig),o.missingFloorConfig),a=ie(x(x({},s),o),{missingFloorConfig:r});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,i,s=!0){return H(this,null,function*(){function o(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const r=e;r&&Dt(r.version)&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield _i(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,s),this.render()})}updatePosition(){var a;const e=Ra(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.five.model)==null?void 0:a.bounding.getCenter(new b.Vector3).setY(e);if(!i)return;const s=i.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return H(this,arguments,function*(e={}){if(this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},i),this._show({userAction:i})})}hide(){return H(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},i),this._hide({userAction:i})})}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,i=!0){this.updateState({config:e},i),this.render()}formatData(e){return H(this,null,function*(){return yield _i(e.data)})}_show(e){return H(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:i}=e;this.hooks.emit("show",{userAction:i,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield Na(this.five,["Topview",void 0,void 0,i])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const s=500,o=this.state.config.modelOpacity;qn(this.five,o,s),this.hooks.emit("showAnimationEnded",{userAction:i,auto:!1}),this.render()})}_hide(e){return H(this,null,function*(){if(!this.state.enabled)return;const{userAction:i}=e;this.hooks.emit("hide",{userAction:i,auto:!1});const s=1,o=0;qn(this.five,s,o),this.render()})}_enable(e){const{userAction:i}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i})}updateState(e,i){var a;const s=this.state,o=(a=e.config)!=null&&a.missingFloorConfig?x(x({},s.config.missingFloorConfig),e.config.missingFloorConfig):s.config.missingFloorConfig,r=e.config?ie(x(x({},s.config),e.config),{missingFloorConfig:o}):s.config;this.state=ie(x(x({},this.state),e),{config:r}),!wt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const i=ie(x({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(i);this.app=new _a({target:this.container,intro:!0,props:i})}};const Nb=(n,t)=>new Fb(n,t);function Gb(n){ge(n,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function Qb(n){let t,e,i;return{c(){t=T("div"),e=T("div"),i=T("div"),P(i,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),z(i,"background-image","url("+(n[0]||Bi)+")"),z(i,"transform",n[1]),P(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),z(e,"transform",n[2]),P(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd"),z(t,"opacity",n[3]?1:0)},m(s,o){B(s,t,o),O(t,e),O(e,i)},p(s,[o]){o&1&&z(i,"background-image","url("+(s[0]||Bi)+")"),(o&1||o&3)&&z(i,"transform",s[1]),o&4&&z(e,"transform",s[2]),o&8&&z(t,"opacity",s[3]?1:0)},i:$,o:$,d(s){s&&V(t)}}}function Wb(n){return`rotate(${Math.floor(n/Math.PI*180)*-1+45}deg)`}function Hb(n,t,e){var w,I;let i,s,o,r,{five:a}=t,{pxmm:l}=t,{floorplanData:c}=t,{cameraImageUrl:h}=t,u=a.getCurrentState().panoIndex,f=a.getCurrentState().longitude,m=(I=(w=a.work.observers[a.getCurrentState().panoIndex])==null?void 0:w.floorIndex)!=null?I:0;function v(C,M){const E=C.bounding,S=C.observers[M];if(!S)return"";const L=(E.max.x-E.min.x)*l,W=(E.max.y-E.min.y)*l,R=Math.floor(S.positionInImage.x*L),U=Math.floor(S.positionInImage.y*W);return`translate(${R}px, ${U}px)`}function p(C){e(7,u=C)}function g(C){e(9,m=a.work.observers[C].floorIndex)}const A=Eo(C=>{e(8,f=C.longitude)},1e3/60);return Et(()=>(a.on("panoWillArrive",p),a.on("panoArrived",g),a.on("cameraDirectionUpdate",A),function(){a.off("panoWillArrive",p),a.off("panoArrived",g),a.off("cameraDirectionUpdate",A)})),n.$$set=C=>{"five"in C&&e(4,a=C.five),"pxmm"in C&&e(5,l=C.pxmm),"floorplanData"in C&&e(6,c=C.floorplanData),"cameraImageUrl"in C&&e(0,h=C.cameraImageUrl)},n.$$.update=()=>{n.$$.dirty&576&&e(10,i=c.floorDatas[m]),n.$$.dirty&1024&&e(3,s=i.rooms.length>0),n.$$.dirty&192&&e(2,o=v(c,u)),n.$$.dirty&256&&e(1,r=Wb(f))},[h,r,o,s,a,l,c,u,f,m,i]}class Ub extends ue{constructor(t){super(),de(this,t,Hb,Qb,he,{five:4,pxmm:5,floorplanData:6,cameraImageUrl:0},Gb)}}function Yb(n){ge(n,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function Wd(n,t,e){const i=n.slice();return i[1]=t[e],i}function Hd(n,t){let e,i,s=`${t[1].icon.width/16}rem`,o=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:n,first:null,c(){e=T("div"),i=T("div"),r=te(),P(i,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),z(i,"background-image",`url(${t[1].icon.url})`),z(i,"width",s),z(i,"height",o),P(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),z(e,"top",a),z(e,"left",l),this.first=e},m(c,h){B(c,e,h),O(e,i),O(e,r)},p(c,h){t=c,h&1&&z(i,"background-image",`url(${t[1].icon.url})`);const u=h&1;u&&z(i,"width",s),u&&z(i,"height",o),h&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&z(e,"top",a),h&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&z(e,"left",l)},d(c){c&&V(e)}}}function Xb(n){let t,e=[],i=new Map,s=n[0];const o=r=>r[1].id;for(let r=0;r<s.length;r+=1){let a=Wd(n,s,r),l=o(a);i.set(l,e[r]=Hd(l,a))}return{c(){t=T("div");for(let r=0;r<e.length;r+=1)e[r].c();P(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){B(r,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(r,[a]){a&1&&(s=r[0],e=Jt(e,a,o,1,r,s,i,t,za,Hd,null,Wd))},i:$,o:$,d(r){r&&V(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Zb(n,t,e){let{extraObjects:i=[]}=t;return n.$$set=s=>{"extraObjects"in s&&e(0,i=s.extraObjects)},[i]}class Jb extends ue{constructor(t){super(),de(this,t,Zb,Xb,he,{extraObjects:0},Yb)}}function qb(n){ge(n,"svelte-18287ai",".missing-floor-wrapper.svelte-18287ai{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:flex;justify-content:center;align-items:center}.missing-floor-image.svelte-18287ai{max-width:100%;max-height:100%}")}function Kb(n){let t,e,i,s,o,r;const a=[{floorIndex:n[2],floorplanData:n[4]}];let l={};for(let h=0;h<a.length;h+=1)l=gt(l,a[h]);t=new cd({props:l}),i=new Jb({props:{extraObjects:n[7]}});let c=n[3]&&Ud(n);return{c(){re(t.$$.fragment),e=te(),re(i.$$.fragment),s=te(),c&&c.c(),o=Ee()},m(h,u){se(t,h,u),B(h,e,u),se(i,h,u),B(h,s,u),c&&c.m(h,u),B(h,o,u),r=!0},p(h,u){const f=u&20?Ct(a,[{floorIndex:h[2],floorplanData:h[4]}]):{};t.$set(f);const m={};u&128&&(m.extraObjects=h[7]),i.$set(m),h[3]?c?(c.p(h,u),u&8&&D(c,1)):(c=Ud(h),c.c(),D(c,1),c.m(o.parentNode,o)):c&&(fe(),_(c,1,1,()=>{c=null}),me())},i(h){r||(D(t.$$.fragment,h),D(i.$$.fragment,h),D(c),r=!0)},o(h){_(t.$$.fragment,h),_(i.$$.fragment,h),_(c),r=!1},d(h){oe(t,h),h&&V(e),oe(i,h),h&&V(s),c&&c.d(h),h&&V(o)}}}function $b(n){let t,e,i;return{c(){t=T("div"),e=T("img"),P(e,"class","missing-floor-image svelte-18287ai"),ft(e.src,i=n[6])||P(e,"src",i),P(e,"alt","缺省楼层"),P(t,"class","missing-floor-wrapper svelte-18287ai")},m(s,o){B(s,t,o),O(t,e)},p(s,o){o&64&&!ft(e.src,i=s[6])&&P(e,"src",i)},i:$,o:$,d(s){s&&V(t)}}}function Ud(n){let t,e;const i=[{five:n[0],pxmm:n[1],floorIndex:n[2],floorplanData:n[4],onRoomHeightClick:n[9],highlightData:n[5],hoveredRoom:void 0}];let s={};for(let o=0;o<i.length;o+=1)s=gt(s,i[o]);return t=new Dd({props:s}),{c(){re(t.$$.fragment)},m(o,r){se(t,o,r),e=!0},p(o,r){const a=r&567?Ct(i,[{five:o[0],pxmm:o[1],floorIndex:o[2],floorplanData:o[4],onRoomHeightClick:o[9],highlightData:o[5],hoveredRoom:void 0}]):{};t.$set(a)},i(o){e||(D(t.$$.fragment,o),e=!0)},o(o){_(t.$$.fragment,o),e=!1},d(o){oe(t,o)}}}function e1(n){let t,e,i,s;const o=[$b,Kb],r=[];function a(l,c){return l[8]?1:0}return t=a(n),e=r[t]=o[t](n),{c(){e.c(),i=Ee()},m(l,c){r[t].m(l,c),B(l,i,c),s=!0},p(l,[c]){let h=t;t=a(l),t===h?r[t].p(l,c):(fe(),_(r[h],1,1,()=>{r[h]=null}),me(),e=r[t],e?e.p(l,c):(e=r[t]=o[t](l),e.c()),D(e,1),e.m(i.parentNode,i))},i(l){s||(D(e),s=!0)},o(l){_(e),s=!1},d(l){r[t].d(l),l&&V(i)}}}function t1(n,t,e){let i,s,o,{five:r}=t,{pxmm:a}=t,{floorIndex:l}=t,{hoverEnable:c}=t,{floorplanData:h}=t,{extraObjects:u=[]}=t,{highlightData:f}=t,{missingFloorImageUrl:m}=t;const v=void 0;return n.$$set=p=>{"five"in p&&e(0,r=p.five),"pxmm"in p&&e(1,a=p.pxmm),"floorIndex"in p&&e(2,l=p.floorIndex),"hoverEnable"in p&&e(3,c=p.hoverEnable),"floorplanData"in p&&e(4,h=p.floorplanData),"extraObjects"in p&&e(10,u=p.extraObjects),"highlightData"in p&&e(5,f=p.highlightData),"missingFloorImageUrl"in p&&e(6,m=p.missingFloorImageUrl)},n.$$.update=()=>{n.$$.dirty&20&&e(11,i=h.floorDatas[l]),n.$$.dirty&2048&&e(8,s=i.rooms.length>0),n.$$.dirty&1028&&e(7,o=u==null?void 0:u.filter(p=>p.floorIndex===l))},[r,a,l,c,h,f,m,o,s,v,u,i]}class i1 extends ue{constructor(t){super(),de(this,t,t1,e1,he,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:10,highlightData:5,missingFloorImageUrl:6},qb)}}function n1(n){ge(n,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function Yd(n){let t,e,i,s,o=n[8]!==0&&Xd(n);return{c(){t=T("div"),o&&o.c(),P(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){B(r,t,a),o&&o.m(t,null),e=!0,i||(s=[Xt(Oi.call(null,t)),Ce(t,"clientWidth",n[14]),Ce(t,"clientHeight",n[15])],i=!0)},p(r,a){r[8]!==0?o?(o.p(r,a),a&256&&D(o,1)):(o=Xd(r),o.c(),D(o,1),o.m(t,null)):o&&(fe(),_(o,1,1,()=>{o=null}),me())},i(r){e||(D(o),e=!0)},o(r){_(o),e=!1},d(r){r&&V(t),o&&o.d(),i=!1,rt(s)}}}function Xd(n){let t,e,i,s,o=`${n[10]}px`,r=`${n[13]}px`,a;const l=[{five:n[0],pxmm:n[11],floorIndex:n[12],floorplanData:n[3],hoverEnable:n[2],extraObjects:n[5],highlightData:n[6],missingFloorImageUrl:n[7]}];let c={};for(let f=0;f<l.length;f+=1)c=gt(c,l[f]);e=new i1({props:c});const h=[{pxmm:n[11],five:n[0],floorplanData:n[3],cameraImageUrl:n[4]}];let u={};for(let f=0;f<h.length;f+=1)u=gt(u,h[f]);return s=new Ub({props:u}),{c(){t=T("div"),re(e.$$.fragment),i=te(),re(s.$$.fragment),P(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),z(t,"width",o),z(t,"height",r)},m(f,m){B(f,t,m),se(e,t,null),O(t,i),se(s,t,null),a=!0},p(f,m){const v=m&6381?Ct(l,[{five:f[0],pxmm:f[11],floorIndex:f[12],floorplanData:f[3],hoverEnable:f[2],extraObjects:f[5],highlightData:f[6],missingFloorImageUrl:f[7]}]):{};e.$set(v);const p=m&2073?Ct(h,[{pxmm:f[11],five:f[0],floorplanData:f[3],cameraImageUrl:f[4]}]):{};s.$set(p),m&1024&&o!==(o=`${f[10]}px`)&&z(t,"width",o),m&8192&&r!==(r=`${f[13]}px`)&&z(t,"height",r)},i(f){a||(D(e.$$.fragment,f),D(s.$$.fragment,f),a=!0)},o(f){_(e.$$.fragment,f),_(s.$$.fragment,f),a=!1},d(f){f&&V(t),oe(e),oe(s)}}}function s1(n){let t,e,i=n[1]&&Yd(n);return{c(){i&&i.c(),t=Ee()},m(s,o){i&&i.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[1]?i?(i.p(s,o),o&2&&D(i,1)):(i=Yd(s),i.c(),D(i,1),i.m(t.parentNode,t)):i&&(fe(),_(i,1,1,()=>{i=null}),me())},i(s){e||(D(i),e=!0)},o(s){_(i),e=!1},d(s){i&&i.d(s),s&&V(t)}}}function o1(n,t,e){var C,M;let{five:i}=t,{visible:s}=t,{hoverEnable:o}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,{missingFloorImageUrl:h}=t,u=0,f=(M=(C=i.work.observers[i.getCurrentState().panoIndex])==null?void 0:C.floorIndex)!=null?M:0,m=0,v=0,p=0,g=0;function A(E){e(12,f=i.work.observers[E].floorIndex)}Et(()=>(i.on("panoArrived",A),()=>{i.off("panoArrived",A)}));const w=E=>{e(8,m=E.detail)},I=E=>{e(9,v=E.detail)};return n.$$set=E=>{"five"in E&&e(0,i=E.five),"visible"in E&&e(1,s=E.visible),"hoverEnable"in E&&e(2,o=E.hoverEnable),"floorplanData"in E&&e(3,r=E.floorplanData),"cameraImageUrl"in E&&e(4,a=E.cameraImageUrl),"extraObjects"in E&&e(5,l=E.extraObjects),"highlightData"in E&&e(6,c=E.highlightData),"missingFloorImageUrl"in E&&e(7,h=E.missingFloorImageUrl)},n.$$.update=()=>{if(n.$$.dirty&1800){const E=Math.min(m,v),{max:S,min:L}=r.bounding,W=S.x-L.x,R=S.y-L.y,U=function(){return W>R?[E,E/W*R]:[E/R*W,E]}();e(10,p=U[0]),e(13,g=U[1]),e(11,u=p/W)}},[i,s,o,r,a,l,c,h,m,v,p,u,f,g,w,I]}class r1 extends ue{constructor(t){super(),de(this,t,o1,s1,he,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6,missingFloorImageUrl:7},n1)}}let a1=class extends wi{constructor(e,i){super(e);d(this,"name","panoFloorplanRadarPlugin");d(this,"state");d(this,"data");d(this,"app");d(this,"wrapperSelector","");d(this,"wrapper",null);d(this,"disposed",!1);d(this,"extraObjects",[]);d(this,"highlightData",{});d(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});d(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});d(this,"unhighlight",()=>{this.highlightData={},this.render()});d(this,"_disable",e=>{var s;const{userAction:i}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:i})});this.five=e;const s={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:Bi,missingFloorImageUrl:this.staticPrefix+"/release/web/saas/missing-floor.d687a5ed.png"},o=x(x({},s),i==null?void 0:i.configs);this.state={enabled:!0,visible:!0,config:o},i!=null&&i.wrapper&&console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"),typeof(i==null?void 0:i.wrapper)=="string"?this.wrapperSelector=i.wrapper:(i==null?void 0:i.wrapper)instanceof Element&&(this.wrapper=i.wrapper),e.once("dispose",this.dispose)}load(e,i,s=!0){return H(this,null,function*(){function o(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=o(r)?r.data:r,l=this.data;this.data=yield _i(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),i&&this.updateState(i,s),this.render()})}show(){return H(this,arguments,function*(e={}){if(this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},i),this._show({userAction:i})})}hide(){return H(this,arguments,function*(e={}){if(!this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},i),this._hide({userAction:i})})}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper!==e&&this.app&&(this.app.$destroy(),this.app=void 0),this.wrapper=e,this.render()}changeConfigs(e,i=!0){this.setState({config:e},{userAction:i}),this.render()}setExtraObjectsWith3DPositions(e){this.data&&(this.extraObjects=Eb(e,this.five,this.data),this.render())}formatData(e){return H(this,null,function*(){return yield _i(e.data)})}_enable(e){const{userAction:i}=e;this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:i}=e;this.hooks.emit("show",{userAction:i}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:i}=e;this.hooks.emit("hide",{userAction:i}),this.render()}updateState(e,i){const s=this.state,o=e.config?x(x({},s.config),e.config):s.config;this.state=ie(x(x({},this.state),e),{config:o}),!wt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const i=document.querySelector(this.wrapperSelector);this.wrapper=i}if(!this.data||!this.wrapper)return;const e=ie(x({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(e):this.app=new r1({target:this.wrapper,props:e})}};const l1=(n,t)=>new a1(n,t),c1=[{type:0,floorType:1,roomType:"100900000012",name:"其他"},{type:1,floorType:1,roomType:"100900000002",name:"客厅"},{type:2,floorType:1,roomType:"100900000002",name:"餐厅"},{type:3,floorType:0,roomType:"100900000001",name:"卧室"},{type:4,floorType:0,roomType:"100900000001",name:"书房"},{type:5,floorType:3,roomType:"100900000004",name:"卫生间"},{type:6,floorType:3,roomType:"100900000004",name:"淋浴间"},{type:7,floorType:3,roomType:"100900000004",name:"洗手间"},{type:8,floorType:3,roomType:"100900000003",name:"厨房"},{type:9,floorType:1,roomType:"100900000003",name:"开放厨房",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"多功能间"},{type:11,floorType:0,roomType:"100900000009",name:"保姆间"},{type:12,floorType:4,roomType:"100900000005",name:"阳台"},{type:13,floorType:4,roomType:"100900000006",name:"露台"},{type:14,floorType:0,roomType:"100900000008",name:"储物间"},{type:15,floorType:0,roomType:"100900000013",name:"衣帽间"},{type:16,floorType:0,roomType:"100900000011",name:"阁楼"},{type:17,floorType:2,roomType:"100900000007",name:"花园"},{type:18,floorType:5,roomType:"100900000010",name:"车库"},{type:19,floorType:1,roomType:"100900000012",name:"电梯"},{type:20,floorType:1,roomType:"100900000012",name:"地下室"},{type:21,floorType:1,roomType:"100900000012",name:"天井"},{type:22,floorType:1,roomType:"100900000012",name:"阳光房"},{type:23,floorType:1,roomType:"100900000012",name:"过道"},{type:24,floorType:1,roomType:"100900000012",name:"楼梯间"},{type:25,floorType:1,roomType:"100900000012",name:"门厅"},{type:26,floorType:2,roomType:"100900000012",name:"入户花园"},{type:27,floorType:1,roomType:"100900000012",name:"玄关"},{type:28,floorType:1,roomType:"100900000012",name:"挑空"},{type:29,floorType:4,roomType:"100900000012",name:"晾晒区"},{type:30,floorType:4,roomType:"100900000012",name:"洗衣房"},{type:31,floorType:0,roomType:"100900000012",name:"娱乐区"},{type:32,floorType:0,roomType:"100900000012",name:"健身区"},{type:33,floorType:0,roomType:"100900000012",name:"接待区"},{type:34,floorType:0,roomType:"100900000012",name:"影音区"},{type:35,floorType:1,roomType:"100900000012",name:"餐饮区"},{type:36,floorType:1,roomType:"100900000012",name:"其他",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"起居室"},{type:38,floorType:0,roomType:"100900000001",name:"主卧"},{type:39,floorType:0,roomType:"100900000001",name:"次卧"},{type:40,floorType:0,roomType:"100900000001",name:"优化间"},{type:41,floorType:0,roomType:"100900000001",name:"办公室"},{type:42,floorType:0,roomType:"100900000001",name:"会议室"},{type:43,floorType:0,roomType:"100900000001",name:"洽谈间"},{type:44,floorType:1,roomType:"100900000002",name:"共享大厅"},{type:45,floorType:1,roomType:"100900000012",name:"水吧"},{type:46,floorType:0,roomType:"100900000015",name:"出入口"},{type:47,floorType:0,roomType:"100900000015",name:"大厅"},{type:48,floorType:0,roomType:"100900000015",name:"包厢"},{type:49,floorType:0,roomType:"100900000015",name:"其他"},{type:50,floorType:0,roomType:"100900000016",name:"出入口"},{type:51,floorType:0,roomType:"100900000016",name:"办公区"},{type:52,floorType:0,roomType:"100900000016",name:"老板间"},{type:53,floorType:0,roomType:"100900000016",name:"会议室"},{type:54,floorType:0,roomType:"100900000016",name:"休息区/水吧"},{type:55,floorType:0,roomType:"100900000016",name:"其他"},{type:56,floorType:2,roomType:"100900000012",name:"空中花园"},{type:57,floorType:0,roomType:"100900000001",name:"洋室"},{type:58,floorType:0,roomType:"100900000001",name:"和室"}],h1=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],d1=[{roomType:"100900000001",description:"室"},{roomType:"100900000002",description:"厅"},{roomType:"100900000003",description:"厨"},{roomType:"100900000004",description:"卫"},{roomType:"100900000005",description:"阳台"},{roomType:"100900000006",description:"露台"},{roomType:"100900000007",description:"花园"},{roomType:"100900000008",description:"储"},{roomType:"100900000009",description:"保姆间"},{roomType:"100900000010",description:"车库"},{roomType:"100900000011",description:"阁楼"},{roomType:"100900000012",description:"其他"},{roomType:"100900000013",description:"衣"},{roomType:"100900000015",description:"商铺"},{roomType:"100900000016",description:"写字楼"}],Ga=(n,t,e)=>{const i=new b.Matrix4,s=new b.Euler(n,t,e,"YXZ");return i.makeRotationFromEuler(s),i},u1=(n,{scale:t,rotation:e,position:i})=>{if(t&&n.scale.set(t,t,t),e){const[s,o,r]=e;s&&n.applyMatrix4(Ga(s,0,0)),o&&n.applyMatrix4(Ga(0,o,0)),r&&n.applyMatrix4(Ga(0,0,r))}return i&&n.position.set(i.x,i.y,i.z),n};function Zd(n,t){n.traverse(e=>{var i;if(e.type==="Mesh"){const s=e,o=x({map:s.material.map||{}},t);s.material=new Q.MeshBasicMaterial(o),s.renderOrder=1,((i=e.parent)==null?void 0:i.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const f1=(n,t)=>{var p;const e=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",i=(p=t.north_rad)!=null?p:void 0,s={};let o={x:0,y:0,z:0},r=[0,0,0],a=1,l=i;n.on("modelLoaded",v);const c=g=>H(this,null,function*(){var C;const A=(g==null?void 0:g.fbx_url)||e;if(l=(C=g==null?void 0:g.north_rad)!=null?C:i,typeof l!="number")throw new Error('"northRad"配置参数缺失:未配置指南针指向!');const I=yield new In.FBXLoader().loadAsync(A);return Zd(I,{transparent:!0,side:b.DoubleSide,blending:b.AdditiveBlending}),s.object=I,v(),!0}),h=({latitude:g})=>{if(!s.object)return;const A=u(g);A&&(s.object.position.y=A)},u=g=>{if(s.yBase===void 0)return;const A=.6;if(g>=Math.PI/4)return s.yBase-(A+1.6);const w=g*(4/Math.PI);return s.yBase-(A*w+1.6)},f=()=>{if(!s.object)return;const g=u(n.getPose().latitude);g&&(s.object.position.y=g),n.scene.add(s.object),n.needsRender=!0,n.on("cameraDirectionUpdate",h)},m=()=>{s.object&&(n.scene.remove(s.object),n.needsRender=!0,n.off("cameraDirectionUpdate",h))};function v(){const g=s.object;if(!g)return;const A=n.model.bounding,w=A.max.x-A.min.x,I=A.max.z-A.min.z,C=Math.max(w,I),{max:{x:M,z:E},min:{x:S,y:L,z:W}}=A;s.yBase=L,o={x:(M+S)/2,y:L-1.6,z:(E+W)/2},r=[0,l-Math.PI/2,0],a=.0045*C,u1(g,{position:o,rotation:r,scale:a})}return{load:c,disable:m,enable:f}};function m1(n,t){var c,h,u,f,m;const e=(c=t==null?void 0:t.size)!=null?c:512,i=(h=t==null?void 0:t.fontSize)!=null?h:e*(35/256)*1.2,s=(u=t==null?void 0:t.backgroundColor)!=null?u:"rgba(0,0,0,0)",o=(f=t==null?void 0:t.fontColor)!=null?f:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=s,l.fillRect(0,0,e,e),l.font=`${i}px "微软雅黑"`,l.textAlign=r,l.fillStyle=o,l.fillText(n,e/2,e*.7),new Q.CanvasTexture(a)}const g1=({x:n,y:t,z:e})=>new Q.Vector3(n,t,e),p1=(n,t)=>{var p,g,A;const e={},i=(p=t.animationEnabled)!=null?p:!0,s=(g=t.position)!=null?g:void 0,o=(A=t.rad)!=null?A:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=w=>H(this,null,function*(){var R,U,j,Y,N,G,X,J;const I=(R=w==null?void 0:w.position)!=null?R:s;if(!I)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const C=g1(I),M=(U=w==null?void 0:w.rad)!=null?U:o,E=(j=w==null?void 0:w.fbx_url)!=null?j:r;if(e.rad=M,M===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${M}`));const S=yield new In.FBXLoader().loadAsync(E);S.position.copy(C),S.rotation.z=M,S.scale.set(.8,.8,.8),Zd(S,{transparent:!0,side:b.DoubleSide});const L=(X=(G=(N=(Y=S.children)==null?void 0:Y[0])==null?void 0:N.children)==null?void 0:G[3])==null?void 0:X.clone();if(!L)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${L}`));const W=(J=t.name)!=null?J:"入户门";return L.material=new Q.MeshBasicMaterial({transparent:!0,map:m1(W)}),L.renderOrder=3,S.children[0].add(L),e.object=S,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const w=1,I=new Q.AnimationMixer(e.object);a.push(I);const C=I.clipAction(e.object.animations[0]);C.timeScale=w;let M;const E=()=>{let R=0,U=0;const j=1e3/30,Y=N=>{R=requestAnimationFrame(Y);const G=N-U;G<j||(U=N,a.forEach(X=>X.update(G/1e3)),n.needsRender=!0)};return R=requestAnimationFrame(Y),()=>{cancelAnimationFrame(R)}},W={play:()=>{M||(C.play(),M=E(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{C.stop(),M==null||M(),M=void 0}};e.animation=W},h=w=>{var C;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((C=w==null?void 0:w.animationEnable)!=null?C:i)&&(e.animation||c(),e.animation.play()),n.scene.add(e.object),n.needsRender=!0},u=()=>{e.object&&(e.animation&&e.animation.stop(),n.scene.remove(e.object),n.needsRender=!0)},f=w=>w==="Floorplan"?h():u();return{load:l,enable:w=>(e.enabled||(e.enabled=!0,f(n.currentMode),n.on("modeChange",f),h(w)),!0),disable:()=>(e.enabled&&(e.enabled=!1,u(),n.off("modeChange",f)),!0)}},v1=ti;function A1(n,t,e,i=v1.Linear.None){const s=new wo(n).to(t,e).easing(i);Ts(()=>s.start(0));const o=Ln(a=>{s.update(a)===!1&&o()}),r=[];return s.onDestroy=a=>(r.push(a),s),s.destroy=function(){this.stop(),Object.assign(s,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();o()},s}function b1(n,t){return A1({progress:0},{progress:1},n,t)}var Jd=(n=>(n.Move="Move",n.Rotate="Rotate",n))(Jd||{}),ai=(n=>(n.Clockwise="Clockwise",n.Anticlockwise="Anticlockwise",n.Loop="Loop",n))(ai||{});const Ko=Math.PI*2;function qd(n){return(n%Ko+Ko)%Ko}function Kd(n){return n%Ko}function Qa(n,t,e){return n+(t-n)*e}const Wa=(n,t,e)=>{const i=Math.PI,s=i*2;let o=qd(n),r=qd(t);return e===ai.Anticlockwise&&o<r&&(o+=s),e===ai.Clockwise&&r<o&&(r+=s),e===ai.Loop&&r-o>i?Wa(o,r,ai.Anticlockwise):e===ai.Loop&&o-r>i?Wa(o,r,ai.Clockwise):{from:o,to:r}},y1=n=>{const t={},e=(l,c,...h)=>H(this,[l,c,...h],function*(o,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),o.mode&&o.mode!==n.currentMode&&(yield n.changeMode(o.mode)),a.preload&&o.panoIndex!==void 0&&o.panoIndex!==n.panoIndex&&(yield n.preloadPano(o.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),o.panoIndex===void 0&&o.fov===void 0&&o.latitude===void 0&&o.longitude===void 0?!0:yield new Promise((u,f)=>{const m=o.panoIndex!==void 0?o.panoIndex:n.panoIndex;m!==void 0?n.moveToPano(m,x({duration:r,moveEndCallback:()=>u(!0),moveCancelCallback:()=>f(new Error("move canceled"))},o)):f(new Error("unexpected error"))})}),i=o=>{const r=n.state,a=Kd(r.latitude),l=Kd(o.latitude),{from:c,to:h}=Wa(r.longitude,o.longitude,o.rotation||ai.Loop),u=r.fov,f=o.fov;return{from:{latitude:a,longitude:c,fov:u},to:{latitude:l,longitude:h,fov:f}}};return{move:e,rotate:(l,c,...h)=>H(this,[l,c,...h],function*(o,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),n.currentMode!==Xe.Five.Mode.Panorama&&(yield n.changeMode(Xe.Five.Mode.Panorama)),o.panoIndex!==void 0&&o.panoIndex!==n.panoIndex&&(a.preload&&(yield n.preloadPano(o.panoIndex)),yield new Promise((m,v)=>{if(!o.panoIndex){m(!0);return}n.moveToPano(o.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>v(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:u,to:f}=i(o);return yield new Promise(m=>{const v=({progress:I})=>{const C={};C.longitude=Qa(u.longitude,f.longitude,I),C.latitude=Qa(u.latitude,f.latitude,I),C.fov=Qa(u.fov,f.fov,I),n.setState(C,!0)},p=()=>{m(!0)},g=()=>{m(!1)},A=o.rotateSpeed?Math.ceil(Math.abs(f.longitude-u.longitude)/o.rotateSpeed*1e3):r,w=b1(A,ti.Linear.None).onUpdate(v).onComplete(p).onDestroy(g);o.rotation===ai.Loop&&w.repeat(1/0).yoyo(!0),t.interruptCallback=(I=!0)=>{w.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(I)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function $d(n,t){return n.x===t.x&&n.y===t.y}function eu(n,t){return Math.abs(n)===1/0&&Math.abs(t)===1/0?!0:Math.abs(n-t)<.001}function $o(n,t){return(t.y-n.y)/(t.x-n.x)}function tu(n,t,e){const i=$o(n[1],n[0]),s=$o(t[1],t[0]);if(isNaN(i)||isNaN(s)||eu(i,s))return!1;if(er(n[0],t))return n[0];if(er(n[1],t))return n[1];if(er(t[0],n))return t[0];if(er(t[1],n))return t[1];if(e&&!C1(n,t))return!1;const o=n[0],r=t[0];if(Math.abs(i)===1/0)return{x:o.x,y:t[1].y-(t[1].x-o.x)*s};if(Math.abs(s)===1/0)return{x:r.x,y:n[1].y-(n[1].x-r.x)*i};const a=(r.y-o.y+i*o.x-s*r.x)/(i-s),l=i*a-i*o.x+o.y;return{x:a,y:l}}function er(n,t){return $d(n,t[0])||$d(n,t[1])?!0:(t[0].x-n.x)*(n.x-t[1].x)>=0&&(t[0].y-n.y)*(n.y-t[1].y)>=0&&eu($o(t[0],n),$o(n,t[1]))}function w1(n){let t=1/0,e=-1/0,i=1/0,s=-1/0;return n.forEach(o=>{t=Math.min(t,o.x),e=Math.max(e,o.x),i=Math.min(i,o.y),s=Math.max(s,o.y)}),{x:(t+e)/2,y:(i+s)/2}}function tr(n,t,e){return(n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y)}function C1(n,t){return Math.max(n[0].x,n[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(n[0].x,n[1].x)&&Math.max(n[0].y,n[1].y)>=Math.min(t[0].y,t[1].y)&&tr(t[0],n[1],n[0])*tr(n[1],t[1],n[0])>0&&tr(n[0],t[1],t[0])*tr(t[1],n[1],t[0])>0?1:0}function iu(n,t=0){t<=0?requestAnimationFrame(n):requestAnimationFrame(()=>iu(n,t-1))}const P1=`<style type="text/css">
452
+ `;return n.$$set=o=>{"content"in o&&e(0,i=o.content)},[i,s]}class eA extends ue{constructor(t){super(),de(this,t,$0,K0,he,{content:0},q0)}}function tA(n){ge(n,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function iA(n){let t,e;return t=new J0({props:{url:n[1].url}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&2&&(o.url=i[1].url),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function nA(n){let t,e;return t=new eA({props:{content:n[0]}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.content=i[0]),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function sA(n){let t,e,i,s;const o=[nA,iA],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(n))&&(i=r[e]=o[e](n)),{c(){t=T("div"),i&&i.c(),P(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){B(l,t,c),~e&&r[e].m(t,null),s=!0},p(l,[c]){let h=e;e=a(l),e===h?~e&&r[e].p(l,c):(i&&(fe(),_(r[h],1,1,()=>{r[h]=null}),me()),~e?(i=r[e],i?i.p(l,c):(i=r[e]=o[e](l),i.c()),D(i,1),i.m(t,null)):i=null)},i(l){s||(D(i),s=!0)},o(l){_(i),s=!1},d(l){l&&V(t),~e&&r[e].d()}}}function oA(n,t,e){let i,s,{floorIndex:o}=t,{floorplanData:r}=t;return n.$$set=a=>{"floorIndex"in a&&e(2,o=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},n.$$.update=()=>{var a,l;n.$$.dirty&12&&e(1,i=r.outlines[o]),n.$$.dirty&12&&e(0,s=(l=(a=r.outlines)==null?void 0:a[o])==null?void 0:l.svgContent)},[s,i,o,r]}class cd extends ue{constructor(t){super(),de(this,t,oA,sA,he,{floorIndex:2,floorplanData:3},tA)}}function rA(n){ge(n,"svelte-9vzn2f",".floorplan-plugin__room-label-item.svelte-9vzn2f{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-part1.svelte-9vzn2f{display:flex;flex-flow:column;align-items:center;color:#fff;white-space:nowrap}.floorplan-plugin__room-area.svelte-9vzn2f{opacity:0.6;line-height:1.25;margin-top:0.125rem}")}function aA(n){let t,e=n[15].outerHTML+"",i;return{c(){t=new _o(!1),i=Ee(),t.a=i},m(s,o){t.m(e,s,o),B(s,i,o)},p(s,o){o[0]&32768&&e!==(e=s[15].outerHTML+"")&&t.p(e)},d(s){s&&V(i),s&&t.d()}}}function lA(n){let t,e,i,s,o,r,a=n[1]&&hd(n),l=n[0]&&dd(n),c=n[2]&&ud(n);return{c(){t=T("div"),a&&a.c(),e=te(),l&&l.c(),i=te(),c&&c.c(),s=Ee(),P(t,"class","floorplan-plugin__room-part1 svelte-9vzn2f"),z(t,"opacity",n[11]?"1":"0")},m(h,u){B(h,t,u),a&&a.m(t,null),O(t,e),l&&l.m(t,null),B(h,i,u),c&&c.m(h,u),B(h,s,u),o||(r=[Xt(Oi.call(null,t)),Ce(t,"clientWidth",n[32]),Ce(t,"clientHeight",n[33])],o=!0)},p(h,u){h[1]?a?a.p(h,u):(a=hd(h),a.c(),a.m(t,e)):a&&(a.d(1),a=null),h[0]?l?l.p(h,u):(l=dd(h),l.c(),l.m(t,null)):l&&(l.d(1),l=null),u[0]&2048&&z(t,"opacity",h[11]?"1":"0"),h[2]?c?c.p(h,u):(c=ud(h),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null)},d(h){h&&V(t),a&&a.d(),l&&l.d(),h&&V(i),c&&c.d(h),h&&V(s),o=!1,rt(r)}}}function hd(n){let t,e=n[3].name+"",i;return{c(){t=T("span"),i=Se(e),P(t,"class","floorplan-plugin__room-name")},m(s,o){B(s,t,o),O(t,i)},p(s,o){o[0]&8&&e!==(e=s[3].name+"")&&Te(i,e)},d(s){s&&V(t)}}}function dd(n){let t,e;return{c(){t=T("span"),e=Se(n[14]),P(t,"class","floorplan-plugin__room-area svelte-9vzn2f"),z(t,"font-size",n[19])},m(i,s){B(i,t,s),O(t,e)},p(i,s){s[0]&16384&&Te(e,i[14])},d(i){i&&V(t)}}}function ud(n){let t,e;return{c(){t=T("span"),e=Se(n[13]),P(t,"class","floorplan-plugin__room-size"),z(t,"font-size",n[19]),z(t,"opacity",n[10]?"0.6":"0")},m(i,s){B(i,t,s),O(t,e)},p(i,s){s[0]&8192&&Te(e,i[13]),s[0]&1024&&z(t,"opacity",i[10]?"0.6":"0")},d(i){i&&V(t)}}}function cA(n){let t,e,i;function s(a,l){if(a[4]===void 0)return lA;if(a[15])return aA}let o=s(n),r=o&&o(n);return{c(){t=T("div"),r&&r.c(),P(t,"class","floorplan-plugin__room-label-item svelte-9vzn2f"),z(t,"left",n[16]),z(t,"top",n[17]),z(t,"font-size",n[18]),z(t,"opacity",n[12]?"1":"0"),z(t,"transform",n[9]?"translate(-50%, calc(-50% + 6px))":"translate(-50%, -50%)")},m(a,l){B(a,t,l),r&&r.m(t,null),e||(i=[Xt(Oi.call(null,t)),Ce(t,"clientWidth",n[34]),Ce(t,"clientHeight",n[35])],e=!0)},p(a,l){o===(o=s(a))&&r?r.p(a,l):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null))),l[0]&4096&&z(t,"opacity",a[12]?"1":"0"),l[0]&512&&z(t,"transform",a[9]?"translate(-50%, calc(-50% + 6px))":"translate(-50%, -50%)")},i:$,o:$,d(a){a&&V(t),r&&r.d(),e=!1,rt(i)}}}function hA(n,t){const e=n[0],i=n[1];let s=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){const a=t[o][0],l=t[o][1],c=t[r][0],h=t[r][1];l>i!=h>i&&e<(c-a)*(i-l)/(h-l)+a&&(s=!s)}return s}function dA(n,t,e){let i,s,o,r,a,l,c,h,u,f,m,v,p,{pxmm:g}=t,{roomAreaEnable:A}=t,{roomNameEnable:w}=t,{roomDimensionEnable:I}=t,{room:C}=t,{hoveredRoom:M}=t,{getRoomAreaText:E}=t,{getRoomDimensionText:S}=t,{getLabelElement:L}=t,{adaptiveRoomLabelVisibleEnable:W}=t;function R(ee,be){if(be.width===0||be.height===0)return()=>!1;const je=ee.path.map(({x:Be,y:Ue})=>[Be,Ue]),ve=ee.roomLabel.position,{x:qe,y:Oe}=ve,{width:Le,height:st}=be,ce=Le/2,Pe=st/2;return function(Ue){const dt=qe*Ue,tt=Oe*Ue,at=je.map(([Me,Ke])=>[Me*Ue,Ke*Ue]);return[[dt+ce,tt-Pe],[dt-ce,tt-Pe],[dt-ce,tt+Pe],[dt+ce,tt+Pe]].every(Me=>hA(Me,at))}}const U=document.body.clientWidth,j=document.body.clientHeight,Y=C.roomLabel,N=Y.positionInImage.x*100+"%",G=Y.positionInImage.y*100+"%",X=(U<500||j<500?10:14)+"px",J=(U<500||j<500?8:12)+"px";let q=0,le=0,ae=0,Ie=0,Ae=!1;M.subscribe(function(be){e(25,Ae=!!be&&be.id===C.id)});const pe=ee=>{e(7,ae=ee.detail)},Fe=ee=>{e(8,Ie=ee.detail)},we=ee=>{e(5,q=ee.detail)},Ye=ee=>{e(6,le=ee.detail)};return n.$$set=ee=>{"pxmm"in ee&&e(20,g=ee.pxmm),"roomAreaEnable"in ee&&e(0,A=ee.roomAreaEnable),"roomNameEnable"in ee&&e(1,w=ee.roomNameEnable),"roomDimensionEnable"in ee&&e(2,I=ee.roomDimensionEnable),"room"in ee&&e(3,C=ee.room),"hoveredRoom"in ee&&e(21,M=ee.hoveredRoom),"getRoomAreaText"in ee&&e(22,E=ee.getRoomAreaText),"getRoomDimensionText"in ee&&e(23,S=ee.getRoomDimensionText),"getLabelElement"in ee&&e(4,L=ee.getLabelElement),"adaptiveRoomLabelVisibleEnable"in ee&&e(24,W=ee.adaptiveRoomLabelVisibleEnable)},n.$$.update=()=>{var ee,be;n.$$.dirty[0]&24&&e(15,i=L==null?void 0:L(C)),n.$$.dirty[0]&4194312&&e(14,s=C.size?E(C.size):""),n.$$.dirty[0]&8388616&&e(13,o=C!=null&&C.dimension?S((ee=C.dimension)==null?void 0:ee.width,(be=C.dimension)==null?void 0:be.height):""),n.$$.dirty[0]&384&&e(31,r={width:ae,height:Ie}),n.$$.dirty[0]&8|n.$$.dirty[1]&1&&e(30,a=r?R(C,r):void 0),n.$$.dirty[0]&1091567616&&e(27,l=W?!!(a!=null&&a(g)):!0),n.$$.dirty[0]&96&&e(29,c={width:q,height:le}),n.$$.dirty[0]&536870920&&e(28,h=c?R(C,c):void 0),n.$$.dirty[0]&286261248&&e(26,u=W?!!(h!=null&&h(g)):!0),n.$$.dirty[0]&234881024&&e(12,f=u||l||Ae),n.$$.dirty[0]&167772160&&e(11,m=l||Ae),n.$$.dirty[0]&100663296&&e(10,v=u||Ae),n.$$.dirty[0]&201326592&&e(9,p=l&&!u)},[A,w,I,C,L,q,le,ae,Ie,p,v,m,f,o,s,i,N,G,X,J,g,M,E,S,W,Ae,u,l,h,c,a,r,pe,Fe,we,Ye]}class uA extends ue{constructor(t){super(),de(this,t,dA,cA,he,{pxmm:20,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,room:3,hoveredRoom:21,getRoomAreaText:22,getRoomDimensionText:23,getLabelElement:4,adaptiveRoomLabelVisibleEnable:24},rA,[-1,-1])}}function fA(n){ge(n,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function fd(n,t,e){const i=n.slice();return i[14]=t[e],i}function md(n){let t,e=[],i=new Map,s,o,r,a=n[10];const l=c=>c[14].id;for(let c=0;c<a.length;c+=1){let h=fd(n,a,c),u=l(h);i.set(u,e[c]=gd(u,h))}return{c(){t=T("div");for(let c=0;c<e.length;c+=1)e[c].c();P(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,h){B(c,t,h);for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(t,null);s=!0,o||(r=[Xt(Oi.call(null,t)),Ce(t,"clientWidth",n[13])],o=!0)},p(c,h){h&1791&&(a=c[10],fe(),e=Jt(e,h,l,1,c,a,i,t,ji,gd,null,fd),me())},i(c){if(!s){for(let h=0;h<a.length;h+=1)D(e[h]);s=!0}},o(c){for(let h=0;h<e.length;h+=1)_(e[h]);s=!1},d(c){c&&V(t);for(let h=0;h<e.length;h+=1)e[h].d();o=!1,rt(r)}}}function gd(n,t){let e,i,s;const o=[{pxmm:t[9],room:t[14],hoveredRoom:t[3],roomAreaEnable:t[0],roomNameEnable:t[1],roomDimensionEnable:t[2],getLabelElement:t[6],getRoomAreaText:t[4],getRoomDimensionText:t[5],adaptiveRoomLabelVisibleEnable:t[7]}];let r={};for(let a=0;a<o.length;a+=1)r=gt(r,o[a]);return i=new uA({props:r}),{key:n,first:null,c(){e=Ee(),re(i.$$.fragment),this.first=e},m(a,l){B(a,e,l),se(i,a,l),s=!0},p(a,l){t=a;const c=l&1791?Ct(o,[{pxmm:t[9],room:t[14],hoveredRoom:t[3],roomAreaEnable:t[0],roomNameEnable:t[1],roomDimensionEnable:t[2],getLabelElement:t[6],getRoomAreaText:t[4],getRoomDimensionText:t[5],adaptiveRoomLabelVisibleEnable:t[7]}]):{};i.$set(c)},i(a){s||(D(i.$$.fragment,a),s=!0)},o(a){_(i.$$.fragment,a),s=!1},d(a){a&&V(e),oe(i,a)}}}function mA(n){let t,e,i=n[10]&&md(n);return{c(){i&&i.c(),t=Ee()},m(s,o){i&&i.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[10]?i?(i.p(s,o),o&1024&&D(i,1)):(i=md(s),i.c(),D(i,1),i.m(t.parentNode,t)):i&&(fe(),_(i,1,1,()=>{i=null}),me())},i(s){e||(D(i),e=!0)},o(s){_(i),e=!1},d(s){i&&i.d(s),s&&V(t)}}}function gA(n,t,e){let i,{floorIndex:s}=t,{roomAreaEnable:o}=t,{roomNameEnable:r}=t,{roomDimensionEnable:a}=t,{floorplanData:l}=t,{hoveredRoom:c}=t,{getRoomAreaText:h}=t,{getRoomDimensionText:u}=t,{getLabelElement:f}=t,{adaptiveRoomLabelVisibleEnable:m}=t,v=0,p=0;const g=A=>{e(8,v=A.detail)};return n.$$set=A=>{"floorIndex"in A&&e(11,s=A.floorIndex),"roomAreaEnable"in A&&e(0,o=A.roomAreaEnable),"roomNameEnable"in A&&e(1,r=A.roomNameEnable),"roomDimensionEnable"in A&&e(2,a=A.roomDimensionEnable),"floorplanData"in A&&e(12,l=A.floorplanData),"hoveredRoom"in A&&e(3,c=A.hoveredRoom),"getRoomAreaText"in A&&e(4,h=A.getRoomAreaText),"getRoomDimensionText"in A&&e(5,u=A.getRoomDimensionText),"getLabelElement"in A&&e(6,f=A.getLabelElement),"adaptiveRoomLabelVisibleEnable"in A&&e(7,m=A.adaptiveRoomLabelVisibleEnable)},n.$$.update=()=>{if(n.$$.dirty&6144&&e(10,i=l.floorDatas[s].rooms),n.$$.dirty&4352){const{max:A,min:w}=l.bounding,I=A.x-w.x;e(9,p=v/I)}},[o,r,a,c,h,u,f,m,v,p,i,s,l,g]}class pA extends ue{constructor(t){super(),de(this,t,gA,mA,he,{floorIndex:11,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,floorplanData:12,hoveredRoom:3,getRoomAreaText:4,getRoomDimensionText:5,getLabelElement:6,adaptiveRoomLabelVisibleEnable:7},fA)}}function vA(n){ge(n,"svelte-1fuyezq",".floorplan-plugin__rule-labels.svelte-1fuyezq.svelte-1fuyezq{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-1fuyezq.svelte-1fuyezq{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-1fuyezq.svelte-1fuyezq{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-1fuyezq.svelte-1fuyezq{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-1fuyezq.svelte-1fuyezq{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-1fuyezq.svelte-1fuyezq{background:#fff;opacity:0.2;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-1fuyezq.svelte-1fuyezq{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-scale-wrapper.svelte-1fuyezq{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-1fuyezq.svelte-1fuyezq{position:absolute;background:#fff;opacity:0.2;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-scale.svelte-1fuyezq{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-1fuyezq.svelte-1fuyezq{position:absolute}.floorplan-plugin__rule-labels--top.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-1fuyezq.svelte-1fuyezq{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-text-item.svelte-1fuyezq{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-1fuyezq.svelte-1fuyezq{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.35}")}function pd(n,t,e){const i=n.slice();return i[11]=t[e],i[13]=e,i}function vd(n,t,e){const i=n.slice();return i[14]=t[e],i}function Ad(n){let t;return{c(){t=T("div"),P(t,"class","floorplan-plugin__rule-scale svelte-1fuyezq"),z(t,"left",n[14].left*100+"%"),z(t,"bottom",n[14].bottom*100+"%")},m(e,i){B(e,t,i)},p:$,d(e){e&&V(t)}}}function bd(n,t){let e,i,s=t[1](t[11].distance)+"",o,r;return{key:n,first:null,c(){e=T("div"),i=T("div"),o=Se(s),r=te(),P(i,"class","floorplan-plugin__rule-text svelte-1fuyezq"),ne(i,"is-row",t[2]),P(e,"class","floorplan-plugin__rule-text-item svelte-1fuyezq"),z(e,"left",t[11].left*100+"%"),z(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){B(a,e,l),O(e,i),O(i,o),O(e,r)},p(a,l){t=a,l&2&&s!==(s=t[1](t[11].distance)+"")&&Te(o,s)},d(a){a&&V(e)}}}function AA(n){let t,e,i,s,o,r,a=[],l=new Map,c,h=n[3],u=[];for(let v=0;v<h.length;v+=1)u[v]=Ad(vd(n,h,v));let f=n[4];const m=v=>v[13];for(let v=0;v<f.length;v+=1){let p=pd(n,f,v),g=m(p);l.set(g,a[v]=bd(g,p))}return{c(){t=T("div"),e=T("div"),i=te(),s=T("div");for(let v=0;v<u.length;v+=1)u[v].c();o=te(),r=T("div");for(let v=0;v<a.length;v+=1)a[v].c();P(e,"class","floorplan-plugin__rule-line svelte-1fuyezq"),P(s,"class","floorplan-plugin__rule-scale-wrapper svelte-1fuyezq"),ne(s,"is-row",n[2]),P(r,"class","floorplan-plugin__rule-text-wrapper svelte-1fuyezq"),P(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+n[0]+" svelte-1fuyezq"),ne(t,"is-row",n[2]),z(t,"width",n[2]?"100%":1/16+"rem"),z(t,"height",n[2]?1/16+"rem":"100%")},m(v,p){B(v,t,p),O(t,e),O(t,i),O(t,s);for(let g=0;g<u.length;g+=1)u[g]&&u[g].m(s,null);O(t,o),O(t,r);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(r,null)},p(v,[p]){if(p&8){h=v[3];let g;for(g=0;g<h.length;g+=1){const A=vd(v,h,g);u[g]?u[g].p(A,p):(u[g]=Ad(A),u[g].c(),u[g].m(s,null))}for(;g<u.length;g+=1)u[g].d(1);u.length=h.length}p&22&&(f=v[4],a=Jt(a,p,m,1,v,f,l,r,za,bd,null,pd)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+v[0]+" svelte-1fuyezq")&&P(t,"class",c),p&5&&ne(t,"is-row",v[2])},i:$,o:$,d(v){v&&V(t),Zt(u,v);for(let p=0;p<a.length;p+=1)a[p].d()}}}const Xn=1e3,Zn=180;function bA(n,t,e){let{type:i}=t,{data:s}=t,{bounding:o}=t,{getRuleDistanceText:r}=t;const a=i==="top"||i==="bottom",l=o.max.x-o.min.x-(Xn-Zn)*2,c=o.max.y-o.min.y-(Xn-Zn)*2,h=s.map(([v,p])=>a?[v.x,p.x]:[v.y,p.y]).flat().sort().filter((v,p,g)=>p===0?!0:v!==g[p-1]),u=h.map(v=>{const p=a?(v-o.min.x-Xn+Zn)/l:0,g=a?0:(v-o.min.y-Xn+Zn)/c;return{left:p,bottom:g}});u.unshift({left:0,bottom:0}),u.push(a?{left:1,bottom:0}:{left:0,bottom:1});const f=h[h.length-1]-h[0],m=h.map((v,p,g)=>{const A=p===0?0:v-g[p-1],w=p===0?0:(v+g[p-1])/2,I=a?(w-o.min.x-Xn+Zn)/l:0,C=a?0:(w-o.min.y-Xn+Zn)/c;return{left:I,bottom:C,distance:A}}).filter(({distance:v})=>v/f>.1);return n.$$set=v=>{"type"in v&&e(0,i=v.type),"data"in v&&e(5,s=v.data),"bounding"in v&&e(6,o=v.bounding),"getRuleDistanceText"in v&&e(1,r=v.getRuleDistanceText)},[i,r,a,u,m,s,o]}class yA extends ue{constructor(t){super(),de(this,t,bA,AA,he,{type:0,data:5,bounding:6,getRuleDistanceText:1},vA)}}function wA(n){ge(n,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function yd(n,t,e){const i=n.slice();return i[13]=t[e][0],i[14]=t[e][1],i}function wd(n,t){let e,i,s;const o=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<o.length;a+=1)r=gt(r,o[a]);return i=new yA({props:r}),{key:n,first:null,c(){e=Ee(),re(i.$$.fragment),this.first=e},m(a,l){B(a,e,l),se(i,a,l),s=!0},p(a,l){t=a;const c=l&19?Ct(o,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};i.$set(c)},i(a){s||(D(i.$$.fragment,a),s=!0)},o(a){_(i.$$.fragment,a),s=!1},d(a){a&&V(e),oe(i,a)}}}function CA(n){let t,e=[],i=new Map,s,o=n[4];const r=a=>a[13];for(let a=0;a<o.length;a+=1){let l=yd(n,o,a),c=r(l);i.set(c,e[a]=wd(c,l))}return{c(){t=T("div");for(let a=0;a<e.length;a+=1)e[a].c();P(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),z(t,"width",n[3]),z(t,"height",n[2])},m(a,l){B(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(a,[l]){l&19&&(o=a[4],fe(),e=Jt(e,l,r,1,a,o,i,t,ji,wd,null,yd),me()),l&8&&z(t,"width",a[3]),l&4&&z(t,"height",a[2])},i(a){if(!s){for(let l=0;l<o.length;l+=1)D(e[l]);s=!0}},o(a){for(let l=0;l<e.length;l+=1)_(e[l]);s=!1},d(a){a&&V(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Cd=1e3,Pd=180;function PA(n,t,e){let i,s,o,r,a,l,c,h,u,f,{floorIndex:m}=t,{floorplanData:v}=t,{getRuleDistanceText:p}=t;return n.$$set=g=>{"floorIndex"in g&&e(5,m=g.floorIndex),"floorplanData"in g&&e(6,v=g.floorplanData),"getRuleDistanceText"in g&&e(0,p=g.getRuleDistanceText)},n.$$.update=()=>{n.$$.dirty&64&&e(1,i=v.bounding),n.$$.dirty&96&&e(11,s=v.floorDatas[m].rules),n.$$.dirty&2048&&e(12,o=Object.keys(s)),n.$$.dirty&6144&&e(4,r=o.map(g=>[g,s[g]])),n.$$.dirty&2&&e(9,a=i.max.x-i.min.x),n.$$.dirty&2&&e(7,l=i.max.y-i.min.y),n.$$.dirty&2&&e(10,c=i.max.x-i.min.x-(Cd-Pd)*2),n.$$.dirty&2&&e(8,h=i.max.y-i.min.y-(Cd-Pd)*2),n.$$.dirty&1536&&e(3,u=c/a*100+"%"),n.$$.dirty&384&&e(2,f=h/l*100+"%")},[p,i,f,u,r,m,v,l,h,a,c,s,o]}class IA extends ue{constructor(t){super(),de(this,t,PA,CA,he,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},wA)}}function Jo(n,t={}){let e="";const{needZ:i,needA:s}=t;return(i?n.slice().concat(n[0]):n.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,h=l+","+c;return a===0?(e+="M"+h,e):s!=null&&s[a]?(e+="A"+s[a]+","+h,e):(e+="L"+h,e)}),e+(i?"Z":"")}function Id({x:n,y:t},e){const{max:i,min:s}=e;return{x:n-s.x,y:i.y-t}}function MA(n,t){const e=n.x*1e3+t.bounding.origin.x,i=-n.z*1e3+t.bounding.origin.y;return{x:e,y:i}}function EA(n,t){const e=t.bounding,i=e.max.x-e.min.x,s=e.max.y-e.min.y;return{x:(n.x-e.min.x)/i,y:(e.max.y-n.y)/s}}function kA(n,t){return Math.max(...t.work.observers.map(i=>n.z>=i.standingPosition.z?i.floorIndex:0))}function xA(n){let t;return{c(){t=Ne("path"),P(t,"d",n[0]),P(t,"fill","#2F313A")},m(e,i){B(e,t,i)},p(e,[i]){i&1&&P(t,"d",e[0])},i:$,o:$,d(e){e&&V(t)}}}function DA(n,t,e){let i,{path:s}=t;return n.$$set=o=>{"path"in o&&e(1,s=o.path)},n.$$.update=()=>{n.$$.dirty&2&&e(0,i=Jo(s,{needZ:!0}))},[i,s]}class SA extends ue{constructor(t){super(),de(this,t,DA,xA,he,{path:1})}}function LA(n){let t,e,i,s,o,r;return{c(){t=Ne("defs"),e=Ne("pattern"),i=Ne("rect"),s=Ne("path"),o=te(),r=Ne("path"),P(i,"x","0"),P(i,"y","0"),P(i,"width",n[1]),P(i,"height",n[1]),P(i,"fill","#323747"),P(s,"d",n[2]),P(s,"stroke","#ffffff"),P(s,"stroke-opacity","0.06"),P(s,"stroke-width","0.5"),P(s,"fill","none"),P(e,"id","fpm-room-pattern-0"),P(e,"x","0"),P(e,"y","0"),P(e,"width",n[1]),P(e,"height",n[1]),P(e,"patternUnits","userSpaceOnUse"),P(e,"patternTransform","scale(50 50)"),P(r,"d",n[0]),P(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){B(a,t,l),O(t,e),O(e,i),O(e,s),B(a,o,l),B(a,r,l)},p(a,[l]){l&1&&P(r,"d",a[0])},i:$,o:$,d(a){a&&V(t),a&&V(o),a&&V(r)}}}const Ba=6;function TA(n,t,e){let i,{path:s}=t;const o=Ba*2,r=`M0 ${Ba} h ${o} M${Ba} 0 v ${o}`;return n.$$set=a=>{"path"in a&&e(3,s=a.path)},n.$$.update=()=>{n.$$.dirty&8&&e(0,i=Jo(s,{needZ:!0}))},[i,o,r,s]}class zA extends ue{constructor(t){super(),de(this,t,TA,LA,he,{path:3})}}function jA(n){let t,e,i,s,o,r,a,l,c,h,u;return{c(){t=Ne("defs"),e=Ne("pattern"),i=Ne("rect"),s=Ne("pattern"),o=Ne("rect"),r=te(),a=Ne("path"),l=te(),c=Ne("path"),h=te(),u=Ne("path"),P(i,"x","0"),P(i,"y","0"),P(i,"width","6"),P(i,"height","50"),P(i,"fill","none"),P(i,"stroke","#4B4B57"),P(i,"stroke-width","0.5"),P(e,"id","room-material-pattern-1"),P(e,"x","0"),P(e,"y","0"),P(e,"width","12"),P(e,"height","50"),P(e,"patternUnits","userSpaceOnUse"),P(e,"patternTransform","scale(50 50)"),P(o,"x","0"),P(o,"y","0"),P(o,"width","6"),P(o,"height","50"),P(o,"fill","none"),P(o,"stroke","#4B4B57"),P(o,"stroke-width","0.5"),P(s,"id","room-material-pattern-2"),P(s,"x","6"),P(s,"y","25"),P(s,"width","12"),P(s,"height","50"),P(s,"patternUnits","userSpaceOnUse"),P(s,"patternTransform","scale(50 50)"),P(a,"d",n[0]),P(a,"fill","#43434D"),P(c,"d",n[0]),P(c,"fill","url(#room-material-pattern-1)"),P(u,"d",n[0]),P(u,"fill","url(#room-material-pattern-2)")},m(f,m){B(f,t,m),O(t,e),O(e,i),O(t,s),O(s,o),B(f,r,m),B(f,a,m),B(f,l,m),B(f,c,m),B(f,h,m),B(f,u,m)},p(f,[m]){m&1&&P(a,"d",f[0]),m&1&&P(c,"d",f[0]),m&1&&P(u,"d",f[0])},i:$,o:$,d(f){f&&V(t),f&&V(r),f&&V(a),f&&V(l),f&&V(c),f&&V(h),f&&V(u)}}}function OA(n,t,e){let i,{path:s}=t;return n.$$set=o=>{"path"in o&&e(1,s=o.path)},n.$$.update=()=>{n.$$.dirty&2&&e(0,i=Jo(s,{needZ:!0}))},[i,s]}class VA extends ue{constructor(t){super(),de(this,t,OA,jA,he,{path:1})}}function BA(n){ge(n,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Md(n,t,e){const i=n.slice();return i[5]=t[e],i}function _A(n){let t,e;return t=new zA({props:{path:n[5].path}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.path=i[5].path),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function RA(n){let t,e;return t=new VA({props:{path:n[5].path}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.path=i[5].path),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function FA(n){let t,e;return t=new SA({props:{path:n[5].path}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.path=i[5].path),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function Ed(n){let t,e,i,s;const o=[FA,RA,_A],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(n),i=r[e]=o[e](n),{c(){t=Ne("svg"),i.c(),P(t,"width","100%"),P(t,"height","100%"),P(t,"viewBox",`0 0 ${n[1]} ${n[2]}`),P(t,"class","svelte-1dykexu")},m(l,c){B(l,t,c),r[e].m(t,null),s=!0},p(l,c){let h=e;e=a(l),e===h?r[e].p(l,c):(fe(),_(r[h],1,1,()=>{r[h]=null}),me(),i=r[e],i?i.p(l,c):(i=r[e]=o[e](l),i.c()),D(i,1),i.m(t,null))},i(l){s||(D(i),s=!0)},o(l){_(i),s=!1},d(l){l&&V(t),r[e].d()}}}function NA(n){let t,e,i=n[0],s=[];for(let r=0;r<i.length;r+=1)s[r]=Ed(Md(n,i,r));const o=r=>_(s[r],1,1,()=>{s[r]=null});return{c(){t=T("div");for(let r=0;r<s.length;r+=1)s[r].c();P(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){B(r,t,a);for(let l=0;l<s.length;l+=1)s[l]&&s[l].m(t,null);e=!0},p(r,[a]){if(a&7){i=r[0];let l;for(l=0;l<i.length;l+=1){const c=Md(r,i,l);s[l]?(s[l].p(c,a),D(s[l],1)):(s[l]=Ed(c),s[l].c(),D(s[l],1),s[l].m(t,null))}for(fe(),l=i.length;l<s.length;l+=1)o(l);me()}},i(r){if(!e){for(let a=0;a<i.length;a+=1)D(s[a]);e=!0}},o(r){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)_(s[a]);e=!1},d(r){r&&V(t),Zt(s,r)}}}function GA(n,t,e){let i,{floorIndex:s}=t,{floorplanData:o}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return n.$$set=l=>{"floorIndex"in l&&e(3,s=l.floorIndex),"floorplanData"in l&&e(4,o=l.floorplanData)},n.$$.update=()=>{n.$$.dirty&24&&e(0,i=o.floorDatas[s].rooms.map(l=>ie(x({},l),{path:l.path.map(c=>Id(c,o.bounding))})))},[i,r,a,s,o]}class QA extends ue{constructor(t){super(),de(this,t,GA,NA,he,{floorIndex:3,floorplanData:4},BA)}}function WA(n){ge(n,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function HA(n){let t,e,i,s;return{c(){t=Ne("path"),P(t,"d",n[5]),P(t,"fill","#fff"),P(t,"style",n[2]),P(t,"id",e=`${n[1]}_${n[0].id}`),P(t,"class","svelte-qq2273")},m(o,r){B(o,t,r),i||(s=[Ce(t,"mouseenter",n[3]),Ce(t,"mouseleave",n[4])],i=!0)},p(o,[r]){r&4&&P(t,"style",o[2]),r&3&&e!==(e=`${o[1]}_${o[0].id}`)&&P(t,"id",e)},i:$,o:$,d(o){o&&V(t),i=!1,rt(s)}}}function UA(n,t,e){let i,s,{room:o}=t,{floorIndex:r}=t,{floorplanData:a}=t,{highlightData:l}=t,{hoveredRoom:c}=t;function h(){c==null||c.set(o)}function u(){c==null||c.set(void 0)}const{bounding:f}=a,m=Jo(o.path,{needZ:!0,format:v=>Id(v,f)});return n.$$set=v=>{"room"in v&&e(0,o=v.room),"floorIndex"in v&&e(1,r=v.floorIndex),"floorplanData"in v&&e(6,a=v.floorplanData),"highlightData"in v&&e(7,l=v.highlightData),"hoveredRoom"in v&&e(8,c=v.hoveredRoom)},n.$$.update=()=>{n.$$.dirty&131&&e(9,i=l[`${r}_${o.id}`]),n.$$.dirty&512&&e(2,s=i?`fill: ${i.color}; --opacity: ${i.opacity}; pointer-events: ${i.disabled?"none":"auto"}`:null)},[o,r,s,h,u,m,a,l,c,i]}class YA extends ue{constructor(t){super(),de(this,t,UA,HA,he,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},WA)}}function XA(n){ge(n,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function kd(n,t,e){const i=n.slice();return i[6]=t[e],i}function xd(n,t){let e,i,s;const o=[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}];let r={};for(let a=0;a<o.length;a+=1)r=gt(r,o[a]);return i=new YA({props:r}),{key:n,first:null,c(){e=Ee(),re(i.$$.fragment),this.first=e},m(a,l){B(a,e,l),se(i,a,l),s=!0},p(a,l){t=a;const c=l&15?Ct(o,[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}]):{};i.$set(c)},i(a){s||(D(i.$$.fragment,a),s=!0)},o(a){_(i.$$.fragment,a),s=!1},d(a){a&&V(e),oe(i,a)}}}function ZA(n){let t,e,i=[],s=new Map,o,r=n[1].floorDatas[n[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=kd(n,r,l),h=a(c);s.set(h,i[l]=xd(h,c))}return{c(){t=T("div"),e=Ne("svg");for(let l=0;l<i.length;l+=1)i[l].c();P(e,"width","100%"),P(e,"height","100%"),P(e,"viewBox",`0 0 ${n[4]} ${n[5]}`),P(e,"class","svelte-1kqo6e4"),P(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){B(l,t,c),O(t,e);for(let h=0;h<i.length;h+=1)i[h]&&i[h].m(e,null);o=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,fe(),i=Jt(i,c,a,1,l,r,s,e,ji,xd,null,kd),me())},i(l){if(!o){for(let c=0;c<r.length;c+=1)D(i[c]);o=!0}},o(l){for(let c=0;c<i.length;c+=1)_(i[c]);o=!1},d(l){l&&V(t);for(let c=0;c<i.length;c+=1)i[c].d()}}}function JA(n,t,e){let{floorIndex:i}=t,{floorplanData:s}=t,{highlightData:o}=t,{hoveredRoom:r}=t;const a=s.bounding.max.x-s.bounding.min.x,l=s.bounding.max.y-s.bounding.min.y;return n.$$set=c=>{"floorIndex"in c&&e(0,i=c.floorIndex),"floorplanData"in c&&e(1,s=c.floorplanData),"highlightData"in c&&e(2,o=c.highlightData),"hoveredRoom"in c&&e(3,r=c.hoveredRoom)},[i,s,o,r,a,l]}class Dd extends ue{constructor(t){super(),de(this,t,JA,ZA,he,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},XA)}}function qA(n){ge(n,"svelte-1lm20n5",".missing-floor.svelte-1lm20n5{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;flex-direction:column;align-items:center}.text.svelte-1lm20n5{margin-top:0.75rem;color:#fff;opacity:0.3}")}function Sd(n){let t,e=n[0].text+"",i;return{c(){t=T("span"),i=Se(e),P(t,"class","text svelte-1lm20n5"),z(t,"font-size",n[0].textFontSize+"px")},m(s,o){B(s,t,o),O(t,i)},p(s,o){o&1&&e!==(e=s[0].text+"")&&Te(i,e),o&1&&z(t,"font-size",s[0].textFontSize+"px")},d(s){s&&V(t)}}}function KA(n){let t,e,i,s,o=n[0].text&&Sd(n);return{c(){t=T("div"),e=T("img"),s=te(),o&&o.c(),P(e,"class","image"),P(e,"alt","缺省楼层展位图"),ft(e.src,i=n[0].imageURL)||P(e,"src",i),z(e,"width",n[0].imageWidth+"px"),z(e,"height",n[0].imageHeight+"px"),P(t,"class","missing-floor svelte-1lm20n5")},m(r,a){B(r,t,a),O(t,e),O(t,s),o&&o.m(t,null)},p(r,[a]){a&1&&!ft(e.src,i=r[0].imageURL)&&P(e,"src",i),a&1&&z(e,"width",r[0].imageWidth+"px"),a&1&&z(e,"height",r[0].imageHeight+"px"),r[0].text?o?o.p(r,a):(o=Sd(r),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},i:$,o:$,d(r){r&&V(t),o&&o.d()}}}function $A(n,t,e){let{missingFloorConfig:i}=t;return n.$$set=s=>{"missingFloorConfig"in s&&e(0,i=s.missingFloorConfig)},[i]}class eb extends ue{constructor(t){super(),de(this,t,$A,KA,he,{missingFloorConfig:0},qA)}}const Bi="data:image/png;base64,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";function qo(n){return n*180/Math.PI}function tb(n){ge(n,"svelte-17hhq1b",".floorplan__camera-position.svelte-17hhq1b{pointer-events:none;position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17hhq1b{position:absolute;background-repeat:no-repeat;background-size:100%}")}function ib(n){let t,e;return{c(){t=T("div"),e=T("div"),P(e,"class","floorplan__camera-rotate svelte-17hhq1b"),z(e,"background-image",`url(${n[0]||Bi})`),z(e,"width",n[4]),z(e,"height",n[4]),z(e,"left","-"+n[4]),z(e,"top","-"+n[4]),z(e,"transform",`rotate(${n[3]}deg)`),z(e,"transform-origin",`${n[4]} ${n[4]}`),P(t,"class","floorplan__camera-position svelte-17hhq1b"),z(t,"left",n[1]),z(t,"top",n[2])},m(i,s){B(i,t,s),O(t,e)},p(i,[s]){s&1&&z(e,"background-image",`url(${i[0]||Bi})`);const o=s&1;o&&z(e,"width",i[4]),o&&z(e,"height",i[4]),o&&z(e,"left","-"+i[4]),o&&z(e,"top","-"+i[4]),o&&z(e,"transform",`rotate(${i[3]}deg)`),o&&z(e,"transform-origin",`${i[4]} ${i[4]}`)},i:$,o:$,d(i){i&&V(t)}}}function nb(n,t,e){let{panoIndex:i}=t,{floorplanData:s}=t,{lastPanoramaLongitude:o}=t,{cameraImageUrl:r}=t;const{observers:a}=s,l=a[i],c=l.positionInImage.x,h=l.positionInImage.y,u=c*100+"%",f=h*100+"%",m=-qo(o)+45,v=document.body.clientWidth,p=document.body.clientHeight,A=`${(v<500||p<500?17:37)/16}rem`;return n.$$set=w=>{"panoIndex"in w&&e(5,i=w.panoIndex),"floorplanData"in w&&e(6,s=w.floorplanData),"lastPanoramaLongitude"in w&&e(7,o=w.lastPanoramaLongitude),"cameraImageUrl"in w&&e(0,r=w.cameraImageUrl)},[r,u,f,m,A,i,s,o]}let sb=class extends ue{constructor(t){super(),de(this,t,nb,ib,he,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},tb)}};const ob="data:image/png;base64,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";function rb(n){ge(n,"svelte-rpkaro",".floorplan-plugin__compass.svelte-rpkaro{position:absolute;left:50%;top:-2.875rem;width:14.4375rem;height:2.5625rem;will-change:opacity;transform-origin:center 11.5rem}.floorplan-plugin__compass-image.svelte-rpkaro{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-rpkaro{position:absolute;left:50%;top:0.9375rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.625rem;color:#fff}")}function ab(n){let t,e,i,s,o;return{c(){t=T("div"),e=T("div"),i=te(),s=T("span"),o=Se(n[0]),P(e,"class","floorplan-plugin__compass-image svelte-rpkaro"),z(e,"background-image",`url(${ob})`),P(s,"class","floorplan-plugin__compass-text svelte-rpkaro"),P(t,"class","floorplan-plugin__compass svelte-rpkaro"),z(t,"transform",n[2])},m(r,a){B(r,t,a),O(t,e),O(t,i),O(t,s),O(s,o)},p(r,a){a&1&&Te(o,r[0])},d(r){r&&V(t)}}}function lb(n){let t,e=n[1]&&ab(n);return{c(){e&&e.c(),t=Ee()},m(i,s){e&&e.m(i,s),B(i,t,s)},p(i,[s]){i[1]&&e.p(i,s)},i:$,o:$,d(i){e&&e.d(i),i&&V(t)}}}function cb(n,t,e){var c;let{floorplanData:i}=t,{northDesc:s}=t;const o=(c=i.entrance)==null?void 0:c.northRad,r=typeof o=="number",l=`translateX(-50%) translateZ(10px) rotate(${-(o?qo(o):0)+90}deg)`;return n.$$set=h=>{"floorplanData"in h&&e(3,i=h.floorplanData),"northDesc"in h&&e(0,s=h.northDesc)},[s,r,l,i]}class hb extends ue{constructor(t){super(),de(this,t,cb,lb,he,{floorplanData:3,northDesc:0},rb)}}function db(n){ge(n,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function ub(n){let t,e,i,s,o,r,a,l,c,h;const u=[{floorIndex:n[2],floorplanData:n[11]}];let f={};for(let C=0;C<u.length;C+=1)f=gt(f,u[C]);t=new QA({props:f});let m=(n[3]||n[5])&&Ld(n);const v=[{floorplanData:n[11],floorIndex:n[2]}];let p={};for(let C=0;C<v.length;C+=1)p=gt(p,v[C]);s=new cd({props:p});let g=n[6]&&Td(n),A=n[10]&&zd(n),w=n[4]&&jd(n),I=n[22]&&Od(n);return{c(){re(t.$$.fragment),e=te(),m&&m.c(),i=te(),re(s.$$.fragment),o=te(),g&&g.c(),r=te(),A&&A.c(),a=te(),w&&w.c(),l=te(),I&&I.c(),c=Ee()},m(C,M){se(t,C,M),B(C,e,M),m&&m.m(C,M),B(C,i,M),se(s,C,M),B(C,o,M),g&&g.m(C,M),B(C,r,M),A&&A.m(C,M),B(C,a,M),w&&w.m(C,M),B(C,l,M),I&&I.m(C,M),B(C,c,M),h=!0},p(C,M){const E=M&2052?Ct(u,[{floorIndex:C[2],floorplanData:C[11]}]):{};t.$set(E),C[3]||C[5]?m?(m.p(C,M),M&40&&D(m,1)):(m=Ld(C),m.c(),D(m,1),m.m(i.parentNode,i)):m&&(fe(),_(m,1,1,()=>{m=null}),me());const S=M&2052?Ct(v,[{floorplanData:C[11],floorIndex:C[2]}]):{};s.$set(S),C[6]?g?(g.p(C,M),M&64&&D(g,1)):(g=Td(C),g.c(),D(g,1),g.m(r.parentNode,r)):g&&(fe(),_(g,1,1,()=>{g=null}),me()),C[10]?A?(A.p(C,M),M&1024&&D(A,1)):(A=zd(C),A.c(),D(A,1),A.m(a.parentNode,a)):A&&(fe(),_(A,1,1,()=>{A=null}),me()),C[4]?w?(w.p(C,M),M&16&&D(w,1)):(w=jd(C),w.c(),D(w,1),w.m(l.parentNode,l)):w&&(fe(),_(w,1,1,()=>{w=null}),me()),C[22]?I?(I.p(C,M),M&4194304&&D(I,1)):(I=Od(C),I.c(),D(I,1),I.m(c.parentNode,c)):I&&(fe(),_(I,1,1,()=>{I=null}),me())},i(C){h||(D(t.$$.fragment,C),D(m),D(s.$$.fragment,C),D(g),D(A),D(w),D(I),h=!0)},o(C){_(t.$$.fragment,C),_(m),_(s.$$.fragment,C),_(g),_(A),_(w),_(I),h=!1},d(C){oe(t,C),C&&V(e),m&&m.d(C),C&&V(i),oe(s,C),C&&V(o),g&&g.d(C),C&&V(r),A&&A.d(C),C&&V(a),w&&w.d(C),C&&V(l),I&&I.d(C),C&&V(c)}}}function fb(n){let t,e;return t=new eb({props:{missingFloorConfig:n[18]}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&262144&&(o.missingFloorConfig=i[18]),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function Ld(n){let t,e;const i=[{floorIndex:n[2],floorplanData:n[11],hoveredRoom:n[24],highlightData:n[17]}];let s={};for(let o=0;o<i.length;o+=1)s=gt(s,i[o]);return t=new Dd({props:s}),{c(){re(t.$$.fragment)},m(o,r){se(t,o,r),e=!0},p(o,r){const a=r&16910340?Ct(i,[{floorIndex:o[2],floorplanData:o[11],hoveredRoom:o[24],highlightData:o[17]}]):{};t.$set(a)},i(o){e||(D(t.$$.fragment,o),e=!0)},o(o){_(t.$$.fragment,o),e=!1},d(o){oe(t,o)}}}function Td(n){let t,e;const i=[{floorplanData:n[11],roomAreaEnable:n[7],roomNameEnable:n[8],roomDimensionEnable:n[9],floorIndex:n[2],getRoomAreaText:n[12],getRoomDimensionText:n[13],getLabelElement:n[14],hoveredRoom:n[24],adaptiveRoomLabelVisibleEnable:n[16]}];let s={};for(let o=0;o<i.length;o+=1)s=gt(s,i[o]);return t=new pA({props:s}),{c(){re(t.$$.fragment)},m(o,r){se(t,o,r),e=!0},p(o,r){const a=r&16874372?Ct(i,[{floorplanData:o[11],roomAreaEnable:o[7],roomNameEnable:o[8],roomDimensionEnable:o[9],floorIndex:o[2],getRoomAreaText:o[12],getRoomDimensionText:o[13],getLabelElement:o[14],hoveredRoom:o[24],adaptiveRoomLabelVisibleEnable:o[16]}]):{};t.$set(a)},i(o){e||(D(t.$$.fragment,o),e=!0)},o(o){_(t.$$.fragment,o),e=!1},d(o){oe(t,o)}}}function zd(n){let t,e;const i=[{floorplanData:n[11],floorIndex:n[2],getRuleDistanceText:n[15]}];let s={};for(let o=0;o<i.length;o+=1)s=gt(s,i[o]);return t=new IA({props:s}),{c(){re(t.$$.fragment)},m(o,r){se(t,o,r),e=!0},p(o,r){const a=r&34820?Ct(i,[{floorplanData:o[11],floorIndex:o[2],getRuleDistanceText:o[15]}]):{};t.$set(a)},i(o){e||(D(t.$$.fragment,o),e=!0)},o(o){_(t.$$.fragment,o),e=!1},d(o){oe(t,o)}}}function jd(n){let t,e;const i=[{panoIndex:n[0],floorplanData:n[11],lastPanoramaLongitude:n[19],cameraImageUrl:n[20]}];let s={};for(let o=0;o<i.length;o+=1)s=gt(s,i[o]);return t=new sb({props:s}),{c(){re(t.$$.fragment)},m(o,r){se(t,o,r),e=!0},p(o,r){const a=r&1574913?Ct(i,[{panoIndex:o[0],floorplanData:o[11],lastPanoramaLongitude:o[19],cameraImageUrl:o[20]}]):{};t.$set(a)},i(o){e||(D(t.$$.fragment,o),e=!0)},o(o){_(t.$$.fragment,o),e=!1},d(o){oe(t,o)}}}function Od(n){let t,e;return t=new hb({props:{floorplanData:n[11],northDesc:n[21]}}),{c(){re(t.$$.fragment)},m(i,s){se(t,i,s),e=!0},p(i,s){const o={};s&2048&&(o.floorplanData=i[11]),s&2097152&&(o.northDesc=i[21]),t.$set(o)},i(i){e||(D(t.$$.fragment,i),e=!0)},o(i){_(t.$$.fragment,i),e=!1},d(i){oe(t,i)}}}function mb(n){let t,e,i,s,o;const r=[fb,ub],a=[];function l(c,h){return c[23]?1:0}return e=l(n),i=a[e]=r[e](n),{c(){t=T("div"),i.c(),P(t,"class",s=it(`floorplan-plugin__floor${n[1]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(c,h){B(c,t,h),a[e].m(t,null),o=!0},p(c,[h]){let u=e;e=l(c),e===u?a[e].p(c,h):(fe(),_(a[u],1,1,()=>{a[u]=null}),me(),i=a[e],i?i.p(c,h):(i=a[e]=r[e](c),i.c()),D(i,1),i.m(t,null)),(!o||h&2&&s!==(s=it(`floorplan-plugin__floor${c[1]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&P(t,"class",s)},i(c){o||(D(i),o=!0)},o(c){_(i),o=!1},d(c){c&&V(t),a[e].d()}}}function gb(n,t,e){let i,s,{panoIndex:o}=t,{isCurrent:r}=t,{floorIndex:a}=t,{highlightEnable:l}=t,{cameraEnable:c}=t,{hoverEnable:h}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:f}=t,{roomNameEnable:m}=t,{roomDimensionEnable:v}=t,{ruleLabelsEnable:p}=t,{floorplanData:g}=t,{getRoomAreaText:A}=t,{getRoomDimensionText:w}=t,{getLabelElement:I}=t,{getRuleDistanceText:C}=t,{adaptiveRoomLabelVisibleEnable:M}=t,{highlightData:E}=t,{missingFloorConfig:S}=t,{lastPanoramaLongitude:L}=t,{cameraImageUrl:W}=t,{northDesc:R}=t,{compassEnable:U}=t,{store:j=void 0}=t;const Y=Va(void 0);return Y.subscribe(N=>{j&&e(25,j.roomOnMouse=N,j)}),n.$$set=N=>{"panoIndex"in N&&e(0,o=N.panoIndex),"isCurrent"in N&&e(1,r=N.isCurrent),"floorIndex"in N&&e(2,a=N.floorIndex),"highlightEnable"in N&&e(3,l=N.highlightEnable),"cameraEnable"in N&&e(4,c=N.cameraEnable),"hoverEnable"in N&&e(5,h=N.hoverEnable),"roomLabelsEnable"in N&&e(6,u=N.roomLabelsEnable),"roomAreaEnable"in N&&e(7,f=N.roomAreaEnable),"roomNameEnable"in N&&e(8,m=N.roomNameEnable),"roomDimensionEnable"in N&&e(9,v=N.roomDimensionEnable),"ruleLabelsEnable"in N&&e(10,p=N.ruleLabelsEnable),"floorplanData"in N&&e(11,g=N.floorplanData),"getRoomAreaText"in N&&e(12,A=N.getRoomAreaText),"getRoomDimensionText"in N&&e(13,w=N.getRoomDimensionText),"getLabelElement"in N&&e(14,I=N.getLabelElement),"getRuleDistanceText"in N&&e(15,C=N.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in N&&e(16,M=N.adaptiveRoomLabelVisibleEnable),"highlightData"in N&&e(17,E=N.highlightData),"missingFloorConfig"in N&&e(18,S=N.missingFloorConfig),"lastPanoramaLongitude"in N&&e(19,L=N.lastPanoramaLongitude),"cameraImageUrl"in N&&e(20,W=N.cameraImageUrl),"northDesc"in N&&e(21,R=N.northDesc),"compassEnable"in N&&e(22,U=N.compassEnable),"store"in N&&e(25,j=N.store)},n.$$.update=()=>{n.$$.dirty&2052&&e(26,i=g.floorDatas[a]),n.$$.dirty&67108864&&e(23,s=i.rooms.length>0)},[o,r,a,l,c,h,u,f,m,v,p,g,A,w,I,C,M,E,S,L,W,R,U,s,Y,j,i]}let pb=class extends ue{constructor(t){super(),de(this,t,gb,mb,he,{panoIndex:0,isCurrent:1,floorIndex:2,highlightEnable:3,cameraEnable:4,hoverEnable:5,roomLabelsEnable:6,roomAreaEnable:7,roomNameEnable:8,roomDimensionEnable:9,ruleLabelsEnable:10,floorplanData:11,getRoomAreaText:12,getRoomDimensionText:13,getLabelElement:14,getRuleDistanceText:15,adaptiveRoomLabelVisibleEnable:16,highlightData:17,missingFloorConfig:18,lastPanoramaLongitude:19,cameraImageUrl:20,northDesc:21,compassEnable:22,store:25},db)}};function vb(n){ge(n,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function Vd(n,t,e){const i=n.slice();return i[25]=t[e],i}function Bd(n){let t,e,i,s=n[14].floorDatas,o=[];for(let a=0;a<s.length;a+=1)o[a]=_d(Vd(n,s,a));const r=a=>_(o[a],1,1,()=>{o[a]=null});return{c(){t=T("div");for(let a=0;a<o.length;a+=1)o[a].c();P(t,"class","floorplan-main svelte-86bqav")},m(a,l){B(a,t,l);for(let c=0;c<o.length;c+=1)o[c]&&o[c].m(t,null);i=!0},p(a,l){if(n=a,l&33554428){s=n[14].floorDatas;let c;for(c=0;c<s.length;c+=1){const h=Vd(n,s,c);o[c]?(o[c].p(h,l),D(o[c],1)):(o[c]=_d(h),o[c].c(),D(o[c],1),o[c].m(t,null))}for(fe(),c=s.length;c<o.length;c+=1)r(c);me()}},i(a){if(!i){for(let l=0;l<s.length;l+=1)D(o[l]);e||nt(()=>{e=zi(t,mt,{duration:n[0],easing:bi}),e.start()}),i=!0}},o(a){o=o.filter(Boolean);for(let l=0;l<o.length;l+=1)_(o[l]);i=!1},d(a){a&&V(t),Zt(o,a)}}}function _d(n){let t,e;const i=[{hoverEnable:n[6],highlightEnable:n[7],floorplanData:n[14],getRoomAreaText:n[17],getRoomDimensionText:n[18],getLabelElement:n[19],getRuleDistanceText:n[20],roomLabelsEnable:n[9],roomAreaEnable:n[10],roomNameEnable:n[11],roomDimensionEnable:n[12],ruleLabelsEnable:n[13],adaptiveRoomLabelVisibleEnable:n[21],highlightData:n[22],missingFloorConfig:n[23],panoIndex:n[3],cameraEnable:n[5],cameraImageUrl:n[16],lastPanoramaLongitude:n[15],compassEnable:n[8],northDesc:n[2],store:n[24]},{floorIndex:n[25].floorIndex},{isCurrent:n[25].floorIndex===n[4]}];let s={};for(let o=0;o<i.length;o+=1)s=gt(s,i[o]);return t=new pb({props:s}),{c(){re(t.$$.fragment)},m(o,r){se(t,o,r),e=!0},p(o,r){const a=r&33554428?Ct(i,[r&33554412&&{hoverEnable:o[6],highlightEnable:o[7],floorplanData:o[14],getRoomAreaText:o[17],getRoomDimensionText:o[18],getLabelElement:o[19],getRuleDistanceText:o[20],roomLabelsEnable:o[9],roomAreaEnable:o[10],roomNameEnable:o[11],roomDimensionEnable:o[12],ruleLabelsEnable:o[13],adaptiveRoomLabelVisibleEnable:o[21],highlightData:o[22],missingFloorConfig:o[23],panoIndex:o[3],cameraEnable:o[5],cameraImageUrl:o[16],lastPanoramaLongitude:o[15],compassEnable:o[8],northDesc:o[2],store:o[24]},r&16384&&{floorIndex:o[25].floorIndex},r&16400&&{isCurrent:o[25].floorIndex===o[4]}]):{};t.$set(a)},i(o){e||(D(t.$$.fragment,o),e=!0)},o(o){_(t.$$.fragment,o),e=!1},d(o){oe(t,o)}}}function Ab(n){let t,e,i=n[1]&&Bd(n);return{c(){i&&i.c(),t=Ee()},m(s,o){i&&i.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[1]?i?(i.p(s,o),o&2&&D(i,1)):(i=Bd(s),i.c(),D(i,1),i.m(t.parentNode,t)):i&&(fe(),_(i,1,1,()=>{i=null}),me())},i(s){e||(D(i),e=!0)},o(s){_(i),e=!1},d(s){i&&i.d(s),s&&V(t)}}}function bb(n,t,e){let{duration:i=0}=t,{visible:s}=t,{northDesc:o}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:h}=t,{compassEnable:u}=t,{roomLabelsEnable:f}=t,{roomAreaEnable:m}=t,{roomNameEnable:v}=t,{roomDimensionEnable:p}=t,{ruleLabelsEnable:g}=t,{floorplanData:A}=t,{lastPanoramaLongitude:w}=t,{cameraImageUrl:I}=t,{getRoomAreaText:C}=t,{getRoomDimensionText:M}=t,{getLabelElement:E}=t,{getRuleDistanceText:S}=t,{adaptiveRoomLabelVisibleEnable:L}=t,{highlightData:W}=t,{missingFloorConfig:R}=t,{store:U=void 0}=t;return n.$$set=j=>{"duration"in j&&e(0,i=j.duration),"visible"in j&&e(1,s=j.visible),"northDesc"in j&&e(2,o=j.northDesc),"panoIndex"in j&&e(3,r=j.panoIndex),"floorIndex"in j&&e(4,a=j.floorIndex),"cameraEnable"in j&&e(5,l=j.cameraEnable),"hoverEnable"in j&&e(6,c=j.hoverEnable),"highlightEnable"in j&&e(7,h=j.highlightEnable),"compassEnable"in j&&e(8,u=j.compassEnable),"roomLabelsEnable"in j&&e(9,f=j.roomLabelsEnable),"roomAreaEnable"in j&&e(10,m=j.roomAreaEnable),"roomNameEnable"in j&&e(11,v=j.roomNameEnable),"roomDimensionEnable"in j&&e(12,p=j.roomDimensionEnable),"ruleLabelsEnable"in j&&e(13,g=j.ruleLabelsEnable),"floorplanData"in j&&e(14,A=j.floorplanData),"lastPanoramaLongitude"in j&&e(15,w=j.lastPanoramaLongitude),"cameraImageUrl"in j&&e(16,I=j.cameraImageUrl),"getRoomAreaText"in j&&e(17,C=j.getRoomAreaText),"getRoomDimensionText"in j&&e(18,M=j.getRoomDimensionText),"getLabelElement"in j&&e(19,E=j.getLabelElement),"getRuleDistanceText"in j&&e(20,S=j.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in j&&e(21,L=j.adaptiveRoomLabelVisibleEnable),"highlightData"in j&&e(22,W=j.highlightData),"missingFloorConfig"in j&&e(23,R=j.missingFloorConfig),"store"in j&&e(24,U=j.store)},[i,s,o,r,a,l,c,h,u,f,m,v,p,g,A,w,I,C,M,E,S,L,W,R,U]}let _a=class extends ue{constructor(t){super(),de(this,t,bb,Ab,he,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,roomDimensionEnable:12,ruleLabelsEnable:13,floorplanData:14,lastPanoramaLongitude:15,cameraImageUrl:16,getRoomAreaText:17,getRoomDimensionText:18,getLabelElement:19,getRuleDistanceText:20,adaptiveRoomLabelVisibleEnable:21,highlightData:22,missingFloorConfig:23,store:24},vb)}};const yb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function wb(n){return H(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(s){return H(this,null,function*(){const o={index:s.index,url:s.url,svgUrl:s.svg_url};if(s.svg_url){const r=yield fetch(s.svg_url,{headers:t}).then(a=>a.text());o.svgContent=r}return o})};return yield Promise.all(n.map(e))})}function Cb(n){const t={id:n.id,size:n.size,name:n.name,path:n.path,roomType:n.room_type,floorType:n.floor_type,roomLabel:{position:n.room_label.position,positionInImage:n.room_label.position_in_image},observerIndexs:n.observer_indexs};return n.dimension&&Object.assign(t,{dimension:n.dimension}),t}function Pb(n){return{floorName:n.floor_name,floorIndex:n.floor_index,rooms:n.rooms.map(Cb),rules:n.rules}}function Ib(n){return{index:n.index,floorIndex:n.floor_index,position:n.position,positionInImage:n.position_in_image}}function Mb(n){return{rad:n.rad,position:n.position,positionInImage:n.position_in_image,northRad:n.north_rad,roomId:n.room_id,floorIndex:n.floor_index}}function _i(n){return H(this,null,function*(){const t=yield wb(n.outlines),e=n.computed_data.bounding,i=n.computed_data.floor_datas.map(Pb),s=n.computed_data.entrance?Mb(n.computed_data.entrance):null;return{outlines:t,entrance:s,bounding:e,floorDatas:i,observers:n.computed_data.observers.map(Ib)}})}function Eb(n,t,e){return n.map(s=>{const o=s.position,r=s.icon?s.icon:{url:yb,width:45,height:48},a=kA(o,t),l=MA(o,e),c=EA(l,e);return{floorIndex:a,icon:r,id:s.id,position:l,positionInImage:c}})}function kb(n,t){return t(n),n}function Jn(n,t){return kb({},e=>{for(const i in n)t.indexOf(i)===-1&&(e[i]=n[i])})}function Rd(n,t){const e=Math.max(...n.work.observers.map(i=>i.floorIndex));return t>e?n.model.bounding.max.y:Math.max(...n.work.observers.filter(i=>i.floorIndex===t).map(i=>i.standingPosition.y))}function Ra(n,t,e=Vi.BOUNDING_CENTER){const i=Rd(n,t),s=Rd(n,t+1);return e===Vi.BOUNDING_CENTER?(n.model.bounding.max.y+n.model.bounding.min.y)/2:e===Vi.CEILING?s:i}function Fa(n,t,e,i){const s=Ra(n,e,i==null?void 0:i.attachedTo),o=new b.Vector3(0,s,0),r=new b.Vector3(1,s,0),a=o.clone().project(n.camera),l=r.clone().project(n.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}let Ri=class{constructor(t,e){d(this,"VERSION","3.59.9");d(this,"NAME");d(this,"five");d(this,"workUtil");d(this,"fiveUtil");d(this,"hooks",new ht);d(this,"staticPrefix","//vr-image-4.realsee-cdn.cn");this.five=t,this.fiveUtil=new Io(t),this.workUtil=this.fiveUtil.workUtil,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}set workCode(t){this.workUtil.workCode=t,this.onWorkCodeChange()}get workCode(){return this.workUtil.workCode}updateFive(t){this.five=t,this.fiveUtil.five=t,this.workUtil.five=t}getCurrentState(){return this.state}absoluteUrl(t){return ma(this.staticPrefix,t)}onWorkCodeChange(){}},wi=class extends Ri{};var St=(n=>(n.UnknownError="UnknownError",n.DataNotLoaded="DataNotLoaded",n.UpdateSizeError="UpdateSizeError",n.BreakOffByHide="BreakOffByHide",n.BreakOffByDisable="BreakOffByDisable",n.ModelNotLoaded="ModelNotLoaded",n.ChangeModeError="ChangeModeError",n.UpdateCameraError="UpdateCameraError",n))(St||{});const Fd=500,xb=80;function $i(n,t,e=4){return Math.abs(n-t)<Math.pow(10,-e)}function Nd(n,t,e=4){const i=Math.PI*2,s=n%i,o=t%i,r=Math.min(s,o),a=Math.max(s,o);return $i(r,a,e)||$i(r+i,a,e)}Object.assign(window,{nearlyEqual:$i,nearlyEqualRad:Nd});function Db(n){return Object.prototype.toString.call(n)==="[object Object]"}function Gd(n){return Db(n)&&!!n.isVector3}function Na(n,t){return H(this,null,function*(){const[e]=yield Ki(n.changeMode(...t));if(e)throw new Error("change mode canceled");yield new Promise(r=>{n.once("initAnimationWillStart",()=>{n.once("initAnimationEnded",()=>r())})});const i=t[1];if(!i)return!0;const s=n.getCurrentState();if(!Sb(i,s))throw new Error("pose 与预期不符")})}function Sb(n,t){return Object.keys(n).every(e=>{const i=t[e],s=n[e];return i===void 0||s===void 0?!0:e==="longitude"||e==="latitude"?Nd(i,s,2):typeof i=="number"&&typeof s=="number"?$i(i,s,2):Gd(s)&&Gd(i)?s.distanceTo(i)<.01:i===s})}function Lb(n,t){if(n.currentMode!==t.mode)return!1;const{latitude:e,longitude:i,fov:s,offset:o}=t,{latitude:r,longitude:a,offset:l}=n.getCurrentState(),c=n.camera.fov;return!(!$i(e,r,2)||!$i(i,a,2)||o!==void 0&&o.distanceTo(l)>.01||!$i(s,c,2))}function Qd(n,t,e=!0){return H(this,null,function*(){if(Lb(n,t)===!0)return;const s=n.getCurrentState();if(s.mode!==t.mode){const[h]=yield Ki(Na(n,[t.mode,t,void 0,e]));if(h)throw h;return}const{latitude:o,longitude:r,fov:a}=s,l=Math.min(1e3,Math.max(200,Math.abs(o-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,typeof t.fov=="number"?Math.abs(a-t.fov)*10:1/0)),[c]=yield Ki(n.updateCamera(Jn(t,["mode"]),l,e));if(c)throw new Error(St.UpdateCameraError)})}function qn(n,t,e=300){var s,o;const i=n.getElement();if(i){i.style.opacity=t+"";for(let r=0;r<((o=(s=i.parentElement)==null?void 0:s.children)==null?void 0:o.length);r++){const a=i.parentElement.children[r];a instanceof HTMLElement&&a.dataset.infive==="1"&&(a.style.opacity=t+"")}i.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(r=>i.addEventListener("transitionend",r,{once:!0})),new Promise(r=>setTimeout(r,e))]).then(()=>{i.style.transition="none"})}}function Tb(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return i||s}function zb(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return i&&s}let jb=class extends wi{constructor(e,i){var l,c,h;super(e);d(this,"name","modelFloorplanPlugin");d(this,"state");d(this,"data");d(this,"showState");d(this,"showPromise");d(this,"app");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"selector");d(this,"showRejection");d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"defaultMissingFloorConfig");d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(this,"highlightData",{});d(this,"store",{roomOnMouse:null});d(this,"dispose",()=>{var e,i;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(i=this.container)==null||i.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});d(this,"show",(...i)=>H(this,[...i],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));d(this,"hide",(...i)=>H(this,[...i],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));d(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper)return!1;const{min:e,max:i}=this.data.bounding,s=i.x-e.x,o=i.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Fa(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);return this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c}),!0});d(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});d(this,"unhighlight",()=>{this.highlightData={},this.render()});d(this,"_disable",e=>{var s,o,r;const{userAction:i}=e;this.hooks.emit("disable",{userAction:i}),(s=this.showRejection)==null||s.call(this,St.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});d(this,"_enable",e=>{const{userAction:i}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i}))});d(this,"_show",e=>H(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(St.ModelNotLoaded);if(!this.data)throw new Error(St.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=x(x({},i),e),o=()=>H(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield Ki(Qd(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(St.UnknownError);if(!this.updateSize())throw new Error(St.UpdateSizeError);this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=o().then(()=>{this.showPromise=void 0,this.showRejection=void 0;const a=s.modelOpacity,l=s.immediately?0:Fd;qn(this.five,a,l),this.render(l),this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}),this.showPromise}));d(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,St.BreakOffByHide),this.showPromise=void 0;const s=x(x({},{userAction:!0,isAutoHide:!1}),e);qn(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});d(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click",this.store.roomOnMouse))return!1});d(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});d(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});d(this,"onFiveInteriaPan",(e,i)=>{if(!i||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();s.mode==="Floorplan"&&(this.state.visible||zb(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});d(this,"onFivePanoArrived",e=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=e,this.floorIndex=this.workUtil.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,i)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();Tb(s)&&(this.updateState({visible:!1},i),this._hide({userAction:i,isAutoHide:!0}))});d(this,"onFiveWantsGesture",(e,i)=>{if(this.state.visible&&(i.length>1||e==="mouseWheel"))return!1});d(this,"onFiveWantsPanGesture",(e,i)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&i&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});d(this,"onFiveWantsTapGesture",()=>this.handleClick());d(this,"onFiveWantsChangeMode",(e,i)=>{i==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});d(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:xb/((l=i==null?void 0:i.scale)!=null?l:1)},this.defaultMissingFloorConfig={imageURL:this.staticPrefix+"/release/web/saas/missing-floorplan.e274c596.png",imageWidth:200,imageHeight:120,text:(h=(c=i.i18n)==null?void 0:c.call(i,"暂无平面图"))!=null?h:"暂无平面图",textFontSize:14};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomDimensionEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:Bi,attachedTo:Vi.BOUNDING_CENTER,getLabelElement:void 0,missingFloorConfig:x(x({},this.defaultMissingFloorConfig),i.missingFloorConfig),i18n:u=>u,getRoomAreaText:u=>(u/1e6).toFixed(1)+"㎡",getRoomDimensionText:(u,f)=>(u/1e3).toFixed(1)+"m × "+(f/1e3).toFixed(1)+"m",getRuleDistanceText:u=>u.toString()},o=i?Jn(i,["selector","scale"]):{},r=x(x({},s.missingFloorConfig),o.missingFloorConfig),a=ie(x(x({},s),o),{missingFloorConfig:r});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),e.once("dispose",this.dispose),this.addEventListener()}load(e,i,s=!0){return H(this,null,function*(){function o(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const r=e;r&&Dt(r.version)&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield _i(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,s),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,i=!0){this.updateState({config:e},i),this.render()}formatData(e){return H(this,null,function*(){return yield _i(e.data)})}updateState(e,i){var a;const s=this.state,o=(a=e.config)!=null&&a.missingFloorConfig?x(x({},s.config.missingFloorConfig),e.config.missingFloorConfig):s.config.missingFloorConfig,r=e.config?ie(x(x({},s.config),e.config),{missingFloorConfig:o}):s.config;this.state=ie(x(x({},this.state),e),{config:r}),!wt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0||this.showPromise)return;const i=ie(x({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData,store:this.store});if(this.app)return this.app.$set(i);this.app=new _a({target:this.container,intro:!0,props:i})}};const Ob=(n,t)=>new jb(n,t);function Vb(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return i||s}function Bb(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return i&&s}let _b=class extends wi{constructor(e,i){var l,c;super(e);d(this,"name","modelFloorplanPlugin");d(this,"state");d(this,"data");d(this,"showState");d(this,"showPromise");d(this,"app");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"selector");d(this,"showRejection");d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"defaultMissingFloorConfig");d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(this,"highlightData",{});d(this,"store",{roomOnMouse:null});d(this,"dispose",()=>{var e,i;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(i=this.container)==null||i.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});d(this,"show",(...i)=>H(this,[...i],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));d(this,"hide",(...i)=>H(this,[...i],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));d(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper)return!1;const{min:e,max:i}=this.data.bounding,s=i.x-e.x,o=i.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Fa(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);return this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c}),!0});d(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});d(this,"unhighlight",()=>{this.highlightData={},this.render()});d(this,"_disable",e=>{var s,o,r;const{userAction:i}=e;this.hooks.emit("disable",{userAction:i}),(s=this.showRejection)==null||s.call(this,St.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});d(this,"_enable",e=>{const{userAction:i}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i}))});d(this,"_show",e=>H(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.fiveUtil.model)!=null&&r.loaded))throw new Error(St.ModelNotLoaded);if(!this.data)throw new Error(St.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=x(x({},i),e),o=()=>H(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield Ki(Qd(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(St.UnknownError);if(!this.updateSize())throw new Error(St.UpdateSizeError);this.updatePosition(),this.floorIndex=s.floorIndex,this.fiveUtil.model.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=o().then(()=>{this.showPromise=void 0,this.showRejection=void 0;const a=s.modelOpacity,l=s.immediately?0:Fd;qn(this.five,a,l),this.render(l),this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}),this.showPromise}));d(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,St.BreakOffByHide),this.showPromise=void 0;const s=x(x({},{userAction:!0,isAutoHide:!1}),e);qn(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});d(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click",this.store.roomOnMouse))return!1});d(this,"onFiveModelLoaded",()=>{const i=this.five.model.bounding.getCenter(new b.Vector3);if(this.showState.offset=i,this.state.enabled===!1||this.wrapper||!this.selector)return;const s=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!s)throw new Error("不正确的父容器选择器");this.wrapper=s,s.append(this.container)});d(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});d(this,"onFiveInteriaPan",(e,i)=>{if(!i||this.state.visible||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();s.mode===this.showState.mode&&Bb(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))});d(this,"onFivePanoArrived",e=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=e,this.floorIndex=this.workUtil.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,i)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Vb(s)&&(this.updateState({visible:!1},i),this._hide({userAction:i}))});d(this,"onFiveWantsPanGesture",(e,i)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&i&&this.state.visible)return this.five.updateCamera(Jn(this.showState,["offset"]),0),!1});d(this,"onFiveWantsTapGesture",()=>this.handleClick());d(this,"onFiveWantsChangeMode",(e,i)=>{i==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});d(this,"onModelShownFloorChange",e=>{var i;if(this.floorIndex!==e){if(e===null){const s=this.five.getCurrentState().panoIndex;this.floorIndex=(i=this.five.work)==null?void 0:i.observers[s].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2},this.defaultMissingFloorConfig={imageURL:this.staticPrefix+"/release/web/saas/missing-floorplan.e274c596.png",imageWidth:200,imageHeight:120,text:(c=(l=i.i18n)==null?void 0:l.call(i,"暂无平面图"))!=null?c:"暂无平面图",textFontSize:14};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomDimensionEnable:!0,cameraImageUrl:Bi,attachedTo:Vi.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:x(x({},this.defaultMissingFloorConfig),i.missingFloorConfig),i18n:h=>h,getRoomAreaText:h=>(h/1e6).toFixed(1)+"㎡",getRoomDimensionText:(h,u)=>(h/1e3).toFixed(1)+"m × "+(u/1e3).toFixed(1)+"m",getRuleDistanceText:h=>h.toString()},o=i?Jn(i,["selector","scale"]):{},r=x(x({},s.missingFloorConfig),o.missingFloorConfig),a=ie(x(x({},s),o),{missingFloorConfig:r});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),ni(e).then(this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,i,s=!0){return H(this,null,function*(){function o(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const r=e;r&&Dt(r.version)&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield _i(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,s),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,i=!0){this.updateState({config:e},i),this.render()}updatePosition(){var a;const e=Ra(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.fiveUtil.model)==null?void 0:a.bounding.getCenter(new b.Vector3).setY(e);if(!i)return;const s=i.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}formatData(e){return H(this,null,function*(){return yield _i(e.data)})}updateState(e,i){var a;const s=this.state,o=(a=e.config)!=null&&a.missingFloorConfig?x(x({},s.config.missingFloorConfig),e.config.missingFloorConfig):s.config.missingFloorConfig,r=e.config?ie(x(x({},s.config),e.config),{missingFloorConfig:o}):s.config;this.state=ie(x(x({},this.state),e),{config:r}),!wt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0||this.showPromise)return;const i=ie(x({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData,store:this.store});if(this.app)return this.app.$set(i);this.app=new _a({target:this.container,intro:!0,props:i})}};const Rb=(n,t)=>new _b(n,t);let Fb=class extends wi{constructor(e,i){var l,c;super(e);d(this,"name","topviewFloorplanPlugin");d(this,"state");d(this,"data");d(this,"app");d(this,"selector");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"defaultMissingFloorConfig");d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(this,"highlightData",{});d(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return!1;const{min:e,max:i}=this.data.bounding,s=i.x-e.x,o=i.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Fa(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);return this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c}),!0});d(this,"dispose",()=>{var e,i;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(i=this.container)==null||i.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});d(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});d(this,"unhighlight",()=>{this.highlightData={},this.render()});d(this,"_disable",e=>{var s,o;const{userAction:i}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,(o=this.container)==null||o.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:i})});d(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});d(this,"onFiveModeChange",(...[e,,,,i])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},i),this._hide({userAction:i}))});d(this,"onFivePanoArrived",e=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,i)=>{this.state.visible&&(this.updatePosition(),this.updateSize())});d(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});d(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});d(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:i}=this.five.getCurrentState();i==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});d(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.defaultMissingFloorConfig={imageURL:this.staticPrefix+"/release/web/saas/missing-floorplan.e274c596.png",imageWidth:200,imageHeight:120,text:(c=(l=i.i18n)==null?void 0:l.call(i,"暂无平面图"))!=null?c:"暂无平面图",textFontSize:14};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomDimensionEnable:!0,cameraImageUrl:Bi,attachedTo:Vi.BOUNDING_CENTER,getLabelElement:void 0,missingFloorConfig:x(x({},this.defaultMissingFloorConfig),i.missingFloorConfig),i18n:h=>h,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:h=>(h/1e6).toFixed(1)+"㎡",getRoomDimensionText:(h,u)=>(h/1e3).toFixed(1)+"m × "+(u/1e3).toFixed(1)+"m",getRuleDistanceText:h=>h.toString()},o=i?Jn(i,["selector","scale"]):{},r=x(x({},s.missingFloorConfig),o.missingFloorConfig),a=ie(x(x({},s),o),{missingFloorConfig:r});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,i,s=!0){return H(this,null,function*(){function o(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const r=e;r&&Dt(r.version)&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield _i(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,s),this.render()})}updatePosition(){var a;const e=Ra(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.five.model)==null?void 0:a.bounding.getCenter(new b.Vector3).setY(e);if(!i)return;const s=i.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return H(this,arguments,function*(e={}){if(this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},i),this._show({userAction:i})})}hide(){return H(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},i),this._hide({userAction:i})})}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,i=!0){this.updateState({config:e},i),this.render()}formatData(e){return H(this,null,function*(){return yield _i(e.data)})}_show(e){return H(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:i}=e;this.hooks.emit("show",{userAction:i,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield Na(this.five,["Topview",void 0,void 0,i])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const s=500,o=this.state.config.modelOpacity;qn(this.five,o,s),this.hooks.emit("showAnimationEnded",{userAction:i,auto:!1}),this.render()})}_hide(e){return H(this,null,function*(){if(!this.state.enabled)return;const{userAction:i}=e;this.hooks.emit("hide",{userAction:i,auto:!1});const s=1,o=0;qn(this.five,s,o),this.render()})}_enable(e){const{userAction:i}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i})}updateState(e,i){var a;const s=this.state,o=(a=e.config)!=null&&a.missingFloorConfig?x(x({},s.config.missingFloorConfig),e.config.missingFloorConfig):s.config.missingFloorConfig,r=e.config?ie(x(x({},s.config),e.config),{missingFloorConfig:o}):s.config;this.state=ie(x(x({},this.state),e),{config:r}),!wt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const i=ie(x({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(i);this.app=new _a({target:this.container,intro:!0,props:i})}};const Nb=(n,t)=>new Fb(n,t);function Gb(n){ge(n,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function Qb(n){let t,e,i;return{c(){t=T("div"),e=T("div"),i=T("div"),P(i,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),z(i,"background-image","url("+(n[0]||Bi)+")"),z(i,"transform",n[1]),P(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),z(e,"transform",n[2]),P(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd"),z(t,"opacity",n[3]?1:0)},m(s,o){B(s,t,o),O(t,e),O(e,i)},p(s,[o]){o&1&&z(i,"background-image","url("+(s[0]||Bi)+")"),(o&1||o&3)&&z(i,"transform",s[1]),o&4&&z(e,"transform",s[2]),o&8&&z(t,"opacity",s[3]?1:0)},i:$,o:$,d(s){s&&V(t)}}}function Wb(n){return`rotate(${Math.floor(n/Math.PI*180)*-1+45}deg)`}function Hb(n,t,e){var w,I;let i,s,o,r,{five:a}=t,{pxmm:l}=t,{floorplanData:c}=t,{cameraImageUrl:h}=t,u=a.getCurrentState().panoIndex,f=a.getCurrentState().longitude,m=(I=(w=a.work.observers[a.getCurrentState().panoIndex])==null?void 0:w.floorIndex)!=null?I:0;function v(C,M){const E=C.bounding,S=C.observers[M];if(!S)return"";const L=(E.max.x-E.min.x)*l,W=(E.max.y-E.min.y)*l,R=Math.floor(S.positionInImage.x*L),U=Math.floor(S.positionInImage.y*W);return`translate(${R}px, ${U}px)`}function p(C){e(7,u=C)}function g(C){e(9,m=a.work.observers[C].floorIndex)}const A=Eo(C=>{e(8,f=C.longitude)},1e3/60);return Et(()=>(a.on("panoWillArrive",p),a.on("panoArrived",g),a.on("cameraDirectionUpdate",A),function(){a.off("panoWillArrive",p),a.off("panoArrived",g),a.off("cameraDirectionUpdate",A)})),n.$$set=C=>{"five"in C&&e(4,a=C.five),"pxmm"in C&&e(5,l=C.pxmm),"floorplanData"in C&&e(6,c=C.floorplanData),"cameraImageUrl"in C&&e(0,h=C.cameraImageUrl)},n.$$.update=()=>{n.$$.dirty&576&&e(10,i=c.floorDatas[m]),n.$$.dirty&1024&&e(3,s=i.rooms.length>0),n.$$.dirty&192&&e(2,o=v(c,u)),n.$$.dirty&256&&e(1,r=Wb(f))},[h,r,o,s,a,l,c,u,f,m,i]}class Ub extends ue{constructor(t){super(),de(this,t,Hb,Qb,he,{five:4,pxmm:5,floorplanData:6,cameraImageUrl:0},Gb)}}function Yb(n){ge(n,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function Wd(n,t,e){const i=n.slice();return i[1]=t[e],i}function Hd(n,t){let e,i,s=`${t[1].icon.width/16}rem`,o=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:n,first:null,c(){e=T("div"),i=T("div"),r=te(),P(i,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),z(i,"background-image",`url(${t[1].icon.url})`),z(i,"width",s),z(i,"height",o),P(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),z(e,"top",a),z(e,"left",l),this.first=e},m(c,h){B(c,e,h),O(e,i),O(e,r)},p(c,h){t=c,h&1&&z(i,"background-image",`url(${t[1].icon.url})`);const u=h&1;u&&z(i,"width",s),u&&z(i,"height",o),h&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&z(e,"top",a),h&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&z(e,"left",l)},d(c){c&&V(e)}}}function Xb(n){let t,e=[],i=new Map,s=n[0];const o=r=>r[1].id;for(let r=0;r<s.length;r+=1){let a=Wd(n,s,r),l=o(a);i.set(l,e[r]=Hd(l,a))}return{c(){t=T("div");for(let r=0;r<e.length;r+=1)e[r].c();P(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){B(r,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(r,[a]){a&1&&(s=r[0],e=Jt(e,a,o,1,r,s,i,t,za,Hd,null,Wd))},i:$,o:$,d(r){r&&V(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Zb(n,t,e){let{extraObjects:i=[]}=t;return n.$$set=s=>{"extraObjects"in s&&e(0,i=s.extraObjects)},[i]}class Jb extends ue{constructor(t){super(),de(this,t,Zb,Xb,he,{extraObjects:0},Yb)}}function qb(n){ge(n,"svelte-18287ai",".missing-floor-wrapper.svelte-18287ai{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:flex;justify-content:center;align-items:center}.missing-floor-image.svelte-18287ai{max-width:100%;max-height:100%}")}function Kb(n){let t,e,i,s,o,r;const a=[{floorIndex:n[2],floorplanData:n[4]}];let l={};for(let h=0;h<a.length;h+=1)l=gt(l,a[h]);t=new cd({props:l}),i=new Jb({props:{extraObjects:n[7]}});let c=n[3]&&Ud(n);return{c(){re(t.$$.fragment),e=te(),re(i.$$.fragment),s=te(),c&&c.c(),o=Ee()},m(h,u){se(t,h,u),B(h,e,u),se(i,h,u),B(h,s,u),c&&c.m(h,u),B(h,o,u),r=!0},p(h,u){const f=u&20?Ct(a,[{floorIndex:h[2],floorplanData:h[4]}]):{};t.$set(f);const m={};u&128&&(m.extraObjects=h[7]),i.$set(m),h[3]?c?(c.p(h,u),u&8&&D(c,1)):(c=Ud(h),c.c(),D(c,1),c.m(o.parentNode,o)):c&&(fe(),_(c,1,1,()=>{c=null}),me())},i(h){r||(D(t.$$.fragment,h),D(i.$$.fragment,h),D(c),r=!0)},o(h){_(t.$$.fragment,h),_(i.$$.fragment,h),_(c),r=!1},d(h){oe(t,h),h&&V(e),oe(i,h),h&&V(s),c&&c.d(h),h&&V(o)}}}function $b(n){let t,e,i;return{c(){t=T("div"),e=T("img"),P(e,"class","missing-floor-image svelte-18287ai"),ft(e.src,i=n[6])||P(e,"src",i),P(e,"alt","缺省楼层"),P(t,"class","missing-floor-wrapper svelte-18287ai")},m(s,o){B(s,t,o),O(t,e)},p(s,o){o&64&&!ft(e.src,i=s[6])&&P(e,"src",i)},i:$,o:$,d(s){s&&V(t)}}}function Ud(n){let t,e;const i=[{five:n[0],pxmm:n[1],floorIndex:n[2],floorplanData:n[4],onRoomHeightClick:n[9],highlightData:n[5],hoveredRoom:void 0}];let s={};for(let o=0;o<i.length;o+=1)s=gt(s,i[o]);return t=new Dd({props:s}),{c(){re(t.$$.fragment)},m(o,r){se(t,o,r),e=!0},p(o,r){const a=r&567?Ct(i,[{five:o[0],pxmm:o[1],floorIndex:o[2],floorplanData:o[4],onRoomHeightClick:o[9],highlightData:o[5],hoveredRoom:void 0}]):{};t.$set(a)},i(o){e||(D(t.$$.fragment,o),e=!0)},o(o){_(t.$$.fragment,o),e=!1},d(o){oe(t,o)}}}function e1(n){let t,e,i,s;const o=[$b,Kb],r=[];function a(l,c){return l[8]?1:0}return t=a(n),e=r[t]=o[t](n),{c(){e.c(),i=Ee()},m(l,c){r[t].m(l,c),B(l,i,c),s=!0},p(l,[c]){let h=t;t=a(l),t===h?r[t].p(l,c):(fe(),_(r[h],1,1,()=>{r[h]=null}),me(),e=r[t],e?e.p(l,c):(e=r[t]=o[t](l),e.c()),D(e,1),e.m(i.parentNode,i))},i(l){s||(D(e),s=!0)},o(l){_(e),s=!1},d(l){r[t].d(l),l&&V(i)}}}function t1(n,t,e){let i,s,o,{five:r}=t,{pxmm:a}=t,{floorIndex:l}=t,{hoverEnable:c}=t,{floorplanData:h}=t,{extraObjects:u=[]}=t,{highlightData:f}=t,{missingFloorImageUrl:m}=t;const v=void 0;return n.$$set=p=>{"five"in p&&e(0,r=p.five),"pxmm"in p&&e(1,a=p.pxmm),"floorIndex"in p&&e(2,l=p.floorIndex),"hoverEnable"in p&&e(3,c=p.hoverEnable),"floorplanData"in p&&e(4,h=p.floorplanData),"extraObjects"in p&&e(10,u=p.extraObjects),"highlightData"in p&&e(5,f=p.highlightData),"missingFloorImageUrl"in p&&e(6,m=p.missingFloorImageUrl)},n.$$.update=()=>{n.$$.dirty&20&&e(11,i=h.floorDatas[l]),n.$$.dirty&2048&&e(8,s=i.rooms.length>0),n.$$.dirty&1028&&e(7,o=u==null?void 0:u.filter(p=>p.floorIndex===l))},[r,a,l,c,h,f,m,o,s,v,u,i]}class i1 extends ue{constructor(t){super(),de(this,t,t1,e1,he,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:10,highlightData:5,missingFloorImageUrl:6},qb)}}function n1(n){ge(n,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function Yd(n){let t,e,i,s,o=n[8]!==0&&Xd(n);return{c(){t=T("div"),o&&o.c(),P(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){B(r,t,a),o&&o.m(t,null),e=!0,i||(s=[Xt(Oi.call(null,t)),Ce(t,"clientWidth",n[14]),Ce(t,"clientHeight",n[15])],i=!0)},p(r,a){r[8]!==0?o?(o.p(r,a),a&256&&D(o,1)):(o=Xd(r),o.c(),D(o,1),o.m(t,null)):o&&(fe(),_(o,1,1,()=>{o=null}),me())},i(r){e||(D(o),e=!0)},o(r){_(o),e=!1},d(r){r&&V(t),o&&o.d(),i=!1,rt(s)}}}function Xd(n){let t,e,i,s,o=`${n[10]}px`,r=`${n[13]}px`,a;const l=[{five:n[0],pxmm:n[11],floorIndex:n[12],floorplanData:n[3],hoverEnable:n[2],extraObjects:n[5],highlightData:n[6],missingFloorImageUrl:n[7]}];let c={};for(let f=0;f<l.length;f+=1)c=gt(c,l[f]);e=new i1({props:c});const h=[{pxmm:n[11],five:n[0],floorplanData:n[3],cameraImageUrl:n[4]}];let u={};for(let f=0;f<h.length;f+=1)u=gt(u,h[f]);return s=new Ub({props:u}),{c(){t=T("div"),re(e.$$.fragment),i=te(),re(s.$$.fragment),P(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),z(t,"width",o),z(t,"height",r)},m(f,m){B(f,t,m),se(e,t,null),O(t,i),se(s,t,null),a=!0},p(f,m){const v=m&6381?Ct(l,[{five:f[0],pxmm:f[11],floorIndex:f[12],floorplanData:f[3],hoverEnable:f[2],extraObjects:f[5],highlightData:f[6],missingFloorImageUrl:f[7]}]):{};e.$set(v);const p=m&2073?Ct(h,[{pxmm:f[11],five:f[0],floorplanData:f[3],cameraImageUrl:f[4]}]):{};s.$set(p),m&1024&&o!==(o=`${f[10]}px`)&&z(t,"width",o),m&8192&&r!==(r=`${f[13]}px`)&&z(t,"height",r)},i(f){a||(D(e.$$.fragment,f),D(s.$$.fragment,f),a=!0)},o(f){_(e.$$.fragment,f),_(s.$$.fragment,f),a=!1},d(f){f&&V(t),oe(e),oe(s)}}}function s1(n){let t,e,i=n[1]&&Yd(n);return{c(){i&&i.c(),t=Ee()},m(s,o){i&&i.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[1]?i?(i.p(s,o),o&2&&D(i,1)):(i=Yd(s),i.c(),D(i,1),i.m(t.parentNode,t)):i&&(fe(),_(i,1,1,()=>{i=null}),me())},i(s){e||(D(i),e=!0)},o(s){_(i),e=!1},d(s){i&&i.d(s),s&&V(t)}}}function o1(n,t,e){var C,M;let{five:i}=t,{visible:s}=t,{hoverEnable:o}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,{missingFloorImageUrl:h}=t,u=0,f=(M=(C=i.work.observers[i.getCurrentState().panoIndex])==null?void 0:C.floorIndex)!=null?M:0,m=0,v=0,p=0,g=0;function A(E){e(12,f=i.work.observers[E].floorIndex)}Et(()=>(i.on("panoArrived",A),()=>{i.off("panoArrived",A)}));const w=E=>{e(8,m=E.detail)},I=E=>{e(9,v=E.detail)};return n.$$set=E=>{"five"in E&&e(0,i=E.five),"visible"in E&&e(1,s=E.visible),"hoverEnable"in E&&e(2,o=E.hoverEnable),"floorplanData"in E&&e(3,r=E.floorplanData),"cameraImageUrl"in E&&e(4,a=E.cameraImageUrl),"extraObjects"in E&&e(5,l=E.extraObjects),"highlightData"in E&&e(6,c=E.highlightData),"missingFloorImageUrl"in E&&e(7,h=E.missingFloorImageUrl)},n.$$.update=()=>{if(n.$$.dirty&1800){const E=Math.min(m,v),{max:S,min:L}=r.bounding,W=S.x-L.x,R=S.y-L.y,U=function(){return W>R?[E,E/W*R]:[E/R*W,E]}();e(10,p=U[0]),e(13,g=U[1]),e(11,u=p/W)}},[i,s,o,r,a,l,c,h,m,v,p,u,f,g,w,I]}class r1 extends ue{constructor(t){super(),de(this,t,o1,s1,he,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6,missingFloorImageUrl:7},n1)}}let a1=class extends wi{constructor(e,i){super(e);d(this,"name","panoFloorplanRadarPlugin");d(this,"state");d(this,"data");d(this,"app");d(this,"wrapperSelector","");d(this,"wrapper",null);d(this,"disposed",!1);d(this,"extraObjects",[]);d(this,"highlightData",{});d(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});d(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});d(this,"unhighlight",()=>{this.highlightData={},this.render()});d(this,"_disable",e=>{var s;const{userAction:i}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:i})});this.five=e;const s={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:Bi,missingFloorImageUrl:this.staticPrefix+"/release/web/saas/missing-floor.d687a5ed.png"},o=x(x({},s),i==null?void 0:i.configs);this.state={enabled:!0,visible:!0,config:o},i!=null&&i.wrapper&&console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"),typeof(i==null?void 0:i.wrapper)=="string"?this.wrapperSelector=i.wrapper:(i==null?void 0:i.wrapper)instanceof Element&&(this.wrapper=i.wrapper),e.once("dispose",this.dispose)}load(e,i,s=!0){return H(this,null,function*(){function o(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=o(r)?r.data:r,l=this.data;this.data=yield _i(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),i&&this.updateState(i,s),this.render()})}show(){return H(this,arguments,function*(e={}){if(this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},i),this._show({userAction:i})})}hide(){return H(this,arguments,function*(e={}){if(!this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},i),this._hide({userAction:i})})}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper!==e&&this.app&&(this.app.$destroy(),this.app=void 0),this.wrapper=e,this.render()}changeConfigs(e,i=!0){this.setState({config:e},{userAction:i}),this.render()}setExtraObjectsWith3DPositions(e){this.data&&(this.extraObjects=Eb(e,this.five,this.data),this.render())}formatData(e){return H(this,null,function*(){return yield _i(e.data)})}_enable(e){const{userAction:i}=e;this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:i}=e;this.hooks.emit("show",{userAction:i}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:i}=e;this.hooks.emit("hide",{userAction:i}),this.render()}updateState(e,i){const s=this.state,o=e.config?x(x({},s.config),e.config):s.config;this.state=ie(x(x({},this.state),e),{config:o}),!wt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const i=document.querySelector(this.wrapperSelector);this.wrapper=i}if(!this.data||!this.wrapper)return;const e=ie(x({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(e):this.app=new r1({target:this.wrapper,props:e})}};const l1=(n,t)=>new a1(n,t),c1=[{type:0,floorType:1,roomType:"100900000012",name:"其他"},{type:1,floorType:1,roomType:"100900000002",name:"客厅"},{type:2,floorType:1,roomType:"100900000002",name:"餐厅"},{type:3,floorType:0,roomType:"100900000001",name:"卧室"},{type:4,floorType:0,roomType:"100900000001",name:"书房"},{type:5,floorType:3,roomType:"100900000004",name:"卫生间"},{type:6,floorType:3,roomType:"100900000004",name:"淋浴间"},{type:7,floorType:3,roomType:"100900000004",name:"洗手间"},{type:8,floorType:3,roomType:"100900000003",name:"厨房"},{type:9,floorType:1,roomType:"100900000003",name:"开放厨房",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"多功能间"},{type:11,floorType:0,roomType:"100900000009",name:"保姆间"},{type:12,floorType:4,roomType:"100900000005",name:"阳台"},{type:13,floorType:4,roomType:"100900000006",name:"露台"},{type:14,floorType:0,roomType:"100900000008",name:"储物间"},{type:15,floorType:0,roomType:"100900000013",name:"衣帽间"},{type:16,floorType:0,roomType:"100900000011",name:"阁楼"},{type:17,floorType:2,roomType:"100900000007",name:"花园"},{type:18,floorType:5,roomType:"100900000010",name:"车库"},{type:19,floorType:1,roomType:"100900000012",name:"电梯"},{type:20,floorType:1,roomType:"100900000012",name:"地下室"},{type:21,floorType:1,roomType:"100900000012",name:"天井"},{type:22,floorType:1,roomType:"100900000012",name:"阳光房"},{type:23,floorType:1,roomType:"100900000012",name:"过道"},{type:24,floorType:1,roomType:"100900000012",name:"楼梯间"},{type:25,floorType:1,roomType:"100900000012",name:"门厅"},{type:26,floorType:2,roomType:"100900000012",name:"入户花园"},{type:27,floorType:1,roomType:"100900000012",name:"玄关"},{type:28,floorType:1,roomType:"100900000012",name:"挑空"},{type:29,floorType:4,roomType:"100900000012",name:"晾晒区"},{type:30,floorType:4,roomType:"100900000012",name:"洗衣房"},{type:31,floorType:0,roomType:"100900000012",name:"娱乐区"},{type:32,floorType:0,roomType:"100900000012",name:"健身区"},{type:33,floorType:0,roomType:"100900000012",name:"接待区"},{type:34,floorType:0,roomType:"100900000012",name:"影音区"},{type:35,floorType:1,roomType:"100900000012",name:"餐饮区"},{type:36,floorType:1,roomType:"100900000012",name:"其他",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"起居室"},{type:38,floorType:0,roomType:"100900000001",name:"主卧"},{type:39,floorType:0,roomType:"100900000001",name:"次卧"},{type:40,floorType:0,roomType:"100900000001",name:"优化间"},{type:41,floorType:0,roomType:"100900000001",name:"办公室"},{type:42,floorType:0,roomType:"100900000001",name:"会议室"},{type:43,floorType:0,roomType:"100900000001",name:"洽谈间"},{type:44,floorType:1,roomType:"100900000002",name:"共享大厅"},{type:45,floorType:1,roomType:"100900000012",name:"水吧"},{type:46,floorType:0,roomType:"100900000015",name:"出入口"},{type:47,floorType:0,roomType:"100900000015",name:"大厅"},{type:48,floorType:0,roomType:"100900000015",name:"包厢"},{type:49,floorType:0,roomType:"100900000015",name:"其他"},{type:50,floorType:0,roomType:"100900000016",name:"出入口"},{type:51,floorType:0,roomType:"100900000016",name:"办公区"},{type:52,floorType:0,roomType:"100900000016",name:"老板间"},{type:53,floorType:0,roomType:"100900000016",name:"会议室"},{type:54,floorType:0,roomType:"100900000016",name:"休息区/水吧"},{type:55,floorType:0,roomType:"100900000016",name:"其他"},{type:56,floorType:2,roomType:"100900000012",name:"空中花园"},{type:57,floorType:0,roomType:"100900000001",name:"洋室"},{type:58,floorType:0,roomType:"100900000001",name:"和室"}],h1=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],d1=[{roomType:"100900000001",description:"室"},{roomType:"100900000002",description:"厅"},{roomType:"100900000003",description:"厨"},{roomType:"100900000004",description:"卫"},{roomType:"100900000005",description:"阳台"},{roomType:"100900000006",description:"露台"},{roomType:"100900000007",description:"花园"},{roomType:"100900000008",description:"储"},{roomType:"100900000009",description:"保姆间"},{roomType:"100900000010",description:"车库"},{roomType:"100900000011",description:"阁楼"},{roomType:"100900000012",description:"其他"},{roomType:"100900000013",description:"衣"},{roomType:"100900000015",description:"商铺"},{roomType:"100900000016",description:"写字楼"}],Ga=(n,t,e)=>{const i=new b.Matrix4,s=new b.Euler(n,t,e,"YXZ");return i.makeRotationFromEuler(s),i},u1=(n,{scale:t,rotation:e,position:i})=>{if(t&&n.scale.set(t,t,t),e){const[s,o,r]=e;s&&n.applyMatrix4(Ga(s,0,0)),o&&n.applyMatrix4(Ga(0,o,0)),r&&n.applyMatrix4(Ga(0,0,r))}return i&&n.position.set(i.x,i.y,i.z),n};function Zd(n,t){n.traverse(e=>{var i;if(e.type==="Mesh"){const s=e,o=x({map:s.material.map||{}},t);s.material=new Q.MeshBasicMaterial(o),s.renderOrder=1,((i=e.parent)==null?void 0:i.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const f1=(n,t)=>{var p;const e=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",i=(p=t.north_rad)!=null?p:void 0,s={};let o={x:0,y:0,z:0},r=[0,0,0],a=1,l=i;n.on("modelLoaded",v);const c=g=>H(this,null,function*(){var C;const A=(g==null?void 0:g.fbx_url)||e;if(l=(C=g==null?void 0:g.north_rad)!=null?C:i,typeof l!="number")throw new Error('"northRad"配置参数缺失:未配置指南针指向!');const I=yield new In.FBXLoader().loadAsync(A);return Zd(I,{transparent:!0,side:b.DoubleSide,blending:b.AdditiveBlending}),s.object=I,v(),!0}),h=({latitude:g})=>{if(!s.object)return;const A=u(g);A&&(s.object.position.y=A)},u=g=>{if(s.yBase===void 0)return;const A=.6;if(g>=Math.PI/4)return s.yBase-(A+1.6);const w=g*(4/Math.PI);return s.yBase-(A*w+1.6)},f=()=>{if(!s.object)return;const g=u(n.getPose().latitude);g&&(s.object.position.y=g),n.scene.add(s.object),n.needsRender=!0,n.on("cameraDirectionUpdate",h)},m=()=>{s.object&&(n.scene.remove(s.object),n.needsRender=!0,n.off("cameraDirectionUpdate",h))};function v(){const g=s.object;if(!g)return;const A=n.model.bounding,w=A.max.x-A.min.x,I=A.max.z-A.min.z,C=Math.max(w,I),{max:{x:M,z:E},min:{x:S,y:L,z:W}}=A;s.yBase=L,o={x:(M+S)/2,y:L-1.6,z:(E+W)/2},r=[0,l-Math.PI/2,0],a=.0045*C,u1(g,{position:o,rotation:r,scale:a})}return{load:c,disable:m,enable:f}};function m1(n,t){var c,h,u,f,m;const e=(c=t==null?void 0:t.size)!=null?c:512,i=(h=t==null?void 0:t.fontSize)!=null?h:e*(35/256)*1.2,s=(u=t==null?void 0:t.backgroundColor)!=null?u:"rgba(0,0,0,0)",o=(f=t==null?void 0:t.fontColor)!=null?f:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=s,l.fillRect(0,0,e,e),l.font=`${i}px "微软雅黑"`,l.textAlign=r,l.fillStyle=o,l.fillText(n,e/2,e*.7),new Q.CanvasTexture(a)}const g1=({x:n,y:t,z:e})=>new Q.Vector3(n,t,e),p1=(n,t)=>{var p,g,A;const e={},i=(p=t.animationEnabled)!=null?p:!0,s=(g=t.position)!=null?g:void 0,o=(A=t.rad)!=null?A:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=w=>H(this,null,function*(){var R,U,j,Y,N,G,X,J;const I=(R=w==null?void 0:w.position)!=null?R:s;if(!I)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const C=g1(I),M=(U=w==null?void 0:w.rad)!=null?U:o,E=(j=w==null?void 0:w.fbx_url)!=null?j:r;if(e.rad=M,M===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${M}`));const S=yield new In.FBXLoader().loadAsync(E);S.position.copy(C),S.rotation.z=M,S.scale.set(.8,.8,.8),Zd(S,{transparent:!0,side:b.DoubleSide});const L=(X=(G=(N=(Y=S.children)==null?void 0:Y[0])==null?void 0:N.children)==null?void 0:G[3])==null?void 0:X.clone();if(!L)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${L}`));const W=(J=t.name)!=null?J:"入户门";return L.material=new Q.MeshBasicMaterial({transparent:!0,map:m1(W)}),L.renderOrder=3,S.children[0].add(L),e.object=S,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const w=1,I=new Q.AnimationMixer(e.object);a.push(I);const C=I.clipAction(e.object.animations[0]);C.timeScale=w;let M;const E=()=>{let R=0,U=0;const j=1e3/30,Y=N=>{R=requestAnimationFrame(Y);const G=N-U;G<j||(U=N,a.forEach(X=>X.update(G/1e3)),n.needsRender=!0)};return R=requestAnimationFrame(Y),()=>{cancelAnimationFrame(R)}},W={play:()=>{M||(C.play(),M=E(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{C.stop(),M==null||M(),M=void 0}};e.animation=W},h=w=>{var C;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((C=w==null?void 0:w.animationEnable)!=null?C:i)&&(e.animation||c(),e.animation.play()),n.scene.add(e.object),n.needsRender=!0},u=()=>{e.object&&(e.animation&&e.animation.stop(),n.scene.remove(e.object),n.needsRender=!0)},f=w=>w==="Floorplan"?h():u();return{load:l,enable:w=>(e.enabled||(e.enabled=!0,f(n.currentMode),n.on("modeChange",f),h(w)),!0),disable:()=>(e.enabled&&(e.enabled=!1,u(),n.off("modeChange",f)),!0)}},v1=ti;function A1(n,t,e,i=v1.Linear.None){const s=new wo(n).to(t,e).easing(i);Ts(()=>s.start(0));const o=Ln(a=>{s.update(a)===!1&&o()}),r=[];return s.onDestroy=a=>(r.push(a),s),s.destroy=function(){this.stop(),Object.assign(s,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();o()},s}function b1(n,t){return A1({progress:0},{progress:1},n,t)}var Jd=(n=>(n.Move="Move",n.Rotate="Rotate",n))(Jd||{}),ai=(n=>(n.Clockwise="Clockwise",n.Anticlockwise="Anticlockwise",n.Loop="Loop",n))(ai||{});const Ko=Math.PI*2;function qd(n){return(n%Ko+Ko)%Ko}function Kd(n){return n%Ko}function Qa(n,t,e){return n+(t-n)*e}const Wa=(n,t,e)=>{const i=Math.PI,s=i*2;let o=qd(n),r=qd(t);return e===ai.Anticlockwise&&o<r&&(o+=s),e===ai.Clockwise&&r<o&&(r+=s),e===ai.Loop&&r-o>i?Wa(o,r,ai.Anticlockwise):e===ai.Loop&&o-r>i?Wa(o,r,ai.Clockwise):{from:o,to:r}},y1=n=>{const t={},e=(l,c,...h)=>H(this,[l,c,...h],function*(o,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),o.mode&&o.mode!==n.currentMode&&(yield n.changeMode(o.mode)),a.preload&&o.panoIndex!==void 0&&o.panoIndex!==n.panoIndex&&(yield n.preloadPano(o.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),o.panoIndex===void 0&&o.fov===void 0&&o.latitude===void 0&&o.longitude===void 0?!0:yield new Promise((u,f)=>{const m=o.panoIndex!==void 0?o.panoIndex:n.panoIndex;m!==void 0?n.moveToPano(m,x({duration:r,moveEndCallback:()=>u(!0),moveCancelCallback:()=>f(new Error("move canceled"))},o)):f(new Error("unexpected error"))})}),i=o=>{const r=n.state,a=Kd(r.latitude),l=Kd(o.latitude),{from:c,to:h}=Wa(r.longitude,o.longitude,o.rotation||ai.Loop),u=r.fov,f=o.fov;return{from:{latitude:a,longitude:c,fov:u},to:{latitude:l,longitude:h,fov:f}}};return{move:e,rotate:(l,c,...h)=>H(this,[l,c,...h],function*(o,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),n.currentMode!==Xe.Five.Mode.Panorama&&(yield n.changeMode(Xe.Five.Mode.Panorama)),o.panoIndex!==void 0&&o.panoIndex!==n.panoIndex&&(a.preload&&(yield n.preloadPano(o.panoIndex)),yield new Promise((m,v)=>{if(!o.panoIndex){m(!0);return}n.moveToPano(o.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>v(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:u,to:f}=i(o);return yield new Promise(m=>{const v=({progress:I})=>{const C={};C.longitude=Qa(u.longitude,f.longitude,I),C.latitude=Qa(u.latitude,f.latitude,I),C.fov=Qa(u.fov,f.fov,I),n.setState(C,!0)},p=()=>{m(!0)},g=()=>{m(!1)},A=o.rotateSpeed?Math.ceil(Math.abs(f.longitude-u.longitude)/o.rotateSpeed*1e3):r,w=b1(A,ti.Linear.None).onUpdate(v).onComplete(p).onDestroy(g);o.rotation===ai.Loop&&w.repeat(1/0).yoyo(!0),t.interruptCallback=(I=!0)=>{w.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(I)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function $d(n,t){return n.x===t.x&&n.y===t.y}function eu(n,t){return Math.abs(n)===1/0&&Math.abs(t)===1/0?!0:Math.abs(n-t)<.001}function $o(n,t){return(t.y-n.y)/(t.x-n.x)}function tu(n,t,e){const i=$o(n[1],n[0]),s=$o(t[1],t[0]);if(isNaN(i)||isNaN(s)||eu(i,s))return!1;if(er(n[0],t))return n[0];if(er(n[1],t))return n[1];if(er(t[0],n))return t[0];if(er(t[1],n))return t[1];if(e&&!C1(n,t))return!1;const o=n[0],r=t[0];if(Math.abs(i)===1/0)return{x:o.x,y:t[1].y-(t[1].x-o.x)*s};if(Math.abs(s)===1/0)return{x:r.x,y:n[1].y-(n[1].x-r.x)*i};const a=(r.y-o.y+i*o.x-s*r.x)/(i-s),l=i*a-i*o.x+o.y;return{x:a,y:l}}function er(n,t){return $d(n,t[0])||$d(n,t[1])?!0:(t[0].x-n.x)*(n.x-t[1].x)>=0&&(t[0].y-n.y)*(n.y-t[1].y)>=0&&eu($o(t[0],n),$o(n,t[1]))}function w1(n){let t=1/0,e=-1/0,i=1/0,s=-1/0;return n.forEach(o=>{t=Math.min(t,o.x),e=Math.max(e,o.x),i=Math.min(i,o.y),s=Math.max(s,o.y)}),{x:(t+e)/2,y:(i+s)/2}}function tr(n,t,e){return(n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y)}function C1(n,t){return Math.max(n[0].x,n[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(n[0].x,n[1].x)&&Math.max(n[0].y,n[1].y)>=Math.min(t[0].y,t[1].y)&&tr(t[0],n[1],n[0])*tr(n[1],t[1],n[0])>0&&tr(n[0],t[1],t[0])*tr(t[1],n[1],t[0])>0?1:0}function iu(n,t=0){t<=0?requestAnimationFrame(n):requestAnimationFrame(()=>iu(n,t-1))}const P1=`<style type="text/css">
453
453
  .PanoRulerPlugin-rule-line {
454
454
  position: absolute;
455
455
  transform-origin: left center;
@@ -806,7 +806,7 @@ void main() {
806
806
  width: 100%;
807
807
  height: 100%;
808
808
  z-index: 5;
809
- `,e.container.style.pointerEvents="none";const i=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),s=g=>{e.itemLabels=aC(g),l()},o=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{h(),e.container.remove()},l=()=>{var g;if(e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:n,itemLabels:e.itemLabels}):e.app=new rC({target:e.container,props:{five:n,modelOcclusionEnable:e.modelOcclusionEnable,itemLabels:e.itemLabels,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{n.on("modeChange",u),n.once("dispose",a)},h=()=>{n.off("modeChange",u)},u=g=>{if(g!==Xe.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}n.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,o()})};return c(),{appendTo:i,load:s,enable:o,disable:r,dispose:a,hooks:e.hooks}},hC={name:"ItemLabelPlugin",version:0};function dC(n){ge(n,"svelte-1irjijd",'.plugin-DoorLabelPlugin-item.svelte-1irjijd.svelte-1irjijd{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-1irjijd.svelte-1irjijd{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-1irjijd.svelte-1irjijd::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAD///+l2Z/dAAAAAnRSTlMAIE397fAAAAAVSURBVAjXY2BjgCMQ+PABhIAASRwARxwD8fgzCQAAAAAASUVORK5CYII=") 4;border-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAD///+l2Z/dAAAAAnRSTlMAIE397fAAAAAVSURBVAjXY2BjgCMQ+PABhIAASRwARxwD8fgzCQAAAAAASUVORK5CYII=") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-1irjijd.svelte-1irjijd:active,.plugin-DoorLabelPlugin-cnt.svelte-1irjijd.svelte-1irjijd:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-1irjijd.svelte-1irjijd{background:url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTBweCIgaGVpZ2h0PSIxMHB4IiB2aWV3Qm94PSIwIDAgMTAgMTAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+aW1hZ2Ut566t5aS0PC90aXRsZT4KICAgIDxkZWZzPgogICAgICAgIDxyZWN0IGlkPSJwYXRoLTEiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCI+PC9yZWN0PgogICAgICAgIDxsaW5lYXJHcmFkaWVudCB4MT0iNjYuMDYyMTk3NSUiIHkxPSI1MCUiIHgyPSItMS4xMzY4NjgzOGUtMTElIiB5Mj0iNTAlIiBpZD0ibGluZWFyR3JhZGllbnQtMyI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCUiPjwvc3RvcD4KICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI0ZGRkZGRiIgc3RvcC1vcGFjaXR5PSIwLjg1IiBvZmZzZXQ9IjEwMCUiPjwvc3RvcD4KICAgICAgICA8L2xpbmVhckdyYWRpZW50PgogICAgICAgIDxsaW5lYXJHcmFkaWVudCB4MT0iODQuMzM5NzMxJSIgeTE9IjUwJSIgeDI9IjIzLjQyODMzNzclIiB5Mj0iNTAlIiBpZD0ibGluZWFyR3JhZGllbnQtNCI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIHN0b3Atb3BhY2l0eT0iMCIgb2Zmc2V0PSIwJSI+PC9zdG9wPgogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjRkZGRkZGIiBzdG9wLW9wYWNpdHk9IjAuOCIgb2Zmc2V0PSIxMDAlIj48L3N0b3A+CiAgICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxnIGlkPSLpobXpnaItMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IlZSLeWIhumXtOW8leWvvOagh+etvuWkh+S7vS0zIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzM5LjAwMDAwMCwgLTU0My4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9Iue8lue7hC0y5aSH5Lu9LTEyIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzMDUuMDAwMDAwLCA1MzYuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0iaW1hZ2Ut566t5aS0IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzNC4wMDAwMDAsIDcuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICAgICAgPG1hc2sgaWQ9Im1hc2stMiIgZmlsbD0id2hpdGUiPgogICAgICAgICAgICAgICAgICAgICAgICA8dXNlIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDwvbWFzaz4KICAgICAgICAgICAgICAgICAgICA8dXNlIGlkPSJCRyIgZmlsbC1vcGFjaXR5PSIwIiBmaWxsPSIjRDhEOEQ4IiBvcGFjaXR5PSIwLjUxMTQ2Mjk4NCIgeGxpbms6aHJlZj0iI3BhdGgtMSI+PC91c2U+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuOTM4ODY5OCwxLjE0Mzc2MTI5IEM4LjI1NDY1NDA0LDEuMjU3NTgwMzUgOC4zMTc4Mjg0LDEuMzAyMTY5OTggOC4zMTc3ODUyMSwxLjM1ODE1MjIzIEM4LjMxNzc1MDcyLDEuNDAyODQzMzUgOC4zMDU3NDkwNywxLjQ0NzUyNTI0IDguMjgxNzg0MTEsMS40ODcyMDUyMSBMOC4yODE3ODQxMSwxLjQ4NzIwNTIxIEw2LjIwOTg5MDQxLDQuOTE3NzQyNDUgQzYuMTM3ODg4MDgsNS4wMzY5NjAyOSA2LjEwMTg4NjkxLDUuMTcxMjIwMiA2LjEwMTg4NjkxLDUuMzA1NDgwMTEgQzYuMTAxODg2OTEsNS40Mzk3NDAwMiA2LjEzNzg4ODA4LDUuNTczOTk5OTQgNi4yMDk4OTA0MSw1LjY5MzIxNzc4IEw2LjIwOTg5MDQxLDUuNjkzMjE3NzggTDguMjgxNzg0MTEsOS4xMjM3NTUwMSBDOC4zMTc0NzQzOCw5LjE4Mjg0OTE2IDguMzI1ODMzMjIsOS4yNTA4MTUyIDguMzEwNDk1OTUsOS4zMTI5MzAyOCBDOC4yOTUxNTg2OCw5LjM3NTA0NTM2IDguMjU2MTI1MzEsOS40MzEzMDk0NyA4LjE5NzAzMTE3LDkuNDY2OTk5NzMgQzguMTU3MzUxMTksOS40OTA5NjQ2OSA4LjExMjY2OTMxLDkuNTAyOTY2MzQgOC4wNjc5NzgxOCw5LjUwMzAwMDgzIEM4LjAyMzI4NzA2LDkuNTAzMDM1MzEgNy45Nzg1ODY3MSw5LjQ5MTEwMjYzIDcuOTM4ODY5OCw5LjQ2NzE5ODkzIEw3LjkzODg2OTgsOS40NjcxOTg5MyBMMS4zNzk5MTIxOCw1LjUxOTY3ODE1IEMxLjMyMDc2MzAyLDUuNDg0MDc5MTIgMS4yODE2NDI4Nyw1LjQyNzg3NTMyIDEuMjY2MjA5NzcsNS4zNjU3ODM5OCBDMS4yNTQ2OTI1Niw1LjMxOTQ0NzMyIDEuMjU2MzY2OTgsNS4yNjk4MzE4MiAxLjI3Mjc1MzMzLDUuMjIzMDU0MDUgTDEuMjcyNzUzMzMsNS4yMjMwNTQwNSBaIiBpZD0i566t5aS0IiBzdHJva2U9InVybCgjbGluZWFyR3JhZGllbnQtNCkiIHN0cm9rZS13aWR0aD0iMC41IiBmaWxsPSJ1cmwoI2xpbmVhckdyYWRpZW50LTMpIiBtYXNrPSJ1cmwoI21hc2stMikiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUuMDM5MjAwLCA1LjMwNTQ4MCkgc2NhbGUoMSwgLTEpIHJvdGF0ZSgtOTAuMDAwMDAwKSB0cmFuc2xhdGUoLTUuMDM5MjAwLCAtNS4zMDU0ODApICI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-1irjijd .plugin-DoorLabelPlugin-txt.svelte-1irjijd{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-1irjijd .plugin-DoorLabelPlugin-txt.svelte-1irjijd{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-1irjijd .plugin-DoorLabelPlugin-txt.svelte-1irjijd{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-1irjijd .plugin-DoorLabelPlugin-txt.svelte-1irjijd{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-1irjijd.svelte-1irjijd{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{background:url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTBweCIgaGVpZ2h0PSI4cHgiIHZpZXdCb3g9IjAgMCAxMCA4IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPHRpdGxlPueureWktDwvdGl0bGU+CiAgICA8ZGVmcz4KICAgICAgICA8bGluZWFyR3JhZGllbnQgeDE9IjEwLjYzODU4ODQlIiB5MT0iMCUiIHgyPSI5Ni41MTYxNDc0JSIgeTI9IjEyOS43MzEzNTQlIiBpZD0ibGluZWFyR3JhZGllbnQtMSI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNGRkYyQ0MiIG9mZnNldD0iMCUiPjwvc3RvcD4KICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI0VBRDA5QSIgb2Zmc2V0PSI0OC43MTQ0NDc4JSI+PC9zdG9wPgogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjRDFCMTdFIiBvZmZzZXQ9IjEwMCUiPjwvc3RvcD4KICAgICAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0i5pyq5p2l5a625aSH5Lu9LTI1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzA1LjAwMDAwMCwgLTU0NS4wMDAwMDApIiBmaWxsPSJ1cmwoI2xpbmVhckdyYWRpZW50LTEpIiBmaWxsLXJ1bGU9Im5vbnplcm8iPgogICAgICAgICAgICA8ZyBpZD0i57yW57uELTLlpIfku70tMTMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0NS4wMDAwMDAsIDUzNy4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxnIGlkPSJpbWFnZS3nrq3lpLQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDYwLjAwMDAwMCwgNy4wMDAwMDApIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNOC40OTU3ODI5NCwxLjYxNjQ1MTEgTDYuNDIzODg5MjUsNS4wNDY5ODgzMyBDNi4zMjc4ODYxMyw1LjIwNTk0NTQ1IDYuMzI3ODg2MTMsNS40MDUwMTQ3NyA2LjQyMzg4OTI1LDUuNTYzOTcxODkgTDguNDk1NzgyOTQsOC45OTQ1MDkxMiBDOC42Mzg1NDQwMSw5LjIzMDg4NTcxIDguNTYyNjUzNjQsOS41MzgyMzc1IDguMzI2Mjc3MDYsOS42ODA5OTg1NiBDOC4xNjc1NTcxNiw5Ljc3Njg1ODQgNy45Njg4MjE5NSw5Ljc3NzAxMTc1IDcuODA5OTU0MzEsOS42ODEzOTY5NyBMMS4yNTA5OTY2OSw1LjczMzg3NjE4IEMxLjAxNDQwMDA4LDUuNTkxNDgwMDcgMC45MzgwMzU0ODEsNS4yODQyNDU3NiAxLjA4MDQzMTU5LDUuMDQ3NjQ5MTQgQzEuMTIyNTE0OCw0Ljk3NzcyNjI4IDEuMTgxMDczODMsNC45MTkxNjcyNSAxLjI1MDk5NjY5LDQuODc3MDg0MDQgTDcuODA5OTU0MzEsMC45Mjk1NjMyNTMgQzguMDQ2NTUwOTMsMC43ODcxNjcxNDIgOC4zNTM3ODUyNCwwLjg2MzUzMTczOSA4LjQ5NjE4MTM1LDEuMTAwMTI4MzUgQzguNTkxNzk2MTMsMS4yNTg5OTYgOC41OTE2NDI3OCwxLjQ1NzczMTIgOC40OTU3ODI5NCwxLjYxNjQ1MTEgWiIgaWQ9IueureWktCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNS4wMzkyMDAsIDUuMzA1NDgwKSBzY2FsZSgxLCAtMSkgcm90YXRlKC05MC4wMDAwMDApIHRyYW5zbGF0ZSgtNS4wMzkyMDAsIC01LjMwNTQ4MCkgIj48L3BhdGg+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-1irjijd.svelte-1irjijd:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-1irjijd.svelte-1irjijd:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function uC(n){let t,e,i,s=n[0].name+"",o,r,a,l,c,h,u,f,m;return{c(){t=T("div"),e=T("div"),i=T("span"),o=Se(s),r=te(),a=T("i"),P(i,"class","plugin-DoorLabelPlugin-txt svelte-1irjijd"),P(a,"class","plugin-DoorLabelPlugin-icon svelte-1irjijd"),P(e,"class",l=it(Lt("plugin-DoorLabelPlugin-cnt",n[0].toward))+" svelte-1irjijd"),P(e,"style",c=`transform: ${n[0].transform||"initial"};pointer-events: ${n[0].inSight?"auto":"none"};opacity: ${n[0].inSight?1:0}`),P(e,"data-camera-toward",h=n[0].cameraToward),P(t,"style",u=`left: ${n[0].left||0}%;top: ${n[0].top||0}%;opacity: ${n[0].inSight?1:0}`),P(t,"class","plugin-DoorLabelPlugin-item svelte-1irjijd")},m(v,p){B(v,t,p),O(t,e),O(e,i),O(i,o),O(e,r),O(e,a),n[4](t),f||(m=Ce(e,"click",n[3]),f=!0)},p(v,[p]){p&1&&s!==(s=v[0].name+"")&&Te(o,s),p&1&&l!==(l=it(Lt("plugin-DoorLabelPlugin-cnt",v[0].toward))+" svelte-1irjijd")&&P(e,"class",l),p&1&&c!==(c=`transform: ${v[0].transform||"initial"};pointer-events: ${v[0].inSight?"auto":"none"};opacity: ${v[0].inSight?1:0}`)&&P(e,"style",c),p&1&&h!==(h=v[0].cameraToward)&&P(e,"data-camera-toward",h),p&1&&u!==(u=`left: ${v[0].left||0}%;top: ${v[0].top||0}%;opacity: ${v[0].inSight?1:0}`)&&P(t,"style",u)},i:$,o:$,d(v){v&&V(t),n[4](null),f=!1,m()}}}function fC(n,t,e){let{props:i}=t,{onClick:s}=t,o;const r=()=>{const{left:c,top:h,inSight:u,panoIndex:f}=i;if(!c||!h||!u||!o)return;const m=o.current.clientWidth/window.innerWidth*100,v=o.current.clientHeight/window.innerHeight*100;c<=m/2||c>=100-m/2||h<=v/2||h>=100-v/2},a=c=>{s&&s()};function l(c){Qe[c?"unshift":"push"](()=>{o=c,e(2,o)})}return n.$$set=c=>{"props"in c&&e(0,i=c.props),"onClick"in c&&e(1,s=c.onClick)},r(),[i,s,o,a,l]}class mC extends ue{constructor(t){super(),de(this,t,fC,uC,he,{props:0,onClick:1},dC)}}function gC(n,t){const e=Math.abs(n.top+n.height/2-t.top-t.height/2),i=Math.abs(n.left+n.width/2-t.left-t.width/2),s=(n.height+t.height)/2,o=(n.width+t.width)/2;return!(e>s&&i>o)}function pC(n){const{camera:t}=n,e=t.getWorldDirection(new Q.Vector3);let i=Math.atan(e.z/e.x)*180/Math.PI,s="";return e.x<0&&(i+=180),i<0&&(i+=360),i>315||i<=45?s="right":i>45&&i<=135?s="back":i>135&&i<=225?s="left":i>225&&i<=315&&(s="forward"),s}function vC(n,t){return Math.sqrt(Math.pow(n.z-t.z,2)+Math.pow(n.x-t.x,2))}function AC(n){const t=Math.PI/4;return n>-t&&n<=t?"left":n>t*3||n<=-t*3?"right":n>-t*3&&n<=-t?"forward":n>t&&n<=t*3?"back":""}const bC={userAction:!0};class yC extends Ri{constructor(e){super(e);d(this,"state",{enabled:!0,visible:!0});d(this,"container");d(this,"MinVisibledistance",1.8);d(this,"MaxVisibledistance",5);d(this,"OffsetHeight",-1.3);d(this,"rooms");d(this,"floorplanServerData");d(this,"visibleLabelMap",new Map);d(this,"labelItems",[]);d(this,"doorLabels");d(this,"roomObservers");d(this,"loadData",(e,i)=>{i&&(this.MaxVisibledistance=i.MaxVisibledistance,this.MinVisibledistance=i.MinVisibledistance,this.OffsetHeight=i.OffsetHeight),this.labelItems=[],this.doorLabels=[],this.floorplanServerData=e,ni(this.five).then(()=>{this.initData(),this.fixDoorVisibleAndPosition(),this.applyState()})});d(this,"dispose",()=>{var e,i,s,o,r,a,l;(e=this.five)==null||e.off("wantsToMoveToPano",this.hideAllLabels),(i=this.five)==null||i.off("modelLoaded",this.fixDoorVisibleAndPosition),(s=this.five)==null||s.off("panoArrived",this.fixDoorVisibleAndPosition),(o=this.five)==null||o.off("initAnimationEnded",this.fixDoorPosition),(r=this.five)==null||r.off("cameraUpdate",this.fixDoorPosition),(a=this.five)==null||a.off("mouseWheel",this.fixDoorPosition),(l=this.five)==null||l.off("pinchGesture",this.fixDoorPosition),this.applyState({enabled:!1})});d(this,"initRoomObservers",()=>{var o,r;const e=this.floorplanServerData.computed_data.floor_datas||[],s=(((r=(o=this.five)==null?void 0:o.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,h=e==null?void 0:e.find(u=>u.floor_index===c);if(h){const u=h.rooms.find(f=>f.observer_indexs.includes(l));if(u)return{panoIndex:l,floorIndex:c,name:u.name}}}).filter(Boolean);this.roomObservers=s});d(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1})});d(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.state.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const i=this.roomObservers.find(a=>a.panoIndex===e),o=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===i.name)return;const h=l.position.clone(),u=h.distanceTo(o);if(u<this.MinVisibledistance||u>this.MaxVisibledistance)return;const f=new Q.Raycaster,m=h.clone().sub(o).normalize();f.set(o,m);const[v]=this.five.model.intersectRaycaster(f);v&&v.distance+.1<u||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});d(this,"fixDoorPosition",()=>{var c,h,u,f,m,v,p,g,A,w,I,C;if(!this.state.enabled||!this.state.visible)return;const{panoIndex:e,camera:i}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const s=this.five.getElement(),o=s.clientWidth,r=s.clientHeight,a=i.getWorldDirection(new Q.Vector3),l=[];if(this.labelItems.forEach((M,E)=>{var R;if(M.visible){const U=i.position.distanceTo(M.position),j=M.position.clone().add(new Q.Vector3(0,this.OffsetHeight,0)),N=j.clone().sub(i.position).normalize().angleTo(a),G=j.clone().project(i),X=(G.x+1)/2.2*100,J=(-G.y+1)/2.2*100,q=X>=0&&X<=100&&J>=0&&J<=100&&U>this.MinVisibledistance&&U<=this.MaxVisibledistance;M.left=X,M.top=J,M.inSight=q&&N<Math.PI/2,M.cameraToward=pC(this.five),q?l.push({disFromCameraToLabel:U,left:X,top:J,index:E}):M.transform="translate(-50%, -50%)"}else M.inSight=!1;const W=M,{svelteApp:S}=W,L=Yi(W,["svelteApp"]);(R=M.svelteApp)==null||R.$set({props:L})}),l.length>1){let M=0;l.sort((E,S)=>S.disFromCameraToLabel-E.disFromCameraToLabel);for(let E=1;E<l.length;E++){const{index:S,left:L,top:W}=l[E-1],{index:R,left:U,top:j}=l[E],Y=this.container.children[S],N=this.container.children[R];if(!Y||!N)return;const G={left:o*L/100,top:r*W/100,width:(u=(h=(c=Y.children)==null?void 0:c[0])==null?void 0:h.clientWidth)!=null?u:0,height:(v=(m=(f=Y.children)==null?void 0:f[0])==null?void 0:m.clientHeight)!=null?v:0},X={left:o*U/100,top:r*j/100,width:(A=(g=(p=N.children)==null?void 0:p[0])==null?void 0:g.clientWidth)!=null?A:0,height:(C=(I=(w=N.children)==null?void 0:w[0])==null?void 0:I.clientHeight)!=null?C:0};gC(G,X)&&(M++,this.labelItems[S].transform=`translate(-50%, ${(M-1)*100-50}%)`,this.labelItems[R].transform=`translate(-50%, ${M*100-50}%)`)}}});d(this,"onClick",(e,i)=>{if(!this.roomObservers)return;const{work:s}=this.five;let o,r,a=1/0;for(const l of s.observers)if(this.roomObservers.find(h=>h.panoIndex===l.panoIndex&&h.name===e)){const h=l.standingPosition,u=i.distanceTo(h);u<a&&(o=l.panoIndex,r=h.clone().sub(i).normalize(),a=u)}if(r!==null&&o!==null){const l={};if(a>0){const h=new Q.Vector3(0,0,-1),u=r.clone(),f=new Q.Quaternion;f.setFromUnitVectors(h,u);const m=new Q.Euler;m.setFromQuaternion(f,"YXZ"),l.longitude=m.y}this.five.emit("wantsToMoveToPano",o,{},!0)||this.five.moveToPano(o,{longitude:l.longitude})}});d(this,"initData",()=>{var o;this.doorLabels=[];const e=this.five.panoIndex,i=this.floorplanServerData.computed_data.observers[e].floor_index,s=i!==void 0&&((o=this.floorplanServerData.computed_data.floor_datas[i])==null?void 0:o.rooms);this.rooms=s,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(h=>!!(h&&h.name===r.name)),l=this.five.work.observers.filter((h,u)=>!!r.observer_indexs.find(f=>f===u));a&&a.forEach(h=>{const u=h.position;let f=1/0,m;l.forEach(p=>{const g=p.standingPosition,A={x:g.x,y:g.y,z:g.z},w=vC(u,A);w<f&&(f=w,m=A)}),m&&(u.y=m.y+.01);const v=new Q.Vector3(u.x,u.y,u.z);v.add(new Q.Vector3(-.2,1.8,0).applyEuler(new Q.Euler(0,h.rad,0))),this.doorLabels.push({roomName:r.name,name:h.name,position:v,toward:AC(h.rad)})})}),this.labelItems=this.doorLabels.map(r=>ie(x({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}appendTo(e){this.state.enabled&&(this.container=e)}setState(e,i){const s=this.state;this.state=x(x({},s),e);const o=s.enabled&&s.visible,r=this.state.enabled&&this.state.visible;o!==r&&this.applyState()}show(){this.setState({visible:!0})}hide(){this.setState({visible:!1})}enable(){this.setState({enabled:!0})}disable(){this.setState({enabled:!1})}stateChangedCallback(e,i){if(this.hooks.hasListener("stateChange")){const s={state:this.state,prevState:e,userAction:i?i.userAction:bC.userAction};this.hooks.emit("stateChange",s)}}applyState(e){const i=e!=null?e:this.state;i.enabled!==!1&&i.visible!==!1?(this.labelItems.forEach(o=>{o.svelteApp=new mC({target:this.container,props:{props:o,onClick:()=>{this.onClick(o.name,o.position)}}})}),this.fixDoorPosition()):this.labelItems.forEach(o=>{o.svelteApp.$destroy()})}initState(){return{enabled:!0,visible:!0}}}const wC=n=>new yC(n);function ff(n,t){console.warn(`🚫 ==> [${n}]: ${t}`)}var cr={},CC=PC;function PC(n,t,e){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n}var IC=MC;function MC(n,t,e){return n[0]=t,n[1]=e,n}var EC=kC;function kC(n,t){var e=t[0],i=t[1],s=e*e+i*i;return s>0&&(s=1/Math.sqrt(s),n[0]=t[0]*s,n[1]=t[1]*s),n}var xC=DC;function DC(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n}var SC=LC;function LC(n,t){return n[0]*t[0]+n[1]*t[1]}var TC=CC,sl=IC,mf=EC,zC=xC,jC=SC,gf=[0,0];cr.computeMiter=function(t,e,i,s,o){return TC(t,i,s),mf(t,t),sl(e,-t[1],t[0]),sl(gf,-i[1],i[0]),o/jC(e,gf)},cr.normal=function(t,e){return sl(t,-e[1],e[0]),t},cr.direction=function(t,e,i){return zC(t,e,i),mf(t,t),t};var Ci=cr,cn=[0,0],hr=[0,0],pf=[0,0],_s=[0,0],OC=function(n,t){var e=null,i=[];t&&(n=n.slice(),n.push(n[0]));for(var s=n.length,o=1;o<s;o++){var r=n[o-1],a=n[o],l=o<n.length-1?n[o+1]:null;if(Ci.direction(cn,a,r),e||(e=[0,0],Ci.normal(e,cn)),o===1&&ol(i,e,1),!l)Ci.normal(e,cn),ol(i,e,1);else{Ci.direction(hr,l,a);var c=Ci.computeMiter(pf,_s,cn,hr,1);ol(i,_s,c)}}if(n.length>2&&t){var h=n[s-2],u=n[0],f=n[1];Ci.direction(cn,u,h),Ci.direction(hr,f,u),Ci.normal(e,cn);var m=Ci.computeMiter(pf,_s,cn,hr,1);i[0][0]=_s.slice(),i[s-1][0]=_s.slice(),i[0][1]=m,i[s-1][1]=m,i.pop()}return i};function ol(n,t,e){n.push([[t[0],t[1]],e])}function vf(n,t){const e=n[0],i=n[1],s=t[0],o=t[1];var r=(o.x-s.x)*(e.y-s.y)-(o.y-s.y)*(e.x-s.x),a=(i.x-e.x)*(e.y-s.y)-(i.y-e.y)*(e.x-s.x),l=(o.y-s.y)*(i.x-e.x)-(o.x-s.x)*(i.y-e.y);if(l!==0){var c=r/l,h=a/l;if(0<=c&&c<=1&&0<=h&&h<=1)return!0}return!1}function VC(n,t){for(let e=0;e<n.length-1;e++)for(let i=0;i<t.length-1;i++)if(vf([n[e],n[e+1]],[t[i],t[i+1]]))return{x:(n[e].x+n[e+1].x)/2,y:(n[e].y+n[e+1].y)/2,line1RelativeIndex:e,line2RelativeIndex:i}}const BC=2,_C=3,RC=3,FC=2;function NC(n){const t=n.width,e=n.unitLength,i=t/2,s=n.path;if(s.length===0)return{geometry:new b.BufferGeometry,maxV:0,curvePath:null,curvePoints:null,panoMap:{}};const o=new b.CurvePath;s.forEach(G=>{const X=GC(G);X&&o.add(X)});const r=Math.ceil(o.getLength()*100);o.arcLengthDivisions=r;const a=o.getPoints(r),l=a.length;if(l<=2)return{geometry:new b.BufferGeometry,maxV:0,curvePath:null,curvePoints:null};const c=OC(a.map(G=>[G.x,G.z])),u=(l-1)*BC*_C,f=2*l,m=f*RC,v=f*FC,p=new Uint32Array(u),g=new Float32Array(m),A=new Float32Array(v),w=o.getLength();let I=0,C=0,M={};const E=n.path[0].points.map(G=>new b.Vector3().fromArray(G)),S=n.path[0].panoIndexList?[...n.path[0].panoIndexList]:void 0,L=(()=>{const G=[];for(let q=0;q<E.length;q++){const le=E[q];if(q===0)G.push(0);else{const ae=E[q-1];G.push(le.distanceTo(ae)+G[q-1])}}const X=G.at(-1),J=[];for(let q=0;q<G.length;q++){const le=G[q],ae=q===0?0:G[q-1],Ie=q===G.length-1?X:G[q+1],Ae=le-Math.min(.3,(le-ae)/2),pe=le+Math.min(.3,(Ie-le)/2);J.push([w*(Ae/X),w*(pe/X)])}return J})();let W=[];for(let G=0;G<l;G++){const[X,J]=c[G][0],q=a[G],{x:le,y:ae,z:Ie}=q,Ae=new Q.Vector3(le+X*i,ae+.05,Ie+J*i);g[G*6+0]=Ae.x,g[G*6+1]=Ae.y,g[G*6+2]=Ae.z;const pe=new Q.Vector3(le-X*i,ae+.05,Ie-J*i);g[G*6+3]=pe.x,g[G*6+4]=pe.y,g[G*6+5]=pe.z,I+=G>0?a[G-1].clone().sub(a[G]).length():0;const Fe=I/e;C=Fe,A[G*4+0]=0,A[G*4+1]=Fe,A[G*4+2]=1,A[G*4+3]=Fe;const we=new b.Vector3().lerpVectors(Ae,pe,.5);if(n.skipPositions&&n.skipPositions.some(be=>be.distanceTo(we)<.26))continue;const Ye=E[0];if(n.useAutoDepthTest&&Ye&&S){const ee=S[0],[be,je]=L[0];if(I>be&&I<je&&W.push({distance:Ye.distanceTo(we),index:G}),I>=je||G===l-1){const ve=Math.min(...W.map(Oe=>Oe.distance)),qe=W.find(Oe=>Oe.distance===ve);if(W=[],E.shift(),S.shift(),L.shift(),qe)M[ee]=qe.index;else{console.error(`can not find the min distance ${ee}`);continue}}}G!==l-1&&(p[G*6+0]=G*2+0,p[G*6+1]=G*2+2,p[G*6+2]=G*2+1,p[G*6+3]=G*2+2,p[G*6+4]=G*2+3,p[G*6+5]=G*2+1)}const R=[];let U;const j=[];for(let G=0;G<l-1;G++){if(U!==void 0&&G<=U)continue;const X=G+1,J={x:g[G*6+0],y:g[G*6+2]},q={x:g[G*6+3],y:g[G*6+5]},le={x:g[X*6+0],y:g[X*6+2]},ae={x:g[X*6+3],y:g[X*6+5]},Ie=vf([J,q],[le,ae]);if(Ie&&R.push(G),!Ie&&R.length){R.push(G);const Ae=new b.Vector2(J.x,J.y).distanceTo(new b.Vector2(le.x,le.y)),pe=new b.Vector2(q.x,q.y).distanceTo(new b.Vector2(ae.x,ae.y)),Fe=200,we=[],Ye=[],ee=Math.max(0,R[0]-e*Fe),be=R[0];for(let Oe=ee;Oe<be;Oe++)Ae<pe?we.push({x:g[Oe*6+0],y:g[Oe*6+2]}):we.push({x:g[Oe*6+3],y:g[Oe*6+5]});const je=R.at(-1),ve=R.at(-1)+e*Fe;for(let Oe=je;Oe<ve;Oe++)Ae<pe?Ye.push({x:g[Oe*6+0],y:g[Oe*6+2]}):Ye.push({x:g[Oe*6+3],y:g[Oe*6+5]});const qe=VC(we,Ye);if(qe){const{line1RelativeIndex:Oe,line2RelativeIndex:Le,x:st,y:ce}=qe,Pe=ee+Oe,Be=je+Le+2;for(let Me=Pe;Me<Be;Me++)Ae<pe?(g[Me*6+0]=st,g[Me*6+2]=ce):(g[Me*6+3]=st,g[Me*6+5]=ce),U=Me;let Ue,dt,tt,at,ze;Ae<pe?(Ue=g[ee*6+1],dt=g[Pe*6+1],tt=g[Be*6+1],at=g[ve*6+1],ze=(dt+tt)/2):(Ue=g[ee*6+4],dt=g[Pe*6+4],tt=g[Be*6+4],at=g[ve*6+4],ze=(dt+tt)/2);for(let Me=ee;Me<Pe;Me++){const Ke=Pe-ee,vt=(Me-ee)/Ke;Ae<pe?g[Me*6+1]=Ue+(ze-Ue)*vt:g[Me*6+4]=Ue+(ze-Ue)*vt}for(let Me=Pe;Me<Be;Me++)Ae<pe?g[Me*6+1]=ze:g[Me*6+4]=ze;for(let Me=Be;Me<ve;Me++){const Ke=ve-Be,vt=(Me-Be+1)/Ke;Ae<pe?g[Me*6+1]=ze+(at-ze)*vt:g[Me*6+4]=ze+(at-ze)*vt}j.push({start:Pe,end:Be})}R.length=0}}const Y=new Float32Array(f);j.forEach(G=>{for(let X=0;X<l-1;X++)X>=G.start&&X<=G.end?(Y[X*2+0]=1,Y[X*2+1]=1):Y[X]!==1&&(Y[X*2+0]=0,Y[X*2+1]=0)});const N=new b.BufferGeometry;return N.setAttribute("position",new b.BufferAttribute(g,3)),N.setAttribute("uv",new b.BufferAttribute(A,2)),N.setIndex(new b.BufferAttribute(p,1)),{geometry:N,maxV:C,animationWillError:j,curvePath:o,curvePoints:a,panoMap:M,totalLength:I}}function GC(n){if(QC(n)){const t=[n.closed,n.curve_type,n.tension],e=n.points.map(s=>new b.Vector3().fromArray(s));return new b.CatmullRomCurve3(e,...t)}}function QC(n){return n.type==="CatmullRomCurve3"}function WC(n,t){t.forEach(e=>{const i=new b.SphereGeometry(.02,16,16),s=[],o=[new b.MeshBasicMaterial({color:16776960}),new b.MeshBasicMaterial({color:16711935}),new b.MeshBasicMaterial({color:16711680}),new b.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=o[a],c=new b.Mesh(i,l);c.position.copy(pi(r)),s.push(c)});else{const r=o[0],a=new b.Mesh(i,r);a.position.copy(pi(e.position)),s.push(a)}s.forEach(r=>{r.material.depthTest=!1,n.scene.add(r)})})}const $e=n=>n;function Af(n){if(!n||n.length<3)return;const t=n.map(De),e=t[1].clone().sub(t[0]),i=t[2].clone().sub(t[1]);return e.cross(i)}function HC(n){return n.stickType==="Plane"}function UC(n){return n.stickType==="3DPoint"}function hn(n){return n.stickType==="Model"&&n.contentType==="MediaModel"}function YC(n){return n.stickType==="Model"&&n.contentType==="Model"}function XC(n){return n.stickType==="Plane"&&n.contentType==="MediaPlane"}function rl(n){const t=(()=>{if(hn(n)&&n.matrix){const e=new Q.Matrix4().fromArray(n.matrix);return n.data.mediaPosition.map(i=>De(i).clone().applyMatrix4(e))}else return n.position})();return Np(t)}function bf(n){const t=rl(n);return Ot(...Array.isArray(t)?t:[t])}function dr(n,t){if(n===void 0)return;const{min:e,max:i}=t!=null?t:{};if(!(e===void 0&&i===void 0))return!(typeof i=="number"&&i<n||typeof e=="number"&&e>n)}function ZC(n,t,e){const s=new b.Plane().setFromNormalAndCoplanarPoint(e,t),o=t.clone().sub(n).cross(new b.Vector3(0,1,0)).setLength(.01),r=new b.Vector3(0,.01,0);return[t.clone().sub(o).sub(r),t.clone().add(o).sub(r),t.clone().add(o).add(r),t.clone().sub(o).add(r)].map(l=>s.projectPoint(l,new b.Vector3))}const JC=(n,t=1e3/60)=>{let e=null;const i=n;return(...o)=>{e&&clearTimeout(e),e=setTimeout(()=>{i==null||i(...o),e&&clearTimeout(e),e=null},t)}};function qC(n,t=200){let e;return function(...i){e||(n.apply(this,i),e=setTimeout(function(){e=null},t))}}function KC(n,t){const[e,i]=t;if(e>=i||i<=1||e<=1)return-1;const s={},o=r=>(s[r]||(s[r]=n(r)),s[r]);for(let r=e;r<i;r++){const a=o(r),l=o(r-1);if(a<l)return r}return-1}function al(n){return n.stickType?n.stickType:n.pointType==="PointTag"&&n.dimensionType==="3D"?"3DPoint":n.pointType==="PlaneTag"?"Plane":"2DPoint"}function $C(n){var t,e,i,s;if(n.stickType||(n.stickType=al(n)),n.contentType==="VRLink"||n.contentType==="PanoLink"||n.contentType==="Link"){const o=n;!((e=(t=o.data)==null?void 0:t.icon)!=null&&e.url)&&!((s=(i=o.style)==null?void 0:i.point)!=null&&s.url)&&(o.data.icon={url:"//vr-static.realsee-cdn.cn/release/web/test.09dee741.png",steps:28})}return n.extraData&&(n.data?n.data.extraData=n.extraData:n.data={extraData:n.extraData}),n}const es="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAgAAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//uQxAACFEII9ACZ/sJZwWEoEb8w/////N//////JcxjHjf+7/v/H2PzCCFAiDtGeyBCIx7bJJ1mmEEMy6g8mm2c8nrGABB4h2Mkmn//4z/73u773R5qHHu/j/w7Kxkzh5lWRWdsifCkNAnY9Zc1HvDAhjhSHdFkHFzLmabt/AQxSg2wwzLhHIJOBnAWwVY4zrhIYhhc2kvhYDfQ4hDi2Gmh5KyFn8EcGIrHAngNgIwVIEMf5bzbAiTRoAD///8z/KVhkkWEle6IX+d/z4fvH3BShK1e5kmjkCMoxVmXhd4ROlTKo3iipasvTilY21q19ta30/v/0/idPX1v8PNxJL6ramnOVsdvMv2akO0iSYIzdJFirtzWXCZicS9vHqvSKyqm5XJBdqBwPxyfJdykhWTZ0G0ZyTZGpLKxsNwwoRhsx3tZfhwmeOBVISm3impAC/IT/8hP/EKEM1KMdVdVKM2rHV4x7HVXZvbVVKN/qq8CiV9VL9jjH/6l6qf7MBCjZmOqsAibjcP+qqqv0oxqpa/NVW286hPo1nz2L/h8+jXt//uSxCmDU2IK/ECN98KKtE5IYzNoCfbw+u9i5r8PoadUMFPKqWL4LK3T/LCraMSHGkW4bpLXR/E6LlHOVQxmslKVJ8IULktMN06N0FKCpHCoYsjC4F+Z0NVqdNFoGSTjSiyjzLdnZ2fNqTi2eHKONONKLMPMKLONKLMPQRJGlFxZRoKcJFAYEeIFiRQkUWUeYfef//Ko04soswso40UJAgMw8wosososy0EalnZyjQUGBRQGIFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsqFdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",Rs={};var ll=(n=>(n.Default="default",n.GetAudioDuration="getAudioDuration",n.PlayAudio="playAudio",n))(ll||{});function eP(n,t){const e=(t==null?void 0:t.namespace)||"default",i=Rs[e]||(Rs[e]=[]);let s=i.find(o=>!o.realSrc||o.realSrc===es);return s||(console.warn("未找到缓存音频,已新建",Rs),s=new yf(es),i.push(s)),n&&(s.src=n),s}function tP(n,t){const e=(t==null?void 0:t.namespace)||"default",i=Rs[e]||(Rs[e]=[]),s=n-i.length;if(!(s<=0))for(let o=0;o<s;o++)i.push(new yf(es))}class yf extends(()=>typeof Audio=="undefined"?class{}:Audio)(){constructor(e){super(e);d(this,"preload","auto");d(this,"crossOrigin","anonymous");d(this,"realSrc","");d(this,"inited",!1);d(this,"removeDocumentEventListener");this.realSrc=e!=null?e:"",this.muted=!0,super.autoplay=!0,super.addEventListener("ended",()=>{this.src=""});const i=()=>iP(this);document.addEventListener("click",i),document.addEventListener("touchend",i),this.removeDocumentEventListener=()=>{document.removeEventListener("click",i),document.removeEventListener("touchend",i)}}get isBlankAudio(){return this.realSrc===es||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e,this.removeDocumentEventListener()}get muted(){return super.muted}set muted(e){super.muted=e}clear(){this.currentTime=0,this.src=es}}function iP(n){n&&(n.inited||(n.src&&(n.inited=!0,n.removeDocumentEventListener()),n.src===es&&n.play()))}const nP={globalConfig:{visibleConfig:{followModelVisibility:!0},unfoldedConfig:{autoUnfold:{enable:!0,strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"[Mapview]":{unfoldedConfig:{autoUnfold:{enable:!1,distance:{max:9999}}}},"[Floorplan]":{unfoldedConfig:{autoUnfold:{enable:!1,distance:{max:9999}}}},"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"}},Link:{unfoldedConfig:{keep:"unfolded"}},Panorama:{unfoldedConfig:{keep:"unfolded"}},VRLink:{unfoldedConfig:{keep:"unfolded"}},PanoLink:{unfoldedConfig:{keep:"unfolded"}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},initialData:{autoplayConfig:{autoplayCarousel:!0,autoplayVideo:!1,autoplayVideoInCarousel:!1}}},"Model-Any":{unfoldedConfig:{keep:"unfolded"},visibleConfig:{visibleFiveMode:"all"}}}},sP=navigator.userAgent.toLowerCase().indexOf("iphone")!==-1;navigator.userAgent.toLowerCase().indexOf("android");const ur=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1,oP=sP&&ur;function rP(n){if(n.length!==4)return!1;const[t,e,i,s]=n,o=t.distanceTo(e),r=e.distanceTo(i),a=i.distanceTo(s),l=s.distanceTo(t),c=t.distanceTo(i),h=e.distanceTo(s);return o===a&&r===l&&c===h}class cl extends b.Mesh{constructor(e,i,s){if(e.length!==4)throw new Error("QuadrangleMesh: Invalid number of points, it's not a quadrangle");const[o,r,a,l]=e,c=Ot(...e),h=[o.clone().sub(c),r.clone().sub(c),a.clone().sub(c),l.clone().sub(c)],u=new wf(h,s);super(u,i);d(this,"name","QuadrangleMesh");this.position.copy(c)}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}}class wf extends b.BufferGeometry{constructor(e,i){super();d(this,"name","QuadrangleGeometry");d(this,"points");this.points=e;const s=i!=null?i:rP(e)?64:1;if(e.length!==4){console.error("Invalid number of points, it's not a quadrangle");return}const[o,r,a,l]=e,[c,h,u,f]=[new b.Vector2(0,0),new b.Vector2(1,0),new b.Vector2(1,1),new b.Vector2(0,1)],m=[],v=[];m.push(...o.toArray()),v.push(...c.toArray());for(let g=1;g<s;g++)m.push(o.x+(r.x-o.x)*g/s,o.y+(r.y-o.y)*g/s,o.z+(r.z-o.z)*g/s),v.push(c.x+(h.x-c.x)*g/s,c.y+(h.y-c.y)*g/s);m.push(...r.toArray()),v.push(...h.toArray()),m.push(...a.toArray()),v.push(...u.toArray());for(let g=1;g<s;g++)m.push(a.x+(l.x-a.x)*g/s,a.y+(l.y-a.y)*g/s,a.z+(l.z-a.z)*g/s),v.push(u.x+(f.x-u.x)*g/s,u.y+(f.y-u.y)*g/s);m.push(...l.toArray()),v.push(...f.toArray());const p=[];for(let g=0;g<s;g++)p.push(g,g+1,s*2-g,g,s*2-g,s*2+1-g);this.setAttribute("position",new b.BufferAttribute(new Float32Array(m),3)),this.setAttribute("uv",new b.BufferAttribute(new Float32Array(v),2)),this.setIndex(new b.BufferAttribute(new Uint32Array(p),1))}}function aP(n,t){let e=!ur;const i=t!=null?t:document.createElement("video");i.preload="metadata",i.crossOrigin="anonymous",i.muted=!0,i.loop=!0,i.playsInline=!0,i.autoplay=!0;const s=new b.VideoTexture(i);s.minFilter=b.LinearFilter,s.magFilter=b.LinearFilter,s.encoding=b.sRGBEncoding,s.metadataLoaded=!1,i.src=n;const o=()=>{s.metadataLoaded||(s.dispatchEvent({type:"videoLoaded"}),s.metadataLoaded=!0)};if(ur||(i.onloadedmetadata=()=>{o()}),ur){const r=()=>{if(!e){if(!i.paused){o();return}i.muted=!0,i.play().then(()=>{e=!0,i.pause(),i.currentTime=0,o()}).catch(()=>{console.warn("video auto play error")})}};document.addEventListener("click",r,{once:!0}),document.addEventListener("touchend",r,{once:!0})}return s}function Fs(n,t,e){if(n==="fill")return t;if(n==="contain"){const[i,s,o,r]=t,a=i.distanceTo(s),l=o.distanceTo(r),c=i.distanceTo(r),h=s.distanceTo(o),u=a,f=c,m=u/f;if(m>e){const p=f*e,g=new b.Vector3().subVectors(s,i).multiplyScalar((a-p)/2/a),A=new b.Vector3().subVectors(o,r).multiplyScalar((l-p)/2/l);return[i.clone().add(g),s.clone().sub(g),o.clone().sub(A),r.clone().add(A)]}else if(m<e){const p=u/e,g=new b.Vector3().subVectors(r,i).multiplyScalar((c-p)/2/c),A=new b.Vector3().subVectors(o,s).multiplyScalar((h-p)/2/h);return[i.clone().add(g),s.clone().add(A),o.clone().sub(A),r.clone().sub(g)]}else return t}else return console.warn(`objectFit: ${n} is not supported yet`),t}class lP extends b.ShaderMaterial{constructor(e){super();d(this,"transparent",!1);d(this,"blending",b.CustomBlending);d(this,"blendSrc",b.SrcAlphaFactor);d(this,"blendDst",b.OneMinusSrcAlphaFactor);d(this,"blendSrcAlpha",b.OneFactor);d(this,"blendDstAlpha",b.OneMinusSrcAlphaFactor);d(this,"vertexShader",`
809
+ `,e.container.style.pointerEvents="none";const i=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),s=g=>{e.itemLabels=aC(g),l()},o=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{h(),e.container.remove()},l=()=>{var g;if(e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:n,itemLabels:e.itemLabels}):e.app=new rC({target:e.container,props:{five:n,modelOcclusionEnable:e.modelOcclusionEnable,itemLabels:e.itemLabels,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{n.on("modeChange",u),n.once("dispose",a)},h=()=>{n.off("modeChange",u)},u=g=>{if(g!==Xe.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}n.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,o()})};return c(),{appendTo:i,load:s,enable:o,disable:r,dispose:a,hooks:e.hooks}},hC={name:"ItemLabelPlugin",version:0};function dC(n){ge(n,"svelte-1irjijd",'.plugin-DoorLabelPlugin-item.svelte-1irjijd.svelte-1irjijd{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-1irjijd.svelte-1irjijd{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-1irjijd.svelte-1irjijd::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAD///+l2Z/dAAAAAnRSTlMAIE397fAAAAAVSURBVAjXY2BjgCMQ+PABhIAASRwARxwD8fgzCQAAAAAASUVORK5CYII=") 4;border-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAD///+l2Z/dAAAAAnRSTlMAIE397fAAAAAVSURBVAjXY2BjgCMQ+PABhIAASRwARxwD8fgzCQAAAAAASUVORK5CYII=") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-1irjijd.svelte-1irjijd:active,.plugin-DoorLabelPlugin-cnt.svelte-1irjijd.svelte-1irjijd:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-1irjijd.svelte-1irjijd{background:url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTBweCIgaGVpZ2h0PSIxMHB4IiB2aWV3Qm94PSIwIDAgMTAgMTAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+aW1hZ2Ut566t5aS0PC90aXRsZT4KICAgIDxkZWZzPgogICAgICAgIDxyZWN0IGlkPSJwYXRoLTEiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCI+PC9yZWN0PgogICAgICAgIDxsaW5lYXJHcmFkaWVudCB4MT0iNjYuMDYyMTk3NSUiIHkxPSI1MCUiIHgyPSItMS4xMzY4NjgzOGUtMTElIiB5Mj0iNTAlIiBpZD0ibGluZWFyR3JhZGllbnQtMyI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCUiPjwvc3RvcD4KICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI0ZGRkZGRiIgc3RvcC1vcGFjaXR5PSIwLjg1IiBvZmZzZXQ9IjEwMCUiPjwvc3RvcD4KICAgICAgICA8L2xpbmVhckdyYWRpZW50PgogICAgICAgIDxsaW5lYXJHcmFkaWVudCB4MT0iODQuMzM5NzMxJSIgeTE9IjUwJSIgeDI9IjIzLjQyODMzNzclIiB5Mj0iNTAlIiBpZD0ibGluZWFyR3JhZGllbnQtNCI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIHN0b3Atb3BhY2l0eT0iMCIgb2Zmc2V0PSIwJSI+PC9zdG9wPgogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjRkZGRkZGIiBzdG9wLW9wYWNpdHk9IjAuOCIgb2Zmc2V0PSIxMDAlIj48L3N0b3A+CiAgICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxnIGlkPSLpobXpnaItMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IlZSLeWIhumXtOW8leWvvOagh+etvuWkh+S7vS0zIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzM5LjAwMDAwMCwgLTU0My4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9Iue8lue7hC0y5aSH5Lu9LTEyIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzMDUuMDAwMDAwLCA1MzYuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0iaW1hZ2Ut566t5aS0IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzNC4wMDAwMDAsIDcuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICAgICAgPG1hc2sgaWQ9Im1hc2stMiIgZmlsbD0id2hpdGUiPgogICAgICAgICAgICAgICAgICAgICAgICA8dXNlIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDwvbWFzaz4KICAgICAgICAgICAgICAgICAgICA8dXNlIGlkPSJCRyIgZmlsbC1vcGFjaXR5PSIwIiBmaWxsPSIjRDhEOEQ4IiBvcGFjaXR5PSIwLjUxMTQ2Mjk4NCIgeGxpbms6aHJlZj0iI3BhdGgtMSI+PC91c2U+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuOTM4ODY5OCwxLjE0Mzc2MTI5IEM4LjI1NDY1NDA0LDEuMjU3NTgwMzUgOC4zMTc4Mjg0LDEuMzAyMTY5OTggOC4zMTc3ODUyMSwxLjM1ODE1MjIzIEM4LjMxNzc1MDcyLDEuNDAyODQzMzUgOC4zMDU3NDkwNywxLjQ0NzUyNTI0IDguMjgxNzg0MTEsMS40ODcyMDUyMSBMOC4yODE3ODQxMSwxLjQ4NzIwNTIxIEw2LjIwOTg5MDQxLDQuOTE3NzQyNDUgQzYuMTM3ODg4MDgsNS4wMzY5NjAyOSA2LjEwMTg4NjkxLDUuMTcxMjIwMiA2LjEwMTg4NjkxLDUuMzA1NDgwMTEgQzYuMTAxODg2OTEsNS40Mzk3NDAwMiA2LjEzNzg4ODA4LDUuNTczOTk5OTQgNi4yMDk4OTA0MSw1LjY5MzIxNzc4IEw2LjIwOTg5MDQxLDUuNjkzMjE3NzggTDguMjgxNzg0MTEsOS4xMjM3NTUwMSBDOC4zMTc0NzQzOCw5LjE4Mjg0OTE2IDguMzI1ODMzMjIsOS4yNTA4MTUyIDguMzEwNDk1OTUsOS4zMTI5MzAyOCBDOC4yOTUxNTg2OCw5LjM3NTA0NTM2IDguMjU2MTI1MzEsOS40MzEzMDk0NyA4LjE5NzAzMTE3LDkuNDY2OTk5NzMgQzguMTU3MzUxMTksOS40OTA5NjQ2OSA4LjExMjY2OTMxLDkuNTAyOTY2MzQgOC4wNjc5NzgxOCw5LjUwMzAwMDgzIEM4LjAyMzI4NzA2LDkuNTAzMDM1MzEgNy45Nzg1ODY3MSw5LjQ5MTEwMjYzIDcuOTM4ODY5OCw5LjQ2NzE5ODkzIEw3LjkzODg2OTgsOS40NjcxOTg5MyBMMS4zNzk5MTIxOCw1LjUxOTY3ODE1IEMxLjMyMDc2MzAyLDUuNDg0MDc5MTIgMS4yODE2NDI4Nyw1LjQyNzg3NTMyIDEuMjY2MjA5NzcsNS4zNjU3ODM5OCBDMS4yNTQ2OTI1Niw1LjMxOTQ0NzMyIDEuMjU2MzY2OTgsNS4yNjk4MzE4MiAxLjI3Mjc1MzMzLDUuMjIzMDU0MDUgTDEuMjcyNzUzMzMsNS4yMjMwNTQwNSBaIiBpZD0i566t5aS0IiBzdHJva2U9InVybCgjbGluZWFyR3JhZGllbnQtNCkiIHN0cm9rZS13aWR0aD0iMC41IiBmaWxsPSJ1cmwoI2xpbmVhckdyYWRpZW50LTMpIiBtYXNrPSJ1cmwoI21hc2stMikiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUuMDM5MjAwLCA1LjMwNTQ4MCkgc2NhbGUoMSwgLTEpIHJvdGF0ZSgtOTAuMDAwMDAwKSB0cmFuc2xhdGUoLTUuMDM5MjAwLCAtNS4zMDU0ODApICI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-1irjijd .plugin-DoorLabelPlugin-txt.svelte-1irjijd{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-1irjijd .plugin-DoorLabelPlugin-txt.svelte-1irjijd{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-1irjijd .plugin-DoorLabelPlugin-txt.svelte-1irjijd{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-1irjijd .plugin-DoorLabelPlugin-txt.svelte-1irjijd{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-1irjijd.svelte-1irjijd{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-1irjijd .plugin-DoorLabelPlugin-icon.svelte-1irjijd{background:url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTBweCIgaGVpZ2h0PSI4cHgiIHZpZXdCb3g9IjAgMCAxMCA4IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPHRpdGxlPueureWktDwvdGl0bGU+CiAgICA8ZGVmcz4KICAgICAgICA8bGluZWFyR3JhZGllbnQgeDE9IjEwLjYzODU4ODQlIiB5MT0iMCUiIHgyPSI5Ni41MTYxNDc0JSIgeTI9IjEyOS43MzEzNTQlIiBpZD0ibGluZWFyR3JhZGllbnQtMSI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNGRkYyQ0MiIG9mZnNldD0iMCUiPjwvc3RvcD4KICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI0VBRDA5QSIgb2Zmc2V0PSI0OC43MTQ0NDc4JSI+PC9zdG9wPgogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjRDFCMTdFIiBvZmZzZXQ9IjEwMCUiPjwvc3RvcD4KICAgICAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0i5pyq5p2l5a625aSH5Lu9LTI1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzA1LjAwMDAwMCwgLTU0NS4wMDAwMDApIiBmaWxsPSJ1cmwoI2xpbmVhckdyYWRpZW50LTEpIiBmaWxsLXJ1bGU9Im5vbnplcm8iPgogICAgICAgICAgICA8ZyBpZD0i57yW57uELTLlpIfku70tMTMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0NS4wMDAwMDAsIDUzNy4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxnIGlkPSJpbWFnZS3nrq3lpLQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDYwLjAwMDAwMCwgNy4wMDAwMDApIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNOC40OTU3ODI5NCwxLjYxNjQ1MTEgTDYuNDIzODg5MjUsNS4wNDY5ODgzMyBDNi4zMjc4ODYxMyw1LjIwNTk0NTQ1IDYuMzI3ODg2MTMsNS40MDUwMTQ3NyA2LjQyMzg4OTI1LDUuNTYzOTcxODkgTDguNDk1NzgyOTQsOC45OTQ1MDkxMiBDOC42Mzg1NDQwMSw5LjIzMDg4NTcxIDguNTYyNjUzNjQsOS41MzgyMzc1IDguMzI2Mjc3MDYsOS42ODA5OTg1NiBDOC4xNjc1NTcxNiw5Ljc3Njg1ODQgNy45Njg4MjE5NSw5Ljc3NzAxMTc1IDcuODA5OTU0MzEsOS42ODEzOTY5NyBMMS4yNTA5OTY2OSw1LjczMzg3NjE4IEMxLjAxNDQwMDA4LDUuNTkxNDgwMDcgMC45MzgwMzU0ODEsNS4yODQyNDU3NiAxLjA4MDQzMTU5LDUuMDQ3NjQ5MTQgQzEuMTIyNTE0OCw0Ljk3NzcyNjI4IDEuMTgxMDczODMsNC45MTkxNjcyNSAxLjI1MDk5NjY5LDQuODc3MDg0MDQgTDcuODA5OTU0MzEsMC45Mjk1NjMyNTMgQzguMDQ2NTUwOTMsMC43ODcxNjcxNDIgOC4zNTM3ODUyNCwwLjg2MzUzMTczOSA4LjQ5NjE4MTM1LDEuMTAwMTI4MzUgQzguNTkxNzk2MTMsMS4yNTg5OTYgOC41OTE2NDI3OCwxLjQ1NzczMTIgOC40OTU3ODI5NCwxLjYxNjQ1MTEgWiIgaWQ9IueureWktCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNS4wMzkyMDAsIDUuMzA1NDgwKSBzY2FsZSgxLCAtMSkgcm90YXRlKC05MC4wMDAwMDApIHRyYW5zbGF0ZSgtNS4wMzkyMDAsIC01LjMwNTQ4MCkgIj48L3BhdGg+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-1irjijd.svelte-1irjijd:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-1irjijd.svelte-1irjijd:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function uC(n){let t,e,i,s=n[0].name+"",o,r,a,l,c,h,u,f,m;return{c(){t=T("div"),e=T("div"),i=T("span"),o=Se(s),r=te(),a=T("i"),P(i,"class","plugin-DoorLabelPlugin-txt svelte-1irjijd"),P(a,"class","plugin-DoorLabelPlugin-icon svelte-1irjijd"),P(e,"class",l=it(Lt("plugin-DoorLabelPlugin-cnt",n[0].toward))+" svelte-1irjijd"),P(e,"style",c=`transform: ${n[0].transform||"initial"};pointer-events: ${n[0].inSight?"auto":"none"};opacity: ${n[0].inSight?1:0}`),P(e,"data-camera-toward",h=n[0].cameraToward),P(t,"style",u=`left: ${n[0].left||0}%;top: ${n[0].top||0}%;opacity: ${n[0].inSight?1:0}`),P(t,"class","plugin-DoorLabelPlugin-item svelte-1irjijd")},m(v,p){B(v,t,p),O(t,e),O(e,i),O(i,o),O(e,r),O(e,a),n[4](t),f||(m=Ce(e,"click",n[3]),f=!0)},p(v,[p]){p&1&&s!==(s=v[0].name+"")&&Te(o,s),p&1&&l!==(l=it(Lt("plugin-DoorLabelPlugin-cnt",v[0].toward))+" svelte-1irjijd")&&P(e,"class",l),p&1&&c!==(c=`transform: ${v[0].transform||"initial"};pointer-events: ${v[0].inSight?"auto":"none"};opacity: ${v[0].inSight?1:0}`)&&P(e,"style",c),p&1&&h!==(h=v[0].cameraToward)&&P(e,"data-camera-toward",h),p&1&&u!==(u=`left: ${v[0].left||0}%;top: ${v[0].top||0}%;opacity: ${v[0].inSight?1:0}`)&&P(t,"style",u)},i:$,o:$,d(v){v&&V(t),n[4](null),f=!1,m()}}}function fC(n,t,e){let{props:i}=t,{onClick:s}=t,o;const r=()=>{const{left:c,top:h,inSight:u,panoIndex:f}=i;if(!c||!h||!u||!o)return;const m=o.current.clientWidth/window.innerWidth*100,v=o.current.clientHeight/window.innerHeight*100;c<=m/2||c>=100-m/2||h<=v/2||h>=100-v/2},a=c=>{s&&s()};function l(c){Qe[c?"unshift":"push"](()=>{o=c,e(2,o)})}return n.$$set=c=>{"props"in c&&e(0,i=c.props),"onClick"in c&&e(1,s=c.onClick)},r(),[i,s,o,a,l]}class mC extends ue{constructor(t){super(),de(this,t,fC,uC,he,{props:0,onClick:1},dC)}}function gC(n,t){const e=Math.abs(n.top+n.height/2-t.top-t.height/2),i=Math.abs(n.left+n.width/2-t.left-t.width/2),s=(n.height+t.height)/2,o=(n.width+t.width)/2;return!(e>s&&i>o)}function pC(n){const{camera:t}=n,e=t.getWorldDirection(new Q.Vector3);let i=Math.atan(e.z/e.x)*180/Math.PI,s="";return e.x<0&&(i+=180),i<0&&(i+=360),i>315||i<=45?s="right":i>45&&i<=135?s="back":i>135&&i<=225?s="left":i>225&&i<=315&&(s="forward"),s}function vC(n,t){return Math.sqrt(Math.pow(n.z-t.z,2)+Math.pow(n.x-t.x,2))}function AC(n){const t=Math.PI/4;return n>-t&&n<=t?"left":n>t*3||n<=-t*3?"right":n>-t*3&&n<=-t?"forward":n>t&&n<=t*3?"back":""}const bC={userAction:!0};class yC extends Ri{constructor(e){super(e);d(this,"state",{enabled:!0,visible:!0});d(this,"container");d(this,"MinVisibledistance",1.8);d(this,"MaxVisibledistance",5);d(this,"OffsetHeight",-1.3);d(this,"rooms");d(this,"floorplanServerData");d(this,"visibleLabelMap",new Map);d(this,"labelItems",[]);d(this,"doorLabels");d(this,"roomObservers");d(this,"loadData",(e,i)=>{i&&(this.MaxVisibledistance=i.MaxVisibledistance,this.MinVisibledistance=i.MinVisibledistance,this.OffsetHeight=i.OffsetHeight),this.labelItems=[],this.doorLabels=[],this.floorplanServerData=e,ni(this.five).then(()=>{this.initData(),this.fixDoorVisibleAndPosition(),this.applyState()})});d(this,"dispose",()=>{var e,i,s,o,r,a,l;(e=this.five)==null||e.off("wantsToMoveToPano",this.hideAllLabels),(i=this.five)==null||i.off("modelLoaded",this.fixDoorVisibleAndPosition),(s=this.five)==null||s.off("panoArrived",this.fixDoorVisibleAndPosition),(o=this.five)==null||o.off("initAnimationEnded",this.fixDoorPosition),(r=this.five)==null||r.off("cameraUpdate",this.fixDoorPosition),(a=this.five)==null||a.off("mouseWheel",this.fixDoorPosition),(l=this.five)==null||l.off("pinchGesture",this.fixDoorPosition),this.applyState({enabled:!1})});d(this,"initRoomObservers",()=>{var o,r;const e=this.floorplanServerData.computed_data.floor_datas||[],s=(((r=(o=this.five)==null?void 0:o.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,h=e==null?void 0:e.find(u=>u.floor_index===c);if(h){const u=h.rooms.find(f=>f.observer_indexs.includes(l));if(u)return{panoIndex:l,floorIndex:c,name:u.name}}}).filter(Boolean);this.roomObservers=s});d(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1})});d(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.state.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const i=this.roomObservers.find(a=>a.panoIndex===e),o=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===i.name)return;const h=l.position.clone(),u=h.distanceTo(o);if(u<this.MinVisibledistance||u>this.MaxVisibledistance)return;const f=new Q.Raycaster,m=h.clone().sub(o).normalize();f.set(o,m);const[v]=this.five.model.intersectRaycaster(f);v&&v.distance+.1<u||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});d(this,"fixDoorPosition",()=>{var c,h,u,f,m,v,p,g,A,w,I,C;if(!this.state.enabled||!this.state.visible)return;const{panoIndex:e,camera:i}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const s=this.five.getElement(),o=s.clientWidth,r=s.clientHeight,a=i.getWorldDirection(new Q.Vector3),l=[];if(this.labelItems.forEach((M,E)=>{var R;if(M.visible){const U=i.position.distanceTo(M.position),j=M.position.clone().add(new Q.Vector3(0,this.OffsetHeight,0)),N=j.clone().sub(i.position).normalize().angleTo(a),G=j.clone().project(i),X=(G.x+1)/2.2*100,J=(-G.y+1)/2.2*100,q=X>=0&&X<=100&&J>=0&&J<=100&&U>this.MinVisibledistance&&U<=this.MaxVisibledistance;M.left=X,M.top=J,M.inSight=q&&N<Math.PI/2,M.cameraToward=pC(this.five),q?l.push({disFromCameraToLabel:U,left:X,top:J,index:E}):M.transform="translate(-50%, -50%)"}else M.inSight=!1;const W=M,{svelteApp:S}=W,L=Yi(W,["svelteApp"]);(R=M.svelteApp)==null||R.$set({props:L})}),l.length>1){let M=0;l.sort((E,S)=>S.disFromCameraToLabel-E.disFromCameraToLabel);for(let E=1;E<l.length;E++){const{index:S,left:L,top:W}=l[E-1],{index:R,left:U,top:j}=l[E],Y=this.container.children[S],N=this.container.children[R];if(!Y||!N)return;const G={left:o*L/100,top:r*W/100,width:(u=(h=(c=Y.children)==null?void 0:c[0])==null?void 0:h.clientWidth)!=null?u:0,height:(v=(m=(f=Y.children)==null?void 0:f[0])==null?void 0:m.clientHeight)!=null?v:0},X={left:o*U/100,top:r*j/100,width:(A=(g=(p=N.children)==null?void 0:p[0])==null?void 0:g.clientWidth)!=null?A:0,height:(C=(I=(w=N.children)==null?void 0:w[0])==null?void 0:I.clientHeight)!=null?C:0};gC(G,X)&&(M++,this.labelItems[S].transform=`translate(-50%, ${(M-1)*100-50}%)`,this.labelItems[R].transform=`translate(-50%, ${M*100-50}%)`)}}});d(this,"onClick",(e,i)=>{if(!this.roomObservers)return;const{work:s}=this.five;let o,r,a=1/0;for(const l of s.observers)if(this.roomObservers.find(h=>h.panoIndex===l.panoIndex&&h.name===e)){const h=l.standingPosition,u=i.distanceTo(h);u<a&&(o=l.panoIndex,r=h.clone().sub(i).normalize(),a=u)}if(r!==null&&o!==null){const l={};if(a>0){const h=new Q.Vector3(0,0,-1),u=r.clone(),f=new Q.Quaternion;f.setFromUnitVectors(h,u);const m=new Q.Euler;m.setFromQuaternion(f,"YXZ"),l.longitude=m.y}this.five.emit("wantsToMoveToPano",o,{},!0)||this.five.moveToPano(o,{longitude:l.longitude})}});d(this,"initData",()=>{var o;this.doorLabels=[];const e=this.five.panoIndex,i=this.floorplanServerData.computed_data.observers[e].floor_index,s=i!==void 0&&((o=this.floorplanServerData.computed_data.floor_datas[i])==null?void 0:o.rooms);this.rooms=s,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(h=>!!(h&&h.name===r.name)),l=this.five.work.observers.filter((h,u)=>!!r.observer_indexs.find(f=>f===u));a&&a.forEach(h=>{const u=h.position;let f=1/0,m;l.forEach(p=>{const g=p.standingPosition,A={x:g.x,y:g.y,z:g.z},w=vC(u,A);w<f&&(f=w,m=A)}),m&&(u.y=m.y+.01);const v=new Q.Vector3(u.x,u.y,u.z);v.add(new Q.Vector3(-.2,1.8,0).applyEuler(new Q.Euler(0,h.rad,0))),this.doorLabels.push({roomName:r.name,name:h.name,position:v,toward:AC(h.rad)})})}),this.labelItems=this.doorLabels.map(r=>ie(x({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}appendTo(e){this.state.enabled&&(this.container=e)}setState(e,i){const s=this.state;this.state=x(x({},s),e);const o=s.enabled&&s.visible,r=this.state.enabled&&this.state.visible;o!==r&&this.applyState()}show(){this.setState({visible:!0})}hide(){this.setState({visible:!1})}enable(){this.setState({enabled:!0})}disable(){this.setState({enabled:!1})}stateChangedCallback(e,i){if(this.hooks.hasListener("stateChange")){const s={state:this.state,prevState:e,userAction:i?i.userAction:bC.userAction};this.hooks.emit("stateChange",s)}}applyState(e){const i=e!=null?e:this.state;i.enabled!==!1&&i.visible!==!1?(this.labelItems.forEach(o=>{o.svelteApp=new mC({target:this.container,props:{props:o,onClick:()=>{this.onClick(o.name,o.position)}}})}),this.fixDoorPosition()):this.labelItems.forEach(o=>{o.svelteApp.$destroy()})}initState(){return{enabled:!0,visible:!0}}}const wC=n=>new yC(n);function ff(n,t){console.warn(`🚫 ==> [${n}]: ${t}`)}var cr={},CC=PC;function PC(n,t,e){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n}var IC=MC;function MC(n,t,e){return n[0]=t,n[1]=e,n}var EC=kC;function kC(n,t){var e=t[0],i=t[1],s=e*e+i*i;return s>0&&(s=1/Math.sqrt(s),n[0]=t[0]*s,n[1]=t[1]*s),n}var xC=DC;function DC(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n}var SC=LC;function LC(n,t){return n[0]*t[0]+n[1]*t[1]}var TC=CC,sl=IC,mf=EC,zC=xC,jC=SC,gf=[0,0];cr.computeMiter=function(t,e,i,s,o){return TC(t,i,s),mf(t,t),sl(e,-t[1],t[0]),sl(gf,-i[1],i[0]),o/jC(e,gf)},cr.normal=function(t,e){return sl(t,-e[1],e[0]),t},cr.direction=function(t,e,i){return zC(t,e,i),mf(t,t),t};var Ci=cr,cn=[0,0],hr=[0,0],pf=[0,0],_s=[0,0],OC=function(n,t){var e=null,i=[];t&&(n=n.slice(),n.push(n[0]));for(var s=n.length,o=1;o<s;o++){var r=n[o-1],a=n[o],l=o<n.length-1?n[o+1]:null;if(Ci.direction(cn,a,r),e||(e=[0,0],Ci.normal(e,cn)),o===1&&ol(i,e,1),!l)Ci.normal(e,cn),ol(i,e,1);else{Ci.direction(hr,l,a);var c=Ci.computeMiter(pf,_s,cn,hr,1);ol(i,_s,c)}}if(n.length>2&&t){var h=n[s-2],u=n[0],f=n[1];Ci.direction(cn,u,h),Ci.direction(hr,f,u),Ci.normal(e,cn);var m=Ci.computeMiter(pf,_s,cn,hr,1);i[0][0]=_s.slice(),i[s-1][0]=_s.slice(),i[0][1]=m,i[s-1][1]=m,i.pop()}return i};function ol(n,t,e){n.push([[t[0],t[1]],e])}function vf(n,t){const e=n[0],i=n[1],s=t[0],o=t[1];var r=(o.x-s.x)*(e.y-s.y)-(o.y-s.y)*(e.x-s.x),a=(i.x-e.x)*(e.y-s.y)-(i.y-e.y)*(e.x-s.x),l=(o.y-s.y)*(i.x-e.x)-(o.x-s.x)*(i.y-e.y);if(l!==0){var c=r/l,h=a/l;if(0<=c&&c<=1&&0<=h&&h<=1)return!0}return!1}function VC(n,t){for(let e=0;e<n.length-1;e++)for(let i=0;i<t.length-1;i++)if(vf([n[e],n[e+1]],[t[i],t[i+1]]))return{x:(n[e].x+n[e+1].x)/2,y:(n[e].y+n[e+1].y)/2,line1RelativeIndex:e,line2RelativeIndex:i}}const BC=2,_C=3,RC=3,FC=2;function NC(n){const t=n.width,e=n.unitLength,i=t/2,s=n.path;if(s.length===0)return{geometry:new b.BufferGeometry,maxV:0,curvePath:null,curvePoints:null,panoMap:{}};const o=new b.CurvePath;s.forEach(G=>{const X=GC(G);X&&o.add(X)});const r=Math.ceil(o.getLength()*100);o.arcLengthDivisions=r;const a=o.getPoints(r),l=a.length;if(l<=2)return{geometry:new b.BufferGeometry,maxV:0,curvePath:null,curvePoints:null};const c=OC(a.map(G=>[G.x,G.z])),u=(l-1)*BC*_C,f=2*l,m=f*RC,v=f*FC,p=new Uint32Array(u),g=new Float32Array(m),A=new Float32Array(v),w=o.getLength();let I=0,C=0,M={};const E=n.path[0].points.map(G=>new b.Vector3().fromArray(G)),S=n.path[0].panoIndexList?[...n.path[0].panoIndexList]:void 0,L=(()=>{const G=[];for(let q=0;q<E.length;q++){const le=E[q];if(q===0)G.push(0);else{const ae=E[q-1];G.push(le.distanceTo(ae)+G[q-1])}}const X=G[G.length-1],J=[];for(let q=0;q<G.length;q++){const le=G[q],ae=q===0?0:G[q-1],Ie=q===G.length-1?X:G[q+1],Ae=le-Math.min(.3,(le-ae)/2),pe=le+Math.min(.3,(Ie-le)/2);J.push([w*(Ae/X),w*(pe/X)])}return J})();let W=[];for(let G=0;G<l;G++){const[X,J]=c[G][0],q=a[G],{x:le,y:ae,z:Ie}=q,Ae=new Q.Vector3(le+X*i,ae+.05,Ie+J*i);g[G*6+0]=Ae.x,g[G*6+1]=Ae.y,g[G*6+2]=Ae.z;const pe=new Q.Vector3(le-X*i,ae+.05,Ie-J*i);g[G*6+3]=pe.x,g[G*6+4]=pe.y,g[G*6+5]=pe.z,I+=G>0?a[G-1].clone().sub(a[G]).length():0;const Fe=I/e;C=Fe,A[G*4+0]=0,A[G*4+1]=Fe,A[G*4+2]=1,A[G*4+3]=Fe;const we=new b.Vector3().lerpVectors(Ae,pe,.5);if(n.skipPositions&&n.skipPositions.some(be=>be.distanceTo(we)<.26))continue;const Ye=E[0];if(n.useAutoDepthTest&&Ye&&S){const ee=S[0],[be,je]=L[0];if(I>be&&I<je&&W.push({distance:Ye.distanceTo(we),index:G}),I>=je||G===l-1){const ve=Math.min(...W.map(Oe=>Oe.distance)),qe=W.find(Oe=>Oe.distance===ve);if(W=[],E.shift(),S.shift(),L.shift(),qe)M[ee]=qe.index;else{console.error(`can not find the min distance ${ee}`);continue}}}G!==l-1&&(p[G*6+0]=G*2+0,p[G*6+1]=G*2+2,p[G*6+2]=G*2+1,p[G*6+3]=G*2+2,p[G*6+4]=G*2+3,p[G*6+5]=G*2+1)}const R=[];let U;const j=[];for(let G=0;G<l-1;G++){if(U!==void 0&&G<=U)continue;const X=G+1,J={x:g[G*6+0],y:g[G*6+2]},q={x:g[G*6+3],y:g[G*6+5]},le={x:g[X*6+0],y:g[X*6+2]},ae={x:g[X*6+3],y:g[X*6+5]},Ie=vf([J,q],[le,ae]);if(Ie&&R.push(G),!Ie&&R.length){R.push(G);const Ae=new b.Vector2(J.x,J.y).distanceTo(new b.Vector2(le.x,le.y)),pe=new b.Vector2(q.x,q.y).distanceTo(new b.Vector2(ae.x,ae.y)),Fe=200,we=[],Ye=[],ee=Math.max(0,R[0]-e*Fe),be=R[0];for(let Oe=ee;Oe<be;Oe++)Ae<pe?we.push({x:g[Oe*6+0],y:g[Oe*6+2]}):we.push({x:g[Oe*6+3],y:g[Oe*6+5]});const je=R[R.length-1],ve=R[R.length-1]+e*Fe;for(let Oe=je;Oe<ve;Oe++)Ae<pe?Ye.push({x:g[Oe*6+0],y:g[Oe*6+2]}):Ye.push({x:g[Oe*6+3],y:g[Oe*6+5]});const qe=VC(we,Ye);if(qe){const{line1RelativeIndex:Oe,line2RelativeIndex:Le,x:st,y:ce}=qe,Pe=ee+Oe,Be=je+Le+2;for(let Me=Pe;Me<Be;Me++)Ae<pe?(g[Me*6+0]=st,g[Me*6+2]=ce):(g[Me*6+3]=st,g[Me*6+5]=ce),U=Me;let Ue,dt,tt,at,ze;Ae<pe?(Ue=g[ee*6+1],dt=g[Pe*6+1],tt=g[Be*6+1],at=g[ve*6+1],ze=(dt+tt)/2):(Ue=g[ee*6+4],dt=g[Pe*6+4],tt=g[Be*6+4],at=g[ve*6+4],ze=(dt+tt)/2);for(let Me=ee;Me<Pe;Me++){const Ke=Pe-ee,vt=(Me-ee)/Ke;Ae<pe?g[Me*6+1]=Ue+(ze-Ue)*vt:g[Me*6+4]=Ue+(ze-Ue)*vt}for(let Me=Pe;Me<Be;Me++)Ae<pe?g[Me*6+1]=ze:g[Me*6+4]=ze;for(let Me=Be;Me<ve;Me++){const Ke=ve-Be,vt=(Me-Be+1)/Ke;Ae<pe?g[Me*6+1]=ze+(at-ze)*vt:g[Me*6+4]=ze+(at-ze)*vt}j.push({start:Pe,end:Be})}R.length=0}}const Y=new Float32Array(f);j.forEach(G=>{for(let X=0;X<l-1;X++)X>=G.start&&X<=G.end?(Y[X*2+0]=1,Y[X*2+1]=1):Y[X]!==1&&(Y[X*2+0]=0,Y[X*2+1]=0)});const N=new b.BufferGeometry;return N.setAttribute("position",new b.BufferAttribute(g,3)),N.setAttribute("uv",new b.BufferAttribute(A,2)),N.setIndex(new b.BufferAttribute(p,1)),{geometry:N,maxV:C,animationWillError:j,curvePath:o,curvePoints:a,panoMap:M,totalLength:I}}function GC(n){if(QC(n)){const t=[n.closed,n.curve_type,n.tension],e=n.points.map(s=>new b.Vector3().fromArray(s));return new b.CatmullRomCurve3(e,...t)}}function QC(n){return n.type==="CatmullRomCurve3"}function WC(n,t){t.forEach(e=>{const i=new b.SphereGeometry(.02,16,16),s=[],o=[new b.MeshBasicMaterial({color:16776960}),new b.MeshBasicMaterial({color:16711935}),new b.MeshBasicMaterial({color:16711680}),new b.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=o[a],c=new b.Mesh(i,l);c.position.copy(pi(r)),s.push(c)});else{const r=o[0],a=new b.Mesh(i,r);a.position.copy(pi(e.position)),s.push(a)}s.forEach(r=>{r.material.depthTest=!1,n.scene.add(r)})})}const $e=n=>n;function Af(n){if(!n||n.length<3)return;const t=n.map(De),e=t[1].clone().sub(t[0]),i=t[2].clone().sub(t[1]);return e.cross(i)}function HC(n){return n.stickType==="Plane"}function UC(n){return n.stickType==="3DPoint"}function hn(n){return n.stickType==="Model"&&n.contentType==="MediaModel"}function YC(n){return n.stickType==="Model"&&n.contentType==="Model"}function XC(n){return n.stickType==="Plane"&&n.contentType==="MediaPlane"}function rl(n){const t=(()=>{if(hn(n)&&n.matrix){const e=new Q.Matrix4().fromArray(n.matrix);return n.data.mediaPosition.map(i=>De(i).clone().applyMatrix4(e))}else return n.position})();return Np(t)}function bf(n){const t=rl(n);return Ot(...Array.isArray(t)?t:[t])}function dr(n,t){if(n===void 0)return;const{min:e,max:i}=t!=null?t:{};if(!(e===void 0&&i===void 0))return!(typeof i=="number"&&i<n||typeof e=="number"&&e>n)}function ZC(n,t,e){const s=new b.Plane().setFromNormalAndCoplanarPoint(e,t),o=t.clone().sub(n).cross(new b.Vector3(0,1,0)).setLength(.01),r=new b.Vector3(0,.01,0);return[t.clone().sub(o).sub(r),t.clone().add(o).sub(r),t.clone().add(o).add(r),t.clone().sub(o).add(r)].map(l=>s.projectPoint(l,new b.Vector3))}const JC=(n,t=1e3/60)=>{let e=null;const i=n;return(...o)=>{e&&clearTimeout(e),e=setTimeout(()=>{i==null||i(...o),e&&clearTimeout(e),e=null},t)}};function qC(n,t=200){let e;return function(...i){e||(n.apply(this,i),e=setTimeout(function(){e=null},t))}}function KC(n,t){const[e,i]=t;if(e>=i||i<=1||e<=1)return-1;const s={},o=r=>(s[r]||(s[r]=n(r)),s[r]);for(let r=e;r<i;r++){const a=o(r),l=o(r-1);if(a<l)return r}return-1}function al(n){return n.stickType?n.stickType:n.pointType==="PointTag"&&n.dimensionType==="3D"?"3DPoint":n.pointType==="PlaneTag"?"Plane":"2DPoint"}function $C(n){var t,e,i,s;if(n.stickType||(n.stickType=al(n)),n.contentType==="VRLink"||n.contentType==="PanoLink"||n.contentType==="Link"){const o=n;!((e=(t=o.data)==null?void 0:t.icon)!=null&&e.url)&&!((s=(i=o.style)==null?void 0:i.point)!=null&&s.url)&&(o.data.icon={url:"//vr-static.realsee-cdn.cn/release/web/test.09dee741.png",steps:28})}return n.extraData&&(n.data?n.data.extraData=n.extraData:n.data={extraData:n.extraData}),n}const es="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAgAAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//uQxAACFEII9ACZ/sJZwWEoEb8w/////N//////JcxjHjf+7/v/H2PzCCFAiDtGeyBCIx7bJJ1mmEEMy6g8mm2c8nrGABB4h2Mkmn//4z/73u773R5qHHu/j/w7Kxkzh5lWRWdsifCkNAnY9Zc1HvDAhjhSHdFkHFzLmabt/AQxSg2wwzLhHIJOBnAWwVY4zrhIYhhc2kvhYDfQ4hDi2Gmh5KyFn8EcGIrHAngNgIwVIEMf5bzbAiTRoAD///8z/KVhkkWEle6IX+d/z4fvH3BShK1e5kmjkCMoxVmXhd4ROlTKo3iipasvTilY21q19ta30/v/0/idPX1v8PNxJL6ramnOVsdvMv2akO0iSYIzdJFirtzWXCZicS9vHqvSKyqm5XJBdqBwPxyfJdykhWTZ0G0ZyTZGpLKxsNwwoRhsx3tZfhwmeOBVISm3impAC/IT/8hP/EKEM1KMdVdVKM2rHV4x7HVXZvbVVKN/qq8CiV9VL9jjH/6l6qf7MBCjZmOqsAibjcP+qqqv0oxqpa/NVW286hPo1nz2L/h8+jXt//uSxCmDU2IK/ECN98KKtE5IYzNoCfbw+u9i5r8PoadUMFPKqWL4LK3T/LCraMSHGkW4bpLXR/E6LlHOVQxmslKVJ8IULktMN06N0FKCpHCoYsjC4F+Z0NVqdNFoGSTjSiyjzLdnZ2fNqTi2eHKONONKLMPMKLONKLMPQRJGlFxZRoKcJFAYEeIFiRQkUWUeYfef//Ko04soswso40UJAgMw8wosososy0EalnZyjQUGBRQGIFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsqFdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",Rs={};var ll=(n=>(n.Default="default",n.GetAudioDuration="getAudioDuration",n.PlayAudio="playAudio",n))(ll||{});function eP(n,t){const e=(t==null?void 0:t.namespace)||"default",i=Rs[e]||(Rs[e]=[]);let s=i.find(o=>!o.realSrc||o.realSrc===es);return s||(console.warn("未找到缓存音频,已新建",Rs),s=new yf(es),i.push(s)),n&&(s.src=n),s}function tP(n,t){const e=(t==null?void 0:t.namespace)||"default",i=Rs[e]||(Rs[e]=[]),s=n-i.length;if(!(s<=0))for(let o=0;o<s;o++)i.push(new yf(es))}class yf extends(()=>typeof Audio=="undefined"?class{}:Audio)(){constructor(e){super(e);d(this,"preload","auto");d(this,"crossOrigin","anonymous");d(this,"realSrc","");d(this,"inited",!1);d(this,"removeDocumentEventListener");this.realSrc=e!=null?e:"",this.muted=!0,super.autoplay=!0,super.addEventListener("ended",()=>{this.src=""});const i=()=>iP(this);document.addEventListener("click",i),document.addEventListener("touchend",i),this.removeDocumentEventListener=()=>{document.removeEventListener("click",i),document.removeEventListener("touchend",i)}}get isBlankAudio(){return this.realSrc===es||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e,this.removeDocumentEventListener()}get muted(){return super.muted}set muted(e){super.muted=e}clear(){this.currentTime=0,this.src=es}}function iP(n){n&&(n.inited||(n.src&&(n.inited=!0,n.removeDocumentEventListener()),n.src===es&&n.play()))}const nP={globalConfig:{visibleConfig:{followModelVisibility:!0},unfoldedConfig:{autoUnfold:{enable:!0,strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"[Mapview]":{unfoldedConfig:{autoUnfold:{enable:!1,distance:{max:9999}}}},"[Floorplan]":{unfoldedConfig:{autoUnfold:{enable:!1,distance:{max:9999}}}},"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"}},Link:{unfoldedConfig:{keep:"unfolded"}},Panorama:{unfoldedConfig:{keep:"unfolded"}},VRLink:{unfoldedConfig:{keep:"unfolded"}},PanoLink:{unfoldedConfig:{keep:"unfolded"}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},initialData:{autoplayConfig:{autoplayCarousel:!0,autoplayVideo:!1,autoplayVideoInCarousel:!1}}},"Model-Any":{unfoldedConfig:{keep:"unfolded"},visibleConfig:{visibleFiveMode:"all"}}}},sP=navigator.userAgent.toLowerCase().indexOf("iphone")!==-1;navigator.userAgent.toLowerCase().indexOf("android");const ur=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1,oP=sP&&ur;function rP(n){if(n.length!==4)return!1;const[t,e,i,s]=n,o=t.distanceTo(e),r=e.distanceTo(i),a=i.distanceTo(s),l=s.distanceTo(t),c=t.distanceTo(i),h=e.distanceTo(s);return o===a&&r===l&&c===h}class cl extends b.Mesh{constructor(e,i,s){if(e.length!==4)throw new Error("QuadrangleMesh: Invalid number of points, it's not a quadrangle");const[o,r,a,l]=e,c=Ot(...e),h=[o.clone().sub(c),r.clone().sub(c),a.clone().sub(c),l.clone().sub(c)],u=new wf(h,s);super(u,i);d(this,"name","QuadrangleMesh");this.position.copy(c)}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}}class wf extends b.BufferGeometry{constructor(e,i){super();d(this,"name","QuadrangleGeometry");d(this,"points");this.points=e;const s=i!=null?i:rP(e)?64:1;if(e.length!==4){console.error("Invalid number of points, it's not a quadrangle");return}const[o,r,a,l]=e,[c,h,u,f]=[new b.Vector2(0,0),new b.Vector2(1,0),new b.Vector2(1,1),new b.Vector2(0,1)],m=[],v=[];m.push(...o.toArray()),v.push(...c.toArray());for(let g=1;g<s;g++)m.push(o.x+(r.x-o.x)*g/s,o.y+(r.y-o.y)*g/s,o.z+(r.z-o.z)*g/s),v.push(c.x+(h.x-c.x)*g/s,c.y+(h.y-c.y)*g/s);m.push(...r.toArray()),v.push(...h.toArray()),m.push(...a.toArray()),v.push(...u.toArray());for(let g=1;g<s;g++)m.push(a.x+(l.x-a.x)*g/s,a.y+(l.y-a.y)*g/s,a.z+(l.z-a.z)*g/s),v.push(u.x+(f.x-u.x)*g/s,u.y+(f.y-u.y)*g/s);m.push(...l.toArray()),v.push(...f.toArray());const p=[];for(let g=0;g<s;g++)p.push(g,g+1,s*2-g,g,s*2-g,s*2+1-g);this.setAttribute("position",new b.BufferAttribute(new Float32Array(m),3)),this.setAttribute("uv",new b.BufferAttribute(new Float32Array(v),2)),this.setIndex(new b.BufferAttribute(new Uint32Array(p),1))}}function aP(n,t){let e=!ur;const i=t!=null?t:document.createElement("video");i.preload="metadata",i.crossOrigin="anonymous",i.muted=!0,i.loop=!0,i.playsInline=!0,i.autoplay=!0;const s=new b.VideoTexture(i);s.minFilter=b.LinearFilter,s.magFilter=b.LinearFilter,s.encoding=b.sRGBEncoding,s.metadataLoaded=!1,i.src=n;const o=()=>{s.metadataLoaded||(s.dispatchEvent({type:"videoLoaded"}),s.metadataLoaded=!0)};if(ur||(i.onloadedmetadata=()=>{o()}),ur){const r=()=>{if(!e){if(!i.paused){o();return}i.muted=!0,i.play().then(()=>{e=!0,i.pause(),i.currentTime=0,o()}).catch(()=>{console.warn("video auto play error")})}};document.addEventListener("click",r,{once:!0}),document.addEventListener("touchend",r,{once:!0})}return s}function Fs(n,t,e){if(n==="fill")return t;if(n==="contain"){const[i,s,o,r]=t,a=i.distanceTo(s),l=o.distanceTo(r),c=i.distanceTo(r),h=s.distanceTo(o),u=a,f=c,m=u/f;if(m>e){const p=f*e,g=new b.Vector3().subVectors(s,i).multiplyScalar((a-p)/2/a),A=new b.Vector3().subVectors(o,r).multiplyScalar((l-p)/2/l);return[i.clone().add(g),s.clone().sub(g),o.clone().sub(A),r.clone().add(A)]}else if(m<e){const p=u/e,g=new b.Vector3().subVectors(r,i).multiplyScalar((c-p)/2/c),A=new b.Vector3().subVectors(o,s).multiplyScalar((h-p)/2/h);return[i.clone().add(g),s.clone().add(A),o.clone().sub(A),r.clone().sub(g)]}else return t}else return console.warn(`objectFit: ${n} is not supported yet`),t}class lP extends b.ShaderMaterial{constructor(e){super();d(this,"transparent",!1);d(this,"blending",b.CustomBlending);d(this,"blendSrc",b.SrcAlphaFactor);d(this,"blendDst",b.OneMinusSrcAlphaFactor);d(this,"blendSrcAlpha",b.OneFactor);d(this,"blendDstAlpha",b.OneMinusSrcAlphaFactor);d(this,"vertexShader",`
810
810
  varying vec2 vUv;
811
811
  void main() {
812
812
  vUv = uv;
@@ -850,6 +850,8 @@ void main() {
850
850
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
851
851
  }
852
852
  `,SE=`
853
+ precision highp float;
854
+ precision mediump int;
853
855
  // 是否使用颜色
854
856
  uniform int useMapColor;
855
857
  // 贴图
@@ -953,13 +955,15 @@ void main() {
953
955
 
954
956
  void main() {
955
957
  float v = vUv.y;
956
- if (includeMinV != -1.0 && includeMaxV != -1.0) {
958
+ // 低版本 webgl 有精度问题,所以这里不能用 includeMinV != -1.0 && includeMaxV != -1.0
959
+ if (includeMinV > -0.9 && includeMaxV > -0.9) {
957
960
  if (v < includeMinV || v > includeMaxV) {
958
961
  gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
959
962
  return;
960
963
  }
961
964
  }
962
- if (excludeMinV != -1.0 && excludeMaxV != -1.0) {
965
+ // 同上
966
+ if (excludeMinV > -0.9 && excludeMaxV > -0.9) {
963
967
  if (v >= excludeMinV && v <= excludeMaxV) {
964
968
  gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
965
969
  return;
@@ -980,7 +984,7 @@ void main() {
980
984
  gl_FragColor.a = gl_FragColor.a * distanceOpacity();
981
985
  gl_FragColor.a = gl_FragColor.a * flicker;
982
986
  }
983
- `;class kl{constructor(t,e){d(this,"name","");d(this,"startTagContainer");d(this,"endTagContainer");d(this,"path",[]);d(this,"geometryStyle",{});d(this,"materialStyle",{});d(this,"meshStyle",{});d(this,"group",new b.Group);d(this,"meshWithDepthTest");d(this,"meshWithoutDepthTest");d(this,"visible",null);d(this,"five");d(this,"mode");d(this,"_curvePath",null);d(this,"_curvePoints",null);d(this,"_panoGroup",[]);d(this,"skippedPositions",null);d(this,"textureUrl","");d(this,"scale",1);d(this,"width",.5);d(this,"unitLength",.5);d(this,"_visibleFloorIndexes",null);d(this,"modeVisible",!1);d(this,"floorVisible",!0);d(this,"defaultVisible",!1);d(this,"inWalkAnimation",!1);d(this,"customVisible",null);d(this,"parent");d(this,"plugin");d(this,"textureHasLoaded",!1);d(this,"disposed",!1);d(this,"flowAnime",new Dn({progress:0}).to({progress:1}).duration(1500).repeat(1/0));d(this,"cacheLengths",[]);d(this,"heightOffset",0);d(this,"panoMap",{});d(this,"autoDepthTestEffectDistance");d(this,"dispose",()=>{var t,e;this.disposed||(this.disposed=!0,this.parent.hooks.off("show",this.updateVisible),this.parent.hooks.off("hide",this.updateVisible),this.plugin.hooks.off("show",this.updateVisible),this.plugin.hooks.off("hide",this.updateVisible),this.plugin.hooks.off("enable",this.updateVisible),this.plugin.hooks.off("disable",this.updateVisible),this.five.off("modeChange",this.onFiveModeChange),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("modelShownFloorChange",this.onFiveModelShownFloorChange),this.doHide(),(t=this.startTagContainer)==null||t.plugin.dispose(),(e=this.endTagContainer)==null||e.plugin.dispose())});d(this,"onWalkAnimationStart",()=>{this.inWalkAnimation=!0,this.updateVisible()});d(this,"onWalkAnimationEnd",()=>{this.inWalkAnimation=!1,this.updateVisible()});d(this,"onFiveModeChange",t=>{this.modeVisible=this.mode==="panorama"?Ji(t):Wt(t),this.updateVisible()});d(this,"onFivePanoArrived",t=>{var s,o,r,a,l,c;const e=(r=(o=(s=this.path)==null?void 0:s[0])==null?void 0:o.panoIndexMap)==null?void 0:r[t],i=this.panoMap[e!=null?e:t];if(i===void 0)this.group.children.includes(this.meshWithoutDepthTest)&&this.group.remove(this.meshWithoutDepthTest),this.meshWithDepthTest.material.uniforms.excludeMinV.value=-1,this.meshWithDepthTest.material.uniforms.excludeMaxV.value=-1;else{this.group.children.includes(this.meshWithoutDepthTest)||this.group.add(this.meshWithoutDepthTest),this.meshWithoutDepthTest.visible=!0;const h=this.meshWithDepthTest.geometry.getAttribute("uv"),u=100*((a=this.autoDepthTestEffectDistance)!=null?a:2),f=(l=h.getY((i-u)*2))!=null?l:0,m=(c=h.getY((i+u)*2))!=null?c:h.getY(h.count-1);this.meshWithDepthTest.material.uniforms.excludeMinV.value=f,this.meshWithDepthTest.material.uniforms.excludeMaxV.value=m,this.meshWithoutDepthTest.material.uniforms.includeMinV.value=f,this.meshWithoutDepthTest.material.uniforms.includeMaxV.value=m}this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0});d(this,"onFiveModelShownFloorChange",t=>{this.floorVisible=t===null||this.visibleFloorIndexes===null||this.visibleFloorIndexes.includes(t),this.updateVisible()});d(this,"updateVisible",()=>{const t=(()=>!this.parent.visible||!this.plugin.state.enabled||!this.plugin.state.visible?!1:this.customVisible!==null?this.customVisible:this.inWalkAnimation?!0:this.modeVisible&&this.defaultVisible&&this.floorVisible)();this.visible=t,t&&this.textureHasLoaded?this.doShow():this.doHide()});d(this,"onFlowAnimeUpdate",t=>{const{progress:e}=t;this.meshWithDepthTest.material.uniforms.vOffset.value=e,this.meshWithoutDepthTest.material.uniforms.vOffset.value=e,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0});d(this,"logError",t=>ff("GuideLineModeItem: ",t));var o,r;this.five=t,this.mode=e.mode,this.plugin=e.plugin,this.parent=e.parent,this.group.name="GuideLineModeItem";const i=new b.BufferGeometry,s=new b.ShaderMaterial({vertexShader:DE,fragmentShader:SE,transparent:!0,uniforms:{map:{value:null},useMapColor:{value:0},mapColor:{value:new b.Color},mapOpacity:{value:1},backgroundColor:{value:new b.Color},backgroundOpacity:{value:0},borderColor:{value:new b.Color},borderOpacity:{value:0},backgroundClip:{value:0},borderWidth:{value:.05},opacity:{value:1},flicker:{value:1},maxV:{value:0},vOffset:{value:0},includeMinV:{value:-1},includeMaxV:{value:-1},excludeMinV:{value:-1},excludeMaxV:{value:-1}}});this.meshWithDepthTest=new b.Mesh(i,s),this.meshWithoutDepthTest=new b.Mesh(i,s.clone()),this.meshWithoutDepthTest.material.depthTest=!1,this.meshWithDepthTest.name="GuideLineModeItemWithDepthTest",this.meshWithoutDepthTest.name="GuideLineModeItemWithoutDepthTest",this.group.add(this.meshWithDepthTest),this.mode==="panorama"&&(this.parent.hooks.on("walkStart",this.onWalkAnimationStart),this.parent.hooks.on("walkEnded",this.onWalkAnimationEnd),this.onFivePanoArrived(this.five.getCurrentState().panoIndex)),this.updateVisible(),this.onFiveModeChange(this.five.getCurrentState().mode),this.onFiveModelShownFloorChange((r=(o=this.five.model)==null?void 0:o.shownFloor)!=null?r:null),this.flowAnime.onUpdate(this.onFlowAnimeUpdate),this.parent.hooks.on("show",this.updateVisible),this.parent.hooks.on("hide",this.updateVisible),this.plugin.hooks.on("show",this.updateVisible),this.plugin.hooks.on("hide",this.updateVisible),this.plugin.hooks.on("enable",this.updateVisible),this.plugin.hooks.on("disable",this.updateVisible),this.plugin.hooks.on("dispose",this.dispose),this.five.on("modeChange",this.onFiveModeChange),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("modelShownFloorChange",this.onFiveModelShownFloorChange),this.five.needsRender=!0}get panoGroup(){return this._panoGroup}get visibleFloorIndexes(){return this._visibleFloorIndexes}get curvePath(){return this._curvePath}get curvePoints(){return this._curvePoints}setCustomVisible(t){if(this.disposed)return this.logError("disposed");this.customVisible!==t&&(this.customVisible=t,this.updateVisible())}setDefaultVisible(t){if(this.disposed)return this.logError("disposed");this.defaultVisible!==t&&(this.defaultVisible=t,this.updateVisible())}setUnitSize(t,e){if(this.disposed)return this.logError("disposed");this.width=t,this.unitLength=e,this.setGeometryByPath(this.path,{width:t,unit_length:e})}setScale(t){if(this.disposed)return this.logError("disposed");this.scale=t,this.setGeometryByPath(this.path,{scale:t})}setGeometryByPanoGroup(t,e){if(this.disposed)return this.logError("disposed");if(!this.five.work)return this.logError("setPathByPanoGroup: work is not ready");const i=xE(t);if(this._panoGroup=i,(e==null?void 0:e.skipPanoGroup)!==void 0){const o=e.skipPanoGroup?i.map(r=>this.plugin.workUtil.getObserverStandingPosition(r)).filter(ke):null;this.skippedPositions=o}const s=this.getPathFromPanoGroup(i,this.five.work,e);this.path=s,this.setGeometryByPath(s,e)}setGeometryByPath(t,e){var f,m,v,p;if(this.disposed)return this.logError("disposed");const i=(f=e==null?void 0:e.scale)!=null?f:this.scale,s=(m=e==null?void 0:e.width)!=null?m:this.width,o=(v=e==null?void 0:e.unit_length)!=null?v:this.unitLength;this.scale=i,this.width=s,this.unitLength=o;const{geometry:r,maxV:a,curvePath:l,curvePoints:c,panoMap:h,totalLength:u}=NC({path:t,width:s*i,unitLength:o*i,skipPositions:this.skippedPositions,useAutoDepthTest:e.useAutoDepthTest});this.autoDepthTestEffectDistance=(p=e.autoDepthTestEffectDistance)!=null?p:(()=>{const g=u/10;return g>3?3:g<1?1:g})(),this.panoMap=h,this._curvePath=l,this._curvePoints=c,this.meshWithDepthTest.geometry.copy(r),this.onFivePanoArrived(this.five.getCurrentState().panoIndex),this.meshWithDepthTest.material.needsUpdate=!0,this.meshWithDepthTest.material.uniforms.maxV.value=a,this.meshWithoutDepthTest.material.needsUpdate=!0,this.meshWithoutDepthTest.material.uniforms.maxV.value=a,this.five.needsRender=!0,this.path=t,this.geometryStyle=x(x({},this.geometryStyle),e)}setMartial(t){var i,s,o,r,a;if(this.disposed)return this.logError("disposed");this.setDefaultVisible((i=t==null?void 0:t.visible)!=null?i:!1),this.setColor((s=t==null?void 0:t.color)!=null?s:"#ffffff"),this.setOpacity((o=t==null?void 0:t.opacity)!=null?o:.5),this.setTextureUrl((a=(r=t==null?void 0:t.texture)==null?void 0:r.url)!=null?a:"https://vr-image-4.realsee-cdn.cn/release/web/arrow1.ebe7d0ff.png"),(t==null?void 0:t.background_color)!==void 0&&this.setBackgroundColor(t.background_color),(t==null?void 0:t.background_opacity)!==void 0&&this.setBackgroundOpacity(t.background_opacity),(t==null?void 0:t.border_color)!==void 0&&this.setBorderColor(t.border_color),(t==null?void 0:t.border_opacity)!==void 0&&this.setBorderOpacity(t.border_opacity),(t==null?void 0:t.border_width)!==void 0&&this.setBorderWidth(t.border_width),(t==null?void 0:t.background_clip)!==void 0&&this.setBackgroundClip(t.background_clip);const e=x(x({},this.materialStyle),t);this.materialStyle=e}setMeshStyle(t){if(t!=null&&t.translate){const s=new b.Vector3,o=new b.Vector3().fromArray(t.translate);o.y+=this.heightOffset,s.add(o),this.group.position.copy(s),i(this.startTagContainer,o),i(this.endTagContainer,o)}const e=x(x({},this.meshStyle),t);this.meshStyle=e;function i(s,o){if(!(s!=null&&s.tag))return;const r=new b.Vector3().fromArray(s.tag.position);r.add(o);const a=r.toArray();s.plugin.changeTagById(s.tag.id,{position:a})}}setHeightOffset(t){const e=new b.Vector3;this.meshStyle.translate&&e.add(new b.Vector3().fromArray(this.meshStyle.translate)),e.setY(e.y+t),this.group.position.copy(e),this.heightOffset=t,this.five.needsRender=!0}setColor(t){if(this.disposed)return this.logError("disposed");t&&(this.meshWithDepthTest.material.uniforms.mapColor.value=new b.Color().set(t),this.meshWithoutDepthTest.material.uniforms.mapColor.value=new b.Color().set(t)),this.meshWithDepthTest.material.uniforms.useMapColor.value=t?1:0,this.meshWithoutDepthTest.material.uniforms.useMapColor.value=t?1:0,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderColor(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.borderColor.value=new b.Color().set(t),this.meshWithoutDepthTest.material.uniforms.borderColor.value=new b.Color().set(t),this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderOpacity(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.borderOpacity.value=t,this.meshWithoutDepthTest.material.uniforms.borderOpacity.value=t,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundClip(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.backgroundClip.value=t==="border-box"?0:1,this.meshWithoutDepthTest.material.uniforms.backgroundClip.value=t==="border-box"?0:1,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderWidth(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.borderWidth.value=t,this.meshWithoutDepthTest.material.uniforms.borderWidth.value=t,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundColor(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.backgroundColor.value=new b.Color().set(t),this.meshWithoutDepthTest.material.uniforms.backgroundColor.value=new b.Color().set(t),this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundOpacity(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.backgroundOpacity.value=t,this.meshWithoutDepthTest.material.uniforms.backgroundOpacity.value=t,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setOpacity(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.opacity.value=t,this.meshWithoutDepthTest.material.uniforms.opacity.value=t,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setMapOpacity(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.mapOpacity.value=t,this.meshWithoutDepthTest.material.uniforms.mapOpacity.value=t,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setTextureUrl(t){if(this.disposed)return this.logError("disposed");this.textureUrl=t,en(t).then(e=>{this.disposed||this.textureUrl===t&&(e.wrapT=b.RepeatWrapping,this.textureHasLoaded=!0,this.meshWithDepthTest.material.uniforms.map.value=e,this.meshWithoutDepthTest.material.uniforms.map.value=e,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.meshWithDepthTest.material.needsUpdate=!0,this.meshWithoutDepthTest.material.needsUpdate=!0,this.five.needsRender=!0,this.updateVisible())})}setVisibleFloorIndexes(t){var e,i;if(this.disposed)return this.logError("disposed");this._visibleFloorIndexes=t,this.onFiveModelShownFloorChange((i=(e=this.five.model)==null?void 0:e.shownFloor)!=null?i:null)}setStartTag(t){this.setTag("start",t)}setEndTag(t){this.setTag("end",t)}flicker(){var t,e,i,s,o,r;if(this.disposed)return this.logError("disposed");To([this.group,(i=(e=(t=this.startTagContainer)==null?void 0:t.plugin)==null?void 0:e.tags[0])==null?void 0:i.dom,(r=(o=(s=this.endTagContainer)==null?void 0:s.plugin)==null?void 0:o.tags[0])==null?void 0:r.dom],{loop:6,updateRender:()=>{this.five.needsRender=!0}})}getLengthByPanoGroupIndex(t){return this.disposed?this.logError("disposed"):this.cacheLengths.length!==0?this.cacheLengths[t]:(this.cacheLengths=this.getPanoGroupLengths(),this.cacheLengths[t])}getPanoGroupLengths(){var l;if(!this.curvePoints||!this.curvePath)return[];const t=this.curvePoints.length,e=this.curvePath.getLength(),i=t-1,s=e/i,o=(l=this.curvePath.getLengths(i))!=null?l:[],r=[];let a=0;for(let c=0;c<t;c++){const h=this.curvePoints[c],u=this.plugin.workUtil.getObserverStandingPosition(a);if(!u)break;u.clone().setY(0).distanceTo(h.clone().setY(0))<s&&(r.push(o[c]),a+=1)}return r}setTag(t,e){var l,c;const i=this.curvePath;if(!(e!=null&&e.data))return;const s=t==="start"?(l=this.startTagContainer)!=null?l:(()=>(this.startTagContainer={tag:null,plugin:new wr(this.five,{containerZIndex:1})},this.startTagContainer))():(c=this.endTagContainer)!=null?c:(()=>(this.endTagContainer={tag:null,plugin:new wr(this.five,{containerZIndex:1})},this.endTagContainer))(),r=He({},{contentType:"Custom",stickType:"2DPoint",config:{visibleConfig:{visibleFiveMode:["Floorplan","Mapview"],followModelVisibility:!1}},style:{point:{enabled:!1}},data:{}},e);s.tag=r,LE(r)&&(s.tag.element=h=>{var m,v;(m=s.app)==null||m.$destroy();const u=t==="start"?ie(x({},r.data),{name:this.name,distance:Math.round((v=i.getLength())!=null?v:0),i18n:this.plugin.config.i18n}):r.data,f=new kE({target:h,intro:!0,props:u});return s.app=f,()=>f.$destroy()}),s.plugin.load({tagList:[s.tag]});const a=this.meshStyle.translate;if(a&&r.position){const h=new b.Vector3().fromArray(r.position),u=new b.Vector3().fromArray(a);h.add(u),h.y+=this.heightOffset;const f=h.toArray();s.plugin.changeTagById(s.tag.id,{position:f})}}doShow(){var t,e;this.mode==="model"&&!this.flowAnime.isPlaying()&&this.flowAnime.play(),this.five.scene.add(this.group),(t=this.startTagContainer)==null||t.plugin.show(),(e=this.endTagContainer)==null||e.plugin.show(),this.five.needsRender=!0}doHide(){var t,e;this.mode==="model"&&this.flowAnime.stop(),this.five.scene.remove(this.group),(t=this.startTagContainer)==null||t.plugin.hide(),(e=this.endTagContainer)==null||e.plugin.hide(),this.five.needsRender=!0}getPathFromPanoGroup(t,e,i){if(t.length<2)return[];const s={},o=t.map((l,c)=>{const h=this.plugin.workUtil.getObserverStandingPosition(l);if(!h)return;const u=t[c-1];if((c===0?999:h.distanceTo(this.plugin.workUtil.getObserverStandingPosition(u)))<.05){let m=u;for(;s[m]!==void 0;)m=s[m];s[l]=m;return}return{position:h,panoIndex:l}}).filter(ke),r=o.map(l=>l.position.toArray()),a=o.map(l=>l.panoIndex);return[ie(x({type:"CatmullRomCurve3",points:r},i),{panoIndexList:a,panoIndexMap:s})]}}function LE(n){return n.contentType==="Custom"}const TE=Object.freeze(Object.defineProperty({__proto__:null,GuideLineModeItem:kl},Symbol.toStringTag,{value:"Module"})),bg="CruisePlugin",xl=`${bg}`;class yg extends Ri{constructor(e,i){super(e,i);d(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1});d(this,"data");d(this,"config");d(this,"pauseDataMap",new Map);d(this,"privateState",{playing:!1,broke:!1,modeChanging:!1});d(this,"GuideLine");d(this,"disposedErrorLog",()=>{console.error(`${xl} is disposed`)});d(this,"disableWarnLog",()=>{console.warn(`${xl} is disabled`)});d(this,"disableErrorLog",()=>{console.error(`${xl} is disabled`)});this.config=i,Object.assign(window,{[`__${bg}_DEBUG__`]:this})}play(e){this.setState({playing:!0},e)}pause(e){this.setState({playing:!1},e)}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,i){var o;if(this.state.disposed)return this.disposedErrorLog();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return this.disableErrorLog();const s=x({},this.state);this.state=He({},this.state,e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,i==null?void 0:i.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,i==null?void 0:i.userAction),e.playing!==void 0&&e.playing!==s.playing&&this.changePlayState(e.playing,i),e.speed!==void 0&&e.speed!==s.speed&&this.changeSpeed(e.speed),wt(s,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(o=i==null?void 0:i.userAction)!=null?o:!0})}clearPauseData(){var e,i;if((e=this.data)!=null&&e.id)return this.pauseDataMap.delete((i=this.data)==null?void 0:i.id)}changePlayState(e,i){this.actionIfStateIsEnabled(()=>{var s;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(s=i==null?void 0:i.userAction)!=null?s:!0})}),e?this.handlePlay(i):this.handlePause(i),this.state.playing=e}handleEnable(e,i=!0){var s,o;e?((s=this.GuideLine)==null||s.enable(),this.hooks.emit("enable",{userAction:i})):((o=this.GuideLine)==null||o.disable(),this.changePlayState(!1,{userAction:i}),this.hooks.emit("disable",{userAction:i})),this.state.enabled=e}handleVisible(e,i=!0){var s,o;e?((s=this.GuideLine)==null||s.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:i}))):((o=this.GuideLine)==null||o.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:i}))),this.state.visible=e}addInterruptListener(e){const i=()=>{this.privateState.modeChanging||e()},s=o=>{o!=="mouseMove"&&(e(),this.five.off("gesture",s))};return this.five.on("gesture",s),this.five.once("wantsChangeMode",i),()=>{this.five.off("gesture",s),this.five.off("wantsChangeMode",i)}}getSpeededDuration(e){return e/this.state.speed}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e;if((e=this.data)!=null&&e.id)return this.pauseDataMap.get(this.data.id)}setPauseData(){var i;const e=(i=this.data)==null?void 0:i.id;if(e)return this.pauseDataMap.set(e,{fiveState:this.five.getCurrentState(),playedProgress:this.getProgress()})}clear(){this.clearPauseData()}handleDispose(){var e;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0}actionIfStateIsEnabled(e,i){if(this.state.enabled)return e();i!=null&&i.warnLog&&this.disableWarnLog()}}function Dl(n,t,e){var l,c,h;const i=new b.Vector3().fromArray([(l=e.x)!=null?l:0,(c=e.y)!=null?c:0,(h=e.z)!=null?h:0]),s=n.getPointAt(t).clone().add(i),o=n.getTangentAt(t),{longitude:r,latitude:a}=Ds(o);return{offset:s.clone(),longitude:r,latitude:a,distance:0}}let Sl=class extends yg{constructor(e,i){var r;super(e,i);d(this,"curve");d(this,"baseCurveOffset");d(this,"curveOffset");d(this,"playStartedTime",performance.now());d(this,"duration");d(this,"changeSpeed",(e,i=!0)=>{this.state.speed=e,this.hooks.emit("speedChange",e,{userAction:i})});d(this,"moveToStart",()=>{this.five.setState(ie(x({},Dl(this.curve,0,this.curveOffset)),{mode:"Model"}))});d(this,"playFromStart",()=>{this.clearPauseData(),this.setState({playing:!0})});d(this,"getDuration",()=>this.getSpeededDuration(this.duration));d(this,"getProgress",()=>{var l;const e=this.getPauseData();let i=(l=e==null?void 0:e.playedProgress)!=null?l:0;(i<0||i>=1)&&(i=0);const s=1-i,o=this.getDuration(),a=(performance.now()-this.playStartedTime)/o;return 1-s+a});const s={config:{speedConfig:{moveSpeed:2,moveSpeedUnit:"m/s"}}},o={allowBroke:!0};this.state=He({},s,this.state),this.config=He({},o,this.config),this.baseCurveOffset=He({x:0,y:0,z:0},{y:2},(r=this.config)==null?void 0:r.offset)}load(e,i){var a,l,c,h,u,f,m,v,p;this.handlePause(),this.clear(),this.data=x({id:ct()},e);const s=(()=>{if(this.data.path instanceof b.Curve)return this.data.path.curves[0];{if(this.data.path.length<2)return null;const g=this.data.path.map(De);return new b.CatmullRomCurve3(g,void 0,"catmullrom",.5)}})();if(!s)return;if(this.curve=s,this.curveOffset={x:this.baseCurveOffset.x+((l=(a=this.data.offset)==null?void 0:a.x)!=null?l:0),y:this.baseCurveOffset.y+((h=(c=this.data.offset)==null?void 0:c.y)!=null?h:0),z:this.baseCurveOffset.z+((f=(u=this.data.offset)==null?void 0:u.z)!=null?f:0)},!this.curve)throw new Error("curve is not defined");const o=this.curve.getLength(),r=this.state.config.speedConfig.moveSpeedUnit==="m/ms"?1:1e3;if(this.duration=o/(this.state.config.speedConfig.moveSpeed/r),Array.isArray(this.data.path)){const g=this.data.path.map(De).map(A=>A.toArray());!this.GuideLine&&(((m=this.config)==null?void 0:m.useGuideLine)!==!1&&e.useGuildLine||(v=this.config)!=null&&v.useGuideLine&&e.useGuildLine!==!1)&&(this.GuideLine=FE(this.five,this.config)),(p=this.GuideLine)==null||p.load({lines:[{id:ct(),path:[{type:"CatmullRomCurve3",points:g}],model_style:{visible:!0}}]})}return i?this.setState(i):(this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed)),Promise.resolve()}handlePlay(){return new Promise((e,i)=>H(this,null,function*(){var l;this.hooks.emit("play",{userAction:!0});const s=this.getPauseData();let o=(l=s==null?void 0:s.playedProgress)!=null?l:0;(o<0||o>=1)&&(o=0);const r=Dl(this.curve,o,this.curveOffset);if(this.hooks.emit("progressChange",o),this.five.setState(ie(x({},r),{mode:"Model"})),yield this.five.ready(),this.playStartedTime=performance.now(),this.config.allowBroke){const c=this.addInterruptListener(()=>{this.state.playing&&(this.hooks.emit("broke"),this.handlePause(),c(),i(new Error("broke")))})}const a=()=>{const c=this.getProgress();if(c>=1)this.five.off("renderFrame",a),this.setState({playing:!1},{userAction:!1}),this.hooks.emit("end"),this.hooks.emit("progressChange",1),e("end");else if(this.state.playing===!1)this.five.off("renderFrame",a);else if(c>=0){const h=Dl(this.curve,c,this.curveOffset);this.hooks.emit("progressChange",c),this.five.setState(h,!0)}};this.five.on("renderFrame",a)}))}handlePause(e){var i;this.state.playing=!1,this.hooks.emit("pause",{userAction:(i=e==null?void 0:e.userAction)!=null?i:!0}),this.setPauseData()}};function wg(n){const t=Math.abs(Math.cos(n.latitude));return new b.Vector3(-Math.sin(n.longitude)*t,-Math.sin(n.latitude),-Math.cos(n.longitude)*t)}function zE(n,t){const e=wg(n),i=wg(t);return e.angleTo(i)}const jE=n=>H(this,null,function*(){try{n().then(()=>{},()=>{}).catch(()=>{})}catch(t){}});function Cg(n){return new Promise(t=>{setTimeout(()=>{t()},n)})}function OE(n){return H(this,null,function*(){return new Promise(t=>{if(n.work){t();return}n.once("loaded",()=>t())})})}class Us extends yg{constructor(e,i){super(e,i);d(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});d(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,modeChanging:!1});this.config=i,Object.assign(window,{__WalkPlugin_DEBUG__:this})}load(e,i,s){return H(this,null,function*(){var h,u;this.clear();const o=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=x({id:r.keyframesId},r),this.hooks.emit("dataChange",r,o);let a=[],l;const c=this.data.keyframes.filter(f=>f.data.panoIndex!==void 0);c.filter((f,m)=>{var v;return f.data.panoIndex!==((v=c[m-1])==null?void 0:v.data.panoIndex)}).map(f=>f.data.panoIndex).forEach(f=>{var v,p;const m=(v=this.workUtil.getObserver(f))==null?void 0:v.floorIndex;if(m!==void 0)if(l===m){const g=a.length-1;a[g]=[...(p=a[g])!=null?p:[],f]}else{l=m;const g=a.length;a[g]=[f]}}),!this.GuideLine&&((h=this.config)==null?void 0:h.useGuideLine)!==!1&&r.useGuildLine!==!1&&(this.GuideLine=Tl(this.five,this.config)),(u=this.GuideLine)==null||u.load({routes:a.map(f=>({panoIndexList:f})),config:r.guildPluginOptions}),i?this.setState(i,{userAction:s}):(this.setState({playing:!1},{userAction:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing,{userAction:!1}),this.changeSpeed(this.state.speed)),this.clearPauseData(),console.debug("WORKPLUGIN loaded",r),this.hooks.emit("dataLoaded",r)})}playFrom(e){const{index:i,id:s,userAction:o}=e;this.state.playing&&this.setState({playing:!1},{userAction:o}),this.setState({playing:!0},{userAction:o,playFromIndex:i,playFromId:s})}playFromStart(e){return this.playFrom(ie(x({},e),{index:0}))}formatData(e){return H(this,null,function*(){this.five.work||(yield OE(this.five));const i=(()=>{const s=e;return typeof s=="object"&&s!==null&&ke(s.version)&&s.data?s.data:s})();if(i.keyframes)return{keyframesId:ct(),keyframes:i.keyframes.map((s,o)=>{var l;const r=i.keyframes[o+1],a=(()=>!r||r.start===void 0||s.end===void 0?0:r.start-s.end)();return ie(x({id:(l=s.uuid)!=null?l:ct(),moveIndex:o,stay:a,index:o},s),{guildPluginOptions:i.guildPluginOptions})})};if(i.panoIndexList){let s=[];const{moveEffect:o,moveToFirstPanoEffect:r,moveToFirstPanoDuration:a}=i;return this.privateState.moveToFirstPanoEffect=r,this.privateState.moveToFirstPanoDuration=a,i.panoIndexList.forEach((l,c)=>{const h=(()=>{var p,g;const u=i.panoIndexList.slice(c).find(A=>A!==l);if(u===void 0)return;const f=this.workUtil.getObserverPosition(l),m=this.workUtil.getObserverPosition(u);if(!m||!f||((p=this.workUtil.getObserver(l))==null?void 0:p.floorIndex)!==((g=this.workUtil.getObserver(u))==null?void 0:g.floorIndex))return;const v=new b.Vector3().subVectors(m,f);return Ds(v.normalize())})();i.moveType===void 0||i.moveType==="justMove"?s.push({moveIndex:c,stay:i.stay,data:x({effect:"Move",panoIndex:l,moveEffect:o},h!=null?h:{})}):i.moveType==="moveAndRotate"&&(s.push({moveIndex:c,stay:i.stay,data:{effect:"Move",panoIndex:l,moveEffect:o}}),h&&s.push({moveIndex:c,stay:i.stay,data:x({effect:"Rotate",panoIndex:l},h)}))}),{keyframesId:ct(),keyframes:s.map((l,c)=>x({id:ct(),index:c},l)),guildPluginOptions:i.guildPluginOptions,useGuildLine:i.useGuildLine}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handlePlay(e){return H(this,null,function*(){var m;const{data:i,state:s,privateState:o,hooks:r}=this;if(o.playing||!(i!=null&&i.keyframes)||(i==null?void 0:i.keyframes.length)===0)return;const a=ct();o.playId=a,o.playing=!0,o.broke=!1;const l=i.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(m=e==null?void 0:e.userAction)!=null?m:!0});let h=!1;const f=yield(()=>H(this,null,function*(){var v,p;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(v=this.data)==null?void 0:v.keyframes.findIndex(g=>g.id===e.playFromId);if(c!=null&&c.id){const g=(p=this.data)==null?void 0:p.keyframes.find(A=>A.id===c.id);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:o.moveToFirstPanoEffect,duration:o.moveToFirstPanoDuration})),g){if(g.data.effect==="Move")return g.index;if(g.data.effect==="Rotate"){const A=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(g,{duration:A}),h=!0,g.index+1}}}}))();this.clearPauseData();for(const v of l){if(o.broke||!s.playing||!o.playing||a!==o.playId)return;if(!(f!==void 0&&v.index<f))try{r.emit("playIndexChange",v.index,v),yield this.playKeyframe(v,{moveEffect:h===!1?o.moveToFirstPanoEffect:void 0,duration:h===!1&&typeof o.moveToFirstPanoDuration=="number"?o.moveToFirstPanoDuration:void 0}),v.stay&&(yield Cg(v.stay)),h===!1&&(h=!0)}catch(p){return Promise.resolve("broke")}}s.playing&&a===o.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:i,privateState:s,hooks:o}=this;i.playing=!1,s.playing!==!1&&(s.playing=!1,(e==null?void 0:e.userAction)!==!1&&this.setPauseData(),s.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&o.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}changeSpeed(e,i=!0){var l;const{state:s,privateState:o,hooks:r}=this,{currentPlayKeyframe:a}=o;if(r.emit("speedChange",e,{userAction:i}),s.playing&&a)try{const c=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,h=a.keyframe,{privateState:u}=this;((l=this.privateState.currentPlayKeyframe)==null?void 0:l.keyframe.id)!==h.id&&(this.privateState.currentPlayKeyframe={keyframe:h}),u.currentPlayQueue.push(this.getPlayPromise(h,{duration:c}))}catch(c){console.error(c)}}getProgress(){return this.five.controller.cameraMotion.progress}setPauseData(){var e,i,s;if((e=this.data)!=null&&e.id)return this.pauseDataMap.set(this.data.id,{id:(i=this.privateState.currentPlayKeyframe)==null?void 0:i.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}playKeyframe(e,i){return H(this,null,function*(){var o;const{privateState:s}=this;return((o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),s.currentPlayQueue.push(this.getPlayPromise(e,i)),this.actionPromiseQueue()})}getPlayPromise(s){return H(this,arguments,function*(e,i={}){var r;const o=e.data;if(i.duration=(r=i.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!o)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const h=()=>{a(),c=!0};switch(o.effect){case"Move":this.move(o,i).then(h);break;case"Rotate":this.rotate(o,i).then(h);break;default:this.rotate(o,i).then(h)}}catch(h){}})})}actionPromiseQueue(){return H(this,null,function*(){const{privateState:e}=this;return new Promise((i,s)=>{if(e.currentPlayQueue.length===0){i();return}const o=e.currentPlayQueue.shift();if(!o){i();return}o.then(i,s)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,i){return H(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,i);else return Promise.resolve()})}rotate(e,i){return H(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,i);yield this.updateCamera(e,i)})}updateCamera(s){return H(this,arguments,function*(e,i={}){const{five:o,privateState:r,state:a}=this,l=(()=>{var m,v;const u=(m=a.config)==null?void 0:m.speedConfig,f=(v=e.rotateSpeed)!=null?v:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return u.rotateSpeedUnit==="rad/ms"?f:f/1e3})(),c=(()=>{if(i.duration)return i.duration;if(l){const u=this.five.getCurrentState();return zE(u,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const h=this.getSpeededDuration(c);return new Promise(u=>{jE(()=>o.updateCamera(e,h)),setTimeout(()=>u(),h)})})}changePano(e,i){return H(this,null,function*(){const{five:s,privateState:o,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===s.panoIndex)return;const a=s.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var f,m;const h=(f=r.config)==null?void 0:f.speedConfig,u=(m=e.moveSpeed)!=null?m:h==null?void 0:h.moveSpeed;if((h==null?void 0:h.moveSpeedUnit)===void 0)return u;if(u!==void 0)return h.moveSpeedUnit==="m/ms"?u:u/1e3})(),c=(()=>{if(i!=null&&i.duration)return i.duration;if(l&&typeof s.panoIndex=="number"&&typeof e.panoIndex=="number"){const h=this.workUtil.getObserverPosition(s.panoIndex),u=this.workUtil.getObserverPosition(e.panoIndex);return h&&u?h.distanceTo(u)/l:800}return 800})();o.currentPlayKeyframe&&(o.currentPlayKeyframe.originDuration=c),yield new Promise(h=>{var f,m,v;const u=this.fiveUtil.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(v=(m=i==null?void 0:i.moveEffect)!=null?m:(f=this.state.config)==null?void 0:f.moveEffect)!=null?v:e.moveEffect,moveCancelCallback:()=>h(),moveEndCallback:()=>h()});u instanceof Promise&&u.then(()=>h()),a&&s.once("panoArrived",()=>h())}),a&&(this.privateState.modeChanging=!1)})}changeMode(e,i){return H(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,i),this.privateState.modeChanging=!1)})}}class Pg{constructor(t){d(this,"id");d(this,"renderID");d(this,"isGuideLine",!0);d(this,"panoramaItem");d(this,"modelItem");d(this,"hooks",new ht);d(this,"_visible",!0);d(this,"plugin");d(this,"five");d(this,"logError",t=>ff("GuideLineItem: ",t));this.id=t.id,this.five=t.five,this.plugin=t.plugin,this.panoramaItem=new kl(this.five,{mode:"panorama",plugin:this.plugin,parent:this}),this.modelItem=new kl(this.five,{mode:"model",plugin:this.plugin,parent:this})}get visible(){return this._visible}setData(t){this.setDataByMode("panorama",t),this.setDataByMode("model",t)}setDataByMode(t,e){var u;const i=t==="panorama"?this.panoramaItem:this.modelItem,s=t==="panorama"?e.panorama_style:e.model_style,o=t==="panorama"&&e.panorama_style.use_auto_depthtest,r=e.panorama_style.auto_depth_test_effect_distance,a=e.path,l=s,c=s,h=s;if(e.pano_group){const f=t==="panorama"&&e.panorama_style.skip_group===!0;i.setGeometryByPanoGroup(e.pano_group,ie(x({skipPanoGroup:f},l),{useAutoDepthTest:o,autoDepthTestEffectDistance:r}))}else e.path&&i.setGeometryByPath(a,ie(x({},l),{useAutoDepthTest:o,autoDepthTestEffectDistance:r}));i.name=e.name,i.setMeshStyle(h),i.setMartial(c),i.setVisibleFloorIndexes((u=e.visible_floor_indexes)!=null?u:null),i.setStartTag(s==null?void 0:s.start_tag),i.setEndTag(s==null?void 0:s.end_tag)}show(){this._visible=!0,this.hooks.emit("show",{userAction:!0})}hide(){this._visible=!1,this.hooks.emit("hide",{userAction:!0})}dispose(){this.panoramaItem.dispose(),this.modelItem.dispose()}walk(t){return H(this,null,function*(){if(this.hooks.emit("walkStart",{userAction:!0}),this.panoramaItem.panoGroup.length){const e=x({panoIndexList:this.panoramaItem.panoGroup},t),[i]=yield Ki(BE(this.five,e));if(i)return this.logError(i.message)}else{const e={path:this.panoramaItem.curvePath},[i]=yield Ki(VE(this.five,e));if(i)return this.logError(i.message)}this.hooks.emit("walkEnded",{userAction:!0})})}}function VE(n,t){return H(this,null,function*(){const e=new Sl(n);yield e.load(t),e.playFromStart()})}function BE(n,t){return H(this,null,function*(){if(t.panoIndexList.length===0)return;const e=n.getCurrentState();e.mode!=="Panorama"&&(yield Na(n,["Panorama",{longitude:e.longitude,latitude:0,panoIndex:t.panoIndexList[0]}]));const i=new Us(n);yield i.load(t),yield new Promise((s,o)=>{const r=n.getCurrentState();let a=t.panoIndexList.slice();r.panoIndex===a[0]&&c(r.panoIndex),i.playFromStart();function l(m){if(m!=="Panorama")return u(new Error("mode not match"))}function c(m){const v=a[0];if(a=a.slice(1),m!==v)return u(new Error("panoIndex not match, wanted: "+v+", got: "+m));if(a.length===0)return f()}function h(){n.off("modeChange",l),n.off("panoArrived",c)}function u(m){h(),o(m)}function f(){h(),s()}n.on("modeChange",l),n.on("panoArrived",c)})})}const _E=Object.freeze(Object.defineProperty({__proto__:null,GuideLineItem:Pg},Symbol.toStringTag,{value:"Module"})),Ll="GuideLinePlugin",Ig=`${Ll}`;let RE=class extends wi{constructor(e,i){super(e,i);d(this,"name",Ll);d(this,"cruisePlugin");d(this,"itemMap",new Map);d(this,"state",{visible:!1,enabled:!0});d(this,"data");d(this,"heightOffset",0);d(this,"_config");d(this,"_disposed",!1);d(this,"disposedErrorLog",()=>{console.error(`${Ig} is disposed`)});this._config=i!=null?i:{},this.cruisePlugin=new Us(e),Object.assign(window,{[`__${Ll}_DEBUG__`]:this})}get config(){return this._config}get disposed(){return this._disposed}load(e,i,s=!0){return H(this,null,function*(){var m,v,p,g,A,w,I,C;const o=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,o),this.data=r;const a=r.config,c={panorama_style:{visible:!!(!r.lines&&r.routes),unit_length:(m=a==null?void 0:a.unitHeight)!=null?m:.4,width:(v=a==null?void 0:a.unitWidth)!=null?v:.6,texture:{url:(p=a==null?void 0:a.arrowTextureUrl)!=null?p:this.staticPrefix+"/release/web/arrow-white.5c2c79a5.png"},use_auto_depthtest:(g=this.config.useAutoDepthTest)!=null?g:!1,auto_depth_test_effect_distance:this.config.autoDepthTestEffectDistance}},h=(w=(A=r.routes)==null?void 0:A.map(M=>{var E;return He({},c,{id:(E=M.id)!=null?E:ct(),pano_group:M.panoIndexList})}))!=null?w:[],u=(C=(I=r.lines)==null?void 0:I.map(M=>He({},c,M)))!=null?C:[],f=[...h,...u];yield ni(this.five),this.clear(),f.forEach(M=>{this.addGuideLineItem(M)}),this.updateTagsEnable(),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),i&&this.setState(i,{userAction:s}),this.hooks.emit("dataLoaded",r),console.debug(`${Ig} loaded`,r)})}formatData(e){return H(this,null,function*(){return this.getDataWithoutVersion(e)})}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.disposed||(this.clear(),this.hooks.emit("dispose"))}setState(e,i){var o;if(this.disposed)return this.disposedErrorLog();const s=x({},this.state);this.state=x(x({},this.state),e),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,i==null?void 0:i.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,i==null?void 0:i.userAction),wt(s,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(o=i==null?void 0:i.userAction)!=null?o:!0}),this.five.needsRender=!0)}addGuideLineItem(e){const i=e.render_id||e.id,s=this.itemMap.get(i);s&&this.removeGuideLineItem(s);const o=new Pg({five:this.five,id:i,plugin:this});return this.itemMap.set(i,o),e&&o.setData(e),this.heightOffset+=1e-4,o.modelItem.setHeightOffset(this.heightOffset),o.panoramaItem.setHeightOffset(this.heightOffset),o}getGuideLineItemByID(e){return this.itemMap.get(e)}removeGuideLineItem(e){this.itemMap.delete(e.id),e.panoramaItem.dispose(),e.modelItem.dispose()}updateTagsEnable(){const e=[];function i(r){return Array.isArray(r)&&r.every(a=>typeof a=="number")}function s(r,a){return new b.Vector3().fromArray(r).distanceTo(new b.Vector3().fromArray(a))<.01}function o(r){var l;const a=(l=r==null?void 0:r.tag)==null?void 0:l.position;return i(a)?e.every(c=>{var h;return i((h=c.tag)==null?void 0:h.position)?!s(a,c.tag.position):!0}):!1}this.itemMap.forEach(r=>{const a=r.modelItem.startTagContainer,l=r.modelItem.endTagContainer,c=o(a);c&&e.push(a),a==null||a.plugin.setState({enabled:c},{});const h=o(l);h&&e.push(l),l==null||l.plugin.setState({enabled:h},{})})}clear(){this.heightOffset=0,this.itemMap.forEach(e=>{this.removeGuideLineItem(e)})}handleEnable(e,i=!0){this.hooks.emit(e?"enable":"disable",{userAction:i})}handleVisible(e,i=!0){this.state.enabled&&this.hooks.emit(e?"show":"hide",{userAction:i})}getDataWithoutVersion(e){return typeof e=="object"&&e!==null&&e.data?e.data:e}};const Tl=(n,t)=>new RE(n,t),FE=Tl,NE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),GE=(n,t)=>new Us(n,t),QE=(n,t)=>new Sl(n,t);function zl(n,t,e){if(e){const s=new b.Vector3().subVectors(n.position,e).applyQuaternion(n.quaternion.clone().inverse()).applyQuaternion(t).add(e);n.position.copy(s)}n.quaternion.copy(t)}class Ys extends Rt{constructor(e,i){var s,o;super();d(this,"originObject3D");d(this,"onRender");d(this,"positionFrom");this.originObject3D=e,this.onRender=(s=i==null?void 0:i.onRender)!=null?s:()=>{},this.positionFrom=(o=i==null?void 0:i.positionFrom)!=null?o:"objectPosition"}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,i=[]){return e.intersectObject(this,!0,i)}initialPosition(e){var i,s;this.positionFrom==="objectPosition"?this.position.copy(this.originObject3D.position):this.positionFrom==="boundingBox"?this.position.copy((i=xn(this.originObject3D))==null?void 0:i.getCenter(new b.Vector3).applyMatrix4(this.originObject3D.matrixWorld)):this.positionFrom==="boundingSphere"?this.position.copy((s=Ch(this.originObject3D))==null?void 0:s.center.clone().applyMatrix4(this.originObject3D.matrixWorld)):this.positionFrom instanceof Q.Vector3?this.position.copy(this.positionFrom):this.positionFrom instanceof Function&&this.position.copy(this.positionFrom(this.originObject3D)),e&&this.position.add(e)}setScaleByCamera(e){}initQuaternion(e){if(this.quaternion.copy(this.originObject3D.quaternion),e&&(e.xAxis||e.yAxis||e.zAxis)){const i=e.xAxis instanceof Function?e.xAxis():e.xAxis,s=e.yAxis instanceof Function?e.yAxis():e.yAxis,o=e.zAxis instanceof Function?e.zAxis():e.zAxis;let r=i==null?void 0:i.clone(),a=s==null?void 0:s.clone(),l=o==null?void 0:o.clone();if(r&&!a&&!a){const c=new b.Quaternion().setFromUnitVectors(new b.Vector3(1,0,0),r.normalize());this.applyQuaternion(c)}if(a&&!r&&!l){const c=new b.Quaternion().setFromUnitVectors(new b.Vector3(0,1,0),a.normalize());this.applyQuaternion(c)}if(l&&!r&&!a){const c=new b.Quaternion().setFromUnitVectors(new b.Vector3(0,0,1),l.normalize());this.applyQuaternion(c)}if([r,a,l].filter(ke).length>=2){r||(r=new b.Vector3().crossVectors(a,l).normalize()),a||(a=new b.Vector3().crossVectors(r,l).normalize()),l||(l=new b.Vector3().crossVectors(r,a).normalize()),r.applyQuaternion(this.quaternion),a.applyQuaternion(this.quaternion),l.applyQuaternion(this.quaternion);const c=new b.Matrix4().makeBasis(r,a,l),h=new b.Quaternion().setFromRotationMatrix(c);this.quaternion.copy(h)}}}applyHelperScaleMatrix4(e,i){this.scale.applyMatrix4(e)}setHelperQuaternion(e,i){this.initQuaternion(),zl(this,this.quaternion.clone().premultiply(e),i)}applyHelperQuaternion(e,i){if(i){const s=new Q.Vector3().subVectors(this.position,i).applyQuaternion(e).add(i);this.position.copy(s)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class WE extends Ys{}class HE extends Ys{}class UE extends Ys{}class YE extends Ys{}class XE extends Ys{}class ZE extends b.Group{constructor(e){super();d(this,"direction");this.direction=e||"x"}}class Mg extends b.Mesh{constructor(e,i,s){super(e,i);d(this,"direction");this.direction=s||"x"}}function JE(n,t){const{offsetWidth:e,offsetHeight:i}=t,{top:s,left:o}=t.getBoundingClientRect();return Object.assign(new b.Vector2,{x:(n.x-o)/e*2-1,y:-(n.y-s)/i*2+1})}function Cr(n,t,e){if(!t||!e||!n)return;const i=JE(t,e);if(Math.abs(i.x)===1||Math.abs(i.y)===1)return;const s=new b.Raycaster;return s.setFromCamera(i,n),s.params.Points.threshold=.1,s}function qE(n,t){return!(Math.abs(n.x-t.x)>1e-5||Math.abs(n.y-t.y)>1e-5||Math.abs(n.z-t.z)>1e-5)}class jl extends ZE{constructor(e){var h;super(e.direction);d(this,"line");d(this,"arrow");d(this,"lineHeight",.4);d(this,"arrowHeight",.1);d(this,"renderOrder",50);d(this,"name","ArrowGroup");const i=new b.Color((h=e.color)!=null?h:16214315),s=new b.MeshBasicMaterial({color:i,depthTest:!1,depthWrite:!1,transparent:!0}),o=new b.ConeGeometry(.04,.1,32),r=new Mg(o,s.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new b.CylinderGeometry(a,a,.4,32),c=new Mg(l,s.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const Ol={X:15618642,Y:4765519,Z:4227839};class os{static get X(){return new b.Color(Ol.X).convertSRGBToLinear().clone()}static get Y(){return new b.Color(Ol.Y).convertSRGBToLinear().clone()}static get Z(){return new b.Color(Ol.Z).convertSRGBToLinear().clone()}}function Vl(n,t,e){const r=n.position.distanceTo(t),a=n.fov,l=n.distance||3,c=r/3,h=a/90,u=l/3,f=c*h*u,m=(e==null?void 0:e.min)||.6,v=e==null?void 0:e.max;return m&&f<m?m:v&&f>v?v:f}function KE(n,t,e){return n<t?t:n>e?e:n}function $E(n){let t=n.pose.latitude,e=n.pose.longitude;if(Dt(t)||Dt(e)){const i=n.matrix.elements;t=Math.asin(KE(i[9],-1,1)),Math.abs(i[9])<.9999999?e=fa(Math.atan2(i[8],i[10])):e=fa(Math.atan2(-i[2],i[0]))}return{latitude:t,longitude:e}}function ek(n){const{latitude:t,longitude:e}=n,i=new b.Vector3;return Eg-t<.03?i.set(0,1,0):Bl(0,e)?i.set(0,0,1):Bl(Math.PI,e)?i.set(0,0,-1):Bl(Eg,e)?i.set(1,0,0):i.set(-1,0,0),i}const Eg=Number((Math.PI/2).toFixed(5));function Bl(n,t){return typeof n!="number"||typeof t!="number"?!1:Math.abs(n-t)<.001}class tk extends WE{constructor(e,i){super(e,i);d(this,"name","MoveHelper");d(this,"xArrow");d(this,"yArrow");d(this,"zArrow");i.xArrowEnable!==!1&&(this.xArrow=new jl({direction:"x",color:os.X})),i.yArrowEnable!==!1&&(this.yArrow=new jl({direction:"y",color:os.Y})),i.zArrowEnable!==!1&&(this.zArrow=new jl({direction:"z",color:os.Z})),this.add(...[this.xArrow,this.yArrow,this.zArrow].filter(Boolean))}update(e){if(this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0,e.type==="OrthographicCamera"){const i=new b.Vector3(1,0,0).applyQuaternion(this.quaternion),s=new b.Vector3(0,1,0).applyQuaternion(this.quaternion),o=new b.Vector3(0,0,1).applyQuaternion(this.quaternion),r=$E(e),a=ek(r),l=.0872665;Math.abs(i.angleTo(a)-0)<l||Math.abs(i.angleTo(a)-Math.PI)<l?this.xArrow.visible=!1:Math.abs(s.angleTo(a)-0)<l||Math.abs(s.angleTo(a)-Math.PI)<l?this.yArrow.visible=!1:(Math.abs(o.angleTo(a)-0)<l||Math.abs(o.angleTo(a)-Math.PI)<l)&&(this.zArrow.visible=!1)}}show(){super.show(),this.xArrow&&this.add(this.xArrow),this.yArrow&&this.add(this.yArrow),this.zArrow&&this.add(this.zArrow)}setScaleByCamera(e){this.scale.setScalar(Vl(e,this.position))}showDraggingHelper(e){this.xArrow&&(e.includes("x")?this.add(this.xArrow):this.remove(this.xArrow)),this.yArrow&&(e.includes("y")?this.add(this.yArrow):this.remove(this.yArrow)),this.zArrow&&(e.includes("z")?this.add(this.zArrow):this.remove(this.zArrow))}dispose(){this.remove(...[this.xArrow,this.yArrow,this.zArrow].filter(Boolean)),super.dispose()}}function mn(n,t){return ik(document.createElement(t!=null?t:"div"),n)}function ik(n,t){if(!t)return n;for(const e in t)e&&t[e]&&(n.style[e]=t[e]);return n}function nk(n){const t=mn(x({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"99999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},n)),e=()=>{t.style.display!=="block"&&t.style.top&&t.style.left&&(t.style.display="block")};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(o,r)=>{t.style.left=o,t.style.top=r,e()}}}class sk extends UE{constructor(e,i){super(e,i);d(this,"name","RotateHelper");d(this,"xCircle");d(this,"yCircle");d(this,"zCircle");d(this,"children",[]);d(this,"angleTips");d(this,"container");(i==null?void 0:i.yzCircleEnable)!==!1&&(this.xCircle=new _l({direction:"x",color:os.X})),(i==null?void 0:i.xzCircleEnable)!==!1&&(this.yCircle=new _l({direction:"y",color:os.Y})),(i==null?void 0:i.xyCircleEnable)!==!1&&(this.zCircle=new _l({direction:"z",color:os.Z})),i!=null&&i.container&&(i==null?void 0:i.angleTipsEnable)!==!1&&(this.container=i==null?void 0:i.container,this.angleTips=nk({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(i=>i.showCircle()),(e=this.angleTips)==null||e.hide()}setScaleByCamera(e){this.scale.setScalar(Vl(e,this.position))}showDraggingHelper(e){var i;this.hide(),this.children.filter(s=>e.includes(s.direction)).forEach(s=>s.showRing()),(i=this.angleTips)==null||i.show()}dispose(){var e,i;this.removeFromParent(),(i=(e=this.angleTips)==null?void 0:e.element)==null||i.remove()}}class _l extends b.Group{constructor(e){super();d(this,"direction");d(this,"circle");d(this,"ring");d(this,"angleSector");this.direction=e.direction,this.circle=new ok(e),this.ring=new rk(e),this.angleSector=new ak(e),this.add(this.circle,this.ring,this.angleSector),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}showCircle(){this.add(this.circle),this.remove(this.ring,this.angleSector)}showRing(){this.add(this.ring,this.angleSector),this.remove(this.circle)}hide(){this.remove(this.ring,this.angleSector,this.circle)}}let ok=class extends b.Mesh{constructor(e){var i;super();d(this,"direction");d(this,"gapAngle",.02);d(this,"geometry",new b.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new b.MeshBasicMaterial({opacity:.6,color:(i=e.color)!=null?i:16777215,transparent:!0,side:b.DoubleSide,depthTest:!1,depthWrite:!1}),this.renderOrder=50,this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`}};class rk extends b.Group{constructor(e){super();d(this,"direction");this.direction=e.direction;const i=.015,s=new Array(8).fill(null).map((o,r)=>{const a=new b.RingGeometry(.25,.3,20,8,Math.PI/4*r+i,Math.PI/4-i*2),l=new b.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,depthWrite:!1,transparent:!0,side:b.DoubleSide});this.renderOrder=50;const c=new b.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...s)}}class ak extends b.Mesh{constructor(e){var s;super();d(this,"direction");d(this,"baseAxes");d(this,"angleDirection");switch(e.direction){case"x":this.baseAxes=new b.Vector3(0,0,1);break;case"y":this.baseAxes=new b.Vector3(1,0,0);break;case"z":this.baseAxes=new b.Vector3(1,0,0);break}const i=.3+5e-4;this.geometry=new b.CircleGeometry(i,48,0,1e-4),this.material=new b.MeshBasicMaterial({opacity:.4,color:(s=e.color)!=null?s:16777215,depthTest:!1,depthWrite:!1,transparent:!0,side:b.DoubleSide}),this.renderOrder=50,this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function lk(){const n=mn({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=mn({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=mn({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});n.appendChild(t),t.appendChild(e);const i="-4px",s={direction:"nesw",element:Gi({cursor:"nesw-resize",left:i,bottom:i})},o={direction:"ns",element:Gi({cursor:"ns-resize",bottom:i})},r={direction:"nwse",element:Gi({cursor:"nwse-resize",right:i,bottom:i})},a={direction:"ew",element:Gi({cursor:"ew-resize",right:i})},l={direction:"nesw",element:Gi({cursor:"nesw-resize",right:i,top:i})},c={direction:"ns",element:Gi({cursor:"ns-resize",top:i})},h={direction:"nwse",element:Gi({cursor:"nwse-resize",left:i,top:i})},u={direction:"ew",element:Gi({cursor:"ew-resize",left:i})};return new Array(o,a,c,u,s,r,l,h).forEach(m=>t.appendChild(m.element)),{container:n,squares:[s,o,r,a,l,c,h,u]}}function Gi(n){const t=mn(x({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},n)),e=mn({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),i=mn({width:"15px",height:"15px",cursor:n==null?void 0:n.cursor,pointerEvents:"auto",background:"transparent"});return i.draggable=!0,e.appendChild(i),t.appendChild(e),t}class ck extends XE{constructor(e,i,s,o){super(e);d(this,"name","CSS3DScaleHelper");d(this,"points",[]);d(this,"cornerPositions",[]);d(this,"css3DInstance");d(this,"plane");d(this,"css3DRenderer",new jn);d(this,"camera");d(this,"scene");d(this,"container");d(this,"enabled",!1);this.camera=s,this.scene=o,this.container=i,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyMatrix4(e){var i;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(i=this.plane)==null||i.applyMatrix4(e),this.cornerPositions.forEach(s=>s.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,i){var s;(s=this.plane)==null||s.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((i,s)=>{i.position.copy(e[s])})}applyHelperQuaternion(e,i){var o;const s=(o=this.css3DInstance)==null?void 0:o.css3DObject;if(s){const r=new b.Vector3().subVectors(s.position,i).applyQuaternion(e).add(i);s.position.copy(r),s.applyQuaternion(e)}if(this.plane){const r=new b.Vector3().subVectors(this.plane.position,i).applyQuaternion(e).add(i);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new b.Vector3().subVectors(r,i).applyQuaternion(e).add(i);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;this.enabled&&(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a,l;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const i=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!i)return;this.css3DInstance=i,i.appendToElement(this.container);const s=i.css3DObject.container,{container:o,squares:r}=lk();this.points=r.map((c,h)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[h]})),s.insertBefore(o,(a=s.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("当前物体暂时不支持 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}class hk extends HE{constructor(e){super(e);d(this,"name","BoundingBoxHelper");d(this,"box");d(this,"outline");d(this,"positionAttribute");this.positionAttribute=new b.BufferAttribute(new Float32Array(8*3),3),this.box=this.createBox(),this.outline=this.createOutline(),this.add(this.box,this.outline),this.update()}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}setHelperQuaternion(e,i){zl(this,e,i)}raycasterIntersectObject(e,i){return e.intersectObject(this,!1,i)}raycast(e,i){this.box.raycast(e,i)}update(){const e=xn(this.originObject3D);if(!e)return;const{min:i,max:s}=e;this.positionAttribute.setXYZ(0,s.x,s.y,s.z),this.positionAttribute.setXYZ(1,i.x,s.y,s.z),this.positionAttribute.setXYZ(2,i.x,i.y,s.z),this.positionAttribute.setXYZ(3,s.x,i.y,s.z),this.positionAttribute.setXYZ(4,s.x,s.y,i.z),this.positionAttribute.setXYZ(5,i.x,s.y,i.z),this.positionAttribute.setXYZ(6,i.x,i.y,i.z),this.positionAttribute.setXYZ(7,s.x,i.y,i.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new b.BufferGeometry;i.setIndex(new b.BufferAttribute(e,1)),i.setAttribute("position",this.positionAttribute);const s=new b.LineBasicMaterial({color:64767,linewidth:1,opacity:1,toneMapped:!1}),o=new b.LineSegments(i,s);return o.matrixAutoUpdate=!1,o}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),i=new b.BufferGeometry;i.setIndex(new b.BufferAttribute(e,1)),i.setAttribute("position",this.positionAttribute);const s=new b.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new b.Mesh(i,s)}}const Pr=new Map;function dk(n){if(Pr.has(n))return Pr.get(n).hooks;const t=new ht;let e=null,i;const s=()=>{e=requestAnimationFrame(s);const r=n.projectionMatrix.toArray().join(",")+n.matrixWorld.toArray().join(",");r!==i&&(i=r,t.emit("cameraUpdate"))};s();const o=()=>{Pr.delete(n),cancelAnimationFrame(e)};return Pr.set(n,{hooks:t,dispose:o}),t}class Xs{constructor(t,e){d(this,"originObject3D");d(this,"hooks");d(this,"preventTapDefaultEvent",!1);d(this,"internalHooks");d(this,"disposers",[]);d(this,"helperObject3D");d(this,"camera");d(this,"model");d(this,"scene");d(this,"container");d(this,"domEvents");d(this,"isDragging",!1);d(this,"enabled",!1);d(this,"name","BaseController");d(this,"boundingBox");d(this,"config");d(this,"onRender");d(this,"cameraHooks");d(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});d(this,"updateHelperScale",()=>{this.helperObject3D.setScaleByCamera(this.camera)});d(this,"getBox",()=>this.boundingBox?this.boundingBox:(this.boundingBox=xn(this.originObject3D),this.boundingBox));var h,u,f;this.hooks=(h=t.sharedHooks)!=null?h:new ht,this.internalHooks=(u=t.sharedInternalHooks)!=null?u:new ht,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=t.domEvents,this.onRender=(f=t.onRender)!=null?f:()=>{},this.config=e!=null?e:{},this.initialHelperPosition(),this.initialHelperQuaternion(),this.updateHelperScale(),this.cameraHooks=dk(this.camera),this.enable();const i=this.onSetOriginObjectScale.bind(this),s=this.onSetOriginObjectRotate.bind(this),o=this.onSetOriginObjectPosition.bind(this),r=this.onApplyOriginObjectScale.bind(this),a=this.onApplyOriginObjectRotate.bind(this),l=this.onApplyOriginObjectPosition.bind(this),c=this.initialHelperPosition.bind(this);this.cameraHooks.on("cameraUpdate",this.updateHelperScale),this.internalHooks.on("initialHelperPosition",c),this.internalHooks.on("setObjectScale",i),this.internalHooks.on("setObjectRotate",s),this.internalHooks.on("setObjectPosition",o),this.internalHooks.on("applyObjectPosition",l),this.internalHooks.on("applyObjectRotate",a),this.internalHooks.on("applyObjectScale",r),this.hooks.on("moveEnd",this.updateHelperScale),this.internalHooks.on("setObjectPosition",this.updateHelperScale),this.internalHooks.on("initialHelperPosition",this.updateHelperScale),this.disposers.push(()=>{this.cameraHooks.off("cameraUpdate",this.updateHelperScale),this.internalHooks.off("initialHelperPosition",c),this.internalHooks.off("setObjectScale",i),this.internalHooks.off("setObjectRotate",s),this.internalHooks.off("setObjectPosition",o),this.internalHooks.off("applyObjectPosition",l),this.internalHooks.off("applyObjectRotate",a),this.internalHooks.off("applyObjectScale",r),this.hooks.off("moveEnd",this.updateHelperScale),this.internalHooks.off("setObjectPosition",this.updateHelperScale),this.internalHooks.off("initialHelperPosition",this.updateHelperScale)})}initialHelperPosition(){this.helperObject3D.initialPosition(this.calculateOffset(this.config.offset))}initialHelperQuaternion(){this.helperObject3D.initQuaternion(this.config)}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){this.enabled&&(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,i){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.config.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.config.offset){const e=this.originObject3D.position,i=new b.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),s=new b.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),o=this.calculateOffset(this.config.offset,{min:s,max:i});this.helperObject3D.initialPosition(o)}}hoverListener(t,e=16777215,i=1){const s=Ai(t).filter(ke),o=[];for(const r of s)if(r.material||r instanceof b.Group){const a=r instanceof b.Group?r.children.filter(f=>f instanceof b.Mesh):[r];a.forEach(f=>{var m,v;f.__originalColor__=(m=f.__originalColor__)!=null?m:f.material.color.clone(),f.__originalOpacity__=(v=f.__originalOpacity__)!=null?v:f.material.opacity});const l=()=>{a.forEach(f=>{f.material.color.set(e),f.material.opacity=i}),this.render()},c=()=>{a.forEach(f=>{f.material.color.copy(f.__originalColor__),f.material.opacity=f.__originalOpacity__}),this.render()},h=()=>{this.isDragging||l()},u=()=>{this.isDragging||c()};for(const f of a)this.domEvents.addEventListener(f,"mouseover",h),this.domEvents.addEventListener(f,"mouseout",u),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),this.hooks.on("scaleEnd",c),o.push(()=>{this.domEvents.removeEventListener(f,"mouseover",h),this.domEvents.removeEventListener(f,"mouseout",u),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c),this.hooks.off("scaleEnd",c)})}return()=>o.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,i=this.helperObject3D;if(!i)return;const s=this.helperObject3D.raycasterIntersectObject(t)[0];if(!s)return;const o=s;if(o.object=i,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<o.point.distanceTo(e))return}return o.object}calculateOffset(t,e){const i=new b.Vector3(0,0,0);if(!t)return i;const s=()=>e||this.getBox();if(typeof t.x=="number")i.setX(t.x);else if(typeof t.x=="object"){const o=s();i.setX((o.max.x-o.min.x)*t.x.percents)}if(typeof t.y=="number")i.setY(t.y);else if(typeof t.y=="object"){const o=s();i.setY((o.max.y-o.min.y)*t.y.percents)}if(typeof t.z=="number")i.setZ(t.z);else if(typeof t.z=="object"){const o=s();i.setZ((o.max.z-o.min.z)*t.z.percents)}return i}}const uk=new b.Vector3;function gn(n){const{raycaster:t,line:e,clampToLine:i=!0}=n,s=new b.Plane().setFromNormalAndCoplanarPoint(t.ray.direction.clone().normalize(),new b.Vector3),o=s.projectPoint(e.start,new b.Vector3),r=s.projectPoint(e.end,new b.Vector3),a=new b.Line3(o,r),l=a.closestPointToPoint(t.ray.origin,i,uk),c=l.distanceTo(r),h=l.distanceTo(o),u=a.distance();if(c>h&&c>u){const f=-l.distanceTo(o)/u,m=e.start.clone().sub(e.end).normalize();return e.start.clone().sub(m.clone().multiplyScalar(f*e.distance()))}else{const f=l.distanceTo(o)/u;return new b.Vector3().lerpVectors(e.start,e.end,f)}}class fk extends Xs{constructor(...e){super(...e);d(this,"name","MoveController");d(this,"startInfo");d(this,"_moveByMouse",{enabled:!1});d(this,"mouseInfo");d(this,"mousedownEventListenerDisposer");d(this,"dragStart",e=>{if(this.moveByMouseEnable||this.isDragging)return;const i=e==null?void 0:e.intersect;if(!i)return this.dragEnd();const s=(i==null?void 0:i.object).direction;if(!s)return this.dragEnd();const o=new b.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new b.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new b.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(s){case"x":return o;case"y":return r;case"z":return a}})(),c=i.point.clone(),h=new b.Line3(c.clone().sub(l.normalize()),c.clone().add(l.normalize()));this.startInfo={startVectorProject:c,line:h},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("moveStart"),this.isDragging=!0});d(this,"dragging",e=>{if(!this.isDragging||!this.startInfo)return;const i="touches"in e?e.touches[0].clientX:e.x,s="touches"in e?e.touches[0].clientY:e.y,o=Cr(this.camera,{x:i,y:s},this.container);return o?(this.move(o),!1):this.dragEnd()});d(this,"dragEnd",()=>{this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))});const i=this.helperObject3D;this.hoverListener([i.xArrow,i.yArrow,i.zArrow]);const s=this.show.bind(this),o=this.hide.bind(this),r=()=>{this.helperObject3D.update(this.camera),this.render()};r(),this.domEvents.addEventListener(this.helperObject3D,"mousedown",this.dragStart),document.addEventListener("mousemove",this.dragging),document.addEventListener("mouseup",this.dragEnd),this.domEvents.addEventListener(this.helperObject3D,"touchstart",this.dragStart),document.addEventListener("touchmove",this.dragging),document.addEventListener("touchend",this.dragEnd),this.hooks.on("rotateStart",o),this.hooks.on("rotateEnd",s),this.hooks.on("scaleStart",o),this.hooks.on("scaleEnd",s),this.hooks.on("moveByMouseEnable",o),this.hooks.on("moveByMouseDisable",s),this.cameraHooks.on("cameraUpdate",r),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",this.dragStart),document.removeEventListener("mousemove",this.dragging),document.removeEventListener("mouseup",this.dragEnd),this.domEvents.removeEventListener(this.helperObject3D,"touchstart",this.dragStart),document.removeEventListener("touchmove",this.dragging),document.removeEventListener("touchend",this.dragEnd),this.hooks.off("rotateStart",o),this.hooks.off("rotateEnd",s),this.hooks.off("scaleStart",o),this.hooks.off("scaleEnd",s),this.hooks.off("moveByMouseEnable",o),this.hooks.off("moveByMouseDisable",s),this.cameraHooks.off("cameraUpdate",r)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouse.enabled}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(i=>i==null?void 0:i())}moveByMouse(e){this._moveByMouse={enabled:!0,useFaceNormal:e==null?void 0:e.useFaceNormal},this.preventTapDefaultEvent=!0;const i=this.handleMouseDown.bind(this),s=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",i),this.container.addEventListener("mouseup",s)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",i),this.container.removeEventListener("mouseup",s)}}disableMoveByMouse(){var e;this._moveByMouse={enabled:!1},this.preventTapDefaultEvent=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){var r,a,l;if(!this.moveByMouseEnable)return;const{point:i,face:s}=e;if(!this.hooks.emit("wantToMove",i)){if(this.originObject3D.position.copy(i),(this._moveByMouse.useFaceNormal===!0||typeof this._moveByMouse.useFaceNormal=="object"&&this._moveByMouse.useFaceNormal.enable!==!1)&&s!=null&&s.normal){const c=(()=>typeof this._moveByMouse.useFaceNormal=="object"&&this._moveByMouse.useFaceNormal.alignmentVector?this._moveByMouse.useFaceNormal.alignmentVector:{x:0,y:1,z:0})(),h=new b.Vector3((r=c.x)!=null?r:0,(a=c.y)!=null?a:0,(l=c.z)!=null?l:0),u=(()=>typeof this._moveByMouse.useFaceNormal=="object"&&this._moveByMouse.useFaceNormal.fixedFaceNormal?this._moveByMouse.useFaceNormal.fixedFaceNormal(s.normal):s.normal)();this.originObject3D.quaternion.setFromUnitVectors(h,u),this.internalHooks.emit("setObjectRotate",this.originObject3D.quaternion.clone())}this.internalHooks.emit("setObjectPosition",i),this.hooks.emit("move",i)}}handleMouseDown(e){const{x:i,y:s}=e;this.mouseInfo={x:i,y:s,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:i,y:s}=e;this.mouseInfo.x===i&&this.mouseInfo.y===s&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}move(e){if(!this.startInfo)return this.dragEnd();const{line:i,startVectorProject:s}=this.startInfo,o=this.originObject3D,r=gn({raycaster:e,line:i,clampToLine:!1}),a=r.clone().sub(s),l=new b.Matrix4;l.setPosition(a);const c=o.position.clone().applyMatrix4(l);this.hooks.emit("wantToMove",c)||(o.applyMatrix4(l),s.copy(r),this.internalHooks.emit("applyObjectPosition",{matrix:l}),this.hooks.emit("move",c))}}class Zs{constructor(t,e,i,s,o,r,a,l){d(this,"helperController");d(this,"five");d(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;if(this.helperController.preventTapDefaultEvent)return!1;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});d(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});d(this,"onFiveIntersectionOnModelUpdate",(...t)=>{this.helperController&&this.helperController.onIntersectionOnModelUpdate(...t)});const{camera:c,model:h,scene:u}=t,f=t.getElement();if(this.five=t,!c||!h||!f||!u)return;const m=()=>{t.needsRender=!0};this.helperController=new i({camera:c,model:h,domEvents:e,originObject3D:s,helperObject3D:o,container:f,scene:u,onRender:m,sharedHooks:a,sharedInternalHooks:l},r),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const Rl="Object3DHelper@v1.0.1",mk=()=>{console.error(`${Rl} is disposed`)},gk=()=>{console.warn(`${Rl} is disabled`)},pk=()=>{console.error(`${Rl} is disabled`)};class vk{constructor(t){d(this,"controllers",{});d(this,"state",{visible:!0,enabled:!0,disposed:!1});d(this,"hooks",new ht);d(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return H(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return H(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return mk();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return pk();const i=x({},this.state);this.state=x(x({},this.state),t),t.disposed!==void 0&&t.disposed!==i.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:i})}addControllers(t){this.controllers=x(x({},this.controllers),t),this.setState(this.state)}initialHelperMatrix(){this.everyControllerDo(t=>{t.initialHelperPosition(),t.initialHelperQuaternion()})}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(i=>{i.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(i=>{i.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(i=>{i.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(i=>{i.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(i=>{i==null||i.dispose()});for(const i in this.controllers){if(!i)continue;const s=i;(e=(t=this.eventListener)[s])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&gk()}}function Fl(n){return n*Math.PI/180}let Nl=new b.Quaternion;class Ak extends Xs{constructor(...e){var c,h,u;super(...e);d(this,"name","RotateController");d(this,"startInfo");d(this,"removeListener");const i=this.helperObject3D;this.hoverListener([(c=i.xCircle)==null?void 0:c.circle,(h=i.yCircle)==null?void 0:h.circle,(u=i.zCircle)==null?void 0:u.circle].filter(Boolean));const s=this.dragStart.bind(this),o=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),this.domEvents.addEventListener(this.helperObject3D,"touchstart",s),document.addEventListener("touchmove",o),document.addEventListener("touchend",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("scaleStart",l),this.hooks.on("scaleEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",s),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),this.domEvents.removeEventListener(this.helperObject3D,"touchstart",s),document.removeEventListener("touchmove",o),document.removeEventListener("touchend",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("scaleStart",l),this.hooks.off("scaleEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)})}get rotateCenter(){return this.helperObject3D.position.clone()}setRotateAngle(e){const{x:i=0,y:s=0,z:o=0}=e,r=new b.Euler(Fl(i),Fl(s),Fl(o)),a=new b.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:h}=this;zl(c,a,h),this.internalHooks.emit("setObjectRotate",a,h),this.hooks.emit("rotate",a),this.render()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const i=e==null?void 0:e.intersect;if(!i)return this.dragEnd();const s=(i==null?void 0:i.object).direction;if(!s)return this.dragEnd();const o=i.point,r=this.getAngleHelper(s);this.setTipsAngle(0);const a=o.clone();a.y+=.2,this.setTipsPosition(a);const l=this.helperObject3D.quaternion.clone(),c=(()=>{if(s==="x")return new b.Vector3(1,0,0).applyQuaternion(l);if(s==="y")return new b.Vector3(0,1,0).applyQuaternion(l);if(s==="z")return new b.Vector3(0,0,1).applyQuaternion(l)})(),h=new b.Plane().setFromNormalAndCoplanarPoint(c,o),f=h.projectPoint(o.clone(),new b.Vector3).clone().sub(this.rotateCenter),m=f.angleTo(r.baseAxes.clone().applyQuaternion(l));this.setAngleHelperStart(s,m),this.setAngleHelperLength(s,0),this.startInfo={direction:s,startVector:f,plane:h,angleHelper:r,angle:0,helperQuaternion:l.clone()},Nl=new b.Quaternion,this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const i="touches"in e?e.touches[0].clientX:e.x,s="touches"in e?e.touches[0].clientY:e.y,o=Cr(this.camera,{x:i,y:s},this.container);return o?(this.rotate(o),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:i,plane:s,angleHelper:o,direction:r,helperQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(s,new b.Vector3);if(!c)return;const h=this.rotateCenter.clone(),f=s.projectPoint(c.clone(),new b.Vector3).clone().sub(h);if(i.angleTo(f)===0)return;const m=new b.Quaternion().setFromUnitVectors(i.clone().normalize(),f.clone().normalize()),v=l.quaternion.clone().premultiply(m);if(this.hooks.emit("wantToRotate",v))return;const A=new b.Euler().setFromQuaternion(new b.Quaternion().setFromUnitVectors(i.clone().normalize().applyQuaternion(a.clone().inverse()),f.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*o.angleDirection;if(this.startInfo.angle+=A,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle(qo(this.startInfo.angle)),h){const w=new b.Vector3().subVectors(l.position,h).applyQuaternion(m).add(h);l.position.copy(w)}l.applyQuaternion(m),Nl.premultiply(m),this.internalHooks.emit("applyObjectRotate",{quaternion:m,origin:h}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=f}dragEnd(){this.isDragging&&(this.applyHelperQuaternion(Nl,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var i,s,o;switch(e){case"x":return(i=this.helperObject3D.xCircle)==null?void 0:i.angleSector;case"y":return(s=this.helperObject3D.yCircle)==null?void 0:s.angleSector;case"z":return(o=this.helperObject3D.zCircle)==null?void 0:o.angleSector}}setAngleHelperStart(e,i){const s=this.getAngleHelper(e);if(!s){console.warn("angleHelper is undefined");return}if(s instanceof b.Mesh&&s.geometry instanceof b.CircleGeometry){const{radius:o,segments:r,thetaLength:a}=s.geometry.parameters;s.geometry=new b.CircleGeometry(o,r,i,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,i){const o=i>=0?Math.max(i,.001):Math.min(i,-.001),r=this.getAngleHelper(e);if(r instanceof b.Mesh&&r.geometry instanceof b.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(o)*(40/(2*Math.PI)));r.geometry=new b.CircleGeometry(a,c,l,o)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var s;const i=(s=this.helperObject3D.angleTips)==null?void 0:s.element;i&&(i.innerText=`${e.toFixed(0)}°`)}setTipsPosition(e){const i=this.helperObject3D.angleTips;if(!i)return;const s=e.project(this.camera),{x:o,y:r,z:a}=s;if(a>1)return;const l=(o+1)/2*100+"%",c=(-r+1)/2*100+"%";i.setLeftTop(l,c)}}class bk extends Xs{constructor(...e){super(...e);d(this,"startInfo");d(this,"name","RectangleScaleController")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}onApplyOriginObjectPosition(e){this.isDragging||super.onApplyOriginObjectPosition(e)}onApplyOriginObjectScale(e){this.helperObject3D.applyHelperScaleMatrix4(e.matrix,e.origin)}getDragPlane(){const e=new b.Plane,i=this.helperObject3D.cornerPositions;if(i.length!==0)return i.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new Q.Vector3),i[0]):e.setFromCoplanarPoints(i[0],i[1],i[2]),e}dragStart(e,i){var o,r;(r=(o=this.helperObject3D).updatePoints)==null||r.call(o);const s=this.getDragPlane();if(!s)return this.dragEnd();this.startInfo={startPoint:{position:i.position.clone(),direction:i.direction},plane:s},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const i=Cr(this.camera,e,this.container);if(!i)return this.dragEnd();this.scale(i)}scale(e){var W,R;if(!this.startInfo)return;const i=this.originObject3D,{startPoint:s,plane:o}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(o,new Q.Vector3);if(!a||qE(a,this.camera.position))return;const l=new Q.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:h}=s,u=new Q.Vector3().subVectors(r[1],r[0]),f=new Q.Vector3().subVectors(r[3],r[0]),m=U=>{const j=new Q.Vector3(0,0,0);if(!this.startInfo)return j;const Y=(U==="ew"?u:f).clone(),N=c.clone().projectOnVector(Y),G=a.clone().projectOnVector(Y),X=l.clone().projectOnVector(Y);if(G.equals(N))return j;if(U==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const le=new Q.Vector3().subVectors(G,X),ae=le.x<0&&Y.x>=0,Ie=le.y<0&&Y.y>=0,Ae=le.z<0&&Y.z>=0;this.startInfo.dragPointInCenterBottom=ae||Ie||Ae}if(U==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const le=new Q.Vector3().subVectors(G,X),ae=le.x<0&&Y.x>=0,Ie=le.y<0&&Y.y>=0,Ae=le.z<0&&Y.z>=0;this.startInfo.dragPointInCenterLeft=ae||Ie||Ae}const J=new Q.Vector3().subVectors(G,N),q=J.length();return q>.3?(console.warn("offset.length() > 0.3, skipped",q),j):J},v=m("ew"),p=m("ns"),g=()=>{const U=v;this.helperObject3D.cornerPositions.forEach((j,Y)=>{var N;(N=this.startInfo)!=null&&N.dragPointInCenterLeft?(Y===0||Y===3)&&j.add(U):(Y===1||Y===2)&&j.add(U)})},A=()=>{const U=p;this.helperObject3D.cornerPositions.forEach((j,Y)=>{var N;(N=this.startInfo)!=null&&N.dragPointInCenterBottom?(Y===0||Y===1)&&j.add(U):(Y===2||Y===3)&&j.add(U)})};switch(h){case"ew":g();break;case"ns":A();break;case"nesw":case"nwse":g(),A()}const w=new Q.Vector3().subVectors(r[1],r[0]).length()/u.length(),I=new Q.Vector3().subVectors(r[3],r[0]).length()/f.length(),C=new Q.Vector3(w,I,1),M=new b.Matrix4().scale(C);i.isCSS3DObjectPlus?i.applyScaleMatrix4(M):i.scale.applyMatrix4(M),s.position.copy(a);const E=new Q.Vector3().addVectors(r[0],r[2]).divideScalar(2),S=new Q.Vector3().subVectors(E,l),L=new b.Matrix4().setPosition(S);i.applyMatrix4(L),(W=this.helperObject3D.css3DInstance)==null||W.css3DObject.applyMatrix4(L),(R=this.helperObject3D.plane)==null||R.applyMatrix4(L),this.internalHooks.emit("applyObjectScale",{matrix:M}),this.internalHooks.emit("applyObjectPosition",{matrix:L}),this.render()}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class yk extends bk{constructor(...e){super(...e);d(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const i=e.point,s=a=>this.dragStart(a,e),o=this.dragging.bind(this),r=this.dragEnd.bind(this);i.addEventListener("dragstart",s),i.addEventListener("drag",o),i.addEventListener("dragend",r)})}}class wk extends Xs{constructor(...e){super(...e);d(this,"name","BoundingBoxController")}}class Ck extends YE{constructor(e,i){super(e,i);d(this,"name","ScaleHelper");d(this,"scaleMeshes",[]);d(this,"positions",[]);i&&(this.positions=i.positions)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}initialPosition(e){this.position.copy(this.originObject3D.position);const i=typeof this.positions=="function"?this.positions():this.positions;i&&(this.scaleMeshes=i.map((s,o)=>{var a;const r=(a=this.scaleMeshes[o])!=null?a:Pk();return r.position.copy(s.handlePosition),r.scalePosition=s,this.addIfNotExists(r),r}))}setScaleByCamera(e){this.scaleMeshes.forEach(i=>{i.scale.setScalar(Vl(e,i.scalePosition.handlePosition.clone().applyMatrix4(this.matrixWorld)))})}}function Pk(){const n=new b.Group;n.name="ScaleHelperCube";const t=.05,e=new b.BoxGeometry(t,t,t),i=new b.MeshBasicMaterial({color:16776960,transparent:!0,side:b.DoubleSide}),s=new b.MeshBasicMaterial({color:16776960,opacity:.4,depthTest:!1,depthWrite:!1,transparent:!0,side:b.DoubleSide}),o=new b.Mesh(e,i),r=new b.Mesh(e,s);return o.name="ScaleHelperCube-front",r.name="ScaleHelperCube-behind",o.renderOrder=11,r.renderOrder=10,n.add(o,r),n}class Ik extends Xs{constructor(...e){super(...e);d(this,"name","ScaleController");d(this,"startInfo");d(this,"dragStart",e=>{if(this.isDragging)return;this.isDragging=!0;const{intersect:i}=e,s=this.camera.position;let o=i.object;o.scalePosition||(o=i.object.parent);const r=o.scalePosition.basePosition.clone(),l=o.scalePosition.handlePosition.clone().clone().sub(r).clone(),c=new b.Line3(r,r.clone().add(l.normalize().multiplyScalar(5)));c.applyMatrix4(this.helperObject3D.matrixWorld);const h=new b.Raycaster(s,i.point.clone().sub(s)),u=gn({raycaster:h,line:c});this.startInfo={line:c,scaleStartPoint:u,draggingObject:o},this.helperObject3D.scaleMeshes.forEach(f=>{f.uuid!==o.uuid&&(f.visible=!1)}),o.visible=!0,this.hooks.emit("scaleStart")});d(this,"dragging",e=>{if(!this.isDragging||!this.startInfo)return;const i="touches"in e?e.touches[0].clientX:e.x,s="touches"in e?e.touches[0].clientY:e.y,o=Cr(this.camera,{x:i,y:s},this.container);return o?(this.scale(o),!1):this.dragEnd()});d(this,"scale",e=>{var l,c;if(!this.startInfo)return;const{line:i,scaleStartPoint:s,draggingObject:o}=this.startInfo,{scalePosition:r}=o,a=gn({raycaster:e,line:i,clampToLine:!1});a.applyMatrix4(new b.Matrix4().getInverse(this.helperObject3D.matrixWorld.clone())),(c=(l=this.config)==null?void 0:l.scaleCallback)==null||c.call(l,{intersectPoint:a,scalePosition:r,offset:a.clone().sub(s)}),o.position.copy(a.clone()),this.hooks.emit("scale",new b.Vector3(1,1,1))});d(this,"dragEnd",()=>{this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.scaleMeshes.forEach(e=>{e.visible=!0}),this.internalHooks.emit("initialHelperPosition"),this.hooks.emit("scaleEnd"))});const i=this.show.bind(this),s=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",this.dragStart),document.addEventListener("mousemove",this.dragging),document.addEventListener("mouseup",this.dragEnd),this.domEvents.addEventListener(this.helperObject3D,"touchstart",this.dragStart),document.addEventListener("touchmove",this.dragging),document.addEventListener("touchend",this.dragEnd),this.hooks.on("rotateStart",s),this.hooks.on("rotateEnd",i),this.hooks.on("moveStart",s),this.hooks.on("moveEnd",i),this.hooks.on("moveByMouseEnable",s),this.hooks.on("moveByMouseDisable",i),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",this.dragStart),document.removeEventListener("mousemove",this.dragging),document.removeEventListener("mouseup",this.dragEnd),this.domEvents.removeEventListener(this.helperObject3D,"touchstart",this.dragStart),document.removeEventListener("touchmove",this.dragging),document.removeEventListener("touchend",this.dragEnd),this.hooks.off("rotateStart",s),this.hooks.off("rotateEnd",i),this.hooks.off("moveStart",s),this.hooks.off("moveEnd",i),this.hooks.off("moveByMouseEnable",s),this.hooks.off("moveByMouseDisable",i)})}initialHelperPosition(){this.helperObject3D.initialPosition();const e=this;e.offHoverListener&&e.offHoverListener(),e.offHoverListener=this.hoverListener(this.helperObject3D.scaleMeshes)}setScale(e){var l,c,h;let i=1,s=1,o=1;typeof e=="number"?(i=e,s=e,o=e):typeof e=="object"&&(i=(l=e.x)!=null?l:1,s=(c=e.y)!=null?c:1,o=(h=e.z)!=null?h:1);const r=new b.Vector3(i,s,o);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.internalHooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}function Re(n,t){this._camera=n||null,this._domElement=t||document,this._raycaster=new b.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}Re.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)},Re.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"],Re.prototype._getRelativeMouseXY=function(n){var t=n.target||n.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},i=t,s=getComputedStyle(i,null);e.y+=parseInt(s.getPropertyValue("padding-top"),10),e.x+=parseInt(s.getPropertyValue("padding-left"),10);do e.x+=i.offsetLeft,e.y+=i.offsetTop,s=getComputedStyle(i,null),e.x+=parseInt(s.getPropertyValue("border-left-width"),10),e.y+=parseInt(s.getPropertyValue("border-top-width"),10);while(i=i.offsetParent);var o={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((n.pageX-e.x)/o.width)*2-1,y:-((n.pageY-e.y)/o.height)*2+1}},Re.prototype._objectCtxInit=function(n){n._3xDomEvent={}},Re.prototype._objectCtxDeinit=function(n){delete n._3xDomEvent},Re.prototype._objectCtxIsInit=function(n){return!!n._3xDomEvent},Re.prototype._objectCtxGet=function(n){return n._3xDomEvent},Re.prototype.camera=function(n){return n&&(this._camera=n),this._camera},Re.prototype.bind=function(n,t,e,i){console.assert(Re.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(n)||this._objectCtxInit(n);var s=this._objectCtxGet(n);s[t+"Handlers"]||(s[t+"Handlers"]=[]),s[t+"Handlers"].push({callback:e,useCapture:i}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(n)},Re.prototype.addEventListener=Re.prototype.bind,Re.prototype.unbind=function(n,t,e,i){console.assert(Re.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(n)||this._objectCtxInit(n);var s=this._objectCtxGet(n);s[t+"Handlers"]||(s[t+"Handlers"]=[]);for(var o=s[t+"Handlers"],r=0;r<o.length;r++){var a=o[r];if(e==a.callback&&i==a.useCapture){o.splice(r,1);break}}var l=this._boundObjs[t].indexOf(n);this._boundObjs[t].splice(l,1)},Re.prototype.removeEventListener=Re.prototype.unbind,Re.prototype._bound=function(n,t){var e=this._objectCtxGet(t);return e?!!e[n+"Handlers"]:!1},Re.prototype._onMove=function(n,t,e,i){var s=this._boundObjs[n];if(!(s===void 0||s.length===0)){var o=new b.Vector2;o.set(t,e),this._raycaster.setFromCamera(o,this._camera);var r=this._raycaster.intersectObjects(s),a=this._selected;if(r.length>0){var l,c,h,u=r[0],f=u.object;this._selected=f,h=this._bound("mousemove",f),a!=f&&(l=this._bound("mouseover",f),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;h&&this._notify("mousemove",f,i,u),l&&this._notify("mouseover",f,i,u),c&&this._notify("mouseout",a,i,u)}},Re.prototype._onEvent=function(n,t,e,i){var s=this._boundObjs[n];if(!(s===void 0||s.length===0)){var o=new b.Vector2;o.set(t,e),this._raycaster.setFromCamera(o,this._camera);var r=this._raycaster.intersectObjects(s,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),h=l.parent;typeof c=="undefined"&&h;)c=this._objectCtxGet(h),h=h.parent;c&&this._notify(n,l,i,a)}}},Re.prototype._notify=function(n,t,e,i){var s=this._objectCtxGet(t),o=s?s[n+"Handlers"]:null;if(!s||!o||o.length===0){t.parent&&this._notify(n,t.parent,e,i);return}for(var o=s[n+"Handlers"],r=0;r<o.length;r++){var a=o[r],l=!0;a.callback({type:n,target:t,origDomEvent:e,intersect:i,stopPropagation:function(){l=!1}}),l&&a.useCapture===!1&&t.parent&&this._notify(n,t.parent,e,i)}},Re.prototype._onMouseDown=function(n){return this._onMouseEvent("mousedown",n)},Re.prototype._onMouseUp=function(n){return this._onMouseEvent("mouseup",n)},Re.prototype._onMouseEvent=function(n,t){var e=this._getRelativeMouseXY(t);this._onEvent(n,e.x,e.y,t)},Re.prototype._onMouseMove=function(n){var t=this._getRelativeMouseXY(n);this._onMove("mousemove",t.x,t.y,n),this._onMove("mouseover",t.x,t.y,n),this._onMove("mouseout",t.x,t.y,n)},Re.prototype._onClick=function(n){this._onMouseEvent("click",n)},Re.prototype._onDblClick=function(n){this._onMouseEvent("dblclick",n)},Re.prototype._onContextmenu=function(n){this._onMouseEvent("contextmenu",n)},Re.prototype._onTouchStart=function(n){return this._onTouchEvent("touchstart",n)},Re.prototype._onTouchEnd=function(n){return this._onTouchEvent("touchend",n)},Re.prototype._onTouchMove=function(n){if(n.touches.length==1){var t=Number(n.touches[0].pageX/window.innerWidth)*2-1,e=-(n.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,n),this._onMove("mouseover",t,e,n),this._onMove("mouseout",t,e,n)}},Re.prototype._onTouchEvent=function(n,t){var e=t.touches;if(e.length==0&&(e=t.changedTouches),e.length==1){var i=Number(e[0].pageX/window.innerWidth)*2-1,s=-(e[0].pageY/window.innerHeight)*2+1;this._onEvent(n,i,s,t)}};const Gl="Object3DHelperPlugin",Ir=Gl,Mk=()=>{console.error(`${Ir} is disposed`)},Ek=()=>{console.warn(`${Ir} is disabled`)},kk=()=>{console.error(`${Ir} is disabled`)};class Ql extends Ri{constructor(e){super(e);d(this,"name",Gl);d(this,"state",{visible:!0,enabled:!0,disposed:!1});d(this,"objectHelperMap",new Map);d(this,"css3DObjectParentMap",new Map);d(this,"css3DRender");this.five=e,this.css3DRender=new jn(this.five.scene),console.warn("Object3DHelper: 使用此插件,需要在初始化five时,设置five参数: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${Gl.toUpperCase()}_DEBUG__`]:this})}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,i){if(this.state.disposed)return Mk();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return kk();const s=x({},this.state);this.state=x(x({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:s})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,i={}){var w;if(!e){console.error("Object3D is undefined");return}if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const s=new vk,o=[],r=(w=this.five.getElement())==null?void 0:w.parentElement,a=this.five.camera,c=x(x({},{moveHelper:!0,rotateHelper:!0,scaleHelper:!0,boundingBoxHelper:!1,positionFrom:"objectPosition"}),i),{moveHelper:h,rotateHelper:u,scaleHelper:f,boundingBoxHelper:m}=c,v=s.hooks,p=new ht,g=new Re(this.five.camera,this.five.getElement()),A=I=>{if(I)return typeof I=="boolean"?I:I.enable};if(A(h)){const I=x(x({},this.getConfig(c.moveHelper)),c),C=new tk(e,x({},I)),M=new Zs(this.five,g,fk,e,C,I,v,p);s.addControllers({moveController:M.helperController}),o.push(()=>M.dispose())}if(A(u)){const I=x(x({},this.getConfig(c.rotateHelper)),c),C=new sk(e,x({container:r},I)),M=new Zs(this.five,g,Ak,e,C,I,v,p);s.addControllers({rotateController:M.helperController}),o.push(()=>M.dispose())}if(A(m)){const I=new hk(e),C=new Zs(this.five,g,wk,e,I,void 0,v,p);s.addControllers({boundingBoxController:C.helperController})}if(A(f))if(e.isCSS3DObjectPlus&&r){const I=new ck(e,r,a,this.five.scene),C=new Zs(this.five,g,yk,e,I,void 0,v,p);s.addControllers({scaleController:C.helperController}),o.push(()=>C.dispose()),ni(this.five).then(()=>{var M,E;if(e.isCSS3DObjectPlus){const S=e;if(!S||S.mode!=="front")return;const L=(M=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?M:va(this.five);L&&(this.css3DObjectParentMap.set(S,S.parent),S.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(L),(E=this.css3DRender.getBehindCSS3DObjectGroup())==null||E.add(S),this.css3DRender.render(this.five.camera))}})}else{const I=x(x({},this.getConfig(c.scaleHelper)),c),C=new Ck(e,I),M=new Zs(this.five,g,Ik,e,C,I,v,p);s.addControllers({scaleController:M.helperController}),o.push(()=>M.dispose())}return this.objectHelperMap.set(e,{helper:s,disposers:o}),s.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:i,disposers:s}=this.objectHelperMap.get(e);if(i){if(e.isCSS3DObjectPlus){const o=e,r=this.css3DObjectParentMap.get(o);r&&r.add(o),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),i.dispose(),s==null||s.forEach(o=>o==null?void 0:o())}}handleEnable(e,i=!0){e?(this.everyHelperDo(s=>s.enable()),this.hooks.emit("enable",{userAction:i})):(this.everyHelperDo(s=>s.disable()),this.hooks.emit("disable",{userAction:i})),this.state.enabled=e}handleVisible(e,i=!0){e?(this.everyHelperDo(s=>s.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:i}))):(this.everyHelperDo(s=>s.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:i}))),this.state.visible=e}handleDispose(){this.everyHelperDo((e,i)=>{e.dispose(),i==null||i.forEach(s=>s==null?void 0:s())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:i,disposers:s})=>{i&&e(i,s)})}actionIfStateIsEnabled(e,i){if(this.state.enabled)return e();i!=null&&i.warnLog&&Ek()}getConfig(e){if(e&&typeof e!="boolean"&&e.enable)return e}}const xk=n=>new Ql(n),Dk=`
987
+ `;class kl{constructor(t,e){d(this,"name","");d(this,"startTagContainer");d(this,"endTagContainer");d(this,"path",[]);d(this,"geometryStyle",{});d(this,"materialStyle",{});d(this,"meshStyle",{});d(this,"group",new b.Group);d(this,"meshWithDepthTest");d(this,"meshWithoutDepthTest");d(this,"visible",null);d(this,"five");d(this,"mode");d(this,"_curvePath",null);d(this,"_curvePoints",null);d(this,"_panoGroup",[]);d(this,"skippedPositions",null);d(this,"textureUrl","");d(this,"scale",1);d(this,"width",.5);d(this,"unitLength",.5);d(this,"_visibleFloorIndexes",null);d(this,"modeVisible",!1);d(this,"floorVisible",!0);d(this,"defaultVisible",!1);d(this,"inWalkAnimation",!1);d(this,"customVisible",null);d(this,"parent");d(this,"plugin");d(this,"textureHasLoaded",!1);d(this,"disposed",!1);d(this,"flowAnime",new Dn({progress:0}).to({progress:1}).duration(1500).repeat(1/0));d(this,"cacheLengths",[]);d(this,"heightOffset",0);d(this,"panoMap",{});d(this,"autoDepthTestEffectDistance");d(this,"dispose",()=>{var t,e;this.disposed||(this.disposed=!0,this.parent.hooks.off("show",this.updateVisible),this.parent.hooks.off("hide",this.updateVisible),this.plugin.hooks.off("show",this.updateVisible),this.plugin.hooks.off("hide",this.updateVisible),this.plugin.hooks.off("enable",this.updateVisible),this.plugin.hooks.off("disable",this.updateVisible),this.five.off("modeChange",this.onFiveModeChange),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("modelShownFloorChange",this.onFiveModelShownFloorChange),this.doHide(),(t=this.startTagContainer)==null||t.plugin.dispose(),(e=this.endTagContainer)==null||e.plugin.dispose())});d(this,"onWalkAnimationStart",()=>{this.inWalkAnimation=!0,this.updateVisible()});d(this,"onWalkAnimationEnd",()=>{this.inWalkAnimation=!1,this.updateVisible()});d(this,"onFiveModeChange",t=>{this.modeVisible=this.mode==="panorama"?Ji(t):Wt(t),this.updateVisible()});d(this,"onFivePanoArrived",t=>{var s,o,r,a,l,c;const e=(r=(o=(s=this.path)==null?void 0:s[0])==null?void 0:o.panoIndexMap)==null?void 0:r[t],i=this.panoMap[e!=null?e:t];if(i===void 0)this.group.children.includes(this.meshWithoutDepthTest)&&this.group.remove(this.meshWithoutDepthTest),this.meshWithDepthTest.material.uniforms.excludeMinV.value=-1,this.meshWithDepthTest.material.uniforms.excludeMaxV.value=-1;else{this.group.children.includes(this.meshWithoutDepthTest)||this.group.add(this.meshWithoutDepthTest),this.meshWithoutDepthTest.visible=!0;const h=this.meshWithDepthTest.geometry.getAttribute("uv"),u=100*((a=this.autoDepthTestEffectDistance)!=null?a:2),f=(l=h.getY((i-u)*2))!=null?l:0,m=(c=h.getY((i+u)*2))!=null?c:h.getY(h.count-1);this.meshWithDepthTest.material.uniforms.excludeMinV.value=f,this.meshWithDepthTest.material.uniforms.excludeMaxV.value=m,this.meshWithDepthTest.material.uniforms.includeMinV.value=-1,this.meshWithDepthTest.material.uniforms.includeMaxV.value=-1,this.meshWithoutDepthTest.material.uniforms.includeMinV.value=f,this.meshWithoutDepthTest.material.uniforms.includeMaxV.value=m,this.meshWithoutDepthTest.material.uniforms.excludeMinV.value=-1,this.meshWithoutDepthTest.material.uniforms.excludeMaxV.value=-1}this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0});d(this,"onFiveModelShownFloorChange",t=>{this.floorVisible=t===null||this.visibleFloorIndexes===null||this.visibleFloorIndexes.includes(t),this.updateVisible()});d(this,"updateVisible",()=>{const t=(()=>!this.parent.visible||!this.plugin.state.enabled||!this.plugin.state.visible?!1:this.customVisible!==null?this.customVisible:this.inWalkAnimation?!0:this.modeVisible&&this.defaultVisible&&this.floorVisible)();this.visible=t,t&&this.textureHasLoaded?this.doShow():this.doHide()});d(this,"onFlowAnimeUpdate",t=>{const{progress:e}=t;this.meshWithDepthTest.material.uniforms.vOffset.value=e,this.meshWithoutDepthTest.material.uniforms.vOffset.value=e,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0});d(this,"logError",t=>ff("GuideLineModeItem: ",t));var o,r;this.five=t,this.mode=e.mode,this.plugin=e.plugin,this.parent=e.parent,this.group.name="GuideLineModeItem";const i=new b.BufferGeometry,s=new b.ShaderMaterial({vertexShader:DE,fragmentShader:SE,transparent:!0,uniforms:{map:{value:null},useMapColor:{value:0},mapColor:{value:new b.Color},mapOpacity:{value:1},backgroundColor:{value:new b.Color},backgroundOpacity:{value:0},borderColor:{value:new b.Color},borderOpacity:{value:0},backgroundClip:{value:0},borderWidth:{value:.05},opacity:{value:1},flicker:{value:1},maxV:{value:0},vOffset:{value:0},includeMinV:{value:-1},includeMaxV:{value:-1},excludeMinV:{value:-1},excludeMaxV:{value:-1}}});this.meshWithDepthTest=new b.Mesh(i,s),this.meshWithoutDepthTest=new b.Mesh(i,s.clone()),this.meshWithoutDepthTest.material.depthTest=!1,this.meshWithDepthTest.name="GuideLineModeItemWithDepthTest",this.meshWithoutDepthTest.name="GuideLineModeItemWithoutDepthTest",this.group.add(this.meshWithDepthTest),this.mode==="panorama"&&(this.parent.hooks.on("walkStart",this.onWalkAnimationStart),this.parent.hooks.on("walkEnded",this.onWalkAnimationEnd),this.onFivePanoArrived(this.five.getCurrentState().panoIndex)),this.updateVisible(),this.onFiveModeChange(this.five.getCurrentState().mode),this.onFiveModelShownFloorChange((r=(o=this.five.model)==null?void 0:o.shownFloor)!=null?r:null),this.flowAnime.onUpdate(this.onFlowAnimeUpdate),this.parent.hooks.on("show",this.updateVisible),this.parent.hooks.on("hide",this.updateVisible),this.plugin.hooks.on("show",this.updateVisible),this.plugin.hooks.on("hide",this.updateVisible),this.plugin.hooks.on("enable",this.updateVisible),this.plugin.hooks.on("disable",this.updateVisible),this.plugin.hooks.on("dispose",this.dispose),this.five.on("modeChange",this.onFiveModeChange),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("modelShownFloorChange",this.onFiveModelShownFloorChange),this.five.needsRender=!0}get panoGroup(){return this._panoGroup}get visibleFloorIndexes(){return this._visibleFloorIndexes}get curvePath(){return this._curvePath}get curvePoints(){return this._curvePoints}setCustomVisible(t){if(this.disposed)return this.logError("disposed");this.customVisible!==t&&(this.customVisible=t,this.updateVisible())}setDefaultVisible(t){if(this.disposed)return this.logError("disposed");this.defaultVisible!==t&&(this.defaultVisible=t,this.updateVisible())}setUnitSize(t,e){if(this.disposed)return this.logError("disposed");this.width=t,this.unitLength=e,this.setGeometryByPath(this.path,{width:t,unit_length:e})}setScale(t){if(this.disposed)return this.logError("disposed");this.scale=t,this.setGeometryByPath(this.path,{scale:t})}setGeometryByPanoGroup(t,e){if(this.disposed)return this.logError("disposed");if(!this.five.work)return this.logError("setPathByPanoGroup: work is not ready");const i=xE(t);if(this._panoGroup=i,(e==null?void 0:e.skipPanoGroup)!==void 0){const o=e.skipPanoGroup?i.map(r=>this.plugin.workUtil.getObserverStandingPosition(r)).filter(ke):null;this.skippedPositions=o}const s=this.getPathFromPanoGroup(i,this.five.work,e);this.path=s,this.setGeometryByPath(s,e)}setGeometryByPath(t,e){var f,m,v,p;if(this.disposed)return this.logError("disposed");const i=(f=e==null?void 0:e.scale)!=null?f:this.scale,s=(m=e==null?void 0:e.width)!=null?m:this.width,o=(v=e==null?void 0:e.unit_length)!=null?v:this.unitLength;this.scale=i,this.width=s,this.unitLength=o;const{geometry:r,maxV:a,curvePath:l,curvePoints:c,panoMap:h,totalLength:u}=NC({path:t,width:s*i,unitLength:o*i,skipPositions:this.skippedPositions,useAutoDepthTest:e.useAutoDepthTest});this.autoDepthTestEffectDistance=(p=e.autoDepthTestEffectDistance)!=null?p:(()=>{const g=u/10;return g>3?3:g<1?1:g})(),this.panoMap=h,this._curvePath=l,this._curvePoints=c,this.meshWithDepthTest.geometry.copy(r),this.onFivePanoArrived(this.five.getCurrentState().panoIndex),this.meshWithDepthTest.material.needsUpdate=!0,this.meshWithDepthTest.material.uniforms.maxV.value=a,this.meshWithoutDepthTest.material.needsUpdate=!0,this.meshWithoutDepthTest.material.uniforms.maxV.value=a,this.five.needsRender=!0,this.path=t,this.geometryStyle=x(x({},this.geometryStyle),e)}setMartial(t){var i,s,o,r,a;if(this.disposed)return this.logError("disposed");this.setDefaultVisible((i=t==null?void 0:t.visible)!=null?i:!1),this.setColor((s=t==null?void 0:t.color)!=null?s:"#ffffff"),this.setOpacity((o=t==null?void 0:t.opacity)!=null?o:.5),this.setTextureUrl((a=(r=t==null?void 0:t.texture)==null?void 0:r.url)!=null?a:"https://vr-image-4.realsee-cdn.cn/release/web/arrow1.ebe7d0ff.png"),(t==null?void 0:t.background_color)!==void 0&&this.setBackgroundColor(t.background_color),(t==null?void 0:t.background_opacity)!==void 0&&this.setBackgroundOpacity(t.background_opacity),(t==null?void 0:t.border_color)!==void 0&&this.setBorderColor(t.border_color),(t==null?void 0:t.border_opacity)!==void 0&&this.setBorderOpacity(t.border_opacity),(t==null?void 0:t.border_width)!==void 0&&this.setBorderWidth(t.border_width),(t==null?void 0:t.background_clip)!==void 0&&this.setBackgroundClip(t.background_clip);const e=x(x({},this.materialStyle),t);this.materialStyle=e}setMeshStyle(t){if(t!=null&&t.translate){const s=new b.Vector3,o=new b.Vector3().fromArray(t.translate);o.y+=this.heightOffset,s.add(o),this.group.position.copy(s),i(this.startTagContainer,o),i(this.endTagContainer,o)}const e=x(x({},this.meshStyle),t);this.meshStyle=e;function i(s,o){if(!(s!=null&&s.tag))return;const r=new b.Vector3().fromArray(s.tag.position);r.add(o);const a=r.toArray();s.plugin.changeTagById(s.tag.id,{position:a})}}setHeightOffset(t){const e=new b.Vector3;this.meshStyle.translate&&e.add(new b.Vector3().fromArray(this.meshStyle.translate)),e.setY(e.y+t),this.group.position.copy(e),this.heightOffset=t,this.five.needsRender=!0}setColor(t){if(this.disposed)return this.logError("disposed");t&&(this.meshWithDepthTest.material.uniforms.mapColor.value=new b.Color().set(t),this.meshWithoutDepthTest.material.uniforms.mapColor.value=new b.Color().set(t)),this.meshWithDepthTest.material.uniforms.useMapColor.value=t?1:0,this.meshWithoutDepthTest.material.uniforms.useMapColor.value=t?1:0,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderColor(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.borderColor.value=new b.Color().set(t),this.meshWithoutDepthTest.material.uniforms.borderColor.value=new b.Color().set(t),this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderOpacity(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.borderOpacity.value=t,this.meshWithoutDepthTest.material.uniforms.borderOpacity.value=t,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundClip(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.backgroundClip.value=t==="border-box"?0:1,this.meshWithoutDepthTest.material.uniforms.backgroundClip.value=t==="border-box"?0:1,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderWidth(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.borderWidth.value=t,this.meshWithoutDepthTest.material.uniforms.borderWidth.value=t,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundColor(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.backgroundColor.value=new b.Color().set(t),this.meshWithoutDepthTest.material.uniforms.backgroundColor.value=new b.Color().set(t),this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundOpacity(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.backgroundOpacity.value=t,this.meshWithoutDepthTest.material.uniforms.backgroundOpacity.value=t,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setOpacity(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.opacity.value=t,this.meshWithoutDepthTest.material.uniforms.opacity.value=t,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setMapOpacity(t){if(this.disposed)return this.logError("disposed");this.meshWithDepthTest.material.uniforms.mapOpacity.value=t,this.meshWithoutDepthTest.material.uniforms.mapOpacity.value=t,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setTextureUrl(t){if(this.disposed)return this.logError("disposed");this.textureUrl=t,en(t).then(e=>{this.disposed||this.textureUrl===t&&(e.wrapT=b.RepeatWrapping,this.textureHasLoaded=!0,this.meshWithDepthTest.material.uniforms.map.value=e,this.meshWithoutDepthTest.material.uniforms.map.value=e,this.meshWithDepthTest.material.uniformsNeedUpdate=!0,this.meshWithoutDepthTest.material.uniformsNeedUpdate=!0,this.meshWithDepthTest.material.needsUpdate=!0,this.meshWithoutDepthTest.material.needsUpdate=!0,this.five.needsRender=!0,this.updateVisible())})}setVisibleFloorIndexes(t){var e,i;if(this.disposed)return this.logError("disposed");this._visibleFloorIndexes=t,this.onFiveModelShownFloorChange((i=(e=this.five.model)==null?void 0:e.shownFloor)!=null?i:null)}setStartTag(t){this.setTag("start",t)}setEndTag(t){this.setTag("end",t)}flicker(){var t,e,i,s,o,r;if(this.disposed)return this.logError("disposed");To([this.group,(i=(e=(t=this.startTagContainer)==null?void 0:t.plugin)==null?void 0:e.tags[0])==null?void 0:i.dom,(r=(o=(s=this.endTagContainer)==null?void 0:s.plugin)==null?void 0:o.tags[0])==null?void 0:r.dom],{loop:6,updateRender:()=>{this.five.needsRender=!0}})}getLengthByPanoGroupIndex(t){return this.disposed?this.logError("disposed"):this.cacheLengths.length!==0?this.cacheLengths[t]:(this.cacheLengths=this.getPanoGroupLengths(),this.cacheLengths[t])}getPanoGroupLengths(){var l;if(!this.curvePoints||!this.curvePath)return[];const t=this.curvePoints.length,e=this.curvePath.getLength(),i=t-1,s=e/i,o=(l=this.curvePath.getLengths(i))!=null?l:[],r=[];let a=0;for(let c=0;c<t;c++){const h=this.curvePoints[c],u=this.plugin.workUtil.getObserverStandingPosition(a);if(!u)break;u.clone().setY(0).distanceTo(h.clone().setY(0))<s&&(r.push(o[c]),a+=1)}return r}setTag(t,e){var l,c;const i=this.curvePath;if(!(e!=null&&e.data))return;const s=t==="start"?(l=this.startTagContainer)!=null?l:(()=>(this.startTagContainer={tag:null,plugin:new wr(this.five,{containerZIndex:1})},this.startTagContainer))():(c=this.endTagContainer)!=null?c:(()=>(this.endTagContainer={tag:null,plugin:new wr(this.five,{containerZIndex:1})},this.endTagContainer))(),r=He({},{contentType:"Custom",stickType:"2DPoint",config:{visibleConfig:{visibleFiveMode:["Floorplan","Mapview"],followModelVisibility:!1}},style:{point:{enabled:!1}},data:{}},e);s.tag=r,LE(r)&&(s.tag.element=h=>{var m,v;(m=s.app)==null||m.$destroy();const u=t==="start"?ie(x({},r.data),{name:this.name,distance:Math.round((v=i.getLength())!=null?v:0),i18n:this.plugin.config.i18n}):r.data,f=new kE({target:h,intro:!0,props:u});return s.app=f,()=>f.$destroy()}),s.plugin.load({tagList:[s.tag]});const a=this.meshStyle.translate;if(a&&r.position){const h=new b.Vector3().fromArray(r.position),u=new b.Vector3().fromArray(a);h.add(u),h.y+=this.heightOffset;const f=h.toArray();s.plugin.changeTagById(s.tag.id,{position:f})}}doShow(){var t,e;this.mode==="model"&&!this.flowAnime.isPlaying()&&this.flowAnime.play(),this.five.scene.add(this.group),(t=this.startTagContainer)==null||t.plugin.show(),(e=this.endTagContainer)==null||e.plugin.show(),this.five.needsRender=!0}doHide(){var t,e;this.mode==="model"&&this.flowAnime.stop(),this.five.scene.remove(this.group),(t=this.startTagContainer)==null||t.plugin.hide(),(e=this.endTagContainer)==null||e.plugin.hide(),this.five.needsRender=!0}getPathFromPanoGroup(t,e,i){if(t.length<2)return[];const s={},o=t.map((l,c)=>{const h=this.plugin.workUtil.getObserverStandingPosition(l);if(!h)return;const u=t[c-1];if((c===0?999:h.distanceTo(this.plugin.workUtil.getObserverStandingPosition(u)))<.05){let m=u;for(;s[m]!==void 0;)m=s[m];s[l]=m;return}return{position:h,panoIndex:l}}).filter(ke),r=o.map(l=>l.position.toArray()),a=o.map(l=>l.panoIndex);return[ie(x({type:"CatmullRomCurve3",points:r},i),{panoIndexList:a,panoIndexMap:s})]}}function LE(n){return n.contentType==="Custom"}const TE=Object.freeze(Object.defineProperty({__proto__:null,GuideLineModeItem:kl},Symbol.toStringTag,{value:"Module"})),bg="CruisePlugin",xl=`${bg}`;class yg extends Ri{constructor(e,i){super(e,i);d(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1});d(this,"data");d(this,"config");d(this,"pauseDataMap",new Map);d(this,"privateState",{playing:!1,broke:!1,modeChanging:!1});d(this,"GuideLine");d(this,"disposedErrorLog",()=>{console.error(`${xl} is disposed`)});d(this,"disableWarnLog",()=>{console.warn(`${xl} is disabled`)});d(this,"disableErrorLog",()=>{console.error(`${xl} is disabled`)});this.config=i,Object.assign(window,{[`__${bg}_DEBUG__`]:this})}play(e){this.setState({playing:!0},e)}pause(e){this.setState({playing:!1},e)}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,i){var o;if(this.state.disposed)return this.disposedErrorLog();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return this.disableErrorLog();const s=x({},this.state);this.state=He({},this.state,e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,i==null?void 0:i.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,i==null?void 0:i.userAction),e.playing!==void 0&&e.playing!==s.playing&&this.changePlayState(e.playing,i),e.speed!==void 0&&e.speed!==s.speed&&this.changeSpeed(e.speed),wt(s,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(o=i==null?void 0:i.userAction)!=null?o:!0})}clearPauseData(){var e,i;if((e=this.data)!=null&&e.id)return this.pauseDataMap.delete((i=this.data)==null?void 0:i.id)}changePlayState(e,i){this.actionIfStateIsEnabled(()=>{var s;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(s=i==null?void 0:i.userAction)!=null?s:!0})}),e?this.handlePlay(i):this.handlePause(i),this.state.playing=e}handleEnable(e,i=!0){var s,o;e?((s=this.GuideLine)==null||s.enable(),this.hooks.emit("enable",{userAction:i})):((o=this.GuideLine)==null||o.disable(),this.changePlayState(!1,{userAction:i}),this.hooks.emit("disable",{userAction:i})),this.state.enabled=e}handleVisible(e,i=!0){var s,o;e?((s=this.GuideLine)==null||s.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:i}))):((o=this.GuideLine)==null||o.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:i}))),this.state.visible=e}addInterruptListener(e){const i=()=>{this.privateState.modeChanging||e()},s=o=>{o!=="mouseMove"&&(e(),this.five.off("gesture",s))};return this.five.on("gesture",s),this.five.once("wantsChangeMode",i),()=>{this.five.off("gesture",s),this.five.off("wantsChangeMode",i)}}getSpeededDuration(e){return e/this.state.speed}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e;if((e=this.data)!=null&&e.id)return this.pauseDataMap.get(this.data.id)}setPauseData(){var i;const e=(i=this.data)==null?void 0:i.id;if(e)return this.pauseDataMap.set(e,{fiveState:this.five.getCurrentState(),playedProgress:this.getProgress()})}clear(){this.clearPauseData()}handleDispose(){var e;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0}actionIfStateIsEnabled(e,i){if(this.state.enabled)return e();i!=null&&i.warnLog&&this.disableWarnLog()}}function Dl(n,t,e){var l,c,h;const i=new b.Vector3().fromArray([(l=e.x)!=null?l:0,(c=e.y)!=null?c:0,(h=e.z)!=null?h:0]),s=n.getPointAt(t).clone().add(i),o=n.getTangentAt(t),{longitude:r,latitude:a}=Ds(o);return{offset:s.clone(),longitude:r,latitude:a,distance:0}}let Sl=class extends yg{constructor(e,i){var r;super(e,i);d(this,"curve");d(this,"baseCurveOffset");d(this,"curveOffset");d(this,"playStartedTime",performance.now());d(this,"duration");d(this,"changeSpeed",(e,i=!0)=>{this.state.speed=e,this.hooks.emit("speedChange",e,{userAction:i})});d(this,"moveToStart",()=>{this.five.setState(ie(x({},Dl(this.curve,0,this.curveOffset)),{mode:"Model"}))});d(this,"playFromStart",()=>{this.clearPauseData(),this.setState({playing:!0})});d(this,"getDuration",()=>this.getSpeededDuration(this.duration));d(this,"getProgress",()=>{var l;const e=this.getPauseData();let i=(l=e==null?void 0:e.playedProgress)!=null?l:0;(i<0||i>=1)&&(i=0);const s=1-i,o=this.getDuration(),a=(performance.now()-this.playStartedTime)/o;return 1-s+a});const s={config:{speedConfig:{moveSpeed:2,moveSpeedUnit:"m/s"}}},o={allowBroke:!0};this.state=He({},s,this.state),this.config=He({},o,this.config),this.baseCurveOffset=He({x:0,y:0,z:0},{y:2},(r=this.config)==null?void 0:r.offset)}load(e,i){var a,l,c,h,u,f,m,v,p;this.handlePause(),this.clear(),this.data=x({id:ct()},e);const s=(()=>{if(this.data.path instanceof b.Curve)return this.data.path.curves[0];{if(this.data.path.length<2)return null;const g=this.data.path.map(De);return new b.CatmullRomCurve3(g,void 0,"catmullrom",.5)}})();if(!s)return;if(this.curve=s,this.curveOffset={x:this.baseCurveOffset.x+((l=(a=this.data.offset)==null?void 0:a.x)!=null?l:0),y:this.baseCurveOffset.y+((h=(c=this.data.offset)==null?void 0:c.y)!=null?h:0),z:this.baseCurveOffset.z+((f=(u=this.data.offset)==null?void 0:u.z)!=null?f:0)},!this.curve)throw new Error("curve is not defined");const o=this.curve.getLength(),r=this.state.config.speedConfig.moveSpeedUnit==="m/ms"?1:1e3;if(this.duration=o/(this.state.config.speedConfig.moveSpeed/r),Array.isArray(this.data.path)){const g=this.data.path.map(De).map(A=>A.toArray());!this.GuideLine&&(((m=this.config)==null?void 0:m.useGuideLine)!==!1&&e.useGuildLine||(v=this.config)!=null&&v.useGuideLine&&e.useGuildLine!==!1)&&(this.GuideLine=FE(this.five,this.config)),(p=this.GuideLine)==null||p.load({lines:[{id:ct(),path:[{type:"CatmullRomCurve3",points:g}],model_style:{visible:!0}}]})}return i?this.setState(i):(this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed)),Promise.resolve()}handlePlay(){return new Promise((e,i)=>H(this,null,function*(){var l;this.hooks.emit("play",{userAction:!0});const s=this.getPauseData();let o=(l=s==null?void 0:s.playedProgress)!=null?l:0;(o<0||o>=1)&&(o=0);const r=Dl(this.curve,o,this.curveOffset);if(this.hooks.emit("progressChange",o),this.five.setState(ie(x({},r),{mode:"Model"})),yield this.five.ready(),this.playStartedTime=performance.now(),this.config.allowBroke){const c=this.addInterruptListener(()=>{this.state.playing&&(this.hooks.emit("broke"),this.handlePause(),c(),i(new Error("broke")))})}const a=()=>{const c=this.getProgress();if(c>=1)this.five.off("renderFrame",a),this.setState({playing:!1},{userAction:!1}),this.hooks.emit("end"),this.hooks.emit("progressChange",1),e("end");else if(this.state.playing===!1)this.five.off("renderFrame",a);else if(c>=0){const h=Dl(this.curve,c,this.curveOffset);this.hooks.emit("progressChange",c),this.five.setState(h,!0)}};this.five.on("renderFrame",a)}))}handlePause(e){var i;this.state.playing=!1,this.hooks.emit("pause",{userAction:(i=e==null?void 0:e.userAction)!=null?i:!0}),this.setPauseData()}};function wg(n){const t=Math.abs(Math.cos(n.latitude));return new b.Vector3(-Math.sin(n.longitude)*t,-Math.sin(n.latitude),-Math.cos(n.longitude)*t)}function zE(n,t){const e=wg(n),i=wg(t);return e.angleTo(i)}const jE=n=>H(this,null,function*(){try{n().then(()=>{},()=>{}).catch(()=>{})}catch(t){}});function Cg(n){return new Promise(t=>{setTimeout(()=>{t()},n)})}function OE(n){return H(this,null,function*(){return new Promise(t=>{if(n.work){t();return}n.once("loaded",()=>t())})})}class Us extends yg{constructor(e,i){super(e,i);d(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});d(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,modeChanging:!1});this.config=i,Object.assign(window,{__WalkPlugin_DEBUG__:this})}load(e,i,s){return H(this,null,function*(){var h,u;this.clear();const o=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=x({id:r.keyframesId},r),this.hooks.emit("dataChange",r,o);let a=[],l;const c=this.data.keyframes.filter(f=>f.data.panoIndex!==void 0);c.filter((f,m)=>{var v;return f.data.panoIndex!==((v=c[m-1])==null?void 0:v.data.panoIndex)}).map(f=>f.data.panoIndex).forEach(f=>{var v,p;const m=(v=this.workUtil.getObserver(f))==null?void 0:v.floorIndex;if(m!==void 0)if(l===m){const g=a.length-1;a[g]=[...(p=a[g])!=null?p:[],f]}else{l=m;const g=a.length;a[g]=[f]}}),!this.GuideLine&&((h=this.config)==null?void 0:h.useGuideLine)!==!1&&r.useGuildLine!==!1&&(this.GuideLine=Tl(this.five,this.config)),(u=this.GuideLine)==null||u.load({routes:a.map(f=>({panoIndexList:f})),config:r.guildPluginOptions}),i?this.setState(i,{userAction:s}):(this.setState({playing:!1},{userAction:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing,{userAction:!1}),this.changeSpeed(this.state.speed)),this.clearPauseData(),console.debug("WORKPLUGIN loaded",r),this.hooks.emit("dataLoaded",r)})}playFrom(e){const{index:i,id:s,userAction:o}=e;this.state.playing&&this.setState({playing:!1},{userAction:o}),this.setState({playing:!0},{userAction:o,playFromIndex:i,playFromId:s})}playFromStart(e){return this.playFrom(ie(x({},e),{index:0}))}formatData(e){return H(this,null,function*(){this.five.work||(yield OE(this.five));const i=(()=>{const s=e;return typeof s=="object"&&s!==null&&ke(s.version)&&s.data?s.data:s})();if(i.keyframes)return{keyframesId:ct(),keyframes:i.keyframes.map((s,o)=>{var l;const r=i.keyframes[o+1],a=(()=>!r||r.start===void 0||s.end===void 0?0:r.start-s.end)();return ie(x({id:(l=s.uuid)!=null?l:ct(),moveIndex:o,stay:a,index:o},s),{guildPluginOptions:i.guildPluginOptions})})};if(i.panoIndexList){let s=[];const{moveEffect:o,moveToFirstPanoEffect:r,moveToFirstPanoDuration:a}=i;return this.privateState.moveToFirstPanoEffect=r,this.privateState.moveToFirstPanoDuration=a,i.panoIndexList.forEach((l,c)=>{const h=(()=>{var p,g;const u=i.panoIndexList.slice(c).find(A=>A!==l);if(u===void 0)return;const f=this.workUtil.getObserverPosition(l),m=this.workUtil.getObserverPosition(u);if(!m||!f||((p=this.workUtil.getObserver(l))==null?void 0:p.floorIndex)!==((g=this.workUtil.getObserver(u))==null?void 0:g.floorIndex))return;const v=new b.Vector3().subVectors(m,f);return Ds(v.normalize())})();i.moveType===void 0||i.moveType==="justMove"?s.push({moveIndex:c,stay:i.stay,data:x({effect:"Move",panoIndex:l,moveEffect:o},h!=null?h:{})}):i.moveType==="moveAndRotate"&&(s.push({moveIndex:c,stay:i.stay,data:{effect:"Move",panoIndex:l,moveEffect:o}}),h&&s.push({moveIndex:c,stay:i.stay,data:x({effect:"Rotate",panoIndex:l},h)}))}),{keyframesId:ct(),keyframes:s.map((l,c)=>x({id:ct(),index:c},l)),guildPluginOptions:i.guildPluginOptions,useGuildLine:i.useGuildLine}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handlePlay(e){return H(this,null,function*(){var m;const{data:i,state:s,privateState:o,hooks:r}=this;if(o.playing||!(i!=null&&i.keyframes)||(i==null?void 0:i.keyframes.length)===0)return;const a=ct();o.playId=a,o.playing=!0,o.broke=!1;const l=i.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(m=e==null?void 0:e.userAction)!=null?m:!0});let h=!1;const f=yield(()=>H(this,null,function*(){var v,p;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(v=this.data)==null?void 0:v.keyframes.findIndex(g=>g.id===e.playFromId);if(c!=null&&c.id){const g=(p=this.data)==null?void 0:p.keyframes.find(A=>A.id===c.id);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:o.moveToFirstPanoEffect,duration:o.moveToFirstPanoDuration})),g){if(g.data.effect==="Move")return g.index;if(g.data.effect==="Rotate"){const A=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(g,{duration:A}),h=!0,g.index+1}}}}))();this.clearPauseData();for(const v of l){if(o.broke||!s.playing||!o.playing||a!==o.playId)return;if(!(f!==void 0&&v.index<f))try{r.emit("playIndexChange",v.index,v),yield this.playKeyframe(v,{moveEffect:h===!1?o.moveToFirstPanoEffect:void 0,duration:h===!1&&typeof o.moveToFirstPanoDuration=="number"?o.moveToFirstPanoDuration:void 0}),v.stay&&(yield Cg(v.stay)),h===!1&&(h=!0)}catch(p){return Promise.resolve("broke")}}s.playing&&a===o.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:i,privateState:s,hooks:o}=this;i.playing=!1,s.playing!==!1&&(s.playing=!1,(e==null?void 0:e.userAction)!==!1&&this.setPauseData(),s.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&o.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}changeSpeed(e,i=!0){var l;const{state:s,privateState:o,hooks:r}=this,{currentPlayKeyframe:a}=o;if(r.emit("speedChange",e,{userAction:i}),s.playing&&a)try{const c=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,h=a.keyframe,{privateState:u}=this;((l=this.privateState.currentPlayKeyframe)==null?void 0:l.keyframe.id)!==h.id&&(this.privateState.currentPlayKeyframe={keyframe:h}),u.currentPlayQueue.push(this.getPlayPromise(h,{duration:c}))}catch(c){console.error(c)}}getProgress(){return this.five.controller.cameraMotion.progress}setPauseData(){var e,i,s;if((e=this.data)!=null&&e.id)return this.pauseDataMap.set(this.data.id,{id:(i=this.privateState.currentPlayKeyframe)==null?void 0:i.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}playKeyframe(e,i){return H(this,null,function*(){var o;const{privateState:s}=this;return((o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),s.currentPlayQueue.push(this.getPlayPromise(e,i)),this.actionPromiseQueue()})}getPlayPromise(s){return H(this,arguments,function*(e,i={}){var r;const o=e.data;if(i.duration=(r=i.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!o)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const h=()=>{a(),c=!0};switch(o.effect){case"Move":this.move(o,i).then(h);break;case"Rotate":this.rotate(o,i).then(h);break;default:this.rotate(o,i).then(h)}}catch(h){}})})}actionPromiseQueue(){return H(this,null,function*(){const{privateState:e}=this;return new Promise((i,s)=>{if(e.currentPlayQueue.length===0){i();return}const o=e.currentPlayQueue.shift();if(!o){i();return}o.then(i,s)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,i){return H(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,i);else return Promise.resolve()})}rotate(e,i){return H(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,i);yield this.updateCamera(e,i)})}updateCamera(s){return H(this,arguments,function*(e,i={}){const{five:o,privateState:r,state:a}=this,l=(()=>{var m,v;const u=(m=a.config)==null?void 0:m.speedConfig,f=(v=e.rotateSpeed)!=null?v:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return u.rotateSpeedUnit==="rad/ms"?f:f/1e3})(),c=(()=>{if(i.duration)return i.duration;if(l){const u=this.five.getCurrentState();return zE(u,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const h=this.getSpeededDuration(c);return new Promise(u=>{jE(()=>o.updateCamera(e,h)),setTimeout(()=>u(),h)})})}changePano(e,i){return H(this,null,function*(){const{five:s,privateState:o,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===s.panoIndex)return;const a=s.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var f,m;const h=(f=r.config)==null?void 0:f.speedConfig,u=(m=e.moveSpeed)!=null?m:h==null?void 0:h.moveSpeed;if((h==null?void 0:h.moveSpeedUnit)===void 0)return u;if(u!==void 0)return h.moveSpeedUnit==="m/ms"?u:u/1e3})(),c=(()=>{if(i!=null&&i.duration)return i.duration;if(l&&typeof s.panoIndex=="number"&&typeof e.panoIndex=="number"){const h=this.workUtil.getObserverPosition(s.panoIndex),u=this.workUtil.getObserverPosition(e.panoIndex);return h&&u?h.distanceTo(u)/l:800}return 800})();o.currentPlayKeyframe&&(o.currentPlayKeyframe.originDuration=c),yield new Promise(h=>{var f,m,v;const u=this.fiveUtil.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(v=(m=i==null?void 0:i.moveEffect)!=null?m:(f=this.state.config)==null?void 0:f.moveEffect)!=null?v:e.moveEffect,moveCancelCallback:()=>h(),moveEndCallback:()=>h()});u instanceof Promise&&u.then(()=>h()),a&&s.once("panoArrived",()=>h())}),a&&(this.privateState.modeChanging=!1)})}changeMode(e,i){return H(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,i),this.privateState.modeChanging=!1)})}}class Pg{constructor(t){d(this,"id");d(this,"renderID");d(this,"isGuideLine",!0);d(this,"panoramaItem");d(this,"modelItem");d(this,"hooks",new ht);d(this,"_visible",!0);d(this,"plugin");d(this,"five");d(this,"logError",t=>ff("GuideLineItem: ",t));this.id=t.id,this.five=t.five,this.plugin=t.plugin,this.panoramaItem=new kl(this.five,{mode:"panorama",plugin:this.plugin,parent:this}),this.modelItem=new kl(this.five,{mode:"model",plugin:this.plugin,parent:this})}get visible(){return this._visible}setData(t){this.setDataByMode("panorama",t),this.setDataByMode("model",t)}setDataByMode(t,e){var u;const i=t==="panorama"?this.panoramaItem:this.modelItem,s=t==="panorama"?e.panorama_style:e.model_style,o=t==="panorama"&&e.panorama_style.use_auto_depthtest,r=e.panorama_style.auto_depth_test_effect_distance,a=e.path,l=s,c=s,h=s;if(e.pano_group){const f=t==="panorama"&&e.panorama_style.skip_group===!0;i.setGeometryByPanoGroup(e.pano_group,ie(x({skipPanoGroup:f},l),{useAutoDepthTest:o,autoDepthTestEffectDistance:r}))}else e.path&&i.setGeometryByPath(a,ie(x({},l),{useAutoDepthTest:o,autoDepthTestEffectDistance:r}));i.name=e.name,i.setMeshStyle(h),i.setMartial(c),i.setVisibleFloorIndexes((u=e.visible_floor_indexes)!=null?u:null),i.setStartTag(s==null?void 0:s.start_tag),i.setEndTag(s==null?void 0:s.end_tag)}show(){this._visible=!0,this.hooks.emit("show",{userAction:!0})}hide(){this._visible=!1,this.hooks.emit("hide",{userAction:!0})}dispose(){this.panoramaItem.dispose(),this.modelItem.dispose()}walk(t){return H(this,null,function*(){if(this.hooks.emit("walkStart",{userAction:!0}),this.panoramaItem.panoGroup.length){const e=x({panoIndexList:this.panoramaItem.panoGroup},t),[i]=yield Ki(BE(this.five,e));if(i)return this.logError(i.message)}else{const e={path:this.panoramaItem.curvePath},[i]=yield Ki(VE(this.five,e));if(i)return this.logError(i.message)}this.hooks.emit("walkEnded",{userAction:!0})})}}function VE(n,t){return H(this,null,function*(){const e=new Sl(n);yield e.load(t),e.playFromStart()})}function BE(n,t){return H(this,null,function*(){if(t.panoIndexList.length===0)return;const e=n.getCurrentState();e.mode!=="Panorama"&&(yield Na(n,["Panorama",{longitude:e.longitude,latitude:0,panoIndex:t.panoIndexList[0]}]));const i=new Us(n);yield i.load(t),yield new Promise((s,o)=>{const r=n.getCurrentState();let a=t.panoIndexList.slice();r.panoIndex===a[0]&&c(r.panoIndex),i.playFromStart();function l(m){if(m!=="Panorama")return u(new Error("mode not match"))}function c(m){const v=a[0];if(a=a.slice(1),m!==v)return u(new Error("panoIndex not match, wanted: "+v+", got: "+m));if(a.length===0)return f()}function h(){n.off("modeChange",l),n.off("panoArrived",c)}function u(m){h(),o(m)}function f(){h(),s()}n.on("modeChange",l),n.on("panoArrived",c)})})}const _E=Object.freeze(Object.defineProperty({__proto__:null,GuideLineItem:Pg},Symbol.toStringTag,{value:"Module"})),Ll="GuideLinePlugin",Ig=`${Ll}`;let RE=class extends wi{constructor(e,i){super(e,i);d(this,"name",Ll);d(this,"cruisePlugin");d(this,"itemMap",new Map);d(this,"state",{visible:!1,enabled:!0});d(this,"data");d(this,"heightOffset",0);d(this,"_config");d(this,"_disposed",!1);d(this,"disposedErrorLog",()=>{console.error(`${Ig} is disposed`)});this._config=i!=null?i:{},this.cruisePlugin=new Us(e),Object.assign(window,{[`__${Ll}_DEBUG__`]:this})}get config(){return this._config}get disposed(){return this._disposed}load(e,i,s=!0){return H(this,null,function*(){var m,v,p,g,A,w,I,C;const o=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,o),this.data=r;const a=r.config,c={panorama_style:{visible:!!(!r.lines&&r.routes),unit_length:(m=a==null?void 0:a.unitHeight)!=null?m:.4,width:(v=a==null?void 0:a.unitWidth)!=null?v:.6,texture:{url:(p=a==null?void 0:a.arrowTextureUrl)!=null?p:this.staticPrefix+"/release/web/arrow-white.5c2c79a5.png"},use_auto_depthtest:(g=this.config.useAutoDepthTest)!=null?g:!1,auto_depth_test_effect_distance:this.config.autoDepthTestEffectDistance}},h=(w=(A=r.routes)==null?void 0:A.map(M=>{var E;return He({},c,{id:(E=M.id)!=null?E:ct(),pano_group:M.panoIndexList})}))!=null?w:[],u=(C=(I=r.lines)==null?void 0:I.map(M=>He({},c,M)))!=null?C:[],f=[...h,...u];yield ni(this.five),this.clear(),f.forEach(M=>{this.addGuideLineItem(M)}),this.updateTagsEnable(),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),i&&this.setState(i,{userAction:s}),this.hooks.emit("dataLoaded",r),console.debug(`${Ig} loaded`,r)})}formatData(e){return H(this,null,function*(){return this.getDataWithoutVersion(e)})}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.disposed||(this.clear(),this.hooks.emit("dispose"))}setState(e,i){var o;if(this.disposed)return this.disposedErrorLog();const s=x({},this.state);this.state=x(x({},this.state),e),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,i==null?void 0:i.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,i==null?void 0:i.userAction),wt(s,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(o=i==null?void 0:i.userAction)!=null?o:!0}),this.five.needsRender=!0)}addGuideLineItem(e){const i=e.render_id||e.id,s=this.itemMap.get(i);s&&this.removeGuideLineItem(s);const o=new Pg({five:this.five,id:i,plugin:this});return this.itemMap.set(i,o),e&&o.setData(e),this.heightOffset+=1e-4,o.modelItem.setHeightOffset(this.heightOffset),o.panoramaItem.setHeightOffset(this.heightOffset),o}getGuideLineItemByID(e){return this.itemMap.get(e)}removeGuideLineItem(e){this.itemMap.delete(e.id),e.panoramaItem.dispose(),e.modelItem.dispose()}updateTagsEnable(){const e=[];function i(r){return Array.isArray(r)&&r.every(a=>typeof a=="number")}function s(r,a){return new b.Vector3().fromArray(r).distanceTo(new b.Vector3().fromArray(a))<.01}function o(r){var l;const a=(l=r==null?void 0:r.tag)==null?void 0:l.position;return i(a)?e.every(c=>{var h;return i((h=c.tag)==null?void 0:h.position)?!s(a,c.tag.position):!0}):!1}this.itemMap.forEach(r=>{const a=r.modelItem.startTagContainer,l=r.modelItem.endTagContainer,c=o(a);c&&e.push(a),a==null||a.plugin.setState({enabled:c},{});const h=o(l);h&&e.push(l),l==null||l.plugin.setState({enabled:h},{})})}clear(){this.heightOffset=0,this.itemMap.forEach(e=>{this.removeGuideLineItem(e)})}handleEnable(e,i=!0){this.hooks.emit(e?"enable":"disable",{userAction:i})}handleVisible(e,i=!0){this.state.enabled&&this.hooks.emit(e?"show":"hide",{userAction:i})}getDataWithoutVersion(e){return typeof e=="object"&&e!==null&&e.data?e.data:e}};const Tl=(n,t)=>new RE(n,t),FE=Tl,NE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),GE=(n,t)=>new Us(n,t),QE=(n,t)=>new Sl(n,t);function zl(n,t,e){if(e){const s=new b.Vector3().subVectors(n.position,e).applyQuaternion(n.quaternion.clone().inverse()).applyQuaternion(t).add(e);n.position.copy(s)}n.quaternion.copy(t)}class Ys extends Rt{constructor(e,i){var s,o;super();d(this,"originObject3D");d(this,"onRender");d(this,"positionFrom");this.originObject3D=e,this.onRender=(s=i==null?void 0:i.onRender)!=null?s:()=>{},this.positionFrom=(o=i==null?void 0:i.positionFrom)!=null?o:"objectPosition"}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,i=[]){return e.intersectObject(this,!0,i)}initialPosition(e){var i,s;this.positionFrom==="objectPosition"?this.position.copy(this.originObject3D.position):this.positionFrom==="boundingBox"?this.position.copy((i=xn(this.originObject3D))==null?void 0:i.getCenter(new b.Vector3).applyMatrix4(this.originObject3D.matrixWorld)):this.positionFrom==="boundingSphere"?this.position.copy((s=Ch(this.originObject3D))==null?void 0:s.center.clone().applyMatrix4(this.originObject3D.matrixWorld)):this.positionFrom instanceof Q.Vector3?this.position.copy(this.positionFrom):this.positionFrom instanceof Function&&this.position.copy(this.positionFrom(this.originObject3D)),e&&this.position.add(e)}setScaleByCamera(e){}initQuaternion(e){if(this.quaternion.copy(this.originObject3D.quaternion),e&&(e.xAxis||e.yAxis||e.zAxis)){const i=e.xAxis instanceof Function?e.xAxis():e.xAxis,s=e.yAxis instanceof Function?e.yAxis():e.yAxis,o=e.zAxis instanceof Function?e.zAxis():e.zAxis;let r=i==null?void 0:i.clone(),a=s==null?void 0:s.clone(),l=o==null?void 0:o.clone();if(r&&!a&&!a){const c=new b.Quaternion().setFromUnitVectors(new b.Vector3(1,0,0),r.normalize());this.applyQuaternion(c)}if(a&&!r&&!l){const c=new b.Quaternion().setFromUnitVectors(new b.Vector3(0,1,0),a.normalize());this.applyQuaternion(c)}if(l&&!r&&!a){const c=new b.Quaternion().setFromUnitVectors(new b.Vector3(0,0,1),l.normalize());this.applyQuaternion(c)}if([r,a,l].filter(ke).length>=2){r||(r=new b.Vector3().crossVectors(a,l).normalize()),a||(a=new b.Vector3().crossVectors(r,l).normalize()),l||(l=new b.Vector3().crossVectors(r,a).normalize()),r.applyQuaternion(this.quaternion),a.applyQuaternion(this.quaternion),l.applyQuaternion(this.quaternion);const c=new b.Matrix4().makeBasis(r,a,l),h=new b.Quaternion().setFromRotationMatrix(c);this.quaternion.copy(h)}}}applyHelperScaleMatrix4(e,i){this.scale.applyMatrix4(e)}setHelperQuaternion(e,i){this.initQuaternion(),zl(this,this.quaternion.clone().premultiply(e),i)}applyHelperQuaternion(e,i){if(i){const s=new Q.Vector3().subVectors(this.position,i).applyQuaternion(e).add(i);this.position.copy(s)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class WE extends Ys{}class HE extends Ys{}class UE extends Ys{}class YE extends Ys{}class XE extends Ys{}class ZE extends b.Group{constructor(e){super();d(this,"direction");this.direction=e||"x"}}class Mg extends b.Mesh{constructor(e,i,s){super(e,i);d(this,"direction");this.direction=s||"x"}}function JE(n,t){const{offsetWidth:e,offsetHeight:i}=t,{top:s,left:o}=t.getBoundingClientRect();return Object.assign(new b.Vector2,{x:(n.x-o)/e*2-1,y:-(n.y-s)/i*2+1})}function Cr(n,t,e){if(!t||!e||!n)return;const i=JE(t,e);if(Math.abs(i.x)===1||Math.abs(i.y)===1)return;const s=new b.Raycaster;return s.setFromCamera(i,n),s.params.Points.threshold=.1,s}function qE(n,t){return!(Math.abs(n.x-t.x)>1e-5||Math.abs(n.y-t.y)>1e-5||Math.abs(n.z-t.z)>1e-5)}class jl extends ZE{constructor(e){var h;super(e.direction);d(this,"line");d(this,"arrow");d(this,"lineHeight",.4);d(this,"arrowHeight",.1);d(this,"renderOrder",50);d(this,"name","ArrowGroup");const i=new b.Color((h=e.color)!=null?h:16214315),s=new b.MeshBasicMaterial({color:i,depthTest:!1,depthWrite:!1,transparent:!0}),o=new b.ConeGeometry(.04,.1,32),r=new Mg(o,s.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new b.CylinderGeometry(a,a,.4,32),c=new Mg(l,s.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const Ol={X:15618642,Y:4765519,Z:4227839};class os{static get X(){return new b.Color(Ol.X).convertSRGBToLinear().clone()}static get Y(){return new b.Color(Ol.Y).convertSRGBToLinear().clone()}static get Z(){return new b.Color(Ol.Z).convertSRGBToLinear().clone()}}function Vl(n,t,e){const r=n.position.distanceTo(t),a=n.fov,l=n.distance||3,c=r/3,h=a/90,u=l/3,f=c*h*u,m=(e==null?void 0:e.min)||.6,v=e==null?void 0:e.max;return m&&f<m?m:v&&f>v?v:f}function KE(n,t,e){return n<t?t:n>e?e:n}function $E(n){let t=n.pose.latitude,e=n.pose.longitude;if(Dt(t)||Dt(e)){const i=n.matrix.elements;t=Math.asin(KE(i[9],-1,1)),Math.abs(i[9])<.9999999?e=fa(Math.atan2(i[8],i[10])):e=fa(Math.atan2(-i[2],i[0]))}return{latitude:t,longitude:e}}function ek(n){const{latitude:t,longitude:e}=n,i=new b.Vector3;return Eg-t<.03?i.set(0,1,0):Bl(0,e)?i.set(0,0,1):Bl(Math.PI,e)?i.set(0,0,-1):Bl(Eg,e)?i.set(1,0,0):i.set(-1,0,0),i}const Eg=Number((Math.PI/2).toFixed(5));function Bl(n,t){return typeof n!="number"||typeof t!="number"?!1:Math.abs(n-t)<.001}class tk extends WE{constructor(e,i){super(e,i);d(this,"name","MoveHelper");d(this,"xArrow");d(this,"yArrow");d(this,"zArrow");i.xArrowEnable!==!1&&(this.xArrow=new jl({direction:"x",color:os.X})),i.yArrowEnable!==!1&&(this.yArrow=new jl({direction:"y",color:os.Y})),i.zArrowEnable!==!1&&(this.zArrow=new jl({direction:"z",color:os.Z})),this.add(...[this.xArrow,this.yArrow,this.zArrow].filter(Boolean))}update(e){if(this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0,e.type==="OrthographicCamera"){const i=new b.Vector3(1,0,0).applyQuaternion(this.quaternion),s=new b.Vector3(0,1,0).applyQuaternion(this.quaternion),o=new b.Vector3(0,0,1).applyQuaternion(this.quaternion),r=$E(e),a=ek(r),l=.0872665;Math.abs(i.angleTo(a)-0)<l||Math.abs(i.angleTo(a)-Math.PI)<l?this.xArrow.visible=!1:Math.abs(s.angleTo(a)-0)<l||Math.abs(s.angleTo(a)-Math.PI)<l?this.yArrow.visible=!1:(Math.abs(o.angleTo(a)-0)<l||Math.abs(o.angleTo(a)-Math.PI)<l)&&(this.zArrow.visible=!1)}}show(){super.show(),this.xArrow&&this.add(this.xArrow),this.yArrow&&this.add(this.yArrow),this.zArrow&&this.add(this.zArrow)}setScaleByCamera(e){this.scale.setScalar(Vl(e,this.position))}showDraggingHelper(e){this.xArrow&&(e.includes("x")?this.add(this.xArrow):this.remove(this.xArrow)),this.yArrow&&(e.includes("y")?this.add(this.yArrow):this.remove(this.yArrow)),this.zArrow&&(e.includes("z")?this.add(this.zArrow):this.remove(this.zArrow))}dispose(){this.remove(...[this.xArrow,this.yArrow,this.zArrow].filter(Boolean)),super.dispose()}}function mn(n,t){return ik(document.createElement(t!=null?t:"div"),n)}function ik(n,t){if(!t)return n;for(const e in t)e&&t[e]&&(n.style[e]=t[e]);return n}function nk(n){const t=mn(x({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"99999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},n)),e=()=>{t.style.display!=="block"&&t.style.top&&t.style.left&&(t.style.display="block")};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(o,r)=>{t.style.left=o,t.style.top=r,e()}}}class sk extends UE{constructor(e,i){super(e,i);d(this,"name","RotateHelper");d(this,"xCircle");d(this,"yCircle");d(this,"zCircle");d(this,"children",[]);d(this,"angleTips");d(this,"container");(i==null?void 0:i.yzCircleEnable)!==!1&&(this.xCircle=new _l({direction:"x",color:os.X})),(i==null?void 0:i.xzCircleEnable)!==!1&&(this.yCircle=new _l({direction:"y",color:os.Y})),(i==null?void 0:i.xyCircleEnable)!==!1&&(this.zCircle=new _l({direction:"z",color:os.Z})),i!=null&&i.container&&(i==null?void 0:i.angleTipsEnable)!==!1&&(this.container=i==null?void 0:i.container,this.angleTips=nk({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(i=>i.showCircle()),(e=this.angleTips)==null||e.hide()}setScaleByCamera(e){this.scale.setScalar(Vl(e,this.position))}showDraggingHelper(e){var i;this.hide(),this.children.filter(s=>e.includes(s.direction)).forEach(s=>s.showRing()),(i=this.angleTips)==null||i.show()}dispose(){var e,i;this.removeFromParent(),(i=(e=this.angleTips)==null?void 0:e.element)==null||i.remove()}}class _l extends b.Group{constructor(e){super();d(this,"direction");d(this,"circle");d(this,"ring");d(this,"angleSector");this.direction=e.direction,this.circle=new ok(e),this.ring=new rk(e),this.angleSector=new ak(e),this.add(this.circle,this.ring,this.angleSector),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}showCircle(){this.add(this.circle),this.remove(this.ring,this.angleSector)}showRing(){this.add(this.ring,this.angleSector),this.remove(this.circle)}hide(){this.remove(this.ring,this.angleSector,this.circle)}}let ok=class extends b.Mesh{constructor(e){var i;super();d(this,"direction");d(this,"gapAngle",.02);d(this,"geometry",new b.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new b.MeshBasicMaterial({opacity:.6,color:(i=e.color)!=null?i:16777215,transparent:!0,side:b.DoubleSide,depthTest:!1,depthWrite:!1}),this.renderOrder=50,this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`}};class rk extends b.Group{constructor(e){super();d(this,"direction");this.direction=e.direction;const i=.015,s=new Array(8).fill(null).map((o,r)=>{const a=new b.RingGeometry(.25,.3,20,8,Math.PI/4*r+i,Math.PI/4-i*2),l=new b.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,depthWrite:!1,transparent:!0,side:b.DoubleSide});this.renderOrder=50;const c=new b.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...s)}}class ak extends b.Mesh{constructor(e){var s;super();d(this,"direction");d(this,"baseAxes");d(this,"angleDirection");switch(e.direction){case"x":this.baseAxes=new b.Vector3(0,0,1);break;case"y":this.baseAxes=new b.Vector3(1,0,0);break;case"z":this.baseAxes=new b.Vector3(1,0,0);break}const i=.3+5e-4;this.geometry=new b.CircleGeometry(i,48,0,1e-4),this.material=new b.MeshBasicMaterial({opacity:.4,color:(s=e.color)!=null?s:16777215,depthTest:!1,depthWrite:!1,transparent:!0,side:b.DoubleSide}),this.renderOrder=50,this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function lk(){const n=mn({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=mn({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=mn({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});n.appendChild(t),t.appendChild(e);const i="-4px",s={direction:"nesw",element:Gi({cursor:"nesw-resize",left:i,bottom:i})},o={direction:"ns",element:Gi({cursor:"ns-resize",bottom:i})},r={direction:"nwse",element:Gi({cursor:"nwse-resize",right:i,bottom:i})},a={direction:"ew",element:Gi({cursor:"ew-resize",right:i})},l={direction:"nesw",element:Gi({cursor:"nesw-resize",right:i,top:i})},c={direction:"ns",element:Gi({cursor:"ns-resize",top:i})},h={direction:"nwse",element:Gi({cursor:"nwse-resize",left:i,top:i})},u={direction:"ew",element:Gi({cursor:"ew-resize",left:i})};return new Array(o,a,c,u,s,r,l,h).forEach(m=>t.appendChild(m.element)),{container:n,squares:[s,o,r,a,l,c,h,u]}}function Gi(n){const t=mn(x({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},n)),e=mn({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),i=mn({width:"15px",height:"15px",cursor:n==null?void 0:n.cursor,pointerEvents:"auto",background:"transparent"});return i.draggable=!0,e.appendChild(i),t.appendChild(e),t}class ck extends XE{constructor(e,i,s,o){super(e);d(this,"name","CSS3DScaleHelper");d(this,"points",[]);d(this,"cornerPositions",[]);d(this,"css3DInstance");d(this,"plane");d(this,"css3DRenderer",new jn);d(this,"camera");d(this,"scene");d(this,"container");d(this,"enabled",!1);this.camera=s,this.scene=o,this.container=i,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyMatrix4(e){var i;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(i=this.plane)==null||i.applyMatrix4(e),this.cornerPositions.forEach(s=>s.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,i){var s;(s=this.plane)==null||s.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((i,s)=>{i.position.copy(e[s])})}applyHelperQuaternion(e,i){var o;const s=(o=this.css3DInstance)==null?void 0:o.css3DObject;if(s){const r=new b.Vector3().subVectors(s.position,i).applyQuaternion(e).add(i);s.position.copy(r),s.applyQuaternion(e)}if(this.plane){const r=new b.Vector3().subVectors(this.plane.position,i).applyQuaternion(e).add(i);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new b.Vector3().subVectors(r,i).applyQuaternion(e).add(i);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;this.enabled&&(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a,l;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const i=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!i)return;this.css3DInstance=i,i.appendToElement(this.container);const s=i.css3DObject.container,{container:o,squares:r}=lk();this.points=r.map((c,h)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[h]})),s.insertBefore(o,(a=s.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("当前物体暂时不支持 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}class hk extends HE{constructor(e){super(e);d(this,"name","BoundingBoxHelper");d(this,"box");d(this,"outline");d(this,"positionAttribute");this.positionAttribute=new b.BufferAttribute(new Float32Array(8*3),3),this.box=this.createBox(),this.outline=this.createOutline(),this.add(this.box,this.outline),this.update()}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}setHelperQuaternion(e,i){zl(this,e,i)}raycasterIntersectObject(e,i){return e.intersectObject(this,!1,i)}raycast(e,i){this.box.raycast(e,i)}update(){const e=xn(this.originObject3D);if(!e)return;const{min:i,max:s}=e;this.positionAttribute.setXYZ(0,s.x,s.y,s.z),this.positionAttribute.setXYZ(1,i.x,s.y,s.z),this.positionAttribute.setXYZ(2,i.x,i.y,s.z),this.positionAttribute.setXYZ(3,s.x,i.y,s.z),this.positionAttribute.setXYZ(4,s.x,s.y,i.z),this.positionAttribute.setXYZ(5,i.x,s.y,i.z),this.positionAttribute.setXYZ(6,i.x,i.y,i.z),this.positionAttribute.setXYZ(7,s.x,i.y,i.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new b.BufferGeometry;i.setIndex(new b.BufferAttribute(e,1)),i.setAttribute("position",this.positionAttribute);const s=new b.LineBasicMaterial({color:64767,linewidth:1,opacity:1,toneMapped:!1}),o=new b.LineSegments(i,s);return o.matrixAutoUpdate=!1,o}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),i=new b.BufferGeometry;i.setIndex(new b.BufferAttribute(e,1)),i.setAttribute("position",this.positionAttribute);const s=new b.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new b.Mesh(i,s)}}const Pr=new Map;function dk(n){if(Pr.has(n))return Pr.get(n).hooks;const t=new ht;let e=null,i;const s=()=>{e=requestAnimationFrame(s);const r=n.projectionMatrix.toArray().join(",")+n.matrixWorld.toArray().join(",");r!==i&&(i=r,t.emit("cameraUpdate"))};s();const o=()=>{Pr.delete(n),cancelAnimationFrame(e)};return Pr.set(n,{hooks:t,dispose:o}),t}class Xs{constructor(t,e){d(this,"originObject3D");d(this,"hooks");d(this,"preventTapDefaultEvent",!1);d(this,"internalHooks");d(this,"disposers",[]);d(this,"helperObject3D");d(this,"camera");d(this,"model");d(this,"scene");d(this,"container");d(this,"domEvents");d(this,"isDragging",!1);d(this,"enabled",!1);d(this,"name","BaseController");d(this,"boundingBox");d(this,"config");d(this,"onRender");d(this,"cameraHooks");d(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});d(this,"updateHelperScale",()=>{this.helperObject3D.setScaleByCamera(this.camera)});d(this,"getBox",()=>this.boundingBox?this.boundingBox:(this.boundingBox=xn(this.originObject3D),this.boundingBox));var h,u,f;this.hooks=(h=t.sharedHooks)!=null?h:new ht,this.internalHooks=(u=t.sharedInternalHooks)!=null?u:new ht,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=t.domEvents,this.onRender=(f=t.onRender)!=null?f:()=>{},this.config=e!=null?e:{},this.initialHelperPosition(),this.initialHelperQuaternion(),this.updateHelperScale(),this.cameraHooks=dk(this.camera),this.enable();const i=this.onSetOriginObjectScale.bind(this),s=this.onSetOriginObjectRotate.bind(this),o=this.onSetOriginObjectPosition.bind(this),r=this.onApplyOriginObjectScale.bind(this),a=this.onApplyOriginObjectRotate.bind(this),l=this.onApplyOriginObjectPosition.bind(this),c=this.initialHelperPosition.bind(this);this.cameraHooks.on("cameraUpdate",this.updateHelperScale),this.internalHooks.on("initialHelperPosition",c),this.internalHooks.on("setObjectScale",i),this.internalHooks.on("setObjectRotate",s),this.internalHooks.on("setObjectPosition",o),this.internalHooks.on("applyObjectPosition",l),this.internalHooks.on("applyObjectRotate",a),this.internalHooks.on("applyObjectScale",r),this.hooks.on("moveEnd",this.updateHelperScale),this.internalHooks.on("setObjectPosition",this.updateHelperScale),this.internalHooks.on("initialHelperPosition",this.updateHelperScale),this.disposers.push(()=>{this.cameraHooks.off("cameraUpdate",this.updateHelperScale),this.internalHooks.off("initialHelperPosition",c),this.internalHooks.off("setObjectScale",i),this.internalHooks.off("setObjectRotate",s),this.internalHooks.off("setObjectPosition",o),this.internalHooks.off("applyObjectPosition",l),this.internalHooks.off("applyObjectRotate",a),this.internalHooks.off("applyObjectScale",r),this.hooks.off("moveEnd",this.updateHelperScale),this.internalHooks.off("setObjectPosition",this.updateHelperScale),this.internalHooks.off("initialHelperPosition",this.updateHelperScale)})}initialHelperPosition(){this.helperObject3D.initialPosition(this.calculateOffset(this.config.offset))}initialHelperQuaternion(){this.helperObject3D.initQuaternion(this.config)}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){this.enabled&&(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,i){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.config.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.config.offset){const e=this.originObject3D.position,i=new b.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),s=new b.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),o=this.calculateOffset(this.config.offset,{min:s,max:i});this.helperObject3D.initialPosition(o)}}hoverListener(t,e=16777215,i=1){const s=Ai(t).filter(ke),o=[];for(const r of s)if(r.material||r instanceof b.Group){const a=r instanceof b.Group?r.children.filter(f=>f instanceof b.Mesh):[r];a.forEach(f=>{var m,v;f.__originalColor__=(m=f.__originalColor__)!=null?m:f.material.color.clone(),f.__originalOpacity__=(v=f.__originalOpacity__)!=null?v:f.material.opacity});const l=()=>{a.forEach(f=>{f.material.color.set(e),f.material.opacity=i}),this.render()},c=()=>{a.forEach(f=>{f.material.color.copy(f.__originalColor__),f.material.opacity=f.__originalOpacity__}),this.render()},h=()=>{this.isDragging||l()},u=()=>{this.isDragging||c()};for(const f of a)this.domEvents.addEventListener(f,"mouseover",h),this.domEvents.addEventListener(f,"mouseout",u),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),this.hooks.on("scaleEnd",c),o.push(()=>{this.domEvents.removeEventListener(f,"mouseover",h),this.domEvents.removeEventListener(f,"mouseout",u),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c),this.hooks.off("scaleEnd",c)})}return()=>o.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,i=this.helperObject3D;if(!i)return;const s=this.helperObject3D.raycasterIntersectObject(t)[0];if(!s)return;const o=s;if(o.object=i,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<o.point.distanceTo(e))return}return o.object}calculateOffset(t,e){const i=new b.Vector3(0,0,0);if(!t)return i;const s=()=>e||this.getBox();if(typeof t.x=="number")i.setX(t.x);else if(typeof t.x=="object"){const o=s();i.setX((o.max.x-o.min.x)*t.x.percents)}if(typeof t.y=="number")i.setY(t.y);else if(typeof t.y=="object"){const o=s();i.setY((o.max.y-o.min.y)*t.y.percents)}if(typeof t.z=="number")i.setZ(t.z);else if(typeof t.z=="object"){const o=s();i.setZ((o.max.z-o.min.z)*t.z.percents)}return i}}const uk=new b.Vector3;function gn(n){const{raycaster:t,line:e,clampToLine:i=!0}=n,s=new b.Plane().setFromNormalAndCoplanarPoint(t.ray.direction.clone().normalize(),new b.Vector3),o=s.projectPoint(e.start,new b.Vector3),r=s.projectPoint(e.end,new b.Vector3),a=new b.Line3(o,r),l=a.closestPointToPoint(t.ray.origin,i,uk),c=l.distanceTo(r),h=l.distanceTo(o),u=a.distance();if(c>h&&c>u){const f=-l.distanceTo(o)/u,m=e.start.clone().sub(e.end).normalize();return e.start.clone().sub(m.clone().multiplyScalar(f*e.distance()))}else{const f=l.distanceTo(o)/u;return new b.Vector3().lerpVectors(e.start,e.end,f)}}class fk extends Xs{constructor(...e){super(...e);d(this,"name","MoveController");d(this,"startInfo");d(this,"_moveByMouse",{enabled:!1});d(this,"mouseInfo");d(this,"mousedownEventListenerDisposer");d(this,"dragStart",e=>{if(this.moveByMouseEnable||this.isDragging)return;const i=e==null?void 0:e.intersect;if(!i)return this.dragEnd();const s=(i==null?void 0:i.object).direction;if(!s)return this.dragEnd();const o=new b.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new b.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new b.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(s){case"x":return o;case"y":return r;case"z":return a}})(),c=i.point.clone(),h=new b.Line3(c.clone().sub(l.normalize()),c.clone().add(l.normalize()));this.startInfo={startVectorProject:c,line:h},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("moveStart"),this.isDragging=!0});d(this,"dragging",e=>{if(!this.isDragging||!this.startInfo)return;const i="touches"in e?e.touches[0].clientX:e.x,s="touches"in e?e.touches[0].clientY:e.y,o=Cr(this.camera,{x:i,y:s},this.container);return o?(this.move(o),!1):this.dragEnd()});d(this,"dragEnd",()=>{this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))});const i=this.helperObject3D;this.hoverListener([i.xArrow,i.yArrow,i.zArrow]);const s=this.show.bind(this),o=this.hide.bind(this),r=()=>{this.helperObject3D.update(this.camera),this.render()};r(),this.domEvents.addEventListener(this.helperObject3D,"mousedown",this.dragStart),document.addEventListener("mousemove",this.dragging),document.addEventListener("mouseup",this.dragEnd),this.domEvents.addEventListener(this.helperObject3D,"touchstart",this.dragStart),document.addEventListener("touchmove",this.dragging),document.addEventListener("touchend",this.dragEnd),this.hooks.on("rotateStart",o),this.hooks.on("rotateEnd",s),this.hooks.on("scaleStart",o),this.hooks.on("scaleEnd",s),this.hooks.on("moveByMouseEnable",o),this.hooks.on("moveByMouseDisable",s),this.cameraHooks.on("cameraUpdate",r),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",this.dragStart),document.removeEventListener("mousemove",this.dragging),document.removeEventListener("mouseup",this.dragEnd),this.domEvents.removeEventListener(this.helperObject3D,"touchstart",this.dragStart),document.removeEventListener("touchmove",this.dragging),document.removeEventListener("touchend",this.dragEnd),this.hooks.off("rotateStart",o),this.hooks.off("rotateEnd",s),this.hooks.off("scaleStart",o),this.hooks.off("scaleEnd",s),this.hooks.off("moveByMouseEnable",o),this.hooks.off("moveByMouseDisable",s),this.cameraHooks.off("cameraUpdate",r)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouse.enabled}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(i=>i==null?void 0:i())}moveByMouse(e){this._moveByMouse={enabled:!0,useFaceNormal:e==null?void 0:e.useFaceNormal},this.preventTapDefaultEvent=!0;const i=this.handleMouseDown.bind(this),s=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",i),this.container.addEventListener("mouseup",s)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",i),this.container.removeEventListener("mouseup",s)}}disableMoveByMouse(){var e;this._moveByMouse={enabled:!1},this.preventTapDefaultEvent=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){var r,a,l;if(!this.moveByMouseEnable)return;const{point:i,face:s}=e;if(!this.hooks.emit("wantToMove",i)){if(this.originObject3D.position.copy(i),(this._moveByMouse.useFaceNormal===!0||typeof this._moveByMouse.useFaceNormal=="object"&&this._moveByMouse.useFaceNormal.enable!==!1)&&s!=null&&s.normal){const c=(()=>typeof this._moveByMouse.useFaceNormal=="object"&&this._moveByMouse.useFaceNormal.alignmentVector?this._moveByMouse.useFaceNormal.alignmentVector:{x:0,y:1,z:0})(),h=new b.Vector3((r=c.x)!=null?r:0,(a=c.y)!=null?a:0,(l=c.z)!=null?l:0),u=(()=>typeof this._moveByMouse.useFaceNormal=="object"&&this._moveByMouse.useFaceNormal.fixedFaceNormal?this._moveByMouse.useFaceNormal.fixedFaceNormal(s.normal):s.normal)();this.originObject3D.quaternion.setFromUnitVectors(h,u),this.internalHooks.emit("setObjectRotate",this.originObject3D.quaternion.clone())}this.internalHooks.emit("setObjectPosition",i),this.hooks.emit("move",i)}}handleMouseDown(e){const{x:i,y:s}=e;this.mouseInfo={x:i,y:s,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:i,y:s}=e;this.mouseInfo.x===i&&this.mouseInfo.y===s&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}move(e){if(!this.startInfo)return this.dragEnd();const{line:i,startVectorProject:s}=this.startInfo,o=this.originObject3D,r=gn({raycaster:e,line:i,clampToLine:!1}),a=r.clone().sub(s),l=new b.Matrix4;l.setPosition(a);const c=o.position.clone().applyMatrix4(l);this.hooks.emit("wantToMove",c)||(o.applyMatrix4(l),s.copy(r),this.internalHooks.emit("applyObjectPosition",{matrix:l}),this.hooks.emit("move",c))}}class Zs{constructor(t,e,i,s,o,r,a,l){d(this,"helperController");d(this,"five");d(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;if(this.helperController.preventTapDefaultEvent)return!1;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});d(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});d(this,"onFiveIntersectionOnModelUpdate",(...t)=>{this.helperController&&this.helperController.onIntersectionOnModelUpdate(...t)});const{camera:c,model:h,scene:u}=t,f=t.getElement();if(this.five=t,!c||!h||!f||!u)return;const m=()=>{t.needsRender=!0};this.helperController=new i({camera:c,model:h,domEvents:e,originObject3D:s,helperObject3D:o,container:f,scene:u,onRender:m,sharedHooks:a,sharedInternalHooks:l},r),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const Rl="Object3DHelper@v1.0.1",mk=()=>{console.error(`${Rl} is disposed`)},gk=()=>{console.warn(`${Rl} is disabled`)},pk=()=>{console.error(`${Rl} is disabled`)};class vk{constructor(t){d(this,"controllers",{});d(this,"state",{visible:!0,enabled:!0,disposed:!1});d(this,"hooks",new ht);d(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return H(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return H(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return mk();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return pk();const i=x({},this.state);this.state=x(x({},this.state),t),t.disposed!==void 0&&t.disposed!==i.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:i})}addControllers(t){this.controllers=x(x({},this.controllers),t),this.setState(this.state)}initialHelperMatrix(){this.everyControllerDo(t=>{t.initialHelperPosition(),t.initialHelperQuaternion()})}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(i=>{i.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(i=>{i.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(i=>{i.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(i=>{i.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(i=>{i==null||i.dispose()});for(const i in this.controllers){if(!i)continue;const s=i;(e=(t=this.eventListener)[s])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&gk()}}function Fl(n){return n*Math.PI/180}let Nl=new b.Quaternion;class Ak extends Xs{constructor(...e){var c,h,u;super(...e);d(this,"name","RotateController");d(this,"startInfo");d(this,"removeListener");const i=this.helperObject3D;this.hoverListener([(c=i.xCircle)==null?void 0:c.circle,(h=i.yCircle)==null?void 0:h.circle,(u=i.zCircle)==null?void 0:u.circle].filter(Boolean));const s=this.dragStart.bind(this),o=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),this.domEvents.addEventListener(this.helperObject3D,"touchstart",s),document.addEventListener("touchmove",o),document.addEventListener("touchend",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("scaleStart",l),this.hooks.on("scaleEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",s),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),this.domEvents.removeEventListener(this.helperObject3D,"touchstart",s),document.removeEventListener("touchmove",o),document.removeEventListener("touchend",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("scaleStart",l),this.hooks.off("scaleEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)})}get rotateCenter(){return this.helperObject3D.position.clone()}setRotateAngle(e){const{x:i=0,y:s=0,z:o=0}=e,r=new b.Euler(Fl(i),Fl(s),Fl(o)),a=new b.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:h}=this;zl(c,a,h),this.internalHooks.emit("setObjectRotate",a,h),this.hooks.emit("rotate",a),this.render()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const i=e==null?void 0:e.intersect;if(!i)return this.dragEnd();const s=(i==null?void 0:i.object).direction;if(!s)return this.dragEnd();const o=i.point,r=this.getAngleHelper(s);this.setTipsAngle(0);const a=o.clone();a.y+=.2,this.setTipsPosition(a);const l=this.helperObject3D.quaternion.clone(),c=(()=>{if(s==="x")return new b.Vector3(1,0,0).applyQuaternion(l);if(s==="y")return new b.Vector3(0,1,0).applyQuaternion(l);if(s==="z")return new b.Vector3(0,0,1).applyQuaternion(l)})(),h=new b.Plane().setFromNormalAndCoplanarPoint(c,o),f=h.projectPoint(o.clone(),new b.Vector3).clone().sub(this.rotateCenter),m=f.angleTo(r.baseAxes.clone().applyQuaternion(l));this.setAngleHelperStart(s,m),this.setAngleHelperLength(s,0),this.startInfo={direction:s,startVector:f,plane:h,angleHelper:r,angle:0,helperQuaternion:l.clone()},Nl=new b.Quaternion,this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const i="touches"in e?e.touches[0].clientX:e.x,s="touches"in e?e.touches[0].clientY:e.y,o=Cr(this.camera,{x:i,y:s},this.container);return o?(this.rotate(o),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:i,plane:s,angleHelper:o,direction:r,helperQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(s,new b.Vector3);if(!c)return;const h=this.rotateCenter.clone(),f=s.projectPoint(c.clone(),new b.Vector3).clone().sub(h);if(i.angleTo(f)===0)return;const m=new b.Quaternion().setFromUnitVectors(i.clone().normalize(),f.clone().normalize()),v=l.quaternion.clone().premultiply(m);if(this.hooks.emit("wantToRotate",v))return;const A=new b.Euler().setFromQuaternion(new b.Quaternion().setFromUnitVectors(i.clone().normalize().applyQuaternion(a.clone().inverse()),f.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*o.angleDirection;if(this.startInfo.angle+=A,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle(qo(this.startInfo.angle)),h){const w=new b.Vector3().subVectors(l.position,h).applyQuaternion(m).add(h);l.position.copy(w)}l.applyQuaternion(m),Nl.premultiply(m),this.internalHooks.emit("applyObjectRotate",{quaternion:m,origin:h}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=f}dragEnd(){this.isDragging&&(this.applyHelperQuaternion(Nl,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var i,s,o;switch(e){case"x":return(i=this.helperObject3D.xCircle)==null?void 0:i.angleSector;case"y":return(s=this.helperObject3D.yCircle)==null?void 0:s.angleSector;case"z":return(o=this.helperObject3D.zCircle)==null?void 0:o.angleSector}}setAngleHelperStart(e,i){const s=this.getAngleHelper(e);if(!s){console.warn("angleHelper is undefined");return}if(s instanceof b.Mesh&&s.geometry instanceof b.CircleGeometry){const{radius:o,segments:r,thetaLength:a}=s.geometry.parameters;s.geometry=new b.CircleGeometry(o,r,i,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,i){const o=i>=0?Math.max(i,.001):Math.min(i,-.001),r=this.getAngleHelper(e);if(r instanceof b.Mesh&&r.geometry instanceof b.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(o)*(40/(2*Math.PI)));r.geometry=new b.CircleGeometry(a,c,l,o)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var s;const i=(s=this.helperObject3D.angleTips)==null?void 0:s.element;i&&(i.innerText=`${e.toFixed(0)}°`)}setTipsPosition(e){const i=this.helperObject3D.angleTips;if(!i)return;const s=e.project(this.camera),{x:o,y:r,z:a}=s;if(a>1)return;const l=(o+1)/2*100+"%",c=(-r+1)/2*100+"%";i.setLeftTop(l,c)}}class bk extends Xs{constructor(...e){super(...e);d(this,"startInfo");d(this,"name","RectangleScaleController")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}onApplyOriginObjectPosition(e){this.isDragging||super.onApplyOriginObjectPosition(e)}onApplyOriginObjectScale(e){this.helperObject3D.applyHelperScaleMatrix4(e.matrix,e.origin)}getDragPlane(){const e=new b.Plane,i=this.helperObject3D.cornerPositions;if(i.length!==0)return i.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new Q.Vector3),i[0]):e.setFromCoplanarPoints(i[0],i[1],i[2]),e}dragStart(e,i){var o,r;(r=(o=this.helperObject3D).updatePoints)==null||r.call(o);const s=this.getDragPlane();if(!s)return this.dragEnd();this.startInfo={startPoint:{position:i.position.clone(),direction:i.direction},plane:s},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const i=Cr(this.camera,e,this.container);if(!i)return this.dragEnd();this.scale(i)}scale(e){var W,R;if(!this.startInfo)return;const i=this.originObject3D,{startPoint:s,plane:o}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(o,new Q.Vector3);if(!a||qE(a,this.camera.position))return;const l=new Q.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:h}=s,u=new Q.Vector3().subVectors(r[1],r[0]),f=new Q.Vector3().subVectors(r[3],r[0]),m=U=>{const j=new Q.Vector3(0,0,0);if(!this.startInfo)return j;const Y=(U==="ew"?u:f).clone(),N=c.clone().projectOnVector(Y),G=a.clone().projectOnVector(Y),X=l.clone().projectOnVector(Y);if(G.equals(N))return j;if(U==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const le=new Q.Vector3().subVectors(G,X),ae=le.x<0&&Y.x>=0,Ie=le.y<0&&Y.y>=0,Ae=le.z<0&&Y.z>=0;this.startInfo.dragPointInCenterBottom=ae||Ie||Ae}if(U==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const le=new Q.Vector3().subVectors(G,X),ae=le.x<0&&Y.x>=0,Ie=le.y<0&&Y.y>=0,Ae=le.z<0&&Y.z>=0;this.startInfo.dragPointInCenterLeft=ae||Ie||Ae}const J=new Q.Vector3().subVectors(G,N),q=J.length();return q>.3?(console.warn("offset.length() > 0.3, skipped",q),j):J},v=m("ew"),p=m("ns"),g=()=>{const U=v;this.helperObject3D.cornerPositions.forEach((j,Y)=>{var N;(N=this.startInfo)!=null&&N.dragPointInCenterLeft?(Y===0||Y===3)&&j.add(U):(Y===1||Y===2)&&j.add(U)})},A=()=>{const U=p;this.helperObject3D.cornerPositions.forEach((j,Y)=>{var N;(N=this.startInfo)!=null&&N.dragPointInCenterBottom?(Y===0||Y===1)&&j.add(U):(Y===2||Y===3)&&j.add(U)})};switch(h){case"ew":g();break;case"ns":A();break;case"nesw":case"nwse":g(),A()}const w=new Q.Vector3().subVectors(r[1],r[0]).length()/u.length(),I=new Q.Vector3().subVectors(r[3],r[0]).length()/f.length(),C=new Q.Vector3(w,I,1),M=new b.Matrix4().scale(C);i.isCSS3DObjectPlus?i.applyScaleMatrix4(M):i.scale.applyMatrix4(M),s.position.copy(a);const E=new Q.Vector3().addVectors(r[0],r[2]).divideScalar(2),S=new Q.Vector3().subVectors(E,l),L=new b.Matrix4().setPosition(S);i.applyMatrix4(L),(W=this.helperObject3D.css3DInstance)==null||W.css3DObject.applyMatrix4(L),(R=this.helperObject3D.plane)==null||R.applyMatrix4(L),this.internalHooks.emit("applyObjectScale",{matrix:M}),this.internalHooks.emit("applyObjectPosition",{matrix:L}),this.render()}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class yk extends bk{constructor(...e){super(...e);d(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const i=e.point,s=a=>this.dragStart(a,e),o=this.dragging.bind(this),r=this.dragEnd.bind(this);i.addEventListener("dragstart",s),i.addEventListener("drag",o),i.addEventListener("dragend",r)})}}class wk extends Xs{constructor(...e){super(...e);d(this,"name","BoundingBoxController")}}class Ck extends YE{constructor(e,i){super(e,i);d(this,"name","ScaleHelper");d(this,"scaleMeshes",[]);d(this,"positions",[]);i&&(this.positions=i.positions)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}initialPosition(e){this.position.copy(this.originObject3D.position);const i=typeof this.positions=="function"?this.positions():this.positions;i&&(this.scaleMeshes=i.map((s,o)=>{var a;const r=(a=this.scaleMeshes[o])!=null?a:Pk();return r.position.copy(s.handlePosition),r.scalePosition=s,this.addIfNotExists(r),r}))}setScaleByCamera(e){this.scaleMeshes.forEach(i=>{i.scale.setScalar(Vl(e,i.scalePosition.handlePosition.clone().applyMatrix4(this.matrixWorld)))})}}function Pk(){const n=new b.Group;n.name="ScaleHelperCube";const t=.05,e=new b.BoxGeometry(t,t,t),i=new b.MeshBasicMaterial({color:16776960,transparent:!0,side:b.DoubleSide}),s=new b.MeshBasicMaterial({color:16776960,opacity:.4,depthTest:!1,depthWrite:!1,transparent:!0,side:b.DoubleSide}),o=new b.Mesh(e,i),r=new b.Mesh(e,s);return o.name="ScaleHelperCube-front",r.name="ScaleHelperCube-behind",o.renderOrder=11,r.renderOrder=10,n.add(o,r),n}class Ik extends Xs{constructor(...e){super(...e);d(this,"name","ScaleController");d(this,"startInfo");d(this,"dragStart",e=>{if(this.isDragging)return;this.isDragging=!0;const{intersect:i}=e,s=this.camera.position;let o=i.object;o.scalePosition||(o=i.object.parent);const r=o.scalePosition.basePosition.clone(),l=o.scalePosition.handlePosition.clone().clone().sub(r).clone(),c=new b.Line3(r,r.clone().add(l.normalize().multiplyScalar(5)));c.applyMatrix4(this.helperObject3D.matrixWorld);const h=new b.Raycaster(s,i.point.clone().sub(s)),u=gn({raycaster:h,line:c});this.startInfo={line:c,scaleStartPoint:u,draggingObject:o},this.helperObject3D.scaleMeshes.forEach(f=>{f.uuid!==o.uuid&&(f.visible=!1)}),o.visible=!0,this.hooks.emit("scaleStart")});d(this,"dragging",e=>{if(!this.isDragging||!this.startInfo)return;const i="touches"in e?e.touches[0].clientX:e.x,s="touches"in e?e.touches[0].clientY:e.y,o=Cr(this.camera,{x:i,y:s},this.container);return o?(this.scale(o),!1):this.dragEnd()});d(this,"scale",e=>{var l,c;if(!this.startInfo)return;const{line:i,scaleStartPoint:s,draggingObject:o}=this.startInfo,{scalePosition:r}=o,a=gn({raycaster:e,line:i,clampToLine:!1});a.applyMatrix4(new b.Matrix4().getInverse(this.helperObject3D.matrixWorld.clone())),(c=(l=this.config)==null?void 0:l.scaleCallback)==null||c.call(l,{intersectPoint:a,scalePosition:r,offset:a.clone().sub(s)}),o.position.copy(a.clone()),this.hooks.emit("scale",new b.Vector3(1,1,1))});d(this,"dragEnd",()=>{this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.scaleMeshes.forEach(e=>{e.visible=!0}),this.internalHooks.emit("initialHelperPosition"),this.hooks.emit("scaleEnd"))});const i=this.show.bind(this),s=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",this.dragStart),document.addEventListener("mousemove",this.dragging),document.addEventListener("mouseup",this.dragEnd),this.domEvents.addEventListener(this.helperObject3D,"touchstart",this.dragStart),document.addEventListener("touchmove",this.dragging),document.addEventListener("touchend",this.dragEnd),this.hooks.on("rotateStart",s),this.hooks.on("rotateEnd",i),this.hooks.on("moveStart",s),this.hooks.on("moveEnd",i),this.hooks.on("moveByMouseEnable",s),this.hooks.on("moveByMouseDisable",i),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",this.dragStart),document.removeEventListener("mousemove",this.dragging),document.removeEventListener("mouseup",this.dragEnd),this.domEvents.removeEventListener(this.helperObject3D,"touchstart",this.dragStart),document.removeEventListener("touchmove",this.dragging),document.removeEventListener("touchend",this.dragEnd),this.hooks.off("rotateStart",s),this.hooks.off("rotateEnd",i),this.hooks.off("moveStart",s),this.hooks.off("moveEnd",i),this.hooks.off("moveByMouseEnable",s),this.hooks.off("moveByMouseDisable",i)})}initialHelperPosition(){this.helperObject3D.initialPosition();const e=this;e.offHoverListener&&e.offHoverListener(),e.offHoverListener=this.hoverListener(this.helperObject3D.scaleMeshes)}setScale(e){var l,c,h;let i=1,s=1,o=1;typeof e=="number"?(i=e,s=e,o=e):typeof e=="object"&&(i=(l=e.x)!=null?l:1,s=(c=e.y)!=null?c:1,o=(h=e.z)!=null?h:1);const r=new b.Vector3(i,s,o);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.internalHooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}function Re(n,t){this._camera=n||null,this._domElement=t||document,this._raycaster=new b.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}Re.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)},Re.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"],Re.prototype._getRelativeMouseXY=function(n){var t=n.target||n.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},i=t,s=getComputedStyle(i,null);e.y+=parseInt(s.getPropertyValue("padding-top"),10),e.x+=parseInt(s.getPropertyValue("padding-left"),10);do e.x+=i.offsetLeft,e.y+=i.offsetTop,s=getComputedStyle(i,null),e.x+=parseInt(s.getPropertyValue("border-left-width"),10),e.y+=parseInt(s.getPropertyValue("border-top-width"),10);while(i=i.offsetParent);var o={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((n.pageX-e.x)/o.width)*2-1,y:-((n.pageY-e.y)/o.height)*2+1}},Re.prototype._objectCtxInit=function(n){n._3xDomEvent={}},Re.prototype._objectCtxDeinit=function(n){delete n._3xDomEvent},Re.prototype._objectCtxIsInit=function(n){return!!n._3xDomEvent},Re.prototype._objectCtxGet=function(n){return n._3xDomEvent},Re.prototype.camera=function(n){return n&&(this._camera=n),this._camera},Re.prototype.bind=function(n,t,e,i){console.assert(Re.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(n)||this._objectCtxInit(n);var s=this._objectCtxGet(n);s[t+"Handlers"]||(s[t+"Handlers"]=[]),s[t+"Handlers"].push({callback:e,useCapture:i}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(n)},Re.prototype.addEventListener=Re.prototype.bind,Re.prototype.unbind=function(n,t,e,i){console.assert(Re.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(n)||this._objectCtxInit(n);var s=this._objectCtxGet(n);s[t+"Handlers"]||(s[t+"Handlers"]=[]);for(var o=s[t+"Handlers"],r=0;r<o.length;r++){var a=o[r];if(e==a.callback&&i==a.useCapture){o.splice(r,1);break}}var l=this._boundObjs[t].indexOf(n);this._boundObjs[t].splice(l,1)},Re.prototype.removeEventListener=Re.prototype.unbind,Re.prototype._bound=function(n,t){var e=this._objectCtxGet(t);return e?!!e[n+"Handlers"]:!1},Re.prototype._onMove=function(n,t,e,i){var s=this._boundObjs[n];if(!(s===void 0||s.length===0)){var o=new b.Vector2;o.set(t,e),this._raycaster.setFromCamera(o,this._camera);var r=this._raycaster.intersectObjects(s),a=this._selected;if(r.length>0){var l,c,h,u=r[0],f=u.object;this._selected=f,h=this._bound("mousemove",f),a!=f&&(l=this._bound("mouseover",f),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;h&&this._notify("mousemove",f,i,u),l&&this._notify("mouseover",f,i,u),c&&this._notify("mouseout",a,i,u)}},Re.prototype._onEvent=function(n,t,e,i){var s=this._boundObjs[n];if(!(s===void 0||s.length===0)){var o=new b.Vector2;o.set(t,e),this._raycaster.setFromCamera(o,this._camera);var r=this._raycaster.intersectObjects(s,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),h=l.parent;typeof c=="undefined"&&h;)c=this._objectCtxGet(h),h=h.parent;c&&this._notify(n,l,i,a)}}},Re.prototype._notify=function(n,t,e,i){var s=this._objectCtxGet(t),o=s?s[n+"Handlers"]:null;if(!s||!o||o.length===0){t.parent&&this._notify(n,t.parent,e,i);return}for(var o=s[n+"Handlers"],r=0;r<o.length;r++){var a=o[r],l=!0;a.callback({type:n,target:t,origDomEvent:e,intersect:i,stopPropagation:function(){l=!1}}),l&&a.useCapture===!1&&t.parent&&this._notify(n,t.parent,e,i)}},Re.prototype._onMouseDown=function(n){return this._onMouseEvent("mousedown",n)},Re.prototype._onMouseUp=function(n){return this._onMouseEvent("mouseup",n)},Re.prototype._onMouseEvent=function(n,t){var e=this._getRelativeMouseXY(t);this._onEvent(n,e.x,e.y,t)},Re.prototype._onMouseMove=function(n){var t=this._getRelativeMouseXY(n);this._onMove("mousemove",t.x,t.y,n),this._onMove("mouseover",t.x,t.y,n),this._onMove("mouseout",t.x,t.y,n)},Re.prototype._onClick=function(n){this._onMouseEvent("click",n)},Re.prototype._onDblClick=function(n){this._onMouseEvent("dblclick",n)},Re.prototype._onContextmenu=function(n){this._onMouseEvent("contextmenu",n)},Re.prototype._onTouchStart=function(n){return this._onTouchEvent("touchstart",n)},Re.prototype._onTouchEnd=function(n){return this._onTouchEvent("touchend",n)},Re.prototype._onTouchMove=function(n){if(n.touches.length==1){var t=Number(n.touches[0].pageX/window.innerWidth)*2-1,e=-(n.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,n),this._onMove("mouseover",t,e,n),this._onMove("mouseout",t,e,n)}},Re.prototype._onTouchEvent=function(n,t){var e=t.touches;if(e.length==0&&(e=t.changedTouches),e.length==1){var i=Number(e[0].pageX/window.innerWidth)*2-1,s=-(e[0].pageY/window.innerHeight)*2+1;this._onEvent(n,i,s,t)}};const Gl="Object3DHelperPlugin",Ir=Gl,Mk=()=>{console.error(`${Ir} is disposed`)},Ek=()=>{console.warn(`${Ir} is disabled`)},kk=()=>{console.error(`${Ir} is disabled`)};class Ql extends Ri{constructor(e){super(e);d(this,"name",Gl);d(this,"state",{visible:!0,enabled:!0,disposed:!1});d(this,"objectHelperMap",new Map);d(this,"css3DObjectParentMap",new Map);d(this,"css3DRender");this.five=e,this.css3DRender=new jn(this.five.scene),console.warn("Object3DHelper: 使用此插件,需要在初始化five时,设置five参数: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${Gl.toUpperCase()}_DEBUG__`]:this})}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,i){if(this.state.disposed)return Mk();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return kk();const s=x({},this.state);this.state=x(x({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:s})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,i={}){var w;if(!e){console.error("Object3D is undefined");return}if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const s=new vk,o=[],r=(w=this.five.getElement())==null?void 0:w.parentElement,a=this.five.camera,c=x(x({},{moveHelper:!0,rotateHelper:!0,scaleHelper:!0,boundingBoxHelper:!1,positionFrom:"objectPosition"}),i),{moveHelper:h,rotateHelper:u,scaleHelper:f,boundingBoxHelper:m}=c,v=s.hooks,p=new ht,g=new Re(this.five.camera,this.five.getElement()),A=I=>{if(I)return typeof I=="boolean"?I:I.enable};if(A(h)){const I=x(x({},this.getConfig(c.moveHelper)),c),C=new tk(e,x({},I)),M=new Zs(this.five,g,fk,e,C,I,v,p);s.addControllers({moveController:M.helperController}),o.push(()=>M.dispose())}if(A(u)){const I=x(x({},this.getConfig(c.rotateHelper)),c),C=new sk(e,x({container:r},I)),M=new Zs(this.five,g,Ak,e,C,I,v,p);s.addControllers({rotateController:M.helperController}),o.push(()=>M.dispose())}if(A(m)){const I=new hk(e),C=new Zs(this.five,g,wk,e,I,void 0,v,p);s.addControllers({boundingBoxController:C.helperController})}if(A(f))if(e.isCSS3DObjectPlus&&r){const I=new ck(e,r,a,this.five.scene),C=new Zs(this.five,g,yk,e,I,void 0,v,p);s.addControllers({scaleController:C.helperController}),o.push(()=>C.dispose()),ni(this.five).then(()=>{var M,E;if(e.isCSS3DObjectPlus){const S=e;if(!S||S.mode!=="front")return;const L=(M=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?M:va(this.five);L&&(this.css3DObjectParentMap.set(S,S.parent),S.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(L),(E=this.css3DRender.getBehindCSS3DObjectGroup())==null||E.add(S),this.css3DRender.render(this.five.camera))}})}else{const I=x(x({},this.getConfig(c.scaleHelper)),c),C=new Ck(e,I),M=new Zs(this.five,g,Ik,e,C,I,v,p);s.addControllers({scaleController:M.helperController}),o.push(()=>M.dispose())}return this.objectHelperMap.set(e,{helper:s,disposers:o}),s.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:i,disposers:s}=this.objectHelperMap.get(e);if(i){if(e.isCSS3DObjectPlus){const o=e,r=this.css3DObjectParentMap.get(o);r&&r.add(o),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),i.dispose(),s==null||s.forEach(o=>o==null?void 0:o())}}handleEnable(e,i=!0){e?(this.everyHelperDo(s=>s.enable()),this.hooks.emit("enable",{userAction:i})):(this.everyHelperDo(s=>s.disable()),this.hooks.emit("disable",{userAction:i})),this.state.enabled=e}handleVisible(e,i=!0){e?(this.everyHelperDo(s=>s.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:i}))):(this.everyHelperDo(s=>s.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:i}))),this.state.visible=e}handleDispose(){this.everyHelperDo((e,i)=>{e.dispose(),i==null||i.forEach(s=>s==null?void 0:s())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:i,disposers:s})=>{i&&e(i,s)})}actionIfStateIsEnabled(e,i){if(this.state.enabled)return e();i!=null&&i.warnLog&&Ek()}getConfig(e){if(e&&typeof e!="boolean"&&e.enable)return e}}const xk=n=>new Ql(n),Dk=`
984
988
  varying vec2 vUv;
985
989
  void main() {
986
990
  vUv = uv;
@@ -1037,4 +1041,4 @@ void main() {
1037
1041
  gl_FragColor = texture2D(envMap, uv);
1038
1042
  gl_FragColor.a = gl_FragColor.a * opacity;
1039
1043
  }
1040
- `;class Zk extends rs{constructor(e){super(e,Xk);d(this,"initialDisplacement",0);d(this,"oldTime",new Date().getTime());d(this,"flowSpeed",.6);d(this,"rotateSpeed",0);d(this,"flowAnimationDisposer",()=>{})}setInitialDisplacement(e,i="backward"){this.initialDisplacement=Math.abs(e)*(i==="forward"?-1:1),this.moveFromOrigin(this.initialDisplacement)}moveFromOrigin(e){const i=e*this.uPreMeter;return this.material.uniforms.uOffset.value=i,this.material.needsUpdate=!0,this.needsRender=!0,!0}moveForwardFromInitialOffset(e){const i=e*-1,s=this.initialDisplacement+i;this.moveFromOrigin(s)}flow(){this.flowAnimationDisposer(),this.oldTime=new Date().getTime();let e=0,i=0;const s=Ln(()=>{const o=new Date().getTime(),r=o-this.oldTime,a=this.flowSpeed*(r/1e3),l=this.rotateSpeed*(r/1e3);e=e+a,i=i+l;const c=1/360,h=i*c;this.material.uniforms.vOffset.value=h,this.moveForwardFromInitialOffset(e),this.oldTime=o});this.flowAnimationDisposer=function(){s(),this.moveForwardFromInitialOffset(0)}}stopFlow(){this.flowAnimationDisposer()}setSpeed(e){typeof(e==null?void 0:e.flowSpeed)=="number"&&(this.flowSpeed=e.flowSpeed),typeof(e==null?void 0:e.rotateSpeed)=="number"&&(this.rotateSpeed=e.rotateSpeed)}disposeAnime(){super.disposeAnime(),this.flowAnimationDisposer()}}const Dg={flowSpeed:.6,rotateSpeed:0};let Jk=class extends wi{constructor(e){super(e);d(this,"data");d(this,"state");d(this,"group");d(this,"pipeObjects",[]);d(this,"texturePromiseCache",new Map);d(this,"dispose",()=>{this.disable(),this.five.scene.remove(this.group),this.texturePromiseCache.forEach(e=>e.then(i=>i.dispose())),this.texturePromiseCache.clear()});d(this,"onWantsFiveTapGesture",(...e)=>{const[i]=e,s=i.intersectObjects(this.pipeObjects,!1);if(s.length===0||!this.data)return;const a=s[0].object.customID,l=this.data.pipes.find(({id:h})=>h===a),c=this.data.pipelines.find(h=>l&&h.pipes.includes(l));if(!(!l||!c))return this.hooks.emit("tap",{intersectObjects:s,pipe:l,pipeline:c,wantsFiveTapGestureParams:e}),!1});this.state={target:null,visible:!0,enabled:!0,isFlowing:!1,speed:Dg},this.five=e,this.group=new b.Group,this.group.name="water-pipe-group",this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.five.on("wantsTapGesture",this.onWantsFiveTapGesture)}load(e,i,s,o){return H(this,null,function*(){const r=this.data;this.data=yield this.formatData(e,o),this.removeAllPipes(),this.hooks.emit("dataChange",this.data,r),this.pipeObjects=yield Promise.all(this.data.pipes.filter(a=>!!(a!=null&&a.texture)).map(u=>H(this,[u],function*({id:a,texture:l,path:c,radius:h}){const f=yield this.loadPipeTexture(l),m={id:a,path:c,textureURL:l,texture:f,geometryConfig:{radius:h}};return new Zk(m)}))),this.data.pipelines.forEach(a=>{a.pipes.reduce((l,c)=>{const h=this.findPipeObjectWithID(c.id);return h==null||h.setInitialDisplacement(l),l+((h==null?void 0:h.pathLength)||0)},0)}),this.hooks.emit("dataLoaded",this.data),this.state.visible===!1&&this.pipeObjects.forEach(a=>a.setOpacity(0)),this.state.enabled&&(this.group.add(...this.pipeObjects),this.five.needsRender=!0),i&&this.setState(i,{userAction:s})})}setState(e,i={}){const s=this.state;if(wt(e,s,{deep:!0}))return;const o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o,anime:{duration:500}};e.visible?this._show(r):this._hide(r)}if(e.isFlowing!==void 0&&s.isFlowing!==e.isFlowing&&(e.isFlowing?this._flow():this._stopFlow()),e.speed!==void 0&&!wt(s.speed,this.state.speed,{deep:!0})&&this._setSpeed(e.speed),e.target!==void 0&&!wt(s.target,this.state.target,{deep:!0})){const r={target:e.target,showAnime:{duration:500},hideAnime:{duration:500}};this._switchPipelines(r)}}enable(e={}){var s;if(this.state.enabled)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({enabled:!0},i),this._enable({userAction:i})}disable(e={}){var s;if(this.state.enabled===!1)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({enabled:!1,isFlowing:!1},i),this._disable({userAction:i})}show(){return H(this,arguments,function*(e={}){if(this.state.visible)return;const i=x({userAction:!0,anime:{duration:500}},e);this.updateState({visible:!0},i.userAction),yield this._show(i)})}hide(){return H(this,arguments,function*(e={}){if(this.state.visible===!1)return;const i=x({userAction:!0,anime:{duration:500}},e);this.updateState({visible:!1},i.userAction),yield this._hide(i)})}switchPipelines(e){return H(this,null,function*(){var c,h,u,f,m,v;if(!this.data)return;const i=(c=e==null?void 0:e.target)!=null?c:null,s=(h=e==null?void 0:e.userAction)!=null?h:!0;this.updateState({target:i},s);const o={duration:500},r=(f=(u=e==null?void 0:e.hideAnime)!=null?u:e==null?void 0:e.anime)!=null?f:o,a=(v=(m=e==null?void 0:e.showAnime)!=null?m:e==null?void 0:e.anime)!=null?v:o,l={target:i,showAnime:a,hideAnime:r};this._switchPipelines(l)})}flow(e={}){var s;if(this.state.isFlowing)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({isFlowing:!0},i),this._flow()}stopFlow(e={}){var s;if(this.state.isFlowing===!1)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({isFlowing:!1},i),this._stopFlow()}setSpeed(e){var o,r;const i=(o=e==null?void 0:e.speed)!=null?o:Dg,s=(r=e.userAction)!=null?r:!0;this.updateState({speed:i},s),this._setSpeed(i)}formatData(e,i){return H(this,null,function*(){return Bk(e,i)})}_enable(e){this.hooks.emit("enable",{userAction:e.userAction}),this.five.scene.add(this.group),this.five.needsRender=!0,this.five.on("wantsTapGesture",this.onWantsFiveTapGesture)}_disable(e){this.hooks.emit("disable",{userAction:e.userAction}),this.disposeAnime(),this.five.scene.remove(this.group),this.five.needsRender=!0,this.five.off("wantsTapGesture",this.onWantsFiveTapGesture)}_show(e){return H(this,null,function*(){var o;this.hooks.emit("show",{userAction:e.userAction});const i=(o=e==null?void 0:e.anime)!=null?o:{duration:500},s=this.findPipeObjectWithTarget(this.state.target);yield Promise.all(s.map(r=>r==null?void 0:r.show(i))),this.five.needsRender=!0})}_hide(e){return H(this,null,function*(){var s;this.hooks.emit("hide",{userAction:e.userAction});const i=(s=e==null?void 0:e.anime)!=null?s:{duration:500};yield Promise.all(this.pipeObjects.map(o=>o.hide(i))),this.five.needsRender=!0})}_switchPipelines(e){return H(this,null,function*(){if(!this.data)return;const i=this.findPipeObjectWithTarget(e.target),s=e.hideAnime;yield Promise.all(this.pipeObjects.map(r=>r.hide(s)));const o=e.showAnime;yield Promise.all(i.map(r=>r.show(o)))})}_flow(){this.pipeObjects.forEach(e=>e.flow())}_stopFlow(){this.pipeObjects.forEach(e=>e.stopFlow())}_setSpeed(e){this.pipeObjects.forEach(i=>i.setSpeed(e))}updateState(e,i){const s=this.state;this.state=x(x({},this.state),e),this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}loadPipeTexture(e){return H(this,null,function*(){const i=this.texturePromiseCache.get(e);if(i)return i;const s=en(e);return this.texturePromiseCache.set(e,s),s})}disposeAnime(){this.pipeObjects.forEach(e=>e.disposeAnime()),this.five.needsRender=!0}removeAllPipes(){this.disposeAnime(),this.group.remove(...this.pipeObjects),this.pipeObjects.forEach(e=>e.dispose()),this.pipeObjects=[],this.five.needsRender=!0}findPipeObjectWithID(e){return this.pipeObjects.find(({customID:i})=>i===e)}findPipeObjectWithTarget(e){return e?Ok({data:this.data,target:e}).map(({id:s})=>this.findPipeObjectWithID(s)).filter(ke):this.pipeObjects}};const qk=n=>new Jk(n),Kk="data:image/png;base64,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";function $k(n){ge(n,"svelte-16mrlad",".room-label-item.svelte-16mrlad{position:absolute;font-size:0.625rem;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;color:#fff}.room-label-item__text.svelte-16mrlad{position:absolute;left:0;top:-4rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.25rem;min-width:2rem;padding:0 0.375rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-16mrlad{position:absolute;transform-origin:top;top:-2.75rem;height:3rem;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}")}function Sg(n){let t,e,i,s,o,r;return{c(){t=T("span"),e=Se(n[0]),i=te(),s=T("div"),P(t,"class","room-label-item__text svelte-16mrlad"),z(t,"background-image","url("+Kk+")"),P(s,"class","room-label-item__bar svelte-16mrlad")},m(a,l){B(a,t,l),O(t,e),n[13](t),B(a,i,l),B(a,s,l),n[14](s),o||(r=Ce(t,"click",function(){si(n[4])&&n[4].apply(this,arguments)}),o=!0)},p(a,l){n=a,l&1&&Te(e,n[0])},d(a){a&&V(t),n[13](null),a&&V(i),a&&V(s),n[14](null),o=!1,r()}}}function ex(n){let t,e=!n[5]&&Sg(n);return{c(){t=T("div"),e&&e.c(),P(t,"class","room-label-item svelte-16mrlad"),z(t,"z-index",n[2]),z(t,"transform",n[3]),z(t,"opacity",n[1]),z(t,"visibility",n[9])},m(i,s){B(i,t,s),e&&e.m(t,null),n[15](t)},p(i,[s]){i[5]?e&&(e.d(1),e=null):e?e.p(i,s):(e=Sg(i),e.c(),e.m(t,null)),s&4&&z(t,"z-index",i[2]),s&8&&z(t,"transform",i[3]),s&2&&z(t,"opacity",i[1]),s&512&&z(t,"visibility",i[9])},i:$,o:$,d(i){i&&V(t),e&&e.d(),n[15](null)}}}function tx(n,t,e){let i,{content:s}=t,{five:o=void 0}=t,{visible:r=!0}=t,{opacity:a=1}=t,{zIndex:l=0}=t,{transform:c=void 0}=t,{onClick:h=()=>{}}=t,{rendererIfNeed:u=void 0}=t,{rendererData:f=void 0}=t,m,v,p,g;const A=M=>{if(o.state.mode!=="Panorama"){const L=-(10+54*(1-qo(M.latitude)/90)),W=L+20,R=W>=0?0:-W/44;e(7,v.style.transform=`scaleY(${R})`,v),e(7,v.style.top=`${W}px`,v),e(8,p.style.top=`${L}px`,p)}};Et(()=>{m&&typeof u=="function"&&(g=u(m,f)),o&&(A(o.camera.pose),o.on("cameraUpdate",A))}),Ft(()=>{g==null||g(),o==null||o.off("cameraUpdate",A)});function w(M){Qe[M?"unshift":"push"](()=>{p=M,e(8,p)})}function I(M){Qe[M?"unshift":"push"](()=>{v=M,e(7,v)})}function C(M){Qe[M?"unshift":"push"](()=>{m=M,e(6,m)})}return n.$$set=M=>{"content"in M&&e(0,s=M.content),"five"in M&&e(10,o=M.five),"visible"in M&&e(11,r=M.visible),"opacity"in M&&e(1,a=M.opacity),"zIndex"in M&&e(2,l=M.zIndex),"transform"in M&&e(3,c=M.transform),"onClick"in M&&e(4,h=M.onClick),"rendererIfNeed"in M&&e(5,u=M.rendererIfNeed),"rendererData"in M&&e(12,f=M.rendererData)},n.$$.update=()=>{n.$$.dirty&2048&&e(9,i=r?"visible":"hidden")},[s,a,l,c,h,u,m,v,p,i,o,r,f,w,I,C]}class Lg extends ue{constructor(t){super(),de(this,t,tx,ex,he,{content:0,five:10,visible:11,opacity:1,zIndex:2,transform:3,onClick:4,rendererIfNeed:5,rendererData:12},$k)}}class ix extends yh{constructor(e){super();d(this,"areaMakerItem");this.areaMakerItem=e}raycast(e,i){this.areaMakerItem.makerObject.raycast(e,i)}}class nx{constructor(t,e){d(this,"id");d(this,"name","");d(this,"makerObject");d(this,"outline");d(this,"bottomY");d(this,"opacity");d(this,"height");d(this,"floorIndex");d(this,"shape");d(this,"mounted",!1);d(this,"checkMsg",{checkVisibleMsg:"",checkTagVisibleMsg:""});d(this,"modelGroup");d(this,"visible",!0);d(this,"tagApp");d(this,"tagVisible",null);d(this,"tagPosition",new b.Vector3);d(this,"tagNDCPosition",new b.Vector3);d(this,"tagTransform",{left:0,top:0});d(this,"tagZIndex",0);d(this,"hooks",new ht);d(this,"itemRenderer");d(this,"data");d(this,"plugin");d(this,"opacityAnime");d(this,"isInContainerResizeAnimation",!1);d(this,"containerResizeTimeoutID",null);d(this,"resizeObserver");d(this,"doOpacityAnime",t=>{var a;(a=this.opacityAnime)==null||a.dispose();const e=t.duration,[i,s]=t.makerObjectOpacity,[o,r]=t.outlineOpacity;if(e===0){this.makerObject.material.opacity=s,this.outline.material.opacity=r;return}return new Promise(l=>{this.opacityAnime=new Dn({makerObjectOpacity:i,outlineOpacity:o}).to({makerObjectOpacity:s,outlineOpacity:r}).onUpdate(({makerObjectOpacity:c,outlineOpacity:h})=>{this.makerObject.material.opacity=c,this.outline.material.opacity=h,this.plugin.five.needsRender=!0}).onComplete(()=>l(!0)).onDispose(()=>{this.makerObject.material.opacity=s,this.outline.material.opacity=r,this.plugin.five.needsRender=!0,l(!1)}).play()})});d(this,"onPluginConfigChange",t=>{this.makerObject.material.depthTest=t.config.modelDepthTest,this.outline.material.depthTest=t.config.modelDepthTest,this.plugin.five.needsRender=!0});d(this,"onPluginStateChange",()=>{this.updateVisible(),this.updateTagVisible()});d(this,"updateVisible",()=>{var s;const{result:t,msg:e}=this.checkVisible();if(this.checkMsg.checkVisibleMsg=e,this.visible===t)return;this.visible=t;const i=(s=this.data.object_data.visible)!=null?s:!0;this.modelGroup.visible=t&&i,this.plugin.five.needsRender=!0});d(this,"checkVisible",()=>{if(!this.plugin.state.visible)return{result:!1,msg:"插件不可见"};const e=this.plugin.fiveUtil.model.shownFloor;return e===null||e===this.floorIndex?{result:!0,msg:""}:{result:!1,msg:`模型高亮楼层不符合展示条件, 当前高亮楼层为:${e}`}});d(this,"updateTag",()=>{this.tagApp&&(this.updateTagNDCPosition(),this.updateTagDomTransform(),this.updateTagVisible())});d(this,"updateTagNDCPosition",()=>{const e=this.tagPosition.clone().project(this.plugin.five.camera);this.tagNDCPosition.copy(e)});d(this,"updateTagDomTransform",()=>{var s;const t=this.tagNDCPosition,e=Math.round((t.x+1)/2*this.plugin.tagDomContainer.clientWidth),i=Math.round((-t.y+1)/2*this.plugin.tagDomContainer.clientHeight);this.tagTransform.left===e&&this.tagTransform.top===i||(this.tagTransform={left:e,top:i},(s=this.tagApp)==null||s.$set({transform:`translate(${e}px, ${i}px)`}))});d(this,"updateTagVisible",()=>{var i;const{result:t,msg:e}=this.checkTagVisible();this.checkMsg.checkTagVisibleMsg=e,this.tagVisible!==t&&(this.tagVisible=t,this.tagApp&&(this.tagVisible?this.hooks.emit("tagShow"):this.hooks.emit("tagHide"),(i=this.tagApp)==null||i.$set({visible:t})))});d(this,"checkTagVisible",()=>{if(!this.visible)return{result:!1,msg:"标注整体不可见"};if(this.isInContainerResizeAnimation)return{result:!1,msg:"处于容器 resize 动画中"};const e=this.plugin.five,i=e.camera.position.clone();vi.set(i.clone(),this.tagPosition.clone().sub(i).normalize());const[s]=this.plugin.fiveUtil.model.intersectRaycaster(vi),o=this.tagPosition.distanceTo(e.camera.position);if(s&&s.distance+.1<o)return{result:!1,msg:"标注标签被 Five 模型遮挡"};const r=this.tagNDCPosition;return Math.abs(r.x)>1.2||Math.abs(r.y)>1.2||Math.abs(r.z)>1?{result:!1,msg:"标注标签不在屏幕内"}:{result:!0,msg:""}});d(this,"onFiveCameraUpdate",()=>{this.tagApp&&this.visible&&(this.updateTagNDCPosition(),this.updateTagDomTransform(),this.updateTagVisible())});d(this,"onContainerResize",()=>{this.isInContainerResizeAnimation===!1&&(this.isInContainerResizeAnimation=!0,this.updateTag());const e=()=>{this.isInContainerResizeAnimation=!1,this.containerResizeTimeoutID=null,this.updateTag()};this.containerResizeTimeoutID&&clearTimeout(this.containerResizeTimeoutID),this.containerResizeTimeoutID=setTimeout(e,100)});var l,c,h,u;const i=e.object_data,s=i.bottom_y,o=i.height,r=new b.Color((l=i.color)!=null?l:"#FFFFFF"),a=(c=i.opacity)!=null?c:.4;this.data=e,this.id=e.id,this.name=(h=e.name)!=null?h:"",this.plugin=t,this.height=o,this.bottomY=s,this.opacity=a,this.shape=new b.Shape().fromJSON(i.shape),this.floorIndex=e.floor_index,this.makerObject=new b.Mesh(Tg(this.shape,o),sx(r,a)),Yl(this.makerObject,s),this.makerObject.material.depthTest=this.plugin.config.modelDepthTest,this.outline=new wh(new b.EdgesGeometry(this.makerObject.geometry),new b.LineBasicMaterial({color:r,transparent:!0})),Yl(this.outline,s),this.outline.material.depthTest=this.plugin.config.modelDepthTest,this.setHeight(o),this.modelGroup=new ix(this),this.modelGroup.visible=(u=i.visible)!=null?u:!0}mount(){if(this.mounted)return;this.mounted=!0,this.updateVisible(),this.makerObject.material.depthTest=this.plugin.config.modelDepthTest,this.outline.material.depthTest=this.plugin.config.modelDepthTest,this.modelGroup.add(this.makerObject,this.outline);const t=!!this.name,e=this.plugin.tagDomContainer;t&&(this.tagApp=new Lg({target:e,props:{rendererData:this.data,content:this.name,visible:this.tagVisible,rendererIfNeed:this.itemRenderer,transform:`translate(${this.tagTransform.left}px, ${this.tagTransform.top}px)`,onClick:i=>this.hooks.emit("tagClick",{target:this,nativeEvent:i})}}),this.updateTag()),this.plugin.five.needsRender=!0,this.plugin.hooks.on("stateChange",this.onPluginStateChange),this.plugin.hooks.on("configChange",this.onPluginConfigChange),this.plugin.five.on("modeChange",this.updateVisible),this.plugin.five.on("modelShownFloorChange",this.updateVisible),this.plugin.five.on("cameraUpdate",this.onFiveCameraUpdate),this.resizeObserver=Mo(this.onContainerResize,e),this.resizeObserver.observe()}unmount(){var t,e;this.mounted&&(this.mounted=!1,this.modelGroup.remove(...this.modelGroup.children),(t=this.tagApp)==null||t.$destroy(),this.tagApp=null,this.plugin.hooks.off("stateChange",this.onPluginStateChange),this.plugin.hooks.off("configChange",this.onPluginConfigChange),this.plugin.five.off("modeChange",this.updateVisible),this.plugin.five.off("modelShownFloorChange",this.updateVisible),this.plugin.five.off("cameraUpdate",this.onFiveCameraUpdate),(e=this.resizeObserver)==null||e.unobserve())}setOpacity(t){var e;this.opacity=t,(e=this.opacityAnime)==null||e.dispose(),this.makerObject.material.opacity=t,this.plugin.five.needsRender=!0}setColor(t){const e=new b.Color(t);this.makerObject.material.color=e,this.outline.material.color=e,this.plugin.five.needsRender=!0}setHeight(t){if(t<=0)throw new Error("高度必须大于 0");this.height=t,this.makerObject.geometry=Tg(this.shape,t),this.outline.geometry=new b.EdgesGeometry(this.makerObject.geometry);const e=this.shape.extractPoints(10).shape.slice(0,-1),i=w1(e),s=new b.Vector3(i.x,i.y,t);Yl(s,this.bottomY),this.tagPosition.copy(s),this.updateTag(),this.plugin.five.needsRender=!0}setTagZIndex(t){var e;this.tagZIndex!==t&&((e=this.tagApp)==null||e.$set({zIndex:t}))}}function Tg(n,t){return new b.ExtrudeBufferGeometry(n,{depth:t,bevelEnabled:!1})}function sx(n,t){return new b.MeshBasicMaterial({color:n,opacity:t,transparent:!0})}function Yl(n,t){const e=new b.Matrix4,i=new b.Matrix4().makeRotationX(Math.PI/2),s=new b.Matrix4().makeTranslation(0,0,-t),o=new b.Matrix4().makeScale(1,1,-1);e.multiply(i),e.multiply(s),e.multiply(o),n.applyMatrix4(e)}let ox=class extends wi{constructor(e,i){super(e);d(this,"state");d(this,"itemMap");d(this,"itemRenderer");d(this,"modelGroup");d(this,"data");d(this,"tagDomContainer");d(this,"checkMsg",{childrenMountedState:""});d(this,"isInFiveChangeModeAnime",!1);d(this,"childrenMountedState",!1);d(this,"_config");d(this,"_disposed",!1);d(this,"dispose",()=>{this.five.scene.remove(this.modelGroup)});d(this,"onFiveInitAnimationWillStart",()=>{this.isInFiveChangeModeAnime=!0,this.updateChildrenMountedState()});d(this,"onFiveInitAnimationEnded",()=>{this.isInFiveChangeModeAnime=!1,this.updateChildrenMountedState()});d(this,"onFiveCameraUpdate",()=>{const e=this.five.camera;[...this.itemMap.values()].sort((s,o)=>{const r=s.tagPosition.distanceTo(e.position);return o.tagPosition.distanceTo(e.position)-r}).forEach((s,o)=>{var r;(r=this.getMaskItemByID(s.id))==null||r.setTagZIndex(o*10)})});d(this,"onFiveModeChange",()=>{this.updateChildrenMountedState()});d(this,"onMakerTagClick",e=>{this.hooks.emit("wantsTap",{target:e.target,intersectObjects:[]})});d(this,"onWantsFiveTapGesture",e=>{const i=Array.from(this.itemMap.values()).filter(l=>l.mounted&&l.visible).map(l=>({makerItem:l,intersects:l.modelGroup.getRaycastIntersects(e)})).filter(({intersects:l})=>l.length>0);if(i.length===0)return;const s=i.reduce((l,c)=>{const h=l.intersects[0].distance,u=c.intersects[0].distance;return h<u?l:c}),o=this.fiveUtil.model.intersectRaycaster(e)[0];if(this.config.modelDepthTest&&o&&o.distance<s.intersects[0].distance)return;if(this.hooks.emit("wantsTap",{target:s.makerItem,intersectObjects:s.intersects}))return!1});this.five=e,this.tagDomContainer=document.createElement("div"),this.tagDomContainer.style.position="absolute",this.tagDomContainer.style.top="0",this.tagDomContainer.style.left="0",this.tagDomContainer.style.width="100%",this.tagDomContainer.style.height="100%",this.tagDomContainer.style.pointerEvents="none";const s={enabled:!0,visible:!0};this.state=Object.assign(s,i==null?void 0:i.initialState);const o=x({modelDepthTest:!0},i==null?void 0:i.config);this._config=o,this.modelGroup=new b.Group,this.modelGroup.name="ModelMakerPluginGroup",this.itemMap=new Map,this.state.enabled&&this._enable({userAction:!1})}get config(){return x({},this._config)}get disposed(){return this._disposed}load(e){return H(this,null,function*(){const i=this.data;this.data=this.formatData(e),this.hooks.emit("dataChange",this.data,i),this.modelGroup.remove(...this.modelGroup.children),this.itemMap.forEach(s=>s.unmount()),this.itemMap.clear(),this.childrenMountedState=!1,this.checkMsg.childrenMountedState="",this.data.list.forEach(s=>{const o=new nx(this,s);o.itemRenderer=this.itemRenderer,this.modelGroup.add(o.modelGroup),this.itemMap.set(s.id,o),o.hooks.on("tagClick",this.onMakerTagClick)}),this.updateChildrenMountedState()})}appendTo(e){e.appendChild(this.tagDomContainer)}enable(e={}){var s;if(this.state.enabled)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({enabled:!0},i),this._enable({userAction:i})}disable(e={}){var s;if(this.state.enabled===!1)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({enabled:!1},i),this._disable({userAction:i})}show(e){return H(this,null,function*(){if(this.state.visible)return Promise.resolve();if(this.disposed)return Promise.reject(new Error("不能在已销毁的插件上调用 show"));const i=x({userAction:!0},e);this.updateState({visible:!0},i.userAction),yield this._show(i)})}hide(e){return H(this,null,function*(){if(this.state.visible===!1)return;const i=x({userAction:!0},e);this.updateState({visible:!1},i.userAction),yield this._hide(i)})}setState(e,i={}){const s=this.state;if(wt(e,s,{deep:!0}))return;const o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o,anime:{duration:500}};e.visible?this._show(r):this._hide(r)}}updateConfig(e,i={}){var r;const s=this.config,o=x(x({},s),e);this._config=o,this.hooks.emit("configChange",{prevConfig:s,config:o,userAction:(r=i.userAction)!=null?r:!0})}getMaskItemByID(e){return this.itemMap.get(e)}formatData(e){function i(s){return s.list.length===0?!0:!("shape"in s.list[0].object_data)}return i(e)?{list:e.list.filter(s=>s.object_data.points.length>=3).map(s=>{const o=new b.Shape,r=s.object_data.points[0];return o.moveTo(r[0],r[2]),s.object_data.points.slice(1).forEach(l=>o.lineTo(l[0],l[2])),o.lineTo(r[0],r[2]),ie(x({},s),{floor_index:s.object_data.floorIndex,object_data:ie(x({},s.object_data),{bottom_y:r[1]+s.object_data.fixedY,shape:o.toJSON(),height:s.object_data.height+s.object_data.fixedHeight})})})}:e}checkChildrenMountedState(){const e=this.state,i=this.five;if(!e.enabled)return{result:!1,msg:"插件不可用"};const s=i.getCurrentState().mode;return s==="Panorama"?{result:!1,msg:`Five 模态不符合条件, 当前模态为:${s}`}:this.isInFiveChangeModeAnime?{result:!1,msg:"切换模态动画中不展示"}:{result:!0,msg:""}}updateChildrenMountedState(){const{result:e,msg:i}=this.checkChildrenMountedState();this.checkMsg.childrenMountedState=i,e!==this.childrenMountedState&&(this.childrenMountedState=e,this.itemMap.forEach(s=>{this.childrenMountedState?s.mount():s.unmount()}))}updateState(e,i){const s=this.state;this.state=x(x({},this.state),e),this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}_enable(e){this.hooks.emit("enable",{userAction:e.userAction}),this.five.scene.add(this.modelGroup),this.updateChildrenMountedState(),this.five.needsRender=!0,this.five.on("wantsTapGesture",this.onWantsFiveTapGesture),this.five.on("initAnimationWillStart",this.onFiveInitAnimationWillStart),this.five.on("initAnimationEnded",this.onFiveInitAnimationEnded),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraUpdate",this.onFiveCameraUpdate)}_disable(e){this.hooks.emit("disable",{userAction:e.userAction}),this.five.scene.remove(this.modelGroup),this.updateChildrenMountedState(),this.five.needsRender=!0,this.five.off("wantsTapGesture",this.onWantsFiveTapGesture),this.five.off("initAnimationWillStart",this.onFiveInitAnimationWillStart),this.five.off("initAnimationEnded",this.onFiveInitAnimationEnded),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraUpdate",this.onFiveCameraUpdate)}_show(e){return H(this,null,function*(){this.hooks.emit("show",e),this.five.needsRender=!0})}_hide(e){return H(this,null,function*(){this.hooks.emit("hide",e),this.five.needsRender=!0})}};const rx=(n,t)=>new ox(n,t);class ax extends Ri{constructor(e,i){super(e);d(this,"state");d(this,"checkMsg",{meshHidden:"",pluginDisabled:"",pluginHidden:""});d(this,"group",new b.Group);d(this,"mesh");d(this,"textureLoadingPromise");d(this,"opacityAnimeTween");d(this,"isInPanoMoveAnime",!1);d(this,"lastArrivedPanoIndex",-1);d(this,"_config");d(this,"_disposed",!1);d(this,"dispose",()=>{this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive)});d(this,"checkMeshVisible",()=>this.state.visible?this.config.imageURL===""?{result:!1,msg:"图片不存在"}:this.mesh.material.map?this.five.work?this.five.getCurrentState().mode!=="Panorama"?{result:!1,msg:"非全景模式"}:this.isInPanoMoveAnime?{result:!1,msg:"处于走点动画中"}:{result:!0,msg:""}:{result:!1,msg:"Five 数据未加载"}:{result:!1,msg:"指南针贴图未加载"}:{result:!1,msg:"插件隐藏"});d(this,"onTextureLoaded",e=>{this.mesh.material.map=e,this.mesh.material.needsUpdate=!0,this.updateMeshVisible()});d(this,"onFiveWillLoad",()=>{this.lastArrivedPanoIndex=-1,this.updateMeshVisible()});d(this,"onFivePanoWillArrive",e=>{var i;e!==this.five.getCurrentState().panoIndex&&(this.isInPanoMoveAnime=!0,(i=this.opacityAnimeTween)==null||i.dispose(),this.updateMeshVisible())});d(this,"onFivePanoArrived",e=>{e!==this.lastArrivedPanoIndex&&(this.lastArrivedPanoIndex=e,this.isInPanoMoveAnime=!1,this.updateMeshPosition(e),this.updateMeshVisible(),this.five.needsRender=!0)});d(this,"onMeshVisibleChange",e=>{var i;if((i=this.opacityAnimeTween)==null||i.dispose(),!e){this.mesh.visible=!1;return}this.mesh.material.setValues({opacity:0}),this.mesh.visible=!0,this.opacityAnimeTween=Ls(1e3).onUpdate(({progress:s})=>{var o;(o=this.mesh)==null||o.material.setValues({opacity:s}),this.five.needsRender=!0}).play()});d(this,"onFiveModeChange",()=>{this.updateMeshVisible()});this.five=e;const s={enabled:!0,visible:!0};this.state=Object.assign(s,i==null?void 0:i.initialState);const o=x({width:1.4,yOffset:.01,yRotate:0,imageURL:this.absoluteUrl("/release/web/logo.7febb17f.png")},i==null?void 0:i.config);this._config=o,this.group.name="current-pano-image-plugin-group",this.mesh=new b.Mesh(new b.PlaneBufferGeometry(this.config.width,this.config.width),new b.MeshBasicMaterial({transparent:!0,opacity:0,depthTest:!1})),this.mesh.visible=!1,this.group.add(this.mesh),this.updateMeshQuaternion(this.config.yRotate),this.state.visible||(this.checkMsg.pluginHidden="初始值设置为隐藏"),this.state.enabled||(this.checkMsg.pluginDisabled="初始值设置为禁用"),this.state.enabled&&this._enable({userAction:!1}),this.five.once("dispose",this.dispose)}get config(){return x({},this._config)}get disposed(){return this._disposed}enable(e={}){var s;if(this.state.enabled)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({enabled:!0},i),this.checkMsg.pluginDisabled="",this._enable({userAction:i})}disable(e={}){var s;if(this.state.enabled===!1)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({enabled:!1},i),this.checkMsg.pluginDisabled="调用 disable 禁用",this._disable({userAction:i})}show(e){return H(this,null,function*(){if(this.state.visible)return Promise.resolve();if(this.disposed)return Promise.reject(new Error("不能在已销毁的插件上调用 show"));const i=x({userAction:!0},e);this.updateState({visible:!0},i.userAction),this.checkMsg.pluginHidden="",this._show(i)})}hide(e){return H(this,null,function*(){if(this.state.visible===!1)return;const i=x({userAction:!0},e);this.updateState({visible:!1},i.userAction),this.checkMsg.pluginDisabled="调用 hide 隐藏",this._hide(i)})}setState(e,i={}){const s=this.state;if(wt(e,s,{deep:!0}))return;const o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this.checkMsg.pluginDisabled="":this.checkMsg.pluginDisabled="调用 setState 禁用",e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o,anime:{duration:500}};e.visible?this.checkMsg.pluginHidden="":this.checkMsg.pluginHidden="调用 setState 隐藏",e.visible?this._show(r):this._hide(r)}}updateConfig(e,i={}){var r;const s=this.config,o=x(x({},s),e);this._config=o,s.imageURL!==o.imageURL&&this.reloadTexture(o.imageURL),s.yOffset!==o.yOffset&&this.updateMeshPosition(this.five.getCurrentState().panoIndex),s.yRotate!==o.yRotate&&this.updateMeshQuaternion(o.yRotate),s.width!==o.width&&(this.mesh.geometry=new b.PlaneBufferGeometry(o.width,o.width)),this.hooks.emit("configChange",{prevConfig:s,config:o,userAction:(r=i.userAction)!=null?r:!0})}__whyCantSeeMesh(){if(this.disposed)return"插件已销毁";if(this.checkMsg.pluginDisabled)return this.checkMsg.pluginDisabled;if(this.checkMsg.pluginHidden)return this.checkMsg.pluginHidden;if(this.checkMsg.meshHidden)return this.checkMsg.meshHidden}updateState(e,i){const s=this.state;this.state=x(x({},this.state),e),this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}updateMeshVisible(){const{result:e,msg:i}=this.checkMeshVisible();this.checkMsg.meshHidden=i,e!==this.mesh.visible&&this.onMeshVisibleChange(e)}updateMeshPosition(e){const i=this.workUtil.getObserverStandingPosition(e);if(!i){console.warn("CurrentPanoImagePlugin: 无法获取到当前点位的 standingPosition");return}const s=i.clone().setY(i.y+this.config.yOffset);s&&this.mesh.position.copy(s)}reloadTexture(e){return H(this,null,function*(){if(this.mesh.material.map=null,e!==""){const i=en(e);this.textureLoadingPromise=i;const s=yield i;s.minFilter=b.LinearFilter,this.textureLoadingPromise===i&&(this.onTextureLoaded(s),this.textureLoadingPromise=null)}this.updateMeshVisible()})}updateMeshQuaternion(e){const i=new b.Quaternion;i.multiplyQuaternions(new b.Quaternion().setFromAxisAngle(new b.Vector3(1,0,0),-Math.PI/2),new b.Quaternion().setFromAxisAngle(new b.Vector3(0,0,1),e)),this.mesh.quaternion.copy(i)}_enable(e){this.hooks.emit("enable",{userAction:e.userAction}),this.config.imageURL&&!this.mesh.material.map&&!this.textureLoadingPromise&&this.reloadTexture(this.config.imageURL),this.five.scene.add(this.group),this.five.needsRender=!0,this.five.work&&this.onFiveWillLoad(),this.five.getCurrentState().mode==="Panorama"&&(this.onFiveModeChange(),this.onFivePanoArrived(this.five.getCurrentState().panoIndex)),this.five.on("willLoad",this.onFiveWillLoad),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange)}_disable(e){this.hooks.emit("disable",{userAction:e.userAction}),this.five.scene.remove(this.group),this.five.needsRender=!0,this.five.off("willLoad",this.onFiveWillLoad),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange)}_show(e){this.hooks.emit("show",e),this.updateMeshVisible(),this.five.needsRender=!0}_hide(e){this.hooks.emit("hide",e),this.updateMeshVisible(),this.five.needsRender=!0}}const lx=(n,t)=>new ax(n,t),cx={auto:"",pen:"","pen-forbidden":"","pen-crosshair":"","pne-polygon":"","pen-circle":"","crosshair-rectangle":"","crosshair-circle":""};class hx{constructor(t){d(this,"container");d(this,"deleteButton");this.container=t!=null?t:document.documentElement}setType(t){const e=cx[t];e?this.container.style.cursor=`url(${e}), auto`:this.container.style.cursor=t}showDeleteButton(t){const{clientX:e,clientY:i,container:s=this.container,onClick:o}=t;let r=this.deleteButton;return r||(r=document.createElement("div"),r.style.position="absolute",r.style.width="20px",r.style.height="20px",r.style.transform="translate(-50%, -40px)",r.style.borderRadius="50%",r.style.cursor="pointer",r.style.zIndex="9999",r.style.cursor="pointer",r.style.userSelect="none",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.backgroundImage="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTciIGhlaWdodD0iMjUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSIxMC43MDYlIiB5MT0iNDIuNzQ0JSIgeDI9Ijg5LjA2NCUiIHkyPSI1Ny4yMDglIiBpZD0icHJlZml4X19hIj48c3RvcCBzdG9wLWNvbG9yPSIjRkZGIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMCUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkZGIiBzdG9wLW9wYWNpdHk9Ii4zMDgiIG9mZnNldD0iNDkuNTY5JSIvPjxzdG9wIHN0b3AtY29sb3I9IiNGRkYiIHN0b3Atb3BhY2l0eT0iMCIgb2Zmc2V0PSIxMDAlIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iLS4yNSIgeT0iLS4yNSIgd2lkdGg9IjU3LjUiIGhlaWdodD0iMjMuNSIgcng9IjExLjI1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDEpIiBmaWxsPSIjMkMyQzJDIiBzdHJva2U9InVybCgjcHJlZml4X19hKSIgc3Ryb2tlLXdpZHRoPSIuNSIgZmlsbC1ydWxlPSJldmVub2RkIiBmaWxsLW9wYWNpdHk9Ii4zMDMiLz48L3N2Zz4=)",r.innerHTML='<svg width="16px" height="17px" viewBox="0 0 16 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><linearGradient x1="22.185491%" y1="100%" x2="66.8316686%" y2="6.67239121%" id="1"><stop stop-color="#FFFCFC" stop-opacity="0.6"></stop><stop stop-color="#FFFFFF" offset="100%"></stop></linearGradient></defs> <path fill="url(#1)" fill-rule="nonzero" transform="translate(2.16 2.16)" d="M11.2979686,2.71818182 C11.611378,2.71818182 11.8654465,2.97561809 11.8654465,3.29318182 C11.8654465,3.58428191 11.6519584,3.82485822 11.374972,3.86293275 L11.2979686,3.86818182 L10.464,3.868 L9.7236795,10.6246222 C9.64153248,11.3737453 9.04854423,11.9512142 8.32013277,12.0165596 L8.18206028,12.0227273 L3.68338622,12.0227273 C2.89302127,12.0227273 2.22904821,11.4205655 2.141767,10.6246222 L2.141767,10.6246222 L1.4,3.868 L0.567477876,3.86818182 C0.254068499,3.86818182 0,3.61074555 0,3.29318182 C0,3.00208173 0.213488114,2.76150541 0.49047449,2.72343089 L0.567477876,2.71818182 L11.2979686,2.71818182 Z M9.322,3.868 L2.542,3.868 L3.26978106,10.4976259 C3.28762252,10.6603274 3.39528004,10.7928487 3.53932022,10.8467307 L3.61412483,10.866894 L3.68338622,10.8727273 L8.18206028,10.8727273 C8.39410941,10.8727273 8.57224853,10.7111717 8.59566544,10.4976259 L8.59566544,10.4976259 L9.322,3.868 Z M8.16824216,0 C8.48165153,0 8.73572003,0.257436269 8.73572003,0.575 C8.73572003,0.866100087 8.52223192,1.1066764 8.24524554,1.14475093 L8.16824216,1.15 L3.69720434,1.15 C3.38379497,1.15 3.12972647,0.892563731 3.12972647,0.575 C3.12972647,0.283899913 3.34321458,0.0433235966 3.62020096,0.00524907226 L3.69720434,0 L8.16824216,0 Z"></path></svg>'),this.deleteButton=r,s.appendChild(r),r.style.left=`${e}px`,r.style.top=`${i}px`,r.onclick=()=>{s.removeChild(r),o()},r}removeDeleteButton(){this.deleteButton&&this.deleteButton.remove()}tip(t){return()=>this.closeTip()}closeTip(){}reset(){this.container.style.cursor="auto"}}class dx{constructor(){d(this,"five");d(this,"_cursor");d(this,"_pointSelector");d(this,"_fiveDomEvents");d(this,"_object3DHelper");d(this,"inited",!1);d(this,"init",t=>{this.inited=!0,this.five=t,this._cursor=void 0,this._pointSelector=void 0,this._fiveDomEvents=void 0,this._object3DHelper=void 0})}get cursor(){if(!this.inited)throw new Error("Global not inited");return this._cursor?this._cursor:(this._cursor=new hx(this.five.getElement()),this._cursor)}get pointSelector(){if(!this.inited)throw new Error("Global not inited");return this._pointSelector?this._pointSelector:(this._pointSelector=new ca(this.five,{mode:"cursor"}),this._pointSelector)}get fiveDomEvents(){if(!this.inited)throw new Error("Global not inited");return this._fiveDomEvents?this._fiveDomEvents:(this._fiveDomEvents=new Ss(this.five,{noEmitWhenNotInScene:!0}),this._fiveDomEvents)}get object3DHelper(){if(!this.inited)throw new Error("Global not inited");return this._object3DHelper?this._object3DHelper:(this._object3DHelper=new Ql(this.five),this._object3DHelper)}}const zg=new dx;window.globalModules=zg;function jg(n,t){return n?t(n)?n:n.parent?jg(n.parent,t):null:null}const ux="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==";let Og=null;class as extends Rt{constructor(e){var f,m;super();d(this,"name","PointMesh");d(this,"dom");d(this,"opacityBeforeHighlight");d(this,"highlighted",!1);d(this,"fontMesh");d(this,"backgroundMesh");d(this,"lastRenderDomItem");d(this,"paramsStyle");d(this,"_visible",!0);const u=e!=null?e:{},{point:i}=u,s=Yi(u,["point"]);this.paramsStyle=s!=null?s:{};const o=new b.BufferGeometry;o.setAttribute("position",new b.Float32BufferAttribute([0,0,0],3));const r={transparent:!0,side:b.DoubleSide,size:(f=e==null?void 0:e.size)!=null?f:8,map:Og||(Og=new b.TextureLoader().load(ux)),sizeAttenuation:!1},a=new b.PointsMaterial(ie(x({},r),{color:(m=e==null?void 0:e.color)!=null?m:16777215,depthTest:!0,opacity:1})),l=new b.PointsMaterial(ie(x({},r),{size:a.size,color:a.color,depthWrite:!1,depthTest:!1,opacity:.5})),c=new b.Points(o,a),h=new b.Points(o,l);this.fontMesh=c,this.backgroundMesh=h,c.name="FontMesh",h.name="BackgroundMesh",c.renderOrder=10,h.renderOrder=0,this.add(c,h),e!=null&&e.point&&this.position.copy(De(e.point)),e&&this.setStyle(e),this.addEventListener("removed",()=>{Do(this)}),Object.defineProperty(this,"visible",{set:v=>{this.dom&&(this.dom.container.style.display=v?"block":"none"),this._visible=v},get:()=>this._visible})}get color(){return this.fontMesh.material.color}get size(){return this.fontMesh.material.size}get style(){return{color:this.color,size:this.size,occlusionVisibility:this.fontMesh.material.depthTest,occlusionMode:this.backgroundMesh.visible?"depthWrite":"depthTest"}}get five(){var e,i;return(i=(e=window.globalModules)==null?void 0:e.five)!=null?i:window.$five}setStyle(e){ke(e.color)&&(this.fontMesh.material.setValues({color:e.color}),this.backgroundMesh.material.setValues({color:e.color})),ke(e.size)&&(this.fontMesh.material.setValues({side:e.size}),this.backgroundMesh.material.setValues({side:e.size})),ke(e.occlusionVisibility)&&(e.occlusionVisibility?e.occlusionMode==="depthTest"?(this.fontMesh.material.depthTest=!1,this.backgroundMesh.visible=!1):(this.fontMesh.material.depthTest=!0,this.backgroundMesh.visible=!0):(this.fontMesh.material.depthTest=!0,this.backgroundMesh.visible=!1))}highlight(){this.highlighted||(this.highlighted=!0,this.opacityBeforeHighlight=this.fontMesh.material.opacity,this.fontMesh.material.setValues({opacity:this.opacityBeforeHighlight*ra}))}unhighlight(){this.highlighted&&(this.highlighted=!1,this.fontMesh.material.setValues({opacity:this.opacityBeforeHighlight}))}updateMatrixWorld(e){super.updateMatrixWorld(e);const i=Es(this,this.position).toArray().join(",");i!==this.lastRenderDomItem&&(this.updateDom(),this.lastRenderDomItem=i)}updateDom(){const e=this.paramsStyle.tip;e&&!this.dom&&(this.dom=new Di(this.five),this.dom.intersectCheck=!1,this.dom.simulate3D=!0,this.dom.container.style.visibility="hidden");const i=s=>{var o;this.dom&&this.dom.__text!==s&&(this.dom.__text=s,s?this.dom.container.innerHTML=aa(s,{style:`color: #${ke((o=this.style)==null?void 0:o.color)?new b.Color(this.style.color).getHexString():"ffffff"}`}):this.dom.container.innerHTML="")};e?(i(e),this.dom.setPosition(this.position.clone())):i(null)}}class Xl extends Ht{constructor(e){super();d(this,"name","LineWithDotsMesh");d(this,"pointGroup",new Rt);d(this,"_paramsStyle");d(this,"setStyle",e=>{super.setStyle(e),this._paramsStyle=x(x({},this._paramsStyle),e),this.pointMeshes.forEach(i=>i.setStyle(ie(x({},this._paramsStyle),{color:e.lineColor,tip:void 0}))),this.updateEdgePointsVisibility(),this.needsRender=!0});d(this,"highlight",()=>{super.highlight(),this.pointMeshes.forEach(e=>e.highlight())});d(this,"unhighlight",()=>{super.unhighlight(),this.pointMeshes.forEach(e=>e.unhighlight())});d(this,"updateEdgePointsVisibility",()=>{var e;ke((e=this._paramsStyle)==null?void 0:e.pointVisibility)&&(this.startPoint&&(this.startPoint.visible=typeof this._paramsStyle.pointVisibility=="object"?this._paramsStyle.pointVisibility.startPoint:this._paramsStyle.pointVisibility),this.endPoint&&(this.endPoint.visible=typeof this._paramsStyle.pointVisibility=="object"?this._paramsStyle.pointVisibility.endPoint:this._paramsStyle.pointVisibility))});this.add(this.pointGroup),e&&this.setStyle(e),e!=null&&e.points&&this.setPoints(e.points)}get startPoint(){return this.pointMeshes[0]}get endPoint(){return this.pointMeshes.length<2?null:this.pointMeshes.at(-1)}get visiblePointMeshes(){return this.pointMeshes.filter(e=>e.visible)}get pointMeshes(){return this.pointGroup.children}setPoints(e){super.setPoints(e);const i=e.map(De).filter(ke);this.pointGroup.removeChildren(),this.addIfNotExists(this.pointGroup),i.forEach(s=>{var r;const o=new as(ie(x({},this.style),{color:(r=this._paramsStyle)==null?void 0:r.lineColor,tip:void 0}));o.position.copy(s),this.pointGroup.add(o)}),this.updateEdgePointsVisibility(),this.needsRender=!0}}function fx(n){const t=[...n];if(n.length<3)return n;const e=n.at(-1),i=n[0];return e.equals(i)||t.push(i),t}class Vg extends Rt{constructor(e){super();d(this,"name","PolylineBaseMesh");d(this,"lines",[]);d(this,"withDots");d(this,"paramsStyle");const r=e,{withDots:i,points:s}=r,o=Yi(r,["withDots","points"]);this.withDots=i!=null?i:!0,s&&this.setPoints(s),o&&this.setStyle(o),this.addEventListener("removed",()=>{Do(this)})}get style(){var e;return{lineColor:this.lineColor,lineWidth:this.lineWidth,opacity:this.opacity,dashed:this.dashed,occlusionVisibility:this.occlusionVisibility,occlusionMode:this.occlusionMode,lengthEnable:(e=this.paramsStyle)==null?void 0:e.lengthEnable}}get opacity(){var e,i,s;return(s=(e=this.lines[0])==null?void 0:e.lineOpacity)!=null?s:(i=this.paramsStyle)==null?void 0:i.lineOpacity}get lineColor(){var e,i,s;return(s=(e=this.lines[0])==null?void 0:e.color)!=null?s:(i=this.paramsStyle)!=null&&i.lineColor?new b.Color(this.paramsStyle.lineColor):void 0}get lineWidth(){var e,i,s;return(s=(e=this.lines[0])==null?void 0:e.lineWidth)!=null?s:(i=this.paramsStyle)==null?void 0:i.lineWidth}get dashed(){var e,i,s;return(s=(e=this.lines[0])==null?void 0:e.dashed)!=null?s:(i=this.paramsStyle)==null?void 0:i.dashed}get occlusionVisibility(){var e,i,s;return(s=(e=this.lines[0])==null?void 0:e.occlusionVisibility)!=null?s:(i=this.paramsStyle)==null?void 0:i.occlusionVisibility}get occlusionMode(){var e,i,s;return(s=(e=this.lines[0])==null?void 0:e.occlusionMode)!=null?s:(i=this.paramsStyle)==null?void 0:i.occlusionMode}get points(){var e;return this.lines.map(i=>i.points[0]).concat((e=this.lines.at(-1))==null?void 0:e.points[1]).filter(Boolean)}setPoints(e,i={closed:!1}){let s=e.map(De);i.closed&&(s=fx(s)),s.forEach((o,r)=>{var c;const a=s[r+1];if(r!==0&&a===void 0)return;const l=(c=this.lines[r])!=null?c:(()=>{const h=new Xl(ie(x({},this.style),{pointVisibility:this.withDots?{startPoint:r===0,endPoint:!0}:!1}));return this.lines[r]=h,this.add(h),h})();l.setStyle(this.style),l.setPoints([o,a])}),s.length===0?(this.lines.forEach(o=>o.removeFromParent()),this.lines=[]):s.length===1||this.lines.length>s.length-1&&this.lines.splice(s.length-1).forEach(o=>o.removeFromParent())}setStyle(e){this.paramsStyle=x(x({},this.paramsStyle),e),this.lines.forEach(i=>i.setStyle(this.paramsStyle))}highlight(){this.lines.forEach(e=>e.highlight())}unhighlight(){this.lines.forEach(e=>e.unhighlight())}}class pn extends Vg{constructor(...e){super(ie(x({},e[0]),{withDots:!1}));d(this,"name","PolylineMesh")}}class Qi extends Vg{constructor(...e){super(ie(x({},e[0]),{withDots:!0}));d(this,"name","PolylineWithDotsMesh")}}const Zl=typeof navigator!="undefined"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Jl(n,t,e,i){n.addEventListener?n.addEventListener(t,e,i):n.attachEvent&&n.attachEvent("on".concat(t),e)}function Js(n,t,e,i){n.removeEventListener?n.removeEventListener(t,e,i):n.detachEvent&&n.detachEvent("on".concat(t),e)}function Bg(n,t){const e=t.slice(0,t.length-1);for(let i=0;i<e.length;i++)e[i]=n[e[i].toLowerCase()];return e}function _g(n){typeof n!="string"&&(n=""),n=n.replace(/\s/g,"");const t=n.split(",");let e=t.lastIndexOf("");for(;e>=0;)t[e-1]+=",",t.splice(e,1),e=t.lastIndexOf("");return t}function mx(n,t){const e=n.length>=t.length?n:t,i=n.length>=t.length?t:n;let s=!0;for(let o=0;o<e.length;o++)i.indexOf(e[o])===-1&&(s=!1);return s}const qs={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Zl?173:189,"=":Zl?61:187,";":Zl?59:186,"'":222,"[":219,"]":221,"\\":220},ci={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},ql={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},pt={16:!1,18:!1,17:!1,91:!1},et={};for(let n=1;n<20;n++)qs["f".concat(n)]=111+n;let Ze=[],Ks=null,Rg="all";const Pi=new Map,$s=n=>qs[n.toLowerCase()]||ci[n.toLowerCase()]||n.toUpperCase().charCodeAt(0),gx=n=>Object.keys(qs).find(t=>qs[t]===n),px=n=>Object.keys(ci).find(t=>ci[t]===n);function Fg(n){Rg=n||"all"}function eo(){return Rg||"all"}function vx(){return Ze.slice(0)}function Ax(){return Ze.map(n=>gx(n)||px(n)||String.fromCharCode(n))}function bx(){const n=[];return Object.keys(et).forEach(t=>{et[t].forEach(e=>{let{key:i,scope:s,mods:o,shortcut:r}=e;n.push({scope:s,shortcut:r,mods:o,keys:i.split("+").map(a=>$s(a))})})}),n}function yx(n){const t=n.target||n.srcElement,{tagName:e}=t;let i=!0;const s=e==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(s||e==="TEXTAREA"||e==="SELECT")&&!t.readOnly)&&(i=!1),i}function wx(n){return typeof n=="string"&&(n=$s(n)),Ze.indexOf(n)!==-1}function Cx(n,t){let e,i;n||(n=eo());for(const s in et)if(Object.prototype.hasOwnProperty.call(et,s))for(e=et[s],i=0;i<e.length;)e[i].scope===n?e.splice(i,1).forEach(r=>{let{element:a}=r;return Kl(a)}):i++;eo()===n&&Fg(t||"all")}function Px(n){let t=n.keyCode||n.which||n.charCode;const e=Ze.indexOf(t);if(e>=0&&Ze.splice(e,1),n.key&&n.key.toLowerCase()==="meta"&&Ze.splice(0,Ze.length),(t===93||t===224)&&(t=91),t in pt){pt[t]=!1;for(const i in ci)ci[i]===t&&(Bt[i]=!1)}}function Ng(n){if(typeof n=="undefined")Object.keys(et).forEach(s=>{Array.isArray(et[s])&&et[s].forEach(o=>Mr(o)),delete et[s]}),Kl(null);else if(Array.isArray(n))n.forEach(s=>{s.key&&Mr(s)});else if(typeof n=="object")n.key&&Mr(n);else if(typeof n=="string"){for(var t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];let[s,o]=e;typeof s=="function"&&(o=s,s=""),Mr({key:n,scope:s,method:o,splitKey:"+"})}}const Mr=n=>{let{key:t,scope:e,method:i,splitKey:s="+"}=n;_g(t).forEach(r=>{const a=r.split(s),l=a.length,c=a[l-1],h=c==="*"?"*":$s(c);if(!et[h])return;e||(e=eo());const u=l>1?Bg(ci,a):[],f=[];et[h]=et[h].filter(m=>{const p=(i?m.method===i:!0)&&m.scope===e&&mx(m.mods,u);return p&&f.push(m.element),!p}),f.forEach(m=>Kl(m))})};function Gg(n,t,e,i){if(t.element!==i)return;let s;if(t.scope===e||t.scope==="all"){s=t.mods.length>0;for(const o in pt)Object.prototype.hasOwnProperty.call(pt,o)&&(!pt[o]&&t.mods.indexOf(+o)>-1||pt[o]&&t.mods.indexOf(+o)===-1)&&(s=!1);(t.mods.length===0&&!pt[16]&&!pt[18]&&!pt[17]&&!pt[91]||s||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(Ze),t.method(n,t)===!1&&(n.preventDefault?n.preventDefault():n.returnValue=!1,n.stopPropagation&&n.stopPropagation(),n.cancelBubble&&(n.cancelBubble=!0)))}}function Qg(n,t){const e=et["*"];let i=n.keyCode||n.which||n.charCode;if(!Bt.filter.call(this,n))return;if((i===93||i===224)&&(i=91),Ze.indexOf(i)===-1&&i!==229&&Ze.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(a=>{const l=ql[a];n[a]&&Ze.indexOf(l)===-1?Ze.push(l):!n[a]&&Ze.indexOf(l)>-1?Ze.splice(Ze.indexOf(l),1):a==="metaKey"&&n[a]&&Ze.length===3&&(n.ctrlKey||n.shiftKey||n.altKey||(Ze=Ze.slice(Ze.indexOf(l))))}),i in pt){pt[i]=!0;for(const a in ci)ci[a]===i&&(Bt[a]=!0);if(!e)return}for(const a in pt)Object.prototype.hasOwnProperty.call(pt,a)&&(pt[a]=n[ql[a]]);n.getModifierState&&!(n.altKey&&!n.ctrlKey)&&n.getModifierState("AltGraph")&&(Ze.indexOf(17)===-1&&Ze.push(17),Ze.indexOf(18)===-1&&Ze.push(18),pt[17]=!0,pt[18]=!0);const s=eo();if(e)for(let a=0;a<e.length;a++)e[a].scope===s&&(n.type==="keydown"&&e[a].keydown||n.type==="keyup"&&e[a].keyup)&&Gg(n,e[a],s,t);if(!(i in et))return;const o=et[i],r=o.length;for(let a=0;a<r;a++)if((n.type==="keydown"&&o[a].keydown||n.type==="keyup"&&o[a].keyup)&&o[a].key){const l=o[a],{splitKey:c}=l,h=l.key.split(c),u=[];for(let f=0;f<h.length;f++)u.push($s(h[f]));u.sort().join("")===Ze.sort().join("")&&Gg(n,l,s,t)}}function Bt(n,t,e){Ze=[];const i=_g(n);let s=[],o="all",r=document,a=0,l=!1,c=!0,h="+",u=!1,f=!1;for(e===void 0&&typeof t=="function"&&(e=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(o=t.scope),t.element&&(r=t.element),t.keyup&&(l=t.keyup),t.keydown!==void 0&&(c=t.keydown),t.capture!==void 0&&(u=t.capture),typeof t.splitKey=="string"&&(h=t.splitKey),t.single===!0&&(f=!0)),typeof t=="string"&&(o=t),f&&Ng(n,o);a<i.length;a++)n=i[a].split(h),s=[],n.length>1&&(s=Bg(ci,n)),n=n[n.length-1],n=n==="*"?"*":$s(n),n in et||(et[n]=[]),et[n].push({keyup:l,keydown:c,scope:o,mods:s,shortcut:i[a],method:e,key:i[a],splitKey:h,element:r});if(typeof r!="undefined"&&window){if(!Pi.has(r)){const m=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return Qg(p,r)},v=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;Qg(p,r),Px(p)};Pi.set(r,{keydownListener:m,keyupListenr:v,capture:u}),Jl(r,"keydown",m,u),Jl(r,"keyup",v,u)}if(!Ks){const m=()=>{Ze=[]};Ks={listener:m,capture:u},Jl(window,"focus",m,u)}}}function Ix(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(et).forEach(e=>{et[e].filter(s=>s.scope===t&&s.shortcut===n).forEach(s=>{s&&s.method&&s.method()})})}function Kl(n){const t=Object.values(et).flat();if(t.findIndex(i=>{let{element:s}=i;return s===n})<0){const{keydownListener:i,keyupListenr:s,capture:o}=Pi.get(n)||{};i&&s&&(Js(n,"keyup",s,o),Js(n,"keydown",i,o),Pi.delete(n))}if((t.length<=0||Pi.size<=0)&&(Object.keys(Pi).forEach(s=>{const{keydownListener:o,keyupListenr:r,capture:a}=Pi.get(s)||{};o&&r&&(Js(s,"keyup",r,a),Js(s,"keydown",o,a),Pi.delete(s))}),Pi.clear(),Object.keys(et).forEach(s=>delete et[s]),Ks)){const{listener:s,capture:o}=Ks;Js(window,"focus",s,o),Ks=null}}const $l={getPressedKeyString:Ax,setScope:Fg,getScope:eo,deleteScope:Cx,getPressedKeyCodes:vx,getAllKeyCodes:bx,isPressed:wx,filter:yx,trigger:Ix,unbind:Ng,keyMap:qs,modifier:ci,modifierMap:ql};for(const n in $l)Object.prototype.hasOwnProperty.call($l,n)&&(Bt[n]=$l[n]);if(typeof window!="undefined"){const n=window.hotkeys;Bt.noConflict=t=>(t&&window.hotkeys===Bt&&(window.hotkeys=n),Bt),window.hotkeys=Bt}const ec=new Map;class Kt extends Rt{constructor(e,i){super();d(this,"name","Sculpt");d(this,"isSculptObject",!0);d(this,"draggable");d(this,"selected");d(this,"config");d(this,"on",(e,i,s)=>Je.modules.fiveDomEvents.addEventListener(this,e,i,s));d(this,"off",(...e)=>Je.modules.fiveDomEvents.removeEventListener(this,...e));d(this,"applyObjectMatrixWorld",(e,i)=>{const s=i!=null?i:this;return s.updateMatrixWorld(),Es(s,e)});d(this,"applyObjectReversalMatrixWorld",(e,i)=>{const s=i!=null?i:this;return s.updateMatrixWorld(),sv(s,e)});e!=null&&e.id&&(this.uuid=e.id),this.config=x({defaultAction:!0,occlusionVisibility:!0,occlusionMode:"translucence"},i),e!=null&&e.style&&(e.style.occlusionVisibility=this.config.occlusionVisibility,e.style.occlusionMode=this.config.occlusionMode),this.addEventListener("removed",()=>{Do(this)}),Bt("esc",()=>{this.stopCreating()}),this.config.defaultAction&&(Bt("backspace, delete",()=>{this.selected&&this.delete()}),this.on("click",()=>{var s;this.editing||(this.select({only:!0}),this.editor.enable(),(s=this.parent)==null||s.children.forEach(o=>{var r;o instanceof Kt&&o!==this&&((r=o._editor)==null||r.disable())}))}),Bt("esc",()=>{this.selected&&this.unselect()}))}get editing(){return this.pointSelector.enabled}get baseData(){return{id:this.uuid,type:this.type}}get pointSelector(){return Je.modules.pointSelector}undo(){throw new Error("Method not implemented.")}redo(){throw new Error("Method not implemented.")}canUndo(){throw new Error("Method not implemented.")}canRedo(){throw new Error("Method not implemented.")}stopCreating(){Je.modules.pointSelector.disable()}delete(){var e;this.stopCreating(),this.removeFromParent(),this.off(),(e=this.editor)==null||e.disable()}select(e={only:!1}){if(this.selected)return;this.selected=!0,this.highlight(),ec.has(this.parent.uuid)||ec.set(this.parent.uuid,[]);const i=ec.get(this.parent.uuid);i.push(this),e.only&&(i==null||i.forEach(s=>{s!==this&&s.unselect()}))}unselect(){var e;this.selected&&(this.selected=!1,this.unhighlight(),(e=this._editor)==null||e.disable())}highlight(){}unhighlight(){}showDeleteButton(e,i){Je.modules.cursor.showDeleteButton({clientX:e,clientY:i,container:document.body,onClick:()=>this.delete()}),Je.modules.five.once("cameraUpdate",()=>{Je.modules.cursor.removeDeleteButton()})}}class Er extends Rt{constructor(e){super();d(this,"hooks",new ht);d(this,"originObject");this.originObject=e}enable(){this.originObject.add(this)}disable(){this.originObject.remove(this)}}class to extends Er{constructor(e,i){super(e);d(this,"objectHelperConfig");d(this,"onObjectUpdate",()=>{this.hooks.emit("objectUpdate")});this.objectHelperConfig=i}get helper(){var e;return(e=Je.modules.object3DHelper.getObject3DHelper(this.originObject))==null?void 0:e.helper}enable(){super.enable();const e=typeof this.objectHelperConfig=="function"?this.objectHelperConfig():this.objectHelperConfig;Je.modules.object3DHelper.addObject3DHelper(this.originObject,x({positionFrom:"boundingBox"},e));const i=Je.modules.object3DHelper.getObject3DHelper(this.originObject).helper;i.hooks.on("move",this.onObjectUpdate),i.hooks.on("rotate",this.onObjectUpdate),i.hooks.on("scale",this.onObjectUpdate)}disable(){var e,i,s;super.disable(),(e=this.helper)==null||e.hooks.off("move",this.onObjectUpdate),(i=this.helper)==null||i.hooks.off("rotate",this.onObjectUpdate),(s=this.helper)==null||s.hooks.off("scale",this.onObjectUpdate),Je.modules.object3DHelper.removeObject3DHelper(this.originObject)}initialHelperMatrix(){var e;(e=this.helper)==null||e.initialHelperMatrix()}}class tc extends Er{constructor(e){super(e);d(this,"draggingPoints",[]);d(this,"onDragstart",e=>{const i=e.target;this.draggingPoints=this.pointMeshes.filter(s=>s.position.equals(i.position))});d(this,"onDragend",e=>{this.draggingPoints=[]})}get pointMeshes(){return this.children.filter(e=>e instanceof as)}get pointHandles(){return this.children}enable(){super.enable(),this.points.filter(ke).forEach(e=>{const i=new as;i.visible=!1,i.position.copy(e),i.draggable=!0,Je.modules.fiveDomEvents.addEventListener(i,"drag",this.onDrag),Je.modules.fiveDomEvents.addEventListener(i,"dragstart",this.onDragstart),Je.modules.fiveDomEvents.addEventListener(i,"dragend",this.onDragend),this.add(i)})}disable(){super.disable(),this.removeChildren()}}class Mx extends tc{constructor(e){super(e);d(this,"onDrag",e=>{if(!this.draggingPoints||this.draggingPoints.length===0)return;const i=ks(Je.modules.five,e.raycaster);this.draggingPoints.forEach(s=>s.position.copy(i.point)),this.originObject.lineMesh.setPoints(this.pointMeshes.map(s=>s.position))})}get points(){return this.originObject.lineMesh.points}}class Ex extends tc{constructor(e){super(e);d(this,"onDrag",e=>{if(!this.draggingPoints||this.draggingPoints.length===0)return;const i=ks(Je.modules.five,e.raycaster);this.draggingPoints.forEach(s=>s.position.copy(i.point)),this.originObject.polyLineMesh.setPoints(this.pointMeshes.map(s=>s.position))})}get points(){return this.originObject.polyLineMesh.points}}function _t(n){return Array.isArray(n)?n.map(t=>[t.x,t.y,t.z]):[n.x,n.y,n.z]}class Wg extends Kt{constructor(e,i){super(e,i);d(this,"type","Polyline");d(this,"polyLineMesh");d(this,"_editor");d(this,"creatingObject");e&&(this.polyLineMesh=new Qi(x(x({},e.style),e)),this.add(this.polyLineMesh))}get editor(){return this._editor||(this._editor=new Ex(this)),this._editor}get data(){return ie(x({},this.baseData),{points:_t(this.applyObjectMatrixWorld(this.polyLineMesh.points)),style:{lineColor:new b.Color(this.polyLineMesh.lineColor).getHex(),lineWidth:this.polyLineMesh.lineWidth,dashed:this.polyLineMesh.dashed}})}setData(e){e.points&&this.polyLineMesh.setPoints(this.applyObjectReversalMatrixWorld(e.points.map(De))),this.polyLineMesh.setStyle(e.style)}highlight(){var e;(e=this.polyLineMesh)==null||e.highlight()}unhighlight(){var e;(e=this.polyLineMesh)==null||e.unhighlight()}canUndo(){var e;(e=this.creatingObject)==null||e.canUndo()}canRedo(){var e;(e=this.creatingObject)==null||e.canRedo()}undo(){var e;(e=this.creatingObject)==null||e.undo()}redo(){var e;(e=this.creatingObject)==null||e.redo()}create(e){return H(this,null,function*(){this.removeChildren();const i=new Qi(e);this.polyLineMesh=i,this.add(this.polyLineMesh),this.creatingObject=Hg(i,this.pointSelector,e),yield this.creatingObject.finished,this.config.defaultAction&&this.editor.enable()})}}function Hg(n,t,e){var M;const i=n.parent;if(!i)return;const{promise:s,resolve:o,reject:r}=dn(),a=(M=e==null?void 0:e.limit)!=null?M:"none",l=new pn(n.style);i.add(l);const c=new pn(ie(x({},n.style),{dashed:!0,lengthEnable:!1}));i.add(c),t.enable();const h=[];let u,f,m;const v=[],p=()=>h.length>0,g=()=>v.length>0,A=()=>{p()&&(v.push(h.pop()),n.setPoints(h),C(m),t.pointSelectorHelper.magnifier.render())},w=()=>{g()&&(h.push(v.pop()),n.setPoints(h),C(m),t.pointSelectorHelper.magnifier.render())},I=E=>{v.length=0;const S=h.length===0?E.point:u.clone();h.push(S),n.setPoints(h)},C=E=>{const S=()=>{l.setPoints([]),c.setPoints([]),u=null};if(!E||(m=E,!(h!=null&&h.length)))return S();const L=h.at(-1).clone();a==="none"?(u=E.point,l.setPoints([L,u])):a==="xoz"?(f=f!=null?f:new b.Plane().setFromNormalAndCoplanarPoint(new b.Vector3(0,1,0),h[0]),t.plane=f,u=f.projectPoint(E.point,new b.Vector3),l.setPoints([L,u]),c.setPoints([u,E.point])):a==="y"&&(h.length===1?(u=E.point,l.setPoints([L,u])):(f=f!=null?f:new b.Plane().setFromCoplanarPoints(h[0],h[1],new b.Vector3(0,1,0).add(h[0])),t.plane=f,u=f.projectPoint(E.point,new b.Vector3),l.setPoints([L,u]),c.setPoints([u,E.point])))};return t.on("select",I),t.on("intersectionUpdate",C),t.on("disable",()=>{if(t.off("select",I),t.off("intersectionUpdate",C),t.plane=null,i.remove(l),i.remove(c),h.length<2)return i.remove(n),r(new Error("Cancelled"));o()}),{finished:s,canUndo:p,canRedo:g,undo:A,redo:w}}class kx extends Er{constructor(e){super(e);d(this,"onDrag",e=>{var s;const i=ks(Je.modules.five,e.raycaster);(s=this.originObject.pointMesh)==null||s.position.copy(i.point)})}enable(){super.enable(),this.originObject.draggable=!0,this.originObject.on("drag",this.onDrag)}disable(){super.disable(),this.originObject.draggable=!1,this.originObject.off("drag",this.onDrag)}}class Ug extends Kt{constructor(e,i){super(e,i);d(this,"type","Point");d(this,"pointMesh");d(this,"_editor");e&&(this.pointMesh=new as(x(x({},e.style),e)),this.add(this.pointMesh))}get editor(){return this._editor||(this._editor=new kx(this)),this._editor}get data(){return ie(x({},this.baseData),{point:_t(this.applyObjectMatrixWorld(this.pointMesh.position)),style:{color:this.pointMesh.color.getHex(),size:this.pointMesh.size}})}setData(e){e.point&&this.pointMesh.position.copy(De(e.point)),this.pointMesh.setStyle(e.style)}highlight(){var e;(e=this.pointMesh)==null||e.highlight()}unhighlight(){var e;(e=this.pointMesh)==null||e.unhighlight()}setStyle(e){this.pointMesh.setStyle(e)}create(e){return H(this,null,function*(){this.pointMesh&&this.remove(this.pointMesh),this.add(this.pointMesh=new as(e)),yield ic(this.pointMesh,this.pointSelector),this.config.defaultAction&&this.editor.enable()})}}function ic(n,t){return new Promise((e,i)=>{t.enable(),n.visible=!1;const s=l=>{l&&(n.visible=!0,n.position.copy(l.point))},o=l=>{l&&(n.visible=!0,n.position.copy(l.point),r())},r=()=>{t.off("select",o),t.off("disable",a),t.off("intersectionUpdate",s),t.disable(),e()},a=()=>{t.off("select",o),t.off("disable",a),t.off("intersectionUpdate",s),n.removeFromParent(),i(new Error("Cancelled"))};t.on("intersectionUpdate",s),t.on("disable",a),t.once("select",o)})}class kr extends Rt{constructor(e){var a,l;super();d(this,"name","ColoredMesh");d(this,"meshFont");d(this,"meshBackground");d(this,"paramsStyle",{});d(this,"_geometry",new b.BufferGeometry);d(this,"highlighted",!1);d(this,"opacityBeforeHighlight");this.paramsStyle=e!=null?e:{};const i=new b.MeshBasicMaterial({color:new b.Color((a=e==null?void 0:e.color)!=null?a:ev).convertSRGBToLinear(),transparent:!0,side:b.DoubleSide,depthTest:!0,depthWrite:!1,opacity:(l=e==null?void 0:e.opacity)!=null?l:nv}),s=new b.MeshBasicMaterial({color:16777215,transparent:!0,side:b.DoubleSide,depthTest:!1,depthWrite:!1,opacity:.3/.5*i.opacity}),o=new b.Mesh(this.geometry,i),r=new b.Mesh(this.geometry,s);o.name="MeshFront",r.name="MeshBackground",o.renderOrder=1,r.renderOrder=0,this.meshFont=o,this.meshBackground=r,this.add(o),this.setOcclusionVisibility({occlusionVisibility:e==null?void 0:e.occlusionVisibility,occlusionMode:e==null?void 0:e.occlusionMode})}get style(){return{color:this.color,opacity:this.opacity,occlusionVisibility:this.occlusionVisibility,occlusionMode:this.occlusionMode}}get color(){return this.meshFont.material.color}get opacity(){return this.meshFont.material.opacity}get occlusionVisibility(){return!!this.meshBackground.parent||this.meshFont.material.depthTest===!1}get occlusionMode(){return this.meshFont.material.depthTest===!1?"depthTest":"translucence"}set geometry(e){this._geometry=e,this.meshFont.geometry=e,this.meshBackground.geometry=e}get geometry(){return this._geometry}setStyle(e){this.paramsStyle=x(x({},this.paramsStyle),e),ke(e.color)&&(this.meshFont.material.color.set(new b.Color(e.color).convertSRGBToLinear()),this.needsRender=!0),ke(e.opacity)&&(this.meshFont.material.opacity=e.opacity,this.meshBackground.material.opacity=.3/.5*this.meshFont.material.opacity,this.needsRender=!0),this.setOcclusionVisibility(e)}highlight(){this.highlighted||(this.highlighted=!0,this.opacityBeforeHighlight=this.opacity,this.meshFont.material.opacity=this.opacity*ra,this.meshBackground.material.opacity=.3/.5*this.meshFont.material.opacity,this.needsRender=!0)}unhighlight(){this.highlighted&&(this.highlighted=!1,this.meshFont.material.opacity=this.opacityBeforeHighlight,this.meshBackground.material.opacity=.3/.5*this.meshFont.material.opacity,this.needsRender=!0)}setOcclusionVisibility(e){var o,r,a;const i=(r=(o=e.occlusionMode)!=null?o:this.paramsStyle.occlusionMode)!=null?r:"translucence",s=(a=e.occlusionVisibility)!=null?a:this.paramsStyle.occlusionVisibility;ke(s)&&(s?i==="depthTest"?(this.meshFont.material.depthTest=!1,this.remove(this.meshBackground)):i==="translucence"&&(this.meshFont.material.depthTest=!0,this.addIfNotExists(this.meshBackground)):(this.meshFont.material.depthTest=!0,this.remove(this.meshBackground)))}}const nc=new b.BufferGeometry;nc.name="blankGeometry",nc.isBlank=!0;class sc extends kr{constructor(e){super(e);d(this,"name","PolygonMesh");d(this,"points",[]);d(this,"planeHelperNeedUpdate",!0);d(this,"geometryInfoNeedUpdate",!0);d(this,"_paramsStyle");d(this,"planeHelper",null);d(this,"_geometryInfo",null);d(this,"lastRenderAreaItem");d(this,"areaDom");e!=null&&e.points&&this.setPoints(e.points),this._paramsStyle=e!=null?e:{},this.updateAreaItems()}get style(){return ie(x({},super.style),{lengthEnable:this._paramsStyle.lengthEnable})}get isBlank(){return!!this.geometry.isBlank}get center(){var e;return(e=this.geometryInfo)==null?void 0:e.center.clone()}get geometryInfo(){return this.geometryInfoNeedUpdate&&(this.isBlank?this._geometryInfo=null:this._geometryInfo=gu(this.geometry),this.geometryInfoNeedUpdate=!1),this._geometryInfo}get five(){var e,i;return(i=(e=window.globalModules)==null?void 0:e.five)!=null?i:window.$five}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.center){const i=Es(this,this.center).toArray().join(",");i!==this.lastRenderAreaItem&&(this.updateAreaItems(),this.lastRenderAreaItem=i)}}setStyle(e){this._paramsStyle=x(x({},this._paramsStyle),e),super.setStyle(this._paramsStyle),this.updateAreaItems()}setPoints(e){var s;const i=e.map(De);this.points=i,this.geometry=(s=fu(this.points,{checkLinesIntersect:!0}))!=null?s:nc,this.planeHelperNeedUpdate=!0,this.geometryInfoNeedUpdate=!0,this.updateAreaItems()}projectPoint(e){return e&&(this.planeHelperNeedUpdate&&this.updatePlaneHelper(),this.planeHelper?this.planeHelper.projectPoint(e,new b.Vector3):e)}updatePlaneHelper(){this.points.length>=3?this.planeHelper=new b.Plane().setFromCoplanarPoints(this.points[0],this.points[1],this.points[2]):this.planeHelper=null,this.planeHelperNeedUpdate=!1}updateAreaItems(){var s,o;const e=()=>{var r;(r=this.areaDom)==null||r.destroy(),this.areaDom=void 0};if(!this._paramsStyle.lengthEnable||!this.geometryInfo)return e();if(!this.five)return console.error("Five not found");this.areaDom=(s=this.areaDom)!=null?s:(()=>{const r=new Di(this.five);return r.intersectCheck=!1,r.simulate3D=!0,r})(),this.areaDom.setPosition(this.center);const i=this.geometryInfo.area.toFixed(2);i==="0.00"?this.areaDom.container.innerHTML="":this.areaDom.container.innerHTML=aa(i+"m²",{style:`color: #${ke((o=this.style)==null?void 0:o.color)?new b.Color(this.style.color).getHexString():"000000"}`})}}class Yg extends sc{constructor(e){const o=e!=null?e:{},{points:i}=o,s=Yi(o,["points"]);super();d(this,"name","PolygonWithEdgeMesh");d(this,"line",new pn);i&&this.setPoints(i),s&&this.setStyle(s)}get style(){return ie(x({},super.style),{lineWidth:this.lineWidth,lineColor:this.lineColor})}get lineWidth(){return this.line.lineWidth}get lineColor(){return this.line.lineColor}raycast(e,i){return this.children.forEach(s=>{sa(s,e,i,!0)}),!1}setPoints(e,i={closed:!0}){super.setPoints(e),this.points&&(this.line.setPoints(this.points,i),this.addIfNotExists(this.line))}setStyle(e){super.setStyle(e),this.line.setStyle(e)}highlight(){super.highlight(),this.line.highlight()}unhighlight(){super.unhighlight(),this.line.unhighlight()}}class oc extends Yg{constructor(){super(...arguments);d(this,"name","AreaMesh")}}class xx extends tc{constructor(e){super(e);d(this,"onDrag",e=>{if(!this.draggingPoints||this.draggingPoints.length===0)return;const i=ks(Je.modules.five,e.raycaster),s=this.originObject.areaMesh.projectPoint(i.point);this.draggingPoints.forEach(o=>o.position.copy(s)),this.originObject.areaMesh.setPoints(this.pointMeshes.map(o=>o.position))})}get points(){return this.originObject.areaMesh.points}}class Xg extends Kt{constructor(e,i){super(e,i);d(this,"type","Polygon");d(this,"areaMesh");d(this,"_editor");d(this,"creatingObject");e&&(this.areaMesh=new oc(x(x({},e.style),e)),this.add(this.areaMesh))}get editor(){return this._editor||(this._editor=new xx(this)),this._editor}get data(){return this.updateMatrixWorld(),ie(x({},this.baseData),{points:_t(this.applyObjectMatrixWorld(this.areaMesh.points)),style:{color:this.areaMesh.color.getHex(),lineColor:this.areaMesh.lineColor.getHex(),lineWidth:this.areaMesh.lineWidth}})}setData(e){e.points&&this.areaMesh.setPoints(this.applyObjectReversalMatrixWorld(e.points.map(De))),this.areaMesh.setStyle(e.style)}highlight(){var e;(e=this.areaMesh)==null||e.highlight()}unhighlight(){var e;(e=this.areaMesh)==null||e.unhighlight()}canUndo(){var e;(e=this.creatingObject)==null||e.canUndo()}canRedo(){var e;(e=this.creatingObject)==null||e.canRedo()}undo(){var e;(e=this.creatingObject)==null||e.undo()}redo(){var e;(e=this.creatingObject)==null||e.redo()}create(e){return H(this,null,function*(){this.children.forEach(s=>{s.parent===this&&this.remove(s)}),this.children.length=0;const i=new oc(e);this.areaMesh=i,this.add(this.areaMesh),this.creatingObject=xr(this.areaMesh,this.pointSelector,e),yield this.creatingObject.finished,this.config.defaultAction&&this.editor.enable()})}}function xr(n,t,e){var L;const{promise:i,resolve:s,reject:o}=dn(),r=n.parent;if(!r){o(new Error("No container"));return}const a=(L=e==null?void 0:e.limit)!=null?L:"none",l=new pn(n.style);r==null||r.add(l);const c=new pn(ie(x({},n.style),{dashed:!0,lengthEnable:!1}));r==null||r.add(c),t.enable();const h=[];let u,f,m=!1,v;const p=[],g=()=>h.length>0,A=()=>p.length>0,w=()=>{g()&&(p.push(h.pop()),M(v),t.pointSelectorHelper.magnifier.render())},I=()=>{A()&&(h.push(p.pop()),M(v),t.pointSelectorHelper.magnifier.render())},C=W=>{p.length=0;const R=h.length===0?W.point:u.clone();h.push(R),n.setPoints(h,{closed:!1}),m&&(E(),s())},M=W=>{const R=()=>{l.setPoints([]),c.setPoints([]),n.setPoints(h),t.pointSelectorHelper.magnifier.render()};if(!W||(v=W,!(h!=null&&h.length)))return R();const U=h.at(-1).clone();if(h.length<3&&(a==="none"?(u=W.point,l.setPoints([U,u]),c.setPoints([])):a==="xoz"?(f=f!=null?f:new b.Plane().setFromNormalAndCoplanarPoint(new b.Vector3(0,1,0),h[0]),t.plane=f,u=f.projectPoint(W.point,new b.Vector3),l.setPoints([U,u]),c.setPoints([u,W.point])):a==="y"&&(h.length===1?(u=W.point,l.setPoints([U,u]),c.setPoints([])):(f=f!=null?f:new b.Plane().setFromCoplanarPoints(h[0],h[1],new b.Vector3(0,1,0).add(h[0])),t.plane=f,u=f.projectPoint(W.point,new b.Vector3),l.setPoints([U,u]),c.setPoints([u,W.point])))),h.length>=3){u=n.projectPoint(W.point);const j=h[0],Y=.2;j.distanceTo(u)<Y||j.distanceTo(W.point)<Y?(u=j,W.point.copy(j),t.pointSelectorHelper.updateWithIntersect(W,{emitEvent:!1}),m=!0):m=!1,l.setPoints([U,u]),c.setPoints([u,W.point])}h.length>=2?(n.setPoints([...h,u],{closed:!1}),n.line.setPoints(n.points.slice(0,-1)),n.isBlank?(t.cursorError=!0,l.setStyle({lineColor:16734553}),c.setStyle({lineColor:16734553})):(t.cursorError=!1,l.setStyle({lineColor:n.lineColor}),c.setStyle({lineColor:n.lineColor}))):n.setPoints([])},E=()=>{t.off("select",C),t.off("intersectionUpdate",M),t.off("disable",S),t.plane=null,t.disable(),r==null||r.remove(l,c)},S=()=>{E(),r==null||r.remove(n,c,l),o(new Error("Cancelled"))};return t.on("select",C),t.on("intersectionUpdate",M),t.on("disable",S),{finished:i,canUndo:g,canRedo:A,undo:w,redo:I}}function Dx(n){const t=[...n],e=[];for(let i=0;i<t.length-2;i++)e.push(0,i+1,i+2);return e}function Sx(n){const t=n.map(i=>new b.Vector3(i[0],i[1],i[2]));return du(t)}class Lx extends b.BufferGeometry{constructor(e){super();d(this,"bottomPositions",[]);d(this,"topPosition",[]);d(this,"_type","Concave");e&&this.setPosition(e)}setPosition(e){var l,c,h;const i=(l=e.bottomPositions)!=null?l:this.bottomPositions,s=(c=e.topPosition)!=null?c:this.topPosition;if(this._type=(h=e.type)!=null?h:this._type,this.bottomPositions=i,this.topPosition=s,!i||i.length<3){console.error("PrismGeometry: Invalid parameters",i,s,e),this.bottomPositions=[],this.setAttribute("position",new b.BufferAttribute(new Float32Array([]),3));return}const o=[],r=[];r.push(...i),r[0][0]===r.at(-1)[0]&&r[0][1]===r.at(-1)[1]&&r[0][2]===r.at(-1)[2]&&(r.length-=1);const a=this._type==="Concave"?Sx(r):Dx(r);if(o.push(...a),s&&s.length===3){const u=[s[0]-i[0][0],s[1]-i[0][1],s[2]-i[0][2]],f=r.map(v=>[v[0]+u[0],v[1]+u[1],v[2]+u[2]]);r.push(...f);const m=o.map(v=>v+r.length/2);o.push(...m);for(let v=0;v<r.length/2-1;v++)o.push(v,v+1,v+r.length/2),o.push(v+1,v+r.length/2+1,v+r.length/2);o.push(0,r.length/2,r.length/2-1),o.push(r.length/2,r.length-1,r.length/2-1)}this.setAttribute("position",new b.Float32BufferAttribute(r.flat(),3)),this.setIndex(o),this.computeBoundingSphere()}}class ls extends Rt{constructor(e){super();d(this,"name","PrismMesh");d(this,"_geometryInfoCache");d(this,"geometryInfoNeedUpdate",!0);d(this,"prismMesh",new kr);d(this,"edgeMesh",new Ht);d(this,"paramStyle");this.prismMesh.name="PrismMesh",this.prismMesh.geometry=new Lx,this.edgeMesh.name="EdgeMesh",this.addIfNotExists(this.prismMesh,this.edgeMesh),e&&this.setPoints(e),this.setStyle(e)}get topPosition(){return new b.Vector3().fromArray(this.prismMesh.geometry.topPosition)}get bottomPositions(){return this.prismMesh.geometry.bottomPositions.map(e=>new b.Vector3().fromArray(e))}get topPositions(){const e=this.bottomPositions[0].clone().sub(this.topPosition);return this.bottomPositions.map(i=>i.clone().sub(e))}get style(){return{color:this.color,lineColor:this.lineColor,lineWidth:this.lineWidth,opacity:this.opacity,occlusionVisibility:this.occlusionVisibility,occlusionMode:this.occlusionMode}}get opacity(){return this.prismMesh.opacity}get occlusionVisibility(){return this.prismMesh.occlusionVisibility}get occlusionMode(){return this.prismMesh.occlusionMode}get center(){return this.localCenter.clone()}get localCenter(){var e;return(e=this.geometryInfo.center.clone())!=null?e:new b.Vector3(9999,9999,9999)}get geometryInfo(){if(this.geometryInfoNeedUpdate){this.geometryInfoNeedUpdate=!1;const e=this.prismMesh.geometry.bottomPositions,i=this.prismMesh.geometry.topPosition;if(!e||e.length<3||!i){this._geometryInfoCache=void 0;return}const s=e.map((c,h)=>{if(!(h>=e.length-2))return[new b.Vector3().fromArray(e[0]),new b.Vector3().fromArray(e[h+1]),new b.Vector3().fromArray(e[h+2])]}).filter(Boolean);if(s.length===0){this._geometryInfoCache=void 0;return}let o=0,r=new b.Vector3;for(const[c,h,u]of s){const f=Ua(c,h,u),m=pu(c,h,u,f);o+=f,r.add(m)}r=r.divideScalar(o);const a=new b.Vector3().fromArray(i).sub(new b.Vector3().fromArray(e[0])),l=r.clone().add(a.divideScalar(2));this._geometryInfoCache={center:l}}return this._geometryInfoCache}get worldCenter(){return this.updateMatrixWorld(),this.localToWorld(this.localCenter)}get color(){return this.prismMesh.color}get lineWidth(){return this.edgeMesh.style.lineWidth}get lineColor(){return this.edgeMesh.color}setStyle(e={}){this.paramStyle=x(x({},this.paramStyle),e),this.prismMesh.setStyle(this.paramStyle),this.edgeMesh.setStyle(this.paramStyle)}setPoints(e){var i;this.prismMesh.geometry.setPosition({bottomPositions:(i=e.points)==null?void 0:i.map(De).map(s=>s.toArray()),topPosition:e.heightPoint?De(e.heightPoint).toArray():void 0}),this.edgeMesh.geometry=new So().fromEdgesGeometry(new b.EdgesGeometry(this.prismMesh.geometry)),this.geometryInfoNeedUpdate=!0}highlight(){this.prismMesh.highlight()}unhighlight(){this.prismMesh.unhighlight()}raycast(e,i){return this.children.forEach(s=>sa(s,e,i,!0)),!1}}class Zg extends to{constructor(t){super(t,()=>({positionFrom:()=>t.worldCenter,yAxis:()=>t.up,scaleHelper:{enable:!0,positions:()=>{const e=t.bottomPositions,i=t.topPosition,s=new b.Vector3().subVectors(i,e[0]),o=t.geometryInfo.center,r=o.clone().sub(s.clone().divideScalar(2)),a=o.clone().add(s.clone().divideScalar(2));return[{id:"top",handlePosition:a,basePosition:r},{id:"bottom",handlePosition:r,basePosition:a}]},scaleCallback:e=>{const{intersectPoint:i,scalePosition:s}=e,{id:o,basePosition:r,handlePosition:a}=s;if(o==="top"){const l=i.clone().sub(r);t.setPoints({heightPoint:t.bottomPositions[0].clone().add(l)})}else if(o==="bottom"){const l=i.clone().sub(r);t.setPoints({points:t.topPositions.map(c=>c.clone().add(l))})}}}}))}}class Jg extends Kt{constructor(e,i){super(e,i);d(this,"type","Prism");d(this,"prismMesh");d(this,"_editor");e&&(this.prismMesh=new ls(x(x({},e.style),e)),this.add(this.prismMesh))}get editor(){return this._editor||(this._editor=new Zg(this.prismMesh)),this._editor}get data(){return ie(x({},this.baseData),{points:_t(this.applyObjectMatrixWorld(this.prismMesh.bottomPositions,this.prismMesh)),heightPoint:_t(this.applyObjectMatrixWorld(this.prismMesh.topPosition,this.prismMesh)),style:{color:this.prismMesh.color.getHex(),lineWidth:this.prismMesh.lineWidth,lineColor:this.prismMesh.lineColor.getHex()}})}setData(e){this.prismMesh.setPoints({points:e.points?this.applyObjectReversalMatrixWorld(e.points.map(De),this.prismMesh):void 0,heightPoint:e.heightPoint?this.applyObjectReversalMatrixWorld(De(e.heightPoint),this.prismMesh):void 0}),this.prismMesh.setStyle(e.style),this._editor&&this._editor.initialHelperMatrix()}highlight(){var e;(e=this.prismMesh)==null||e.highlight()}unhighlight(){var e;(e=this.prismMesh)==null||e.unhighlight()}create(e){return H(this,null,function*(){this.prismMesh=new ls(e),this.add(this.prismMesh),yield rc(this.prismMesh,this.pointSelector),this.config.defaultAction&&this.editor.enable()})}}function rc(n,t){return H(this,null,function*(){const e=n.parent,i=new oc(n.style);e.add(i),yield xr(i,t).finished,e.remove(i),n.setPoints({points:i.points});const s=new Ht;s.name="LineHelper",e.add(s);const o=i.points.at(-1),r=on(i.points),a=o.clone().add(r.clone().multiplyScalar(100)),l=o.clone().sub(r.clone().multiplyScalar(100));return s.setPoints([a,l]),t.enable(),new Promise((c,h)=>{const u=p=>{m(),c()},f=p=>{if(!(p!=null&&p.raycaster))return;const g=gn({raycaster:p.raycaster,line:new b.Line3(a,l)});g&&n.setPoints({heightPoint:g})},m=()=>{t.off("select",u),t.off("intersectionUpdate",f),t.off("disable",v),e.remove(s),t.disable()},v=()=>{m(),e.remove(n),h(new Error("Cancelled"))};t.on("select",u),t.on("intersectionUpdate",f),t.on("disable",v)})})}class qg extends to{constructor(t){super(t,()=>({yAxis:()=>{const e=t.points;return on(e).normalize()},zAxis:()=>{const e=t.points;return e[0].clone().sub(e[1]).normalize()},scaleHelper:{enable:!0,positions:()=>{const e=t.points,i=e[0].clone().lerp(e[3],.5),s=e[1].clone().lerp(e[2],.5),o=e[0].clone().lerp(e[1],.5),r=e[3].clone().lerp(e[2],.5);return[{id:"left",handlePosition:i,basePosition:s},{id:"right",handlePosition:s,basePosition:i},{id:"top",handlePosition:o,basePosition:r},{id:"bottom",handlePosition:r,basePosition:o}]},scaleCallback:e=>{const{intersectPoint:i,scalePosition:s}=e,{id:o,basePosition:r}=s,a=i.clone().sub(r),l=t.points;o==="top"?t.setPoints([l[3].clone().add(a),l[2].clone().add(a),l[2],l[3]]):o==="bottom"?t.setPoints([l[0],l[1],l[1].clone().add(a),l[0].clone().add(a)]):o==="left"?t.setPoints([l[1].clone().add(a),l[1],l[2],l[2].clone().add(a)]):o==="right"&&t.setPoints([l[0],l[0].clone().add(a),l[3].clone().add(a),l[3]])}}}))}}class Tx extends b.BufferGeometry{constructor(e){super();d(this,"name","RectangleGeometry");d(this,"points");if(e.length!==4){console.error("Invalid number of points, it's not a rectangle");return}this.points=e.slice(0,4),this.setAttribute("position",new b.BufferAttribute(new Float32Array(this.points.flatMap(i=>i.toArray())),3)),this.setIndex(new b.BufferAttribute(new Uint16Array([0,1,2,0,2,3]),1))}}class Kg extends sc{constructor(e){super(e);d(this,"name","RectangleMesh")}get color(){return this.meshFont.material.color}setPoints(e){const i=e.map(De).filter(ke);if(i.length<3){console.error("Invalid position");return}if(e.length===3){const[s,o,r]=i,a=s.clone().add(r).sub(o);i.push(a)}this.points=i,this.geometry=new Tx(i),this.planeHelperNeedUpdate=!0,this.geometryInfoNeedUpdate=!0}}class Dr extends Kg{constructor(e){const o=e!=null?e:{},{points:i}=o,s=Yi(o,["points"]);super();d(this,"name","RectangleWithEdgeMesh");d(this,"line",new pn);i&&this.setPoints(i),s&&this.setStyle(s)}get style(){return x(x({},super.style),this.line.style)}get lineWidth(){return this.line.lineWidth}get lineColor(){return this.line.lineColor}setPoints(e){super.setPoints(e),this.points&&(this.line.setPoints([this.points[0],this.points[1],this.points[2],this.points[3],this.points[0]]),this.addIfNotExists(this.line))}setStyle(e){super.setStyle(e),this.line.setStyle(e)}highlight(){super.highlight(),this.line.highlight()}unhighlight(){super.unhighlight(),this.line.unhighlight()}}function $g(n,t){const e=on(n),i=Ot(...n),s=t.clone().sub(i);return e.dot(s)>=0?n:n.slice().reverse()}class ep extends Kt{constructor(e,i){super(e,i);d(this,"type","Rectangle");d(this,"rectangleMesh");d(this,"_editor");e&&(this.rectangleMesh=new Dr(x(x({},e.style),e)),this.add(this.rectangleMesh))}get editor(){return this._editor||(this._editor=new qg(this.rectangleMesh)),this._editor}get data(){return ie(x({},this.baseData),{points:_t(this.applyObjectMatrixWorld(this.rectangleMesh.points,this.rectangleMesh)),style:{color:this.rectangleMesh.color.getHex(),opacity:this.rectangleMesh.opacity,lineWidth:this.rectangleMesh.lineWidth,lineColor:this.rectangleMesh.lineColor.getHex()}})}setData(e){e.points&&this.rectangleMesh.setPoints(this.applyObjectReversalMatrixWorld(e.points.map(De),this.rectangleMesh)),this.rectangleMesh.setStyle(e.style),this._editor&&this._editor.initialHelperMatrix()}highlight(){var e;(e=this.rectangleMesh)==null||e.highlight()}unhighlight(){var e;(e=this.rectangleMesh)==null||e.unhighlight()}create(e){return H(this,null,function*(){this.removeChildren();const i=new Dr(e);this.rectangleMesh=i,this.add(this.rectangleMesh),yield Sr(this.rectangleMesh,this.pointSelector,e),this.config.defaultAction&&this.editor.enable()})}}function Sr(n,t,e){var s;return((s=e==null?void 0:e.drawMethod)!=null?s:"diagonal")==="diagonal"?zx(n,t,e):jx(n,t,e)}function zx(n,t,e){var I;const{promise:i,reject:s,resolve:o}=dn(),r=n.parent;if(!r)return s(new Error("No container"));const a=(I=e==null?void 0:e.limit)!=null?I:"none",l=new Qi(ie(x({},n.style),{dashed:!0})),c=new Qi(ie(x({},n.style),{dashed:!0,lengthEnable:!1})),h=new Qi(ie(x({},n.style),{dashed:!1,lengthEnable:!1}));r.add(l,h,c),t.enable();const u=[];let f=new b.Vector3,m=new b.Vector3;const v=new b.Plane,p=()=>{u.push(f.clone()),u.length===1?(a==="xoz"&&v.setFromNormalAndCoplanarPoint(new b.Vector3(0,1,0),u[0]),a==="none"&&v.setFromNormalAndCoplanarPoint(m,u[0])):u.length===2?a==="y"||a==="xoz"?(A(),o()):h.setPoints([u[0],u[1]]):u.length===3&&(A(),o())},g=C=>{var E,S;if(!(C!=null&&C.raycaster))return;const M=(E=u.at(-1))==null?void 0:E.clone();if(u.length===0){f=C.point.clone(),m=(S=C.face)==null?void 0:S.normal;return}if(u.length===1&&a==="y"){const W=new b.Line3(new b.Vector3(0,1,0).add(u[0]),new b.Vector3(0,-1,0).add(u[0])).closestPointToPoint(C.point,!1,new b.Vector3);n.setPoints([u[0],W,C.point]);return}if(u.length===1&&a==="xoz"){const L=new b.Line3(new b.Vector3(1,0,0).add(u[0]),new b.Vector3(-1,0,0).add(u[0])),W=C.raycaster.ray.intersectPlane(v,new b.Vector3),R=L.closestPointToPoint(W,!1,new b.Vector3);n.setPoints([u[0],R,W]);return}if(u.length===1&&a==="none"){v?(f=C.raycaster.ray.intersectPlane(v,new b.Vector3),c.setPoints([f,C.point])):f=C.point.clone(),l.setPoints([M,f]);return}if(u.length===2&&a==="none"){r.remove(l);const L=C.raycaster.ray.intersectPlane(v,new b.Vector3),W=u[0].distanceTo(u[1])/2,R=new b.Vector3().lerpVectors(u[0],u[1],.5),U=new b.Vector3().subVectors(L,R).normalize();f=new b.Vector3().addVectors(R,U.multiplyScalar(W));const j=[u[0],f,u[1]],Y=$g(j,Je.modules.five.camera.position);n.setPoints(Y);return}},A=()=>{t.off("select",p),t.off("intersectionUpdate",g),t.off("disable",w),t.disable(),r==null||r.remove(l,h,c)},w=()=>{A(),r==null||r.remove(n),s(new Error("Cancelled"))};return t.on("select",p),t.on("intersectionUpdate",g),t.on("disable",w),i}function jx(n,t,e){var I;const{promise:i,reject:s,resolve:o}=dn(),r=n.parent;if(!r)return s(new Error("No container"));const a=(I=e==null?void 0:e.limit)!=null?I:"none",l=new Qi(ie(x({},n.style),{dashed:!0})),c=new Qi(ie(x({},n.style),{dashed:!0,lengthEnable:!1})),h=new Qi(ie(x({},n.style),{dashed:!1,lengthEnable:!1}));r.add(l,h,c),t.enable();const u=[];let f=new b.Vector3,m=new b.Vector3;const v=new b.Plane,p=()=>{u.push(f.clone()),u.length===1?(a==="xoz"&&v.setFromNormalAndCoplanarPoint(new b.Vector3(0,1,0),u[0]),a==="none"&&v.setFromNormalAndCoplanarPoint(m,u[0])):u.length===2?(a==="y"&&v.setFromCoplanarPoints(u[0],u[1],new b.Vector3(0,1,0).add(u[0])),h.setPoints([u[0],u[1]])):u.length===3&&(A(),o())},g=C=>{var E,S;if(!(C!=null&&C.raycaster))return;const M=(E=u.at(-1))==null?void 0:E.clone();if(u.length===0){f=C.point.clone(),m=(S=C.face)==null?void 0:S.normal;return}if(u.length===1&&a==="y"){f=C.point,c.setPoints([]),l.setPoints([M,f]);return}if(u.length===1&&a==="xoz"){f=C.raycaster.ray.intersectPlane(v,new b.Vector3),c.setPoints([f,C.point]),l.setPoints([M,f]);return}if(u.length===1&&a==="none"){f=C.raycaster.ray.intersectPlane(v,new b.Vector3),c.setPoints([f,C.point]),l.setPoints([M,f]);return}if(u.length===2){r.remove(l);const L=new b.Vector3().crossVectors(u[0].clone().sub(u[1]),v.normal).normalize();f=new b.Line3(u[1].clone().add(L),u[1].clone().sub(L)).closestPointToPoint(C.point,!1,new b.Vector3);const R=[u[0],u[1],f],U=$g(R,Je.modules.five.camera.position);n.setPoints(U);return}},A=()=>{t.off("select",p),t.off("intersectionUpdate",g),t.off("disable",w),t.disable(),r==null||r.remove(l,h,c)},w=()=>{A(),r==null||r.remove(n),s(new Error("Cancelled"))};return t.on("select",p),t.on("intersectionUpdate",g),t.on("disable",w),i}class tp extends to{constructor(t){super(t,()=>({yAxis:()=>t.normal}))}}function ip(n){return Math.max(32,Math.min(128,Math.floor(n*40)))}class np extends kr{constructor(e){super(e);d(this,"_normal");d(this,"_center");d(this,"_radius");e!=null&&e.center&&(e!=null&&e.normal)&&(e!=null&&e.radius)&&this.setPoints(e)}get center(){return this.position.clone()}get normal(){return this._normal}set normal(e){this._normal=e}get radius(){var e,i;return(i=(e=this.meshFont.geometry)==null?void 0:e.parameters)==null?void 0:i.radius}setPoints(e){var i,s,o;if(this._center=(i=De(e.center))!=null?i:this._center,this._normal=((s=De(e.normal))!=null?s:this._normal).normalize(),this._radius=(o=e.radius)!=null?o:this._radius,ke(this._radius)&&this._radius!==this.radius){const r=ip(this._radius);this.geometry=new b.CircleGeometry(this._radius,r)}this._center&&this.position.copy(this._center),this._normal&&(this.lookAt(this._normal.clone().add(this._center)),this.normal=this._normal.clone()),this.needsRender=!0}}class io extends np{constructor(e){const a=e!=null?e:{},{normal:i,radius:s,center:o}=a,r=Yi(a,["normal","radius","center"]);super(r);d(this,"edgeLine");this.edgeLine=new Ht(r),this.add(this.edgeLine),i&&s&&o&&this.setPoints({normal:i,radius:s,center:o})}setPoints(...e){super.setPoints(...e);const i=this.meshFont.geometry.vertices.slice(1);this.edgeLine.setPoints(i.concat(i[0]))}setStyle(e){super.setStyle(e),this.edgeLine.setStyle(e)}highlight(){super.highlight(),this.edgeLine.highlight()}unhighlight(){super.unhighlight(),this.edgeLine.unhighlight()}}class sp extends Kt{constructor(e,i){super(e,i);d(this,"type","Circle");d(this,"circleMesh");d(this,"_editor");e&&(this.circleMesh=new io(x(x({},e.style),e)),this.add(this.circleMesh))}get editor(){return this._editor||(this._editor=new tp(this.circleMesh)),this._editor}get data(){return ie(x({},this.baseData),{center:_t(this.applyObjectMatrixWorld(this.circleMesh.center,this.circleMesh)),normal:_t(this.circleMesh.normal.clone().applyQuaternion(this.circleMesh.quaternion)),radius:this.circleMesh.radius,style:{color:this.circleMesh.color.getHex()}})}setData(e){this.circleMesh.setPoints({center:e.center?this.applyObjectReversalMatrixWorld(De(e.center),this.circleMesh):void 0,normal:e.normal?De(e.normal):void 0,radius:e.radius}),this.circleMesh.setStyle(e.style),this._editor&&this._editor.initialHelperMatrix()}highlight(){var e;(e=this.circleMesh)==null||e.highlight()}unhighlight(){var e;(e=this.circleMesh)==null||e.unhighlight()}create(e){return H(this,null,function*(){this.children.forEach(s=>{s.parent===this&&this.remove(s)}),this.children.length=0;const i=new io(e);this.circleMesh=i,this.add(this.circleMesh),yield Lr(this.circleMesh,this.pointSelector),this.config.defaultAction&&this.editor.enable()})}}function Lr(n,t){return new Promise((e,i)=>{const s=n.parent;if(!s){i(new Error("No container"));return}const o=new pn({dashed:!0});s.add(o),t.enable();let r,a;const l=f=>{if(f){if(!r){r={point:f.point,normal:f.face.normal};return}r&&a&&(h(),e())}},c=f=>{if(!f||!r)return;const m=new b.Plane().setFromNormalAndCoplanarPoint(r.normal,r.point);if(a=f.raycaster.ray.intersectPlane(m,new b.Vector3),a){const v=r.point.distanceTo(a);n.setPoints({center:r.point,normal:r.normal,radius:v})}},h=()=>{t.off("select",l),t.off("intersectionUpdate",c),t.off("disable",u),t.disable(),s==null||s.remove(o)},u=()=>{h(),s==null||s.remove(n,o),i(new Error("Cancelled"))};t.on("select",l),t.on("intersectionUpdate",c),t.on("disable",u)})}class ac extends Rt{constructor(e){super();d(this,"bottomCircle");d(this,"topCircle");d(this,"edgeMesh");d(this,"highlighted",!1);d(this,"params");d(this,"_topCenter");d(this,"_bottomCenter");d(this,"_radius");this.params=e,this.bottomCircle=new io(e),this.bottomCircle.name="bottomCircle",this.topCircle=new io(e),this.topCircle.name="topCircle",this.edgeMesh=new kr(e),e!=null&&e.bottomCenter&&(e!=null&&e.topCenter)&&(e!=null&&e.radius)&&this.setPoints(e),this.addIfNotExists(this.bottomCircle)}get bottomCenter(){return this.bottomCircle.center}get topCenter(){return this.topCircle.center}get normal(){return this.bottomCircle.normal}get radius(){return this.bottomCircle.radius}get color(){return this.bottomCircle.color}setPoints(e){var i,s;if(this._topCenter=(i=De(e.topCenter))!=null?i:this.topCenter,this._bottomCenter=(s=De(e.bottomCenter))!=null?s:this.bottomCenter,this._radius=ke(e.radius)?e.radius:this.radius,this._topCenter&&this._bottomCenter){const o=this._topCenter.clone().sub(this._bottomCenter).normalize();this.bottomCircle.setPoints({center:this._bottomCenter,normal:o,radius:this._radius}),this.setTopCenter(this._topCenter)}this.needsRender=!0}setTopCenter(e){this.addIfNotExists(this.topCircle),this.topCircle.setPoints({center:e,normal:this.normal,radius:this.radius}),this.setEdgeMesh()}setBottomCenter(e){this.addIfNotExists(this.bottomCircle),this.bottomCircle.setPoints({center:e,normal:this.normal,radius:this.radius}),this.setEdgeMesh()}setStyle(e){this.params=x(x({},this.params),e),this.bottomCircle.setStyle(this.params),this.topCircle.setStyle(this.params)}highlight(){this.highlighted||(this.highlighted=!0,this.edgeMesh.highlight(),this.bottomCircle.highlight(),this.topCircle.highlight(),this.needsRender=!0)}unhighlight(){this.highlighted&&(this.highlighted=!1,this.edgeMesh.unhighlight(),this.bottomCircle.unhighlight(),this.topCircle.unhighlight(),this.needsRender=!0)}setEdgeMesh(){this.addIfNotExists(this.edgeMesh);const e=this.topCircle.center,i=this.bottomCircle.center;this.edgeMesh.geometry.dispose(),this.edgeMesh.geometry=new b.CylinderGeometry(this.radius,this.radius,e.distanceTo(i),ip(this.radius),1,!0);const s=new b.Quaternion().setFromUnitVectors(new b.Vector3(0,1,0),this.normal.clone().normalize());this.edgeMesh.position.copy(new b.Vector3().lerpVectors(i,e,.5)),this.edgeMesh.quaternion.copy(s)}}class op extends to{constructor(t){super(t,()=>{const e=()=>{const i=t.topCenter,s=t.bottomCenter,o=new b.Vector3().lerpVectors(i,s,.5);return{topCenter:i,bottomCenter:s,boxCenter:o}};return{positionFrom:"boundingBox",yAxis:()=>t.normal,scaleHelper:{enable:!0,positions:()=>{const i=e();return[{id:"top",handlePosition:i.topCenter,basePosition:i.bottomCenter},{id:"bottom",handlePosition:i.bottomCenter,basePosition:i.topCenter}]},scaleCallback:i=>{const{intersectPoint:s,scalePosition:o}=i,{id:r}=o;r==="top"?t.setTopCenter(s):r==="bottom"&&t.setBottomCenter(s)}}}})}}class rp extends Kt{constructor(e,i){super(e,i);d(this,"type","Cylinder");d(this,"cylinderMesh");d(this,"_editor");e&&(this.cylinderMesh=new ac(x(x({},e.style),e)),this.add(this.cylinderMesh))}get editor(){return this._editor||(this._editor=new op(this.cylinderMesh)),this._editor}get data(){return ie(x({},this.baseData),{bottomCenter:_t(this.applyObjectMatrixWorld(this.cylinderMesh.bottomCenter,this.cylinderMesh)),topCenter:_t(this.applyObjectMatrixWorld(this.cylinderMesh.topCenter,this.cylinderMesh)),radius:this.cylinderMesh.radius,style:{color:this.cylinderMesh.color.getHex()}})}setData(e){this.cylinderMesh.setPoints({bottomCenter:e.bottomCenter?this.applyObjectReversalMatrixWorld(De(e.bottomCenter),this.cylinderMesh):void 0,topCenter:e.topCenter?this.applyObjectReversalMatrixWorld(De(e.topCenter),this.cylinderMesh):void 0}),this.cylinderMesh.setStyle(e.style),this._editor&&this._editor.initialHelperMatrix()}highlight(){var e;(e=this.cylinderMesh)==null||e.highlight()}unhighlight(){var e;(e=this.cylinderMesh)==null||e.unhighlight()}create(e){return H(this,null,function*(){this.cylinderMesh=new ac(e),this.add(this.cylinderMesh),yield lc(this.cylinderMesh,this.pointSelector),this.config.defaultAction&&this.editor.enable()})}}function lc(n,t){return H(this,null,function*(){const e=n.parent;yield Lr(n.bottomCircle,t);const i=new Ht;i.name="LineHelper",e.add(i);const s=t.position.point,o=n.normal.clone().normalize(),r=s.clone().add(o.clone().multiplyScalar(100)),a=s.clone().sub(o.clone().multiplyScalar(100));return i.setPoints([r,a]),t.enable(),new Promise((l,c)=>{const h=v=>{f(),l()},u=v=>{if(!(v!=null&&v.raycaster))return;const p=gn({raycaster:v.raycaster,line:new b.Line3(r,a)}),A=new b.Plane().setFromNormalAndCoplanarPoint(n.normal,n.bottomCenter).projectPoint(p,new b.Vector3),w=p.clone().sub(A),I=n.bottomCenter.clone().add(w);p&&n.setTopCenter(I)},f=()=>{t.off("select",h),t.off("intersectionUpdate",u),t.off("disable",m),e.remove(i),t.disable()},m=()=>{f(),e.remove(n),c(new Error("Cancelled"))};t.on("select",h),t.on("intersectionUpdate",u),t.on("disable",m)})})}class ap extends to{constructor(t){super(t,()=>({positionFrom:()=>t.worldCenter,yAxis:()=>new b.Vector3().subVectors(t.topPosition,t.bottomPositions[0]).normalize(),zAxis:()=>new b.Vector3().subVectors(t.bottomPositions[0],t.bottomPositions[1]).normalize(),scaleHelper:{enable:!0,positions:()=>{const e=t.bottomPositions,i=t.topPosition,s=new b.Vector3().subVectors(i,e[0]),o=new b.Vector3().subVectors(e[1],e[0]),r=new b.Vector3().subVectors(e[2],e[1]),a=t.geometryInfo.center,l=a.clone().sub(s.clone().divideScalar(2)),c=a.clone().add(s.clone().divideScalar(2)),h=a.clone().sub(o.clone().divideScalar(2)),u=a.clone().add(o.clone().divideScalar(2)),f=a.clone().sub(r.clone().divideScalar(2)),m=a.clone().add(r.clone().divideScalar(2));return[{id:"top",handlePosition:c,basePosition:l},{id:"bottom",handlePosition:l,basePosition:c},{id:"left",handlePosition:h,basePosition:u},{id:"right",handlePosition:u,basePosition:h},{id:"front",handlePosition:f,basePosition:m},{id:"back",handlePosition:m,basePosition:f}]},scaleCallback:e=>{const{intersectPoint:i,scalePosition:s}=e,{id:o,basePosition:r}=s,a=t.bottomPositions,l=t.topPositions;let c=new b.Vector3().subVectors(t.topPosition,a[0]),h;if(o==="top")c=i.clone().sub(r),h=a;else if(o==="bottom"){const u=i.clone().sub(r);h=l.map(f=>f.clone().add(u)),c=void 0}else if(o==="left"){const u=i.clone().sub(r);h=[a[1].clone().add(u),a[1],a[2],a[2].clone().add(u)]}else if(o==="right"){const u=i.clone().sub(r);h=[a[0],a[0].clone().add(u),a[3].clone().add(u),a[3]]}else if(o==="front"){const u=i.clone().sub(r);h=[a[3].clone().add(u),a[2].clone().add(u),a[2],a[3]]}else if(o==="back"){const u=i.clone().sub(r);h=[a[0],a[1],a[1].clone().add(u),a[0].clone().add(u)]}t.setPoints({points:h,heightPoint:c?h[0].clone().add(c):void 0})}}}))}}class cc extends ls{constructor(){super(...arguments);d(this,"name","BoxMesh")}get geometryInfo(){if(this.geometryInfoNeedUpdate){this.geometryInfoNeedUpdate=!1;const e=this.bottomPositions,i=this.topPosition;if(!e||e.length<3||!i){this._geometryInfoCache=void 0;return}const s=Ot(...e),o=i.clone().sub(e[0]),r=s.clone().add(o.clone().divideScalar(2));this._geometryInfoCache={center:r}}return this._geometryInfoCache}}class lp extends Kt{constructor(e,i){super(e,i);d(this,"type","Box");d(this,"boxMesh");d(this,"_editor");e&&(this.boxMesh=new cc(x(x({},e.style),e)),this.add(this.boxMesh))}get editor(){return this._editor||(this._editor=new ap(this.boxMesh)),this._editor}get data(){return ie(x({},this.baseData),{points:_t(this.applyObjectMatrixWorld(this.boxMesh.bottomPositions,this.boxMesh)),heightPoint:_t(this.applyObjectMatrixWorld(this.boxMesh.topPosition,this.boxMesh)),style:{color:this.boxMesh.color.getHex(),opacity:this.boxMesh.opacity,lineWidth:this.boxMesh.lineWidth,lineColor:this.boxMesh.lineColor.getHex()}})}setData(e){this.boxMesh.setPoints({points:e.points?this.applyObjectReversalMatrixWorld(e.points.map(De),this.boxMesh):void 0,heightPoint:e.heightPoint?this.applyObjectReversalMatrixWorld(De(e.heightPoint),this.boxMesh):void 0}),this.boxMesh.setStyle(e.style),this._editor&&this._editor.initialHelperMatrix()}highlight(){var e;(e=this.boxMesh)==null||e.highlight()}unhighlight(){var e;(e=this.boxMesh)==null||e.unhighlight()}create(e){return H(this,null,function*(){this.removeChildren(),this.boxMesh=new cc(e),this.add(this.boxMesh),yield hc(this.boxMesh,this.pointSelector,e),this.config.defaultAction&&this.editor.enable()})}}function hc(n,t,e){return H(this,null,function*(){return new Promise((i,s)=>H(this,null,function*(){const o=n.parent;if(!o){s(new Error("No container"));return}const r=new Dr(n.style);o.add(r),yield Sr(r,t,e),o.remove(r),n.setPoints({points:r.points});const a=new Ht,l=on(n.bottomPositions),c=Ot(...n.bottomPositions),h=c.clone().add(l.clone().multiplyScalar(100)),u=c.clone().sub(l.clone().multiplyScalar(100));a.setPoints([h,u]),o.add(a),t.enable();const f=g=>{v(),i()},m=g=>{if(!(g!=null&&g.raycaster))return;const A=gn({raycaster:g.raycaster,line:new b.Line3(h,u)});if(A){const w=A.clone().sub(c);n.setPoints({heightPoint:n.bottomPositions[0].clone().add(w)})}},v=()=>{t.off("select",f),t.off("intersectionUpdate",m),t.off("disable",p),t.disable(),o==null||o.remove(a)},p=()=>{v(),o==null||o.remove(n),s(new Error("Cancelled"))};t.on("select",f),t.on("intersectionUpdate",m),t.on("disable",p)}))})}function Ox(n,t){for(let e=n.length-1;e>=0;e--)t(n[e])}class cp extends Kt{constructor(e,i){super(e,i);d(this,"type","Line");d(this,"lineMesh");d(this,"_editor");d(this,"creatingObject");e&&(this.lineMesh=new Xl(x(x({},e.style),e)),this.add(this.lineMesh))}get editor(){return this._editor||(this._editor=new Mx(this)),this._editor}get data(){return ie(x({},this.baseData),{points:_t(this.applyObjectMatrixWorld(this.lineMesh.points)),style:{lineColor:new b.Color(this.lineMesh.color).getHex(),lineWidth:this.lineMesh.lineWidth,dashed:this.lineMesh.dashed}})}setData(e){e.points&&this.lineMesh.setPoints(e.points),this.lineMesh.setStyle(e.style)}highlight(){var e;(e=this.lineMesh)==null||e.highlight()}unhighlight(){var e;(e=this.lineMesh)==null||e.unhighlight()}canUndo(){var e;(e=this.creatingObject)==null||e.canUndo()}canRedo(){var e;(e=this.creatingObject)==null||e.canRedo()}undo(){var e;(e=this.creatingObject)==null||e.undo()}redo(){var e;(e=this.creatingObject)==null||e.redo()}create(e){return H(this,null,function*(){this.removeChildren();const i=new Xl(e);this.lineMesh=i,this.add(this.lineMesh),this.creatingObject=dc(i,this.pointSelector,e),yield this.creatingObject.finished,this.config.defaultAction&&this.editor.enable()})}}function dc(n,t,e){var S;const i=n.parent;if(!i)return;const{promise:s,resolve:o,reject:r}=dn(),a=(S=e==null?void 0:e.limit)!=null?S:"none",l=new Ht(n.style);i.add(l);const c=new Ht(ie(x({},n.style),{dashed:!0,lengthEnable:!1}));i.add(c),t.enable();const h=[];let u,f,m;const v=[],p=()=>h.length>0,g=()=>v.length>0,A=()=>{p()&&(v.push(h.pop()),n.setPoints(h),C(m),t.pointSelectorHelper.magnifier.render())},w=()=>{g()&&(h.push(v.pop()),n.setPoints(h),C(m),t.pointSelectorHelper.magnifier.render())},I=L=>{if(!L)return;v.length=0;const W=h.length===0?L.point:u.clone();h.push(W),n.setPoints(h),h.length===2&&(M(),o())},C=L=>{const W=()=>{l.setPoints([]),c.setPoints([]),t.pointSelectorHelper.magnifier.render()};if(!(h!=null&&h.length)||!L)return W();m=L;const R=h.at(-1).clone();a==="none"?(u=L.point,l.setPoints([R,u])):a==="xoz"?(t.plane=f,f=f!=null?f:new b.Plane().setFromNormalAndCoplanarPoint(new b.Vector3(0,1,0),h[0]),u=f.projectPoint(L.point,new b.Vector3),l.setPoints([R,u]),c.setPoints([u,L.point])):a==="y"&&(L.isVirtual?(u=gn({raycaster:L.raycaster,line:new b.Line3(h[0].clone(),new b.Vector3(0,1,0).add(h[0])),clampToLine:!1}),c.setPoints([])):(u=new b.Line3(h[0].clone(),new b.Vector3(0,1,0).add(h[0])).closestPointToPoint(L.point,!1,new b.Vector3),c.setPoints([u,L.point])),l.setPoints([R,u]))},M=()=>{t.off("select",I),t.off("intersectionUpdate",C),t.off("disable",E),t.plane=null,t.disable(),i==null||i.remove(l,c)},E=()=>{M(),h.length!==2&&(i==null||i.remove(n)),r(new Error("Cancelled"))};return t.on("select",I),t.on("intersectionUpdate",C),t.on("disable",E),{finished:s,canUndo:p,canRedo:g,undo:A,redo:w}}const cs=class extends ht{constructor(e,i){super();d(this,"group");d(this,"theme");d(this,"five");d(this,"creatingItem",null);d(this,"undo",()=>{var e;console.log("undo"),(e=this.creatingItem)==null||e.undo(),this.five.needsRender=!0});d(this,"redo",()=>{var e;console.log("redo"),(e=this.creatingItem)==null||e.redo(),this.five.needsRender=!0});this.five=e,this.theme=i,this.group=new Rt,this.group.name="Sculpt",e.scene.add(this.group),cs.modules.init(e),Bt("ctrl+z, command+z",this.undo),Bt("ctrl+shift+z, command+shift+z",this.redo),cs.modules.fiveDomEvents.addEventListener(this.group,"click",({intersects:s,origDomEvent:o})=>{var a;const r=jg((a=s==null?void 0:s[0])==null?void 0:a.object,l=>l.isSculptObject);return r&&!r.editing?this.emit("click",o,r):!1}),window.__SCULPT_DEBUG__=this,window.__SCULPT_MODULES_DEBUG__=cs.modules}get data(){return{items:this.items.map(e=>{try{return e.data}catch(i){return console.error(i),null}}).filter(ke)}}get items(){return this.group.children}load(e,i){var o;this.clear();const s=(o=e==null?void 0:e.items)==null?void 0:o.map(r=>{var l;const a=ie(x({},r),{style:x(x({},(l=this.theme)==null?void 0:l[r.type.toLowerCase()]),r.style)});return r.type==="Point"?new Ug(a,i):r.type==="line"?new cp(a,i):r.type==="Polyline"?new Wg(a,i):r.type==="Polygon"?new Xg(a,i):r.type==="Prism"?new Jg(a,i):r.type==="Rectangle"?new ep(a,i):r.type==="Circle"?new sp(a,i):r.type==="Cylinder"?new rp(a,i):r.type==="Box"?new lp(a,i):null});this.group.add(...s),this.five.needsRender=!0}getItemById(e){return this.items.find(i=>i.uuid===e)}putObject(e){var o;this.group.add(e);const i=cs.modules.object3DHelper,s=i.addObject3DHelper(e);return(o=s==null?void 0:s.moveController)==null||o.moveByMouse(),i}createPoint(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.point,e[0]),this.createItem(Ug,...e)})}createLine(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.line,e[0]),this.createItem(cp,...e)})}createline(...e){return H(this,null,function*(){this.createLine(...e)})}createPolyline(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.polyline,e[0]),this.createItem(Wg,...e)})}createPolygon(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.polygon,e[0]),this.createItem(Xg,...e)})}createPrism(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.prism,e[0]),this.createItem(Jg,...e)})}createRectangle(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.rectangle,e[0]),this.createItem(ep,...e)})}createCircle(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.circle,e[0]),this.createItem(sp,...e)})}createCylinder(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.cylinder,e[0]),this.createItem(rp,...e)})}createBox(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.box,e[0]),this.createItem(lp,...e)})}canUndo(){var e;return this.creatingItem?(e=this.creatingItem)==null?void 0:e.canUndo():!1}canRedo(){var e;return this.creatingItem?(e=this.creatingItem)==null?void 0:e.canRedo():!1}clear(){Ox(this.items,e=>e.delete()),this.five.needsRender=!0}createItem(e,...i){return H(this,null,function*(){this.creatingItem&&(this.creatingItem.stopCreating(),this.creatingItem=null);const s=new e;this.creatingItem=s,this.group.add(s);const{promise:o,resolve:r,reject:a}=dn();return yield s.create(...i).then((...l)=>(this.creatingItem=null,r(s),l)).catch(l=>{a(l),this.group.remove(s)}),o})}};let Je=cs;d(Je,"modules",zg);const Vx=n=>new Je(n);function Bx(n,...t){t.forEach(e=>{n.children.includes(e)||e&&n.add(e)})}let Tr;const hp=n=>((!Tr||n!==Tr.five)&&(Tr={instance:new Ss(n,{noEmitWhenHide:!0,noEmitWhenNotInScene:!0}),five:n}),Tr.instance);class dp extends ht{constructor(e){var s,o;super();d(this,"type");d(this,"tag");d(this,"rawData");d(this,"model");d(this,"visibles",[]);d(this,"five");d(this,"group");d(this,"fiveDomEvents");d(this,"disposers",[]);this.five=e.five,this.model=e.model,this.group=e.group,this.type=e.type,this.rawData=e.rawData,this.fiveDomEvents=hp(this.five);const i=(o=(s=e.position)!=null?s:this.model.center)!=null?o:xn(this.model).getCenter(new b.Vector3);this.tag=lh(this.five,i,{wrapper:e.tagWrapper}),this.tag.extraObjectsForIntersectCheck.push(this.group)}get container(){return this.tag.container}get state(){return{visible:this.model.visible,enabled:this.group.children.includes(this.model)}}show(){this.visibles[0]=!0,this.updateVisible(),this.emit("show")}hide(){this.visibles[0]=!1,this.updateVisible(),this.emit("hide")}enable(){Bx(this.group,this.model),this.five.needsRender=!0,this.model.updateMatrixWorld(!0),this.tag.setTransformMatrix(this.model.matrixWorld),this.tag.enable();const e=this.onClick.bind(this);this.fiveDomEvents.addEventListener(this.model,"click",e),this.disposers.push(()=>{this.fiveDomEvents.removeEventListener(this.model,"click")}),this.updateVisible(),this.emit("enable")}disable(){this.group.remove(this.model),this.five.needsRender=!0,this.tag.disable(),this.disposers.forEach(e=>e()),this.disposers=[],this.emit("disable")}updateVisible(){!this.visibles.some(i=>i===!1)?(this.tag.show(),this.model.visible=!0):(this.tag.hide(),this.model.visible=!1),this.five.needsRender=!0}onClick(){return this.emit("click",this)}}class up extends dp{constructor(...e){super(...e);d(this,"hideTag",()=>{this.tag.hide()});this.enable(),this.tag.hide(),this.updateVisible()}enable(){super.enable(),this.five.on("mode.change.request",this.hideTag),this.five.on("pano.request",this.hideTag)}disable(){super.disable(),this.five.off("mode.change.request",this.hideTag),this.five.off("pano.request",this.hideTag)}show(){super.show(),this.tag.hide()}onClick(){return this.tag.visible?this.tag.hide():this.tag.show({force:!0}),super.onClick(),!0}updateVisible(){!this.visibles.some(i=>i===!1)?this.model.visible=!0:(this.tag.hide(),this.model.visible=!1),this.five.needsRender=!0}}function _x(n){ge(n,"svelte-1q9fx3x",".model-maker-tag.svelte-1q9fx3x{position:absolute;width:-moz-max-content;width:max-content;left:50%;top:50%;transform:translate(-50%, -50%);color:#fff;font-size:0.875rem;font-weight:bold;text-shadow:0.125rem 0 0.5rem rgba(0, 0, 0, 0.15)}")}function fp(n){let t,e;return{c(){t=T("div"),e=Se(n[0]),P(t,"class","model-maker-tag svelte-1q9fx3x")},m(i,s){B(i,t,s),O(t,e)},p(i,s){s&1&&Te(e,i[0])},d(i){i&&V(t)}}}function Rx(n){let t,e=n[0]&&fp(n);return{c(){e&&e.c(),t=Ee()},m(i,s){e&&e.m(i,s),B(i,t,s)},p(i,[s]){i[0]?e?e.p(i,s):(e=fp(i),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:$,o:$,d(i){e&&e.d(i),i&&V(t)}}}function Fx(n,t,e){let{text:i}=t;return n.$$set=s=>{"text"in s&&e(0,i=s.text)},[i]}class Nx extends ue{constructor(t){super(),de(this,t,Fx,Rx,he,{text:0},_x)}}const mp=(n,t)=>{var i;const e=new Nx({target:n,props:{text:(i=t.rawData)==null?void 0:i.name}});return()=>e.$destroy()},Gx={box:mp,triangles:mp,prism:(n,t,e)=>{var s;const i=new Lg({target:n,props:{content:(s=t.rawData)==null?void 0:s.name,five:e}});return()=>i.$destroy()}};class gp extends dp{constructor(...e){const i=e[0],s=xn(i.model),o=new b.Vector3().lerpVectors(Si(s,0),Si(s,5),.5);super(ie(x({},i),{position:o}));d(this,"onModelShownFloorChange",e=>{this.updateFiveCurrentFloorState(e),this.updateVisible()});d(this,"updateFiveCurrentFloorState",e=>{var s,o;const i=(o=(s=this.rawData)==null?void 0:s.object_data)==null?void 0:o.floorIndex;Dt(i)?this.visibles[1]=!0:this.visibles[1]=e===null?!0:i===e});this.enable(),this.updateVisible(),this.five.on("modelShownFloorChange",this.onModelShownFloorChange),this.disposers.push(()=>{this.five.off("modelShownFloorChange",this.onModelShownFloorChange)})}show(){this.updateFiveCurrentFloorState(this.five.model.shownFloor),super.show()}hide(){super.hide()}}class Qx extends up{constructor(...e){super(...e);d(this,"onPanoArrived",e=>{this.updatePanoIndex(e),this.updateVisible()});d(this,"onModeChange",e=>{this.updateMode(e),this.updateVisible()});d(this,"updatePanoIndex",e=>{var i,s;this.visibles[1]=((s=(i=this.rawData)==null?void 0:i.object_data)==null?void 0:s.panoIndex)===e});d(this,"updateMode",e=>{this.visibles[2]=e==="Panorama"});this.updatePanoIndex(this.five.state.panoIndex),this.updateMode(this.five.state.mode),this.updateVisible(),this.five.on("panoArrived",this.onPanoArrived),this.five.on("modeChange",this.onModeChange),this.disposers.push(()=>{this.five.off("panoArrived",this.onPanoArrived),this.five.off("modeChange",this.onModeChange)})}show(){this.updatePanoIndex(this.five.state.panoIndex),this.updateMode(this.five.state.mode),super.show()}}class Wx extends wi{constructor(e,i){var s,o;super(e);d(this,"state");d(this,"items",[]);d(this,"group",new b.Group);d(this,"data");d(this,"tagRendererMap",{});d(this,"fiveDomEvents");d(this,"zFightingOffset",0);d(this,"tagWrapper");d(this,"occlusionVisibility");d(this,"occlusionMode");d(this,"fiveEveryReadyListenerDisposer");d(this,"onFiveModeChange",e=>{const i=this.occlusionVisibility;Array.isArray(i)&&this.items.forEach(s=>{s.model.setStyle instanceof Function&&s.model.setStyle({occlusionVisibility:i.includes(e)})})});d(this,"handleEnable",()=>{var e,i;this.five.scene.add(this.group),(i=(e=this.five.getElement())==null?void 0:e.parentElement)==null||i.appendChild(this.tagWrapper),this.five.needsRender=!0,this.onFiveModeChange(this.five.getCurrentState().mode),this.onFiveEveryReady(),this.five.on("modeChange",this.onFiveModeChange),this.fiveEveryReadyListenerDisposer=oa(this.five,this.onFiveEveryReady)});d(this,"handleDisable",()=>{this.five.scene.remove(this.group),this.tagWrapper.remove(),this.five.needsRender=!0,this.five.off("modeChange",this.onFiveModeChange),this.fiveEveryReadyListenerDisposer()});d(this,"onFiveEveryReady",()=>H(this,null,function*(){if(this.five.state.mode==="Panorama")return;const e=this.items.filter(l=>l instanceof gp).map(l=>l.tag),i=e.filter(l=>l.position&&l.visible&&l.enabled);yield Cg(0);const s=this.five.camera.position.clone(),o=i.sort((l,c)=>s.distanceTo(l.position)-s.distanceTo(c.position)),r=[],a=(l,c)=>!(l.right<c.left||l.left>c.right||l.bottom<c.top||l.top>c.bottom);e.forEach(l=>{l.visibles[2]=void 0}),o.forEach(l=>{if(l.visibles[1]===!1)return;const c=l.container.getElementsByClassName("room-label-item__text")[0];if(!c)return;const h=c.getBoundingClientRect();r.every(f=>!a(f.boundingClientRect,h))?(r.push({tag:l,boundingClientRect:h}),l.visibles[2]=!0):l.visibles[2]=!1,l.needsRender=!0})}));d(this,"updateTagRenderer",()=>{this.items.forEach(e=>{var s;const i=(s=this.tagRendererMap[e.type])!=null?s:Gx[e.type];i&&e.__renderer!==i&&(e.__renderer=i,typeof e.__disposeRenderer=="function"&&e.__disposeRenderer(),e.tag.container.innerHTML="",e.__disposeRenderer=i(e.tag.container,e,this.five))})});this.group.name="ModelMakerPluginGroup",this.state={enabled:!0,visible:!0},this.occlusionVisibility=(s=i==null?void 0:i.occlusionVisibility)!=null?s:!1,this.occlusionMode=(o=i==null?void 0:i.occlusionMode)!=null?o:"translucence",this.fiveDomEvents=hp(e),this.tagWrapper=(()=>{var a;const r=document.createElement("div");return r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.pointerEvents="none",r.style.zIndex=`${(a=i==null?void 0:i.tagContainerZIndex)!=null?a:""}`,r})(),e.scene.add(this.group),this.handleEnable(),window.__MODELMAKER_DEBUG__=this}load(e){return H(this,null,function*(){var s;if(this.clear(),this.data=e,yield ni(this.five),this.data!==e)return;this.clear();const i=o=>{var a;const r=o.object_data.color?new b.Color().setHex(parseInt(o.object_data.color.slice(1),16)):new b.Color(1,1,1);return{color:r,lineColor:r,opacity:((a=o.object_data.opacity)!=null?a:.4)/2,lineOpacity:1,lineWidth:1,occlusionVisibility:typeof this.occlusionVisibility=="boolean"?this.occlusionVisibility:!1,occlusionMode:this.occlusionMode}};(s=e==null?void 0:e.list)==null||s.forEach(o=>{var r;if(o.type==="triangles"){const a=new Yg;a.setPoints(o.object_data.points),a.setStyle(i(o)),this.fiveDomEvents.addEventListener(a,"hover",()=>a.highlight()),this.fiveDomEvents.addEventListener(a,"unHover",()=>a.unhighlight());const l=new Qx({five:this.five,tagWrapper:this.tagWrapper,model:a,group:this.group,type:o.type,rawData:o});this.items.push(l)}else if(o.type==="prism"){const a=new ls;this.zFightingOffset+=Ns.Z_FIGHTING_OFFSET;const l=o.object_data.points.map(f=>{var m;return[f[0],f[1]+((m=o.object_data.fixedY)!=null?m:0),f[2]]});l.push(l[0]);const c=o.object_data.height+((r=o.object_data.fixedHeight)!=null?r:0)+this.zFightingOffset,h=De(l[0]).add(new b.Vector3().setY(c));a.setPoints({points:l,heightPoint:h}),a.setStyle(i(o));const u=new gp({five:this.five,tagWrapper:this.tagWrapper,model:a,group:this.group,type:o.type,rawData:o});this.items.push(u)}else if(o.type==="box"){const a=new ls,{start:l,end:c,rotation:h=[0,0,0,0]}=o.object_data,u=new b.Vector3().fromArray(l),f=new b.Vector3().fromArray(c),m=new b.Euler().fromArray(h),v=new b.Quaternion().setFromEuler(m),p=v.clone().inverse(),g=new b.Vector3().lerpVectors(u,f,.5),A=g.clone().negate(),w=u.clone().add(A).applyQuaternion(p),I=f.clone().add(A).applyQuaternion(p),C=new b.Box3(w.clone().max(I),w.clone().min(I));a.setPoints({points:[Si(C,2),Si(C,3),Si(C,7),Si(C,6)],heightPoint:Si(C,1)}),a.position.copy(g),a.quaternion.copy(v),a.setStyle(i(o));const M=new up({five:this.five,tagWrapper:this.tagWrapper,model:a,group:this.group,type:o.type,rawData:o});this.items.push(M)}}),this.state.enabled?this.handleEnable():this.handleDisable(),this.state.visible?this.handleShow():this.handleHide(),this.updateTagRenderer(),this.hooks.emit("dataLoaded",e),this.five.needsRender=!0})}setState(e){ke(e.enabled)&&this.state.enabled!==e.enabled&&(this.state.enabled=e.enabled,e.enabled?this.handleEnable():this.handleDisable(),this.hooks.emit(e.enabled?"enable":"disable",{userAction:"我不知道捏"}),this.hooks.emit("stateChange",{state:this.state,userAction:"我不知道捏"})),ke(e.visible)&&this.state.visible!==e.visible&&(this.state.visible=e.visible,e.visible?this.handleShow():this.handleHide(),this.hooks.emit(e.visible?"show":"hide",{userAction:"我不知道捏"}),this.hooks.emit("stateChange",{state:this.state,userAction:"我不知道捏"}))}getItemById(e){return this.items.find(i=>i.rawData.id===e)}registerTagRenderer(e){this.tagRendererMap=x(x({},this.tagRendererMap),e),this.updateTagRenderer()}hasCustomTagRenderer(e){return!!this.tagRendererMap[e]}enable(){this.setState({enabled:!0})}disable(){this.setState({enabled:!1})}show(){this.setState({visible:!0})}hide(){this.setState({visible:!1})}clear(){this.zFightingOffset=0,this.handleDisable(),this.group.children.length=0,this.five.needsRender=!0,this.items=[],this.tagWrapper.innerHTML="",this.fiveDomEvents.clear()}dispose(){this.hooks.emit("dispose"),this.clear()}onWorkCodeChange(){this.group.matrix.copy(this.workUtil.transform.clone()),this.group.matrix.decompose(this.group.position,this.group.quaternion,this.group.scale),this.group.updateMatrixWorld()}handleShow(){this.group.visible=!0,this.tagWrapper.style.display="block",this.five.needsRender=!0}handleHide(){this.group.visible=!1,this.tagWrapper.style.display="none",this.five.needsRender=!0}}const Hx=(...n)=>new Wx(...n),Ux=Object.freeze(Object.defineProperty({__proto__:null,BetterTween:Dn,FiveDomEvents:Ss,FivePuppet:Wv,Interval:$r,LightTag:Di,LineSegments:wh,Magnifier:ko,Object3D:yh,PointHelper:bh,PointSelector:ca,PointSelectorHelper:mh,Rectangle:Up,absoluteUrl:ma,animeMap:xs,awaitNextFrame:Vv,blink:To,bounding:da,boundingBox:xn,boundingSphere:Ch,boxVertex:Si,boxVertexes:Dv,checkFiveModelLoaded:jv,convexHull:Yp,equal:wt,fiveModelIsLoaded:kh,getCoordsFromClient:Kp,getCoordsFromElement:$p,getFrameTime:Bv,inside:oh,isAbsoluteURL:Dh,isModelLike:Wt,isNil:Dt,isPanoramaLike:Ji,lookObject:zv,lookPoint:Eh,nextFrame:Ts,notNil:ke,pointInPolygon:oh,reblink:Mh,requestAnimationFrameInterval:Ln,sculpt:Object.freeze(Object.defineProperty({__proto__:null,BaseEditor:Er,BoxMesh:cc,BoxMeshEditor:ap,CircleMesh:np,CircleMeshEditor:tp,CircleWithEdgeMesh:io,CylinderMesh:ac,CylinderMeshEditor:op,LineMesh:Ht,PointMesh:as,PolygonMesh:sc,PrismMesh:ls,PrismMeshEditor:Zg,RectangleMesh:Kg,RectangleMeshEditor:qg,RectangleWithEdgeMesh:Dr,createBox:hc,createCircle:Lr,createCylinder:lc,createLine:dc,createPoint:ic,createPolygon:xr,createPrism:rc,createRectangle:Sr},Symbol.toStringTag,{value:"Module"})),tag:lh,tweenProgress:Ls,uuid:ct,waitFiveModelLoaded:ni,worldBounding:Lo,worldBoundingBox:Sv,worldBoundingSphere:Ph},Symbol.toStringTag,{value:"Module"}));Pp(),Cp(),K.AreaMakerPlugin=rx,K.CSS3DRender=jn,K.CSS3DRenderPlugin=Oo,K.CameraMovementEffect=Jd,K.CameraMovementPlugin=y1,K.ContentType=xf,K.CruisePlugin=GE,K.CruisePluginController=Us,K.CruisePluginTypes=NE,K.CurrentPanoImagePlugin=lx,K.DIRECTION=$n,K.DISPLAY_STRATEGY_TYPE=an,K.DimensionType=Df,K.FLOOR_PLAN_ATTACHED_TO=Vi,K.FLOOR_TYPE_MAP=h1,K.GuideLineItem=_E,K.GuideLineModeItem=TE,K.GuideLinePlugin=Tl,K.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=ln,K.ItemLabelPlugin=cC,K.Magnifier=ko,K.MapviewFloorplanPlugin=Rb,K.ModelChassisCompassPlugin=f1,K.ModelEntryDoorGuidePlugin=p1,K.ModelFloorplanPlugin=Ob,K.ModelItemLabelPlugin=Nw,K.ModelMakerPlugin=Hx,K.ModelRoomLabelPlugin=H0,K.ModelTVVideoPlugin=Uw,K.ModelViewPlugin=Rp,K.MoveController=Sl,K.MovePlugin=QE,K.Object3DHelperController=Ql,K.Object3DHelperPlugin=xk,K.PLUGIN=Ir,K.PaintBrush=_p,K.PaintBrushTypeEnum=gi,K.PanoCompassPlugin=G1,K.PanoCursorRaycasterPlugin=t0,K.PanoDoorLabelPlugin=wC,K.PanoFloorplanRadarPlugin=l1,K.PanoMeasurePlugin=mw,K.PanoMeasurePluginLine=nn,K.PanoMeasurePluginModel=Ja,K.PanoMeasurePluginPoint=Vt,K.PanoMeasurePluginPolyline=sn,K.PanoRulerPlugin=E1,K.PanoRulerProPlugin=B1,K.PanoSpatialTagPlugin=Dw,K.PanoTagPlugin=PE,K.PanoTagPluginController=wr,K.PanoVideoPlugin=jk,K.PanoVideoPluginType=zk,K.PipelinePlugin=qk,K.PointType=kf,K.ROOM_FETILE_TYPE_MAP=c1,K.ROOM_TYPE_MAP=d1,K.Rotation=ai,K.Sculpt=Je,K.SculptPlugin=Vx,K.TopviewFloorplanPlugin=Nb,K.Util=Ux,K.WalkController=Us,K.createBox=hc,K.createCircle=Lr,K.createCylinder=lc,K.createLine=dc,K.createPoint=ic,K.createPolygon=xr,K.createPolyline=Hg,K.createPrism=rc,K.createRectangle=Sr,K.defaultGlobalConfig=Ef,K.itemLabelPluginServerParams=hC,K.modelItemLabelPluginServerParams=Gw,K.modelRoomLabelPluginServerParams=U0,K.pluginFlag=CE,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
1044
+ `;class Zk extends rs{constructor(e){super(e,Xk);d(this,"initialDisplacement",0);d(this,"oldTime",new Date().getTime());d(this,"flowSpeed",.6);d(this,"rotateSpeed",0);d(this,"flowAnimationDisposer",()=>{})}setInitialDisplacement(e,i="backward"){this.initialDisplacement=Math.abs(e)*(i==="forward"?-1:1),this.moveFromOrigin(this.initialDisplacement)}moveFromOrigin(e){const i=e*this.uPreMeter;return this.material.uniforms.uOffset.value=i,this.material.needsUpdate=!0,this.needsRender=!0,!0}moveForwardFromInitialOffset(e){const i=e*-1,s=this.initialDisplacement+i;this.moveFromOrigin(s)}flow(){this.flowAnimationDisposer(),this.oldTime=new Date().getTime();let e=0,i=0;const s=Ln(()=>{const o=new Date().getTime(),r=o-this.oldTime,a=this.flowSpeed*(r/1e3),l=this.rotateSpeed*(r/1e3);e=e+a,i=i+l;const c=1/360,h=i*c;this.material.uniforms.vOffset.value=h,this.moveForwardFromInitialOffset(e),this.oldTime=o});this.flowAnimationDisposer=function(){s(),this.moveForwardFromInitialOffset(0)}}stopFlow(){this.flowAnimationDisposer()}setSpeed(e){typeof(e==null?void 0:e.flowSpeed)=="number"&&(this.flowSpeed=e.flowSpeed),typeof(e==null?void 0:e.rotateSpeed)=="number"&&(this.rotateSpeed=e.rotateSpeed)}disposeAnime(){super.disposeAnime(),this.flowAnimationDisposer()}}const Dg={flowSpeed:.6,rotateSpeed:0};let Jk=class extends wi{constructor(e){super(e);d(this,"data");d(this,"state");d(this,"group");d(this,"pipeObjects",[]);d(this,"texturePromiseCache",new Map);d(this,"dispose",()=>{this.disable(),this.five.scene.remove(this.group),this.texturePromiseCache.forEach(e=>e.then(i=>i.dispose())),this.texturePromiseCache.clear()});d(this,"onWantsFiveTapGesture",(...e)=>{const[i]=e,s=i.intersectObjects(this.pipeObjects,!1);if(s.length===0||!this.data)return;const a=s[0].object.customID,l=this.data.pipes.find(({id:h})=>h===a),c=this.data.pipelines.find(h=>l&&h.pipes.includes(l));if(!(!l||!c))return this.hooks.emit("tap",{intersectObjects:s,pipe:l,pipeline:c,wantsFiveTapGestureParams:e}),!1});this.state={target:null,visible:!0,enabled:!0,isFlowing:!1,speed:Dg},this.five=e,this.group=new b.Group,this.group.name="water-pipe-group",this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.five.on("wantsTapGesture",this.onWantsFiveTapGesture)}load(e,i,s,o){return H(this,null,function*(){const r=this.data;this.data=yield this.formatData(e,o),this.removeAllPipes(),this.hooks.emit("dataChange",this.data,r),this.pipeObjects=yield Promise.all(this.data.pipes.filter(a=>!!(a!=null&&a.texture)).map(u=>H(this,[u],function*({id:a,texture:l,path:c,radius:h}){const f=yield this.loadPipeTexture(l),m={id:a,path:c,textureURL:l,texture:f,geometryConfig:{radius:h}};return new Zk(m)}))),this.data.pipelines.forEach(a=>{a.pipes.reduce((l,c)=>{const h=this.findPipeObjectWithID(c.id);return h==null||h.setInitialDisplacement(l),l+((h==null?void 0:h.pathLength)||0)},0)}),this.hooks.emit("dataLoaded",this.data),this.state.visible===!1&&this.pipeObjects.forEach(a=>a.setOpacity(0)),this.state.enabled&&(this.group.add(...this.pipeObjects),this.five.needsRender=!0),i&&this.setState(i,{userAction:s})})}setState(e,i={}){const s=this.state;if(wt(e,s,{deep:!0}))return;const o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o,anime:{duration:500}};e.visible?this._show(r):this._hide(r)}if(e.isFlowing!==void 0&&s.isFlowing!==e.isFlowing&&(e.isFlowing?this._flow():this._stopFlow()),e.speed!==void 0&&!wt(s.speed,this.state.speed,{deep:!0})&&this._setSpeed(e.speed),e.target!==void 0&&!wt(s.target,this.state.target,{deep:!0})){const r={target:e.target,showAnime:{duration:500},hideAnime:{duration:500}};this._switchPipelines(r)}}enable(e={}){var s;if(this.state.enabled)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({enabled:!0},i),this._enable({userAction:i})}disable(e={}){var s;if(this.state.enabled===!1)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({enabled:!1,isFlowing:!1},i),this._disable({userAction:i})}show(){return H(this,arguments,function*(e={}){if(this.state.visible)return;const i=x({userAction:!0,anime:{duration:500}},e);this.updateState({visible:!0},i.userAction),yield this._show(i)})}hide(){return H(this,arguments,function*(e={}){if(this.state.visible===!1)return;const i=x({userAction:!0,anime:{duration:500}},e);this.updateState({visible:!1},i.userAction),yield this._hide(i)})}switchPipelines(e){return H(this,null,function*(){var c,h,u,f,m,v;if(!this.data)return;const i=(c=e==null?void 0:e.target)!=null?c:null,s=(h=e==null?void 0:e.userAction)!=null?h:!0;this.updateState({target:i},s);const o={duration:500},r=(f=(u=e==null?void 0:e.hideAnime)!=null?u:e==null?void 0:e.anime)!=null?f:o,a=(v=(m=e==null?void 0:e.showAnime)!=null?m:e==null?void 0:e.anime)!=null?v:o,l={target:i,showAnime:a,hideAnime:r};this._switchPipelines(l)})}flow(e={}){var s;if(this.state.isFlowing)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({isFlowing:!0},i),this._flow()}stopFlow(e={}){var s;if(this.state.isFlowing===!1)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({isFlowing:!1},i),this._stopFlow()}setSpeed(e){var o,r;const i=(o=e==null?void 0:e.speed)!=null?o:Dg,s=(r=e.userAction)!=null?r:!0;this.updateState({speed:i},s),this._setSpeed(i)}formatData(e,i){return H(this,null,function*(){return Bk(e,i)})}_enable(e){this.hooks.emit("enable",{userAction:e.userAction}),this.five.scene.add(this.group),this.five.needsRender=!0,this.five.on("wantsTapGesture",this.onWantsFiveTapGesture)}_disable(e){this.hooks.emit("disable",{userAction:e.userAction}),this.disposeAnime(),this.five.scene.remove(this.group),this.five.needsRender=!0,this.five.off("wantsTapGesture",this.onWantsFiveTapGesture)}_show(e){return H(this,null,function*(){var o;this.hooks.emit("show",{userAction:e.userAction});const i=(o=e==null?void 0:e.anime)!=null?o:{duration:500},s=this.findPipeObjectWithTarget(this.state.target);yield Promise.all(s.map(r=>r==null?void 0:r.show(i))),this.five.needsRender=!0})}_hide(e){return H(this,null,function*(){var s;this.hooks.emit("hide",{userAction:e.userAction});const i=(s=e==null?void 0:e.anime)!=null?s:{duration:500};yield Promise.all(this.pipeObjects.map(o=>o.hide(i))),this.five.needsRender=!0})}_switchPipelines(e){return H(this,null,function*(){if(!this.data)return;const i=this.findPipeObjectWithTarget(e.target),s=e.hideAnime;yield Promise.all(this.pipeObjects.map(r=>r.hide(s)));const o=e.showAnime;yield Promise.all(i.map(r=>r.show(o)))})}_flow(){this.pipeObjects.forEach(e=>e.flow())}_stopFlow(){this.pipeObjects.forEach(e=>e.stopFlow())}_setSpeed(e){this.pipeObjects.forEach(i=>i.setSpeed(e))}updateState(e,i){const s=this.state;this.state=x(x({},this.state),e),this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}loadPipeTexture(e){return H(this,null,function*(){const i=this.texturePromiseCache.get(e);if(i)return i;const s=en(e);return this.texturePromiseCache.set(e,s),s})}disposeAnime(){this.pipeObjects.forEach(e=>e.disposeAnime()),this.five.needsRender=!0}removeAllPipes(){this.disposeAnime(),this.group.remove(...this.pipeObjects),this.pipeObjects.forEach(e=>e.dispose()),this.pipeObjects=[],this.five.needsRender=!0}findPipeObjectWithID(e){return this.pipeObjects.find(({customID:i})=>i===e)}findPipeObjectWithTarget(e){return e?Ok({data:this.data,target:e}).map(({id:s})=>this.findPipeObjectWithID(s)).filter(ke):this.pipeObjects}};const qk=n=>new Jk(n),Kk="data:image/png;base64,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";function $k(n){ge(n,"svelte-16mrlad",".room-label-item.svelte-16mrlad{position:absolute;font-size:0.625rem;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;color:#fff}.room-label-item__text.svelte-16mrlad{position:absolute;left:0;top:-4rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.25rem;min-width:2rem;padding:0 0.375rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-16mrlad{position:absolute;transform-origin:top;top:-2.75rem;height:3rem;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}")}function Sg(n){let t,e,i,s,o,r;return{c(){t=T("span"),e=Se(n[0]),i=te(),s=T("div"),P(t,"class","room-label-item__text svelte-16mrlad"),z(t,"background-image","url("+Kk+")"),P(s,"class","room-label-item__bar svelte-16mrlad")},m(a,l){B(a,t,l),O(t,e),n[13](t),B(a,i,l),B(a,s,l),n[14](s),o||(r=Ce(t,"click",function(){si(n[4])&&n[4].apply(this,arguments)}),o=!0)},p(a,l){n=a,l&1&&Te(e,n[0])},d(a){a&&V(t),n[13](null),a&&V(i),a&&V(s),n[14](null),o=!1,r()}}}function ex(n){let t,e=!n[5]&&Sg(n);return{c(){t=T("div"),e&&e.c(),P(t,"class","room-label-item svelte-16mrlad"),z(t,"z-index",n[2]),z(t,"transform",n[3]),z(t,"opacity",n[1]),z(t,"visibility",n[9])},m(i,s){B(i,t,s),e&&e.m(t,null),n[15](t)},p(i,[s]){i[5]?e&&(e.d(1),e=null):e?e.p(i,s):(e=Sg(i),e.c(),e.m(t,null)),s&4&&z(t,"z-index",i[2]),s&8&&z(t,"transform",i[3]),s&2&&z(t,"opacity",i[1]),s&512&&z(t,"visibility",i[9])},i:$,o:$,d(i){i&&V(t),e&&e.d(),n[15](null)}}}function tx(n,t,e){let i,{content:s}=t,{five:o=void 0}=t,{visible:r=!0}=t,{opacity:a=1}=t,{zIndex:l=0}=t,{transform:c=void 0}=t,{onClick:h=()=>{}}=t,{rendererIfNeed:u=void 0}=t,{rendererData:f=void 0}=t,m,v,p,g;const A=M=>{if(o.state.mode!=="Panorama"){const L=-(10+54*(1-qo(M.latitude)/90)),W=L+20,R=W>=0?0:-W/44;e(7,v.style.transform=`scaleY(${R})`,v),e(7,v.style.top=`${W}px`,v),e(8,p.style.top=`${L}px`,p)}};Et(()=>{m&&typeof u=="function"&&(g=u(m,f)),o&&(A(o.camera.pose),o.on("cameraUpdate",A))}),Ft(()=>{g==null||g(),o==null||o.off("cameraUpdate",A)});function w(M){Qe[M?"unshift":"push"](()=>{p=M,e(8,p)})}function I(M){Qe[M?"unshift":"push"](()=>{v=M,e(7,v)})}function C(M){Qe[M?"unshift":"push"](()=>{m=M,e(6,m)})}return n.$$set=M=>{"content"in M&&e(0,s=M.content),"five"in M&&e(10,o=M.five),"visible"in M&&e(11,r=M.visible),"opacity"in M&&e(1,a=M.opacity),"zIndex"in M&&e(2,l=M.zIndex),"transform"in M&&e(3,c=M.transform),"onClick"in M&&e(4,h=M.onClick),"rendererIfNeed"in M&&e(5,u=M.rendererIfNeed),"rendererData"in M&&e(12,f=M.rendererData)},n.$$.update=()=>{n.$$.dirty&2048&&e(9,i=r?"visible":"hidden")},[s,a,l,c,h,u,m,v,p,i,o,r,f,w,I,C]}class Lg extends ue{constructor(t){super(),de(this,t,tx,ex,he,{content:0,five:10,visible:11,opacity:1,zIndex:2,transform:3,onClick:4,rendererIfNeed:5,rendererData:12},$k)}}class ix extends yh{constructor(e){super();d(this,"areaMakerItem");this.areaMakerItem=e}raycast(e,i){this.areaMakerItem.makerObject.raycast(e,i)}}class nx{constructor(t,e){d(this,"id");d(this,"name","");d(this,"makerObject");d(this,"outline");d(this,"bottomY");d(this,"opacity");d(this,"height");d(this,"floorIndex");d(this,"shape");d(this,"mounted",!1);d(this,"checkMsg",{checkVisibleMsg:"",checkTagVisibleMsg:""});d(this,"modelGroup");d(this,"visible",!0);d(this,"tagApp");d(this,"tagVisible",null);d(this,"tagPosition",new b.Vector3);d(this,"tagNDCPosition",new b.Vector3);d(this,"tagTransform",{left:0,top:0});d(this,"tagZIndex",0);d(this,"hooks",new ht);d(this,"itemRenderer");d(this,"data");d(this,"plugin");d(this,"opacityAnime");d(this,"isInContainerResizeAnimation",!1);d(this,"containerResizeTimeoutID",null);d(this,"resizeObserver");d(this,"doOpacityAnime",t=>{var a;(a=this.opacityAnime)==null||a.dispose();const e=t.duration,[i,s]=t.makerObjectOpacity,[o,r]=t.outlineOpacity;if(e===0){this.makerObject.material.opacity=s,this.outline.material.opacity=r;return}return new Promise(l=>{this.opacityAnime=new Dn({makerObjectOpacity:i,outlineOpacity:o}).to({makerObjectOpacity:s,outlineOpacity:r}).onUpdate(({makerObjectOpacity:c,outlineOpacity:h})=>{this.makerObject.material.opacity=c,this.outline.material.opacity=h,this.plugin.five.needsRender=!0}).onComplete(()=>l(!0)).onDispose(()=>{this.makerObject.material.opacity=s,this.outline.material.opacity=r,this.plugin.five.needsRender=!0,l(!1)}).play()})});d(this,"onPluginConfigChange",t=>{this.makerObject.material.depthTest=t.config.modelDepthTest,this.outline.material.depthTest=t.config.modelDepthTest,this.plugin.five.needsRender=!0});d(this,"onPluginStateChange",()=>{this.updateVisible(),this.updateTagVisible()});d(this,"updateVisible",()=>{var s;const{result:t,msg:e}=this.checkVisible();if(this.checkMsg.checkVisibleMsg=e,this.visible===t)return;this.visible=t;const i=(s=this.data.object_data.visible)!=null?s:!0;this.modelGroup.visible=t&&i,this.plugin.five.needsRender=!0});d(this,"checkVisible",()=>{if(!this.plugin.state.visible)return{result:!1,msg:"插件不可见"};const e=this.plugin.fiveUtil.model.shownFloor;return e===null||e===this.floorIndex?{result:!0,msg:""}:{result:!1,msg:`模型高亮楼层不符合展示条件, 当前高亮楼层为:${e}`}});d(this,"updateTag",()=>{this.tagApp&&(this.updateTagNDCPosition(),this.updateTagDomTransform(),this.updateTagVisible())});d(this,"updateTagNDCPosition",()=>{const e=this.tagPosition.clone().project(this.plugin.five.camera);this.tagNDCPosition.copy(e)});d(this,"updateTagDomTransform",()=>{var s;const t=this.tagNDCPosition,e=Math.round((t.x+1)/2*this.plugin.tagDomContainer.clientWidth),i=Math.round((-t.y+1)/2*this.plugin.tagDomContainer.clientHeight);this.tagTransform.left===e&&this.tagTransform.top===i||(this.tagTransform={left:e,top:i},(s=this.tagApp)==null||s.$set({transform:`translate(${e}px, ${i}px)`}))});d(this,"updateTagVisible",()=>{var i;const{result:t,msg:e}=this.checkTagVisible();this.checkMsg.checkTagVisibleMsg=e,this.tagVisible!==t&&(this.tagVisible=t,this.tagApp&&(this.tagVisible?this.hooks.emit("tagShow"):this.hooks.emit("tagHide"),(i=this.tagApp)==null||i.$set({visible:t})))});d(this,"checkTagVisible",()=>{if(!this.visible)return{result:!1,msg:"标注整体不可见"};if(this.isInContainerResizeAnimation)return{result:!1,msg:"处于容器 resize 动画中"};const e=this.plugin.five,i=e.camera.position.clone();vi.set(i.clone(),this.tagPosition.clone().sub(i).normalize());const[s]=this.plugin.fiveUtil.model.intersectRaycaster(vi),o=this.tagPosition.distanceTo(e.camera.position);if(s&&s.distance+.1<o)return{result:!1,msg:"标注标签被 Five 模型遮挡"};const r=this.tagNDCPosition;return Math.abs(r.x)>1.2||Math.abs(r.y)>1.2||Math.abs(r.z)>1?{result:!1,msg:"标注标签不在屏幕内"}:{result:!0,msg:""}});d(this,"onFiveCameraUpdate",()=>{this.tagApp&&this.visible&&(this.updateTagNDCPosition(),this.updateTagDomTransform(),this.updateTagVisible())});d(this,"onContainerResize",()=>{this.isInContainerResizeAnimation===!1&&(this.isInContainerResizeAnimation=!0,this.updateTag());const e=()=>{this.isInContainerResizeAnimation=!1,this.containerResizeTimeoutID=null,this.updateTag()};this.containerResizeTimeoutID&&clearTimeout(this.containerResizeTimeoutID),this.containerResizeTimeoutID=setTimeout(e,100)});var l,c,h,u;const i=e.object_data,s=i.bottom_y,o=i.height,r=new b.Color((l=i.color)!=null?l:"#FFFFFF"),a=(c=i.opacity)!=null?c:.4;this.data=e,this.id=e.id,this.name=(h=e.name)!=null?h:"",this.plugin=t,this.height=o,this.bottomY=s,this.opacity=a,this.shape=new b.Shape().fromJSON(i.shape),this.floorIndex=e.floor_index,this.makerObject=new b.Mesh(Tg(this.shape,o),sx(r,a)),Yl(this.makerObject,s),this.makerObject.material.depthTest=this.plugin.config.modelDepthTest,this.outline=new wh(new b.EdgesGeometry(this.makerObject.geometry),new b.LineBasicMaterial({color:r,transparent:!0})),Yl(this.outline,s),this.outline.material.depthTest=this.plugin.config.modelDepthTest,this.setHeight(o),this.modelGroup=new ix(this),this.modelGroup.visible=(u=i.visible)!=null?u:!0}mount(){if(this.mounted)return;this.mounted=!0,this.updateVisible(),this.makerObject.material.depthTest=this.plugin.config.modelDepthTest,this.outline.material.depthTest=this.plugin.config.modelDepthTest,this.modelGroup.add(this.makerObject,this.outline);const t=!!this.name,e=this.plugin.tagDomContainer;t&&(this.tagApp=new Lg({target:e,props:{rendererData:this.data,content:this.name,visible:this.tagVisible,rendererIfNeed:this.itemRenderer,transform:`translate(${this.tagTransform.left}px, ${this.tagTransform.top}px)`,onClick:i=>this.hooks.emit("tagClick",{target:this,nativeEvent:i})}}),this.updateTag()),this.plugin.five.needsRender=!0,this.plugin.hooks.on("stateChange",this.onPluginStateChange),this.plugin.hooks.on("configChange",this.onPluginConfigChange),this.plugin.five.on("modeChange",this.updateVisible),this.plugin.five.on("modelShownFloorChange",this.updateVisible),this.plugin.five.on("cameraUpdate",this.onFiveCameraUpdate),this.resizeObserver=Mo(this.onContainerResize,e),this.resizeObserver.observe()}unmount(){var t,e;this.mounted&&(this.mounted=!1,this.modelGroup.remove(...this.modelGroup.children),(t=this.tagApp)==null||t.$destroy(),this.tagApp=null,this.plugin.hooks.off("stateChange",this.onPluginStateChange),this.plugin.hooks.off("configChange",this.onPluginConfigChange),this.plugin.five.off("modeChange",this.updateVisible),this.plugin.five.off("modelShownFloorChange",this.updateVisible),this.plugin.five.off("cameraUpdate",this.onFiveCameraUpdate),(e=this.resizeObserver)==null||e.unobserve())}setOpacity(t){var e;this.opacity=t,(e=this.opacityAnime)==null||e.dispose(),this.makerObject.material.opacity=t,this.plugin.five.needsRender=!0}setColor(t){const e=new b.Color(t);this.makerObject.material.color=e,this.outline.material.color=e,this.plugin.five.needsRender=!0}setHeight(t){if(t<=0)throw new Error("高度必须大于 0");this.height=t,this.makerObject.geometry=Tg(this.shape,t),this.outline.geometry=new b.EdgesGeometry(this.makerObject.geometry);const e=this.shape.extractPoints(10).shape.slice(0,-1),i=w1(e),s=new b.Vector3(i.x,i.y,t);Yl(s,this.bottomY),this.tagPosition.copy(s),this.updateTag(),this.plugin.five.needsRender=!0}setTagZIndex(t){var e;this.tagZIndex!==t&&((e=this.tagApp)==null||e.$set({zIndex:t}))}}function Tg(n,t){return new b.ExtrudeBufferGeometry(n,{depth:t,bevelEnabled:!1})}function sx(n,t){return new b.MeshBasicMaterial({color:n,opacity:t,transparent:!0})}function Yl(n,t){const e=new b.Matrix4,i=new b.Matrix4().makeRotationX(Math.PI/2),s=new b.Matrix4().makeTranslation(0,0,-t),o=new b.Matrix4().makeScale(1,1,-1);e.multiply(i),e.multiply(s),e.multiply(o),n.applyMatrix4(e)}let ox=class extends wi{constructor(e,i){super(e);d(this,"state");d(this,"itemMap");d(this,"itemRenderer");d(this,"modelGroup");d(this,"data");d(this,"tagDomContainer");d(this,"checkMsg",{childrenMountedState:""});d(this,"isInFiveChangeModeAnime",!1);d(this,"childrenMountedState",!1);d(this,"_config");d(this,"_disposed",!1);d(this,"dispose",()=>{this.five.scene.remove(this.modelGroup)});d(this,"onFiveInitAnimationWillStart",()=>{this.isInFiveChangeModeAnime=!0,this.updateChildrenMountedState()});d(this,"onFiveInitAnimationEnded",()=>{this.isInFiveChangeModeAnime=!1,this.updateChildrenMountedState()});d(this,"onFiveCameraUpdate",()=>{const e=this.five.camera;[...this.itemMap.values()].sort((s,o)=>{const r=s.tagPosition.distanceTo(e.position);return o.tagPosition.distanceTo(e.position)-r}).forEach((s,o)=>{var r;(r=this.getMaskItemByID(s.id))==null||r.setTagZIndex(o*10)})});d(this,"onFiveModeChange",()=>{this.updateChildrenMountedState()});d(this,"onMakerTagClick",e=>{this.hooks.emit("wantsTap",{target:e.target,intersectObjects:[]})});d(this,"onWantsFiveTapGesture",e=>{const i=Array.from(this.itemMap.values()).filter(l=>l.mounted&&l.visible).map(l=>({makerItem:l,intersects:l.modelGroup.getRaycastIntersects(e)})).filter(({intersects:l})=>l.length>0);if(i.length===0)return;const s=i.reduce((l,c)=>{const h=l.intersects[0].distance,u=c.intersects[0].distance;return h<u?l:c}),o=this.fiveUtil.model.intersectRaycaster(e)[0];if(this.config.modelDepthTest&&o&&o.distance<s.intersects[0].distance)return;if(this.hooks.emit("wantsTap",{target:s.makerItem,intersectObjects:s.intersects}))return!1});this.five=e,this.tagDomContainer=document.createElement("div"),this.tagDomContainer.style.position="absolute",this.tagDomContainer.style.top="0",this.tagDomContainer.style.left="0",this.tagDomContainer.style.width="100%",this.tagDomContainer.style.height="100%",this.tagDomContainer.style.pointerEvents="none";const s={enabled:!0,visible:!0};this.state=Object.assign(s,i==null?void 0:i.initialState);const o=x({modelDepthTest:!0},i==null?void 0:i.config);this._config=o,this.modelGroup=new b.Group,this.modelGroup.name="ModelMakerPluginGroup",this.itemMap=new Map,this.state.enabled&&this._enable({userAction:!1})}get config(){return x({},this._config)}get disposed(){return this._disposed}load(e){return H(this,null,function*(){const i=this.data;this.data=this.formatData(e),this.hooks.emit("dataChange",this.data,i),this.modelGroup.remove(...this.modelGroup.children),this.itemMap.forEach(s=>s.unmount()),this.itemMap.clear(),this.childrenMountedState=!1,this.checkMsg.childrenMountedState="",this.data.list.forEach(s=>{const o=new nx(this,s);o.itemRenderer=this.itemRenderer,this.modelGroup.add(o.modelGroup),this.itemMap.set(s.id,o),o.hooks.on("tagClick",this.onMakerTagClick)}),this.updateChildrenMountedState()})}appendTo(e){e.appendChild(this.tagDomContainer)}enable(e={}){var s;if(this.state.enabled)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({enabled:!0},i),this._enable({userAction:i})}disable(e={}){var s;if(this.state.enabled===!1)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({enabled:!1},i),this._disable({userAction:i})}show(e){return H(this,null,function*(){if(this.state.visible)return Promise.resolve();if(this.disposed)return Promise.reject(new Error("不能在已销毁的插件上调用 show"));const i=x({userAction:!0},e);this.updateState({visible:!0},i.userAction),yield this._show(i)})}hide(e){return H(this,null,function*(){if(this.state.visible===!1)return;const i=x({userAction:!0},e);this.updateState({visible:!1},i.userAction),yield this._hide(i)})}setState(e,i={}){const s=this.state;if(wt(e,s,{deep:!0}))return;const o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o,anime:{duration:500}};e.visible?this._show(r):this._hide(r)}}updateConfig(e,i={}){var r;const s=this.config,o=x(x({},s),e);this._config=o,this.hooks.emit("configChange",{prevConfig:s,config:o,userAction:(r=i.userAction)!=null?r:!0})}getMaskItemByID(e){return this.itemMap.get(e)}formatData(e){function i(s){return s.list.length===0?!0:!("shape"in s.list[0].object_data)}return i(e)?{list:e.list.filter(s=>s.object_data.points.length>=3).map(s=>{const o=new b.Shape,r=s.object_data.points[0];return o.moveTo(r[0],r[2]),s.object_data.points.slice(1).forEach(l=>o.lineTo(l[0],l[2])),o.lineTo(r[0],r[2]),ie(x({},s),{floor_index:s.object_data.floorIndex,object_data:ie(x({},s.object_data),{bottom_y:r[1]+s.object_data.fixedY,shape:o.toJSON(),height:s.object_data.height+s.object_data.fixedHeight})})})}:e}checkChildrenMountedState(){const e=this.state,i=this.five;if(!e.enabled)return{result:!1,msg:"插件不可用"};const s=i.getCurrentState().mode;return s==="Panorama"?{result:!1,msg:`Five 模态不符合条件, 当前模态为:${s}`}:this.isInFiveChangeModeAnime?{result:!1,msg:"切换模态动画中不展示"}:{result:!0,msg:""}}updateChildrenMountedState(){const{result:e,msg:i}=this.checkChildrenMountedState();this.checkMsg.childrenMountedState=i,e!==this.childrenMountedState&&(this.childrenMountedState=e,this.itemMap.forEach(s=>{this.childrenMountedState?s.mount():s.unmount()}))}updateState(e,i){const s=this.state;this.state=x(x({},this.state),e),this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}_enable(e){this.hooks.emit("enable",{userAction:e.userAction}),this.five.scene.add(this.modelGroup),this.updateChildrenMountedState(),this.five.needsRender=!0,this.five.on("wantsTapGesture",this.onWantsFiveTapGesture),this.five.on("initAnimationWillStart",this.onFiveInitAnimationWillStart),this.five.on("initAnimationEnded",this.onFiveInitAnimationEnded),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraUpdate",this.onFiveCameraUpdate)}_disable(e){this.hooks.emit("disable",{userAction:e.userAction}),this.five.scene.remove(this.modelGroup),this.updateChildrenMountedState(),this.five.needsRender=!0,this.five.off("wantsTapGesture",this.onWantsFiveTapGesture),this.five.off("initAnimationWillStart",this.onFiveInitAnimationWillStart),this.five.off("initAnimationEnded",this.onFiveInitAnimationEnded),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraUpdate",this.onFiveCameraUpdate)}_show(e){return H(this,null,function*(){this.hooks.emit("show",e),this.five.needsRender=!0})}_hide(e){return H(this,null,function*(){this.hooks.emit("hide",e),this.five.needsRender=!0})}};const rx=(n,t)=>new ox(n,t);class ax extends Ri{constructor(e,i){super(e);d(this,"state");d(this,"checkMsg",{meshHidden:"",pluginDisabled:"",pluginHidden:""});d(this,"group",new b.Group);d(this,"mesh");d(this,"textureLoadingPromise");d(this,"opacityAnimeTween");d(this,"isInPanoMoveAnime",!1);d(this,"lastArrivedPanoIndex",-1);d(this,"_config");d(this,"_disposed",!1);d(this,"dispose",()=>{this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive)});d(this,"checkMeshVisible",()=>this.state.visible?this.config.imageURL===""?{result:!1,msg:"图片不存在"}:this.mesh.material.map?this.five.work?this.five.getCurrentState().mode!=="Panorama"?{result:!1,msg:"非全景模式"}:this.isInPanoMoveAnime?{result:!1,msg:"处于走点动画中"}:{result:!0,msg:""}:{result:!1,msg:"Five 数据未加载"}:{result:!1,msg:"指南针贴图未加载"}:{result:!1,msg:"插件隐藏"});d(this,"onTextureLoaded",e=>{this.mesh.material.map=e,this.mesh.material.needsUpdate=!0,this.updateMeshVisible()});d(this,"onFiveWillLoad",()=>{this.lastArrivedPanoIndex=-1,this.updateMeshVisible()});d(this,"onFivePanoWillArrive",e=>{var i;e!==this.five.getCurrentState().panoIndex&&(this.isInPanoMoveAnime=!0,(i=this.opacityAnimeTween)==null||i.dispose(),this.updateMeshVisible())});d(this,"onFivePanoArrived",e=>{e!==this.lastArrivedPanoIndex&&(this.lastArrivedPanoIndex=e,this.isInPanoMoveAnime=!1,this.updateMeshPosition(e),this.updateMeshVisible(),this.five.needsRender=!0)});d(this,"onMeshVisibleChange",e=>{var i;if((i=this.opacityAnimeTween)==null||i.dispose(),!e){this.mesh.visible=!1;return}this.mesh.material.setValues({opacity:0}),this.mesh.visible=!0,this.opacityAnimeTween=Ls(1e3).onUpdate(({progress:s})=>{var o;(o=this.mesh)==null||o.material.setValues({opacity:s}),this.five.needsRender=!0}).play()});d(this,"onFiveModeChange",()=>{this.updateMeshVisible()});this.five=e;const s={enabled:!0,visible:!0};this.state=Object.assign(s,i==null?void 0:i.initialState);const o=x({width:1.4,yOffset:.01,yRotate:0,imageURL:this.absoluteUrl("/release/web/logo.7febb17f.png")},i==null?void 0:i.config);this._config=o,this.group.name="current-pano-image-plugin-group",this.mesh=new b.Mesh(new b.PlaneBufferGeometry(this.config.width,this.config.width),new b.MeshBasicMaterial({transparent:!0,opacity:0,depthTest:!1})),this.mesh.visible=!1,this.group.add(this.mesh),this.updateMeshQuaternion(this.config.yRotate),this.state.visible||(this.checkMsg.pluginHidden="初始值设置为隐藏"),this.state.enabled||(this.checkMsg.pluginDisabled="初始值设置为禁用"),this.state.enabled&&this._enable({userAction:!1}),this.five.once("dispose",this.dispose)}get config(){return x({},this._config)}get disposed(){return this._disposed}enable(e={}){var s;if(this.state.enabled)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({enabled:!0},i),this.checkMsg.pluginDisabled="",this._enable({userAction:i})}disable(e={}){var s;if(this.state.enabled===!1)return;const i=(s=e.userAction)!=null?s:!0;this.updateState({enabled:!1},i),this.checkMsg.pluginDisabled="调用 disable 禁用",this._disable({userAction:i})}show(e){return H(this,null,function*(){if(this.state.visible)return Promise.resolve();if(this.disposed)return Promise.reject(new Error("不能在已销毁的插件上调用 show"));const i=x({userAction:!0},e);this.updateState({visible:!0},i.userAction),this.checkMsg.pluginHidden="",this._show(i)})}hide(e){return H(this,null,function*(){if(this.state.visible===!1)return;const i=x({userAction:!0},e);this.updateState({visible:!1},i.userAction),this.checkMsg.pluginDisabled="调用 hide 隐藏",this._hide(i)})}setState(e,i={}){const s=this.state;if(wt(e,s,{deep:!0}))return;const o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this.checkMsg.pluginDisabled="":this.checkMsg.pluginDisabled="调用 setState 禁用",e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o,anime:{duration:500}};e.visible?this.checkMsg.pluginHidden="":this.checkMsg.pluginHidden="调用 setState 隐藏",e.visible?this._show(r):this._hide(r)}}updateConfig(e,i={}){var r;const s=this.config,o=x(x({},s),e);this._config=o,s.imageURL!==o.imageURL&&this.reloadTexture(o.imageURL),s.yOffset!==o.yOffset&&this.updateMeshPosition(this.five.getCurrentState().panoIndex),s.yRotate!==o.yRotate&&this.updateMeshQuaternion(o.yRotate),s.width!==o.width&&(this.mesh.geometry=new b.PlaneBufferGeometry(o.width,o.width)),this.hooks.emit("configChange",{prevConfig:s,config:o,userAction:(r=i.userAction)!=null?r:!0})}__whyCantSeeMesh(){if(this.disposed)return"插件已销毁";if(this.checkMsg.pluginDisabled)return this.checkMsg.pluginDisabled;if(this.checkMsg.pluginHidden)return this.checkMsg.pluginHidden;if(this.checkMsg.meshHidden)return this.checkMsg.meshHidden}updateState(e,i){const s=this.state;this.state=x(x({},this.state),e),this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}updateMeshVisible(){const{result:e,msg:i}=this.checkMeshVisible();this.checkMsg.meshHidden=i,e!==this.mesh.visible&&this.onMeshVisibleChange(e)}updateMeshPosition(e){const i=this.workUtil.getObserverStandingPosition(e);if(!i){console.warn("CurrentPanoImagePlugin: 无法获取到当前点位的 standingPosition");return}const s=i.clone().setY(i.y+this.config.yOffset);s&&this.mesh.position.copy(s)}reloadTexture(e){return H(this,null,function*(){if(this.mesh.material.map=null,e!==""){const i=en(e);this.textureLoadingPromise=i;const s=yield i;s.minFilter=b.LinearFilter,this.textureLoadingPromise===i&&(this.onTextureLoaded(s),this.textureLoadingPromise=null)}this.updateMeshVisible()})}updateMeshQuaternion(e){const i=new b.Quaternion;i.multiplyQuaternions(new b.Quaternion().setFromAxisAngle(new b.Vector3(1,0,0),-Math.PI/2),new b.Quaternion().setFromAxisAngle(new b.Vector3(0,0,1),e)),this.mesh.quaternion.copy(i)}_enable(e){this.hooks.emit("enable",{userAction:e.userAction}),this.config.imageURL&&!this.mesh.material.map&&!this.textureLoadingPromise&&this.reloadTexture(this.config.imageURL),this.five.scene.add(this.group),this.five.needsRender=!0,this.five.work&&this.onFiveWillLoad(),this.five.getCurrentState().mode==="Panorama"&&(this.onFiveModeChange(),this.onFivePanoArrived(this.five.getCurrentState().panoIndex)),this.five.on("willLoad",this.onFiveWillLoad),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange)}_disable(e){this.hooks.emit("disable",{userAction:e.userAction}),this.five.scene.remove(this.group),this.five.needsRender=!0,this.five.off("willLoad",this.onFiveWillLoad),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange)}_show(e){this.hooks.emit("show",e),this.updateMeshVisible(),this.five.needsRender=!0}_hide(e){this.hooks.emit("hide",e),this.updateMeshVisible(),this.five.needsRender=!0}}const lx=(n,t)=>new ax(n,t),cx={auto:"",pen:"","pen-forbidden":"","pen-crosshair":"","pne-polygon":"","pen-circle":"","crosshair-rectangle":"","crosshair-circle":""};class hx{constructor(t){d(this,"container");d(this,"deleteButton");this.container=t!=null?t:document.documentElement}setType(t){const e=cx[t];e?this.container.style.cursor=`url(${e}), auto`:this.container.style.cursor=t}showDeleteButton(t){const{clientX:e,clientY:i,container:s=this.container,onClick:o}=t;let r=this.deleteButton;return r||(r=document.createElement("div"),r.style.position="absolute",r.style.width="20px",r.style.height="20px",r.style.transform="translate(-50%, -40px)",r.style.borderRadius="50%",r.style.cursor="pointer",r.style.zIndex="9999",r.style.cursor="pointer",r.style.userSelect="none",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.backgroundImage="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTciIGhlaWdodD0iMjUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSIxMC43MDYlIiB5MT0iNDIuNzQ0JSIgeDI9Ijg5LjA2NCUiIHkyPSI1Ny4yMDglIiBpZD0icHJlZml4X19hIj48c3RvcCBzdG9wLWNvbG9yPSIjRkZGIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMCUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkZGIiBzdG9wLW9wYWNpdHk9Ii4zMDgiIG9mZnNldD0iNDkuNTY5JSIvPjxzdG9wIHN0b3AtY29sb3I9IiNGRkYiIHN0b3Atb3BhY2l0eT0iMCIgb2Zmc2V0PSIxMDAlIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iLS4yNSIgeT0iLS4yNSIgd2lkdGg9IjU3LjUiIGhlaWdodD0iMjMuNSIgcng9IjExLjI1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDEpIiBmaWxsPSIjMkMyQzJDIiBzdHJva2U9InVybCgjcHJlZml4X19hKSIgc3Ryb2tlLXdpZHRoPSIuNSIgZmlsbC1ydWxlPSJldmVub2RkIiBmaWxsLW9wYWNpdHk9Ii4zMDMiLz48L3N2Zz4=)",r.innerHTML='<svg width="16px" height="17px" viewBox="0 0 16 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><linearGradient x1="22.185491%" y1="100%" x2="66.8316686%" y2="6.67239121%" id="1"><stop stop-color="#FFFCFC" stop-opacity="0.6"></stop><stop stop-color="#FFFFFF" offset="100%"></stop></linearGradient></defs> <path fill="url(#1)" fill-rule="nonzero" transform="translate(2.16 2.16)" d="M11.2979686,2.71818182 C11.611378,2.71818182 11.8654465,2.97561809 11.8654465,3.29318182 C11.8654465,3.58428191 11.6519584,3.82485822 11.374972,3.86293275 L11.2979686,3.86818182 L10.464,3.868 L9.7236795,10.6246222 C9.64153248,11.3737453 9.04854423,11.9512142 8.32013277,12.0165596 L8.18206028,12.0227273 L3.68338622,12.0227273 C2.89302127,12.0227273 2.22904821,11.4205655 2.141767,10.6246222 L2.141767,10.6246222 L1.4,3.868 L0.567477876,3.86818182 C0.254068499,3.86818182 0,3.61074555 0,3.29318182 C0,3.00208173 0.213488114,2.76150541 0.49047449,2.72343089 L0.567477876,2.71818182 L11.2979686,2.71818182 Z M9.322,3.868 L2.542,3.868 L3.26978106,10.4976259 C3.28762252,10.6603274 3.39528004,10.7928487 3.53932022,10.8467307 L3.61412483,10.866894 L3.68338622,10.8727273 L8.18206028,10.8727273 C8.39410941,10.8727273 8.57224853,10.7111717 8.59566544,10.4976259 L8.59566544,10.4976259 L9.322,3.868 Z M8.16824216,0 C8.48165153,0 8.73572003,0.257436269 8.73572003,0.575 C8.73572003,0.866100087 8.52223192,1.1066764 8.24524554,1.14475093 L8.16824216,1.15 L3.69720434,1.15 C3.38379497,1.15 3.12972647,0.892563731 3.12972647,0.575 C3.12972647,0.283899913 3.34321458,0.0433235966 3.62020096,0.00524907226 L3.69720434,0 L8.16824216,0 Z"></path></svg>'),this.deleteButton=r,s.appendChild(r),r.style.left=`${e}px`,r.style.top=`${i}px`,r.onclick=()=>{s.removeChild(r),o()},r}removeDeleteButton(){this.deleteButton&&this.deleteButton.remove()}tip(t){return()=>this.closeTip()}closeTip(){}reset(){this.container.style.cursor="auto"}}class dx{constructor(){d(this,"five");d(this,"_cursor");d(this,"_pointSelector");d(this,"_fiveDomEvents");d(this,"_object3DHelper");d(this,"inited",!1);d(this,"init",t=>{this.inited=!0,this.five=t,this._cursor=void 0,this._pointSelector=void 0,this._fiveDomEvents=void 0,this._object3DHelper=void 0})}get cursor(){if(!this.inited)throw new Error("Global not inited");return this._cursor?this._cursor:(this._cursor=new hx(this.five.getElement()),this._cursor)}get pointSelector(){if(!this.inited)throw new Error("Global not inited");return this._pointSelector?this._pointSelector:(this._pointSelector=new ca(this.five,{mode:"cursor"}),this._pointSelector)}get fiveDomEvents(){if(!this.inited)throw new Error("Global not inited");return this._fiveDomEvents?this._fiveDomEvents:(this._fiveDomEvents=new Ss(this.five,{noEmitWhenNotInScene:!0}),this._fiveDomEvents)}get object3DHelper(){if(!this.inited)throw new Error("Global not inited");return this._object3DHelper?this._object3DHelper:(this._object3DHelper=new Ql(this.five),this._object3DHelper)}}const zg=new dx;window.globalModules=zg;function jg(n,t){return n?t(n)?n:n.parent?jg(n.parent,t):null:null}const ux="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==";let Og=null;class as extends Rt{constructor(e){var f,m;super();d(this,"name","PointMesh");d(this,"dom");d(this,"opacityBeforeHighlight");d(this,"highlighted",!1);d(this,"fontMesh");d(this,"backgroundMesh");d(this,"lastRenderDomItem");d(this,"paramsStyle");d(this,"_visible",!0);const u=e!=null?e:{},{point:i}=u,s=Yi(u,["point"]);this.paramsStyle=s!=null?s:{};const o=new b.BufferGeometry;o.setAttribute("position",new b.Float32BufferAttribute([0,0,0],3));const r={transparent:!0,side:b.DoubleSide,size:(f=e==null?void 0:e.size)!=null?f:8,map:Og||(Og=new b.TextureLoader().load(ux)),sizeAttenuation:!1},a=new b.PointsMaterial(ie(x({},r),{color:(m=e==null?void 0:e.color)!=null?m:16777215,depthTest:!0,opacity:1})),l=new b.PointsMaterial(ie(x({},r),{size:a.size,color:a.color,depthWrite:!1,depthTest:!1,opacity:.5})),c=new b.Points(o,a),h=new b.Points(o,l);this.fontMesh=c,this.backgroundMesh=h,c.name="FontMesh",h.name="BackgroundMesh",c.renderOrder=10,h.renderOrder=0,this.add(c,h),e!=null&&e.point&&this.position.copy(De(e.point)),e&&this.setStyle(e),this.addEventListener("removed",()=>{Do(this)}),Object.defineProperty(this,"visible",{set:v=>{this.dom&&(this.dom.container.style.display=v?"block":"none"),this._visible=v},get:()=>this._visible})}get color(){return this.fontMesh.material.color}get size(){return this.fontMesh.material.size}get style(){return{color:this.color,size:this.size,occlusionVisibility:this.fontMesh.material.depthTest,occlusionMode:this.backgroundMesh.visible?"depthWrite":"depthTest"}}get five(){var e,i;return(i=(e=window.globalModules)==null?void 0:e.five)!=null?i:window.$five}setStyle(e){ke(e.color)&&(this.fontMesh.material.setValues({color:e.color}),this.backgroundMesh.material.setValues({color:e.color})),ke(e.size)&&(this.fontMesh.material.setValues({side:e.size}),this.backgroundMesh.material.setValues({side:e.size})),ke(e.occlusionVisibility)&&(e.occlusionVisibility?e.occlusionMode==="depthTest"?(this.fontMesh.material.depthTest=!1,this.backgroundMesh.visible=!1):(this.fontMesh.material.depthTest=!0,this.backgroundMesh.visible=!0):(this.fontMesh.material.depthTest=!0,this.backgroundMesh.visible=!1))}highlight(){this.highlighted||(this.highlighted=!0,this.opacityBeforeHighlight=this.fontMesh.material.opacity,this.fontMesh.material.setValues({opacity:this.opacityBeforeHighlight*ra}))}unhighlight(){this.highlighted&&(this.highlighted=!1,this.fontMesh.material.setValues({opacity:this.opacityBeforeHighlight}))}updateMatrixWorld(e){super.updateMatrixWorld(e);const i=Es(this,this.position).toArray().join(",");i!==this.lastRenderDomItem&&(this.updateDom(),this.lastRenderDomItem=i)}updateDom(){const e=this.paramsStyle.tip;e&&!this.dom&&(this.dom=new Di(this.five),this.dom.intersectCheck=!1,this.dom.simulate3D=!0,this.dom.container.style.visibility="hidden");const i=s=>{var o;this.dom&&this.dom.__text!==s&&(this.dom.__text=s,s?this.dom.container.innerHTML=aa(s,{style:`color: #${ke((o=this.style)==null?void 0:o.color)?new b.Color(this.style.color).getHexString():"ffffff"}`}):this.dom.container.innerHTML="")};e?(i(e),this.dom.setPosition(this.position.clone())):i(null)}}class Xl extends Ht{constructor(e){super();d(this,"name","LineWithDotsMesh");d(this,"pointGroup",new Rt);d(this,"_paramsStyle");d(this,"setStyle",e=>{super.setStyle(e),this._paramsStyle=x(x({},this._paramsStyle),e),this.pointMeshes.forEach(i=>i.setStyle(ie(x({},this._paramsStyle),{color:e.lineColor,tip:void 0}))),this.updateEdgePointsVisibility(),this.needsRender=!0});d(this,"highlight",()=>{super.highlight(),this.pointMeshes.forEach(e=>e.highlight())});d(this,"unhighlight",()=>{super.unhighlight(),this.pointMeshes.forEach(e=>e.unhighlight())});d(this,"updateEdgePointsVisibility",()=>{var e;ke((e=this._paramsStyle)==null?void 0:e.pointVisibility)&&(this.startPoint&&(this.startPoint.visible=typeof this._paramsStyle.pointVisibility=="object"?this._paramsStyle.pointVisibility.startPoint:this._paramsStyle.pointVisibility),this.endPoint&&(this.endPoint.visible=typeof this._paramsStyle.pointVisibility=="object"?this._paramsStyle.pointVisibility.endPoint:this._paramsStyle.pointVisibility))});this.add(this.pointGroup),e&&this.setStyle(e),e!=null&&e.points&&this.setPoints(e.points)}get startPoint(){return this.pointMeshes[0]}get endPoint(){return this.pointMeshes.length<2?null:this.pointMeshes[this.pointMeshes.length-1]}get visiblePointMeshes(){return this.pointMeshes.filter(e=>e.visible)}get pointMeshes(){return this.pointGroup.children}setPoints(e){super.setPoints(e);const i=e.map(De).filter(ke);this.pointGroup.removeChildren(),this.addIfNotExists(this.pointGroup),i.forEach(s=>{var r;const o=new as(ie(x({},this.style),{color:(r=this._paramsStyle)==null?void 0:r.lineColor,tip:void 0}));o.position.copy(s),this.pointGroup.add(o)}),this.updateEdgePointsVisibility(),this.needsRender=!0}}function fx(n){const t=[...n];if(n.length<3)return n;const e=n[n.length-1],i=n[0];return e.equals(i)||t.push(i),t}class Vg extends Rt{constructor(e){super();d(this,"name","PolylineBaseMesh");d(this,"lines",[]);d(this,"withDots");d(this,"paramsStyle");const r=e,{withDots:i,points:s}=r,o=Yi(r,["withDots","points"]);this.withDots=i!=null?i:!0,s&&this.setPoints(s),o&&this.setStyle(o),this.addEventListener("removed",()=>{Do(this)})}get style(){var e;return{lineColor:this.lineColor,lineWidth:this.lineWidth,opacity:this.opacity,dashed:this.dashed,occlusionVisibility:this.occlusionVisibility,occlusionMode:this.occlusionMode,lengthEnable:(e=this.paramsStyle)==null?void 0:e.lengthEnable}}get opacity(){var e,i,s;return(s=(e=this.lines[0])==null?void 0:e.lineOpacity)!=null?s:(i=this.paramsStyle)==null?void 0:i.lineOpacity}get lineColor(){var e,i,s;return(s=(e=this.lines[0])==null?void 0:e.color)!=null?s:(i=this.paramsStyle)!=null&&i.lineColor?new b.Color(this.paramsStyle.lineColor):void 0}get lineWidth(){var e,i,s;return(s=(e=this.lines[0])==null?void 0:e.lineWidth)!=null?s:(i=this.paramsStyle)==null?void 0:i.lineWidth}get dashed(){var e,i,s;return(s=(e=this.lines[0])==null?void 0:e.dashed)!=null?s:(i=this.paramsStyle)==null?void 0:i.dashed}get occlusionVisibility(){var e,i,s;return(s=(e=this.lines[0])==null?void 0:e.occlusionVisibility)!=null?s:(i=this.paramsStyle)==null?void 0:i.occlusionVisibility}get occlusionMode(){var e,i,s;return(s=(e=this.lines[0])==null?void 0:e.occlusionMode)!=null?s:(i=this.paramsStyle)==null?void 0:i.occlusionMode}get points(){var e,i,s;return this.lines.map(o=>o.points[0]).concat((s=(i=this.lines)==null?void 0:i[((e=this.lines)==null?void 0:e.length)-1])==null?void 0:s.points[1]).filter(Boolean)}setPoints(e,i={closed:!1}){let s=e.map(De);i.closed&&(s=fx(s)),s.forEach((o,r)=>{var c;const a=s[r+1];if(r!==0&&a===void 0)return;const l=(c=this.lines[r])!=null?c:(()=>{const h=new Xl(ie(x({},this.style),{pointVisibility:this.withDots?{startPoint:r===0,endPoint:!0}:!1}));return this.lines[r]=h,this.add(h),h})();l.setStyle(this.style),l.setPoints([o,a])}),s.length===0?(this.lines.forEach(o=>o.removeFromParent()),this.lines=[]):s.length===1||this.lines.length>s.length-1&&this.lines.splice(s.length-1).forEach(o=>o.removeFromParent())}setStyle(e){this.paramsStyle=x(x({},this.paramsStyle),e),this.lines.forEach(i=>i.setStyle(this.paramsStyle))}highlight(){this.lines.forEach(e=>e.highlight())}unhighlight(){this.lines.forEach(e=>e.unhighlight())}}class pn extends Vg{constructor(...e){super(ie(x({},e[0]),{withDots:!1}));d(this,"name","PolylineMesh")}}class Qi extends Vg{constructor(...e){super(ie(x({},e[0]),{withDots:!0}));d(this,"name","PolylineWithDotsMesh")}}const Zl=typeof navigator!="undefined"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Jl(n,t,e,i){n.addEventListener?n.addEventListener(t,e,i):n.attachEvent&&n.attachEvent("on".concat(t),e)}function Js(n,t,e,i){n.removeEventListener?n.removeEventListener(t,e,i):n.detachEvent&&n.detachEvent("on".concat(t),e)}function Bg(n,t){const e=t.slice(0,t.length-1);for(let i=0;i<e.length;i++)e[i]=n[e[i].toLowerCase()];return e}function _g(n){typeof n!="string"&&(n=""),n=n.replace(/\s/g,"");const t=n.split(",");let e=t.lastIndexOf("");for(;e>=0;)t[e-1]+=",",t.splice(e,1),e=t.lastIndexOf("");return t}function mx(n,t){const e=n.length>=t.length?n:t,i=n.length>=t.length?t:n;let s=!0;for(let o=0;o<e.length;o++)i.indexOf(e[o])===-1&&(s=!1);return s}const qs={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Zl?173:189,"=":Zl?61:187,";":Zl?59:186,"'":222,"[":219,"]":221,"\\":220},ci={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},ql={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},pt={16:!1,18:!1,17:!1,91:!1},et={};for(let n=1;n<20;n++)qs["f".concat(n)]=111+n;let Ze=[],Ks=null,Rg="all";const Pi=new Map,$s=n=>qs[n.toLowerCase()]||ci[n.toLowerCase()]||n.toUpperCase().charCodeAt(0),gx=n=>Object.keys(qs).find(t=>qs[t]===n),px=n=>Object.keys(ci).find(t=>ci[t]===n);function Fg(n){Rg=n||"all"}function eo(){return Rg||"all"}function vx(){return Ze.slice(0)}function Ax(){return Ze.map(n=>gx(n)||px(n)||String.fromCharCode(n))}function bx(){const n=[];return Object.keys(et).forEach(t=>{et[t].forEach(e=>{let{key:i,scope:s,mods:o,shortcut:r}=e;n.push({scope:s,shortcut:r,mods:o,keys:i.split("+").map(a=>$s(a))})})}),n}function yx(n){const t=n.target||n.srcElement,{tagName:e}=t;let i=!0;const s=e==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(s||e==="TEXTAREA"||e==="SELECT")&&!t.readOnly)&&(i=!1),i}function wx(n){return typeof n=="string"&&(n=$s(n)),Ze.indexOf(n)!==-1}function Cx(n,t){let e,i;n||(n=eo());for(const s in et)if(Object.prototype.hasOwnProperty.call(et,s))for(e=et[s],i=0;i<e.length;)e[i].scope===n?e.splice(i,1).forEach(r=>{let{element:a}=r;return Kl(a)}):i++;eo()===n&&Fg(t||"all")}function Px(n){let t=n.keyCode||n.which||n.charCode;const e=Ze.indexOf(t);if(e>=0&&Ze.splice(e,1),n.key&&n.key.toLowerCase()==="meta"&&Ze.splice(0,Ze.length),(t===93||t===224)&&(t=91),t in pt){pt[t]=!1;for(const i in ci)ci[i]===t&&(Bt[i]=!1)}}function Ng(n){if(typeof n=="undefined")Object.keys(et).forEach(s=>{Array.isArray(et[s])&&et[s].forEach(o=>Mr(o)),delete et[s]}),Kl(null);else if(Array.isArray(n))n.forEach(s=>{s.key&&Mr(s)});else if(typeof n=="object")n.key&&Mr(n);else if(typeof n=="string"){for(var t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];let[s,o]=e;typeof s=="function"&&(o=s,s=""),Mr({key:n,scope:s,method:o,splitKey:"+"})}}const Mr=n=>{let{key:t,scope:e,method:i,splitKey:s="+"}=n;_g(t).forEach(r=>{const a=r.split(s),l=a.length,c=a[l-1],h=c==="*"?"*":$s(c);if(!et[h])return;e||(e=eo());const u=l>1?Bg(ci,a):[],f=[];et[h]=et[h].filter(m=>{const p=(i?m.method===i:!0)&&m.scope===e&&mx(m.mods,u);return p&&f.push(m.element),!p}),f.forEach(m=>Kl(m))})};function Gg(n,t,e,i){if(t.element!==i)return;let s;if(t.scope===e||t.scope==="all"){s=t.mods.length>0;for(const o in pt)Object.prototype.hasOwnProperty.call(pt,o)&&(!pt[o]&&t.mods.indexOf(+o)>-1||pt[o]&&t.mods.indexOf(+o)===-1)&&(s=!1);(t.mods.length===0&&!pt[16]&&!pt[18]&&!pt[17]&&!pt[91]||s||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(Ze),t.method(n,t)===!1&&(n.preventDefault?n.preventDefault():n.returnValue=!1,n.stopPropagation&&n.stopPropagation(),n.cancelBubble&&(n.cancelBubble=!0)))}}function Qg(n,t){const e=et["*"];let i=n.keyCode||n.which||n.charCode;if(!Bt.filter.call(this,n))return;if((i===93||i===224)&&(i=91),Ze.indexOf(i)===-1&&i!==229&&Ze.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(a=>{const l=ql[a];n[a]&&Ze.indexOf(l)===-1?Ze.push(l):!n[a]&&Ze.indexOf(l)>-1?Ze.splice(Ze.indexOf(l),1):a==="metaKey"&&n[a]&&Ze.length===3&&(n.ctrlKey||n.shiftKey||n.altKey||(Ze=Ze.slice(Ze.indexOf(l))))}),i in pt){pt[i]=!0;for(const a in ci)ci[a]===i&&(Bt[a]=!0);if(!e)return}for(const a in pt)Object.prototype.hasOwnProperty.call(pt,a)&&(pt[a]=n[ql[a]]);n.getModifierState&&!(n.altKey&&!n.ctrlKey)&&n.getModifierState("AltGraph")&&(Ze.indexOf(17)===-1&&Ze.push(17),Ze.indexOf(18)===-1&&Ze.push(18),pt[17]=!0,pt[18]=!0);const s=eo();if(e)for(let a=0;a<e.length;a++)e[a].scope===s&&(n.type==="keydown"&&e[a].keydown||n.type==="keyup"&&e[a].keyup)&&Gg(n,e[a],s,t);if(!(i in et))return;const o=et[i],r=o.length;for(let a=0;a<r;a++)if((n.type==="keydown"&&o[a].keydown||n.type==="keyup"&&o[a].keyup)&&o[a].key){const l=o[a],{splitKey:c}=l,h=l.key.split(c),u=[];for(let f=0;f<h.length;f++)u.push($s(h[f]));u.sort().join("")===Ze.sort().join("")&&Gg(n,l,s,t)}}function Bt(n,t,e){Ze=[];const i=_g(n);let s=[],o="all",r=document,a=0,l=!1,c=!0,h="+",u=!1,f=!1;for(e===void 0&&typeof t=="function"&&(e=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(o=t.scope),t.element&&(r=t.element),t.keyup&&(l=t.keyup),t.keydown!==void 0&&(c=t.keydown),t.capture!==void 0&&(u=t.capture),typeof t.splitKey=="string"&&(h=t.splitKey),t.single===!0&&(f=!0)),typeof t=="string"&&(o=t),f&&Ng(n,o);a<i.length;a++)n=i[a].split(h),s=[],n.length>1&&(s=Bg(ci,n)),n=n[n.length-1],n=n==="*"?"*":$s(n),n in et||(et[n]=[]),et[n].push({keyup:l,keydown:c,scope:o,mods:s,shortcut:i[a],method:e,key:i[a],splitKey:h,element:r});if(typeof r!="undefined"&&window){if(!Pi.has(r)){const m=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return Qg(p,r)},v=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;Qg(p,r),Px(p)};Pi.set(r,{keydownListener:m,keyupListenr:v,capture:u}),Jl(r,"keydown",m,u),Jl(r,"keyup",v,u)}if(!Ks){const m=()=>{Ze=[]};Ks={listener:m,capture:u},Jl(window,"focus",m,u)}}}function Ix(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(et).forEach(e=>{et[e].filter(s=>s.scope===t&&s.shortcut===n).forEach(s=>{s&&s.method&&s.method()})})}function Kl(n){const t=Object.values(et).flat();if(t.findIndex(i=>{let{element:s}=i;return s===n})<0){const{keydownListener:i,keyupListenr:s,capture:o}=Pi.get(n)||{};i&&s&&(Js(n,"keyup",s,o),Js(n,"keydown",i,o),Pi.delete(n))}if((t.length<=0||Pi.size<=0)&&(Object.keys(Pi).forEach(s=>{const{keydownListener:o,keyupListenr:r,capture:a}=Pi.get(s)||{};o&&r&&(Js(s,"keyup",r,a),Js(s,"keydown",o,a),Pi.delete(s))}),Pi.clear(),Object.keys(et).forEach(s=>delete et[s]),Ks)){const{listener:s,capture:o}=Ks;Js(window,"focus",s,o),Ks=null}}const $l={getPressedKeyString:Ax,setScope:Fg,getScope:eo,deleteScope:Cx,getPressedKeyCodes:vx,getAllKeyCodes:bx,isPressed:wx,filter:yx,trigger:Ix,unbind:Ng,keyMap:qs,modifier:ci,modifierMap:ql};for(const n in $l)Object.prototype.hasOwnProperty.call($l,n)&&(Bt[n]=$l[n]);if(typeof window!="undefined"){const n=window.hotkeys;Bt.noConflict=t=>(t&&window.hotkeys===Bt&&(window.hotkeys=n),Bt),window.hotkeys=Bt}const ec=new Map;class Kt extends Rt{constructor(e,i){super();d(this,"name","Sculpt");d(this,"isSculptObject",!0);d(this,"draggable");d(this,"selected");d(this,"config");d(this,"on",(e,i,s)=>Je.modules.fiveDomEvents.addEventListener(this,e,i,s));d(this,"off",(...e)=>Je.modules.fiveDomEvents.removeEventListener(this,...e));d(this,"applyObjectMatrixWorld",(e,i)=>{const s=i!=null?i:this;return s.updateMatrixWorld(),Es(s,e)});d(this,"applyObjectReversalMatrixWorld",(e,i)=>{const s=i!=null?i:this;return s.updateMatrixWorld(),sv(s,e)});e!=null&&e.id&&(this.uuid=e.id),this.config=x({defaultAction:!0,occlusionVisibility:!0,occlusionMode:"translucence"},i),e!=null&&e.style&&(e.style.occlusionVisibility=this.config.occlusionVisibility,e.style.occlusionMode=this.config.occlusionMode),this.addEventListener("removed",()=>{Do(this)}),Bt("esc",()=>{this.stopCreating()}),this.config.defaultAction&&(Bt("backspace, delete",()=>{this.selected&&this.delete()}),this.on("click",()=>{var s;this.editing||(this.select({only:!0}),this.editor.enable(),(s=this.parent)==null||s.children.forEach(o=>{var r;o instanceof Kt&&o!==this&&((r=o._editor)==null||r.disable())}))}),Bt("esc",()=>{this.selected&&this.unselect()}))}get editing(){return this.pointSelector.enabled}get baseData(){return{id:this.uuid,type:this.type}}get pointSelector(){return Je.modules.pointSelector}undo(){throw new Error("Method not implemented.")}redo(){throw new Error("Method not implemented.")}canUndo(){throw new Error("Method not implemented.")}canRedo(){throw new Error("Method not implemented.")}stopCreating(){Je.modules.pointSelector.disable()}delete(){var e;this.stopCreating(),this.removeFromParent(),this.off(),(e=this.editor)==null||e.disable()}select(e={only:!1}){if(this.selected)return;this.selected=!0,this.highlight(),ec.has(this.parent.uuid)||ec.set(this.parent.uuid,[]);const i=ec.get(this.parent.uuid);i.push(this),e.only&&(i==null||i.forEach(s=>{s!==this&&s.unselect()}))}unselect(){var e;this.selected&&(this.selected=!1,this.unhighlight(),(e=this._editor)==null||e.disable())}highlight(){}unhighlight(){}showDeleteButton(e,i){Je.modules.cursor.showDeleteButton({clientX:e,clientY:i,container:document.body,onClick:()=>this.delete()}),Je.modules.five.once("cameraUpdate",()=>{Je.modules.cursor.removeDeleteButton()})}}class Er extends Rt{constructor(e){super();d(this,"hooks",new ht);d(this,"originObject");this.originObject=e}enable(){this.originObject.add(this)}disable(){this.originObject.remove(this)}}class to extends Er{constructor(e,i){super(e);d(this,"objectHelperConfig");d(this,"onObjectUpdate",()=>{this.hooks.emit("objectUpdate")});this.objectHelperConfig=i}get helper(){var e;return(e=Je.modules.object3DHelper.getObject3DHelper(this.originObject))==null?void 0:e.helper}enable(){super.enable();const e=typeof this.objectHelperConfig=="function"?this.objectHelperConfig():this.objectHelperConfig;Je.modules.object3DHelper.addObject3DHelper(this.originObject,x({positionFrom:"boundingBox"},e));const i=Je.modules.object3DHelper.getObject3DHelper(this.originObject).helper;i.hooks.on("move",this.onObjectUpdate),i.hooks.on("rotate",this.onObjectUpdate),i.hooks.on("scale",this.onObjectUpdate)}disable(){var e,i,s;super.disable(),(e=this.helper)==null||e.hooks.off("move",this.onObjectUpdate),(i=this.helper)==null||i.hooks.off("rotate",this.onObjectUpdate),(s=this.helper)==null||s.hooks.off("scale",this.onObjectUpdate),Je.modules.object3DHelper.removeObject3DHelper(this.originObject)}initialHelperMatrix(){var e;(e=this.helper)==null||e.initialHelperMatrix()}}class tc extends Er{constructor(e){super(e);d(this,"draggingPoints",[]);d(this,"onDragstart",e=>{const i=e.target;this.draggingPoints=this.pointMeshes.filter(s=>s.position.equals(i.position))});d(this,"onDragend",e=>{this.draggingPoints=[]})}get pointMeshes(){return this.children.filter(e=>e instanceof as)}get pointHandles(){return this.children}enable(){super.enable(),this.points.filter(ke).forEach(e=>{const i=new as;i.visible=!1,i.position.copy(e),i.draggable=!0,Je.modules.fiveDomEvents.addEventListener(i,"drag",this.onDrag),Je.modules.fiveDomEvents.addEventListener(i,"dragstart",this.onDragstart),Je.modules.fiveDomEvents.addEventListener(i,"dragend",this.onDragend),this.add(i)})}disable(){super.disable(),this.removeChildren()}}class Mx extends tc{constructor(e){super(e);d(this,"onDrag",e=>{if(!this.draggingPoints||this.draggingPoints.length===0)return;const i=ks(Je.modules.five,e.raycaster);this.draggingPoints.forEach(s=>s.position.copy(i.point)),this.originObject.lineMesh.setPoints(this.pointMeshes.map(s=>s.position))})}get points(){return this.originObject.lineMesh.points}}class Ex extends tc{constructor(e){super(e);d(this,"onDrag",e=>{if(!this.draggingPoints||this.draggingPoints.length===0)return;const i=ks(Je.modules.five,e.raycaster);this.draggingPoints.forEach(s=>s.position.copy(i.point)),this.originObject.polyLineMesh.setPoints(this.pointMeshes.map(s=>s.position))})}get points(){return this.originObject.polyLineMesh.points}}function _t(n){return Array.isArray(n)?n.map(t=>[t.x,t.y,t.z]):[n.x,n.y,n.z]}class Wg extends Kt{constructor(e,i){super(e,i);d(this,"type","Polyline");d(this,"polyLineMesh");d(this,"_editor");d(this,"creatingObject");e&&(this.polyLineMesh=new Qi(x(x({},e.style),e)),this.add(this.polyLineMesh))}get editor(){return this._editor||(this._editor=new Ex(this)),this._editor}get data(){return ie(x({},this.baseData),{points:_t(this.applyObjectMatrixWorld(this.polyLineMesh.points)),style:{lineColor:new b.Color(this.polyLineMesh.lineColor).getHex(),lineWidth:this.polyLineMesh.lineWidth,dashed:this.polyLineMesh.dashed}})}setData(e){e.points&&this.polyLineMesh.setPoints(this.applyObjectReversalMatrixWorld(e.points.map(De))),this.polyLineMesh.setStyle(e.style)}highlight(){var e;(e=this.polyLineMesh)==null||e.highlight()}unhighlight(){var e;(e=this.polyLineMesh)==null||e.unhighlight()}canUndo(){var e;(e=this.creatingObject)==null||e.canUndo()}canRedo(){var e;(e=this.creatingObject)==null||e.canRedo()}undo(){var e;(e=this.creatingObject)==null||e.undo()}redo(){var e;(e=this.creatingObject)==null||e.redo()}create(e){return H(this,null,function*(){this.removeChildren();const i=new Qi(e);this.polyLineMesh=i,this.add(this.polyLineMesh),this.creatingObject=Hg(i,this.pointSelector,e),yield this.creatingObject.finished,this.config.defaultAction&&this.editor.enable()})}}function Hg(n,t,e){var M;const i=n.parent;if(!i)return;const{promise:s,resolve:o,reject:r}=dn(),a=(M=e==null?void 0:e.limit)!=null?M:"none",l=new pn(n.style);i.add(l);const c=new pn(ie(x({},n.style),{dashed:!0,lengthEnable:!1}));i.add(c),t.enable();const h=[];let u,f,m;const v=[],p=()=>h.length>0,g=()=>v.length>0,A=()=>{p()&&(v.push(h.pop()),n.setPoints(h),C(m),t.pointSelectorHelper.magnifier.render())},w=()=>{g()&&(h.push(v.pop()),n.setPoints(h),C(m),t.pointSelectorHelper.magnifier.render())},I=E=>{v.length=0;const S=h.length===0?E.point:u.clone();h.push(S),n.setPoints(h)},C=E=>{const S=()=>{l.setPoints([]),c.setPoints([]),u=null};if(!E||(m=E,!(h!=null&&h.length)))return S();const L=h.at(-1).clone();a==="none"?(u=E.point,l.setPoints([L,u])):a==="xoz"?(f=f!=null?f:new b.Plane().setFromNormalAndCoplanarPoint(new b.Vector3(0,1,0),h[0]),t.plane=f,u=f.projectPoint(E.point,new b.Vector3),l.setPoints([L,u]),c.setPoints([u,E.point])):a==="y"&&(h.length===1?(u=E.point,l.setPoints([L,u])):(f=f!=null?f:new b.Plane().setFromCoplanarPoints(h[0],h[1],new b.Vector3(0,1,0).add(h[0])),t.plane=f,u=f.projectPoint(E.point,new b.Vector3),l.setPoints([L,u]),c.setPoints([u,E.point])))};return t.on("select",I),t.on("intersectionUpdate",C),t.on("disable",()=>{if(t.off("select",I),t.off("intersectionUpdate",C),t.plane=null,i.remove(l),i.remove(c),h.length<2)return i.remove(n),r(new Error("Cancelled"));o()}),{finished:s,canUndo:p,canRedo:g,undo:A,redo:w}}class kx extends Er{constructor(e){super(e);d(this,"onDrag",e=>{var s;const i=ks(Je.modules.five,e.raycaster);(s=this.originObject.pointMesh)==null||s.position.copy(i.point)})}enable(){super.enable(),this.originObject.draggable=!0,this.originObject.on("drag",this.onDrag)}disable(){super.disable(),this.originObject.draggable=!1,this.originObject.off("drag",this.onDrag)}}class Ug extends Kt{constructor(e,i){super(e,i);d(this,"type","Point");d(this,"pointMesh");d(this,"_editor");e&&(this.pointMesh=new as(x(x({},e.style),e)),this.add(this.pointMesh))}get editor(){return this._editor||(this._editor=new kx(this)),this._editor}get data(){return ie(x({},this.baseData),{point:_t(this.applyObjectMatrixWorld(this.pointMesh.position)),style:{color:this.pointMesh.color.getHex(),size:this.pointMesh.size}})}setData(e){e.point&&this.pointMesh.position.copy(De(e.point)),this.pointMesh.setStyle(e.style)}highlight(){var e;(e=this.pointMesh)==null||e.highlight()}unhighlight(){var e;(e=this.pointMesh)==null||e.unhighlight()}setStyle(e){this.pointMesh.setStyle(e)}create(e){return H(this,null,function*(){this.pointMesh&&this.remove(this.pointMesh),this.add(this.pointMesh=new as(e)),yield ic(this.pointMesh,this.pointSelector),this.config.defaultAction&&this.editor.enable()})}}function ic(n,t){return new Promise((e,i)=>{t.enable(),n.visible=!1;const s=l=>{l&&(n.visible=!0,n.position.copy(l.point))},o=l=>{l&&(n.visible=!0,n.position.copy(l.point),r())},r=()=>{t.off("select",o),t.off("disable",a),t.off("intersectionUpdate",s),t.disable(),e()},a=()=>{t.off("select",o),t.off("disable",a),t.off("intersectionUpdate",s),n.removeFromParent(),i(new Error("Cancelled"))};t.on("intersectionUpdate",s),t.on("disable",a),t.once("select",o)})}class kr extends Rt{constructor(e){var a,l;super();d(this,"name","ColoredMesh");d(this,"meshFont");d(this,"meshBackground");d(this,"paramsStyle",{});d(this,"_geometry",new b.BufferGeometry);d(this,"highlighted",!1);d(this,"opacityBeforeHighlight");this.paramsStyle=e!=null?e:{};const i=new b.MeshBasicMaterial({color:new b.Color((a=e==null?void 0:e.color)!=null?a:ev).convertSRGBToLinear(),transparent:!0,side:b.DoubleSide,depthTest:!0,depthWrite:!1,opacity:(l=e==null?void 0:e.opacity)!=null?l:nv}),s=new b.MeshBasicMaterial({color:16777215,transparent:!0,side:b.DoubleSide,depthTest:!1,depthWrite:!1,opacity:.3/.5*i.opacity}),o=new b.Mesh(this.geometry,i),r=new b.Mesh(this.geometry,s);o.name="MeshFront",r.name="MeshBackground",o.renderOrder=1,r.renderOrder=0,this.meshFont=o,this.meshBackground=r,this.add(o),this.setOcclusionVisibility({occlusionVisibility:e==null?void 0:e.occlusionVisibility,occlusionMode:e==null?void 0:e.occlusionMode})}get style(){return{color:this.color,opacity:this.opacity,occlusionVisibility:this.occlusionVisibility,occlusionMode:this.occlusionMode}}get color(){return this.meshFont.material.color}get opacity(){return this.meshFont.material.opacity}get occlusionVisibility(){return!!this.meshBackground.parent||this.meshFont.material.depthTest===!1}get occlusionMode(){return this.meshFont.material.depthTest===!1?"depthTest":"translucence"}set geometry(e){this._geometry=e,this.meshFont.geometry=e,this.meshBackground.geometry=e}get geometry(){return this._geometry}setStyle(e){this.paramsStyle=x(x({},this.paramsStyle),e),ke(e.color)&&(this.meshFont.material.color.set(new b.Color(e.color).convertSRGBToLinear()),this.needsRender=!0),ke(e.opacity)&&(this.meshFont.material.opacity=e.opacity,this.meshBackground.material.opacity=.3/.5*this.meshFont.material.opacity,this.needsRender=!0),this.setOcclusionVisibility(e)}highlight(){this.highlighted||(this.highlighted=!0,this.opacityBeforeHighlight=this.opacity,this.meshFont.material.opacity=this.opacity*ra,this.meshBackground.material.opacity=.3/.5*this.meshFont.material.opacity,this.needsRender=!0)}unhighlight(){this.highlighted&&(this.highlighted=!1,this.meshFont.material.opacity=this.opacityBeforeHighlight,this.meshBackground.material.opacity=.3/.5*this.meshFont.material.opacity,this.needsRender=!0)}setOcclusionVisibility(e){var o,r,a;const i=(r=(o=e.occlusionMode)!=null?o:this.paramsStyle.occlusionMode)!=null?r:"translucence",s=(a=e.occlusionVisibility)!=null?a:this.paramsStyle.occlusionVisibility;ke(s)&&(s?i==="depthTest"?(this.meshFont.material.depthTest=!1,this.remove(this.meshBackground)):i==="translucence"&&(this.meshFont.material.depthTest=!0,this.addIfNotExists(this.meshBackground)):(this.meshFont.material.depthTest=!0,this.remove(this.meshBackground)))}}const nc=new b.BufferGeometry;nc.name="blankGeometry",nc.isBlank=!0;class sc extends kr{constructor(e){super(e);d(this,"name","PolygonMesh");d(this,"points",[]);d(this,"planeHelperNeedUpdate",!0);d(this,"geometryInfoNeedUpdate",!0);d(this,"_paramsStyle");d(this,"planeHelper",null);d(this,"_geometryInfo",null);d(this,"lastRenderAreaItem");d(this,"areaDom");e!=null&&e.points&&this.setPoints(e.points),this._paramsStyle=e!=null?e:{},this.updateAreaItems()}get style(){return ie(x({},super.style),{lengthEnable:this._paramsStyle.lengthEnable})}get isBlank(){return!!this.geometry.isBlank}get center(){var e;return(e=this.geometryInfo)==null?void 0:e.center.clone()}get geometryInfo(){return this.geometryInfoNeedUpdate&&(this.isBlank?this._geometryInfo=null:this._geometryInfo=gu(this.geometry),this.geometryInfoNeedUpdate=!1),this._geometryInfo}get five(){var e,i;return(i=(e=window.globalModules)==null?void 0:e.five)!=null?i:window.$five}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.center){const i=Es(this,this.center).toArray().join(",");i!==this.lastRenderAreaItem&&(this.updateAreaItems(),this.lastRenderAreaItem=i)}}setStyle(e){this._paramsStyle=x(x({},this._paramsStyle),e),super.setStyle(this._paramsStyle),this.updateAreaItems()}setPoints(e){var s;const i=e.map(De);this.points=i,this.geometry=(s=fu(this.points,{checkLinesIntersect:!0}))!=null?s:nc,this.planeHelperNeedUpdate=!0,this.geometryInfoNeedUpdate=!0,this.updateAreaItems()}projectPoint(e){return e&&(this.planeHelperNeedUpdate&&this.updatePlaneHelper(),this.planeHelper?this.planeHelper.projectPoint(e,new b.Vector3):e)}updatePlaneHelper(){this.points.length>=3?this.planeHelper=new b.Plane().setFromCoplanarPoints(this.points[0],this.points[1],this.points[2]):this.planeHelper=null,this.planeHelperNeedUpdate=!1}updateAreaItems(){var s,o;const e=()=>{var r;(r=this.areaDom)==null||r.destroy(),this.areaDom=void 0};if(!this._paramsStyle.lengthEnable||!this.geometryInfo)return e();if(!this.five)return console.error("Five not found");this.areaDom=(s=this.areaDom)!=null?s:(()=>{const r=new Di(this.five);return r.intersectCheck=!1,r.simulate3D=!0,r})(),this.areaDom.setPosition(this.center);const i=this.geometryInfo.area.toFixed(2);i==="0.00"?this.areaDom.container.innerHTML="":this.areaDom.container.innerHTML=aa(i+"m²",{style:`color: #${ke((o=this.style)==null?void 0:o.color)?new b.Color(this.style.color).getHexString():"000000"}`})}}class Yg extends sc{constructor(e){const o=e!=null?e:{},{points:i}=o,s=Yi(o,["points"]);super();d(this,"name","PolygonWithEdgeMesh");d(this,"line",new pn);i&&this.setPoints(i),s&&this.setStyle(s)}get style(){return ie(x({},super.style),{lineWidth:this.lineWidth,lineColor:this.lineColor})}get lineWidth(){return this.line.lineWidth}get lineColor(){return this.line.lineColor}raycast(e,i){return this.children.forEach(s=>{sa(s,e,i,!0)}),!1}setPoints(e,i={closed:!0}){super.setPoints(e),this.points&&(this.line.setPoints(this.points,i),this.addIfNotExists(this.line))}setStyle(e){super.setStyle(e),this.line.setStyle(e)}highlight(){super.highlight(),this.line.highlight()}unhighlight(){super.unhighlight(),this.line.unhighlight()}}class oc extends Yg{constructor(){super(...arguments);d(this,"name","AreaMesh")}}class xx extends tc{constructor(e){super(e);d(this,"onDrag",e=>{if(!this.draggingPoints||this.draggingPoints.length===0)return;const i=ks(Je.modules.five,e.raycaster),s=this.originObject.areaMesh.projectPoint(i.point);this.draggingPoints.forEach(o=>o.position.copy(s)),this.originObject.areaMesh.setPoints(this.pointMeshes.map(o=>o.position))})}get points(){return this.originObject.areaMesh.points}}class Xg extends Kt{constructor(e,i){super(e,i);d(this,"type","Polygon");d(this,"areaMesh");d(this,"_editor");d(this,"creatingObject");e&&(this.areaMesh=new oc(x(x({},e.style),e)),this.add(this.areaMesh))}get editor(){return this._editor||(this._editor=new xx(this)),this._editor}get data(){return this.updateMatrixWorld(),ie(x({},this.baseData),{points:_t(this.applyObjectMatrixWorld(this.areaMesh.points)),style:{color:this.areaMesh.color.getHex(),lineColor:this.areaMesh.lineColor.getHex(),lineWidth:this.areaMesh.lineWidth}})}setData(e){e.points&&this.areaMesh.setPoints(this.applyObjectReversalMatrixWorld(e.points.map(De))),this.areaMesh.setStyle(e.style)}highlight(){var e;(e=this.areaMesh)==null||e.highlight()}unhighlight(){var e;(e=this.areaMesh)==null||e.unhighlight()}canUndo(){var e;(e=this.creatingObject)==null||e.canUndo()}canRedo(){var e;(e=this.creatingObject)==null||e.canRedo()}undo(){var e;(e=this.creatingObject)==null||e.undo()}redo(){var e;(e=this.creatingObject)==null||e.redo()}create(e){return H(this,null,function*(){this.children.forEach(s=>{s.parent===this&&this.remove(s)}),this.children.length=0;const i=new oc(e);this.areaMesh=i,this.add(this.areaMesh),this.creatingObject=xr(this.areaMesh,this.pointSelector,e),yield this.creatingObject.finished,this.config.defaultAction&&this.editor.enable()})}}function xr(n,t,e){var L;const{promise:i,resolve:s,reject:o}=dn(),r=n.parent;if(!r){o(new Error("No container"));return}const a=(L=e==null?void 0:e.limit)!=null?L:"none",l=new pn(n.style);r==null||r.add(l);const c=new pn(ie(x({},n.style),{dashed:!0,lengthEnable:!1}));r==null||r.add(c),t.enable();const h=[];let u,f,m=!1,v;const p=[],g=()=>h.length>0,A=()=>p.length>0,w=()=>{g()&&(p.push(h.pop()),M(v),t.pointSelectorHelper.magnifier.render())},I=()=>{A()&&(h.push(p.pop()),M(v),t.pointSelectorHelper.magnifier.render())},C=W=>{p.length=0;const R=h.length===0?W.point:u.clone();h.push(R),n.setPoints(h,{closed:!1}),m&&(E(),s())},M=W=>{const R=()=>{l.setPoints([]),c.setPoints([]),n.setPoints(h),t.pointSelectorHelper.magnifier.render()};if(!W||(v=W,!(h!=null&&h.length)))return R();const U=h.at(-1).clone();if(h.length<3&&(a==="none"?(u=W.point,l.setPoints([U,u]),c.setPoints([])):a==="xoz"?(f=f!=null?f:new b.Plane().setFromNormalAndCoplanarPoint(new b.Vector3(0,1,0),h[0]),t.plane=f,u=f.projectPoint(W.point,new b.Vector3),l.setPoints([U,u]),c.setPoints([u,W.point])):a==="y"&&(h.length===1?(u=W.point,l.setPoints([U,u]),c.setPoints([])):(f=f!=null?f:new b.Plane().setFromCoplanarPoints(h[0],h[1],new b.Vector3(0,1,0).add(h[0])),t.plane=f,u=f.projectPoint(W.point,new b.Vector3),l.setPoints([U,u]),c.setPoints([u,W.point])))),h.length>=3){u=n.projectPoint(W.point);const j=h[0],Y=.2;j.distanceTo(u)<Y||j.distanceTo(W.point)<Y?(u=j,W.point.copy(j),t.pointSelectorHelper.updateWithIntersect(W,{emitEvent:!1}),m=!0):m=!1,l.setPoints([U,u]),c.setPoints([u,W.point])}h.length>=2?(n.setPoints([...h,u],{closed:!1}),n.line.setPoints(n.points.slice(0,-1)),n.isBlank?(t.cursorError=!0,l.setStyle({lineColor:16734553}),c.setStyle({lineColor:16734553})):(t.cursorError=!1,l.setStyle({lineColor:n.lineColor}),c.setStyle({lineColor:n.lineColor}))):n.setPoints([])},E=()=>{t.off("select",C),t.off("intersectionUpdate",M),t.off("disable",S),t.plane=null,t.disable(),r==null||r.remove(l,c)},S=()=>{E(),r==null||r.remove(n,c,l),o(new Error("Cancelled"))};return t.on("select",C),t.on("intersectionUpdate",M),t.on("disable",S),{finished:i,canUndo:g,canRedo:A,undo:w,redo:I}}function Dx(n){const t=[...n],e=[];for(let i=0;i<t.length-2;i++)e.push(0,i+1,i+2);return e}function Sx(n){const t=n.map(i=>new b.Vector3(i[0],i[1],i[2]));return du(t)}class Lx extends b.BufferGeometry{constructor(e){super();d(this,"bottomPositions",[]);d(this,"topPosition",[]);d(this,"_type","Concave");e&&this.setPosition(e)}setPosition(e){var l,c,h;const i=(l=e.bottomPositions)!=null?l:this.bottomPositions,s=(c=e.topPosition)!=null?c:this.topPosition;if(this._type=(h=e.type)!=null?h:this._type,this.bottomPositions=i,this.topPosition=s,!i||i.length<3){console.error("PrismGeometry: Invalid parameters",i,s,e),this.bottomPositions=[],this.setAttribute("position",new b.BufferAttribute(new Float32Array([]),3));return}const o=[],r=[];r.push(...i),r[0][0]===r.at(-1)[0]&&r[0][1]===r.at(-1)[1]&&r[0][2]===r.at(-1)[2]&&(r.length-=1);const a=this._type==="Concave"?Sx(r):Dx(r);if(o.push(...a),s&&s.length===3){const u=[s[0]-i[0][0],s[1]-i[0][1],s[2]-i[0][2]],f=r.map(v=>[v[0]+u[0],v[1]+u[1],v[2]+u[2]]);r.push(...f);const m=o.map(v=>v+r.length/2);o.push(...m);for(let v=0;v<r.length/2-1;v++)o.push(v,v+1,v+r.length/2),o.push(v+1,v+r.length/2+1,v+r.length/2);o.push(0,r.length/2,r.length/2-1),o.push(r.length/2,r.length-1,r.length/2-1)}this.setAttribute("position",new b.Float32BufferAttribute(r.flat(),3)),this.setIndex(o),this.computeBoundingSphere()}}class ls extends Rt{constructor(e){super();d(this,"name","PrismMesh");d(this,"_geometryInfoCache");d(this,"geometryInfoNeedUpdate",!0);d(this,"prismMesh",new kr);d(this,"edgeMesh",new Ht);d(this,"paramStyle");this.prismMesh.name="PrismMesh",this.prismMesh.geometry=new Lx,this.edgeMesh.name="EdgeMesh",this.addIfNotExists(this.prismMesh,this.edgeMesh),e&&this.setPoints(e),this.setStyle(e)}get topPosition(){return new b.Vector3().fromArray(this.prismMesh.geometry.topPosition)}get bottomPositions(){return this.prismMesh.geometry.bottomPositions.map(e=>new b.Vector3().fromArray(e))}get topPositions(){const e=this.bottomPositions[0].clone().sub(this.topPosition);return this.bottomPositions.map(i=>i.clone().sub(e))}get style(){return{color:this.color,lineColor:this.lineColor,lineWidth:this.lineWidth,opacity:this.opacity,occlusionVisibility:this.occlusionVisibility,occlusionMode:this.occlusionMode}}get opacity(){return this.prismMesh.opacity}get occlusionVisibility(){return this.prismMesh.occlusionVisibility}get occlusionMode(){return this.prismMesh.occlusionMode}get center(){return this.localCenter.clone()}get localCenter(){var e;return(e=this.geometryInfo.center.clone())!=null?e:new b.Vector3(9999,9999,9999)}get geometryInfo(){if(this.geometryInfoNeedUpdate){this.geometryInfoNeedUpdate=!1;const e=this.prismMesh.geometry.bottomPositions,i=this.prismMesh.geometry.topPosition;if(!e||e.length<3||!i){this._geometryInfoCache=void 0;return}const s=e.map((c,h)=>{if(!(h>=e.length-2))return[new b.Vector3().fromArray(e[0]),new b.Vector3().fromArray(e[h+1]),new b.Vector3().fromArray(e[h+2])]}).filter(Boolean);if(s.length===0){this._geometryInfoCache=void 0;return}let o=0,r=new b.Vector3;for(const[c,h,u]of s){const f=Ua(c,h,u),m=pu(c,h,u,f);o+=f,r.add(m)}r=r.divideScalar(o);const a=new b.Vector3().fromArray(i).sub(new b.Vector3().fromArray(e[0])),l=r.clone().add(a.divideScalar(2));this._geometryInfoCache={center:l}}return this._geometryInfoCache}get worldCenter(){return this.updateMatrixWorld(),this.localToWorld(this.localCenter)}get color(){return this.prismMesh.color}get lineWidth(){return this.edgeMesh.style.lineWidth}get lineColor(){return this.edgeMesh.color}setStyle(e={}){this.paramStyle=x(x({},this.paramStyle),e),this.prismMesh.setStyle(this.paramStyle),this.edgeMesh.setStyle(this.paramStyle)}setPoints(e){var i;this.prismMesh.geometry.setPosition({bottomPositions:(i=e.points)==null?void 0:i.map(De).map(s=>s.toArray()),topPosition:e.heightPoint?De(e.heightPoint).toArray():void 0}),this.edgeMesh.geometry=new So().fromEdgesGeometry(new b.EdgesGeometry(this.prismMesh.geometry)),this.geometryInfoNeedUpdate=!0}highlight(){this.prismMesh.highlight()}unhighlight(){this.prismMesh.unhighlight()}raycast(e,i){return this.children.forEach(s=>sa(s,e,i,!0)),!1}}class Zg extends to{constructor(t){super(t,()=>({positionFrom:()=>t.worldCenter,yAxis:()=>t.up,scaleHelper:{enable:!0,positions:()=>{const e=t.bottomPositions,i=t.topPosition,s=new b.Vector3().subVectors(i,e[0]),o=t.geometryInfo.center,r=o.clone().sub(s.clone().divideScalar(2)),a=o.clone().add(s.clone().divideScalar(2));return[{id:"top",handlePosition:a,basePosition:r},{id:"bottom",handlePosition:r,basePosition:a}]},scaleCallback:e=>{const{intersectPoint:i,scalePosition:s}=e,{id:o,basePosition:r,handlePosition:a}=s;if(o==="top"){const l=i.clone().sub(r);t.setPoints({heightPoint:t.bottomPositions[0].clone().add(l)})}else if(o==="bottom"){const l=i.clone().sub(r);t.setPoints({points:t.topPositions.map(c=>c.clone().add(l))})}}}}))}}class Jg extends Kt{constructor(e,i){super(e,i);d(this,"type","Prism");d(this,"prismMesh");d(this,"_editor");e&&(this.prismMesh=new ls(x(x({},e.style),e)),this.add(this.prismMesh))}get editor(){return this._editor||(this._editor=new Zg(this.prismMesh)),this._editor}get data(){return ie(x({},this.baseData),{points:_t(this.applyObjectMatrixWorld(this.prismMesh.bottomPositions,this.prismMesh)),heightPoint:_t(this.applyObjectMatrixWorld(this.prismMesh.topPosition,this.prismMesh)),style:{color:this.prismMesh.color.getHex(),lineWidth:this.prismMesh.lineWidth,lineColor:this.prismMesh.lineColor.getHex()}})}setData(e){this.prismMesh.setPoints({points:e.points?this.applyObjectReversalMatrixWorld(e.points.map(De),this.prismMesh):void 0,heightPoint:e.heightPoint?this.applyObjectReversalMatrixWorld(De(e.heightPoint),this.prismMesh):void 0}),this.prismMesh.setStyle(e.style),this._editor&&this._editor.initialHelperMatrix()}highlight(){var e;(e=this.prismMesh)==null||e.highlight()}unhighlight(){var e;(e=this.prismMesh)==null||e.unhighlight()}create(e){return H(this,null,function*(){this.prismMesh=new ls(e),this.add(this.prismMesh),yield rc(this.prismMesh,this.pointSelector),this.config.defaultAction&&this.editor.enable()})}}function rc(n,t){return H(this,null,function*(){const e=n.parent,i=new oc(n.style);e.add(i),yield xr(i,t).finished,e.remove(i),n.setPoints({points:i.points});const s=new Ht;s.name="LineHelper",e.add(s);const o=i.points.at(-1),r=on(i.points),a=o.clone().add(r.clone().multiplyScalar(100)),l=o.clone().sub(r.clone().multiplyScalar(100));return s.setPoints([a,l]),t.enable(),new Promise((c,h)=>{const u=p=>{m(),c()},f=p=>{if(!(p!=null&&p.raycaster))return;const g=gn({raycaster:p.raycaster,line:new b.Line3(a,l)});g&&n.setPoints({heightPoint:g})},m=()=>{t.off("select",u),t.off("intersectionUpdate",f),t.off("disable",v),e.remove(s),t.disable()},v=()=>{m(),e.remove(n),h(new Error("Cancelled"))};t.on("select",u),t.on("intersectionUpdate",f),t.on("disable",v)})})}class qg extends to{constructor(t){super(t,()=>({yAxis:()=>{const e=t.points;return on(e).normalize()},zAxis:()=>{const e=t.points;return e[0].clone().sub(e[1]).normalize()},scaleHelper:{enable:!0,positions:()=>{const e=t.points,i=e[0].clone().lerp(e[3],.5),s=e[1].clone().lerp(e[2],.5),o=e[0].clone().lerp(e[1],.5),r=e[3].clone().lerp(e[2],.5);return[{id:"left",handlePosition:i,basePosition:s},{id:"right",handlePosition:s,basePosition:i},{id:"top",handlePosition:o,basePosition:r},{id:"bottom",handlePosition:r,basePosition:o}]},scaleCallback:e=>{const{intersectPoint:i,scalePosition:s}=e,{id:o,basePosition:r}=s,a=i.clone().sub(r),l=t.points;o==="top"?t.setPoints([l[3].clone().add(a),l[2].clone().add(a),l[2],l[3]]):o==="bottom"?t.setPoints([l[0],l[1],l[1].clone().add(a),l[0].clone().add(a)]):o==="left"?t.setPoints([l[1].clone().add(a),l[1],l[2],l[2].clone().add(a)]):o==="right"&&t.setPoints([l[0],l[0].clone().add(a),l[3].clone().add(a),l[3]])}}}))}}class Tx extends b.BufferGeometry{constructor(e){super();d(this,"name","RectangleGeometry");d(this,"points");if(e.length!==4){console.error("Invalid number of points, it's not a rectangle");return}this.points=e.slice(0,4),this.setAttribute("position",new b.BufferAttribute(new Float32Array(this.points.flatMap(i=>i.toArray())),3)),this.setIndex(new b.BufferAttribute(new Uint16Array([0,1,2,0,2,3]),1))}}class Kg extends sc{constructor(e){super(e);d(this,"name","RectangleMesh")}get color(){return this.meshFont.material.color}setPoints(e){const i=e.map(De).filter(ke);if(i.length<3){console.error("Invalid position");return}if(e.length===3){const[s,o,r]=i,a=s.clone().add(r).sub(o);i.push(a)}this.points=i,this.geometry=new Tx(i),this.planeHelperNeedUpdate=!0,this.geometryInfoNeedUpdate=!0}}class Dr extends Kg{constructor(e){const o=e!=null?e:{},{points:i}=o,s=Yi(o,["points"]);super();d(this,"name","RectangleWithEdgeMesh");d(this,"line",new pn);i&&this.setPoints(i),s&&this.setStyle(s)}get style(){return x(x({},super.style),this.line.style)}get lineWidth(){return this.line.lineWidth}get lineColor(){return this.line.lineColor}setPoints(e){super.setPoints(e),this.points&&(this.line.setPoints([this.points[0],this.points[1],this.points[2],this.points[3],this.points[0]]),this.addIfNotExists(this.line))}setStyle(e){super.setStyle(e),this.line.setStyle(e)}highlight(){super.highlight(),this.line.highlight()}unhighlight(){super.unhighlight(),this.line.unhighlight()}}function $g(n,t){const e=on(n),i=Ot(...n),s=t.clone().sub(i);return e.dot(s)>=0?n:n.slice().reverse()}class ep extends Kt{constructor(e,i){super(e,i);d(this,"type","Rectangle");d(this,"rectangleMesh");d(this,"_editor");e&&(this.rectangleMesh=new Dr(x(x({},e.style),e)),this.add(this.rectangleMesh))}get editor(){return this._editor||(this._editor=new qg(this.rectangleMesh)),this._editor}get data(){return ie(x({},this.baseData),{points:_t(this.applyObjectMatrixWorld(this.rectangleMesh.points,this.rectangleMesh)),style:{color:this.rectangleMesh.color.getHex(),opacity:this.rectangleMesh.opacity,lineWidth:this.rectangleMesh.lineWidth,lineColor:this.rectangleMesh.lineColor.getHex()}})}setData(e){e.points&&this.rectangleMesh.setPoints(this.applyObjectReversalMatrixWorld(e.points.map(De),this.rectangleMesh)),this.rectangleMesh.setStyle(e.style),this._editor&&this._editor.initialHelperMatrix()}highlight(){var e;(e=this.rectangleMesh)==null||e.highlight()}unhighlight(){var e;(e=this.rectangleMesh)==null||e.unhighlight()}create(e){return H(this,null,function*(){this.removeChildren();const i=new Dr(e);this.rectangleMesh=i,this.add(this.rectangleMesh),yield Sr(this.rectangleMesh,this.pointSelector,e),this.config.defaultAction&&this.editor.enable()})}}function Sr(n,t,e){var s;return((s=e==null?void 0:e.drawMethod)!=null?s:"diagonal")==="diagonal"?zx(n,t,e):jx(n,t,e)}function zx(n,t,e){var I;const{promise:i,reject:s,resolve:o}=dn(),r=n.parent;if(!r)return s(new Error("No container"));const a=(I=e==null?void 0:e.limit)!=null?I:"none",l=new Qi(ie(x({},n.style),{dashed:!0})),c=new Qi(ie(x({},n.style),{dashed:!0,lengthEnable:!1})),h=new Qi(ie(x({},n.style),{dashed:!1,lengthEnable:!1}));r.add(l,h,c),t.enable();const u=[];let f=new b.Vector3,m=new b.Vector3;const v=new b.Plane,p=()=>{u.push(f.clone()),u.length===1?(a==="xoz"&&v.setFromNormalAndCoplanarPoint(new b.Vector3(0,1,0),u[0]),a==="none"&&v.setFromNormalAndCoplanarPoint(m,u[0])):u.length===2?a==="y"||a==="xoz"?(A(),o()):h.setPoints([u[0],u[1]]):u.length===3&&(A(),o())},g=C=>{var E,S;if(!(C!=null&&C.raycaster))return;const M=(E=u.at(-1))==null?void 0:E.clone();if(u.length===0){f=C.point.clone(),m=(S=C.face)==null?void 0:S.normal;return}if(u.length===1&&a==="y"){const W=new b.Line3(new b.Vector3(0,1,0).add(u[0]),new b.Vector3(0,-1,0).add(u[0])).closestPointToPoint(C.point,!1,new b.Vector3);n.setPoints([u[0],W,C.point]);return}if(u.length===1&&a==="xoz"){const L=new b.Line3(new b.Vector3(1,0,0).add(u[0]),new b.Vector3(-1,0,0).add(u[0])),W=C.raycaster.ray.intersectPlane(v,new b.Vector3),R=L.closestPointToPoint(W,!1,new b.Vector3);n.setPoints([u[0],R,W]);return}if(u.length===1&&a==="none"){v?(f=C.raycaster.ray.intersectPlane(v,new b.Vector3),c.setPoints([f,C.point])):f=C.point.clone(),l.setPoints([M,f]);return}if(u.length===2&&a==="none"){r.remove(l);const L=C.raycaster.ray.intersectPlane(v,new b.Vector3),W=u[0].distanceTo(u[1])/2,R=new b.Vector3().lerpVectors(u[0],u[1],.5),U=new b.Vector3().subVectors(L,R).normalize();f=new b.Vector3().addVectors(R,U.multiplyScalar(W));const j=[u[0],f,u[1]],Y=$g(j,Je.modules.five.camera.position);n.setPoints(Y);return}},A=()=>{t.off("select",p),t.off("intersectionUpdate",g),t.off("disable",w),t.disable(),r==null||r.remove(l,h,c)},w=()=>{A(),r==null||r.remove(n),s(new Error("Cancelled"))};return t.on("select",p),t.on("intersectionUpdate",g),t.on("disable",w),i}function jx(n,t,e){var I;const{promise:i,reject:s,resolve:o}=dn(),r=n.parent;if(!r)return s(new Error("No container"));const a=(I=e==null?void 0:e.limit)!=null?I:"none",l=new Qi(ie(x({},n.style),{dashed:!0})),c=new Qi(ie(x({},n.style),{dashed:!0,lengthEnable:!1})),h=new Qi(ie(x({},n.style),{dashed:!1,lengthEnable:!1}));r.add(l,h,c),t.enable();const u=[];let f=new b.Vector3,m=new b.Vector3;const v=new b.Plane,p=()=>{u.push(f.clone()),u.length===1?(a==="xoz"&&v.setFromNormalAndCoplanarPoint(new b.Vector3(0,1,0),u[0]),a==="none"&&v.setFromNormalAndCoplanarPoint(m,u[0])):u.length===2?(a==="y"&&v.setFromCoplanarPoints(u[0],u[1],new b.Vector3(0,1,0).add(u[0])),h.setPoints([u[0],u[1]])):u.length===3&&(A(),o())},g=C=>{var E,S;if(!(C!=null&&C.raycaster))return;const M=(E=u.at(-1))==null?void 0:E.clone();if(u.length===0){f=C.point.clone(),m=(S=C.face)==null?void 0:S.normal;return}if(u.length===1&&a==="y"){f=C.point,c.setPoints([]),l.setPoints([M,f]);return}if(u.length===1&&a==="xoz"){f=C.raycaster.ray.intersectPlane(v,new b.Vector3),c.setPoints([f,C.point]),l.setPoints([M,f]);return}if(u.length===1&&a==="none"){f=C.raycaster.ray.intersectPlane(v,new b.Vector3),c.setPoints([f,C.point]),l.setPoints([M,f]);return}if(u.length===2){r.remove(l);const L=new b.Vector3().crossVectors(u[0].clone().sub(u[1]),v.normal).normalize();f=new b.Line3(u[1].clone().add(L),u[1].clone().sub(L)).closestPointToPoint(C.point,!1,new b.Vector3);const R=[u[0],u[1],f],U=$g(R,Je.modules.five.camera.position);n.setPoints(U);return}},A=()=>{t.off("select",p),t.off("intersectionUpdate",g),t.off("disable",w),t.disable(),r==null||r.remove(l,h,c)},w=()=>{A(),r==null||r.remove(n),s(new Error("Cancelled"))};return t.on("select",p),t.on("intersectionUpdate",g),t.on("disable",w),i}class tp extends to{constructor(t){super(t,()=>({yAxis:()=>t.normal}))}}function ip(n){return Math.max(32,Math.min(128,Math.floor(n*40)))}class np extends kr{constructor(e){super(e);d(this,"_normal");d(this,"_center");d(this,"_radius");e!=null&&e.center&&(e!=null&&e.normal)&&(e!=null&&e.radius)&&this.setPoints(e)}get center(){return this.position.clone()}get normal(){return this._normal}set normal(e){this._normal=e}get radius(){var e,i;return(i=(e=this.meshFont.geometry)==null?void 0:e.parameters)==null?void 0:i.radius}setPoints(e){var i,s,o;if(this._center=(i=De(e.center))!=null?i:this._center,this._normal=((s=De(e.normal))!=null?s:this._normal).normalize(),this._radius=(o=e.radius)!=null?o:this._radius,ke(this._radius)&&this._radius!==this.radius){const r=ip(this._radius);this.geometry=new b.CircleGeometry(this._radius,r)}this._center&&this.position.copy(this._center),this._normal&&(this.lookAt(this._normal.clone().add(this._center)),this.normal=this._normal.clone()),this.needsRender=!0}}class io extends np{constructor(e){const a=e!=null?e:{},{normal:i,radius:s,center:o}=a,r=Yi(a,["normal","radius","center"]);super(r);d(this,"edgeLine");this.edgeLine=new Ht(r),this.add(this.edgeLine),i&&s&&o&&this.setPoints({normal:i,radius:s,center:o})}setPoints(...e){super.setPoints(...e);const i=this.meshFont.geometry.vertices.slice(1);this.edgeLine.setPoints(i.concat(i[0]))}setStyle(e){super.setStyle(e),this.edgeLine.setStyle(e)}highlight(){super.highlight(),this.edgeLine.highlight()}unhighlight(){super.unhighlight(),this.edgeLine.unhighlight()}}class sp extends Kt{constructor(e,i){super(e,i);d(this,"type","Circle");d(this,"circleMesh");d(this,"_editor");e&&(this.circleMesh=new io(x(x({},e.style),e)),this.add(this.circleMesh))}get editor(){return this._editor||(this._editor=new tp(this.circleMesh)),this._editor}get data(){return ie(x({},this.baseData),{center:_t(this.applyObjectMatrixWorld(this.circleMesh.center,this.circleMesh)),normal:_t(this.circleMesh.normal.clone().applyQuaternion(this.circleMesh.quaternion)),radius:this.circleMesh.radius,style:{color:this.circleMesh.color.getHex()}})}setData(e){this.circleMesh.setPoints({center:e.center?this.applyObjectReversalMatrixWorld(De(e.center),this.circleMesh):void 0,normal:e.normal?De(e.normal):void 0,radius:e.radius}),this.circleMesh.setStyle(e.style),this._editor&&this._editor.initialHelperMatrix()}highlight(){var e;(e=this.circleMesh)==null||e.highlight()}unhighlight(){var e;(e=this.circleMesh)==null||e.unhighlight()}create(e){return H(this,null,function*(){this.children.forEach(s=>{s.parent===this&&this.remove(s)}),this.children.length=0;const i=new io(e);this.circleMesh=i,this.add(this.circleMesh),yield Lr(this.circleMesh,this.pointSelector),this.config.defaultAction&&this.editor.enable()})}}function Lr(n,t){return new Promise((e,i)=>{const s=n.parent;if(!s){i(new Error("No container"));return}const o=new pn({dashed:!0});s.add(o),t.enable();let r,a;const l=f=>{if(f){if(!r){r={point:f.point,normal:f.face.normal};return}r&&a&&(h(),e())}},c=f=>{if(!f||!r)return;const m=new b.Plane().setFromNormalAndCoplanarPoint(r.normal,r.point);if(a=f.raycaster.ray.intersectPlane(m,new b.Vector3),a){const v=r.point.distanceTo(a);n.setPoints({center:r.point,normal:r.normal,radius:v})}},h=()=>{t.off("select",l),t.off("intersectionUpdate",c),t.off("disable",u),t.disable(),s==null||s.remove(o)},u=()=>{h(),s==null||s.remove(n,o),i(new Error("Cancelled"))};t.on("select",l),t.on("intersectionUpdate",c),t.on("disable",u)})}class ac extends Rt{constructor(e){super();d(this,"bottomCircle");d(this,"topCircle");d(this,"edgeMesh");d(this,"highlighted",!1);d(this,"params");d(this,"_topCenter");d(this,"_bottomCenter");d(this,"_radius");this.params=e,this.bottomCircle=new io(e),this.bottomCircle.name="bottomCircle",this.topCircle=new io(e),this.topCircle.name="topCircle",this.edgeMesh=new kr(e),e!=null&&e.bottomCenter&&(e!=null&&e.topCenter)&&(e!=null&&e.radius)&&this.setPoints(e),this.addIfNotExists(this.bottomCircle)}get bottomCenter(){return this.bottomCircle.center}get topCenter(){return this.topCircle.center}get normal(){return this.bottomCircle.normal}get radius(){return this.bottomCircle.radius}get color(){return this.bottomCircle.color}setPoints(e){var i,s;if(this._topCenter=(i=De(e.topCenter))!=null?i:this.topCenter,this._bottomCenter=(s=De(e.bottomCenter))!=null?s:this.bottomCenter,this._radius=ke(e.radius)?e.radius:this.radius,this._topCenter&&this._bottomCenter){const o=this._topCenter.clone().sub(this._bottomCenter).normalize();this.bottomCircle.setPoints({center:this._bottomCenter,normal:o,radius:this._radius}),this.setTopCenter(this._topCenter)}this.needsRender=!0}setTopCenter(e){this.addIfNotExists(this.topCircle),this.topCircle.setPoints({center:e,normal:this.normal,radius:this.radius}),this.setEdgeMesh()}setBottomCenter(e){this.addIfNotExists(this.bottomCircle),this.bottomCircle.setPoints({center:e,normal:this.normal,radius:this.radius}),this.setEdgeMesh()}setStyle(e){this.params=x(x({},this.params),e),this.bottomCircle.setStyle(this.params),this.topCircle.setStyle(this.params)}highlight(){this.highlighted||(this.highlighted=!0,this.edgeMesh.highlight(),this.bottomCircle.highlight(),this.topCircle.highlight(),this.needsRender=!0)}unhighlight(){this.highlighted&&(this.highlighted=!1,this.edgeMesh.unhighlight(),this.bottomCircle.unhighlight(),this.topCircle.unhighlight(),this.needsRender=!0)}setEdgeMesh(){this.addIfNotExists(this.edgeMesh);const e=this.topCircle.center,i=this.bottomCircle.center;this.edgeMesh.geometry.dispose(),this.edgeMesh.geometry=new b.CylinderGeometry(this.radius,this.radius,e.distanceTo(i),ip(this.radius),1,!0);const s=new b.Quaternion().setFromUnitVectors(new b.Vector3(0,1,0),this.normal.clone().normalize());this.edgeMesh.position.copy(new b.Vector3().lerpVectors(i,e,.5)),this.edgeMesh.quaternion.copy(s)}}class op extends to{constructor(t){super(t,()=>{const e=()=>{const i=t.topCenter,s=t.bottomCenter,o=new b.Vector3().lerpVectors(i,s,.5);return{topCenter:i,bottomCenter:s,boxCenter:o}};return{positionFrom:"boundingBox",yAxis:()=>t.normal,scaleHelper:{enable:!0,positions:()=>{const i=e();return[{id:"top",handlePosition:i.topCenter,basePosition:i.bottomCenter},{id:"bottom",handlePosition:i.bottomCenter,basePosition:i.topCenter}]},scaleCallback:i=>{const{intersectPoint:s,scalePosition:o}=i,{id:r}=o;r==="top"?t.setTopCenter(s):r==="bottom"&&t.setBottomCenter(s)}}}})}}class rp extends Kt{constructor(e,i){super(e,i);d(this,"type","Cylinder");d(this,"cylinderMesh");d(this,"_editor");e&&(this.cylinderMesh=new ac(x(x({},e.style),e)),this.add(this.cylinderMesh))}get editor(){return this._editor||(this._editor=new op(this.cylinderMesh)),this._editor}get data(){return ie(x({},this.baseData),{bottomCenter:_t(this.applyObjectMatrixWorld(this.cylinderMesh.bottomCenter,this.cylinderMesh)),topCenter:_t(this.applyObjectMatrixWorld(this.cylinderMesh.topCenter,this.cylinderMesh)),radius:this.cylinderMesh.radius,style:{color:this.cylinderMesh.color.getHex()}})}setData(e){this.cylinderMesh.setPoints({bottomCenter:e.bottomCenter?this.applyObjectReversalMatrixWorld(De(e.bottomCenter),this.cylinderMesh):void 0,topCenter:e.topCenter?this.applyObjectReversalMatrixWorld(De(e.topCenter),this.cylinderMesh):void 0}),this.cylinderMesh.setStyle(e.style),this._editor&&this._editor.initialHelperMatrix()}highlight(){var e;(e=this.cylinderMesh)==null||e.highlight()}unhighlight(){var e;(e=this.cylinderMesh)==null||e.unhighlight()}create(e){return H(this,null,function*(){this.cylinderMesh=new ac(e),this.add(this.cylinderMesh),yield lc(this.cylinderMesh,this.pointSelector),this.config.defaultAction&&this.editor.enable()})}}function lc(n,t){return H(this,null,function*(){const e=n.parent;yield Lr(n.bottomCircle,t);const i=new Ht;i.name="LineHelper",e.add(i);const s=t.position.point,o=n.normal.clone().normalize(),r=s.clone().add(o.clone().multiplyScalar(100)),a=s.clone().sub(o.clone().multiplyScalar(100));return i.setPoints([r,a]),t.enable(),new Promise((l,c)=>{const h=v=>{f(),l()},u=v=>{if(!(v!=null&&v.raycaster))return;const p=gn({raycaster:v.raycaster,line:new b.Line3(r,a)}),A=new b.Plane().setFromNormalAndCoplanarPoint(n.normal,n.bottomCenter).projectPoint(p,new b.Vector3),w=p.clone().sub(A),I=n.bottomCenter.clone().add(w);p&&n.setTopCenter(I)},f=()=>{t.off("select",h),t.off("intersectionUpdate",u),t.off("disable",m),e.remove(i),t.disable()},m=()=>{f(),e.remove(n),c(new Error("Cancelled"))};t.on("select",h),t.on("intersectionUpdate",u),t.on("disable",m)})})}class ap extends to{constructor(t){super(t,()=>({positionFrom:()=>t.worldCenter,yAxis:()=>new b.Vector3().subVectors(t.topPosition,t.bottomPositions[0]).normalize(),zAxis:()=>new b.Vector3().subVectors(t.bottomPositions[0],t.bottomPositions[1]).normalize(),scaleHelper:{enable:!0,positions:()=>{const e=t.bottomPositions,i=t.topPosition,s=new b.Vector3().subVectors(i,e[0]),o=new b.Vector3().subVectors(e[1],e[0]),r=new b.Vector3().subVectors(e[2],e[1]),a=t.geometryInfo.center,l=a.clone().sub(s.clone().divideScalar(2)),c=a.clone().add(s.clone().divideScalar(2)),h=a.clone().sub(o.clone().divideScalar(2)),u=a.clone().add(o.clone().divideScalar(2)),f=a.clone().sub(r.clone().divideScalar(2)),m=a.clone().add(r.clone().divideScalar(2));return[{id:"top",handlePosition:c,basePosition:l},{id:"bottom",handlePosition:l,basePosition:c},{id:"left",handlePosition:h,basePosition:u},{id:"right",handlePosition:u,basePosition:h},{id:"front",handlePosition:f,basePosition:m},{id:"back",handlePosition:m,basePosition:f}]},scaleCallback:e=>{const{intersectPoint:i,scalePosition:s}=e,{id:o,basePosition:r}=s,a=t.bottomPositions,l=t.topPositions;let c=new b.Vector3().subVectors(t.topPosition,a[0]),h;if(o==="top")c=i.clone().sub(r),h=a;else if(o==="bottom"){const u=i.clone().sub(r);h=l.map(f=>f.clone().add(u)),c=void 0}else if(o==="left"){const u=i.clone().sub(r);h=[a[1].clone().add(u),a[1],a[2],a[2].clone().add(u)]}else if(o==="right"){const u=i.clone().sub(r);h=[a[0],a[0].clone().add(u),a[3].clone().add(u),a[3]]}else if(o==="front"){const u=i.clone().sub(r);h=[a[3].clone().add(u),a[2].clone().add(u),a[2],a[3]]}else if(o==="back"){const u=i.clone().sub(r);h=[a[0],a[1],a[1].clone().add(u),a[0].clone().add(u)]}t.setPoints({points:h,heightPoint:c?h[0].clone().add(c):void 0})}}}))}}class cc extends ls{constructor(){super(...arguments);d(this,"name","BoxMesh")}get geometryInfo(){if(this.geometryInfoNeedUpdate){this.geometryInfoNeedUpdate=!1;const e=this.bottomPositions,i=this.topPosition;if(!e||e.length<3||!i){this._geometryInfoCache=void 0;return}const s=Ot(...e),o=i.clone().sub(e[0]),r=s.clone().add(o.clone().divideScalar(2));this._geometryInfoCache={center:r}}return this._geometryInfoCache}}class lp extends Kt{constructor(e,i){super(e,i);d(this,"type","Box");d(this,"boxMesh");d(this,"_editor");e&&(this.boxMesh=new cc(x(x({},e.style),e)),this.add(this.boxMesh))}get editor(){return this._editor||(this._editor=new ap(this.boxMesh)),this._editor}get data(){return ie(x({},this.baseData),{points:_t(this.applyObjectMatrixWorld(this.boxMesh.bottomPositions,this.boxMesh)),heightPoint:_t(this.applyObjectMatrixWorld(this.boxMesh.topPosition,this.boxMesh)),style:{color:this.boxMesh.color.getHex(),opacity:this.boxMesh.opacity,lineWidth:this.boxMesh.lineWidth,lineColor:this.boxMesh.lineColor.getHex()}})}setData(e){this.boxMesh.setPoints({points:e.points?this.applyObjectReversalMatrixWorld(e.points.map(De),this.boxMesh):void 0,heightPoint:e.heightPoint?this.applyObjectReversalMatrixWorld(De(e.heightPoint),this.boxMesh):void 0}),this.boxMesh.setStyle(e.style),this._editor&&this._editor.initialHelperMatrix()}highlight(){var e;(e=this.boxMesh)==null||e.highlight()}unhighlight(){var e;(e=this.boxMesh)==null||e.unhighlight()}create(e){return H(this,null,function*(){this.removeChildren(),this.boxMesh=new cc(e),this.add(this.boxMesh),yield hc(this.boxMesh,this.pointSelector,e),this.config.defaultAction&&this.editor.enable()})}}function hc(n,t,e){return H(this,null,function*(){return new Promise((i,s)=>H(this,null,function*(){const o=n.parent;if(!o){s(new Error("No container"));return}const r=new Dr(n.style);o.add(r),yield Sr(r,t,e),o.remove(r),n.setPoints({points:r.points});const a=new Ht,l=on(n.bottomPositions),c=Ot(...n.bottomPositions),h=c.clone().add(l.clone().multiplyScalar(100)),u=c.clone().sub(l.clone().multiplyScalar(100));a.setPoints([h,u]),o.add(a),t.enable();const f=g=>{v(),i()},m=g=>{if(!(g!=null&&g.raycaster))return;const A=gn({raycaster:g.raycaster,line:new b.Line3(h,u)});if(A){const w=A.clone().sub(c);n.setPoints({heightPoint:n.bottomPositions[0].clone().add(w)})}},v=()=>{t.off("select",f),t.off("intersectionUpdate",m),t.off("disable",p),t.disable(),o==null||o.remove(a)},p=()=>{v(),o==null||o.remove(n),s(new Error("Cancelled"))};t.on("select",f),t.on("intersectionUpdate",m),t.on("disable",p)}))})}function Ox(n,t){for(let e=n.length-1;e>=0;e--)t(n[e])}class cp extends Kt{constructor(e,i){super(e,i);d(this,"type","Line");d(this,"lineMesh");d(this,"_editor");d(this,"creatingObject");e&&(this.lineMesh=new Xl(x(x({},e.style),e)),this.add(this.lineMesh))}get editor(){return this._editor||(this._editor=new Mx(this)),this._editor}get data(){return ie(x({},this.baseData),{points:_t(this.applyObjectMatrixWorld(this.lineMesh.points)),style:{lineColor:new b.Color(this.lineMesh.color).getHex(),lineWidth:this.lineMesh.lineWidth,dashed:this.lineMesh.dashed}})}setData(e){e.points&&this.lineMesh.setPoints(e.points),this.lineMesh.setStyle(e.style)}highlight(){var e;(e=this.lineMesh)==null||e.highlight()}unhighlight(){var e;(e=this.lineMesh)==null||e.unhighlight()}canUndo(){var e;(e=this.creatingObject)==null||e.canUndo()}canRedo(){var e;(e=this.creatingObject)==null||e.canRedo()}undo(){var e;(e=this.creatingObject)==null||e.undo()}redo(){var e;(e=this.creatingObject)==null||e.redo()}create(e){return H(this,null,function*(){this.removeChildren();const i=new Xl(e);this.lineMesh=i,this.add(this.lineMesh),this.creatingObject=dc(i,this.pointSelector,e),yield this.creatingObject.finished,this.config.defaultAction&&this.editor.enable()})}}function dc(n,t,e){var S;const i=n.parent;if(!i)return;const{promise:s,resolve:o,reject:r}=dn(),a=(S=e==null?void 0:e.limit)!=null?S:"none",l=new Ht(n.style);i.add(l);const c=new Ht(ie(x({},n.style),{dashed:!0,lengthEnable:!1}));i.add(c),t.enable();const h=[];let u,f,m;const v=[],p=()=>h.length>0,g=()=>v.length>0,A=()=>{p()&&(v.push(h.pop()),n.setPoints(h),C(m),t.pointSelectorHelper.magnifier.render())},w=()=>{g()&&(h.push(v.pop()),n.setPoints(h),C(m),t.pointSelectorHelper.magnifier.render())},I=L=>{if(!L)return;v.length=0;const W=h.length===0?L.point:u.clone();h.push(W),n.setPoints(h),h.length===2&&(M(),o())},C=L=>{const W=()=>{l.setPoints([]),c.setPoints([]),t.pointSelectorHelper.magnifier.render()};if(!(h!=null&&h.length)||!L)return W();m=L;const R=h.at(-1).clone();a==="none"?(u=L.point,l.setPoints([R,u])):a==="xoz"?(t.plane=f,f=f!=null?f:new b.Plane().setFromNormalAndCoplanarPoint(new b.Vector3(0,1,0),h[0]),u=f.projectPoint(L.point,new b.Vector3),l.setPoints([R,u]),c.setPoints([u,L.point])):a==="y"&&(L.isVirtual?(u=gn({raycaster:L.raycaster,line:new b.Line3(h[0].clone(),new b.Vector3(0,1,0).add(h[0])),clampToLine:!1}),c.setPoints([])):(u=new b.Line3(h[0].clone(),new b.Vector3(0,1,0).add(h[0])).closestPointToPoint(L.point,!1,new b.Vector3),c.setPoints([u,L.point])),l.setPoints([R,u]))},M=()=>{t.off("select",I),t.off("intersectionUpdate",C),t.off("disable",E),t.plane=null,t.disable(),i==null||i.remove(l,c)},E=()=>{M(),h.length!==2&&(i==null||i.remove(n)),r(new Error("Cancelled"))};return t.on("select",I),t.on("intersectionUpdate",C),t.on("disable",E),{finished:s,canUndo:p,canRedo:g,undo:A,redo:w}}const cs=class extends ht{constructor(e,i){super();d(this,"group");d(this,"theme");d(this,"five");d(this,"creatingItem",null);d(this,"undo",()=>{var e;console.log("undo"),(e=this.creatingItem)==null||e.undo(),this.five.needsRender=!0});d(this,"redo",()=>{var e;console.log("redo"),(e=this.creatingItem)==null||e.redo(),this.five.needsRender=!0});this.five=e,this.theme=i,this.group=new Rt,this.group.name="Sculpt",e.scene.add(this.group),cs.modules.init(e),Bt("ctrl+z, command+z",this.undo),Bt("ctrl+shift+z, command+shift+z",this.redo),cs.modules.fiveDomEvents.addEventListener(this.group,"click",({intersects:s,origDomEvent:o})=>{var a;const r=jg((a=s==null?void 0:s[0])==null?void 0:a.object,l=>l.isSculptObject);return r&&!r.editing?this.emit("click",o,r):!1}),window.__SCULPT_DEBUG__=this,window.__SCULPT_MODULES_DEBUG__=cs.modules}get data(){return{items:this.items.map(e=>{try{return e.data}catch(i){return console.error(i),null}}).filter(ke)}}get items(){return this.group.children}load(e,i){var o;this.clear();const s=(o=e==null?void 0:e.items)==null?void 0:o.map(r=>{var l;const a=ie(x({},r),{style:x(x({},(l=this.theme)==null?void 0:l[r.type.toLowerCase()]),r.style)});return r.type==="Point"?new Ug(a,i):r.type==="line"?new cp(a,i):r.type==="Polyline"?new Wg(a,i):r.type==="Polygon"?new Xg(a,i):r.type==="Prism"?new Jg(a,i):r.type==="Rectangle"?new ep(a,i):r.type==="Circle"?new sp(a,i):r.type==="Cylinder"?new rp(a,i):r.type==="Box"?new lp(a,i):null});this.group.add(...s),this.five.needsRender=!0}getItemById(e){return this.items.find(i=>i.uuid===e)}putObject(e){var o;this.group.add(e);const i=cs.modules.object3DHelper,s=i.addObject3DHelper(e);return(o=s==null?void 0:s.moveController)==null||o.moveByMouse(),i}createPoint(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.point,e[0]),this.createItem(Ug,...e)})}createLine(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.line,e[0]),this.createItem(cp,...e)})}createline(...e){return H(this,null,function*(){this.createLine(...e)})}createPolyline(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.polyline,e[0]),this.createItem(Wg,...e)})}createPolygon(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.polygon,e[0]),this.createItem(Xg,...e)})}createPrism(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.prism,e[0]),this.createItem(Jg,...e)})}createRectangle(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.rectangle,e[0]),this.createItem(ep,...e)})}createCircle(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.circle,e[0]),this.createItem(sp,...e)})}createCylinder(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.cylinder,e[0]),this.createItem(rp,...e)})}createBox(...e){return H(this,null,function*(){var i,s;return Object.assign((i=e[0])!=null?i:{},(s=this.theme)==null?void 0:s.box,e[0]),this.createItem(lp,...e)})}canUndo(){var e;return this.creatingItem?(e=this.creatingItem)==null?void 0:e.canUndo():!1}canRedo(){var e;return this.creatingItem?(e=this.creatingItem)==null?void 0:e.canRedo():!1}clear(){Ox(this.items,e=>e.delete()),this.five.needsRender=!0}createItem(e,...i){return H(this,null,function*(){this.creatingItem&&(this.creatingItem.stopCreating(),this.creatingItem=null);const s=new e;this.creatingItem=s,this.group.add(s);const{promise:o,resolve:r,reject:a}=dn();return yield s.create(...i).then((...l)=>(this.creatingItem=null,r(s),l)).catch(l=>{a(l),this.group.remove(s)}),o})}};let Je=cs;d(Je,"modules",zg);const Vx=n=>new Je(n);function Bx(n,...t){t.forEach(e=>{n.children.includes(e)||e&&n.add(e)})}let Tr;const hp=n=>((!Tr||n!==Tr.five)&&(Tr={instance:new Ss(n,{noEmitWhenHide:!0,noEmitWhenNotInScene:!0}),five:n}),Tr.instance);class dp extends ht{constructor(e){var s,o;super();d(this,"type");d(this,"tag");d(this,"rawData");d(this,"model");d(this,"visibles",[]);d(this,"five");d(this,"group");d(this,"fiveDomEvents");d(this,"disposers",[]);this.five=e.five,this.model=e.model,this.group=e.group,this.type=e.type,this.rawData=e.rawData,this.fiveDomEvents=hp(this.five);const i=(o=(s=e.position)!=null?s:this.model.center)!=null?o:xn(this.model).getCenter(new b.Vector3);this.tag=lh(this.five,i,{wrapper:e.tagWrapper}),this.tag.extraObjectsForIntersectCheck.push(this.group)}get container(){return this.tag.container}get state(){return{visible:this.model.visible,enabled:this.group.children.includes(this.model)}}show(){this.visibles[0]=!0,this.updateVisible(),this.emit("show")}hide(){this.visibles[0]=!1,this.updateVisible(),this.emit("hide")}enable(){Bx(this.group,this.model),this.five.needsRender=!0,this.model.updateMatrixWorld(!0),this.tag.setTransformMatrix(this.model.matrixWorld),this.tag.enable();const e=this.onClick.bind(this);this.fiveDomEvents.addEventListener(this.model,"click",e),this.disposers.push(()=>{this.fiveDomEvents.removeEventListener(this.model,"click")}),this.updateVisible(),this.emit("enable")}disable(){this.group.remove(this.model),this.five.needsRender=!0,this.tag.disable(),this.disposers.forEach(e=>e()),this.disposers=[],this.emit("disable")}updateVisible(){!this.visibles.some(i=>i===!1)?(this.tag.show(),this.model.visible=!0):(this.tag.hide(),this.model.visible=!1),this.five.needsRender=!0}onClick(){return this.emit("click",this)}}class up extends dp{constructor(...e){super(...e);d(this,"hideTag",()=>{this.tag.hide()});this.enable(),this.tag.hide(),this.updateVisible()}enable(){super.enable(),this.five.on("mode.change.request",this.hideTag),this.five.on("pano.request",this.hideTag)}disable(){super.disable(),this.five.off("mode.change.request",this.hideTag),this.five.off("pano.request",this.hideTag)}show(){super.show(),this.tag.hide()}onClick(){return this.tag.visible?this.tag.hide():this.tag.show({force:!0}),super.onClick(),!0}updateVisible(){!this.visibles.some(i=>i===!1)?this.model.visible=!0:(this.tag.hide(),this.model.visible=!1),this.five.needsRender=!0}}function _x(n){ge(n,"svelte-1q9fx3x",".model-maker-tag.svelte-1q9fx3x{position:absolute;width:-moz-max-content;width:max-content;left:50%;top:50%;transform:translate(-50%, -50%);color:#fff;font-size:0.875rem;font-weight:bold;text-shadow:0.125rem 0 0.5rem rgba(0, 0, 0, 0.15)}")}function fp(n){let t,e;return{c(){t=T("div"),e=Se(n[0]),P(t,"class","model-maker-tag svelte-1q9fx3x")},m(i,s){B(i,t,s),O(t,e)},p(i,s){s&1&&Te(e,i[0])},d(i){i&&V(t)}}}function Rx(n){let t,e=n[0]&&fp(n);return{c(){e&&e.c(),t=Ee()},m(i,s){e&&e.m(i,s),B(i,t,s)},p(i,[s]){i[0]?e?e.p(i,s):(e=fp(i),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:$,o:$,d(i){e&&e.d(i),i&&V(t)}}}function Fx(n,t,e){let{text:i}=t;return n.$$set=s=>{"text"in s&&e(0,i=s.text)},[i]}class Nx extends ue{constructor(t){super(),de(this,t,Fx,Rx,he,{text:0},_x)}}const mp=(n,t)=>{var i;const e=new Nx({target:n,props:{text:(i=t.rawData)==null?void 0:i.name}});return()=>e.$destroy()},Gx={box:mp,triangles:mp,prism:(n,t,e)=>{var s;const i=new Lg({target:n,props:{content:(s=t.rawData)==null?void 0:s.name,five:e}});return()=>i.$destroy()}};class gp extends dp{constructor(...e){const i=e[0],s=xn(i.model),o=new b.Vector3().lerpVectors(Si(s,0),Si(s,5),.5);super(ie(x({},i),{position:o}));d(this,"onModelShownFloorChange",e=>{this.updateFiveCurrentFloorState(e),this.updateVisible()});d(this,"updateFiveCurrentFloorState",e=>{var s,o;const i=(o=(s=this.rawData)==null?void 0:s.object_data)==null?void 0:o.floorIndex;Dt(i)?this.visibles[1]=!0:this.visibles[1]=e===null?!0:i===e});this.enable(),this.updateVisible(),this.five.on("modelShownFloorChange",this.onModelShownFloorChange),this.disposers.push(()=>{this.five.off("modelShownFloorChange",this.onModelShownFloorChange)})}show(){this.updateFiveCurrentFloorState(this.five.model.shownFloor),super.show()}hide(){super.hide()}}class Qx extends up{constructor(...e){super(...e);d(this,"onPanoArrived",e=>{this.updatePanoIndex(e),this.updateVisible()});d(this,"onModeChange",e=>{this.updateMode(e),this.updateVisible()});d(this,"updatePanoIndex",e=>{var i,s;this.visibles[1]=((s=(i=this.rawData)==null?void 0:i.object_data)==null?void 0:s.panoIndex)===e});d(this,"updateMode",e=>{this.visibles[2]=e==="Panorama"});this.updatePanoIndex(this.five.state.panoIndex),this.updateMode(this.five.state.mode),this.updateVisible(),this.five.on("panoArrived",this.onPanoArrived),this.five.on("modeChange",this.onModeChange),this.disposers.push(()=>{this.five.off("panoArrived",this.onPanoArrived),this.five.off("modeChange",this.onModeChange)})}show(){this.updatePanoIndex(this.five.state.panoIndex),this.updateMode(this.five.state.mode),super.show()}}class Wx extends wi{constructor(e,i){var s,o;super(e);d(this,"state");d(this,"items",[]);d(this,"group",new b.Group);d(this,"data");d(this,"tagRendererMap",{});d(this,"fiveDomEvents");d(this,"zFightingOffset",0);d(this,"tagWrapper");d(this,"occlusionVisibility");d(this,"occlusionMode");d(this,"fiveEveryReadyListenerDisposer");d(this,"onFiveModeChange",e=>{const i=this.occlusionVisibility;Array.isArray(i)&&this.items.forEach(s=>{s.model.setStyle instanceof Function&&s.model.setStyle({occlusionVisibility:i.includes(e)})})});d(this,"handleEnable",()=>{var e,i;this.five.scene.add(this.group),(i=(e=this.five.getElement())==null?void 0:e.parentElement)==null||i.appendChild(this.tagWrapper),this.five.needsRender=!0,this.onFiveModeChange(this.five.getCurrentState().mode),this.onFiveEveryReady(),this.five.on("modeChange",this.onFiveModeChange),this.fiveEveryReadyListenerDisposer=oa(this.five,this.onFiveEveryReady)});d(this,"handleDisable",()=>{this.five.scene.remove(this.group),this.tagWrapper.remove(),this.five.needsRender=!0,this.five.off("modeChange",this.onFiveModeChange),this.fiveEveryReadyListenerDisposer()});d(this,"onFiveEveryReady",()=>H(this,null,function*(){if(this.five.state.mode==="Panorama")return;const e=this.items.filter(l=>l instanceof gp).map(l=>l.tag),i=e.filter(l=>l.position&&l.visible&&l.enabled);yield Cg(0);const s=this.five.camera.position.clone(),o=i.sort((l,c)=>s.distanceTo(l.position)-s.distanceTo(c.position)),r=[],a=(l,c)=>!(l.right<c.left||l.left>c.right||l.bottom<c.top||l.top>c.bottom);e.forEach(l=>{l.visibles[2]=void 0}),o.forEach(l=>{if(l.visibles[1]===!1)return;const c=l.container.getElementsByClassName("room-label-item__text")[0];if(!c)return;const h=c.getBoundingClientRect();r.every(f=>!a(f.boundingClientRect,h))?(r.push({tag:l,boundingClientRect:h}),l.visibles[2]=!0):l.visibles[2]=!1,l.needsRender=!0})}));d(this,"updateTagRenderer",()=>{this.items.forEach(e=>{var s;const i=(s=this.tagRendererMap[e.type])!=null?s:Gx[e.type];i&&e.__renderer!==i&&(e.__renderer=i,typeof e.__disposeRenderer=="function"&&e.__disposeRenderer(),e.tag.container.innerHTML="",e.__disposeRenderer=i(e.tag.container,e,this.five))})});this.group.name="ModelMakerPluginGroup",this.state={enabled:!0,visible:!0},this.occlusionVisibility=(s=i==null?void 0:i.occlusionVisibility)!=null?s:!1,this.occlusionMode=(o=i==null?void 0:i.occlusionMode)!=null?o:"translucence",this.fiveDomEvents=hp(e),this.tagWrapper=(()=>{var a;const r=document.createElement("div");return r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.pointerEvents="none",r.style.zIndex=`${(a=i==null?void 0:i.tagContainerZIndex)!=null?a:""}`,r})(),e.scene.add(this.group),this.handleEnable(),window.__MODELMAKER_DEBUG__=this}load(e){return H(this,null,function*(){var s;if(this.clear(),this.data=e,yield ni(this.five),this.data!==e)return;this.clear();const i=o=>{var a;const r=o.object_data.color?new b.Color().setHex(parseInt(o.object_data.color.slice(1),16)):new b.Color(1,1,1);return{color:r,lineColor:r,opacity:((a=o.object_data.opacity)!=null?a:.4)/2,lineOpacity:1,lineWidth:1,occlusionVisibility:typeof this.occlusionVisibility=="boolean"?this.occlusionVisibility:!1,occlusionMode:this.occlusionMode}};(s=e==null?void 0:e.list)==null||s.forEach(o=>{var r;if(o.type==="triangles"){const a=new Yg;a.setPoints(o.object_data.points),a.setStyle(i(o)),this.fiveDomEvents.addEventListener(a,"hover",()=>a.highlight()),this.fiveDomEvents.addEventListener(a,"unHover",()=>a.unhighlight());const l=new Qx({five:this.five,tagWrapper:this.tagWrapper,model:a,group:this.group,type:o.type,rawData:o});this.items.push(l)}else if(o.type==="prism"){const a=new ls;this.zFightingOffset+=Ns.Z_FIGHTING_OFFSET;const l=o.object_data.points.map(f=>{var m;return[f[0],f[1]+((m=o.object_data.fixedY)!=null?m:0),f[2]]});l.push(l[0]);const c=o.object_data.height+((r=o.object_data.fixedHeight)!=null?r:0)+this.zFightingOffset,h=De(l[0]).add(new b.Vector3().setY(c));a.setPoints({points:l,heightPoint:h}),a.setStyle(i(o));const u=new gp({five:this.five,tagWrapper:this.tagWrapper,model:a,group:this.group,type:o.type,rawData:o});this.items.push(u)}else if(o.type==="box"){const a=new ls,{start:l,end:c,rotation:h=[0,0,0,0]}=o.object_data,u=new b.Vector3().fromArray(l),f=new b.Vector3().fromArray(c),m=new b.Euler().fromArray(h),v=new b.Quaternion().setFromEuler(m),p=v.clone().inverse(),g=new b.Vector3().lerpVectors(u,f,.5),A=g.clone().negate(),w=u.clone().add(A).applyQuaternion(p),I=f.clone().add(A).applyQuaternion(p),C=new b.Box3(w.clone().max(I),w.clone().min(I));a.setPoints({points:[Si(C,2),Si(C,3),Si(C,7),Si(C,6)],heightPoint:Si(C,1)}),a.position.copy(g),a.quaternion.copy(v),a.setStyle(i(o));const M=new up({five:this.five,tagWrapper:this.tagWrapper,model:a,group:this.group,type:o.type,rawData:o});this.items.push(M)}}),this.state.enabled?this.handleEnable():this.handleDisable(),this.state.visible?this.handleShow():this.handleHide(),this.updateTagRenderer(),this.hooks.emit("dataLoaded",e),this.five.needsRender=!0})}setState(e){ke(e.enabled)&&this.state.enabled!==e.enabled&&(this.state.enabled=e.enabled,e.enabled?this.handleEnable():this.handleDisable(),this.hooks.emit(e.enabled?"enable":"disable",{userAction:"我不知道捏"}),this.hooks.emit("stateChange",{state:this.state,userAction:"我不知道捏"})),ke(e.visible)&&this.state.visible!==e.visible&&(this.state.visible=e.visible,e.visible?this.handleShow():this.handleHide(),this.hooks.emit(e.visible?"show":"hide",{userAction:"我不知道捏"}),this.hooks.emit("stateChange",{state:this.state,userAction:"我不知道捏"}))}getItemById(e){return this.items.find(i=>i.rawData.id===e)}registerTagRenderer(e){this.tagRendererMap=x(x({},this.tagRendererMap),e),this.updateTagRenderer()}hasCustomTagRenderer(e){return!!this.tagRendererMap[e]}enable(){this.setState({enabled:!0})}disable(){this.setState({enabled:!1})}show(){this.setState({visible:!0})}hide(){this.setState({visible:!1})}clear(){this.zFightingOffset=0,this.handleDisable(),this.group.children.length=0,this.five.needsRender=!0,this.items=[],this.tagWrapper.innerHTML="",this.fiveDomEvents.clear()}dispose(){this.hooks.emit("dispose"),this.clear()}onWorkCodeChange(){this.group.matrix.copy(this.workUtil.transform.clone()),this.group.matrix.decompose(this.group.position,this.group.quaternion,this.group.scale),this.group.updateMatrixWorld()}handleShow(){this.group.visible=!0,this.tagWrapper.style.display="block",this.five.needsRender=!0}handleHide(){this.group.visible=!1,this.tagWrapper.style.display="none",this.five.needsRender=!0}}const Hx=(...n)=>new Wx(...n),Ux=Object.freeze(Object.defineProperty({__proto__:null,BetterTween:Dn,FiveDomEvents:Ss,FivePuppet:Wv,Interval:$r,LightTag:Di,LineSegments:wh,Magnifier:ko,Object3D:yh,PointHelper:bh,PointSelector:ca,PointSelectorHelper:mh,Rectangle:Up,absoluteUrl:ma,animeMap:xs,awaitNextFrame:Vv,blink:To,bounding:da,boundingBox:xn,boundingSphere:Ch,boxVertex:Si,boxVertexes:Dv,checkFiveModelLoaded:jv,convexHull:Yp,equal:wt,fiveModelIsLoaded:kh,getCoordsFromClient:Kp,getCoordsFromElement:$p,getFrameTime:Bv,inside:oh,isAbsoluteURL:Dh,isModelLike:Wt,isNil:Dt,isPanoramaLike:Ji,lookObject:zv,lookPoint:Eh,nextFrame:Ts,notNil:ke,pointInPolygon:oh,reblink:Mh,requestAnimationFrameInterval:Ln,sculpt:Object.freeze(Object.defineProperty({__proto__:null,BaseEditor:Er,BoxMesh:cc,BoxMeshEditor:ap,CircleMesh:np,CircleMeshEditor:tp,CircleWithEdgeMesh:io,CylinderMesh:ac,CylinderMeshEditor:op,LineMesh:Ht,PointMesh:as,PolygonMesh:sc,PrismMesh:ls,PrismMeshEditor:Zg,RectangleMesh:Kg,RectangleMeshEditor:qg,RectangleWithEdgeMesh:Dr,createBox:hc,createCircle:Lr,createCylinder:lc,createLine:dc,createPoint:ic,createPolygon:xr,createPrism:rc,createRectangle:Sr},Symbol.toStringTag,{value:"Module"})),tag:lh,tweenProgress:Ls,uuid:ct,waitFiveModelLoaded:ni,worldBounding:Lo,worldBoundingBox:Sv,worldBoundingSphere:Ph},Symbol.toStringTag,{value:"Module"}));Pp(),Cp(),K.AreaMakerPlugin=rx,K.CSS3DRender=jn,K.CSS3DRenderPlugin=Oo,K.CameraMovementEffect=Jd,K.CameraMovementPlugin=y1,K.ContentType=xf,K.CruisePlugin=GE,K.CruisePluginController=Us,K.CruisePluginTypes=NE,K.CurrentPanoImagePlugin=lx,K.DIRECTION=$n,K.DISPLAY_STRATEGY_TYPE=an,K.DimensionType=Df,K.FLOOR_PLAN_ATTACHED_TO=Vi,K.FLOOR_TYPE_MAP=h1,K.GuideLineItem=_E,K.GuideLineModeItem=TE,K.GuideLinePlugin=Tl,K.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=ln,K.ItemLabelPlugin=cC,K.Magnifier=ko,K.MapviewFloorplanPlugin=Rb,K.ModelChassisCompassPlugin=f1,K.ModelEntryDoorGuidePlugin=p1,K.ModelFloorplanPlugin=Ob,K.ModelItemLabelPlugin=Nw,K.ModelMakerPlugin=Hx,K.ModelRoomLabelPlugin=H0,K.ModelTVVideoPlugin=Uw,K.ModelViewPlugin=Rp,K.MoveController=Sl,K.MovePlugin=QE,K.Object3DHelperController=Ql,K.Object3DHelperPlugin=xk,K.PLUGIN=Ir,K.PaintBrush=_p,K.PaintBrushTypeEnum=gi,K.PanoCompassPlugin=G1,K.PanoCursorRaycasterPlugin=t0,K.PanoDoorLabelPlugin=wC,K.PanoFloorplanRadarPlugin=l1,K.PanoMeasurePlugin=mw,K.PanoMeasurePluginLine=nn,K.PanoMeasurePluginModel=Ja,K.PanoMeasurePluginPoint=Vt,K.PanoMeasurePluginPolyline=sn,K.PanoRulerPlugin=E1,K.PanoRulerProPlugin=B1,K.PanoSpatialTagPlugin=Dw,K.PanoTagPlugin=PE,K.PanoTagPluginController=wr,K.PanoVideoPlugin=jk,K.PanoVideoPluginType=zk,K.PipelinePlugin=qk,K.PointType=kf,K.ROOM_FETILE_TYPE_MAP=c1,K.ROOM_TYPE_MAP=d1,K.Rotation=ai,K.Sculpt=Je,K.SculptPlugin=Vx,K.TopviewFloorplanPlugin=Nb,K.Util=Ux,K.WalkController=Us,K.createBox=hc,K.createCircle=Lr,K.createCylinder=lc,K.createLine=dc,K.createPoint=ic,K.createPolygon=xr,K.createPolyline=Hg,K.createPrism=rc,K.createRectangle=Sr,K.defaultGlobalConfig=Ef,K.itemLabelPluginServerParams=hC,K.modelItemLabelPluginServerParams=Gw,K.modelRoomLabelPluginServerParams=U0,K.pluginFlag=CE,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});