@realsee/dnalogel 2.0.0-alpha.7 → 2.0.0-beta.36

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 (605) hide show
  1. package/README.md +78 -28
  2. package/components/index.js +1450 -0
  3. package/dist/CSS3DRenderPlugin/Plugin.d.ts +49 -0
  4. package/dist/CSS3DRenderPlugin/index.d.ts +4 -0
  5. package/dist/CSS3DRenderPlugin/index.js +234 -0
  6. package/dist/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
  7. package/dist/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
  8. package/dist/CameraMovementPlugin/index.d.ts +5 -0
  9. package/dist/CameraMovementPlugin/index.js +302 -0
  10. package/dist/CameraMovementPlugin/typing.d.ts +68 -0
  11. package/dist/ItemLabelPlugin/Plugin.d.ts +4 -0
  12. package/dist/ItemLabelPlugin/events.type.d.ts +9 -0
  13. package/dist/ItemLabelPlugin/index.d.ts +9 -0
  14. package/dist/ItemLabelPlugin/index.js +941 -0
  15. package/dist/ItemLabelPlugin/typings.d.ts +59 -0
  16. package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
  17. package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
  18. package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
  19. package/dist/ItemLabelPlugin/utils/parseData.d.ts +3 -0
  20. package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
  21. package/dist/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
  22. package/dist/ModelChassisCompassPlugin/index.d.ts +4 -0
  23. package/dist/ModelChassisCompassPlugin/index.js +145 -0
  24. package/dist/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
  25. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +4 -0
  26. package/dist/ModelEntryDoorGuidePlugin/index.js +196 -0
  27. package/dist/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
  28. package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
  29. package/dist/ModelItemLabelPlugin/index.d.ts +9 -0
  30. package/dist/ModelItemLabelPlugin/index.js +674 -0
  31. package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
  32. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
  33. package/dist/ModelRoomLabelPlugin/Assets/roomLabelBg.d.ts +1 -0
  34. package/dist/ModelRoomLabelPlugin/Controller.d.ts +36 -0
  35. package/dist/ModelRoomLabelPlugin/index.d.ts +12 -0
  36. package/dist/ModelRoomLabelPlugin/index.js +541 -0
  37. package/dist/ModelRoomLabelPlugin/typings.d.ts +35 -0
  38. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
  39. package/dist/ModelTVVideoPlugin/Plugin.d.ts +4 -0
  40. package/dist/ModelTVVideoPlugin/index.d.ts +5 -0
  41. package/dist/ModelTVVideoPlugin/index.js +301 -0
  42. package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
  43. package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
  44. package/dist/ModelViewPlugin/Plugin.d.ts +17 -0
  45. package/dist/ModelViewPlugin/index.d.ts +4 -0
  46. package/dist/ModelViewPlugin/index.js +187 -0
  47. package/dist/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
  48. package/dist/PanoCompassPlugin/Plugin.d.ts +47 -0
  49. package/dist/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
  50. package/dist/PanoCompassPlugin/index.d.ts +8 -0
  51. package/dist/PanoCompassPlugin/index.js +636 -0
  52. package/dist/PanoCursorRaycasterPlugin/index.d.ts +48 -0
  53. package/dist/PanoCursorRaycasterPlugin/index.js +90 -0
  54. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +39 -0
  55. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
  56. package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
  57. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
  58. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +26 -0
  59. package/dist/PanoMeasurePlugin/Controller/index.d.ts +70 -0
  60. package/dist/PanoMeasurePlugin/Model/index.d.ts +38 -0
  61. package/dist/PanoMeasurePlugin/Model/line.d.ts +30 -0
  62. package/dist/PanoMeasurePlugin/Model/point.d.ts +16 -0
  63. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
  64. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
  65. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
  66. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
  67. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +25 -0
  68. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
  69. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
  70. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +59 -0
  71. package/dist/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
  72. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
  73. package/dist/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
  74. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +13 -0
  75. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +20 -0
  76. package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  77. package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +19 -0
  78. package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
  79. package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
  80. package/dist/PanoMeasurePlugin/index.d.ts +10 -0
  81. package/dist/PanoMeasurePlugin/index.js +3996 -0
  82. package/dist/PanoMeasurePlugin/typings/data.d.ts +32 -0
  83. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +37 -0
  84. package/dist/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
  85. package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
  86. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
  87. package/dist/PanoMeasurePlugin/utils/constants.d.ts +4 -0
  88. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
  89. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
  90. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
  91. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
  92. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
  93. package/dist/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
  94. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
  95. package/dist/PanoMeasurePlugin/utils/line.d.ts +17 -0
  96. package/dist/PanoMeasurePlugin/utils/math.d.ts +17 -0
  97. package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
  98. package/dist/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
  99. package/dist/PanoRulerPlugin/Plugin.d.ts +31 -0
  100. package/dist/PanoRulerPlugin/index.d.ts +5 -0
  101. package/dist/PanoRulerPlugin/index.js +610 -0
  102. package/dist/PanoRulerPlugin/style.d.ts +2 -0
  103. package/dist/PanoRulerPlugin/typings.d.ts +21 -0
  104. package/dist/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
  105. package/dist/PanoSpatialTagPlugin/index.d.ts +5 -0
  106. package/dist/PanoSpatialTagPlugin/index.js +1307 -0
  107. package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
  108. package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
  109. package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
  110. package/dist/base/BasePlugin.d.ts +100 -0
  111. package/dist/base/BasePluginWithData.d.ts +34 -0
  112. package/dist/components/PaintBrush/Controller.d.ts +43 -0
  113. package/dist/components/PaintBrush/Subscribe.d.ts +76 -0
  114. package/dist/components/PaintBrush/index.d.ts +27 -0
  115. package/dist/components/PaintBrush/style.d.ts +2 -0
  116. package/dist/components/PaintBrush/tween.d.ts +62 -0
  117. package/dist/components/PaintBrush/typings.d.ts +58 -0
  118. package/dist/components/PaintBrush/utils.d.ts +26 -0
  119. package/dist/components/index.d.ts +2 -0
  120. package/dist/floorplan/Assets/camera.d.ts +1 -0
  121. package/dist/floorplan/Assets/compass.d.ts +1 -0
  122. package/dist/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
  123. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +97 -0
  124. package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +7 -0
  125. package/dist/floorplan/ModelFloorplanPlugin/index.js +4526 -0
  126. package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
  127. package/dist/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
  128. package/dist/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
  129. package/dist/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
  130. package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +36 -0
  131. package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +7 -0
  132. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +2008 -0
  133. package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
  134. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +67 -0
  135. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +7 -0
  136. package/dist/floorplan/TopviewFloorplanPlugin/index.js +4236 -0
  137. package/dist/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
  138. package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
  139. package/dist/floorplan/constant.d.ts +5 -0
  140. package/dist/floorplan/index.d.ts +6 -0
  141. package/dist/floorplan/typings/floorplanData.d.ts +137 -0
  142. package/dist/floorplan/typings/floorplanServerData.d.ts +131 -0
  143. package/dist/floorplan/typings/utility.d.ts +2 -0
  144. package/dist/floorplan/utils/constant.d.ts +22 -0
  145. package/dist/floorplan/utils/correctFiveState.d.ts +15 -0
  146. package/dist/floorplan/utils/formatData.d.ts +5 -0
  147. package/dist/floorplan/utils/formatPosition.d.ts +36 -0
  148. package/dist/index.d.ts +15 -0
  149. package/dist/index.es.js +15436 -0
  150. package/dist/index.js +15488 -0
  151. package/dist/index.umd.js +15480 -0
  152. package/dist/shared-utils/Preloader.d.ts +6 -0
  153. package/dist/shared-utils/Subscribe.d.ts +45 -0
  154. package/dist/shared-utils/animationFrame/BetterTween.d.ts +11 -0
  155. package/dist/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
  156. package/dist/shared-utils/animationFrame/formatRad.d.ts +15 -0
  157. package/dist/shared-utils/animationFrame/index.d.ts +15 -0
  158. package/dist/shared-utils/animationFrame/tween.d.ts +75 -0
  159. package/dist/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
  160. package/dist/shared-utils/createCanvasTextTexture.d.ts +8 -0
  161. package/dist/shared-utils/createLine/index.d.ts +3 -0
  162. package/dist/shared-utils/debounce.d.ts +6 -0
  163. package/dist/shared-utils/equal.d.ts +11 -0
  164. package/dist/shared-utils/filter.d.ts +27 -0
  165. package/dist/shared-utils/five/changeMode.d.ts +5 -0
  166. package/dist/shared-utils/formatRad.d.ts +7 -0
  167. package/dist/shared-utils/getPxmm.d.ts +19 -0
  168. package/dist/shared-utils/getRandomColor.d.ts +1 -0
  169. package/dist/shared-utils/index.d.ts +1 -0
  170. package/dist/shared-utils/isNil.d.ts +10 -0
  171. package/dist/shared-utils/isTruelyObject.d.ts +18 -0
  172. package/dist/shared-utils/math/Interval.d.ts +13 -0
  173. package/dist/shared-utils/math/Rectangle.d.ts +27 -0
  174. package/dist/shared-utils/math/evenNumber.d.ts +3 -0
  175. package/dist/shared-utils/math/index.d.ts +2 -0
  176. package/dist/shared-utils/math/planimetry.d.ts +116 -0
  177. package/dist/shared-utils/math/rad2Deg.d.ts +1 -0
  178. package/dist/shared-utils/nearlyEqual.d.ts +7 -0
  179. package/dist/shared-utils/nextFrame.d.ts +1 -0
  180. package/dist/shared-utils/noop.d.ts +5 -0
  181. package/dist/shared-utils/object3d2LocalMatrix.d.ts +12 -0
  182. package/dist/shared-utils/px2rem.d.ts +1 -0
  183. package/dist/shared-utils/removeArrayItem.d.ts +7 -0
  184. package/dist/shared-utils/tap.d.ts +8 -0
  185. package/dist/shared-utils/three/centerPoint.d.ts +2 -0
  186. package/dist/shared-utils/three/getExtraModelLoader.d.ts +6 -0
  187. package/dist/shared-utils/three/getNormal.d.ts +2 -0
  188. package/dist/shared-utils/three/getTextureLoader.d.ts +6 -0
  189. package/dist/shared-utils/three/loadFbxObj.d.ts +2 -0
  190. package/dist/shared-utils/three/loadTexture.d.ts +2 -0
  191. package/dist/shared-utils/three/transformPositionToVector3.d.ts +7 -0
  192. package/dist/shared-utils/three/transfromToMeshBasicMaterial.d.ts +2 -0
  193. package/dist/shared-utils/throttle.d.ts +7 -0
  194. package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
  195. package/dist/shared-utils/to.d.ts +8 -0
  196. package/dist/shared-utils/uuid.d.ts +5 -0
  197. package/dist/shared-utils/vectorTocoordinates.d.ts +7 -0
  198. package/dist/typings/math.type.d.ts +44 -0
  199. package/dist/typings/utils.type.d.ts +2 -0
  200. package/docs/.nojekyll +1 -0
  201. package/docs/assets/highlight.css +78 -0
  202. package/docs/assets/icons.css +1043 -0
  203. package/docs/assets/icons.png +0 -0
  204. package/docs/assets/icons@2x.png +0 -0
  205. package/docs/assets/main.js +52 -0
  206. package/docs/assets/search.js +1 -0
  207. package/docs/assets/style.css +1413 -0
  208. package/docs/assets/widgets.png +0 -0
  209. package/docs/assets/widgets@2x.png +0 -0
  210. package/docs/classes/Magnifier.html +9 -0
  211. package/docs/classes/ModelRoomLabelController.html +17 -0
  212. package/docs/enums/CameraMovementEffect.html +3 -0
  213. package/docs/enums/DIRECTION.html +1 -0
  214. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -0
  215. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -0
  216. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -0
  217. package/docs/enums/Rotation.html +3 -0
  218. package/docs/index.html +88 -0
  219. package/docs/interfaces/CSS3DRenderPluginExportType.html +4 -0
  220. package/docs/interfaces/CameraMovementPluginExportType.html +17 -0
  221. package/docs/interfaces/FloorplanBounding.html +10 -0
  222. package/docs/interfaces/FloorplanData.html +3 -0
  223. package/docs/interfaces/FloorplanEntrance.html +15 -0
  224. package/docs/interfaces/FloorplanExtraObject.html +7 -0
  225. package/docs/interfaces/FloorplanExtraObject3D.html +3 -0
  226. package/docs/interfaces/FloorplanFloorData.html +3 -0
  227. package/docs/interfaces/FloorplanImagePosition.html +3 -0
  228. package/docs/interfaces/FloorplanObserver.html +5 -0
  229. package/docs/interfaces/FloorplanOutlineItem.html +3 -0
  230. package/docs/interfaces/FloorplanPosition.html +3 -0
  231. package/docs/interfaces/FloorplanRoomItem.html +17 -0
  232. package/docs/interfaces/FloorplanRoomLabelItem.html +7 -0
  233. package/docs/interfaces/FloorplanServerBounding.html +10 -0
  234. package/docs/interfaces/FloorplanServerComputedData.html +1 -0
  235. package/docs/interfaces/FloorplanServerData.html +3 -0
  236. package/docs/interfaces/FloorplanServerEntrance.html +15 -0
  237. package/docs/interfaces/FloorplanServerFloorData.html +3 -0
  238. package/docs/interfaces/FloorplanServerImagePosition.html +3 -0
  239. package/docs/interfaces/FloorplanServerObserver.html +5 -0
  240. package/docs/interfaces/FloorplanServerOutlineItem.html +3 -0
  241. package/docs/interfaces/FloorplanServerPosition.html +3 -0
  242. package/docs/interfaces/FloorplanServerRoomItem.html +20 -0
  243. package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -0
  244. package/docs/interfaces/ItemLabelPluginData.html +1 -0
  245. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -0
  246. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -0
  247. package/docs/interfaces/LineJson.html +1 -0
  248. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -0
  249. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -0
  250. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -0
  251. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -0
  252. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -0
  253. package/docs/interfaces/ModelItemLabelPluginData.html +1 -0
  254. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -0
  255. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -0
  256. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -0
  257. package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
  258. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
  259. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
  260. package/docs/interfaces/ModelViewPluginExportType.html +1 -0
  261. package/docs/interfaces/OpenParameter.html +3 -0
  262. package/docs/interfaces/PanoCompassPluginData.html +1 -0
  263. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -0
  264. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +11 -0
  265. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -0
  266. package/docs/interfaces/PanoMeasureParameterType.html +1 -0
  267. package/docs/interfaces/PanoRulerPluginExportType.html +1 -0
  268. package/docs/interfaces/PanoRulerPluginOptions.html +1 -0
  269. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -0
  270. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -0
  271. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
  272. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
  273. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -0
  274. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
  275. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -0
  276. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
  277. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -0
  278. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -0
  279. package/docs/interfaces/Point.html +1 -0
  280. package/docs/interfaces/PointJson.html +1 -0
  281. package/docs/interfaces/Room.html +1 -0
  282. package/docs/interfaces/RoomInfo.html +1 -0
  283. package/docs/interfaces/RoomLabel.html +13 -0
  284. package/docs/interfaces/RoomRules.html +1 -0
  285. package/docs/interfaces/Rooms.html +1 -0
  286. package/docs/modules.html +34 -0
  287. package/libs/CSS3DRenderPlugin/Plugin.d.ts +49 -0
  288. package/libs/CSS3DRenderPlugin/Plugin.js +182 -0
  289. package/libs/CSS3DRenderPlugin/index.d.ts +3 -48
  290. package/libs/CSS3DRenderPlugin/index.js +2 -180
  291. package/libs/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
  292. package/libs/CameraMovementPlugin/CameraMovementPlugin.js +159 -0
  293. package/libs/CameraMovementPlugin/index.d.ts +4 -6
  294. package/libs/CameraMovementPlugin/index.js +3 -158
  295. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  296. package/libs/ItemLabelPlugin/ItemLabelComponent.js +577 -0
  297. package/libs/ItemLabelPlugin/ItemLabelItem.js +227 -0
  298. package/libs/ItemLabelPlugin/Plugin.d.ts +4 -0
  299. package/libs/ItemLabelPlugin/Plugin.js +120 -0
  300. package/libs/ItemLabelPlugin/events.type.d.ts +9 -0
  301. package/libs/ItemLabelPlugin/events.type.js +1 -0
  302. package/libs/ItemLabelPlugin/index.d.ts +9 -0
  303. package/libs/ItemLabelPlugin/index.js +8 -0
  304. package/libs/ItemLabelPlugin/typings.d.ts +59 -0
  305. package/libs/ItemLabelPlugin/typings.js +7 -0
  306. package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
  307. package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
  308. package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
  309. package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
  310. package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
  311. package/libs/ItemLabelPlugin/utils/isImpacted.js +13 -0
  312. package/libs/ItemLabelPlugin/utils/parseData.d.ts +3 -0
  313. package/libs/ItemLabelPlugin/utils/parseData.js +4 -0
  314. package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
  315. package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
  316. package/libs/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
  317. package/libs/ModelChassisCompassPlugin/Plugin.js +77 -0
  318. package/libs/ModelChassisCompassPlugin/index.d.ts +3 -18
  319. package/libs/ModelChassisCompassPlugin/index.js +2 -74
  320. package/libs/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
  321. package/libs/ModelEntryDoorGuidePlugin/Plugin.js +140 -0
  322. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
  323. package/libs/ModelEntryDoorGuidePlugin/index.js +2 -135
  324. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
  325. package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
  326. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
  327. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +120 -0
  328. package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
  329. package/libs/ModelItemLabelPlugin/events.type.js +1 -0
  330. package/libs/ModelItemLabelPlugin/index.d.ts +9 -0
  331. package/libs/ModelItemLabelPlugin/index.js +8 -0
  332. package/libs/ModelItemLabelPlugin/typings.d.ts +56 -0
  333. package/libs/ModelItemLabelPlugin/typings.js +7 -0
  334. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
  335. package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
  336. package/libs/ModelRoomLabelPlugin/Controller.js +67 -25
  337. package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +121 -0
  338. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +291 -0
  339. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  340. package/libs/ModelSimulationPlugin/index.d.ts +33 -0
  341. package/libs/ModelSimulationPlugin/index.js +166 -0
  342. package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
  343. package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
  344. package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
  345. package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
  346. package/libs/ModelTVVideoPlugin/Plugin.d.ts +4 -0
  347. package/libs/ModelTVVideoPlugin/Plugin.js +254 -0
  348. package/libs/ModelTVVideoPlugin/index.d.ts +5 -0
  349. package/libs/ModelTVVideoPlugin/index.js +4 -0
  350. package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
  351. package/libs/ModelTVVideoPlugin/typings.js +8 -0
  352. package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
  353. package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
  354. package/libs/ModelViewPlugin/Plugin.d.ts +17 -0
  355. package/libs/ModelViewPlugin/Plugin.js +160 -0
  356. package/libs/ModelViewPlugin/index.d.ts +3 -16
  357. package/libs/ModelViewPlugin/index.js +2 -159
  358. package/libs/PanoCompassPlugin/Plugin.d.ts +47 -0
  359. package/libs/PanoCompassPlugin/Plugin.js +249 -0
  360. package/libs/PanoCompassPlugin/index.d.ts +4 -47
  361. package/libs/PanoCompassPlugin/index.js +3 -167
  362. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  363. package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
  364. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
  365. package/libs/PanoMeasurePlugin/Controller/BaseController.js +77 -14
  366. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  367. package/libs/PanoMeasurePlugin/Controller/EditController.js +267 -154
  368. package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
  369. package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
  370. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  371. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
  372. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
  373. package/libs/PanoMeasurePlugin/Controller/WatchController.js +246 -153
  374. package/libs/PanoMeasurePlugin/Controller/index.d.ts +18 -9
  375. package/libs/PanoMeasurePlugin/Controller/index.js +182 -54
  376. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  377. package/libs/PanoMeasurePlugin/Model/index.js +30 -5
  378. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  379. package/libs/PanoMeasurePlugin/Model/line.js +61 -11
  380. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  381. package/libs/PanoMeasurePlugin/Model/point.js +24 -4
  382. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  383. package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
  384. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
  385. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
  386. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
  387. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
  388. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
  389. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +107 -25
  390. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  391. package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
  392. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  393. package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
  394. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
  395. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +234 -59
  396. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  397. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +84 -38
  398. package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
  399. package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
  400. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  401. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
  402. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
  403. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +84 -34
  404. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  405. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
  406. package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
  407. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +11 -1
  408. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
  409. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
  410. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
  411. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
  412. package/libs/PanoMeasurePlugin/index.d.ts +9 -6
  413. package/libs/PanoMeasurePlugin/index.js +3 -1
  414. package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
  415. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
  416. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
  417. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
  418. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  419. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  420. package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
  421. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  422. package/libs/PanoMeasurePlugin/utils/distanceDom.js +22 -16
  423. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  424. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  425. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  426. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  427. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  428. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  429. package/libs/PanoMeasurePlugin/utils/line.js +8 -7
  430. package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
  431. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -5
  432. package/libs/PanoRulerPlugin/Plugin.d.ts +31 -0
  433. package/libs/PanoRulerPlugin/Plugin.js +403 -0
  434. package/libs/PanoRulerPlugin/index.d.ts +4 -30
  435. package/libs/PanoRulerPlugin/index.js +2 -397
  436. package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
  437. package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
  438. package/libs/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
  439. package/libs/PanoSpatialTagPlugin/Plugin.js +426 -0
  440. package/libs/PanoSpatialTagPlugin/index.d.ts +5 -0
  441. package/libs/PanoSpatialTagPlugin/index.js +5 -0
  442. package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
  443. package/libs/PanoSpatialTagPlugin/store.js +2 -0
  444. package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
  445. package/libs/PanoSpatialTagPlugin/style.js +8 -0
  446. package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
  447. package/libs/PanoSpatialTagPlugin/typings.js +1 -0
  448. package/libs/base/BasePlugin.d.ts +100 -0
  449. package/libs/base/BasePlugin.js +31 -0
  450. package/libs/base/BasePluginWithData.d.ts +34 -0
  451. package/libs/base/BasePluginWithData.js +4 -0
  452. package/libs/components/PaintBrush/Controller.d.ts +43 -0
  453. package/libs/components/PaintBrush/Controller.js +575 -0
  454. package/libs/components/PaintBrush/Subscribe.d.ts +76 -0
  455. package/libs/components/PaintBrush/Subscribe.js +121 -0
  456. package/libs/components/PaintBrush/index.d.ts +27 -0
  457. package/libs/components/PaintBrush/index.js +57 -0
  458. package/libs/components/PaintBrush/style.d.ts +2 -0
  459. package/libs/components/PaintBrush/style.js +102 -0
  460. package/libs/components/PaintBrush/tween.d.ts +62 -0
  461. package/libs/components/PaintBrush/tween.js +15 -0
  462. package/libs/components/PaintBrush/typings.d.ts +58 -0
  463. package/libs/components/PaintBrush/typings.js +6 -0
  464. package/libs/components/PaintBrush/utils.d.ts +26 -0
  465. package/libs/components/PaintBrush/utils.js +51 -0
  466. package/libs/components/index.d.ts +2 -0
  467. package/libs/components/index.js +3 -0
  468. package/libs/floorplan/Assets/compass.d.ts +1 -0
  469. package/libs/floorplan/Assets/compass.js +1 -0
  470. package/libs/floorplan/Components/BaseImage.js +222 -0
  471. package/libs/floorplan/Components/Camera.js +120 -0
  472. package/libs/floorplan/Components/Compass.js +120 -0
  473. package/libs/floorplan/Components/CurrentFloor.js +469 -0
  474. package/libs/floorplan/Components/Main.js +470 -0
  475. package/libs/floorplan/Components/Normalmage.js +63 -0
  476. package/libs/floorplan/Components/RoomHighlight/Room.js +107 -0
  477. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +216 -0
  478. package/libs/floorplan/Components/RoomLabels/RoomLabel.js +322 -0
  479. package/libs/floorplan/Components/RoomLabels/RoomLabels.js +309 -0
  480. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +331 -0
  481. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +64 -0
  482. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +104 -0
  483. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +142 -0
  484. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  485. package/libs/floorplan/Components/RuleLabels/RuleLabels.js +269 -0
  486. package/libs/floorplan/Components/SvgImage.js +83 -0
  487. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +120 -0
  488. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +106 -0
  489. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +463 -0
  490. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +375 -0
  491. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +171 -0
  492. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +265 -0
  493. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +301 -0
  494. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +219 -0
  495. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
  496. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +661 -326
  497. package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
  498. package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
  499. package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
  500. package/libs/floorplan/ModelFloorplanPlugin/typing.js +1 -0
  501. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +168 -0
  502. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +250 -0
  503. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +154 -0
  504. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +373 -0
  505. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
  506. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +195 -43
  507. package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
  508. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
  509. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
  510. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
  511. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
  512. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +450 -154
  513. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
  514. package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
  515. package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
  516. package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
  517. package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
  518. package/libs/floorplan/index.d.ts +6 -0
  519. package/libs/floorplan/index.js +7 -0
  520. package/libs/floorplan/utils/constant.d.ts +22 -0
  521. package/libs/floorplan/utils/constant.js +23 -0
  522. package/libs/floorplan/utils/correctFiveState.d.ts +15 -0
  523. package/libs/floorplan/utils/correctFiveState.js +46 -0
  524. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  525. package/libs/floorplan/utils/formatPosition.js +3 -3
  526. package/libs/index.d.ts +15 -24
  527. package/libs/index.js +25 -14
  528. package/libs/shared-utils/Subscribe.js +8 -1
  529. package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
  530. package/libs/shared-utils/createCanvasTextTexture.js +6 -5
  531. package/libs/shared-utils/five/changeMode.d.ts +4 -1
  532. package/libs/shared-utils/five/changeMode.js +34 -13
  533. package/libs/shared-utils/getPxmm.d.ts +8 -0
  534. package/libs/shared-utils/getPxmm.js +25 -20
  535. package/libs/shared-utils/index.d.ts +1 -0
  536. package/libs/shared-utils/index.js +1 -0
  537. package/libs/shared-utils/math/Interval.d.ts +13 -0
  538. package/libs/shared-utils/math/Interval.js +40 -0
  539. package/libs/shared-utils/math/Rectangle.d.ts +27 -0
  540. package/libs/shared-utils/math/Rectangle.js +50 -0
  541. package/libs/shared-utils/math/evenNumber.js +1 -1
  542. package/libs/shared-utils/math/index.d.ts +2 -0
  543. package/libs/shared-utils/math/index.js +2 -0
  544. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  545. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  546. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  547. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  548. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
  549. package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
  550. package/libs/shared-utils/tinyEJSrender.js +210 -0
  551. package/libs/shared-utils/uuid.d.ts +1 -0
  552. package/libs/shared-utils/uuid.js +1 -0
  553. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  554. package/package.json +29 -14
  555. package/CHANGELOG.md +0 -21
  556. package/dist/dnalogel.cjs.js +0 -7
  557. package/dist/dnalogel.es.js +0 -41280
  558. package/dist/dnalogel.umd.js +0 -7
  559. package/dist/style.css +0 -1
  560. package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +0 -63
  561. package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte.map +0 -1
  562. package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +0 -80
  563. package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte.map +0 -1
  564. package/libs/floorplan/Components/BaseImage.svelte +0 -25
  565. package/libs/floorplan/Components/BaseImage.svelte.map +0 -1
  566. package/libs/floorplan/Components/Normalmage.svelte +0 -11
  567. package/libs/floorplan/Components/Normalmage.svelte.map +0 -1
  568. package/libs/floorplan/Components/RoomHighlight/Room.svelte +0 -21
  569. package/libs/floorplan/Components/RoomHighlight/Room.svelte.map +0 -1
  570. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +0 -60
  571. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte.map +0 -1
  572. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +0 -35
  573. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte.map +0 -1
  574. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +0 -7
  575. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte.map +0 -1
  576. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +0 -16
  577. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte.map +0 -1
  578. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +0 -17
  579. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte.map +0 -1
  580. package/libs/floorplan/Components/SvgImage.svelte +0 -25
  581. package/libs/floorplan/Components/SvgImage.svelte.map +0 -1
  582. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +0 -46
  583. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +0 -1
  584. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte +0 -48
  585. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte.map +0 -1
  586. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -37
  587. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
  588. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte +0 -50
  589. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte.map +0 -1
  590. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte +0 -41
  591. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte.map +0 -1
  592. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte +0 -25
  593. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte.map +0 -1
  594. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte +0 -148
  595. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte.map +0 -1
  596. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte +0 -15
  597. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte.map +0 -1
  598. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +0 -84
  599. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte.map +0 -1
  600. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -18
  601. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
  602. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +0 -40
  603. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte.map +0 -1
  604. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +0 -61
  605. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte.map +0 -1
@@ -0,0 +1,4236 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var THREE = require('three');
6
+ var internal = require('svelte/internal');
7
+ var easing = require('svelte/easing');
8
+ var transition = require('svelte/transition');
9
+ var store = require('svelte/store');
10
+ var svelte = require('svelte');
11
+ var five = require('@realsee/five');
12
+
13
+ function _interopNamespace(e) {
14
+ if (e && e.__esModule) return e;
15
+ var n = Object.create(null);
16
+ if (e) {
17
+ Object.keys(e).forEach(function (k) {
18
+ if (k !== 'default') {
19
+ var d = Object.getOwnPropertyDescriptor(e, k);
20
+ Object.defineProperty(n, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function () { return e[k]; }
23
+ });
24
+ }
25
+ });
26
+ }
27
+ n["default"] = e;
28
+ return Object.freeze(n);
29
+ }
30
+
31
+ var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
32
+
33
+ /**
34
+ * 检查一个值是否是狭义上的对象
35
+ * @param {any} value 要检查的值
36
+ *
37
+ * isTruelyObject({})
38
+ * // => true
39
+ *
40
+ * isObjectLike([1, 2, 3])
41
+ * // => false
42
+ *
43
+ * isObjectLike(Function)
44
+ * // => false
45
+ *
46
+ * isObjectLike(null)
47
+ * // => false
48
+ *
49
+ */
50
+ function isTruelyObject(value) {
51
+ return Object.prototype.toString.call(value) === '[object Object]';
52
+ }
53
+
54
+ /* eslint-disable @typescript-eslint/no-use-before-define */
55
+ function baseIsEqual(value, other) {
56
+ if (value === other)
57
+ return true;
58
+ if (typeof value !== typeof other)
59
+ return false;
60
+ if (Number.isNaN(value) && Number.isNaN(other))
61
+ return true;
62
+ return false;
63
+ }
64
+ function objEqualShallow(value, other) {
65
+ const valueProps = Object.getOwnPropertyNames(value);
66
+ const otherProps = Object.getOwnPropertyNames(other);
67
+ if (valueProps.length !== otherProps.length)
68
+ return false;
69
+ for (let i = 0, len = valueProps.length; i < len; i++) {
70
+ const propName = valueProps[i];
71
+ if (!baseIsEqual(value[propName], other[propName]))
72
+ return false;
73
+ }
74
+ return true;
75
+ }
76
+ function arrayEqualShallow(value, other) {
77
+ if (value.length !== other.length)
78
+ return false;
79
+ for (let i = 0, len = value.length; i < len; i++) {
80
+ if (!baseIsEqual(value[i], other[i]))
81
+ return false;
82
+ }
83
+ return true;
84
+ }
85
+ function isShallowEqual(value, other) {
86
+ if (baseIsEqual(value, other))
87
+ return true;
88
+ if (isTruelyObject(value) && isTruelyObject(other))
89
+ return objEqualShallow(value, other);
90
+ if (Array.isArray(value) && Array.isArray(other))
91
+ return arrayEqualShallow(value, other);
92
+ return false;
93
+ }
94
+ function isDeepEqual(value, other) {
95
+ if (baseIsEqual(value, other))
96
+ return true;
97
+ if (isTruelyObject(value) && isTruelyObject(other))
98
+ return objEqualDeep(value, other);
99
+ if (Array.isArray(value) && Array.isArray(other))
100
+ return arrayEqualDeep(value, other);
101
+ return false;
102
+ }
103
+ function arrayEqualDeep(value, other) {
104
+ if (value.length !== other.length)
105
+ return false;
106
+ for (let i = 0, len = value.length; i < len; i++) {
107
+ if (!isDeepEqual(value[i], other[i]))
108
+ return false;
109
+ }
110
+ return true;
111
+ }
112
+ function objEqualDeep(value, other) {
113
+ const valueProps = Object.getOwnPropertyNames(value);
114
+ const otherProps = Object.getOwnPropertyNames(other);
115
+ if (valueProps.length !== otherProps.length)
116
+ return false;
117
+ for (let i = 0, len = valueProps.length; i < len; i++) {
118
+ const propName = valueProps[i];
119
+ if (!isDeepEqual(value[propName], other[propName]))
120
+ return false;
121
+ }
122
+ return true;
123
+ }
124
+ /**
125
+ * 对象比较
126
+ * @param {*} value 第一个比较的值
127
+ * @param {*} other 第二个比较的值
128
+ * @param {Object} options 可选参数,可选项包括:<br />
129
+ * deep {Boolean} 是否深比较<br />
130
+ * @returns {boolean} 是否相等
131
+ */
132
+ function equal(value, other, opt = { deep: false }) {
133
+ if (!opt.deep)
134
+ return isShallowEqual(value, other);
135
+ return isDeepEqual(value, other);
136
+ }
137
+
138
+ const CAMERA_IMAGE = 'data:image/png;base64,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';
139
+
140
+ function rad2Deg$1(rad) {
141
+ return (rad * 180) / Math.PI;
142
+ }
143
+
144
+ /* src/floorplan/Components/Camera.svelte generated by Svelte v3.47.0 */
145
+
146
+ function add_css$d(target) {
147
+ internal.append_styles(target, "svelte-17cl35n", ".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}");
148
+ }
149
+
150
+ function create_fragment$g(ctx) {
151
+ let div1;
152
+ let div0;
153
+
154
+ return {
155
+ c() {
156
+ div1 = internal.element("div");
157
+ div0 = internal.element("div");
158
+ internal.attr(div0, "class", "floorplan__camera-rotate svelte-17cl35n");
159
+ internal.set_style(div0, "background-image", `url(${/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE})`);
160
+ internal.set_style(div0, "width", /*domSizeStyle*/ ctx[4], false);
161
+ internal.set_style(div0, "height", /*domSizeStyle*/ ctx[4], false);
162
+ internal.set_style(div0, "left", '-' + /*domSizeStyle*/ ctx[4], false);
163
+ internal.set_style(div0, "top", '-' + /*domSizeStyle*/ ctx[4], false);
164
+ internal.set_style(div0, "transform", `rotate(${/*rotate*/ ctx[3]}deg)`, false);
165
+ internal.set_style(div0, "transform-origin", `${/*domSizeStyle*/ ctx[4]} ${/*domSizeStyle*/ ctx[4]}`, false);
166
+ internal.attr(div1, "class", "floorplan__camera-position svelte-17cl35n");
167
+ internal.set_style(div1, "left", /*positionLeft*/ ctx[1], false);
168
+ internal.set_style(div1, "top", /*positionTop*/ ctx[2], false);
169
+ },
170
+ m(target, anchor) {
171
+ internal.insert(target, div1, anchor);
172
+ internal.append(div1, div0);
173
+ },
174
+ p(ctx, [dirty]) {
175
+ if (dirty & /*cameraImageUrl*/ 1) {
176
+ internal.set_style(div0, "background-image", `url(${/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE})`);
177
+ }
178
+ },
179
+ i: internal.noop,
180
+ o: internal.noop,
181
+ d(detaching) {
182
+ if (detaching) internal.detach(div1);
183
+ }
184
+ };
185
+ }
186
+
187
+ function instance$g($$self, $$props, $$invalidate) {
188
+ let { panoIndex } = $$props;
189
+ let { floorplanData } = $$props;
190
+ let { lastPanoramaLongitude } = $$props;
191
+ let { cameraImageUrl } = $$props;
192
+ const { observers } = floorplanData;
193
+ const observer = observers[panoIndex];
194
+ const leftRatio = observer.positionInImage.x;
195
+ const topRatio = observer.positionInImage.y;
196
+ const positionLeft = leftRatio * 100 + '%';
197
+ const positionTop = topRatio * 100 + '%';
198
+ const rotate = -rad2Deg$1(lastPanoramaLongitude) + 45;
199
+
200
+ // TODO: 统一这里的判断条件,目前写了多处
201
+ const bodyWidth = document.body.clientWidth;
202
+
203
+ const bodyHeight = document.body.clientHeight;
204
+ const size = bodyWidth < 500 || bodyHeight < 500 ? 17 : 37;
205
+ const domSizeStyle = `${size / 16}rem`;
206
+
207
+ $$self.$$set = $$props => {
208
+ if ('panoIndex' in $$props) $$invalidate(5, panoIndex = $$props.panoIndex);
209
+ if ('floorplanData' in $$props) $$invalidate(6, floorplanData = $$props.floorplanData);
210
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(7, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
211
+ if ('cameraImageUrl' in $$props) $$invalidate(0, cameraImageUrl = $$props.cameraImageUrl);
212
+ };
213
+
214
+ return [
215
+ cameraImageUrl,
216
+ positionLeft,
217
+ positionTop,
218
+ rotate,
219
+ domSizeStyle,
220
+ panoIndex,
221
+ floorplanData,
222
+ lastPanoramaLongitude
223
+ ];
224
+ }
225
+
226
+ class Camera extends internal.SvelteComponent {
227
+ constructor(options) {
228
+ super();
229
+
230
+ internal.init(
231
+ this,
232
+ options,
233
+ instance$g,
234
+ create_fragment$g,
235
+ internal.safe_not_equal,
236
+ {
237
+ panoIndex: 5,
238
+ floorplanData: 6,
239
+ lastPanoramaLongitude: 7,
240
+ cameraImageUrl: 0
241
+ },
242
+ add_css$d
243
+ );
244
+ }
245
+ }
246
+
247
+ const COMPASS_IMAGE = 'data:image/png;base64,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';
248
+
249
+ /* src/floorplan/Components/Compass.svelte generated by Svelte v3.47.0 */
250
+
251
+ function add_css$c(target) {
252
+ internal.append_styles(target, "svelte-z9kwkx", ".floorplan-plugin__compass.svelte-z9kwkx{position:absolute;left:50%;top:-2.39583rem;width:12.03125rem;height:2.13542rem;will-change:opacity;transform-origin:center 9.58333rem}.floorplan-plugin__compass-image.svelte-z9kwkx{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-z9kwkx{position:absolute;left:50%;top:0.78125rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.52083rem;color:#fff}");
253
+ }
254
+
255
+ // (14:0) {#if canCompassShow}
256
+ function create_if_block$6(ctx) {
257
+ let div1;
258
+ let div0;
259
+ let t0;
260
+ let span;
261
+ let t1;
262
+
263
+ return {
264
+ c() {
265
+ div1 = internal.element("div");
266
+ div0 = internal.element("div");
267
+ t0 = internal.space();
268
+ span = internal.element("span");
269
+ t1 = internal.text(/*northDesc*/ ctx[0]);
270
+ internal.attr(div0, "class", "floorplan-plugin__compass-image svelte-z9kwkx");
271
+ internal.set_style(div0, "background-image", `url(${COMPASS_IMAGE})`);
272
+ internal.attr(span, "class", "floorplan-plugin__compass-text svelte-z9kwkx");
273
+ internal.attr(div1, "class", "floorplan-plugin__compass svelte-z9kwkx");
274
+ internal.set_style(div1, "transform", /*compassTransformStyle*/ ctx[2], false);
275
+ },
276
+ m(target, anchor) {
277
+ internal.insert(target, div1, anchor);
278
+ internal.append(div1, div0);
279
+ internal.append(div1, t0);
280
+ internal.append(div1, span);
281
+ internal.append(span, t1);
282
+ },
283
+ p(ctx, dirty) {
284
+ if (dirty & /*northDesc*/ 1) internal.set_data(t1, /*northDesc*/ ctx[0]);
285
+ },
286
+ d(detaching) {
287
+ if (detaching) internal.detach(div1);
288
+ }
289
+ };
290
+ }
291
+
292
+ function create_fragment$f(ctx) {
293
+ let if_block_anchor;
294
+ let if_block = /*canCompassShow*/ ctx[1] && create_if_block$6(ctx);
295
+
296
+ return {
297
+ c() {
298
+ if (if_block) if_block.c();
299
+ if_block_anchor = internal.empty();
300
+ },
301
+ m(target, anchor) {
302
+ if (if_block) if_block.m(target, anchor);
303
+ internal.insert(target, if_block_anchor, anchor);
304
+ },
305
+ p(ctx, [dirty]) {
306
+ if (/*canCompassShow*/ ctx[1]) if_block.p(ctx, dirty);
307
+ },
308
+ i: internal.noop,
309
+ o: internal.noop,
310
+ d(detaching) {
311
+ if (if_block) if_block.d(detaching);
312
+ if (detaching) internal.detach(if_block_anchor);
313
+ }
314
+ };
315
+ }
316
+
317
+ function rad2Deg(rad) {
318
+ return rad / Math.PI * 180;
319
+ }
320
+
321
+ function instance$f($$self, $$props, $$invalidate) {
322
+ var _a;
323
+ let { floorplanData } = $$props;
324
+ let { northDesc } = $$props;
325
+
326
+ const northRad = (_a = floorplanData.entrance) === null || _a === void 0
327
+ ? void 0
328
+ : _a.northRad;
329
+
330
+ const canCompassShow = typeof northRad === 'number';
331
+ const rotate = !northRad ? 0 : rad2Deg(northRad);
332
+ const compassTransformStyle = `translateX(-50%) translateZ(10px) rotate(${-rotate + 90}deg)`;
333
+
334
+ $$self.$$set = $$props => {
335
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
336
+ if ('northDesc' in $$props) $$invalidate(0, northDesc = $$props.northDesc);
337
+ };
338
+
339
+ return [northDesc, canCompassShow, compassTransformStyle, floorplanData];
340
+ }
341
+
342
+ class Compass extends internal.SvelteComponent {
343
+ constructor(options) {
344
+ super();
345
+ internal.init(this, options, instance$f, create_fragment$f, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$c);
346
+ }
347
+ }
348
+
349
+ /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
350
+
351
+ function add_css$b(target) {
352
+ internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
353
+ }
354
+
355
+ function create_fragment$e(ctx) {
356
+ let img;
357
+ let img_src_value;
358
+
359
+ return {
360
+ c() {
361
+ img = internal.element("img");
362
+ if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
363
+ internal.attr(img, "alt", "floorplan iamge");
364
+ internal.attr(img, "class", "svelte-1gfoniz");
365
+ },
366
+ m(target, anchor) {
367
+ internal.insert(target, img, anchor);
368
+ },
369
+ p(ctx, [dirty]) {
370
+ if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
371
+ internal.attr(img, "src", img_src_value);
372
+ }
373
+ },
374
+ i: internal.noop,
375
+ o: internal.noop,
376
+ d(detaching) {
377
+ if (detaching) internal.detach(img);
378
+ }
379
+ };
380
+ }
381
+
382
+ function instance$e($$self, $$props, $$invalidate) {
383
+ let { url } = $$props;
384
+
385
+ $$self.$$set = $$props => {
386
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
387
+ };
388
+
389
+ return [url];
390
+ }
391
+
392
+ class Normalmage extends internal.SvelteComponent {
393
+ constructor(options) {
394
+ super();
395
+ internal.init(this, options, instance$e, create_fragment$e, internal.safe_not_equal, { url: 0 }, add_css$b);
396
+ }
397
+ }
398
+
399
+ /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
400
+
401
+ function add_css$a(target) {
402
+ internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
403
+ }
404
+
405
+ function create_fragment$d(ctx) {
406
+ let div;
407
+ let html_tag;
408
+ let t;
409
+ let html_tag_1;
410
+
411
+ return {
412
+ c() {
413
+ div = internal.element("div");
414
+ html_tag = new internal.HtmlTag();
415
+ t = internal.space();
416
+ html_tag_1 = new internal.HtmlTag();
417
+ html_tag.a = t;
418
+ html_tag_1.a = null;
419
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
420
+ },
421
+ m(target, anchor) {
422
+ internal.insert(target, div, anchor);
423
+ html_tag.m(/*svgStyle*/ ctx[1], div);
424
+ internal.append(div, t);
425
+ html_tag_1.m(/*content*/ ctx[0], div);
426
+ },
427
+ p(ctx, [dirty]) {
428
+ if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
429
+ },
430
+ i: internal.noop,
431
+ o: internal.noop,
432
+ d(detaching) {
433
+ if (detaching) internal.detach(div);
434
+ }
435
+ };
436
+ }
437
+
438
+ function instance$d($$self, $$props, $$invalidate) {
439
+ let { content } = $$props;
440
+
441
+ const svgStyle = `
442
+ <style>
443
+ svg [type='lineGroup'] path {
444
+ fill: #ffffff;
445
+ stroke: #ffffff;
446
+ }
447
+ svg [type='lineItemGroup'] g g g g {
448
+ stroke: #ffffff;
449
+ }</style>
450
+ `;
451
+
452
+ $$self.$$set = $$props => {
453
+ if ('content' in $$props) $$invalidate(0, content = $$props.content);
454
+ };
455
+
456
+ return [content, svgStyle];
457
+ }
458
+
459
+ class SvgImage extends internal.SvelteComponent {
460
+ constructor(options) {
461
+ super();
462
+ internal.init(this, options, instance$d, create_fragment$d, internal.safe_not_equal, { content: 0 }, add_css$a);
463
+ }
464
+ }
465
+
466
+ /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
467
+
468
+ function add_css$9(target) {
469
+ internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
470
+ }
471
+
472
+ // (13:22)
473
+ function create_if_block_1$4(ctx) {
474
+ let normalimage;
475
+ let current;
476
+ normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
477
+
478
+ return {
479
+ c() {
480
+ internal.create_component(normalimage.$$.fragment);
481
+ },
482
+ m(target, anchor) {
483
+ internal.mount_component(normalimage, target, anchor);
484
+ current = true;
485
+ },
486
+ p(ctx, dirty) {
487
+ const normalimage_changes = {};
488
+ if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
489
+ normalimage.$set(normalimage_changes);
490
+ },
491
+ i(local) {
492
+ if (current) return;
493
+ internal.transition_in(normalimage.$$.fragment, local);
494
+ current = true;
495
+ },
496
+ o(local) {
497
+ internal.transition_out(normalimage.$$.fragment, local);
498
+ current = false;
499
+ },
500
+ d(detaching) {
501
+ internal.destroy_component(normalimage, detaching);
502
+ }
503
+ };
504
+ }
505
+
506
+ // (11:2) {#if svgContent}
507
+ function create_if_block$5(ctx) {
508
+ let svgimage;
509
+ let current;
510
+
511
+ svgimage = new SvgImage({
512
+ props: { content: /*svgContent*/ ctx[0] }
513
+ });
514
+
515
+ return {
516
+ c() {
517
+ internal.create_component(svgimage.$$.fragment);
518
+ },
519
+ m(target, anchor) {
520
+ internal.mount_component(svgimage, target, anchor);
521
+ current = true;
522
+ },
523
+ p(ctx, dirty) {
524
+ const svgimage_changes = {};
525
+ if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
526
+ svgimage.$set(svgimage_changes);
527
+ },
528
+ i(local) {
529
+ if (current) return;
530
+ internal.transition_in(svgimage.$$.fragment, local);
531
+ current = true;
532
+ },
533
+ o(local) {
534
+ internal.transition_out(svgimage.$$.fragment, local);
535
+ current = false;
536
+ },
537
+ d(detaching) {
538
+ internal.destroy_component(svgimage, detaching);
539
+ }
540
+ };
541
+ }
542
+
543
+ function create_fragment$c(ctx) {
544
+ let div;
545
+ let current_block_type_index;
546
+ let if_block;
547
+ let current;
548
+ const if_block_creators = [create_if_block$5, create_if_block_1$4];
549
+ const if_blocks = [];
550
+
551
+ function select_block_type(ctx, dirty) {
552
+ if (/*svgContent*/ ctx[0]) return 0;
553
+ if (/*imageData*/ ctx[1]) return 1;
554
+ return -1;
555
+ }
556
+
557
+ if (~(current_block_type_index = select_block_type(ctx))) {
558
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
559
+ }
560
+
561
+ return {
562
+ c() {
563
+ div = internal.element("div");
564
+ if (if_block) if_block.c();
565
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
566
+ },
567
+ m(target, anchor) {
568
+ internal.insert(target, div, anchor);
569
+
570
+ if (~current_block_type_index) {
571
+ if_blocks[current_block_type_index].m(div, null);
572
+ }
573
+
574
+ current = true;
575
+ },
576
+ p(ctx, [dirty]) {
577
+ let previous_block_index = current_block_type_index;
578
+ current_block_type_index = select_block_type(ctx);
579
+
580
+ if (current_block_type_index === previous_block_index) {
581
+ if (~current_block_type_index) {
582
+ if_blocks[current_block_type_index].p(ctx, dirty);
583
+ }
584
+ } else {
585
+ if (if_block) {
586
+ internal.group_outros();
587
+
588
+ internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
589
+ if_blocks[previous_block_index] = null;
590
+ });
591
+
592
+ internal.check_outros();
593
+ }
594
+
595
+ if (~current_block_type_index) {
596
+ if_block = if_blocks[current_block_type_index];
597
+
598
+ if (!if_block) {
599
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
600
+ if_block.c();
601
+ } else {
602
+ if_block.p(ctx, dirty);
603
+ }
604
+
605
+ internal.transition_in(if_block, 1);
606
+ if_block.m(div, null);
607
+ } else {
608
+ if_block = null;
609
+ }
610
+ }
611
+ },
612
+ i(local) {
613
+ if (current) return;
614
+ internal.transition_in(if_block);
615
+ current = true;
616
+ },
617
+ o(local) {
618
+ internal.transition_out(if_block);
619
+ current = false;
620
+ },
621
+ d(detaching) {
622
+ if (detaching) internal.detach(div);
623
+
624
+ if (~current_block_type_index) {
625
+ if_blocks[current_block_type_index].d();
626
+ }
627
+ }
628
+ };
629
+ }
630
+
631
+ function instance$c($$self, $$props, $$invalidate) {
632
+ let imageData;
633
+ let svgContent;
634
+ var _a, _b;
635
+ let { floorIndex } = $$props;
636
+ let { floorplanData } = $$props;
637
+
638
+ $$self.$$set = $$props => {
639
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
640
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
641
+ };
642
+
643
+ $$self.$$.update = () => {
644
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
645
+ $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
646
+ }
647
+
648
+ if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
649
+ $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
650
+ ? void 0
651
+ : _a[floorIndex]) === null || _b === void 0
652
+ ? void 0
653
+ : _b.svgContent);
654
+ }
655
+ };
656
+
657
+ return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
658
+ }
659
+
660
+ class BaseImage extends internal.SvelteComponent {
661
+ constructor(options) {
662
+ super();
663
+ internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$9);
664
+ }
665
+ }
666
+
667
+ /* src/floorplan/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
668
+
669
+ function add_css$8(target) {
670
+ internal.append_styles(target, "svelte-12pzct5", ".floorplan-plugin__room-label-item.svelte-12pzct5{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-size.svelte-12pzct5{opacity:0.45}");
671
+ }
672
+
673
+ // (95:30)
674
+ function create_if_block_1$3(ctx) {
675
+ let html_tag;
676
+ let raw_value = /*userConfigElement*/ ctx[4].outerHTML + "";
677
+ let html_anchor;
678
+
679
+ return {
680
+ c() {
681
+ html_tag = new internal.HtmlTag();
682
+ html_anchor = internal.empty();
683
+ html_tag.a = html_anchor;
684
+ },
685
+ m(target, anchor) {
686
+ html_tag.m(raw_value, target, anchor);
687
+ internal.insert(target, html_anchor, anchor);
688
+ },
689
+ p(ctx, dirty) {
690
+ if (dirty & /*userConfigElement*/ 16 && raw_value !== (raw_value = /*userConfigElement*/ ctx[4].outerHTML + "")) html_tag.p(raw_value);
691
+ },
692
+ d(detaching) {
693
+ if (detaching) internal.detach(html_anchor);
694
+ if (detaching) html_tag.d();
695
+ }
696
+ };
697
+ }
698
+
699
+ // (89:2) {#if getLabelElement === undefined}
700
+ function create_if_block$4(ctx) {
701
+ let span0;
702
+ let t0_value = /*room*/ ctx[0].name + "";
703
+ let t0;
704
+ let t1;
705
+ let span1;
706
+
707
+ return {
708
+ c() {
709
+ span0 = internal.element("span");
710
+ t0 = internal.text(t0_value);
711
+ t1 = internal.space();
712
+ span1 = internal.element("span");
713
+ span1.textContent = `${/*roomSizeDes*/ ctx[5]}`;
714
+ internal.attr(span0, "class", "floorplan-plugin__room-name");
715
+ internal.attr(span1, "class", "floorplan-plugin__room-size svelte-12pzct5");
716
+ },
717
+ m(target, anchor) {
718
+ internal.insert(target, span0, anchor);
719
+ internal.append(span0, t0);
720
+ internal.insert(target, t1, anchor);
721
+ internal.insert(target, span1, anchor);
722
+ },
723
+ p(ctx, dirty) {
724
+ if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
725
+ },
726
+ d(detaching) {
727
+ if (detaching) internal.detach(span0);
728
+ if (detaching) internal.detach(t1);
729
+ if (detaching) internal.detach(span1);
730
+ }
731
+ };
732
+ }
733
+
734
+ function create_fragment$b(ctx) {
735
+ let div;
736
+
737
+ function select_block_type(ctx, dirty) {
738
+ if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$4;
739
+ if (/*userConfigElement*/ ctx[4]) return create_if_block_1$3;
740
+ }
741
+
742
+ let current_block_type = select_block_type(ctx);
743
+ let if_block = current_block_type && current_block_type(ctx);
744
+
745
+ return {
746
+ c() {
747
+ div = internal.element("div");
748
+ if (if_block) if_block.c();
749
+ internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-12pzct5");
750
+ internal.set_style(div, "left", /*left*/ ctx[6], false);
751
+ internal.set_style(div, "top", /*top*/ ctx[7], false);
752
+ internal.set_style(div, "font-size", /*fontSize*/ ctx[8], false);
753
+ internal.set_style(div, "opacity", /*labelVisible*/ ctx[3] ? '1' : '0', false);
754
+ },
755
+ m(target, anchor) {
756
+ internal.insert(target, div, anchor);
757
+ if (if_block) if_block.m(div, null);
758
+ /*div_binding*/ ctx[15](div);
759
+ },
760
+ p(ctx, [dirty]) {
761
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
762
+ if_block.p(ctx, dirty);
763
+ } else {
764
+ if (if_block) if_block.d(1);
765
+ if_block = current_block_type && current_block_type(ctx);
766
+
767
+ if (if_block) {
768
+ if_block.c();
769
+ if_block.m(div, null);
770
+ }
771
+ }
772
+
773
+ if (dirty & /*labelVisible*/ 8) {
774
+ internal.set_style(div, "opacity", /*labelVisible*/ ctx[3] ? '1' : '0', false);
775
+ }
776
+ },
777
+ i: internal.noop,
778
+ o: internal.noop,
779
+ d(detaching) {
780
+ if (detaching) internal.detach(div);
781
+
782
+ if (if_block) {
783
+ if_block.d();
784
+ }
785
+
786
+ /*div_binding*/ ctx[15](null);
787
+ }
788
+ };
789
+ }
790
+
791
+ function isPointInPolygon(point, polygon) {
792
+ const x = point[0];
793
+ const y = point[1];
794
+ let inside = false;
795
+
796
+ for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
797
+ const xi = polygon[i][0];
798
+ const yi = polygon[i][1];
799
+ const xj = polygon[j][0];
800
+ const yj = polygon[j][1];
801
+ const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
802
+ if (intersect) inside = !inside;
803
+ }
804
+
805
+ return inside;
806
+ }
807
+
808
+ function instance$b($$self, $$props, $$invalidate) {
809
+ let isLabelInRoom;
810
+ let userConfigElement;
811
+ let labelVisible;
812
+ let { pxmm } = $$props;
813
+ let { room } = $$props;
814
+ let { hoveredRoom } = $$props;
815
+ let { getLabelElement } = $$props;
816
+ let { adaptiveRoomLabelVisibleEnable } = $$props;
817
+
818
+ function isLabelInRoomCurry(room, labelElementSize) {
819
+ if (labelElementSize.width === 0 || labelElementSize.height === 0) return () => false;
820
+ const polygon = room.path.map(({ x, y }) => [x, y]);
821
+ const labelPosition = room.roomLabel.position;
822
+ const { x, y } = labelPosition;
823
+ const { width, height } = labelElementSize;
824
+ const halfWidth = width / 2;
825
+ const halfHeight = height / 2;
826
+
827
+ return function isLabelInRoom(pxmm) {
828
+ const clientX = x * pxmm;
829
+ const clientY = y * pxmm;
830
+ const clientPolygon = polygon.map(([x, y]) => [x * pxmm, y * pxmm]);
831
+
832
+ // const
833
+ /** 围成 labelRect 的四个点
834
+ * 1----0
835
+ * | |
836
+ * 2----3
837
+ */
838
+ const labelRectClientPoints = [
839
+ [clientX + halfWidth, clientY - halfHeight],
840
+ [clientX - halfWidth, clientY - halfHeight],
841
+ [clientX - halfWidth, clientY + halfHeight],
842
+ [clientX + halfWidth, clientY + halfHeight]
843
+ ];
844
+
845
+ return labelRectClientPoints.every(point => isPointInPolygon(point, clientPolygon));
846
+ };
847
+ }
848
+
849
+ // ========== 获取设备宽高像素 ==========
850
+ // TODO: 统一这里的判断条件,目前写了多处
851
+ const bodyWidth = document.body.clientWidth;
852
+
853
+ const bodyHeight = document.body.clientHeight;
854
+ const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
855
+
856
+ // ====================================
857
+ const roomLabel = room.roomLabel;
858
+
859
+ const left = roomLabel.positionInImage.x * 100 + '%';
860
+ const top = roomLabel.positionInImage.y * 100 + '%';
861
+
862
+ // 屏幕宽或高小于 500px 时,用 10px 字体,否则用 14px
863
+ const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
864
+
865
+ let isHoverd = false;
866
+ let labelElement;
867
+ let labelElementSize;
868
+
869
+ hoveredRoom.subscribe(function onHoverdRoomUpdate(_room) {
870
+ $$invalidate(12, isHoverd = !!_room && _room.id === room.id);
871
+ });
872
+
873
+ svelte.onMount(() => {
874
+ // Label 能不能展示只跟房间大小有关
875
+ // 计算 LabelElement 宽高
876
+ const labelDomRect = labelElement === null || labelElement === void 0
877
+ ? void 0
878
+ : labelElement.getClientRects()[0];
879
+
880
+ $$invalidate(13, labelElementSize = {
881
+ width: labelDomRect.width,
882
+ height: labelDomRect.height
883
+ });
884
+ });
885
+
886
+ function div_binding($$value) {
887
+ internal.binding_callbacks[$$value ? 'unshift' : 'push'](() => {
888
+ labelElement = $$value;
889
+ $$invalidate(2, labelElement);
890
+ });
891
+ }
892
+
893
+ $$self.$$set = $$props => {
894
+ if ('pxmm' in $$props) $$invalidate(9, pxmm = $$props.pxmm);
895
+ if ('room' in $$props) $$invalidate(0, room = $$props.room);
896
+ if ('hoveredRoom' in $$props) $$invalidate(10, hoveredRoom = $$props.hoveredRoom);
897
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
898
+ if ('adaptiveRoomLabelVisibleEnable' in $$props) $$invalidate(11, adaptiveRoomLabelVisibleEnable = $$props.adaptiveRoomLabelVisibleEnable);
899
+ };
900
+
901
+ $$self.$$.update = () => {
902
+ if ($$self.$$.dirty & /*labelElementSize, room*/ 8193) {
903
+ $$invalidate(14, isLabelInRoom = labelElementSize
904
+ ? isLabelInRoomCurry(room, labelElementSize)
905
+ : undefined);
906
+ }
907
+
908
+ if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
909
+ $$invalidate(4, userConfigElement = getLabelElement === null || getLabelElement === void 0
910
+ ? void 0
911
+ : getLabelElement(room));
912
+ }
913
+
914
+ if ($$self.$$.dirty & /*adaptiveRoomLabelVisibleEnable, isHoverd, isLabelInRoom, pxmm*/ 23040) {
915
+ $$invalidate(3, labelVisible = adaptiveRoomLabelVisibleEnable
916
+ ? isHoverd
917
+ ? true
918
+ : !!(isLabelInRoom === null || isLabelInRoom === void 0
919
+ ? void 0
920
+ : isLabelInRoom(pxmm))
921
+ : true);
922
+ }
923
+ };
924
+
925
+ return [
926
+ room,
927
+ getLabelElement,
928
+ labelElement,
929
+ labelVisible,
930
+ userConfigElement,
931
+ roomSizeDes,
932
+ left,
933
+ top,
934
+ fontSize,
935
+ pxmm,
936
+ hoveredRoom,
937
+ adaptiveRoomLabelVisibleEnable,
938
+ isHoverd,
939
+ labelElementSize,
940
+ isLabelInRoom,
941
+ div_binding
942
+ ];
943
+ }
944
+
945
+ class RoomLabel extends internal.SvelteComponent {
946
+ constructor(options) {
947
+ super();
948
+
949
+ internal.init(
950
+ this,
951
+ options,
952
+ instance$b,
953
+ create_fragment$b,
954
+ internal.safe_not_equal,
955
+ {
956
+ pxmm: 9,
957
+ room: 0,
958
+ hoveredRoom: 10,
959
+ getLabelElement: 1,
960
+ adaptiveRoomLabelVisibleEnable: 11
961
+ },
962
+ add_css$8
963
+ );
964
+ }
965
+ }
966
+
967
+ /* src/floorplan/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
968
+
969
+ function add_css$7(target) {
970
+ internal.append_styles(target, "svelte-13xux0b", ".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}");
971
+ }
972
+
973
+ function get_each_context$5(ctx, list, i) {
974
+ const child_ctx = ctx.slice();
975
+ child_ctx[9] = list[i];
976
+ return child_ctx;
977
+ }
978
+
979
+ // (17:0) {#if rooms}
980
+ function create_if_block$3(ctx) {
981
+ let div;
982
+ let each_blocks = [];
983
+ let each_1_lookup = new Map();
984
+ let div_resize_listener;
985
+ let current;
986
+ let each_value = /*rooms*/ ctx[5];
987
+ const get_key = ctx => /*room*/ ctx[9].id;
988
+
989
+ for (let i = 0; i < each_value.length; i += 1) {
990
+ let child_ctx = get_each_context$5(ctx, each_value, i);
991
+ let key = get_key(child_ctx);
992
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$5(key, child_ctx));
993
+ }
994
+
995
+ return {
996
+ c() {
997
+ div = internal.element("div");
998
+
999
+ for (let i = 0; i < each_blocks.length; i += 1) {
1000
+ each_blocks[i].c();
1001
+ }
1002
+
1003
+ internal.attr(div, "class", "floorplan-plugin__room-labels svelte-13xux0b");
1004
+ internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[8].call(div));
1005
+ },
1006
+ m(target, anchor) {
1007
+ internal.insert(target, div, anchor);
1008
+
1009
+ for (let i = 0; i < each_blocks.length; i += 1) {
1010
+ each_blocks[i].m(div, null);
1011
+ }
1012
+
1013
+ div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[8].bind(div));
1014
+ current = true;
1015
+ },
1016
+ p(ctx, dirty) {
1017
+ if (dirty & /*pxmm, rooms, getLabelElement, hoveredRoom, adaptiveRoomLabelVisibleEnable*/ 55) {
1018
+ each_value = /*rooms*/ ctx[5];
1019
+ internal.group_outros();
1020
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$5, null, get_each_context$5);
1021
+ internal.check_outros();
1022
+ }
1023
+ },
1024
+ i(local) {
1025
+ if (current) return;
1026
+
1027
+ for (let i = 0; i < each_value.length; i += 1) {
1028
+ internal.transition_in(each_blocks[i]);
1029
+ }
1030
+
1031
+ current = true;
1032
+ },
1033
+ o(local) {
1034
+ for (let i = 0; i < each_blocks.length; i += 1) {
1035
+ internal.transition_out(each_blocks[i]);
1036
+ }
1037
+
1038
+ current = false;
1039
+ },
1040
+ d(detaching) {
1041
+ if (detaching) internal.detach(div);
1042
+
1043
+ for (let i = 0; i < each_blocks.length; i += 1) {
1044
+ each_blocks[i].d();
1045
+ }
1046
+
1047
+ div_resize_listener();
1048
+ }
1049
+ };
1050
+ }
1051
+
1052
+ // (19:4) {#each rooms as room (room.id)}
1053
+ function create_each_block$5(key_1, ctx) {
1054
+ let first;
1055
+ let roomlabel;
1056
+ let current;
1057
+
1058
+ const roomlabel_spread_levels = [
1059
+ {
1060
+ pxmm: /*pxmm*/ ctx[4],
1061
+ room: /*room*/ ctx[9],
1062
+ getLabelElement: /*getLabelElement*/ ctx[1],
1063
+ hoveredRoom: /*hoveredRoom*/ ctx[0],
1064
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[2]
1065
+ }
1066
+ ];
1067
+
1068
+ let roomlabel_props = {};
1069
+
1070
+ for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
1071
+ roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
1072
+ }
1073
+
1074
+ roomlabel = new RoomLabel({ props: roomlabel_props });
1075
+
1076
+ return {
1077
+ key: key_1,
1078
+ first: null,
1079
+ c() {
1080
+ first = internal.empty();
1081
+ internal.create_component(roomlabel.$$.fragment);
1082
+ this.first = first;
1083
+ },
1084
+ m(target, anchor) {
1085
+ internal.insert(target, first, anchor);
1086
+ internal.mount_component(roomlabel, target, anchor);
1087
+ current = true;
1088
+ },
1089
+ p(new_ctx, dirty) {
1090
+ ctx = new_ctx;
1091
+
1092
+ const roomlabel_changes = (dirty & /*pxmm, rooms, getLabelElement, hoveredRoom, adaptiveRoomLabelVisibleEnable*/ 55)
1093
+ ? internal.get_spread_update(roomlabel_spread_levels, [
1094
+ {
1095
+ pxmm: /*pxmm*/ ctx[4],
1096
+ room: /*room*/ ctx[9],
1097
+ getLabelElement: /*getLabelElement*/ ctx[1],
1098
+ hoveredRoom: /*hoveredRoom*/ ctx[0],
1099
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[2]
1100
+ }
1101
+ ])
1102
+ : {};
1103
+
1104
+ roomlabel.$set(roomlabel_changes);
1105
+ },
1106
+ i(local) {
1107
+ if (current) return;
1108
+ internal.transition_in(roomlabel.$$.fragment, local);
1109
+ current = true;
1110
+ },
1111
+ o(local) {
1112
+ internal.transition_out(roomlabel.$$.fragment, local);
1113
+ current = false;
1114
+ },
1115
+ d(detaching) {
1116
+ if (detaching) internal.detach(first);
1117
+ internal.destroy_component(roomlabel, detaching);
1118
+ }
1119
+ };
1120
+ }
1121
+
1122
+ function create_fragment$a(ctx) {
1123
+ let if_block_anchor;
1124
+ let current;
1125
+ let if_block = /*rooms*/ ctx[5] && create_if_block$3(ctx);
1126
+
1127
+ return {
1128
+ c() {
1129
+ if (if_block) if_block.c();
1130
+ if_block_anchor = internal.empty();
1131
+ },
1132
+ m(target, anchor) {
1133
+ if (if_block) if_block.m(target, anchor);
1134
+ internal.insert(target, if_block_anchor, anchor);
1135
+ current = true;
1136
+ },
1137
+ p(ctx, [dirty]) {
1138
+ if (/*rooms*/ ctx[5]) {
1139
+ if (if_block) {
1140
+ if_block.p(ctx, dirty);
1141
+
1142
+ if (dirty & /*rooms*/ 32) {
1143
+ internal.transition_in(if_block, 1);
1144
+ }
1145
+ } else {
1146
+ if_block = create_if_block$3(ctx);
1147
+ if_block.c();
1148
+ internal.transition_in(if_block, 1);
1149
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
1150
+ }
1151
+ } else if (if_block) {
1152
+ internal.group_outros();
1153
+
1154
+ internal.transition_out(if_block, 1, 1, () => {
1155
+ if_block = null;
1156
+ });
1157
+
1158
+ internal.check_outros();
1159
+ }
1160
+ },
1161
+ i(local) {
1162
+ if (current) return;
1163
+ internal.transition_in(if_block);
1164
+ current = true;
1165
+ },
1166
+ o(local) {
1167
+ internal.transition_out(if_block);
1168
+ current = false;
1169
+ },
1170
+ d(detaching) {
1171
+ if (if_block) if_block.d(detaching);
1172
+ if (detaching) internal.detach(if_block_anchor);
1173
+ }
1174
+ };
1175
+ }
1176
+
1177
+ function instance$a($$self, $$props, $$invalidate) {
1178
+ let rooms;
1179
+ let { floorIndex } = $$props;
1180
+ let { floorplanData } = $$props;
1181
+ let { hoveredRoom } = $$props;
1182
+ let { getLabelElement } = $$props;
1183
+ let { adaptiveRoomLabelVisibleEnable } = $$props;
1184
+ let clientWidth = 0;
1185
+ let pxmm = 0;
1186
+
1187
+ function div_elementresize_handler() {
1188
+ clientWidth = this.clientWidth;
1189
+ $$invalidate(3, clientWidth);
1190
+ }
1191
+
1192
+ $$self.$$set = $$props => {
1193
+ if ('floorIndex' in $$props) $$invalidate(6, floorIndex = $$props.floorIndex);
1194
+ if ('floorplanData' in $$props) $$invalidate(7, floorplanData = $$props.floorplanData);
1195
+ if ('hoveredRoom' in $$props) $$invalidate(0, hoveredRoom = $$props.hoveredRoom);
1196
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
1197
+ if ('adaptiveRoomLabelVisibleEnable' in $$props) $$invalidate(2, adaptiveRoomLabelVisibleEnable = $$props.adaptiveRoomLabelVisibleEnable);
1198
+ };
1199
+
1200
+ $$self.$$.update = () => {
1201
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 192) {
1202
+ $$invalidate(5, rooms = floorplanData.floorDatas[floorIndex].rooms);
1203
+ }
1204
+
1205
+ if ($$self.$$.dirty & /*floorplanData, clientWidth*/ 136) {
1206
+ {
1207
+ const { max, min } = floorplanData.bounding;
1208
+ const boundingWidth = max.x - min.x;
1209
+ $$invalidate(4, pxmm = clientWidth / boundingWidth);
1210
+ }
1211
+ }
1212
+ };
1213
+
1214
+ return [
1215
+ hoveredRoom,
1216
+ getLabelElement,
1217
+ adaptiveRoomLabelVisibleEnable,
1218
+ clientWidth,
1219
+ pxmm,
1220
+ rooms,
1221
+ floorIndex,
1222
+ floorplanData,
1223
+ div_elementresize_handler
1224
+ ];
1225
+ }
1226
+
1227
+ class RoomLabels extends internal.SvelteComponent {
1228
+ constructor(options) {
1229
+ super();
1230
+
1231
+ internal.init(
1232
+ this,
1233
+ options,
1234
+ instance$a,
1235
+ create_fragment$a,
1236
+ internal.safe_not_equal,
1237
+ {
1238
+ floorIndex: 6,
1239
+ floorplanData: 7,
1240
+ hoveredRoom: 0,
1241
+ getLabelElement: 1,
1242
+ adaptiveRoomLabelVisibleEnable: 2
1243
+ },
1244
+ add_css$7
1245
+ );
1246
+ }
1247
+ }
1248
+
1249
+ /* src/floorplan/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
1250
+
1251
+ function add_css$6(target) {
1252
+ internal.append_styles(target, "svelte-xt7p1v", ".floorplan-plugin__rule-labels.svelte-xt7p1v.svelte-xt7p1v{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-xt7p1v.svelte-xt7p1v{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-xt7p1v.svelte-xt7p1v{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-xt7p1v.svelte-xt7p1v{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-xt7p1v.svelte-xt7p1v{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-xt7p1v.svelte-xt7p1v{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-xt7p1v.svelte-xt7p1v{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-scale-wrapper.svelte-xt7p1v{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-xt7p1v.svelte-xt7p1v{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-scale.svelte-xt7p1v{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-xt7p1v.svelte-xt7p1v{position:absolute}.floorplan-plugin__rule-labels--top.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-xt7p1v.svelte-xt7p1v{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-text-item.svelte-xt7p1v{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-xt7p1v.svelte-xt7p1v{width:-webkit-max-content;width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}");
1253
+ }
1254
+
1255
+ function get_each_context$4(ctx, list, i) {
1256
+ const child_ctx = ctx.slice();
1257
+ child_ctx[10] = list[i];
1258
+ child_ctx[12] = i;
1259
+ return child_ctx;
1260
+ }
1261
+
1262
+ function get_each_context_1(ctx, list, i) {
1263
+ const child_ctx = ctx.slice();
1264
+ child_ctx[13] = list[i];
1265
+ return child_ctx;
1266
+ }
1267
+
1268
+ // (47:4) {#each rulerLabels as rulerLabel}
1269
+ function create_each_block_1(ctx) {
1270
+ let div;
1271
+
1272
+ return {
1273
+ c() {
1274
+ div = internal.element("div");
1275
+ internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-xt7p1v");
1276
+ internal.set_style(div, "left", /*rulerLabel*/ ctx[13].left * 100 + '%', false);
1277
+ internal.set_style(div, "bottom", /*rulerLabel*/ ctx[13].bottom * 100 + '%', false);
1278
+ },
1279
+ m(target, anchor) {
1280
+ internal.insert(target, div, anchor);
1281
+ },
1282
+ p: internal.noop,
1283
+ d(detaching) {
1284
+ if (detaching) internal.detach(div);
1285
+ }
1286
+ };
1287
+ }
1288
+
1289
+ // (56:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
1290
+ function create_each_block$4(key_1, ctx) {
1291
+ let div1;
1292
+ let div0;
1293
+ let t0_value = /*textItem*/ ctx[10].distance + "";
1294
+ let t0;
1295
+ let t1;
1296
+
1297
+ return {
1298
+ key: key_1,
1299
+ first: null,
1300
+ c() {
1301
+ div1 = internal.element("div");
1302
+ div0 = internal.element("div");
1303
+ t0 = internal.text(t0_value);
1304
+ t1 = internal.space();
1305
+ internal.attr(div0, "class", "floorplan-plugin__rule-text svelte-xt7p1v");
1306
+ internal.toggle_class(div0, "is-row", /*isRow*/ ctx[1]);
1307
+ internal.attr(div1, "class", "floorplan-plugin__rule-text-item svelte-xt7p1v");
1308
+ internal.set_style(div1, "left", /*textItem*/ ctx[10].left * 100 + '%', false);
1309
+ internal.set_style(div1, "bottom", /*textItem*/ ctx[10].bottom * 100 + '%', false);
1310
+ this.first = div1;
1311
+ },
1312
+ m(target, anchor) {
1313
+ internal.insert(target, div1, anchor);
1314
+ internal.append(div1, div0);
1315
+ internal.append(div0, t0);
1316
+ internal.append(div1, t1);
1317
+ },
1318
+ p(new_ctx, dirty) {
1319
+ ctx = new_ctx;
1320
+ },
1321
+ d(detaching) {
1322
+ if (detaching) internal.detach(div1);
1323
+ }
1324
+ };
1325
+ }
1326
+
1327
+ function create_fragment$9(ctx) {
1328
+ let div3;
1329
+ let div0;
1330
+ let t0;
1331
+ let div1;
1332
+ let t1;
1333
+ let div2;
1334
+ let each_blocks = [];
1335
+ let each1_lookup = new Map();
1336
+ let div3_class_value;
1337
+ let each_value_1 = /*rulerLabels*/ ctx[2];
1338
+ let each_blocks_1 = [];
1339
+
1340
+ for (let i = 0; i < each_value_1.length; i += 1) {
1341
+ each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
1342
+ }
1343
+
1344
+ let each_value = /*rulerTexts*/ ctx[3];
1345
+ const get_key = ctx => /*textItemIndex*/ ctx[12];
1346
+
1347
+ for (let i = 0; i < each_value.length; i += 1) {
1348
+ let child_ctx = get_each_context$4(ctx, each_value, i);
1349
+ let key = get_key(child_ctx);
1350
+ each1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
1351
+ }
1352
+
1353
+ return {
1354
+ c() {
1355
+ div3 = internal.element("div");
1356
+ div0 = internal.element("div");
1357
+ t0 = internal.space();
1358
+ div1 = internal.element("div");
1359
+
1360
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
1361
+ each_blocks_1[i].c();
1362
+ }
1363
+
1364
+ t1 = internal.space();
1365
+ div2 = internal.element("div");
1366
+
1367
+ for (let i = 0; i < each_blocks.length; i += 1) {
1368
+ each_blocks[i].c();
1369
+ }
1370
+
1371
+ internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-xt7p1v");
1372
+ internal.attr(div1, "class", "floorplan-plugin__rule-scale-wrapper svelte-xt7p1v");
1373
+ internal.toggle_class(div1, "is-row", /*isRow*/ ctx[1]);
1374
+ internal.attr(div2, "class", "floorplan-plugin__rule-text-wrapper svelte-xt7p1v");
1375
+ internal.attr(div3, "class", div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v");
1376
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
1377
+ internal.set_style(div3, "width", /*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
1378
+ internal.set_style(div3, "height", !/*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
1379
+ },
1380
+ m(target, anchor) {
1381
+ internal.insert(target, div3, anchor);
1382
+ internal.append(div3, div0);
1383
+ internal.append(div3, t0);
1384
+ internal.append(div3, div1);
1385
+
1386
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
1387
+ each_blocks_1[i].m(div1, null);
1388
+ }
1389
+
1390
+ internal.append(div3, t1);
1391
+ internal.append(div3, div2);
1392
+
1393
+ for (let i = 0; i < each_blocks.length; i += 1) {
1394
+ each_blocks[i].m(div2, null);
1395
+ }
1396
+ },
1397
+ p(ctx, [dirty]) {
1398
+ if (dirty & /*rulerLabels*/ 4) {
1399
+ each_value_1 = /*rulerLabels*/ ctx[2];
1400
+ let i;
1401
+
1402
+ for (i = 0; i < each_value_1.length; i += 1) {
1403
+ const child_ctx = get_each_context_1(ctx, each_value_1, i);
1404
+
1405
+ if (each_blocks_1[i]) {
1406
+ each_blocks_1[i].p(child_ctx, dirty);
1407
+ } else {
1408
+ each_blocks_1[i] = create_each_block_1(child_ctx);
1409
+ each_blocks_1[i].c();
1410
+ each_blocks_1[i].m(div1, null);
1411
+ }
1412
+ }
1413
+
1414
+ for (; i < each_blocks_1.length; i += 1) {
1415
+ each_blocks_1[i].d(1);
1416
+ }
1417
+
1418
+ each_blocks_1.length = each_value_1.length;
1419
+ }
1420
+
1421
+ if (dirty & /*rulerTexts, isRow*/ 10) {
1422
+ each_value = /*rulerTexts*/ ctx[3];
1423
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each1_lookup, div2, internal.destroy_block, create_each_block$4, null, get_each_context$4);
1424
+ }
1425
+
1426
+ if (dirty & /*type*/ 1 && div3_class_value !== (div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v")) {
1427
+ internal.attr(div3, "class", div3_class_value);
1428
+ }
1429
+
1430
+ if (dirty & /*type, isRow*/ 3) {
1431
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
1432
+ }
1433
+ },
1434
+ i: internal.noop,
1435
+ o: internal.noop,
1436
+ d(detaching) {
1437
+ if (detaching) internal.detach(div3);
1438
+ internal.destroy_each(each_blocks_1, detaching);
1439
+
1440
+ for (let i = 0; i < each_blocks.length; i += 1) {
1441
+ each_blocks[i].d();
1442
+ }
1443
+ }
1444
+ };
1445
+ }
1446
+
1447
+ const padding$1 = 1000;
1448
+ const exteriorWallOffset$1 = 180;
1449
+
1450
+ function instance$9($$self, $$props, $$invalidate) {
1451
+ let { type } = $$props;
1452
+ let { data } = $$props;
1453
+ let { bounding } = $$props;
1454
+ const isRow = type === 'top' || type === 'bottom';
1455
+ const contentWidth = bounding.max.x - bounding.min.x - (padding$1 - exteriorWallOffset$1) * 2;
1456
+ const contentHeight = bounding.max.y - bounding.min.y - (padding$1 - exteriorWallOffset$1) * 2;
1457
+
1458
+ // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
1459
+ const rulerPoints = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
1460
+ // 筛除重复数据
1461
+ if (index === 0) return true;
1462
+
1463
+ return x !== arr[index - 1];
1464
+ });
1465
+
1466
+ const rulerLabels = rulerPoints.map(num => {
1467
+ const left = isRow
1468
+ ? (num - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
1469
+ : 0;
1470
+
1471
+ const bottom = !isRow
1472
+ ? (num - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
1473
+ : 0;
1474
+
1475
+ return { left, bottom };
1476
+ });
1477
+
1478
+ rulerLabels.unshift({ left: 0, bottom: 0 });
1479
+ rulerLabels.push(isRow ? { left: 1, bottom: 0 } : { left: 0, bottom: 1 });
1480
+ const length = rulerPoints[rulerPoints.length - 1] - rulerPoints[0];
1481
+
1482
+ const rulerTexts = rulerPoints.map((num, index, arr) => {
1483
+ const distance = index === 0 ? 0 : num - arr[index - 1];
1484
+ const positionNum = index === 0 ? 0 : (num + arr[index - 1]) / 2;
1485
+
1486
+ const left = isRow
1487
+ ? (positionNum - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
1488
+ : 0;
1489
+
1490
+ const bottom = !isRow
1491
+ ? (positionNum - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
1492
+ : 0;
1493
+
1494
+ return { left, bottom, distance };
1495
+ }).filter(({ distance }) => distance / length > 0.1);
1496
+
1497
+ $$self.$$set = $$props => {
1498
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
1499
+ if ('data' in $$props) $$invalidate(4, data = $$props.data);
1500
+ if ('bounding' in $$props) $$invalidate(5, bounding = $$props.bounding);
1501
+ };
1502
+
1503
+ return [type, isRow, rulerLabels, rulerTexts, data, bounding];
1504
+ }
1505
+
1506
+ class RuleItem extends internal.SvelteComponent {
1507
+ constructor(options) {
1508
+ super();
1509
+ internal.init(this, options, instance$9, create_fragment$9, internal.safe_not_equal, { type: 0, data: 4, bounding: 5 }, add_css$6);
1510
+ }
1511
+ }
1512
+
1513
+ /* src/floorplan/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
1514
+
1515
+ function add_css$5(target) {
1516
+ internal.append_styles(target, "svelte-1mzj9p3", ".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}");
1517
+ }
1518
+
1519
+ function get_each_context$3(ctx, list, i) {
1520
+ const child_ctx = ctx.slice();
1521
+ child_ctx[12] = list[i][0];
1522
+ child_ctx[13] = list[i][1];
1523
+ return child_ctx;
1524
+ }
1525
+
1526
+ // (19:2) {#each ruleLabelArray as [type, data] (type)}
1527
+ function create_each_block$3(key_1, ctx) {
1528
+ let first;
1529
+ let ruleitem;
1530
+ let current;
1531
+
1532
+ const ruleitem_spread_levels = [
1533
+ {
1534
+ type: /*type*/ ctx[12],
1535
+ data: /*data*/ ctx[13],
1536
+ bounding: /*bounding*/ ctx[0]
1537
+ }
1538
+ ];
1539
+
1540
+ let ruleitem_props = {};
1541
+
1542
+ for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
1543
+ ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
1544
+ }
1545
+
1546
+ ruleitem = new RuleItem({ props: ruleitem_props });
1547
+
1548
+ return {
1549
+ key: key_1,
1550
+ first: null,
1551
+ c() {
1552
+ first = internal.empty();
1553
+ internal.create_component(ruleitem.$$.fragment);
1554
+ this.first = first;
1555
+ },
1556
+ m(target, anchor) {
1557
+ internal.insert(target, first, anchor);
1558
+ internal.mount_component(ruleitem, target, anchor);
1559
+ current = true;
1560
+ },
1561
+ p(new_ctx, dirty) {
1562
+ ctx = new_ctx;
1563
+
1564
+ const ruleitem_changes = (dirty & /*ruleLabelArray, bounding*/ 9)
1565
+ ? internal.get_spread_update(ruleitem_spread_levels, [
1566
+ {
1567
+ type: /*type*/ ctx[12],
1568
+ data: /*data*/ ctx[13],
1569
+ bounding: /*bounding*/ ctx[0]
1570
+ }
1571
+ ])
1572
+ : {};
1573
+
1574
+ ruleitem.$set(ruleitem_changes);
1575
+ },
1576
+ i(local) {
1577
+ if (current) return;
1578
+ internal.transition_in(ruleitem.$$.fragment, local);
1579
+ current = true;
1580
+ },
1581
+ o(local) {
1582
+ internal.transition_out(ruleitem.$$.fragment, local);
1583
+ current = false;
1584
+ },
1585
+ d(detaching) {
1586
+ if (detaching) internal.detach(first);
1587
+ internal.destroy_component(ruleitem, detaching);
1588
+ }
1589
+ };
1590
+ }
1591
+
1592
+ function create_fragment$8(ctx) {
1593
+ let div;
1594
+ let each_blocks = [];
1595
+ let each_1_lookup = new Map();
1596
+ let current;
1597
+ let each_value = /*ruleLabelArray*/ ctx[3];
1598
+ const get_key = ctx => /*type*/ ctx[12];
1599
+
1600
+ for (let i = 0; i < each_value.length; i += 1) {
1601
+ let child_ctx = get_each_context$3(ctx, each_value, i);
1602
+ let key = get_key(child_ctx);
1603
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
1604
+ }
1605
+
1606
+ return {
1607
+ c() {
1608
+ div = internal.element("div");
1609
+
1610
+ for (let i = 0; i < each_blocks.length; i += 1) {
1611
+ each_blocks[i].c();
1612
+ }
1613
+
1614
+ internal.attr(div, "class", "floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3");
1615
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
1616
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
1617
+ },
1618
+ m(target, anchor) {
1619
+ internal.insert(target, div, anchor);
1620
+
1621
+ for (let i = 0; i < each_blocks.length; i += 1) {
1622
+ each_blocks[i].m(div, null);
1623
+ }
1624
+
1625
+ current = true;
1626
+ },
1627
+ p(ctx, [dirty]) {
1628
+ if (dirty & /*ruleLabelArray, bounding*/ 9) {
1629
+ each_value = /*ruleLabelArray*/ ctx[3];
1630
+ internal.group_outros();
1631
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$3, null, get_each_context$3);
1632
+ internal.check_outros();
1633
+ }
1634
+
1635
+ if (dirty & /*width*/ 4) {
1636
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
1637
+ }
1638
+
1639
+ if (dirty & /*height*/ 2) {
1640
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
1641
+ }
1642
+ },
1643
+ i(local) {
1644
+ if (current) return;
1645
+
1646
+ for (let i = 0; i < each_value.length; i += 1) {
1647
+ internal.transition_in(each_blocks[i]);
1648
+ }
1649
+
1650
+ current = true;
1651
+ },
1652
+ o(local) {
1653
+ for (let i = 0; i < each_blocks.length; i += 1) {
1654
+ internal.transition_out(each_blocks[i]);
1655
+ }
1656
+
1657
+ current = false;
1658
+ },
1659
+ d(detaching) {
1660
+ if (detaching) internal.detach(div);
1661
+
1662
+ for (let i = 0; i < each_blocks.length; i += 1) {
1663
+ each_blocks[i].d();
1664
+ }
1665
+ }
1666
+ };
1667
+ }
1668
+
1669
+ const padding = 1000;
1670
+ const exteriorWallOffset = 180;
1671
+
1672
+ function instance$8($$self, $$props, $$invalidate) {
1673
+ let bounding;
1674
+ let ruleLabelData;
1675
+ let ruleLabelDataKeys;
1676
+ let ruleLabelArray;
1677
+ let boundingWidth;
1678
+ let boundingHeight;
1679
+ let contentWidth;
1680
+ let contentHeight;
1681
+ let width;
1682
+ let height;
1683
+ let { floorIndex } = $$props;
1684
+ let { floorplanData } = $$props;
1685
+
1686
+ $$self.$$set = $$props => {
1687
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
1688
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
1689
+ };
1690
+
1691
+ $$self.$$.update = () => {
1692
+ if ($$self.$$.dirty & /*floorplanData*/ 32) {
1693
+ $$invalidate(0, bounding = floorplanData.bounding);
1694
+ }
1695
+
1696
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 48) {
1697
+ $$invalidate(10, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1698
+ }
1699
+
1700
+ if ($$self.$$.dirty & /*ruleLabelData*/ 1024) {
1701
+ $$invalidate(11, ruleLabelDataKeys = Object.keys(ruleLabelData));
1702
+ }
1703
+
1704
+ if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 3072) {
1705
+ $$invalidate(3, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
1706
+ }
1707
+
1708
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1709
+ $$invalidate(8, boundingWidth = bounding.max.x - bounding.min.x);
1710
+ }
1711
+
1712
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1713
+ $$invalidate(6, boundingHeight = bounding.max.y - bounding.min.y);
1714
+ }
1715
+
1716
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1717
+ $$invalidate(9, contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2);
1718
+ }
1719
+
1720
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1721
+ $$invalidate(7, contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2);
1722
+ }
1723
+
1724
+ if ($$self.$$.dirty & /*contentWidth, boundingWidth*/ 768) {
1725
+ $$invalidate(2, width = contentWidth / boundingWidth * 100 + '%');
1726
+ }
1727
+
1728
+ if ($$self.$$.dirty & /*contentHeight, boundingHeight*/ 192) {
1729
+ $$invalidate(1, height = contentHeight / boundingHeight * 100 + '%');
1730
+ }
1731
+ };
1732
+
1733
+ return [
1734
+ bounding,
1735
+ height,
1736
+ width,
1737
+ ruleLabelArray,
1738
+ floorIndex,
1739
+ floorplanData,
1740
+ boundingHeight,
1741
+ contentHeight,
1742
+ boundingWidth,
1743
+ contentWidth,
1744
+ ruleLabelData,
1745
+ ruleLabelDataKeys
1746
+ ];
1747
+ }
1748
+
1749
+ class RuleLabels extends internal.SvelteComponent {
1750
+ constructor(options) {
1751
+ super();
1752
+ internal.init(this, options, instance$8, create_fragment$8, internal.safe_not_equal, { floorIndex: 4, floorplanData: 5 }, add_css$5);
1753
+ }
1754
+ }
1755
+
1756
+ function pathD(points, options = {}) {
1757
+ let d = '';
1758
+ const { needZ, needA } = options;
1759
+ const _points = needZ ? points.slice().concat(points[0]) : points.slice();
1760
+ _points.forEach((_point, index) => {
1761
+ const { x, y } = options.format ? options.format(_point) : _point;
1762
+ const point = x + ',' + y;
1763
+ if (index === 0) {
1764
+ d += 'M' + point;
1765
+ return d;
1766
+ }
1767
+ if (needA === null || needA === void 0 ? void 0 : needA[index]) {
1768
+ d += 'A' + needA[index] + ',' + point;
1769
+ return d;
1770
+ }
1771
+ d += 'L' + point;
1772
+ return d;
1773
+ });
1774
+ return d + (needZ ? 'Z' : '');
1775
+ }
1776
+ /** 把户型图上点点位转换到 SVG 上的点位 */
1777
+ function formatFloorplanPoint({ x, y }, bounding) {
1778
+ const { max, min } = bounding;
1779
+ return { x: x - min.x, y: max.y - y };
1780
+ }
1781
+
1782
+ /* src/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte generated by Svelte v3.47.0 */
1783
+
1784
+ function create_fragment$7(ctx) {
1785
+ let path_1;
1786
+
1787
+ return {
1788
+ c() {
1789
+ path_1 = internal.svg_element("path");
1790
+ internal.attr(path_1, "d", /*d*/ ctx[0]);
1791
+ internal.attr(path_1, "fill", "#2F313A");
1792
+ },
1793
+ m(target, anchor) {
1794
+ internal.insert(target, path_1, anchor);
1795
+ },
1796
+ p(ctx, [dirty]) {
1797
+ if (dirty & /*d*/ 1) {
1798
+ internal.attr(path_1, "d", /*d*/ ctx[0]);
1799
+ }
1800
+ },
1801
+ i: internal.noop,
1802
+ o: internal.noop,
1803
+ d(detaching) {
1804
+ if (detaching) internal.detach(path_1);
1805
+ }
1806
+ };
1807
+ }
1808
+
1809
+ function instance$7($$self, $$props, $$invalidate) {
1810
+ let d;
1811
+ let { path } = $$props;
1812
+
1813
+ $$self.$$set = $$props => {
1814
+ if ('path' in $$props) $$invalidate(1, path = $$props.path);
1815
+ };
1816
+
1817
+ $$self.$$.update = () => {
1818
+ if ($$self.$$.dirty & /*path*/ 2) {
1819
+ $$invalidate(0, d = pathD(path, { needZ: true }));
1820
+ }
1821
+ };
1822
+
1823
+ return [d, path];
1824
+ }
1825
+
1826
+ class RoomMaterial_0 extends internal.SvelteComponent {
1827
+ constructor(options) {
1828
+ super();
1829
+ internal.init(this, options, instance$7, create_fragment$7, internal.safe_not_equal, { path: 1 });
1830
+ }
1831
+ }
1832
+
1833
+ /* src/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte generated by Svelte v3.47.0 */
1834
+
1835
+ function create_fragment$6(ctx) {
1836
+ let defs;
1837
+ let pattern;
1838
+ let rect;
1839
+ let path0;
1840
+ let t;
1841
+ let path1;
1842
+
1843
+ return {
1844
+ c() {
1845
+ defs = internal.svg_element("defs");
1846
+ pattern = internal.svg_element("pattern");
1847
+ rect = internal.svg_element("rect");
1848
+ path0 = internal.svg_element("path");
1849
+ t = internal.space();
1850
+ path1 = internal.svg_element("path");
1851
+ internal.attr(rect, "x", "0");
1852
+ internal.attr(rect, "y", "0");
1853
+ internal.attr(rect, "width", /*width*/ ctx[1]);
1854
+ internal.attr(rect, "height", /*width*/ ctx[1]);
1855
+ internal.attr(rect, "fill", "#323747");
1856
+ internal.attr(path0, "d", /*patternPathD*/ ctx[2]);
1857
+ internal.attr(path0, "stroke", "#ffffff");
1858
+ internal.attr(path0, "stroke-opacity", "0.06");
1859
+ internal.attr(path0, "stroke-width", "0.5");
1860
+ internal.attr(path0, "fill", "none");
1861
+ internal.attr(pattern, "id", "fpm-room-pattern-0");
1862
+ internal.attr(pattern, "x", "0");
1863
+ internal.attr(pattern, "y", "0");
1864
+ internal.attr(pattern, "width", /*width*/ ctx[1]);
1865
+ internal.attr(pattern, "height", /*width*/ ctx[1]);
1866
+ internal.attr(pattern, "patternUnits", "userSpaceOnUse");
1867
+ internal.attr(pattern, "patternTransform", "scale(50 50)");
1868
+ internal.attr(path1, "d", /*d*/ ctx[0]);
1869
+ internal.attr(path1, "fill", "url(#fpm-room-pattern-0)");
1870
+ },
1871
+ m(target, anchor) {
1872
+ internal.insert(target, defs, anchor);
1873
+ internal.append(defs, pattern);
1874
+ internal.append(pattern, rect);
1875
+ internal.append(pattern, path0);
1876
+ internal.insert(target, t, anchor);
1877
+ internal.insert(target, path1, anchor);
1878
+ },
1879
+ p(ctx, [dirty]) {
1880
+ if (dirty & /*d*/ 1) {
1881
+ internal.attr(path1, "d", /*d*/ ctx[0]);
1882
+ }
1883
+ },
1884
+ i: internal.noop,
1885
+ o: internal.noop,
1886
+ d(detaching) {
1887
+ if (detaching) internal.detach(defs);
1888
+ if (detaching) internal.detach(t);
1889
+ if (detaching) internal.detach(path1);
1890
+ }
1891
+ };
1892
+ }
1893
+
1894
+ const halfWidth = 6;
1895
+
1896
+ function instance$6($$self, $$props, $$invalidate) {
1897
+ let d;
1898
+ let { path } = $$props;
1899
+ const width = halfWidth * 2;
1900
+ const patternPathD = `M0 ${halfWidth} h ${width} M${halfWidth} 0 v ${width}`;
1901
+
1902
+ $$self.$$set = $$props => {
1903
+ if ('path' in $$props) $$invalidate(3, path = $$props.path);
1904
+ };
1905
+
1906
+ $$self.$$.update = () => {
1907
+ if ($$self.$$.dirty & /*path*/ 8) {
1908
+ $$invalidate(0, d = pathD(path, { needZ: true }));
1909
+ }
1910
+ };
1911
+
1912
+ return [d, width, patternPathD, path];
1913
+ }
1914
+
1915
+ class RoomMaterial_1 extends internal.SvelteComponent {
1916
+ constructor(options) {
1917
+ super();
1918
+ internal.init(this, options, instance$6, create_fragment$6, internal.safe_not_equal, { path: 3 });
1919
+ }
1920
+ }
1921
+
1922
+ /* src/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte generated by Svelte v3.47.0 */
1923
+
1924
+ function create_fragment$5(ctx) {
1925
+ let defs;
1926
+ let pattern0;
1927
+ let rect0;
1928
+ let pattern1;
1929
+ let rect1;
1930
+ let t0;
1931
+ let path0;
1932
+ let t1;
1933
+ let path1;
1934
+ let t2;
1935
+ let path2;
1936
+
1937
+ return {
1938
+ c() {
1939
+ defs = internal.svg_element("defs");
1940
+ pattern0 = internal.svg_element("pattern");
1941
+ rect0 = internal.svg_element("rect");
1942
+ pattern1 = internal.svg_element("pattern");
1943
+ rect1 = internal.svg_element("rect");
1944
+ t0 = internal.space();
1945
+ path0 = internal.svg_element("path");
1946
+ t1 = internal.space();
1947
+ path1 = internal.svg_element("path");
1948
+ t2 = internal.space();
1949
+ path2 = internal.svg_element("path");
1950
+ internal.attr(rect0, "x", "0");
1951
+ internal.attr(rect0, "y", "0");
1952
+ internal.attr(rect0, "width", "6");
1953
+ internal.attr(rect0, "height", "50");
1954
+ internal.attr(rect0, "fill", "none");
1955
+ internal.attr(rect0, "stroke", "#4B4B57");
1956
+ internal.attr(rect0, "stroke-width", "0.5");
1957
+ internal.attr(pattern0, "id", "room-material-pattern-1");
1958
+ internal.attr(pattern0, "x", "0");
1959
+ internal.attr(pattern0, "y", "0");
1960
+ internal.attr(pattern0, "width", "12");
1961
+ internal.attr(pattern0, "height", "50");
1962
+ internal.attr(pattern0, "patternUnits", "userSpaceOnUse");
1963
+ internal.attr(pattern0, "patternTransform", "scale(50 50)");
1964
+ internal.attr(rect1, "x", "0");
1965
+ internal.attr(rect1, "y", "0");
1966
+ internal.attr(rect1, "width", "6");
1967
+ internal.attr(rect1, "height", "50");
1968
+ internal.attr(rect1, "fill", "none");
1969
+ internal.attr(rect1, "stroke", "#4B4B57");
1970
+ internal.attr(rect1, "stroke-width", "0.5");
1971
+ internal.attr(pattern1, "id", "room-material-pattern-2");
1972
+ internal.attr(pattern1, "x", "6");
1973
+ internal.attr(pattern1, "y", "25");
1974
+ internal.attr(pattern1, "width", "12");
1975
+ internal.attr(pattern1, "height", "50");
1976
+ internal.attr(pattern1, "patternUnits", "userSpaceOnUse");
1977
+ internal.attr(pattern1, "patternTransform", "scale(50 50)");
1978
+ internal.attr(path0, "d", /*d*/ ctx[0]);
1979
+ internal.attr(path0, "fill", "#43434D");
1980
+ internal.attr(path1, "d", /*d*/ ctx[0]);
1981
+ internal.attr(path1, "fill", "url(#room-material-pattern-1)");
1982
+ internal.attr(path2, "d", /*d*/ ctx[0]);
1983
+ internal.attr(path2, "fill", "url(#room-material-pattern-2)");
1984
+ },
1985
+ m(target, anchor) {
1986
+ internal.insert(target, defs, anchor);
1987
+ internal.append(defs, pattern0);
1988
+ internal.append(pattern0, rect0);
1989
+ internal.append(defs, pattern1);
1990
+ internal.append(pattern1, rect1);
1991
+ internal.insert(target, t0, anchor);
1992
+ internal.insert(target, path0, anchor);
1993
+ internal.insert(target, t1, anchor);
1994
+ internal.insert(target, path1, anchor);
1995
+ internal.insert(target, t2, anchor);
1996
+ internal.insert(target, path2, anchor);
1997
+ },
1998
+ p(ctx, [dirty]) {
1999
+ if (dirty & /*d*/ 1) {
2000
+ internal.attr(path0, "d", /*d*/ ctx[0]);
2001
+ }
2002
+
2003
+ if (dirty & /*d*/ 1) {
2004
+ internal.attr(path1, "d", /*d*/ ctx[0]);
2005
+ }
2006
+
2007
+ if (dirty & /*d*/ 1) {
2008
+ internal.attr(path2, "d", /*d*/ ctx[0]);
2009
+ }
2010
+ },
2011
+ i: internal.noop,
2012
+ o: internal.noop,
2013
+ d(detaching) {
2014
+ if (detaching) internal.detach(defs);
2015
+ if (detaching) internal.detach(t0);
2016
+ if (detaching) internal.detach(path0);
2017
+ if (detaching) internal.detach(t1);
2018
+ if (detaching) internal.detach(path1);
2019
+ if (detaching) internal.detach(t2);
2020
+ if (detaching) internal.detach(path2);
2021
+ }
2022
+ };
2023
+ }
2024
+
2025
+ function instance$5($$self, $$props, $$invalidate) {
2026
+ let d;
2027
+ let { path } = $$props;
2028
+
2029
+ $$self.$$set = $$props => {
2030
+ if ('path' in $$props) $$invalidate(1, path = $$props.path);
2031
+ };
2032
+
2033
+ $$self.$$.update = () => {
2034
+ if ($$self.$$.dirty & /*path*/ 2) {
2035
+ $$invalidate(0, d = pathD(path, { needZ: true }));
2036
+ }
2037
+ };
2038
+
2039
+ return [d, path];
2040
+ }
2041
+
2042
+ class RoomMaterial_2 extends internal.SvelteComponent {
2043
+ constructor(options) {
2044
+ super();
2045
+ internal.init(this, options, instance$5, create_fragment$5, internal.safe_not_equal, { path: 1 });
2046
+ }
2047
+ }
2048
+
2049
+ /* src/floorplan/Components/RoomMaterials/RoomMaterial.svelte generated by Svelte v3.47.0 */
2050
+
2051
+ function add_css$4(target) {
2052
+ internal.append_styles(target, "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}");
2053
+ }
2054
+
2055
+ function get_each_context$2(ctx, list, i) {
2056
+ const child_ctx = ctx.slice();
2057
+ child_ctx[5] = list[i];
2058
+ return child_ctx;
2059
+ }
2060
+
2061
+ // (19:6) {:else}
2062
+ function create_else_block(ctx) {
2063
+ let roommaterial_1;
2064
+ let current;
2065
+ roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[5].path } });
2066
+
2067
+ return {
2068
+ c() {
2069
+ internal.create_component(roommaterial_1.$$.fragment);
2070
+ },
2071
+ m(target, anchor) {
2072
+ internal.mount_component(roommaterial_1, target, anchor);
2073
+ current = true;
2074
+ },
2075
+ p(ctx, dirty) {
2076
+ const roommaterial_1_changes = {};
2077
+ if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[5].path;
2078
+ roommaterial_1.$set(roommaterial_1_changes);
2079
+ },
2080
+ i(local) {
2081
+ if (current) return;
2082
+ internal.transition_in(roommaterial_1.$$.fragment, local);
2083
+ current = true;
2084
+ },
2085
+ o(local) {
2086
+ internal.transition_out(roommaterial_1.$$.fragment, local);
2087
+ current = false;
2088
+ },
2089
+ d(detaching) {
2090
+ internal.destroy_component(roommaterial_1, detaching);
2091
+ }
2092
+ };
2093
+ }
2094
+
2095
+ // (17:37)
2096
+ function create_if_block_1$2(ctx) {
2097
+ let roommaterial_2;
2098
+ let current;
2099
+ roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[5].path } });
2100
+
2101
+ return {
2102
+ c() {
2103
+ internal.create_component(roommaterial_2.$$.fragment);
2104
+ },
2105
+ m(target, anchor) {
2106
+ internal.mount_component(roommaterial_2, target, anchor);
2107
+ current = true;
2108
+ },
2109
+ p(ctx, dirty) {
2110
+ const roommaterial_2_changes = {};
2111
+ if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[5].path;
2112
+ roommaterial_2.$set(roommaterial_2_changes);
2113
+ },
2114
+ i(local) {
2115
+ if (current) return;
2116
+ internal.transition_in(roommaterial_2.$$.fragment, local);
2117
+ current = true;
2118
+ },
2119
+ o(local) {
2120
+ internal.transition_out(roommaterial_2.$$.fragment, local);
2121
+ current = false;
2122
+ },
2123
+ d(detaching) {
2124
+ internal.destroy_component(roommaterial_2, detaching);
2125
+ }
2126
+ };
2127
+ }
2128
+
2129
+ // (15:6) {#if room.floorType === 1}
2130
+ function create_if_block$2(ctx) {
2131
+ let roommaterial_0;
2132
+ let current;
2133
+ roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[5].path } });
2134
+
2135
+ return {
2136
+ c() {
2137
+ internal.create_component(roommaterial_0.$$.fragment);
2138
+ },
2139
+ m(target, anchor) {
2140
+ internal.mount_component(roommaterial_0, target, anchor);
2141
+ current = true;
2142
+ },
2143
+ p(ctx, dirty) {
2144
+ const roommaterial_0_changes = {};
2145
+ if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[5].path;
2146
+ roommaterial_0.$set(roommaterial_0_changes);
2147
+ },
2148
+ i(local) {
2149
+ if (current) return;
2150
+ internal.transition_in(roommaterial_0.$$.fragment, local);
2151
+ current = true;
2152
+ },
2153
+ o(local) {
2154
+ internal.transition_out(roommaterial_0.$$.fragment, local);
2155
+ current = false;
2156
+ },
2157
+ d(detaching) {
2158
+ internal.destroy_component(roommaterial_0, detaching);
2159
+ }
2160
+ };
2161
+ }
2162
+
2163
+ // (13:2) {#each rooms as room}
2164
+ function create_each_block$2(ctx) {
2165
+ let svg;
2166
+ let current_block_type_index;
2167
+ let if_block;
2168
+ let svg_viewBox_value;
2169
+ let current;
2170
+ const if_block_creators = [create_if_block$2, create_if_block_1$2, create_else_block];
2171
+ const if_blocks = [];
2172
+
2173
+ function select_block_type(ctx, dirty) {
2174
+ if (/*room*/ ctx[5].floorType === 1) return 0;
2175
+ if (/*room*/ ctx[5].floorType === 0) return 1;
2176
+ return 2;
2177
+ }
2178
+
2179
+ current_block_type_index = select_block_type(ctx);
2180
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2181
+
2182
+ return {
2183
+ c() {
2184
+ svg = internal.svg_element("svg");
2185
+ if_block.c();
2186
+ internal.attr(svg, "width", "100%");
2187
+ internal.attr(svg, "height", "100%");
2188
+ internal.attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[1]} ${/*boundingHeight*/ ctx[2]}`);
2189
+ internal.attr(svg, "class", "svelte-1dykexu");
2190
+ },
2191
+ m(target, anchor) {
2192
+ internal.insert(target, svg, anchor);
2193
+ if_blocks[current_block_type_index].m(svg, null);
2194
+ current = true;
2195
+ },
2196
+ p(ctx, dirty) {
2197
+ let previous_block_index = current_block_type_index;
2198
+ current_block_type_index = select_block_type(ctx);
2199
+
2200
+ if (current_block_type_index === previous_block_index) {
2201
+ if_blocks[current_block_type_index].p(ctx, dirty);
2202
+ } else {
2203
+ internal.group_outros();
2204
+
2205
+ internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
2206
+ if_blocks[previous_block_index] = null;
2207
+ });
2208
+
2209
+ internal.check_outros();
2210
+ if_block = if_blocks[current_block_type_index];
2211
+
2212
+ if (!if_block) {
2213
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2214
+ if_block.c();
2215
+ } else {
2216
+ if_block.p(ctx, dirty);
2217
+ }
2218
+
2219
+ internal.transition_in(if_block, 1);
2220
+ if_block.m(svg, null);
2221
+ }
2222
+ },
2223
+ i(local) {
2224
+ if (current) return;
2225
+ internal.transition_in(if_block);
2226
+ current = true;
2227
+ },
2228
+ o(local) {
2229
+ internal.transition_out(if_block);
2230
+ current = false;
2231
+ },
2232
+ d(detaching) {
2233
+ if (detaching) internal.detach(svg);
2234
+ if_blocks[current_block_type_index].d();
2235
+ }
2236
+ };
2237
+ }
2238
+
2239
+ function create_fragment$4(ctx) {
2240
+ let div;
2241
+ let current;
2242
+ let each_value = /*rooms*/ ctx[0];
2243
+ let each_blocks = [];
2244
+
2245
+ for (let i = 0; i < each_value.length; i += 1) {
2246
+ each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
2247
+ }
2248
+
2249
+ const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
2250
+ each_blocks[i] = null;
2251
+ });
2252
+
2253
+ return {
2254
+ c() {
2255
+ div = internal.element("div");
2256
+
2257
+ for (let i = 0; i < each_blocks.length; i += 1) {
2258
+ each_blocks[i].c();
2259
+ }
2260
+
2261
+ internal.attr(div, "class", "floorplan-plugin__room-material svelte-1dykexu");
2262
+ },
2263
+ m(target, anchor) {
2264
+ internal.insert(target, div, anchor);
2265
+
2266
+ for (let i = 0; i < each_blocks.length; i += 1) {
2267
+ each_blocks[i].m(div, null);
2268
+ }
2269
+
2270
+ current = true;
2271
+ },
2272
+ p(ctx, [dirty]) {
2273
+ if (dirty & /*boundingWidth, boundingHeight, rooms*/ 7) {
2274
+ each_value = /*rooms*/ ctx[0];
2275
+ let i;
2276
+
2277
+ for (i = 0; i < each_value.length; i += 1) {
2278
+ const child_ctx = get_each_context$2(ctx, each_value, i);
2279
+
2280
+ if (each_blocks[i]) {
2281
+ each_blocks[i].p(child_ctx, dirty);
2282
+ internal.transition_in(each_blocks[i], 1);
2283
+ } else {
2284
+ each_blocks[i] = create_each_block$2(child_ctx);
2285
+ each_blocks[i].c();
2286
+ internal.transition_in(each_blocks[i], 1);
2287
+ each_blocks[i].m(div, null);
2288
+ }
2289
+ }
2290
+
2291
+ internal.group_outros();
2292
+
2293
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
2294
+ out(i);
2295
+ }
2296
+
2297
+ internal.check_outros();
2298
+ }
2299
+ },
2300
+ i(local) {
2301
+ if (current) return;
2302
+
2303
+ for (let i = 0; i < each_value.length; i += 1) {
2304
+ internal.transition_in(each_blocks[i]);
2305
+ }
2306
+
2307
+ current = true;
2308
+ },
2309
+ o(local) {
2310
+ each_blocks = each_blocks.filter(Boolean);
2311
+
2312
+ for (let i = 0; i < each_blocks.length; i += 1) {
2313
+ internal.transition_out(each_blocks[i]);
2314
+ }
2315
+
2316
+ current = false;
2317
+ },
2318
+ d(detaching) {
2319
+ if (detaching) internal.detach(div);
2320
+ internal.destroy_each(each_blocks, detaching);
2321
+ }
2322
+ };
2323
+ }
2324
+
2325
+ function instance$4($$self, $$props, $$invalidate) {
2326
+ let rooms;
2327
+ let { floorIndex } = $$props;
2328
+ let { floorplanData } = $$props;
2329
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
2330
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
2331
+
2332
+ $$self.$$set = $$props => {
2333
+ if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
2334
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
2335
+ };
2336
+
2337
+ $$self.$$.update = () => {
2338
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
2339
+ $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => Object.assign(Object.assign({}, room), {
2340
+ path: room.path.map(p => formatFloorplanPoint(p, floorplanData.bounding))
2341
+ })));
2342
+ }
2343
+ };
2344
+
2345
+ return [rooms, boundingWidth, boundingHeight, floorIndex, floorplanData];
2346
+ }
2347
+
2348
+ class RoomMaterial extends internal.SvelteComponent {
2349
+ constructor(options) {
2350
+ super();
2351
+ internal.init(this, options, instance$4, create_fragment$4, internal.safe_not_equal, { floorIndex: 3, floorplanData: 4 }, add_css$4);
2352
+ }
2353
+ }
2354
+
2355
+ /* src/floorplan/Components/RoomHighlight/Room.svelte generated by Svelte v3.47.0 */
2356
+
2357
+ function add_css$3(target) {
2358
+ internal.append_styles(target, "svelte-19uvvss", "path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}");
2359
+ }
2360
+
2361
+ function create_fragment$3(ctx) {
2362
+ let path;
2363
+ let mounted;
2364
+ let dispose;
2365
+
2366
+ return {
2367
+ c() {
2368
+ path = internal.svg_element("path");
2369
+ internal.attr(path, "d", /*_pathD*/ ctx[2]);
2370
+ internal.attr(path, "fill", `#fff`);
2371
+ internal.attr(path, "class", "svelte-19uvvss");
2372
+ },
2373
+ m(target, anchor) {
2374
+ internal.insert(target, path, anchor);
2375
+
2376
+ if (!mounted) {
2377
+ dispose = [
2378
+ internal.listen(path, "mouseenter", /*onMouseEnter*/ ctx[0]),
2379
+ internal.listen(path, "mouseleave", /*onMouseLeave*/ ctx[1])
2380
+ ];
2381
+
2382
+ mounted = true;
2383
+ }
2384
+ },
2385
+ p: internal.noop,
2386
+ i: internal.noop,
2387
+ o: internal.noop,
2388
+ d(detaching) {
2389
+ if (detaching) internal.detach(path);
2390
+ mounted = false;
2391
+ internal.run_all(dispose);
2392
+ }
2393
+ };
2394
+ }
2395
+
2396
+ function instance$3($$self, $$props, $$invalidate) {
2397
+ let { room } = $$props;
2398
+ let { floorplanData } = $$props;
2399
+ let { hoveredRoom } = $$props;
2400
+
2401
+ function onMouseEnter() {
2402
+ hoveredRoom.set(room);
2403
+ }
2404
+
2405
+ function onMouseLeave() {
2406
+ hoveredRoom.set(undefined);
2407
+ }
2408
+
2409
+ const { bounding } = floorplanData;
2410
+
2411
+ const _pathD = pathD(room.path, {
2412
+ needZ: true,
2413
+ format: vector => formatFloorplanPoint(vector, bounding)
2414
+ });
2415
+
2416
+ $$self.$$set = $$props => {
2417
+ if ('room' in $$props) $$invalidate(3, room = $$props.room);
2418
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
2419
+ if ('hoveredRoom' in $$props) $$invalidate(5, hoveredRoom = $$props.hoveredRoom);
2420
+ };
2421
+
2422
+ return [onMouseEnter, onMouseLeave, _pathD, room, floorplanData, hoveredRoom];
2423
+ }
2424
+
2425
+ class Room extends internal.SvelteComponent {
2426
+ constructor(options) {
2427
+ super();
2428
+
2429
+ internal.init(
2430
+ this,
2431
+ options,
2432
+ instance$3,
2433
+ create_fragment$3,
2434
+ internal.safe_not_equal,
2435
+ {
2436
+ room: 3,
2437
+ floorplanData: 4,
2438
+ hoveredRoom: 5
2439
+ },
2440
+ add_css$3
2441
+ );
2442
+ }
2443
+ }
2444
+
2445
+ /* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
2446
+
2447
+ function add_css$2(target) {
2448
+ internal.append_styles(target, "svelte-1kqo6e4", ".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}");
2449
+ }
2450
+
2451
+ function get_each_context$1(ctx, list, i) {
2452
+ const child_ctx = ctx.slice();
2453
+ child_ctx[5] = list[i];
2454
+ return child_ctx;
2455
+ }
2456
+
2457
+ // (11:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
2458
+ function create_each_block$1(key_1, ctx) {
2459
+ let first;
2460
+ let room;
2461
+ let current;
2462
+
2463
+ const room_spread_levels = [
2464
+ {
2465
+ room: /*room*/ ctx[5],
2466
+ floorplanData: /*floorplanData*/ ctx[1],
2467
+ hoveredRoom: /*hoveredRoom*/ ctx[2]
2468
+ }
2469
+ ];
2470
+
2471
+ let room_props = {};
2472
+
2473
+ for (let i = 0; i < room_spread_levels.length; i += 1) {
2474
+ room_props = internal.assign(room_props, room_spread_levels[i]);
2475
+ }
2476
+
2477
+ room = new Room({ props: room_props });
2478
+
2479
+ return {
2480
+ key: key_1,
2481
+ first: null,
2482
+ c() {
2483
+ first = internal.empty();
2484
+ internal.create_component(room.$$.fragment);
2485
+ this.first = first;
2486
+ },
2487
+ m(target, anchor) {
2488
+ internal.insert(target, first, anchor);
2489
+ internal.mount_component(room, target, anchor);
2490
+ current = true;
2491
+ },
2492
+ p(new_ctx, dirty) {
2493
+ ctx = new_ctx;
2494
+
2495
+ const room_changes = (dirty & /*floorplanData, floorIndex, hoveredRoom*/ 7)
2496
+ ? internal.get_spread_update(room_spread_levels, [
2497
+ {
2498
+ room: /*room*/ ctx[5],
2499
+ floorplanData: /*floorplanData*/ ctx[1],
2500
+ hoveredRoom: /*hoveredRoom*/ ctx[2]
2501
+ }
2502
+ ])
2503
+ : {};
2504
+
2505
+ room.$set(room_changes);
2506
+ },
2507
+ i(local) {
2508
+ if (current) return;
2509
+ internal.transition_in(room.$$.fragment, local);
2510
+ current = true;
2511
+ },
2512
+ o(local) {
2513
+ internal.transition_out(room.$$.fragment, local);
2514
+ current = false;
2515
+ },
2516
+ d(detaching) {
2517
+ if (detaching) internal.detach(first);
2518
+ internal.destroy_component(room, detaching);
2519
+ }
2520
+ };
2521
+ }
2522
+
2523
+ function create_fragment$2(ctx) {
2524
+ let div;
2525
+ let svg;
2526
+ let each_blocks = [];
2527
+ let each_1_lookup = new Map();
2528
+ let current;
2529
+ let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
2530
+ const get_key = ctx => /*room*/ ctx[5].id;
2531
+
2532
+ for (let i = 0; i < each_value.length; i += 1) {
2533
+ let child_ctx = get_each_context$1(ctx, each_value, i);
2534
+ let key = get_key(child_ctx);
2535
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$1(key, child_ctx));
2536
+ }
2537
+
2538
+ return {
2539
+ c() {
2540
+ div = internal.element("div");
2541
+ svg = internal.svg_element("svg");
2542
+
2543
+ for (let i = 0; i < each_blocks.length; i += 1) {
2544
+ each_blocks[i].c();
2545
+ }
2546
+
2547
+ internal.attr(svg, "width", "100%");
2548
+ internal.attr(svg, "height", "100%");
2549
+ internal.attr(svg, "viewBox", `0 0 ${/*boundingWidth*/ ctx[3]} ${/*boundingHeight*/ ctx[4]}`);
2550
+ internal.attr(svg, "class", "svelte-1kqo6e4");
2551
+ internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1kqo6e4");
2552
+ },
2553
+ m(target, anchor) {
2554
+ internal.insert(target, div, anchor);
2555
+ internal.append(div, svg);
2556
+
2557
+ for (let i = 0; i < each_blocks.length; i += 1) {
2558
+ each_blocks[i].m(svg, null);
2559
+ }
2560
+
2561
+ current = true;
2562
+ },
2563
+ p(ctx, [dirty]) {
2564
+ if (dirty & /*floorplanData, floorIndex, hoveredRoom*/ 7) {
2565
+ each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
2566
+ internal.group_outros();
2567
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block$1, null, get_each_context$1);
2568
+ internal.check_outros();
2569
+ }
2570
+ },
2571
+ i(local) {
2572
+ if (current) return;
2573
+
2574
+ for (let i = 0; i < each_value.length; i += 1) {
2575
+ internal.transition_in(each_blocks[i]);
2576
+ }
2577
+
2578
+ current = true;
2579
+ },
2580
+ o(local) {
2581
+ for (let i = 0; i < each_blocks.length; i += 1) {
2582
+ internal.transition_out(each_blocks[i]);
2583
+ }
2584
+
2585
+ current = false;
2586
+ },
2587
+ d(detaching) {
2588
+ if (detaching) internal.detach(div);
2589
+
2590
+ for (let i = 0; i < each_blocks.length; i += 1) {
2591
+ each_blocks[i].d();
2592
+ }
2593
+ }
2594
+ };
2595
+ }
2596
+
2597
+ function instance$2($$self, $$props, $$invalidate) {
2598
+ let { floorIndex } = $$props;
2599
+ let { floorplanData } = $$props;
2600
+ let { hoveredRoom } = $$props;
2601
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
2602
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
2603
+
2604
+ $$self.$$set = $$props => {
2605
+ if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
2606
+ if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
2607
+ if ('hoveredRoom' in $$props) $$invalidate(2, hoveredRoom = $$props.hoveredRoom);
2608
+ };
2609
+
2610
+ return [floorIndex, floorplanData, hoveredRoom, boundingWidth, boundingHeight];
2611
+ }
2612
+
2613
+ class RoomHighlight extends internal.SvelteComponent {
2614
+ constructor(options) {
2615
+ super();
2616
+
2617
+ internal.init(
2618
+ this,
2619
+ options,
2620
+ instance$2,
2621
+ create_fragment$2,
2622
+ internal.safe_not_equal,
2623
+ {
2624
+ floorIndex: 0,
2625
+ floorplanData: 1,
2626
+ hoveredRoom: 2
2627
+ },
2628
+ add_css$2
2629
+ );
2630
+ }
2631
+ }
2632
+
2633
+ /* src/floorplan/Components/CurrentFloor.svelte generated by Svelte v3.47.0 */
2634
+
2635
+ function add_css$1(target) {
2636
+ internal.append_styles(target, "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}");
2637
+ }
2638
+
2639
+ // (20:2) {#if hoverEnable}
2640
+ function create_if_block_2(ctx) {
2641
+ let roomhighlight;
2642
+ let current;
2643
+
2644
+ const roomhighlight_spread_levels = [
2645
+ {
2646
+ floorIndex: /*floorIndex*/ ctx[1],
2647
+ floorplanData: /*floorplanData*/ ctx[5],
2648
+ hoveredRoom: /*hoveredRoom*/ ctx[8]
2649
+ }
2650
+ ];
2651
+
2652
+ let roomhighlight_props = {};
2653
+
2654
+ for (let i = 0; i < roomhighlight_spread_levels.length; i += 1) {
2655
+ roomhighlight_props = internal.assign(roomhighlight_props, roomhighlight_spread_levels[i]);
2656
+ }
2657
+
2658
+ roomhighlight = new RoomHighlight({ props: roomhighlight_props });
2659
+
2660
+ return {
2661
+ c() {
2662
+ internal.create_component(roomhighlight.$$.fragment);
2663
+ },
2664
+ m(target, anchor) {
2665
+ internal.mount_component(roomhighlight, target, anchor);
2666
+ current = true;
2667
+ },
2668
+ p(ctx, dirty) {
2669
+ const roomhighlight_changes = (dirty & /*floorIndex, floorplanData, hoveredRoom*/ 290)
2670
+ ? internal.get_spread_update(roomhighlight_spread_levels, [
2671
+ {
2672
+ floorIndex: /*floorIndex*/ ctx[1],
2673
+ floorplanData: /*floorplanData*/ ctx[5],
2674
+ hoveredRoom: /*hoveredRoom*/ ctx[8]
2675
+ }
2676
+ ])
2677
+ : {};
2678
+
2679
+ roomhighlight.$set(roomhighlight_changes);
2680
+ },
2681
+ i(local) {
2682
+ if (current) return;
2683
+ internal.transition_in(roomhighlight.$$.fragment, local);
2684
+ current = true;
2685
+ },
2686
+ o(local) {
2687
+ internal.transition_out(roomhighlight.$$.fragment, local);
2688
+ current = false;
2689
+ },
2690
+ d(detaching) {
2691
+ internal.destroy_component(roomhighlight, detaching);
2692
+ }
2693
+ };
2694
+ }
2695
+
2696
+ // (24:2) {#if roomLabelsEnable}
2697
+ function create_if_block_1$1(ctx) {
2698
+ let roomlabels;
2699
+ let current;
2700
+
2701
+ const roomlabels_spread_levels = [
2702
+ {
2703
+ floorplanData: /*floorplanData*/ ctx[5],
2704
+ floorIndex: /*floorIndex*/ ctx[1],
2705
+ getLabelElement: /*getLabelElement*/ ctx[6],
2706
+ hoveredRoom: /*hoveredRoom*/ ctx[8],
2707
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[7]
2708
+ }
2709
+ ];
2710
+
2711
+ let roomlabels_props = {};
2712
+
2713
+ for (let i = 0; i < roomlabels_spread_levels.length; i += 1) {
2714
+ roomlabels_props = internal.assign(roomlabels_props, roomlabels_spread_levels[i]);
2715
+ }
2716
+
2717
+ roomlabels = new RoomLabels({ props: roomlabels_props });
2718
+
2719
+ return {
2720
+ c() {
2721
+ internal.create_component(roomlabels.$$.fragment);
2722
+ },
2723
+ m(target, anchor) {
2724
+ internal.mount_component(roomlabels, target, anchor);
2725
+ current = true;
2726
+ },
2727
+ p(ctx, dirty) {
2728
+ const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement, hoveredRoom, adaptiveRoomLabelVisibleEnable*/ 482)
2729
+ ? internal.get_spread_update(roomlabels_spread_levels, [
2730
+ {
2731
+ floorplanData: /*floorplanData*/ ctx[5],
2732
+ floorIndex: /*floorIndex*/ ctx[1],
2733
+ getLabelElement: /*getLabelElement*/ ctx[6],
2734
+ hoveredRoom: /*hoveredRoom*/ ctx[8],
2735
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[7]
2736
+ }
2737
+ ])
2738
+ : {};
2739
+
2740
+ roomlabels.$set(roomlabels_changes);
2741
+ },
2742
+ i(local) {
2743
+ if (current) return;
2744
+ internal.transition_in(roomlabels.$$.fragment, local);
2745
+ current = true;
2746
+ },
2747
+ o(local) {
2748
+ internal.transition_out(roomlabels.$$.fragment, local);
2749
+ current = false;
2750
+ },
2751
+ d(detaching) {
2752
+ internal.destroy_component(roomlabels, detaching);
2753
+ }
2754
+ };
2755
+ }
2756
+
2757
+ // (27:2) {#if ruleLabelsEnable}
2758
+ function create_if_block$1(ctx) {
2759
+ let rulelabels;
2760
+ let current;
2761
+
2762
+ const rulelabels_spread_levels = [
2763
+ {
2764
+ floorplanData: /*floorplanData*/ ctx[5],
2765
+ floorIndex: /*floorIndex*/ ctx[1]
2766
+ }
2767
+ ];
2768
+
2769
+ let rulelabels_props = {};
2770
+
2771
+ for (let i = 0; i < rulelabels_spread_levels.length; i += 1) {
2772
+ rulelabels_props = internal.assign(rulelabels_props, rulelabels_spread_levels[i]);
2773
+ }
2774
+
2775
+ rulelabels = new RuleLabels({ props: rulelabels_props });
2776
+
2777
+ return {
2778
+ c() {
2779
+ internal.create_component(rulelabels.$$.fragment);
2780
+ },
2781
+ m(target, anchor) {
2782
+ internal.mount_component(rulelabels, target, anchor);
2783
+ current = true;
2784
+ },
2785
+ p(ctx, dirty) {
2786
+ const rulelabels_changes = (dirty & /*floorplanData, floorIndex*/ 34)
2787
+ ? internal.get_spread_update(rulelabels_spread_levels, [
2788
+ {
2789
+ floorplanData: /*floorplanData*/ ctx[5],
2790
+ floorIndex: /*floorIndex*/ ctx[1]
2791
+ }
2792
+ ])
2793
+ : {};
2794
+
2795
+ rulelabels.$set(rulelabels_changes);
2796
+ },
2797
+ i(local) {
2798
+ if (current) return;
2799
+ internal.transition_in(rulelabels.$$.fragment, local);
2800
+ current = true;
2801
+ },
2802
+ o(local) {
2803
+ internal.transition_out(rulelabels.$$.fragment, local);
2804
+ current = false;
2805
+ },
2806
+ d(detaching) {
2807
+ internal.destroy_component(rulelabels, detaching);
2808
+ }
2809
+ };
2810
+ }
2811
+
2812
+ function create_fragment$1(ctx) {
2813
+ let div;
2814
+ let roommaterial;
2815
+ let t0;
2816
+ let t1;
2817
+ let baseimage;
2818
+ let t2;
2819
+ let t3;
2820
+ let div_class_value;
2821
+ let current;
2822
+
2823
+ const roommaterial_spread_levels = [
2824
+ {
2825
+ floorIndex: /*floorIndex*/ ctx[1],
2826
+ floorplanData: /*floorplanData*/ ctx[5]
2827
+ }
2828
+ ];
2829
+
2830
+ let roommaterial_props = {};
2831
+
2832
+ for (let i = 0; i < roommaterial_spread_levels.length; i += 1) {
2833
+ roommaterial_props = internal.assign(roommaterial_props, roommaterial_spread_levels[i]);
2834
+ }
2835
+
2836
+ roommaterial = new RoomMaterial({ props: roommaterial_props });
2837
+ let if_block0 = /*hoverEnable*/ ctx[2] && create_if_block_2(ctx);
2838
+
2839
+ const baseimage_spread_levels = [
2840
+ {
2841
+ floorplanData: /*floorplanData*/ ctx[5],
2842
+ floorIndex: /*floorIndex*/ ctx[1]
2843
+ }
2844
+ ];
2845
+
2846
+ let baseimage_props = {};
2847
+
2848
+ for (let i = 0; i < baseimage_spread_levels.length; i += 1) {
2849
+ baseimage_props = internal.assign(baseimage_props, baseimage_spread_levels[i]);
2850
+ }
2851
+
2852
+ baseimage = new BaseImage({ props: baseimage_props });
2853
+ let if_block1 = /*roomLabelsEnable*/ ctx[3] && create_if_block_1$1(ctx);
2854
+ let if_block2 = /*ruleLabelsEnable*/ ctx[4] && create_if_block$1(ctx);
2855
+
2856
+ return {
2857
+ c() {
2858
+ div = internal.element("div");
2859
+ internal.create_component(roommaterial.$$.fragment);
2860
+ t0 = internal.space();
2861
+ if (if_block0) if_block0.c();
2862
+ t1 = internal.space();
2863
+ internal.create_component(baseimage.$$.fragment);
2864
+ t2 = internal.space();
2865
+ if (if_block1) if_block1.c();
2866
+ t3 = internal.space();
2867
+ if (if_block2) if_block2.c();
2868
+
2869
+ internal.attr(div, "class", div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
2870
+ ? ' floorplan-plugin__floor--is-current'
2871
+ : ''}`) + " svelte-bl8zrz"));
2872
+ },
2873
+ m(target, anchor) {
2874
+ internal.insert(target, div, anchor);
2875
+ internal.mount_component(roommaterial, div, null);
2876
+ internal.append(div, t0);
2877
+ if (if_block0) if_block0.m(div, null);
2878
+ internal.append(div, t1);
2879
+ internal.mount_component(baseimage, div, null);
2880
+ internal.append(div, t2);
2881
+ if (if_block1) if_block1.m(div, null);
2882
+ internal.append(div, t3);
2883
+ if (if_block2) if_block2.m(div, null);
2884
+ current = true;
2885
+ },
2886
+ p(ctx, [dirty]) {
2887
+ const roommaterial_changes = (dirty & /*floorIndex, floorplanData*/ 34)
2888
+ ? internal.get_spread_update(roommaterial_spread_levels, [
2889
+ {
2890
+ floorIndex: /*floorIndex*/ ctx[1],
2891
+ floorplanData: /*floorplanData*/ ctx[5]
2892
+ }
2893
+ ])
2894
+ : {};
2895
+
2896
+ roommaterial.$set(roommaterial_changes);
2897
+
2898
+ if (/*hoverEnable*/ ctx[2]) {
2899
+ if (if_block0) {
2900
+ if_block0.p(ctx, dirty);
2901
+
2902
+ if (dirty & /*hoverEnable*/ 4) {
2903
+ internal.transition_in(if_block0, 1);
2904
+ }
2905
+ } else {
2906
+ if_block0 = create_if_block_2(ctx);
2907
+ if_block0.c();
2908
+ internal.transition_in(if_block0, 1);
2909
+ if_block0.m(div, t1);
2910
+ }
2911
+ } else if (if_block0) {
2912
+ internal.group_outros();
2913
+
2914
+ internal.transition_out(if_block0, 1, 1, () => {
2915
+ if_block0 = null;
2916
+ });
2917
+
2918
+ internal.check_outros();
2919
+ }
2920
+
2921
+ const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 34)
2922
+ ? internal.get_spread_update(baseimage_spread_levels, [
2923
+ {
2924
+ floorplanData: /*floorplanData*/ ctx[5],
2925
+ floorIndex: /*floorIndex*/ ctx[1]
2926
+ }
2927
+ ])
2928
+ : {};
2929
+
2930
+ baseimage.$set(baseimage_changes);
2931
+
2932
+ if (/*roomLabelsEnable*/ ctx[3]) {
2933
+ if (if_block1) {
2934
+ if_block1.p(ctx, dirty);
2935
+
2936
+ if (dirty & /*roomLabelsEnable*/ 8) {
2937
+ internal.transition_in(if_block1, 1);
2938
+ }
2939
+ } else {
2940
+ if_block1 = create_if_block_1$1(ctx);
2941
+ if_block1.c();
2942
+ internal.transition_in(if_block1, 1);
2943
+ if_block1.m(div, t3);
2944
+ }
2945
+ } else if (if_block1) {
2946
+ internal.group_outros();
2947
+
2948
+ internal.transition_out(if_block1, 1, 1, () => {
2949
+ if_block1 = null;
2950
+ });
2951
+
2952
+ internal.check_outros();
2953
+ }
2954
+
2955
+ if (/*ruleLabelsEnable*/ ctx[4]) {
2956
+ if (if_block2) {
2957
+ if_block2.p(ctx, dirty);
2958
+
2959
+ if (dirty & /*ruleLabelsEnable*/ 16) {
2960
+ internal.transition_in(if_block2, 1);
2961
+ }
2962
+ } else {
2963
+ if_block2 = create_if_block$1(ctx);
2964
+ if_block2.c();
2965
+ internal.transition_in(if_block2, 1);
2966
+ if_block2.m(div, null);
2967
+ }
2968
+ } else if (if_block2) {
2969
+ internal.group_outros();
2970
+
2971
+ internal.transition_out(if_block2, 1, 1, () => {
2972
+ if_block2 = null;
2973
+ });
2974
+
2975
+ internal.check_outros();
2976
+ }
2977
+
2978
+ if (!current || dirty & /*isCurrent*/ 1 && div_class_value !== (div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
2979
+ ? ' floorplan-plugin__floor--is-current'
2980
+ : ''}`) + " svelte-bl8zrz"))) {
2981
+ internal.attr(div, "class", div_class_value);
2982
+ }
2983
+ },
2984
+ i(local) {
2985
+ if (current) return;
2986
+ internal.transition_in(roommaterial.$$.fragment, local);
2987
+ internal.transition_in(if_block0);
2988
+ internal.transition_in(baseimage.$$.fragment, local);
2989
+ internal.transition_in(if_block1);
2990
+ internal.transition_in(if_block2);
2991
+ current = true;
2992
+ },
2993
+ o(local) {
2994
+ internal.transition_out(roommaterial.$$.fragment, local);
2995
+ internal.transition_out(if_block0);
2996
+ internal.transition_out(baseimage.$$.fragment, local);
2997
+ internal.transition_out(if_block1);
2998
+ internal.transition_out(if_block2);
2999
+ current = false;
3000
+ },
3001
+ d(detaching) {
3002
+ if (detaching) internal.detach(div);
3003
+ internal.destroy_component(roommaterial);
3004
+ if (if_block0) if_block0.d();
3005
+ internal.destroy_component(baseimage);
3006
+ if (if_block1) if_block1.d();
3007
+ if (if_block2) if_block2.d();
3008
+ }
3009
+ };
3010
+ }
3011
+
3012
+ function instance$1($$self, $$props, $$invalidate) {
3013
+ let { isCurrent } = $$props;
3014
+ let { floorIndex } = $$props;
3015
+ let { hoverEnable } = $$props;
3016
+ let { roomLabelsEnable } = $$props;
3017
+ let { ruleLabelsEnable } = $$props;
3018
+ let { floorplanData } = $$props;
3019
+ let { getLabelElement } = $$props;
3020
+ let { adaptiveRoomLabelVisibleEnable } = $$props;
3021
+ const hoveredRoom = store.writable(undefined);
3022
+
3023
+ $$self.$$set = $$props => {
3024
+ if ('isCurrent' in $$props) $$invalidate(0, isCurrent = $$props.isCurrent);
3025
+ if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3026
+ if ('hoverEnable' in $$props) $$invalidate(2, hoverEnable = $$props.hoverEnable);
3027
+ if ('roomLabelsEnable' in $$props) $$invalidate(3, roomLabelsEnable = $$props.roomLabelsEnable);
3028
+ if ('ruleLabelsEnable' in $$props) $$invalidate(4, ruleLabelsEnable = $$props.ruleLabelsEnable);
3029
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
3030
+ if ('getLabelElement' in $$props) $$invalidate(6, getLabelElement = $$props.getLabelElement);
3031
+ if ('adaptiveRoomLabelVisibleEnable' in $$props) $$invalidate(7, adaptiveRoomLabelVisibleEnable = $$props.adaptiveRoomLabelVisibleEnable);
3032
+ };
3033
+
3034
+ return [
3035
+ isCurrent,
3036
+ floorIndex,
3037
+ hoverEnable,
3038
+ roomLabelsEnable,
3039
+ ruleLabelsEnable,
3040
+ floorplanData,
3041
+ getLabelElement,
3042
+ adaptiveRoomLabelVisibleEnable,
3043
+ hoveredRoom
3044
+ ];
3045
+ }
3046
+
3047
+ class CurrentFloor extends internal.SvelteComponent {
3048
+ constructor(options) {
3049
+ super();
3050
+
3051
+ internal.init(
3052
+ this,
3053
+ options,
3054
+ instance$1,
3055
+ create_fragment$1,
3056
+ internal.safe_not_equal,
3057
+ {
3058
+ isCurrent: 0,
3059
+ floorIndex: 1,
3060
+ hoverEnable: 2,
3061
+ roomLabelsEnable: 3,
3062
+ ruleLabelsEnable: 4,
3063
+ floorplanData: 5,
3064
+ getLabelElement: 6,
3065
+ adaptiveRoomLabelVisibleEnable: 7
3066
+ },
3067
+ add_css$1
3068
+ );
3069
+ }
3070
+ }
3071
+
3072
+ /* src/floorplan/Components/Main.svelte generated by Svelte v3.47.0 */
3073
+
3074
+ function add_css(target) {
3075
+ internal.append_styles(target, "svelte-86bqav", ".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}");
3076
+ }
3077
+
3078
+ function get_each_context(ctx, list, i) {
3079
+ const child_ctx = ctx.slice();
3080
+ child_ctx[14] = list[i];
3081
+ return child_ctx;
3082
+ }
3083
+
3084
+ // (22:0) {#if visible}
3085
+ function create_if_block(ctx) {
3086
+ let div;
3087
+ let t0;
3088
+ let camera;
3089
+ let t1;
3090
+ let div_intro;
3091
+ let current;
3092
+ let each_value = /*floorplanData*/ ctx[9].floorDatas;
3093
+ let each_blocks = [];
3094
+
3095
+ for (let i = 0; i < each_value.length; i += 1) {
3096
+ each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
3097
+ }
3098
+
3099
+ const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
3100
+ each_blocks[i] = null;
3101
+ });
3102
+
3103
+ const camera_spread_levels = [
3104
+ {
3105
+ panoIndex: /*panoIndex*/ ctx[3],
3106
+ floorplanData: /*floorplanData*/ ctx[9],
3107
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3108
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
3109
+ }
3110
+ ];
3111
+
3112
+ let camera_props = {};
3113
+
3114
+ for (let i = 0; i < camera_spread_levels.length; i += 1) {
3115
+ camera_props = internal.assign(camera_props, camera_spread_levels[i]);
3116
+ }
3117
+
3118
+ camera = new Camera({ props: camera_props });
3119
+ let if_block = /*compassEnable*/ ctx[6] && create_if_block_1(ctx);
3120
+
3121
+ return {
3122
+ c() {
3123
+ div = internal.element("div");
3124
+
3125
+ for (let i = 0; i < each_blocks.length; i += 1) {
3126
+ each_blocks[i].c();
3127
+ }
3128
+
3129
+ t0 = internal.space();
3130
+ internal.create_component(camera.$$.fragment);
3131
+ t1 = internal.space();
3132
+ if (if_block) if_block.c();
3133
+ internal.attr(div, "class", "floorplan-main svelte-86bqav");
3134
+ },
3135
+ m(target, anchor) {
3136
+ internal.insert(target, div, anchor);
3137
+
3138
+ for (let i = 0; i < each_blocks.length; i += 1) {
3139
+ each_blocks[i].m(div, null);
3140
+ }
3141
+
3142
+ internal.append(div, t0);
3143
+ internal.mount_component(camera, div, null);
3144
+ internal.append(div, t1);
3145
+ if (if_block) if_block.m(div, null);
3146
+ current = true;
3147
+ },
3148
+ p(new_ctx, dirty) {
3149
+ ctx = new_ctx;
3150
+
3151
+ if (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, adaptiveRoomLabelVisibleEnable, floorIndex*/ 13232) {
3152
+ each_value = /*floorplanData*/ ctx[9].floorDatas;
3153
+ let i;
3154
+
3155
+ for (i = 0; i < each_value.length; i += 1) {
3156
+ const child_ctx = get_each_context(ctx, each_value, i);
3157
+
3158
+ if (each_blocks[i]) {
3159
+ each_blocks[i].p(child_ctx, dirty);
3160
+ internal.transition_in(each_blocks[i], 1);
3161
+ } else {
3162
+ each_blocks[i] = create_each_block(child_ctx);
3163
+ each_blocks[i].c();
3164
+ internal.transition_in(each_blocks[i], 1);
3165
+ each_blocks[i].m(div, t0);
3166
+ }
3167
+ }
3168
+
3169
+ internal.group_outros();
3170
+
3171
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
3172
+ out(i);
3173
+ }
3174
+
3175
+ internal.check_outros();
3176
+ }
3177
+
3178
+ const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 3592)
3179
+ ? internal.get_spread_update(camera_spread_levels, [
3180
+ {
3181
+ panoIndex: /*panoIndex*/ ctx[3],
3182
+ floorplanData: /*floorplanData*/ ctx[9],
3183
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3184
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
3185
+ }
3186
+ ])
3187
+ : {};
3188
+
3189
+ camera.$set(camera_changes);
3190
+
3191
+ if (/*compassEnable*/ ctx[6]) {
3192
+ if (if_block) {
3193
+ if_block.p(ctx, dirty);
3194
+
3195
+ if (dirty & /*compassEnable*/ 64) {
3196
+ internal.transition_in(if_block, 1);
3197
+ }
3198
+ } else {
3199
+ if_block = create_if_block_1(ctx);
3200
+ if_block.c();
3201
+ internal.transition_in(if_block, 1);
3202
+ if_block.m(div, null);
3203
+ }
3204
+ } else if (if_block) {
3205
+ internal.group_outros();
3206
+
3207
+ internal.transition_out(if_block, 1, 1, () => {
3208
+ if_block = null;
3209
+ });
3210
+
3211
+ internal.check_outros();
3212
+ }
3213
+ },
3214
+ i(local) {
3215
+ if (current) return;
3216
+
3217
+ for (let i = 0; i < each_value.length; i += 1) {
3218
+ internal.transition_in(each_blocks[i]);
3219
+ }
3220
+
3221
+ internal.transition_in(camera.$$.fragment, local);
3222
+ internal.transition_in(if_block);
3223
+
3224
+ if (!div_intro) {
3225
+ internal.add_render_callback(() => {
3226
+ div_intro = internal.create_in_transition(div, transition.fade, {
3227
+ duration: /*duration*/ ctx[0],
3228
+ easing: easing.linear
3229
+ });
3230
+
3231
+ div_intro.start();
3232
+ });
3233
+ }
3234
+
3235
+ current = true;
3236
+ },
3237
+ o(local) {
3238
+ each_blocks = each_blocks.filter(Boolean);
3239
+
3240
+ for (let i = 0; i < each_blocks.length; i += 1) {
3241
+ internal.transition_out(each_blocks[i]);
3242
+ }
3243
+
3244
+ internal.transition_out(camera.$$.fragment, local);
3245
+ internal.transition_out(if_block);
3246
+ current = false;
3247
+ },
3248
+ d(detaching) {
3249
+ if (detaching) internal.detach(div);
3250
+ internal.destroy_each(each_blocks, detaching);
3251
+ internal.destroy_component(camera);
3252
+ if (if_block) if_block.d();
3253
+ }
3254
+ };
3255
+ }
3256
+
3257
+ // (24:4) {#each floorplanData.floorDatas as floorData}
3258
+ function create_each_block(ctx) {
3259
+ let currentfloor;
3260
+ let current;
3261
+
3262
+ const currentfloor_spread_levels = [
3263
+ {
3264
+ hoverEnable: /*hoverEnable*/ ctx[5],
3265
+ floorplanData: /*floorplanData*/ ctx[9],
3266
+ getLabelElement: /*getLabelElement*/ ctx[12],
3267
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
3268
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8],
3269
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[13]
3270
+ },
3271
+ {
3272
+ floorIndex: /*floorData*/ ctx[14].floorIndex
3273
+ },
3274
+ {
3275
+ isCurrent: /*floorData*/ ctx[14].floorIndex === /*floorIndex*/ ctx[4]
3276
+ }
3277
+ ];
3278
+
3279
+ let currentfloor_props = {};
3280
+
3281
+ for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
3282
+ currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
3283
+ }
3284
+
3285
+ currentfloor = new CurrentFloor({ props: currentfloor_props });
3286
+
3287
+ return {
3288
+ c() {
3289
+ internal.create_component(currentfloor.$$.fragment);
3290
+ },
3291
+ m(target, anchor) {
3292
+ internal.mount_component(currentfloor, target, anchor);
3293
+ current = true;
3294
+ },
3295
+ p(ctx, dirty) {
3296
+ const currentfloor_changes = (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, adaptiveRoomLabelVisibleEnable, floorIndex*/ 13232)
3297
+ ? internal.get_spread_update(currentfloor_spread_levels, [
3298
+ dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, adaptiveRoomLabelVisibleEnable*/ 13216 && {
3299
+ hoverEnable: /*hoverEnable*/ ctx[5],
3300
+ floorplanData: /*floorplanData*/ ctx[9],
3301
+ getLabelElement: /*getLabelElement*/ ctx[12],
3302
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
3303
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8],
3304
+ adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[13]
3305
+ },
3306
+ dirty & /*floorplanData*/ 512 && {
3307
+ floorIndex: /*floorData*/ ctx[14].floorIndex
3308
+ },
3309
+ dirty & /*floorplanData, floorIndex*/ 528 && {
3310
+ isCurrent: /*floorData*/ ctx[14].floorIndex === /*floorIndex*/ ctx[4]
3311
+ }
3312
+ ])
3313
+ : {};
3314
+
3315
+ currentfloor.$set(currentfloor_changes);
3316
+ },
3317
+ i(local) {
3318
+ if (current) return;
3319
+ internal.transition_in(currentfloor.$$.fragment, local);
3320
+ current = true;
3321
+ },
3322
+ o(local) {
3323
+ internal.transition_out(currentfloor.$$.fragment, local);
3324
+ current = false;
3325
+ },
3326
+ d(detaching) {
3327
+ internal.destroy_component(currentfloor, detaching);
3328
+ }
3329
+ };
3330
+ }
3331
+
3332
+ // (39:4) {#if compassEnable}
3333
+ function create_if_block_1(ctx) {
3334
+ let compass;
3335
+ let current;
3336
+
3337
+ compass = new Compass({
3338
+ props: {
3339
+ floorplanData: /*floorplanData*/ ctx[9],
3340
+ northDesc: /*northDesc*/ ctx[2]
3341
+ }
3342
+ });
3343
+
3344
+ return {
3345
+ c() {
3346
+ internal.create_component(compass.$$.fragment);
3347
+ },
3348
+ m(target, anchor) {
3349
+ internal.mount_component(compass, target, anchor);
3350
+ current = true;
3351
+ },
3352
+ p(ctx, dirty) {
3353
+ const compass_changes = {};
3354
+ if (dirty & /*floorplanData*/ 512) compass_changes.floorplanData = /*floorplanData*/ ctx[9];
3355
+ if (dirty & /*northDesc*/ 4) compass_changes.northDesc = /*northDesc*/ ctx[2];
3356
+ compass.$set(compass_changes);
3357
+ },
3358
+ i(local) {
3359
+ if (current) return;
3360
+ internal.transition_in(compass.$$.fragment, local);
3361
+ current = true;
3362
+ },
3363
+ o(local) {
3364
+ internal.transition_out(compass.$$.fragment, local);
3365
+ current = false;
3366
+ },
3367
+ d(detaching) {
3368
+ internal.destroy_component(compass, detaching);
3369
+ }
3370
+ };
3371
+ }
3372
+
3373
+ function create_fragment(ctx) {
3374
+ let if_block_anchor;
3375
+ let current;
3376
+ let if_block = /*visible*/ ctx[1] && create_if_block(ctx);
3377
+
3378
+ return {
3379
+ c() {
3380
+ if (if_block) if_block.c();
3381
+ if_block_anchor = internal.empty();
3382
+ },
3383
+ m(target, anchor) {
3384
+ if (if_block) if_block.m(target, anchor);
3385
+ internal.insert(target, if_block_anchor, anchor);
3386
+ current = true;
3387
+ },
3388
+ p(ctx, [dirty]) {
3389
+ if (/*visible*/ ctx[1]) {
3390
+ if (if_block) {
3391
+ if_block.p(ctx, dirty);
3392
+
3393
+ if (dirty & /*visible*/ 2) {
3394
+ internal.transition_in(if_block, 1);
3395
+ }
3396
+ } else {
3397
+ if_block = create_if_block(ctx);
3398
+ if_block.c();
3399
+ internal.transition_in(if_block, 1);
3400
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
3401
+ }
3402
+ } else if (if_block) {
3403
+ internal.group_outros();
3404
+
3405
+ internal.transition_out(if_block, 1, 1, () => {
3406
+ if_block = null;
3407
+ });
3408
+
3409
+ internal.check_outros();
3410
+ }
3411
+ },
3412
+ i(local) {
3413
+ if (current) return;
3414
+ internal.transition_in(if_block);
3415
+ current = true;
3416
+ },
3417
+ o(local) {
3418
+ internal.transition_out(if_block);
3419
+ current = false;
3420
+ },
3421
+ d(detaching) {
3422
+ if (if_block) if_block.d(detaching);
3423
+ if (detaching) internal.detach(if_block_anchor);
3424
+ }
3425
+ };
3426
+ }
3427
+
3428
+ function instance($$self, $$props, $$invalidate) {
3429
+ let { duration = 0 } = $$props;
3430
+ let { visible } = $$props;
3431
+ let { northDesc } = $$props;
3432
+ let { panoIndex } = $$props;
3433
+ let { floorIndex } = $$props;
3434
+ let { hoverEnable } = $$props;
3435
+ let { compassEnable } = $$props;
3436
+ let { roomLabelsEnable } = $$props;
3437
+ let { ruleLabelsEnable } = $$props;
3438
+ let { floorplanData } = $$props;
3439
+ let { lastPanoramaLongitude } = $$props;
3440
+ let { cameraImageUrl } = $$props;
3441
+ let { getLabelElement } = $$props;
3442
+ let { adaptiveRoomLabelVisibleEnable } = $$props;
3443
+
3444
+ $$self.$$set = $$props => {
3445
+ if ('duration' in $$props) $$invalidate(0, duration = $$props.duration);
3446
+ if ('visible' in $$props) $$invalidate(1, visible = $$props.visible);
3447
+ if ('northDesc' in $$props) $$invalidate(2, northDesc = $$props.northDesc);
3448
+ if ('panoIndex' in $$props) $$invalidate(3, panoIndex = $$props.panoIndex);
3449
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
3450
+ if ('hoverEnable' in $$props) $$invalidate(5, hoverEnable = $$props.hoverEnable);
3451
+ if ('compassEnable' in $$props) $$invalidate(6, compassEnable = $$props.compassEnable);
3452
+ if ('roomLabelsEnable' in $$props) $$invalidate(7, roomLabelsEnable = $$props.roomLabelsEnable);
3453
+ if ('ruleLabelsEnable' in $$props) $$invalidate(8, ruleLabelsEnable = $$props.ruleLabelsEnable);
3454
+ if ('floorplanData' in $$props) $$invalidate(9, floorplanData = $$props.floorplanData);
3455
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(10, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
3456
+ if ('cameraImageUrl' in $$props) $$invalidate(11, cameraImageUrl = $$props.cameraImageUrl);
3457
+ if ('getLabelElement' in $$props) $$invalidate(12, getLabelElement = $$props.getLabelElement);
3458
+ if ('adaptiveRoomLabelVisibleEnable' in $$props) $$invalidate(13, adaptiveRoomLabelVisibleEnable = $$props.adaptiveRoomLabelVisibleEnable);
3459
+ };
3460
+
3461
+ return [
3462
+ duration,
3463
+ visible,
3464
+ northDesc,
3465
+ panoIndex,
3466
+ floorIndex,
3467
+ hoverEnable,
3468
+ compassEnable,
3469
+ roomLabelsEnable,
3470
+ ruleLabelsEnable,
3471
+ floorplanData,
3472
+ lastPanoramaLongitude,
3473
+ cameraImageUrl,
3474
+ getLabelElement,
3475
+ adaptiveRoomLabelVisibleEnable
3476
+ ];
3477
+ }
3478
+
3479
+ class Main extends internal.SvelteComponent {
3480
+ constructor(options) {
3481
+ super();
3482
+
3483
+ internal.init(
3484
+ this,
3485
+ options,
3486
+ instance,
3487
+ create_fragment,
3488
+ internal.safe_not_equal,
3489
+ {
3490
+ duration: 0,
3491
+ visible: 1,
3492
+ northDesc: 2,
3493
+ panoIndex: 3,
3494
+ floorIndex: 4,
3495
+ hoverEnable: 5,
3496
+ compassEnable: 6,
3497
+ roomLabelsEnable: 7,
3498
+ ruleLabelsEnable: 8,
3499
+ floorplanData: 9,
3500
+ lastPanoramaLongitude: 10,
3501
+ cameraImageUrl: 11,
3502
+ getLabelElement: 12,
3503
+ adaptiveRoomLabelVisibleEnable: 13
3504
+ },
3505
+ add_css
3506
+ );
3507
+ }
3508
+ }
3509
+
3510
+ async function formatOutlines(outlines) {
3511
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
3512
+ const getOutlineItem = async function (item) {
3513
+ const outlineItem = {
3514
+ index: item.index,
3515
+ url: item.url,
3516
+ svgUrl: item.svg_url,
3517
+ };
3518
+ if (item.svg_url) {
3519
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
3520
+ outlineItem.svgContent = svgContent;
3521
+ }
3522
+ return outlineItem;
3523
+ };
3524
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
3525
+ return svgOutlineItems;
3526
+ }
3527
+ function formatRoom(data) {
3528
+ const floorplanRoomItem = {
3529
+ id: data.id,
3530
+ size: data.size,
3531
+ name: data.name,
3532
+ path: data.path,
3533
+ roomType: data.room_type,
3534
+ floorType: data.floor_type,
3535
+ roomLabel: {
3536
+ position: data.room_label.position,
3537
+ positionInImage: data.room_label.position_in_image,
3538
+ },
3539
+ observerIndexs: data.observer_indexs,
3540
+ };
3541
+ return floorplanRoomItem;
3542
+ }
3543
+ function formatFloorData(_data) {
3544
+ return {
3545
+ floorName: _data.floor_name,
3546
+ floorIndex: _data.floor_index,
3547
+ rooms: _data.rooms.map(formatRoom),
3548
+ rules: _data.rules,
3549
+ };
3550
+ }
3551
+ function formateFloorplanObserver(data) {
3552
+ const floorplanObserver = {
3553
+ index: data.index,
3554
+ floorIndex: data.floor_index,
3555
+ position: data.position,
3556
+ positionInImage: data.position_in_image,
3557
+ };
3558
+ return floorplanObserver;
3559
+ }
3560
+ function formatFloorplanEntrance(data) {
3561
+ const floorplanEntrance = {
3562
+ rad: data.rad,
3563
+ position: data.position,
3564
+ positionInImage: data.position_in_image,
3565
+ northRad: data.north_rad,
3566
+ roomId: data.room_id,
3567
+ floorIndex: data.floor_index,
3568
+ };
3569
+ return floorplanEntrance;
3570
+ }
3571
+ async function formatData(data) {
3572
+ const outlines = await formatOutlines(data.outlines);
3573
+ const bounding = data.computed_data.bounding;
3574
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
3575
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
3576
+ const floorplanData = {
3577
+ outlines,
3578
+ entrance,
3579
+ bounding,
3580
+ floorDatas,
3581
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
3582
+ };
3583
+ return floorplanData;
3584
+ }
3585
+
3586
+ /**
3587
+ * 把第一个参数传入第二个参数(函数)中并执行
3588
+ * 一般用于执行函数后返回变量。
3589
+ * @param {any} something
3590
+ * @param {function} callback
3591
+ * @return {any}
3592
+ */
3593
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3594
+ function tap(something, callback) {
3595
+ callback(something);
3596
+ return something;
3597
+ }
3598
+
3599
+ /**
3600
+ * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
3601
+ * @param object
3602
+ * @param props 排除的属性
3603
+ * @return
3604
+ */
3605
+ function omit(object, props) {
3606
+ return tap({}, (result) => {
3607
+ for (const name in object) {
3608
+ if (props.indexOf(name) !== -1)
3609
+ continue;
3610
+ result[name] = object[name];
3611
+ }
3612
+ });
3613
+ }
3614
+
3615
+ var FLOOR_PLAN_ATTACHED_TO;
3616
+ (function (FLOOR_PLAN_ATTACHED_TO) {
3617
+ FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["FLOOR"] = 1] = "FLOOR";
3618
+ FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["CEILING"] = 2] = "CEILING";
3619
+ FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["BOUNDING_CENTER"] = 3] = "BOUNDING_CENTER";
3620
+ })(FLOOR_PLAN_ATTACHED_TO || (FLOOR_PLAN_ATTACHED_TO = {}));
3621
+
3622
+ /**
3623
+ * plugin 的基本控制器
3624
+ */
3625
+ class Controller$2 {
3626
+ constructor(five$1) {
3627
+ Object.defineProperty(this, "five", {
3628
+ enumerable: true,
3629
+ configurable: true,
3630
+ writable: true,
3631
+ value: void 0
3632
+ });
3633
+ /**
3634
+ * 插件事件钩子
3635
+ */
3636
+ Object.defineProperty(this, "hooks", {
3637
+ enumerable: true,
3638
+ configurable: true,
3639
+ writable: true,
3640
+ value: new five.Subscribe()
3641
+ });
3642
+ this.five = five$1;
3643
+ }
3644
+ /**
3645
+ * 获取当前的插件状态,如果当初插件内存在需要通过动画变更的 state 值,则通过此方法可以得到中间状态
3646
+ */
3647
+ getCurrentState() {
3648
+ return this.state;
3649
+ }
3650
+ }
3651
+
3652
+ class Controller$1 extends Controller$2 {
3653
+ }
3654
+
3655
+ /**
3656
+ * 比较两个数字近似相等
3657
+ * @param num1 数字1
3658
+ * @param num2 数字2
3659
+ * @param accuracy 精度:精确到小数点后几位,默认精确到 小数点后四位
3660
+ */
3661
+ function nearlyEqual(num1, num2, accuracy = 4) {
3662
+ return Math.floor(num1 * Math.pow(10, accuracy)) === Math.floor(num2 * Math.pow(10, accuracy));
3663
+ }
3664
+
3665
+ /** 等待 five changeMode 结束
3666
+ * @description Promise 的状态只代表 mode 与预期是否一致,不保证参数的一致性
3667
+ */
3668
+ async function changeMode(five, changeModeParams) {
3669
+ await new Promise((resolve, reject) => {
3670
+ // 虽然 changeMode 是异步函数,但不代表异步流程结束代表切换 Mode 动画结束
3671
+ five.changeMode(...changeModeParams).catch((error) => reject(error));
3672
+ five.once('initAnimationEnded', () => {
3673
+ const fiveCurrentState = five.getCurrentState();
3674
+ const correctMode = changeModeParams[0];
3675
+ if (fiveCurrentState.mode !== correctMode)
3676
+ reject(new Error('mode 与预期不符'));
3677
+ /** 检测当前的 current pose 和传入的 pose 是否一致 */
3678
+ const checkPose = () => {
3679
+ const correctPose = changeModeParams[1];
3680
+ if (!correctPose)
3681
+ return true;
3682
+ return Object.keys(correctPose).every((key) => {
3683
+ const fivePoseItem = fiveCurrentState[key];
3684
+ if (fivePoseItem === undefined)
3685
+ return true;
3686
+ const correctPoseItem = correctPose[key];
3687
+ if (typeof fivePoseItem === 'number' && typeof correctPoseItem === 'number') {
3688
+ return nearlyEqual(fivePoseItem, correctPoseItem, 2);
3689
+ }
3690
+ return fivePoseItem === correctPoseItem;
3691
+ });
3692
+ };
3693
+ const checkPoseResult = checkPose();
3694
+ if (!checkPoseResult)
3695
+ reject(new Error('five pose 与预期不符'));
3696
+ resolve();
3697
+ });
3698
+ });
3699
+ }
3700
+
3701
+ /** 获取当前楼层地面的 Y 值 */
3702
+ function getFloorY(five, floorIndex) {
3703
+ const maxFloorIndex = Math.max(...five.work.observers.map((ob) => ob.floorIndex));
3704
+ return floorIndex > maxFloorIndex
3705
+ ? five.model.bounding.max.y
3706
+ : Math.max(...five.work.observers
3707
+ .filter((ob) => ob.floorIndex === floorIndex)
3708
+ .map((ob) => ob.standingPosition.y));
3709
+ }
3710
+ /** 获取当前吸附类型的 Y 值
3711
+ * * FLOOR_PLAN_ATTACHED_TO.FLOOR:当前楼层地板的 Y
3712
+ * * FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER:当前模型中心的 Y
3713
+ * * FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER:当前楼层天花板的 Y
3714
+ */
3715
+ function getAttachedY(five, floorIndex, attachedTo = FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER) {
3716
+ const currentFloorY = getFloorY(five, floorIndex);
3717
+ const nextFloorY = getFloorY(five, floorIndex + 1);
3718
+ if (attachedTo === FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER)
3719
+ return (five.model.bounding.max.y + five.model.bounding.min.y) / 2;
3720
+ else if (attachedTo === FLOOR_PLAN_ATTACHED_TO.CEILING)
3721
+ return nextFloorY;
3722
+ else
3723
+ return currentFloorY;
3724
+ }
3725
+ /**
3726
+ * 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
3727
+ * @param five five
3728
+ */
3729
+ function getPxmm(five, container, floorIndex, options) {
3730
+ const y = getAttachedY(five, floorIndex, options === null || options === void 0 ? void 0 : options.attachedTo);
3731
+ const originPosition = new THREE__namespace.Vector3(0, y, 0);
3732
+ const originPositionXUnit = new THREE__namespace.Vector3(1, y, 0);
3733
+ const mouse = originPosition.clone().project(five.camera);
3734
+ const xUnitMouse = originPositionXUnit.clone().project(five.camera);
3735
+ const pxmm = Math.abs((xUnitMouse.x - mouse.x) / 1000) * (container.getBoundingClientRect().width / 2);
3736
+ return pxmm;
3737
+ }
3738
+
3739
+ function changeModelCanvasOpacity(five, opacity, duration = 300) {
3740
+ const fiveEle = five.getElement();
3741
+ if (!fiveEle)
3742
+ return;
3743
+ fiveEle.style.opacity = opacity + '';
3744
+ fiveEle.style.transition = duration === 0 ? 'none' : `opacity ${duration}ms linear`;
3745
+ if (duration === 0)
3746
+ return;
3747
+ Promise.race([
3748
+ new Promise((res) => fiveEle.addEventListener('transitionend', res, { once: true })),
3749
+ new Promise((res) => setTimeout(res, duration)),
3750
+ ]).then(() => {
3751
+ fiveEle.style.transition = 'none';
3752
+ });
3753
+ }
3754
+
3755
+ class Controller extends Controller$1 {
3756
+ constructor(five, params) {
3757
+ super(five);
3758
+ // =============== public properties =================
3759
+ Object.defineProperty(this, "name", {
3760
+ enumerable: true,
3761
+ configurable: true,
3762
+ writable: true,
3763
+ value: 'topviewFloorplanPlugin'
3764
+ });
3765
+ Object.defineProperty(this, "state", {
3766
+ enumerable: true,
3767
+ configurable: true,
3768
+ writable: true,
3769
+ value: void 0
3770
+ });
3771
+ // =============== private properties =================
3772
+ Object.defineProperty(this, "data", {
3773
+ enumerable: true,
3774
+ configurable: true,
3775
+ writable: true,
3776
+ value: void 0
3777
+ });
3778
+ Object.defineProperty(this, "app", {
3779
+ enumerable: true,
3780
+ configurable: true,
3781
+ writable: true,
3782
+ value: undefined
3783
+ });
3784
+ Object.defineProperty(this, "selector", {
3785
+ enumerable: true,
3786
+ configurable: true,
3787
+ writable: true,
3788
+ value: void 0
3789
+ });
3790
+ Object.defineProperty(this, "panoIndex", {
3791
+ enumerable: true,
3792
+ configurable: true,
3793
+ writable: true,
3794
+ value: 0
3795
+ });
3796
+ Object.defineProperty(this, "floorIndex", {
3797
+ enumerable: true,
3798
+ configurable: true,
3799
+ writable: true,
3800
+ value: 0
3801
+ });
3802
+ /** 户型图父容器 */
3803
+ Object.defineProperty(this, "wrapper", {
3804
+ enumerable: true,
3805
+ configurable: true,
3806
+ writable: true,
3807
+ value: void 0
3808
+ });
3809
+ /** 户型图主容器 */
3810
+ Object.defineProperty(this, "container", {
3811
+ enumerable: true,
3812
+ configurable: true,
3813
+ writable: true,
3814
+ value: document.createElement('div')
3815
+ });
3816
+ /** 展示户型图图前,Five 的 Panorama Longitude */
3817
+ Object.defineProperty(this, "lastPanoramaLongitude", {
3818
+ enumerable: true,
3819
+ configurable: true,
3820
+ writable: true,
3821
+ value: 0
3822
+ });
3823
+ /** 户型图大小 */
3824
+ Object.defineProperty(this, "size", {
3825
+ enumerable: true,
3826
+ configurable: true,
3827
+ writable: true,
3828
+ value: { width: 0, height: 0 }
3829
+ });
3830
+ /** 是否已经执行过事件监听 */
3831
+ Object.defineProperty(this, "hasAddedEventListener", {
3832
+ enumerable: true,
3833
+ configurable: true,
3834
+ writable: true,
3835
+ value: false
3836
+ });
3837
+ /** 上一次隐藏是否是用户调用了 hide 导致的 */
3838
+ Object.defineProperty(this, "isHiddenByHideFunc", {
3839
+ enumerable: true,
3840
+ configurable: true,
3841
+ writable: true,
3842
+ value: false
3843
+ });
3844
+ /** 更新户型图大小 */
3845
+ Object.defineProperty(this, "updateSize", {
3846
+ enumerable: true,
3847
+ configurable: true,
3848
+ writable: true,
3849
+ value: () => {
3850
+ if (!this.data)
3851
+ return;
3852
+ if (!this.container || !this.wrapper)
3853
+ return;
3854
+ if (this.five.getCurrentState().mode !== 'Topview')
3855
+ return;
3856
+ // 计算户型图展示大小
3857
+ const { min, max } = this.data.bounding;
3858
+ const width = max.x - min.x;
3859
+ const height = max.y - min.y;
3860
+ // 每毫米对应的 px 值
3861
+ const options = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : undefined;
3862
+ const pxmm = getPxmm(this.five, this.wrapper, this.floorIndex, options);
3863
+ const _width = Math.ceil(width * pxmm);
3864
+ const _height = Math.ceil(height * pxmm);
3865
+ if (this.size.width === _width && this.size.height === _height)
3866
+ return;
3867
+ this.container.style.width = _width + 'px';
3868
+ this.container.style.height = _height + 'px';
3869
+ this.size = { width: _width, height: _height };
3870
+ }
3871
+ });
3872
+ /** 销毁插件 */
3873
+ Object.defineProperty(this, "dispose", {
3874
+ enumerable: true,
3875
+ configurable: true,
3876
+ writable: true,
3877
+ value: () => {
3878
+ var _a, _b;
3879
+ this.removeEventListener();
3880
+ (_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
3881
+ this.app = undefined;
3882
+ (_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
3883
+ this.data = undefined;
3884
+ this.wrapper = undefined;
3885
+ this.selector = undefined;
3886
+ this.hooks.emit('dispose');
3887
+ }
3888
+ });
3889
+ Object.defineProperty(this, "_disable", {
3890
+ enumerable: true,
3891
+ configurable: true,
3892
+ writable: true,
3893
+ value: (options) => {
3894
+ var _a, _b;
3895
+ const { userAction } = options;
3896
+ (_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
3897
+ this.app = undefined;
3898
+ (_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
3899
+ this.removeEventListener();
3900
+ this.hooks.emit('disable', { userAction });
3901
+ }
3902
+ });
3903
+ /** modelLoaded 之后自动执行 append container 操作 */
3904
+ Object.defineProperty(this, "onFiveModelLoaded", {
3905
+ enumerable: true,
3906
+ configurable: true,
3907
+ writable: true,
3908
+ value: () => {
3909
+ if (this.state.enabled === false)
3910
+ return;
3911
+ if (this.wrapper)
3912
+ return;
3913
+ if (!this.selector)
3914
+ return;
3915
+ const wrapper = this.selector instanceof Element ? this.selector : document.querySelector(this.selector);
3916
+ if (!wrapper)
3917
+ throw new Error('不正确的父容器选择器');
3918
+ this.wrapper = wrapper;
3919
+ wrapper.append(this.container);
3920
+ }
3921
+ });
3922
+ /** 非 Topview 态隐藏户型图 */
3923
+ Object.defineProperty(this, "onFiveModeChange", {
3924
+ enumerable: true,
3925
+ configurable: true,
3926
+ writable: true,
3927
+ value: (...[mode, , , , userAction]) => {
3928
+ if (mode !== 'Topview' && this.state.visible) {
3929
+ this.updateState({ visible: false }, userAction);
3930
+ this._hide({ userAction });
3931
+ }
3932
+ }
3933
+ });
3934
+ Object.defineProperty(this, "onFivePanoArrived", {
3935
+ enumerable: true,
3936
+ configurable: true,
3937
+ writable: true,
3938
+ value: (index) => {
3939
+ var _a;
3940
+ if (!((_a = this.five) === null || _a === void 0 ? void 0 : _a.work))
3941
+ return;
3942
+ this.panoIndex = index;
3943
+ this.floorIndex = this.five.work.observers[index].floorIndex;
3944
+ }
3945
+ });
3946
+ Object.defineProperty(this, "onFiveCameraUpdate", {
3947
+ enumerable: true,
3948
+ configurable: true,
3949
+ writable: true,
3950
+ value: (_, userAction) => {
3951
+ if (!this.state.visible)
3952
+ return;
3953
+ this.updatePosition();
3954
+ this.updateSize();
3955
+ }
3956
+ });
3957
+ Object.defineProperty(this, "onFiveWantsGesture", {
3958
+ enumerable: true,
3959
+ configurable: true,
3960
+ writable: true,
3961
+ value: (type) => {
3962
+ if (type !== 'pan' && type !== 'pinch' && type !== 'mouseWheel')
3963
+ return;
3964
+ if (this.state.visible && !this.state.config.gestureEnable)
3965
+ return false;
3966
+ }
3967
+ });
3968
+ Object.defineProperty(this, "onFiveWantsMoveToPano", {
3969
+ enumerable: true,
3970
+ configurable: true,
3971
+ writable: true,
3972
+ value: () => {
3973
+ if (this.state.visible && this.state.config.preventRoomClick)
3974
+ return false;
3975
+ }
3976
+ });
3977
+ /** 动画结束后是 Topview 态就展示户型图 */
3978
+ Object.defineProperty(this, "onFiveInitAnimationEnded", {
3979
+ enumerable: true,
3980
+ configurable: true,
3981
+ writable: true,
3982
+ value: (...[, , userAction]) => {
3983
+ const { mode } = this.five.getCurrentState();
3984
+ if (mode === 'Topview' && !this.isHiddenByHideFunc && !this.state.visible && this.state.config.autoShowEnable) {
3985
+ this.updateState({ visible: true }, userAction);
3986
+ this._show({ userAction });
3987
+ }
3988
+ }
3989
+ });
3990
+ Object.defineProperty(this, "onModelShownFloorChange", {
3991
+ enumerable: true,
3992
+ configurable: true,
3993
+ writable: true,
3994
+ value: (shownFloor) => {
3995
+ if (this.floorIndex === shownFloor)
3996
+ return;
3997
+ if (shownFloor === null) {
3998
+ const panoIndex = this.five.getCurrentState().panoIndex;
3999
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
4000
+ return;
4001
+ }
4002
+ // 模型楼层高亮改变时,自动进行楼层切换
4003
+ this.floorIndex = shownFloor;
4004
+ this.updateSize();
4005
+ this.render();
4006
+ }
4007
+ });
4008
+ if (params === null || params === void 0 ? void 0 : params.selector) {
4009
+ this.selector = params.selector;
4010
+ console.warn('不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法');
4011
+ }
4012
+ // =============== init State ===============
4013
+ const baseConfig = {
4014
+ northDesc: '北',
4015
+ modelOpacity: 1,
4016
+ hoverEnable: true,
4017
+ compassEnable: true,
4018
+ gestureEnable: false,
4019
+ autoShowEnable: true,
4020
+ ruleLabelsEnable: true,
4021
+ roomLabelsEnable: true,
4022
+ cameraImageUrl: CAMERA_IMAGE,
4023
+ attachedTo: FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER,
4024
+ getLabelElement: undefined,
4025
+ adaptiveRoomLabelVisibleEnable: true,
4026
+ };
4027
+ const paramsConfig = params ? omit(params, ['selector', 'scale']) : {};
4028
+ const config = Object.assign(Object.assign({}, baseConfig), paramsConfig);
4029
+ this.state = {
4030
+ enabled: true,
4031
+ visible: false,
4032
+ config,
4033
+ };
4034
+ // =============== init Container ===============
4035
+ this.initContainer();
4036
+ // =============== init Listener ===============
4037
+ // 注意插件声明周期内只监听一次的事件不放在 addEventListener 里面
4038
+ // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
4039
+ five.model.loaded ? this.onFiveModelLoaded() : five.once('modelLoaded', this.onFiveModelLoaded);
4040
+ five.once('dispose', this.dispose);
4041
+ this.addEventListener();
4042
+ }
4043
+ async load(serverData, state, userAction = true) {
4044
+ function isPluginServerData(serverData) {
4045
+ return Object.prototype.hasOwnProperty.apply(serverData, ['version']);
4046
+ }
4047
+ const _data = serverData;
4048
+ if (_data && !_data.version)
4049
+ console.warn('传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数');
4050
+ const copyData = JSON.parse(JSON.stringify(serverData));
4051
+ const _serverData = isPluginServerData(copyData) ? copyData.data : copyData;
4052
+ const prevData = this.data;
4053
+ this.data = await formatData(_serverData);
4054
+ this.hooks.emit('dataLoaded', this.data);
4055
+ this.hooks.emit('dataChange', this.data, prevData);
4056
+ if (state)
4057
+ this.updateState(state, userAction);
4058
+ this.render();
4059
+ }
4060
+ /** 更新户型图位置 */
4061
+ updatePosition() {
4062
+ var _a;
4063
+ const y = getAttachedY(this.five, this.floorIndex, this.state.config.attachedTo);
4064
+ const modelPosition = (_a = this.five.model) === null || _a === void 0 ? void 0 : _a.bounding.getCenter(new THREE__namespace.Vector3()).setY(y);
4065
+ if (!modelPosition)
4066
+ return;
4067
+ const ndcPosition = modelPosition.clone().project(this.five.camera);
4068
+ const left = (ndcPosition.x + 1) / 2;
4069
+ const top = -(ndcPosition.y - 1) / 2;
4070
+ this.container.style.left = left * 100 + '%';
4071
+ this.container.style.top = top * 100 + '%';
4072
+ }
4073
+ /** 把插件的渲染DOM插入到对应的容器中去 */
4074
+ appendTo(wrapper) {
4075
+ this.wrapper = wrapper;
4076
+ // 插件 disabled 时,只是不执行副作用,但是 wrapper 还是要赋值的,不然 enable 的时候找不到父容器
4077
+ if (!this.state.enabled)
4078
+ return;
4079
+ wrapper.appendChild(this.container);
4080
+ this.render();
4081
+ return this;
4082
+ }
4083
+ async show(options = {}) {
4084
+ // 已经展示完成了,不做任何操作
4085
+ if (this.state.visible)
4086
+ return;
4087
+ const userAction = options.userAction !== undefined ? options.userAction : true;
4088
+ this.updateState({ visible: true }, userAction);
4089
+ this._show({ userAction });
4090
+ }
4091
+ async hide(options = {}) {
4092
+ this.isHiddenByHideFunc = true;
4093
+ if (!this.state.visible)
4094
+ return;
4095
+ const userAction = options.userAction !== undefined ? options.userAction : true;
4096
+ this.updateState({ visible: false }, userAction);
4097
+ this._hide({ userAction });
4098
+ }
4099
+ enable(options = {}) {
4100
+ if (this.state.enabled)
4101
+ return;
4102
+ const userAction = options.userAction !== undefined ? options.userAction : true;
4103
+ this.updateState({ enabled: true }, options.userAction || userAction);
4104
+ this._enable({ userAction });
4105
+ }
4106
+ disable(options = {}) {
4107
+ if (!this.state.enabled)
4108
+ return;
4109
+ const userAction = options.userAction !== undefined ? options.userAction : true;
4110
+ this.updateState({ enabled: false }, options.userAction || userAction);
4111
+ this._disable({ userAction });
4112
+ }
4113
+ /** 更改插件 State */
4114
+ setState(state, options = {}) {
4115
+ const prevState = this.state;
4116
+ const userAction = options.userAction !== undefined ? options.userAction : true;
4117
+ this.updateState(state, userAction);
4118
+ if (state.enabled !== undefined && prevState.enabled !== state.enabled) {
4119
+ const options = { userAction };
4120
+ state.enabled ? this._enable(options) : this._disable(options);
4121
+ }
4122
+ if (state.visible !== undefined && prevState.visible !== state.visible) {
4123
+ const options = { userAction };
4124
+ state.visible ? this._show(options) : this._hide(options);
4125
+ }
4126
+ }
4127
+ async formatData(serverData) {
4128
+ return await formatData(serverData.data);
4129
+ }
4130
+ async _show(options) {
4131
+ if (!this.state.enabled)
4132
+ return;
4133
+ this.isHiddenByHideFunc = false;
4134
+ const { userAction } = options;
4135
+ this.hooks.emit('show', { userAction });
4136
+ if (this.five.getCurrentState().mode !== 'Topview') {
4137
+ await changeMode(this.five, ['Topview', undefined, undefined, userAction]);
4138
+ }
4139
+ this.five.model.show(this.floorIndex);
4140
+ this.updatePosition();
4141
+ this.updateSize();
4142
+ const renderDuration = 500;
4143
+ const modelOpacity = this.state.config.modelOpacity;
4144
+ changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4145
+ this.hooks.emit('showAnimationEnded', { userAction });
4146
+ this.render();
4147
+ }
4148
+ async _hide(options) {
4149
+ if (!this.state.enabled)
4150
+ return;
4151
+ const { userAction } = options;
4152
+ this.hooks.emit('hide', { userAction });
4153
+ const modelOpacity = 1;
4154
+ const renderDuration = 0;
4155
+ changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4156
+ this.render();
4157
+ }
4158
+ _enable(options) {
4159
+ const { userAction } = options;
4160
+ this.addEventListener();
4161
+ if (this.wrapper)
4162
+ this.wrapper.append(this.container);
4163
+ this.hooks.emit('enable', { userAction });
4164
+ if (this.state.visible)
4165
+ this._show({ userAction });
4166
+ }
4167
+ updateState(state, userAction) {
4168
+ const prevState = this.state;
4169
+ this.state = Object.assign(Object.assign({}, this.state), state);
4170
+ if (equal(this.state, prevState, { deep: true }))
4171
+ return;
4172
+ this.hooks.emit('stateChange', { state: this.state, prevState, userAction });
4173
+ }
4174
+ addEventListener() {
4175
+ if (!this.state.enabled)
4176
+ return;
4177
+ if (this.hasAddedEventListener)
4178
+ return;
4179
+ const five = this.five;
4180
+ five.on('modeChange', this.onFiveModeChange);
4181
+ five.on('panoArrived', this.onFivePanoArrived);
4182
+ five.on('cameraUpdate', this.onFiveCameraUpdate);
4183
+ five.on('wantsGesture', this.onFiveWantsGesture);
4184
+ five.on('wantsMoveToPano', this.onFiveWantsMoveToPano);
4185
+ five.on('initAnimationEnded', this.onFiveInitAnimationEnded);
4186
+ five.on('modelShownFloorChange', this.onModelShownFloorChange);
4187
+ }
4188
+ removeEventListener() {
4189
+ const five = this.five;
4190
+ this.hasAddedEventListener = false;
4191
+ // 注意这里并没有消除 dispose 的监听
4192
+ five.off('modeChange', this.onFiveModeChange);
4193
+ five.off('panoArrived', this.onFivePanoArrived);
4194
+ five.off('cameraUpdate', this.onFiveCameraUpdate);
4195
+ five.off('wantsGesture', this.onFiveWantsGesture);
4196
+ five.off('wantsMoveToPano', this.onFiveWantsMoveToPano);
4197
+ five.off('initAnimationEnded', this.onFiveInitAnimationEnded);
4198
+ five.off('modelShownFloorChange', this.onModelShownFloorChange);
4199
+ }
4200
+ /** 如果用户是通过 selector 设置父容器,需要在 modelLoaded 之后把 container 自动放到父容器里
4201
+ *
4202
+ * - TODO: 等 selector 功能下掉之后删除这个逻辑
4203
+ */
4204
+ initContainer() {
4205
+ this.container.classList.add('floorplan-plugin');
4206
+ Object.assign(this.container.style, {
4207
+ position: 'absolute',
4208
+ left: '50%',
4209
+ top: '50%',
4210
+ transform: 'translate3d(-50%, -50%, 10px)',
4211
+ zIndex: 10,
4212
+ pointerEvents: 'none',
4213
+ 'will-change': 'width, height',
4214
+ });
4215
+ this.five.addExtraElement(this.container);
4216
+ }
4217
+ render(duration) {
4218
+ if (!this.state.enabled)
4219
+ return;
4220
+ if (!this.container || !this.data)
4221
+ return;
4222
+ if (this.size.width === 0)
4223
+ return;
4224
+ const props = Object.assign(Object.assign({}, this.state.config), { visible: this.state.visible, duration: duration !== null && duration !== void 0 ? duration : 0, panoIndex: this.panoIndex, floorIndex: this.floorIndex, floorplanData: this.data, lastPanoramaLongitude: this.lastPanoramaLongitude });
4225
+ if (this.app)
4226
+ return this.app.$set(props);
4227
+ this.app = new Main({ target: this.container, intro: true, props });
4228
+ }
4229
+ }
4230
+
4231
+ const TopviewFloorplanPlugin = (five, params) => {
4232
+ return new Controller(five, params);
4233
+ };
4234
+
4235
+ exports.TopviewFloorplanPlugin = TopviewFloorplanPlugin;
4236
+ exports["default"] = TopviewFloorplanPlugin;