@realsee/dnalogel 2.11.0-alpha.0 → 2.11.0-alpha.1

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 (259) hide show
  1. package/dist/index.cjs.js +2 -2
  2. package/dist/index.js +6 -4
  3. package/dist/index.umd.js +2 -2
  4. package/docs/classes/CSS3DRender.html +4 -4
  5. package/docs/classes/CruisePluginController.html +4 -4
  6. package/docs/classes/Magnifier.html +4 -4
  7. package/docs/classes/ModelRoomLabelController.html +4 -4
  8. package/docs/classes/Object3DHelperController.html +4 -4
  9. package/docs/classes/PaintBrush.html +4 -4
  10. package/docs/classes/PanoMeasurePluginLine.html +4 -4
  11. package/docs/classes/PanoMeasurePluginModel.html +4 -4
  12. package/docs/classes/PanoMeasurePluginPoint.html +4 -4
  13. package/docs/classes/PanoMeasurePluginPolyline.html +4 -4
  14. package/docs/classes/PanoTagPluginController.html +12 -12
  15. package/docs/classes/Util.BetterTween.html +4 -4
  16. package/docs/classes/Util.FivePointSelector.html +4 -4
  17. package/docs/classes/Util.Interval.html +4 -4
  18. package/docs/classes/Util.Magnifier.html +4 -4
  19. package/docs/classes/Util.PointDomHelper.html +4 -4
  20. package/docs/classes/Util.PointHelper.html +4 -4
  21. package/docs/classes/Util.Rectangle.html +4 -4
  22. package/docs/enums/CameraMovementEffect.html +4 -4
  23. package/docs/enums/ContentType.html +4 -4
  24. package/docs/enums/DIRECTION.html +4 -4
  25. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +4 -4
  26. package/docs/enums/DimensionType.html +4 -4
  27. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +4 -4
  28. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +4 -4
  29. package/docs/enums/PaintBrushTypeEnum.html +4 -4
  30. package/docs/enums/PointType.html +4 -4
  31. package/docs/enums/Rotation.html +4 -4
  32. package/docs/functions/CSS3DRenderPlugin.html +4 -4
  33. package/docs/functions/CameraMovementPlugin.html +4 -4
  34. package/docs/functions/CruisePlugin.html +4 -4
  35. package/docs/functions/GuideLinePlugin.html +4 -4
  36. package/docs/functions/ItemLabelPlugin.html +4 -4
  37. package/docs/functions/MapviewFloorplanPlugin.html +4 -4
  38. package/docs/functions/ModelChassisCompassPlugin.html +4 -4
  39. package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
  40. package/docs/functions/ModelFloorplanPlugin.html +4 -4
  41. package/docs/functions/ModelItemLabelPlugin.html +4 -4
  42. package/docs/functions/ModelRoomLabelPlugin.html +4 -4
  43. package/docs/functions/ModelTVVideoPlugin.html +4 -4
  44. package/docs/functions/ModelViewPlugin.html +4 -4
  45. package/docs/functions/Object3DHelperPlugin.html +4 -4
  46. package/docs/functions/PanoCompassPlugin.html +4 -4
  47. package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
  48. package/docs/functions/PanoDoorLabelPlugin.html +4 -4
  49. package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
  50. package/docs/functions/PanoMeasurePlugin.html +4 -4
  51. package/docs/functions/PanoRulerPlugin.html +4 -4
  52. package/docs/functions/PanoRulerProPlugin.html +4 -4
  53. package/docs/functions/PanoSpatialTagPlugin.html +4 -4
  54. package/docs/functions/PanoTagPlugin.html +4 -4
  55. package/docs/functions/PanoVideoPlugin.html +4 -4
  56. package/docs/functions/TopviewFloorplanPlugin.html +4 -4
  57. package/docs/functions/Util.getCoordsFromClient.html +4 -4
  58. package/docs/functions/Util.getCoordsFromElement.html +4 -4
  59. package/docs/functions/Util.getFrameTime.html +4 -4
  60. package/docs/functions/Util.getIntersectFromRelativePosition.html +4 -4
  61. package/docs/functions/Util.getRaycasterFromFivePointer.html +4 -4
  62. package/docs/functions/Util.isNil.html +4 -4
  63. package/docs/functions/Util.nextFrame.html +4 -4
  64. package/docs/functions/Util.notNil.html +4 -4
  65. package/docs/functions/Util.requestAnimationFrameInterval.html +4 -4
  66. package/docs/functions/Util.tweenProgress.html +4 -4
  67. package/docs/functions/pluginFlag.html +4 -4
  68. package/docs/index.html +4 -4
  69. package/docs/interfaces/AddTagConfig.html +4 -4
  70. package/docs/interfaces/CSS3DRenderPluginEventMap.html +4 -4
  71. package/docs/interfaces/CSS3DRenderPluginState.html +4 -4
  72. package/docs/interfaces/CameraMovementPluginExportType.html +4 -4
  73. package/docs/interfaces/EventMap.html +4 -4
  74. package/docs/interfaces/FloorplanBounding.html +4 -4
  75. package/docs/interfaces/FloorplanData.html +4 -4
  76. package/docs/interfaces/FloorplanEntrance.html +4 -4
  77. package/docs/interfaces/FloorplanExtraObject.html +4 -4
  78. package/docs/interfaces/FloorplanExtraObject3D.html +4 -4
  79. package/docs/interfaces/FloorplanFloorData.html +4 -4
  80. package/docs/interfaces/FloorplanImagePosition.html +4 -4
  81. package/docs/interfaces/FloorplanObserver.html +4 -4
  82. package/docs/interfaces/FloorplanOutlineItem.html +4 -4
  83. package/docs/interfaces/FloorplanPosition.html +4 -4
  84. package/docs/interfaces/FloorplanRoomItem.html +4 -4
  85. package/docs/interfaces/FloorplanRoomLabelItem.html +4 -4
  86. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  87. package/docs/interfaces/FloorplanServerComputedData.html +4 -4
  88. package/docs/interfaces/FloorplanServerData.html +4 -4
  89. package/docs/interfaces/FloorplanServerDoorItem.html +4 -4
  90. package/docs/interfaces/FloorplanServerDoorPosition.html +4 -4
  91. package/docs/interfaces/FloorplanServerEntrance.html +4 -4
  92. package/docs/interfaces/FloorplanServerFloorData.html +4 -4
  93. package/docs/interfaces/FloorplanServerImagePosition.html +4 -4
  94. package/docs/interfaces/FloorplanServerObserver.html +4 -4
  95. package/docs/interfaces/FloorplanServerOutlineItem.html +4 -4
  96. package/docs/interfaces/FloorplanServerPosition.html +4 -4
  97. package/docs/interfaces/FloorplanServerRoomItem.html +4 -4
  98. package/docs/interfaces/FloorplanServerRoomLabelItem.html +4 -4
  99. package/docs/interfaces/HelperOffset.html +4 -4
  100. package/docs/interfaces/ItemLabelPluginData.html +4 -4
  101. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +4 -4
  102. package/docs/interfaces/ItemLabelPluginParametersType.html +4 -4
  103. package/docs/interfaces/MinMax.html +4 -4
  104. package/docs/interfaces/ModelChassisCompassPluginData.html +4 -4
  105. package/docs/interfaces/ModelChassisCompassPluginExportType.html +4 -4
  106. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +4 -4
  107. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +4 -4
  108. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +4 -4
  109. package/docs/interfaces/ModelItemLabelPluginData.html +4 -4
  110. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +4 -4
  111. package/docs/interfaces/ModelItemLabelPluginParametersType.html +4 -4
  112. package/docs/interfaces/ModelRoomLabelPluginData.html +4 -4
  113. package/docs/interfaces/ModelTVVideoPluginData.html +4 -4
  114. package/docs/interfaces/ModelTVVideoPluginExportType.html +4 -4
  115. package/docs/interfaces/ModelTVVideoPluginParameterType.html +4 -4
  116. package/docs/interfaces/ModelViewPluginExportType.html +4 -4
  117. package/docs/interfaces/Object3DHelperState.html +4 -4
  118. package/docs/interfaces/ObjectHelperControllers.html +4 -4
  119. package/docs/interfaces/PaintBrushAction.html +4 -4
  120. package/docs/interfaces/PaintBrushConfigs.html +4 -4
  121. package/docs/interfaces/PaintBrushState.html +4 -4
  122. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +4 -4
  123. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +4 -4
  124. package/docs/interfaces/PanoMeasureParameterType.html +4 -4
  125. package/docs/interfaces/PanoMeasurePluginLineJson.html +4 -4
  126. package/docs/interfaces/PanoMeasurePluginOpenParameter.html +4 -4
  127. package/docs/interfaces/PanoMeasurePluginPointJson.html +4 -4
  128. package/docs/interfaces/PanoMeasurePluginPolylineJson.html +4 -4
  129. package/docs/interfaces/PanoRulerPluginExportType.html +4 -4
  130. package/docs/interfaces/PanoRulerPluginOptions.html +4 -4
  131. package/docs/interfaces/PanoRulerPluginParameterType.html +4 -4
  132. package/docs/interfaces/PanoRulerProPluginExportType.html +4 -4
  133. package/docs/interfaces/PanoRulerProPluginOptions.html +4 -4
  134. package/docs/interfaces/PanoRulerProPluginParameterType.html +4 -4
  135. package/docs/interfaces/PanoRulerProPluginState.html +4 -4
  136. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +4 -4
  137. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +4 -4
  138. package/docs/interfaces/PanoSpatialTagPluginData.html +4 -4
  139. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +4 -4
  140. package/docs/interfaces/PanoSpatialTagPluginExportType.html +4 -4
  141. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +4 -4
  142. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +4 -4
  143. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +4 -4
  144. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +4 -4
  145. package/docs/interfaces/PanoVideoPluginType.LoadParams.html +4 -4
  146. package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +4 -4
  147. package/docs/interfaces/PanoVideoPluginType.PluginData.html +4 -4
  148. package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +4 -4
  149. package/docs/interfaces/PanoVideoPluginType.PluginState.html +4 -4
  150. package/docs/interfaces/PanoVideoPluginType.VideoItem.html +4 -4
  151. package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +4 -4
  152. package/docs/interfaces/Point.html +4 -4
  153. package/docs/interfaces/Room.html +4 -4
  154. package/docs/interfaces/RoomInfo.html +4 -4
  155. package/docs/interfaces/RoomLabel.html +4 -4
  156. package/docs/interfaces/RoomRules.html +4 -4
  157. package/docs/interfaces/Rooms.html +4 -4
  158. package/docs/interfaces/Scissor.html +4 -4
  159. package/docs/interfaces/State.html +4 -4
  160. package/docs/interfaces/TagCache.html +4 -4
  161. package/docs/interfaces/TagConfig.html +4 -4
  162. package/docs/interfaces/TagIconUrl.html +4 -4
  163. package/docs/interfaces/TagStyle.html +4 -4
  164. package/docs/interfaces/Tags.html +4 -4
  165. package/docs/interfaces/TemporaryState.html +4 -4
  166. package/docs/interfaces/Util.MagnifierParameter.html +4 -4
  167. package/docs/interfaces/Util.MouseGroupParameter.html +4 -4
  168. package/docs/modules/PanoVideoPluginType.html +4 -4
  169. package/docs/modules/Util.html +4 -4
  170. package/docs/modules.html +4 -4
  171. package/docs/types/ArrayPosition.html +4 -4
  172. package/docs/types/AudioAppearance.html +4 -4
  173. package/docs/types/AudioTagTypeConfigKey.html +4 -4
  174. package/docs/types/CSS3DRenderExportType.html +4 -4
  175. package/docs/types/CSS3DRenderPluginExportType.html +4 -4
  176. package/docs/types/CSS3DRenderPluginParameterType.html +4 -4
  177. package/docs/types/ClassFunctionParameters.html +4 -4
  178. package/docs/types/Color.html +4 -4
  179. package/docs/types/ContentTypeConfigKey.html +4 -4
  180. package/docs/types/ContentTypeConfigKeySplit.html +4 -4
  181. package/docs/types/ContentTypeMap.html +4 -4
  182. package/docs/types/Create3DDomContainerReturnType.html +4 -4
  183. package/docs/types/Create3DElementReturnType.html +4 -4
  184. package/docs/types/CruisePluginExportType.html +4 -4
  185. package/docs/types/Direction-1.html +4 -4
  186. package/docs/types/Direction4.html +4 -4
  187. package/docs/types/FloorplanRuleLabels.html +4 -4
  188. package/docs/types/FloorplanServerRuleLabels.html +4 -4
  189. package/docs/types/GuideLinePluginExportType.html +4 -4
  190. package/docs/types/HelperEventMap.html +4 -4
  191. package/docs/types/LoadTagConfig.html +4 -4
  192. package/docs/types/MapviewFloorplanPluginParameterType.html +4 -4
  193. package/docs/types/MapviewFloorplanPluginReturnType.html +4 -4
  194. package/docs/types/MediaData.html +4 -4
  195. package/docs/types/MediaStore.html +4 -4
  196. package/docs/types/ModelElement.html +4 -4
  197. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +4 -4
  198. package/docs/types/ModelFloorplanPluginParameterType.html +4 -4
  199. package/docs/types/ModelFloorplanPluginReturnType.html +4 -4
  200. package/docs/types/ModelRoomLabelPluginParameters.html +4 -4
  201. package/docs/types/ModelRoomLabelPluginReturnType.html +4 -4
  202. package/docs/types/MoveArgs.html +4 -4
  203. package/docs/types/MoveOpts.html +4 -4
  204. package/docs/types/Object3DHelperEventMap.html +4 -4
  205. package/docs/types/ObjectFit.html +4 -4
  206. package/docs/types/PaintBrushEventMap.html +4 -4
  207. package/docs/types/PanoCompassPluginData.html +4 -4
  208. package/docs/types/PanoCompassPluginExportType.html +4 -4
  209. package/docs/types/PanoCompassPluginParameterType.html +4 -4
  210. package/docs/types/PanoFloorplanRadarPluginParameterType.html +4 -4
  211. package/docs/types/PanoFloorplanRadarPluginReturnType.html +4 -4
  212. package/docs/types/PanoIndex.html +4 -4
  213. package/docs/types/PanoMeasurePluginEvent.html +4 -4
  214. package/docs/types/PanoMeasureReturnType.html +4 -4
  215. package/docs/types/PanoSpatialTagPluginId.html +4 -4
  216. package/docs/types/PanoTagPluginExportInterface.html +4 -4
  217. package/docs/types/PanoTagPluginParamsInterface.html +4 -4
  218. package/docs/types/PanoVideoPluginParameterType.html +4 -4
  219. package/docs/types/PanoVideoPluginReturnType.html +4 -4
  220. package/docs/types/PlaneTag.html +4 -4
  221. package/docs/types/PlaneTagElement.html +4 -4
  222. package/docs/types/Point2DElement.html +4 -4
  223. package/docs/types/Point2DTag.html +4 -4
  224. package/docs/types/Point3DElement.html +4 -4
  225. package/docs/types/Point3DTag.html +4 -4
  226. package/docs/types/PointTag.html +4 -4
  227. package/docs/types/PointTagElement.html +4 -4
  228. package/docs/types/Position.html +4 -4
  229. package/docs/types/RotateArgs.html +4 -4
  230. package/docs/types/RotateOpts.html +4 -4
  231. package/docs/types/RuleLabelsKey.html +4 -4
  232. package/docs/types/RuleLabelsValue.html +4 -4
  233. package/docs/types/StickType.html +4 -4
  234. package/docs/types/Tag.html +4 -4
  235. package/docs/types/Tag2D.html +4 -4
  236. package/docs/types/Tag3D.html +4 -4
  237. package/docs/types/TagContentType.html +4 -4
  238. package/docs/types/TagDimensionType.html +4 -4
  239. package/docs/types/TagElement.html +4 -4
  240. package/docs/types/TagEvents.html +4 -4
  241. package/docs/types/TagGLTFObject.html +4 -4
  242. package/docs/types/TagHooks.html +4 -4
  243. package/docs/types/TagIconSize.html +4 -4
  244. package/docs/types/TagId.html +4 -4
  245. package/docs/types/TagPointType.html +4 -4
  246. package/docs/types/TopviewFloorplanPluginParameterType.html +4 -4
  247. package/docs/types/TopviewFloorplanPluginReturnType.html +4 -4
  248. package/docs/types/WorkCode.html +4 -4
  249. package/docs/variables/FLOOR_TYPE_MAP.html +4 -4
  250. package/docs/variables/PLUGIN.html +4 -4
  251. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +4 -4
  252. package/docs/variables/ROOM_TYPE_MAP.html +4 -4
  253. package/docs/variables/VERSION.html +4 -4
  254. package/docs/variables/itemLabelPluginServerParams.html +4 -4
  255. package/docs/variables/modelItemLabelPluginServerParams.html +4 -4
  256. package/docs/variables/modelRoomLabelPluginServerParams.html +4 -4
  257. package/libs/PanoTagPlugin/controller/index.js +20 -18
  258. package/libs/base/BasePlugin.js +1 -1
  259. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -112,7 +112,7 @@ transition: all 500ms;
112
112
  svg [type='lineItemGroup'] g g g g {
113
113
  stroke: #ffffff;
114
114
  }</style>
115
- `;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Bu extends oe{constructor(t){super(),ie(this,t,zu,Tu,ne,{content:0},Mu)}}function ju(i){ce(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function Vu(i){let t,e;return t=new Su({props:{url:i[1].url}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Qu(i){let t,e;return t=new Bu({props:{content:i[0]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Ou(i){let t,e,n,o;const s=[Qu,Vu],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=z("div"),n&&n.c(),b(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){M(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),E(n,1),n.m(t,null)):n=null)},i(l){o||(E(n),o=!0)},o(l){D(n),o=!1},d(l){l&&S(t),~e&&r[e].d()}}}function Ru(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class Oa extends oe{constructor(t){super(),ie(this,t,Ru,Ou,ne,{floorIndex:2,floorplanData:3},ju)}}function Fu(i){ce(i,"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}")}function Hu(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new Kn(!1),n=me(),t.a=n},m(o,s){t.m(e,o,s),M(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&S(n),o&&t.d()}}}function Gu(i){let t,e,n=i[1]&&Ro(i),o=i[0]&&Fo(i);return{c(){n&&n.c(),t=ee(),o&&o.c(),e=me()},m(s,r){n&&n.m(s,r),M(s,t,r),o&&o.m(s,r),M(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=Ro(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Fo(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&S(t),o&&o.d(s),s&&S(e)}}}function Ro(i){let t,e=i[2].name+"",n;return{c(){t=z("span"),n=Ie(e),b(t,"class","floorplan-plugin__room-name")},m(o,s){M(o,t,s),B(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Me(n,e)},d(o){o&&S(t)}}}function Fo(i){let t,e;return{c(){t=z("span"),e=Ie(i[7]),b(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){M(n,t,o),B(t,e)},p(n,o){o&128&&Me(e,n[7])},d(n){n&&S(t)}}}function Wu(i){let t,e;function n(r,a){if(r[3]===void 0)return Gu;if(r[8])return Hu}let o=n(i),s=o&&o(i);return{c(){t=z("div"),s&&s.c(),b(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),ke(()=>i[19].call(t)),T(t,"left",i[9]),T(t,"top",i[10]),T(t,"font-size",i[11]),T(t,"opacity",i[6]?"1":"0")},m(r,a){M(r,t,a),s&&s.m(t,null),e=tt(t,i[19].bind(t))},p(r,[a]){o===(o=n(r))&&s?s.p(r,a):(s&&s.d(1),s=o&&o(r),s&&(s.c(),s.m(t,null))),a&64&&T(t,"opacity",r[6]?"1":"0")},i:Y,o:Y,d(r){r&&S(t),s&&s.d(),e()}}}function _u(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],u=t[r][1];l>n!=u>n&&e<(c-a)*(n-l)/(u-l)+a&&(o=!o)}return o}function Nu(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:u}=t,{room:h}=t,{hoveredRoom:d}=t,{getRoomAreaText:f}=t,{getLabelElement:g}=t,{adaptiveRoomLabelVisibleEnable:v}=t;function p(R,U){if(U.width===0||U.height===0)return()=>!1;const j=R.path.map(({x:he,y:ue})=>[he,ue]),H=R.roomLabel.position,{x:O,y:N}=H,{width:G,height:$}=U,X=G/2,ae=$/2;return function(ue){const pe=O*ue,Pe=N*ue,Le=j.map(([le,ge])=>[le*ue,ge*ue]);return[[pe+X,Pe-ae],[pe-X,Pe-ae],[pe-X,Pe+ae],[pe+X,Pe+ae]].every(le=>_u(le,Le))}}const A=document.body.clientWidth,y=document.body.clientHeight,w=h.roomLabel,k=w.positionInImage.x*100+"%",P=w.positionInImage.y*100+"%",C=(A<500||y<500?10:14)+"px";let L=0,x=0,Q=!1;d.subscribe(function(U){e(16,Q=!!U&&U.id===h.id)});function W(){L=this.clientWidth,x=this.clientHeight,e(4,L),e(5,x)}return i.$$set=R=>{"pxmm"in R&&e(12,l=R.pxmm),"roomAreaEnable"in R&&e(0,c=R.roomAreaEnable),"roomNameEnable"in R&&e(1,u=R.roomNameEnable),"room"in R&&e(2,h=R.room),"hoveredRoom"in R&&e(13,d=R.hoveredRoom),"getRoomAreaText"in R&&e(14,f=R.getRoomAreaText),"getLabelElement"in R&&e(3,g=R.getLabelElement),"adaptiveRoomLabelVisibleEnable"in R&&e(15,v=R.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=g==null?void 0:g(h)),i.$$.dirty&16388&&e(7,o=h.size?f(h.size):""),i.$$.dirty&48&&e(18,s={width:L,height:x}),i.$$.dirty&262148&&e(17,r=s?p(h,s):void 0),i.$$.dirty&233472&&e(6,a=v?Q?!0:!!(r!=null&&r(l)):!0)},[c,u,h,g,L,x,a,o,n,k,P,C,l,d,f,v,Q,r,s,W]}class Xu extends oe{constructor(t){super(),ie(this,t,Nu,Wu,ne,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Fu)}}function Yu(i){ce(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function Ho(i,t,e){const n=i.slice();return n[12]=t[e],n}function Go(i){let t,e=[],n=new Map,o,s,r=i[8];const a=l=>l[12].id;for(let l=0;l<r.length;l+=1){let c=Ho(i,r,l),u=a(c);n.set(u,e[l]=Wo(u,c))}return{c(){t=z("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","floorplan-plugin__room-labels svelte-13xux0b"),ke(()=>i[11].call(t))},m(l,c){M(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=tt(t,i[11].bind(t)),s=!0},p(l,c){c&447&&(r=l[8],se(),e=Ue(e,c,a,1,l,r,n,t,Et,Wo,null,Ho),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)D(e[c]);s=!1},d(l){l&&S(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function Wo(i,t){let e,n,o;const s=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new Xu({props:r}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&447?Oe(s,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){o||(E(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&S(e),Z(n,a)}}}function Uu(i){let t,e,n=i[8]&&Go(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&E(n,1)):(n=Go(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function qu(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:u}=t,{adaptiveRoomLabelVisibleEnable:h}=t,d=0,f=0;function g(){d=this.clientWidth,e(6,d)}return i.$$set=v=>{"floorIndex"in v&&e(9,o=v.floorIndex),"roomAreaEnable"in v&&e(0,s=v.roomAreaEnable),"roomNameEnable"in v&&e(1,r=v.roomNameEnable),"floorplanData"in v&&e(10,a=v.floorplanData),"hoveredRoom"in v&&e(2,l=v.hoveredRoom),"getRoomAreaText"in v&&e(3,c=v.getRoomAreaText),"getLabelElement"in v&&e(4,u=v.getLabelElement),"adaptiveRoomLabelVisibleEnable"in v&&e(5,h=v.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:v,min:p}=a.bounding,A=v.x-p.x;e(7,f=d/A)}},[s,r,l,c,u,h,d,f,n,o,a,g]}class Ju extends oe{constructor(t){super(),ie(this,t,qu,Uu,ne,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Yu)}}function Zu(i){ce(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function _o(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function No(i,t,e){const n=i.slice();return n[14]=t[e],n}function Xo(i){let t;return{c(){t=z("div"),b(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),T(t,"left",i[14].left*100+"%"),T(t,"bottom",i[14].bottom*100+"%")},m(e,n){M(e,t,n)},p:Y,d(e){e&&S(t)}}}function Yo(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=z("div"),n=z("div"),s=Ie(o),r=ee(),b(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),q(n,"is-row",t[2]),b(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),T(e,"left",t[11].left*100+"%"),T(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){M(a,e,l),B(e,n),B(n,s),B(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Me(s,o)},d(a){a&&S(e)}}}function Ku(i){let t,e,n,o,s,r,a=[],l=new Map,c,u=i[3],h=[];for(let g=0;g<u.length;g+=1)h[g]=Xo(No(i,u,g));let d=i[4];const f=g=>g[13];for(let g=0;g<d.length;g+=1){let v=_o(i,d,g),p=f(v);l.set(p,a[g]=Yo(p,v))}return{c(){t=z("div"),e=z("div"),n=ee(),o=z("div");for(let g=0;g<h.length;g+=1)h[g].c();s=ee(),r=z("div");for(let g=0;g<a.length;g+=1)a[g].c();b(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),b(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),q(o,"is-row",i[2]),b(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),b(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),q(t,"is-row",i[2]),T(t,"width",i[2]?"100%":1/16+"rem"),T(t,"height",i[2]?1/16+"rem":"100%")},m(g,v){M(g,t,v),B(t,e),B(t,n),B(t,o);for(let p=0;p<h.length;p+=1)h[p].m(o,null);B(t,s),B(t,r);for(let p=0;p<a.length;p+=1)a[p].m(r,null)},p(g,[v]){if(v&8){u=g[3];let p;for(p=0;p<u.length;p+=1){const A=No(g,u,p);h[p]?h[p].p(A,v):(h[p]=Xo(A),h[p].c(),h[p].m(o,null))}for(;p<h.length;p+=1)h[p].d(1);h.length=u.length}v&22&&(d=g[4],a=Ue(a,v,f,1,g,d,l,r,ao,Yo,null,_o)),v&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&b(t,"class",c),v&5&&q(t,"is-row",g[2])},i:Y,o:Y,d(g){g&&S(t),at(h,g);for(let v=0;v<a.length;v+=1)a[v].d()}}}const Ot=1e3,Rt=180;function $u(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(Ot-Rt)*2,c=s.max.y-s.min.y-(Ot-Rt)*2,u=o.map(([g,v])=>a?[g.x,v.x]:[g.y,v.y]).flat().sort().filter((g,v,p)=>v===0?!0:g!==p[v-1]),h=u.map(g=>{const v=a?(g-s.min.x-Ot+Rt)/l:0,p=a?0:(g-s.min.y-Ot+Rt)/c;return{left:v,bottom:p}});h.unshift({left:0,bottom:0}),h.push(a?{left:1,bottom:0}:{left:0,bottom:1});const d=u[u.length-1]-u[0],f=u.map((g,v,p)=>{const A=v===0?0:g-p[v-1],y=v===0?0:(g+p[v-1])/2,w=a?(y-s.min.x-Ot+Rt)/l:0,k=a?0:(y-s.min.y-Ot+Rt)/c;return{left:w,bottom:k,distance:A}}).filter(({distance:g})=>g/d>.1);return i.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,o=g.data),"bounding"in g&&e(6,s=g.bounding),"getRuleDistanceText"in g&&e(1,r=g.getRuleDistanceText)},[n,r,a,h,f,o,s]}class ed extends oe{constructor(t){super(),ie(this,t,$u,Ku,ne,{type:0,data:5,bounding:6,getRuleDistanceText:1},Zu)}}function td(i){ce(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Uo(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function qo(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new ed({props:r}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Oe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(E(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&S(e),Z(n,a)}}}function nd(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=Uo(i,s,a),c=r(l);n.set(c,e[a]=qo(c,l))}return{c(){t=z("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),T(t,"width",i[3]),T(t,"height",i[2])},m(a,l){M(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],se(),e=Ue(e,l,r,1,a,s,n,t,Et,qo,null,Uo),re()),l&8&&T(t,"width",a[3]),l&4&&T(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)E(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&S(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Jo=1e3,Zo=180;function id(i,t,e){let n,o,s,r,a,l,c,u,h,d,{floorIndex:f}=t,{floorplanData:g}=t,{getRuleDistanceText:v}=t;return i.$$set=p=>{"floorIndex"in p&&e(5,f=p.floorIndex),"floorplanData"in p&&e(6,g=p.floorplanData),"getRuleDistanceText"in p&&e(0,v=p.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=g.bounding),i.$$.dirty&96&&e(11,o=g.floorDatas[f].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(p=>[p,o[p]])),i.$$.dirty&2&&e(9,a=n.max.x-n.min.x),i.$$.dirty&2&&e(7,l=n.max.y-n.min.y),i.$$.dirty&2&&e(10,c=n.max.x-n.min.x-(Jo-Zo)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(Jo-Zo)*2),i.$$.dirty&1536&&e(3,h=c/a*100+"%"),i.$$.dirty&384&&e(2,d=u/l*100+"%")},[v,n,d,h,r,f,g,l,u,a,c,o,s]}class od extends oe{constructor(t){super(),ie(this,t,id,nd,ne,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},td)}}function di(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,u=l+","+c;return a===0?(e+="M"+u,e):o!=null&&o[a]?(e+="A"+o[a]+","+u,e):(e+="L"+u,e)}),e+(n?"Z":"")}function Ra({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function sd(i,t){const e=i.x*1e3+t.bounding.origin.x,n=-i.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function rd(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function ad(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function ld(i){let t;return{c(){t=ye("path"),b(t,"d",i[0]),b(t,"fill","#2F313A")},m(e,n){M(e,t,n)},p(e,[n]){n&1&&b(t,"d",e[0])},i:Y,o:Y,d(e){e&&S(t)}}}function cd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=di(o,{needZ:!0}))},[n,o]}class ud extends oe{constructor(t){super(),ie(this,t,cd,ld,ne,{path:1})}}function dd(i){let t,e,n,o,s,r;return{c(){t=ye("defs"),e=ye("pattern"),n=ye("rect"),o=ye("path"),s=ee(),r=ye("path"),b(n,"x","0"),b(n,"y","0"),b(n,"width",i[1]),b(n,"height",i[1]),b(n,"fill","#323747"),b(o,"d",i[2]),b(o,"stroke","#ffffff"),b(o,"stroke-opacity","0.06"),b(o,"stroke-width","0.5"),b(o,"fill","none"),b(e,"id","fpm-room-pattern-0"),b(e,"x","0"),b(e,"y","0"),b(e,"width",i[1]),b(e,"height",i[1]),b(e,"patternUnits","userSpaceOnUse"),b(e,"patternTransform","scale(50 50)"),b(r,"d",i[0]),b(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){M(a,t,l),B(t,e),B(e,n),B(e,o),M(a,s,l),M(a,r,l)},p(a,[l]){l&1&&b(r,"d",a[0])},i:Y,o:Y,d(a){a&&S(t),a&&S(s),a&&S(r)}}}const xi=6;function hd(i,t,e){let n,{path:o}=t;const s=xi*2,r=`M0 ${xi} h ${s} M${xi} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=di(o,{needZ:!0}))},[n,s,r,o]}class fd extends oe{constructor(t){super(),ie(this,t,hd,dd,ne,{path:3})}}function md(i){let t,e,n,o,s,r,a,l,c,u,h;return{c(){t=ye("defs"),e=ye("pattern"),n=ye("rect"),o=ye("pattern"),s=ye("rect"),r=ee(),a=ye("path"),l=ee(),c=ye("path"),u=ee(),h=ye("path"),b(n,"x","0"),b(n,"y","0"),b(n,"width","6"),b(n,"height","50"),b(n,"fill","none"),b(n,"stroke","#4B4B57"),b(n,"stroke-width","0.5"),b(e,"id","room-material-pattern-1"),b(e,"x","0"),b(e,"y","0"),b(e,"width","12"),b(e,"height","50"),b(e,"patternUnits","userSpaceOnUse"),b(e,"patternTransform","scale(50 50)"),b(s,"x","0"),b(s,"y","0"),b(s,"width","6"),b(s,"height","50"),b(s,"fill","none"),b(s,"stroke","#4B4B57"),b(s,"stroke-width","0.5"),b(o,"id","room-material-pattern-2"),b(o,"x","6"),b(o,"y","25"),b(o,"width","12"),b(o,"height","50"),b(o,"patternUnits","userSpaceOnUse"),b(o,"patternTransform","scale(50 50)"),b(a,"d",i[0]),b(a,"fill","#43434D"),b(c,"d",i[0]),b(c,"fill","url(#room-material-pattern-1)"),b(h,"d",i[0]),b(h,"fill","url(#room-material-pattern-2)")},m(d,f){M(d,t,f),B(t,e),B(e,n),B(t,o),B(o,s),M(d,r,f),M(d,a,f),M(d,l,f),M(d,c,f),M(d,u,f),M(d,h,f)},p(d,[f]){f&1&&b(a,"d",d[0]),f&1&&b(c,"d",d[0]),f&1&&b(h,"d",d[0])},i:Y,o:Y,d(d){d&&S(t),d&&S(r),d&&S(a),d&&S(l),d&&S(c),d&&S(u),d&&S(h)}}}function pd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=di(o,{needZ:!0}))},[n,o]}class gd extends oe{constructor(t){super(),ie(this,t,pd,md,ne,{path:1})}}function Ad(i){ce(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Ko(i,t,e){const n=i.slice();return n[5]=t[e],n}function vd(i){let t,e;return t=new fd({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function bd(i){let t,e;return t=new gd({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function yd(i){let t,e;return t=new ud({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function $o(i){let t,e,n,o;const s=[yd,bd,vd],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=ye("svg"),n.c(),b(t,"width","100%"),b(t,"height","100%"),b(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),b(t,"class","svelte-1dykexu")},m(l,c){M(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),E(n,1),n.m(t,null))},i(l){o||(E(n),o=!0)},o(l){D(n),o=!1},d(l){l&&S(t),r[e].d()}}}function wd(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=$o(Ko(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){t=z("div");for(let r=0;r<o.length;r+=1)o[r].c();b(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){M(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Ko(r,n,l);o[l]?(o[l].p(c,a),E(o[l],1)):(o[l]=$o(c),o[l].c(),E(o[l],1),o[l].m(t,null))}for(se(),l=n.length;l<o.length;l+=1)s(l);re()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)E(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)D(o[a]);e=!1},d(r){r&&S(t),at(o,r)}}}function Cd(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>fe(F({},l),{path:l.path.map(c=>Ra(c,s.bounding))})))},[n,r,a,o,s]}class Pd extends oe{constructor(t){super(),ie(this,t,Cd,wd,ne,{floorIndex:3,floorplanData:4},Ad)}}function Ed(i){ce(i,"svelte-19uvvss","path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}")}function Id(i){let t,e,n;return{c(){t=ye("path"),b(t,"d",i[2]),b(t,"fill","#fff"),b(t,"class","svelte-19uvvss")},m(o,s){M(o,t,s),e||(n=[we(t,"mouseenter",i[0]),we(t,"mouseleave",i[1])],e=!0)},p:Y,i:Y,o:Y,d(o){o&&S(t),e=!1,ct(n)}}}function kd(i,t,e){let{room:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;function r(){s.set(n)}function a(){s.set(void 0)}const{bounding:l}=o,c=di(n.path,{needZ:!0,format:u=>Ra(u,l)});return i.$$set=u=>{"room"in u&&e(3,n=u.room),"floorplanData"in u&&e(4,o=u.floorplanData),"hoveredRoom"in u&&e(5,s=u.hoveredRoom)},[r,a,c,n,o,s]}class xd extends oe{constructor(t){super(),ie(this,t,kd,Id,ne,{room:3,floorplanData:4,hoveredRoom:5},Ed)}}function Dd(i){ce(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function es(i,t,e){const n=i.slice();return n[5]=t[e],n}function ts(i,t){let e,n,o;const s=[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new xd({props:r}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&7?Oe(s,[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}]):{};n.$set(c)},i(a){o||(E(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&S(e),Z(n,a)}}}function Ld(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[5].id;for(let l=0;l<r.length;l+=1){let c=es(i,r,l),u=a(c);o.set(u,n[l]=ts(u,c))}return{c(){t=z("div"),e=ye("svg");for(let l=0;l<n.length;l+=1)n[l].c();b(e,"width","100%"),b(e,"height","100%"),b(e,"viewBox",`0 0 ${i[3]} ${i[4]}`),b(e,"class","svelte-1kqo6e4"),b(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){M(l,t,c),B(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);s=!0},p(l,[c]){c&7&&(r=l[1].floorDatas[l[0]].rooms,se(),n=Ue(n,c,a,1,l,r,o,e,Et,ts,null,es),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)D(n[c]);s=!1},d(l){l&&S(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Sd(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(0,n=l.floorIndex),"floorplanData"in l&&e(1,o=l.floorplanData),"hoveredRoom"in l&&e(2,s=l.hoveredRoom)},[n,o,s,r,a]}class Fa extends oe{constructor(t){super(),ie(this,t,Sd,Ld,ne,{floorIndex:0,floorplanData:1,hoveredRoom:2},Dd)}}function Md(i){ce(i,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function ns(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[7],hoveredRoom:i[12]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Fa({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&4226?Oe(n,[{floorIndex:s[1],floorplanData:s[7],hoveredRoom:s[12]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function is(i){let t,e;const n=[{floorplanData:i[7],roomAreaEnable:i[4],roomNameEnable:i[5],floorIndex:i[1],getRoomAreaText:i[8],getLabelElement:i[9],hoveredRoom:i[12],adaptiveRoomLabelVisibleEnable:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Ju({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&7090?Oe(n,[{floorplanData:s[7],roomAreaEnable:s[4],roomNameEnable:s[5],floorIndex:s[1],getRoomAreaText:s[8],getLabelElement:s[9],hoveredRoom:s[12],adaptiveRoomLabelVisibleEnable:s[11]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function os(i){let t,e;const n=[{floorplanData:i[7],floorIndex:i[1],getRuleDistanceText:i[10]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new od({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&1154?Oe(n,[{floorplanData:s[7],floorIndex:s[1],getRuleDistanceText:s[10]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function Td(i){let t,e,n,o,s,r,a,l,c;const u=[{floorIndex:i[1],floorplanData:i[7]}];let h={};for(let A=0;A<u.length;A+=1)h=je(h,u[A]);e=new Pd({props:h});let d=i[2]&&ns(i);const f=[{floorplanData:i[7],floorIndex:i[1]}];let g={};for(let A=0;A<f.length;A+=1)g=je(g,f[A]);s=new Oa({props:g});let v=i[3]&&is(i),p=i[6]&&os(i);return{c(){t=z("div"),K(e.$$.fragment),n=ee(),d&&d.c(),o=ee(),K(s.$$.fragment),r=ee(),v&&v.c(),a=ee(),p&&p.c(),b(t,"class",l=Te(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(A,y){M(A,t,y),J(e,t,null),B(t,n),d&&d.m(t,null),B(t,o),J(s,t,null),B(t,r),v&&v.m(t,null),B(t,a),p&&p.m(t,null),c=!0},p(A,[y]){const w=y&130?Oe(u,[{floorIndex:A[1],floorplanData:A[7]}]):{};e.$set(w),A[2]?d?(d.p(A,y),y&4&&E(d,1)):(d=ns(A),d.c(),E(d,1),d.m(t,o)):d&&(se(),D(d,1,1,()=>{d=null}),re());const k=y&130?Oe(f,[{floorplanData:A[7],floorIndex:A[1]}]):{};s.$set(k),A[3]?v?(v.p(A,y),y&8&&E(v,1)):(v=is(A),v.c(),E(v,1),v.m(t,a)):v&&(se(),D(v,1,1,()=>{v=null}),re()),A[6]?p?(p.p(A,y),y&64&&E(p,1)):(p=os(A),p.c(),E(p,1),p.m(t,null)):p&&(se(),D(p,1,1,()=>{p=null}),re()),(!c||y&1&&l!==(l=Te(`floorplan-plugin__floor${A[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&b(t,"class",l)},i(A){c||(E(e.$$.fragment,A),E(d),E(s.$$.fragment,A),E(v),E(p),c=!0)},o(A){D(e.$$.fragment,A),D(d),D(s.$$.fragment,A),D(v),D(p),c=!1},d(A){A&&S(t),Z(e),d&&d.d(),Z(s),v&&v.d(),p&&p.d()}}}function zd(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{hoverEnable:s}=t,{roomLabelsEnable:r}=t,{roomAreaEnable:a}=t,{roomNameEnable:l}=t,{ruleLabelsEnable:c}=t,{floorplanData:u}=t,{getRoomAreaText:h}=t,{getLabelElement:d}=t,{getRuleDistanceText:f}=t,{adaptiveRoomLabelVisibleEnable:g}=t;const v=co(void 0);return i.$$set=p=>{"isCurrent"in p&&e(0,n=p.isCurrent),"floorIndex"in p&&e(1,o=p.floorIndex),"hoverEnable"in p&&e(2,s=p.hoverEnable),"roomLabelsEnable"in p&&e(3,r=p.roomLabelsEnable),"roomAreaEnable"in p&&e(4,a=p.roomAreaEnable),"roomNameEnable"in p&&e(5,l=p.roomNameEnable),"ruleLabelsEnable"in p&&e(6,c=p.ruleLabelsEnable),"floorplanData"in p&&e(7,u=p.floorplanData),"getRoomAreaText"in p&&e(8,h=p.getRoomAreaText),"getLabelElement"in p&&e(9,d=p.getLabelElement),"getRuleDistanceText"in p&&e(10,f=p.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in p&&e(11,g=p.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,u,h,d,f,g,v]}class Bd extends oe{constructor(t){super(),ie(this,t,zd,Td,ne,{isCurrent:0,floorIndex:1,hoverEnable:2,roomLabelsEnable:3,roomAreaEnable:4,roomNameEnable:5,ruleLabelsEnable:6,floorplanData:7,getRoomAreaText:8,getLabelElement:9,getRuleDistanceText:10,adaptiveRoomLabelVisibleEnable:11},Md)}}function jd(i){ce(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function ss(i,t,e){const n=i.slice();return n[18]=t[e],n}function rs(i){let t,e,n,o,s,r,a=i[11].floorDatas,l=[];for(let f=0;f<a.length;f+=1)l[f]=as(ss(i,a,f));const c=f=>D(l[f],1,1,()=>{l[f]=null}),u=[{panoIndex:i[3],floorplanData:i[11],lastPanoramaLongitude:i[12],cameraImageUrl:i[13]}];let h={};for(let f=0;f<u.length;f+=1)h=je(h,u[f]);n=new bu({props:h});let d=i[6]&&ls(i);return{c(){t=z("div");for(let f=0;f<l.length;f+=1)l[f].c();e=ee(),K(n.$$.fragment),o=ee(),d&&d.c(),b(t,"class","floorplan-main svelte-86bqav")},m(f,g){M(f,t,g);for(let v=0;v<l.length;v+=1)l[v].m(t,null);B(t,e),J(n,t,null),B(t,o),d&&d.m(t,null),r=!0},p(f,g){if(i=f,g&249776){a=i[11].floorDatas;let p;for(p=0;p<a.length;p+=1){const A=ss(i,a,p);l[p]?(l[p].p(A,g),E(l[p],1)):(l[p]=as(A),l[p].c(),E(l[p],1),l[p].m(t,e))}for(se(),p=a.length;p<l.length;p+=1)c(p);re()}const v=g&14344?Oe(u,[{panoIndex:i[3],floorplanData:i[11],lastPanoramaLongitude:i[12],cameraImageUrl:i[13]}]):{};n.$set(v),i[6]?d?(d.p(i,g),g&64&&E(d,1)):(d=ls(i),d.c(),E(d,1),d.m(t,null)):d&&(se(),D(d,1,1,()=>{d=null}),re())},i(f){if(!r){for(let g=0;g<a.length;g+=1)E(l[g]);E(n.$$.fragment,f),E(d),s||ke(()=>{s=Tt(t,Mt,{duration:i[0],easing:At}),s.start()}),r=!0}},o(f){l=l.filter(Boolean);for(let g=0;g<l.length;g+=1)D(l[g]);D(n.$$.fragment,f),D(d),r=!1},d(f){f&&S(t),at(l,f),Z(n),d&&d.d()}}}function as(i){let t,e;const n=[{hoverEnable:i[5],floorplanData:i[11],getRoomAreaText:i[14],getLabelElement:i[15],getRuleDistanceText:i[16],roomLabelsEnable:i[7],roomAreaEnable:i[8],roomNameEnable:i[9],ruleLabelsEnable:i[10],adaptiveRoomLabelVisibleEnable:i[17]},{floorIndex:i[18].floorIndex},{isCurrent:i[18].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Bd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&249776?Oe(n,[r&249760&&{hoverEnable:s[5],floorplanData:s[11],getRoomAreaText:s[14],getLabelElement:s[15],getRuleDistanceText:s[16],roomLabelsEnable:s[7],roomAreaEnable:s[8],roomNameEnable:s[9],ruleLabelsEnable:s[10],adaptiveRoomLabelVisibleEnable:s[17]},r&2048&&{floorIndex:s[18].floorIndex},r&2064&&{isCurrent:s[18].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ls(i){let t,e;return t=new ku({props:{floorplanData:i[11],northDesc:i[2]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2048&&(s.floorplanData=n[11]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Vd(i){let t,e,n=i[1]&&rs(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&E(n,1)):(n=rs(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function Qd(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{hoverEnable:l}=t,{compassEnable:c}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:h}=t,{roomNameEnable:d}=t,{ruleLabelsEnable:f}=t,{floorplanData:g}=t,{lastPanoramaLongitude:v}=t,{cameraImageUrl:p}=t,{getRoomAreaText:A}=t,{getLabelElement:y}=t,{getRuleDistanceText:w}=t,{adaptiveRoomLabelVisibleEnable:k}=t;return i.$$set=P=>{"duration"in P&&e(0,n=P.duration),"visible"in P&&e(1,o=P.visible),"northDesc"in P&&e(2,s=P.northDesc),"panoIndex"in P&&e(3,r=P.panoIndex),"floorIndex"in P&&e(4,a=P.floorIndex),"hoverEnable"in P&&e(5,l=P.hoverEnable),"compassEnable"in P&&e(6,c=P.compassEnable),"roomLabelsEnable"in P&&e(7,u=P.roomLabelsEnable),"roomAreaEnable"in P&&e(8,h=P.roomAreaEnable),"roomNameEnable"in P&&e(9,d=P.roomNameEnable),"ruleLabelsEnable"in P&&e(10,f=P.ruleLabelsEnable),"floorplanData"in P&&e(11,g=P.floorplanData),"lastPanoramaLongitude"in P&&e(12,v=P.lastPanoramaLongitude),"cameraImageUrl"in P&&e(13,p=P.cameraImageUrl),"getRoomAreaText"in P&&e(14,A=P.getRoomAreaText),"getLabelElement"in P&&e(15,y=P.getLabelElement),"getRuleDistanceText"in P&&e(16,w=P.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in P&&e(17,k=P.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,u,h,d,f,g,v,p,A,y,w,k]}class uo extends oe{constructor(t){super(),ie(this,t,Qd,Vd,ne,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,hoverEnable:5,compassEnable:6,roomLabelsEnable:7,roomAreaEnable:8,roomNameEnable:9,ruleLabelsEnable:10,floorplanData:11,lastPanoramaLongitude:12,cameraImageUrl:13,getRoomAreaText:14,getLabelElement:15,getRuleDistanceText:16,adaptiveRoomLabelVisibleEnable:17},jd)}}const Od="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function Rd(i){return _(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return _(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function Fd(i){return{id:i.id,size:i.size,name:i.name,path:i.path,roomType:i.room_type,floorType:i.floor_type,roomLabel:{position:i.room_label.position,positionInImage:i.room_label.position_in_image},observerIndexs:i.observer_indexs}}function Hd(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Fd),rules:i.rules}}function Gd(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function Wd(i){return{rad:i.rad,position:i.position,positionInImage:i.position_in_image,northRad:i.north_rad,roomId:i.room_id,floorIndex:i.floor_index}}function bt(i){return _(this,null,function*(){const t=yield Rd(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Hd),o=i.computed_data.entrance?Wd(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Gd)}})}function _d(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:Od,width:45,height:48},a=ad(s,t),l=sd(s,e),c=rd(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Nd(i,t){return t(i),i}function hi(i,t){return Nd({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function cs(i,t){const e=Math.max(...i.work.observers.map(n=>n.floorIndex));return t>e?i.model.bounding.max.y:Math.max(...i.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function ho(i,t,e=pt.BOUNDING_CENTER){const n=cs(i,t),o=cs(i,t+1);return e===pt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===pt.CEILING?o:n}function fo(i,t,e,n){const o=ho(i,e,n==null?void 0:n.attachedTo),s=new I.Vector3(0,o,0),r=new I.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}class Pn{constructor(t,e){m(this,"VERSION","2.11.0-alpha.0");m(this,"five");m(this,"hooks",new Jt);m(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class zt extends Pn{}var Ge=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(Ge||{});const Ha=500,Xd=80;function Xi(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function Ga(i,t){return _(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const h=l[c];return typeof u=="number"&&typeof h=="number"?Xi(u,h,2):u===h}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function mo(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!Xi(e,s,2)||!Xi(n,r,2)||o!==a)}function Wa(i,t,e=!0){return _(this,null,function*(){if(mo(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield ii(Ga(i,[t.mode,t,void 0,e]));if(u)throw new Error(Ge.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ii(i.updateCamera(t,l,e));if(c)throw new Error(Ge.UpdateCameraError)})}function Yt(i,t,e=300){const n=i.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function Yd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Ud(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class qd extends zt{constructor(e,n){var a;super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>_(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));m(this,"hide",(...n)=>_(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!mo(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=fo(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ge.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>_(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ge.ModelNotLoaded);if(!this.data)throw new Error(Ge.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=F(F({},n),e),s=()=>_(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield ii(Wa(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ge.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:Ha;Yt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ge.BreakOffByHide),this.showPromise=void 0;const o=F(F({},{userAction:!0,isAutoHide:!1}),e);Yt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||Ud(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();Yd(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});m(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:Xd/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?hi(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return _(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield bt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return _(this,null,function*(){return yield bt(e.data)})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=fe(F(F({},this.state),e),{config:s}),!$e(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new uo({target:this.container,intro:!0,props:n})}}const Jd=(i,t)=>new qd(i,t);function Zd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Kd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class $d extends zt{constructor(e,n){super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>_(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));m(this,"hide",(...n)=>_(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!mo(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=fo(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ge.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>_(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ge.ModelNotLoaded);if(!this.data)throw new Error(Ge.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=F(F({},n),e),s=()=>_(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield ii(Wa(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ge.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:Ha;Yt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ge.BreakOffByHide),this.showPromise=void 0;const o=F(F({},{userAction:!0,isAutoHide:!1}),e);Yt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Zd(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(Kd(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?hi(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return _(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield bt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=ho(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new I.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return _(this,null,function*(){return yield bt(e.data)})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=fe(F(F({},this.state),e),{config:s}),!$e(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new uo({target:this.container,intro:!0,props:n})}}const eh=(i,t)=>new $d(i,t);class th extends zt{constructor(e,n){super(e);m(this,"name","topviewFloorplanPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"selector");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=fo(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"_disable",e=>{var o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});m(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});m(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});m(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?hi(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return _(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield bt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=ho(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new I.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return _(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return _(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return _(this,null,function*(){return yield bt(e.data)})}_show(e){return _(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield Ga(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;Yt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return _(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Yt(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=fe(F(F({},this.state),e),{config:s}),!$e(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new uo({target:this.container,intro:!0,props:n})}}const nh=(i,t)=>new th(i,t);function po(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function ih(i){ce(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function oh(i){let t,e,n;return{c(){t=z("div"),e=z("div"),n=z("div"),b(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),T(n,"background-image","url("+(i[0]||vt)+")"),T(n,"transform",i[1]),b(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),T(e,"transform",i[2]),b(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){M(o,t,s),B(t,e),B(e,n)},p(o,[s]){s&1&&T(n,"background-image","url("+(o[0]||vt)+")"),s&2&&T(n,"transform",o[1]),s&4&&T(e,"transform",o[2])},i:Y,o:Y,d(o){o&&S(t)}}}function sh(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function rh(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,u=s.getCurrentState().longitude;function h(g,v){const p=g.bounding,A=g.observers[v];if(!A)return"";const y=(p.max.x-p.min.x)*r,w=(p.max.y-p.min.y)*r,k=Math.floor(A.positionInImage.x*y),P=Math.floor(A.positionInImage.y*w);return`translate(${k}px, ${P}px)`}function d(g){e(6,c=g)}const f=po(g=>{e(7,u=g.longitude)},1e3/60);return Ye(()=>(s.on("panoWillArrive",d),s.on("cameraDirectionUpdate",f),function(){s.off("panoWillArrive",d),s.off("cameraDirectionUpdate",f)})),i.$$set=g=>{"five"in g&&e(3,s=g.five),"pxmm"in g&&e(4,r=g.pxmm),"floorplanData"in g&&e(5,a=g.floorplanData),"cameraImageUrl"in g&&e(0,l=g.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=h(a,c)),i.$$.dirty&128&&e(1,o=sh(u))},[l,o,n,s,r,a,c,u]}class ah extends oe{constructor(t){super(),ie(this,t,rh,oh,ne,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},ih)}}function lh(i){ce(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function us(i,t,e){const n=i.slice();return n[1]=t[e],n}function ds(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=z("div"),n=z("div"),r=ee(),b(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),T(n,"background-image",`url(${t[1].icon.url})`),T(n,"width",o),T(n,"height",s),b(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),T(e,"top",a),T(e,"left",l),this.first=e},m(c,u){M(c,e,u),B(e,n),B(e,r)},p(c,u){t=c,u&1&&T(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&T(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&T(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&T(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&T(e,"left",l)},d(c){c&&S(e)}}}function ch(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=us(i,o,r),l=s(a);n.set(l,e[r]=ds(l,a))}return{c(){t=z("div");for(let r=0;r<e.length;r+=1)e[r].c();b(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){M(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=Ue(e,a,s,1,r,o,n,t,ao,ds,null,us))},i:Y,o:Y,d(r){r&&S(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function uh(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class dh extends oe{constructor(t){super(),ie(this,t,uh,ch,ne,{extraObjects:0},lh)}}function hs(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[6]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Fa({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&87?Oe(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[6]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function hh(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let u=0;u<a.length;u+=1)l=je(l,a[u]);t=new Oa({props:l}),n=new dh({props:{extraObjects:i[5]}});let c=i[3]&&hs(i);return{c(){K(t.$$.fragment),e=ee(),K(n.$$.fragment),o=ee(),c&&c.c(),s=me()},m(u,h){J(t,u,h),M(u,e,h),J(n,u,h),M(u,o,h),c&&c.m(u,h),M(u,s,h),r=!0},p(u,[h]){const d=h&20?Oe(a,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(d);const f={};h&32&&(f.extraObjects=u[5]),n.$set(f),u[3]?c?(c.p(u,h),h&8&&E(c,1)):(c=hs(u),c.c(),E(c,1),c.m(s.parentNode,s)):c&&(se(),D(c,1,1,()=>{c=null}),re())},i(u){r||(E(t.$$.fragment,u),E(n.$$.fragment,u),E(c),r=!0)},o(u){D(t.$$.fragment,u),D(n.$$.fragment,u),D(c),r=!1},d(u){Z(t,u),u&&S(e),Z(n,u),u&&S(o),c&&c.d(u),u&&S(s)}}}function fh(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const u=void 0;return i.$$set=h=>{"five"in h&&e(0,o=h.five),"pxmm"in h&&e(1,s=h.pxmm),"floorIndex"in h&&e(2,r=h.floorIndex),"hoverEnable"in h&&e(3,a=h.hoverEnable),"floorplanData"in h&&e(4,l=h.floorplanData),"extraObjects"in h&&e(7,c=h.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(h=>h.floorIndex===r))},[o,s,r,a,l,n,u,c]}class mh extends oe{constructor(t){super(),ie(this,t,fh,hh,ne,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function ph(i){ce(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function fs(i){let t,e,n,o=i[6]!==0&&ms(i);return{c(){t=z("div"),o&&o.c(),b(t,"class","plugin-floorplan-radar svelte-1mvqyqq"),ke(()=>i[12].call(t))},m(s,r){M(s,t,r),o&&o.m(t,null),e=tt(t,i[12].bind(t)),n=!0},p(s,r){s[6]!==0?o?(o.p(s,r),r&64&&E(o,1)):(o=ms(s),o.c(),E(o,1),o.m(t,null)):o&&(se(),D(o,1,1,()=>{o=null}),re())},i(s){n||(E(o),n=!0)},o(s){D(o),n=!1},d(s){s&&S(t),o&&o.d(),e()}}}function ms(i){let t,e,n,o,s=`${i[8]}px`,r=`${i[11]}px`,a;const l=[{five:i[0],pxmm:i[9],floorIndex:i[10],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5]}];let c={};for(let d=0;d<l.length;d+=1)c=je(c,l[d]);e=new mh({props:c});const u=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let h={};for(let d=0;d<u.length;d+=1)h=je(h,u[d]);return o=new ah({props:h}),{c(){t=z("div"),K(e.$$.fragment),n=ee(),K(o.$$.fragment),b(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),T(t,"width",s),T(t,"height",r)},m(d,f){M(d,t,f),J(e,t,null),B(t,n),J(o,t,null),a=!0},p(d,f){const g=f&1581?Oe(l,[{five:d[0],pxmm:d[9],floorIndex:d[10],floorplanData:d[3],hoverEnable:d[2],extraObjects:d[5]}]):{};e.$set(g);const v=f&537?Oe(u,[{pxmm:d[9],five:d[0],floorplanData:d[3],cameraImageUrl:d[4]}]):{};o.$set(v),f&256&&s!==(s=`${d[8]}px`)&&T(t,"width",s),f&2048&&r!==(r=`${d[11]}px`)&&T(t,"height",r)},i(d){a||(E(e.$$.fragment,d),E(o.$$.fragment,d),a=!0)},o(d){D(e.$$.fragment,d),D(o.$$.fragment,d),a=!1},d(d){d&&S(t),Z(e),Z(o)}}}function gh(i){let t,e,n=i[1]&&fs(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&E(n,1)):(n=fs(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function Ah(i,t,e){var A,y;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,u=(y=(A=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:A.floorIndex)!=null?y:0,h=0,d=0,f=0,g=0;function v(w){e(10,u=n.work.observers[w].floorIndex)}Ye(()=>(n.on("panoArrived",v),()=>{n.off("panoArrived",v)}));function p(){h=this.clientWidth,d=this.clientHeight,e(6,h),e(7,d)}return i.$$set=w=>{"five"in w&&e(0,n=w.five),"visible"in w&&e(1,o=w.visible),"hoverEnable"in w&&e(2,s=w.hoverEnable),"floorplanData"in w&&e(3,r=w.floorplanData),"cameraImageUrl"in w&&e(4,a=w.cameraImageUrl),"extraObjects"in w&&e(5,l=w.extraObjects)},i.$$.update=()=>{if(i.$$.dirty&456){const w=Math.min(h,d),{max:k,min:P}=r.bounding,C=k.x-P.x,L=k.y-P.y,x=function(){return C>L?[w,w/C*L]:[w/L*C,w]}();e(8,f=x[0]),e(11,g=x[1]),e(9,c=f/C)}},[n,o,s,r,a,l,h,d,f,c,u,g,p]}class vh extends oe{constructor(t){super(),ie(this,t,Ah,gh,ne,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},ph)}}class bh extends zt{constructor(e,n){super(e);m(this,"name","panoFloorplanRadarPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"wrapperSelector","");m(this,"wrapper",null);m(this,"disposed",!1);m(this,"extraObjects",[]);m(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});m(this,"_disable",e=>{var o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!1,cameraImageUrl:vt},s=n!=null&&n.configs?n.configs:{},r=F(F({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return _(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield bt(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return _(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return _(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=_d(e,this.five,this.data),this.render())}formatData(e){return _(this,null,function*(){return yield bt(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=F(F({},this.state),e),!$e(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=fe(F({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects});this.app?this.app.$set(e):this.app=new vh({target:this.wrapper,props:e})}}const yh=(i,t)=>new bh(i,t),wh=[{type:0,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6"},{type:1,floorType:1,roomType:"100900000002",name:"\u5BA2\u5385"},{type:2,floorType:1,roomType:"100900000002",name:"\u9910\u5385"},{type:3,floorType:0,roomType:"100900000001",name:"\u5367\u5BA4"},{type:4,floorType:0,roomType:"100900000001",name:"\u4E66\u623F"},{type:5,floorType:3,roomType:"100900000004",name:"\u536B\u751F\u95F4"},{type:6,floorType:3,roomType:"100900000004",name:"\u6DCB\u6D74\u95F4"},{type:7,floorType:3,roomType:"100900000004",name:"\u6D17\u624B\u95F4"},{type:8,floorType:3,roomType:"100900000003",name:"\u53A8\u623F"},{type:9,floorType:1,roomType:"100900000003",name:"\u5F00\u653E\u53A8\u623F",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"\u591A\u529F\u80FD\u95F4"},{type:11,floorType:0,roomType:"100900000009",name:"\u4FDD\u59C6\u95F4"},{type:12,floorType:4,roomType:"100900000005",name:"\u9633\u53F0"},{type:13,floorType:4,roomType:"100900000006",name:"\u9732\u53F0"},{type:14,floorType:0,roomType:"100900000008",name:"\u50A8\u7269\u95F4"},{type:15,floorType:0,roomType:"100900000013",name:"\u8863\u5E3D\u95F4"},{type:16,floorType:0,roomType:"100900000011",name:"\u9601\u697C"},{type:17,floorType:2,roomType:"100900000007",name:"\u82B1\u56ED"},{type:18,floorType:5,roomType:"100900000010",name:"\u8F66\u5E93"},{type:19,floorType:1,roomType:"100900000012",name:"\u7535\u68AF"},{type:20,floorType:1,roomType:"100900000012",name:"\u5730\u4E0B\u5BA4"},{type:21,floorType:1,roomType:"100900000012",name:"\u5929\u4E95"},{type:22,floorType:1,roomType:"100900000012",name:"\u9633\u5149\u623F"},{type:23,floorType:1,roomType:"100900000012",name:"\u8FC7\u9053"},{type:24,floorType:1,roomType:"100900000012",name:"\u697C\u68AF\u95F4"},{type:25,floorType:1,roomType:"100900000012",name:"\u95E8\u5385"},{type:26,floorType:2,roomType:"100900000012",name:"\u5165\u6237\u82B1\u56ED"},{type:27,floorType:1,roomType:"100900000012",name:"\u7384\u5173"},{type:28,floorType:1,roomType:"100900000012",name:"\u6311\u7A7A"},{type:29,floorType:4,roomType:"100900000012",name:"\u667E\u6652\u533A"},{type:30,floorType:4,roomType:"100900000012",name:"\u6D17\u8863\u623F"},{type:31,floorType:0,roomType:"100900000012",name:"\u5A31\u4E50\u533A"},{type:32,floorType:0,roomType:"100900000012",name:"\u5065\u8EAB\u533A"},{type:33,floorType:0,roomType:"100900000012",name:"\u63A5\u5F85\u533A"},{type:34,floorType:0,roomType:"100900000012",name:"\u5F71\u97F3\u533A"},{type:35,floorType:1,roomType:"100900000012",name:"\u9910\u996E\u533A"},{type:36,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"\u8D77\u5C45\u5BA4"},{type:38,floorType:0,roomType:"100900000001",name:"\u4E3B\u5367"},{type:39,floorType:0,roomType:"100900000001",name:"\u6B21\u5367"},{type:40,floorType:0,roomType:"100900000001",name:"\u4F18\u5316\u95F4"},{type:41,floorType:0,roomType:"100900000001",name:"\u529E\u516C\u5BA4"},{type:42,floorType:0,roomType:"100900000001",name:"\u4F1A\u8BAE\u5BA4"},{type:43,floorType:0,roomType:"100900000001",name:"\u6D3D\u8C08\u95F4"},{type:44,floorType:1,roomType:"100900000002",name:"\u5171\u4EAB\u5927\u5385"},{type:45,floorType:1,roomType:"100900000012",name:"\u6C34\u5427"},{type:46,floorType:0,roomType:"100900000015",name:"\u51FA\u5165\u53E3"},{type:47,floorType:0,roomType:"100900000015",name:"\u5927\u5385"},{type:48,floorType:0,roomType:"100900000015",name:"\u5305\u53A2"},{type:49,floorType:0,roomType:"100900000015",name:"\u5176\u4ED6"},{type:50,floorType:0,roomType:"100900000016",name:"\u51FA\u5165\u53E3"},{type:51,floorType:0,roomType:"100900000016",name:"\u529E\u516C\u533A"},{type:52,floorType:0,roomType:"100900000016",name:"\u8001\u677F\u95F4"},{type:53,floorType:0,roomType:"100900000016",name:"\u4F1A\u8BAE\u5BA4"},{type:54,floorType:0,roomType:"100900000016",name:"\u4F11\u606F\u533A/\u6C34\u5427"},{type:55,floorType:0,roomType:"100900000016",name:"\u5176\u4ED6"},{type:56,floorType:2,roomType:"100900000012",name:"\u7A7A\u4E2D\u82B1\u56ED"},{type:57,floorType:0,roomType:"100900000001",name:"\u6D0B\u5BA4"},{type:58,floorType:0,roomType:"100900000001",name:"\u548C\u5BA4"}],Ch=[{type:0,description:"\u6728\u8D28\u5730\u677F"},{type:1,description:"\u74F7\u7816\u5730\u9762"},{type:2,description:"\u6237\u5916\u5730\u9762"},{type:3,description:"\u536B\u751F\u95F4\u5730\u9762"},{type:4,description:"\u9633\u53F0\u5730\u9762"},{type:5,description:"\u8F66\u5E93\u5730\u9762"}],Ph=[{roomType:"100900000001",description:"\u5BA4"},{roomType:"100900000002",description:"\u5385"},{roomType:"100900000003",description:"\u53A8"},{roomType:"100900000004",description:"\u536B"},{roomType:"100900000005",description:"\u9633\u53F0"},{roomType:"100900000006",description:"\u9732\u53F0"},{roomType:"100900000007",description:"\u82B1\u56ED"},{roomType:"100900000008",description:"\u50A8"},{roomType:"100900000009",description:"\u4FDD\u59C6\u95F4"},{roomType:"100900000010",description:"\u8F66\u5E93"},{roomType:"100900000011",description:"\u9601\u697C"},{roomType:"100900000012",description:"\u5176\u4ED6"},{roomType:"100900000013",description:"\u8863"},{roomType:"100900000015",description:"\u5546\u94FA"},{roomType:"100900000016",description:"\u5199\u5B57\u697C"}],Di=(i,t,e)=>{const n=new I.Matrix4,o=new I.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},Eh=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(Di(o,0,0)),s&&i.applyMatrix4(Di(0,s,0)),r&&i.applyMatrix4(Di(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function _a(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=F({map:o.material.map||{}},t);o.material=new V.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const Ih=(i,t)=>{var u;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(u=t.north_rad)!=null?u:void 0,o={},s=h=>_(exports,null,function*(){var U;const d=(h==null?void 0:h.fbx_url)||e,f=(U=h==null?void 0:h.north_rad)!=null?U:n;if(typeof f!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const g=i.model.bounding,v=g.max.x-g.min.x,p=g.max.z-g.min.z,A=Math.max(v,p),w=yield new da.FBXLoader().loadAsync(d);_a(w,{transparent:!0,side:I.DoubleSide,blending:I.AdditiveBlending});const k=[0,f-Math.PI/2,0],{model:{bounding:{max:{x:P,z:C},min:{x:L,y:x,z:Q}}}}=i;o.yBase=x;const W={x:(P+L)/2,y:x-1.6,z:(C+Q)/2},R=.0045*A;return Eh(w,{position:W,rotation:k,scale:R}),o.object=w,!0}),r=({latitude:h})=>{if(!o.object)return;const d=a(h);d&&(o.object.position.y=d)},a=h=>{if(o.yBase===void 0)return;const d=.6;if(h>=Math.PI/4)return o.yBase-(d+1.6);const f=h*(4/Math.PI);return o.yBase-(d*f+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const h=a(i.getPose().latitude);h&&(o.object.position.y=h),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function kh(i,t){var c,u,h,d,f;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,o=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",s=(d=t==null?void 0:t.fontColor)!=null?d:"#fff",r=(f=t==null?void 0:t.textAlign)!=null?f:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new V.CanvasTexture(a)}const xh=({x:i,y:t,z:e})=>new V.Vector3(i,t,e),Dh=(i,t)=>{var v,p,A;const e={},n=(v=t.animationEnabled)!=null?v:!0,o=(p=t.position)!=null?p:void 0,s=(A=t.rad)!=null?A:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=y=>_(exports,null,function*(){var W,R,U,j,H,O,N,G;const w=(W=y==null?void 0:y.position)!=null?W:o;if(!w)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const k=xh(w),P=(R=y==null?void 0:y.rad)!=null?R:s,C=(U=y==null?void 0:y.fbx_url)!=null?U:r;if(e.rad=P,P===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${P}`));const L=yield new da.FBXLoader().loadAsync(C);L.position.copy(k),L.rotation.z=P,L.scale.set(.8,.8,.8),_a(L,{transparent:!0,side:I.DoubleSide});const x=(N=(O=(H=(j=L.children)==null?void 0:j[0])==null?void 0:H.children)==null?void 0:O[3])==null?void 0:N.clone();if(!x)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${x}`));const Q=(G=t.name)!=null?G:"\u5165\u6237\u95E8";return x.material=new V.MeshBasicMaterial({transparent:!0,map:kh(Q)}),x.renderOrder=3,L.children[0].add(x),e.object=L,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const y=1,w=new V.AnimationMixer(e.object);a.push(w);const k=w.clipAction(e.object.animations[0]);k.timeScale=y;let P;const C=()=>{let W=0,R=0;const U=1e3/30,j=H=>{W=requestAnimationFrame(j);const O=H-R;O<U||(R=H,a.forEach(N=>N.update(O/1e3)),i.needsRender=!0)};return W=requestAnimationFrame(j),()=>{cancelAnimationFrame(W)}},Q={play:()=>{P||(k.play(),P=C(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{k.stop(),P==null||P(),P=void 0}};e.animation=Q},u=y=>{var k;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((k=y==null?void 0:y.animationEnable)!=null?k:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},h=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},d=y=>y==="Floorplan"?u():h();return{load:l,enable:y=>(e.enabled||(e.enabled=!0,d(i.currentMode),i.on("modeChange",d),u(y)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),i.off("modeChange",d)),!0)}};class go extends An.default.Tween{constructor(){super(...arguments);m(this,"disposeMethods",[]);m(this,"animationFrameDisposer");m(this,"onDispose",e=>(this.disposeMethods.push(e),this));m(this,"play",()=>(this.start(0),this.animationFrameDisposer=En(e=>this.update(e)),this));m(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],An.default.remove(this)})}}function Na(i,t=An.default.Easing.Linear.None){const e=new go({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const yn=window.requestAnimationFrame||(i=>setTimeout(i,16)),Lh=window.cancelAnimationFrame||clearTimeout;function fi(i,t=0){t<=0?yn(i):yn(()=>fi(i,t-1))}function En(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=yn(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=yn(r),function(){Lh(e)}}function Sh(){const i=Date.now();return new Promise(t=>{yn(()=>{t(Date.now()-i)})})}const Mh=li.Easing;function Th(i,t,e,n=Mh.Linear.None){const o=new li.Tween(i).to(t,e).easing(n);fi(()=>o.start(0));const s=En(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function zh(i,t){return Th({progress:0},{progress:1},i,t)}var Xa=(i=>(i.Move="Move",i.Rotate="Rotate",i))(Xa||{}),Ke=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(Ke||{});const Un=Math.PI*2;function ps(i){return(i%Un+Un)%Un}function gs(i){return i%Un}function Li(i,t,e){return i+(t-i)*e}const Yi=(i,t,e)=>{const n=Math.PI,o=n*2;return i=ps(i),t=ps(t),e===Ke.Anticlockwise&&i<t&&(i+=o),e===Ke.Clockwise&&t<i&&(t+=o),e===Ke.Loop&&t-i>n?Yi(i,t,Ke.Anticlockwise):e===Ke.Loop&&i-t>n?Yi(i,t,Ke.Clockwise):{from:i,to:t}},Bh=i=>{const t={},e=(l,c,...u)=>_(exports,[l,c,...u],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((h,d)=>{const f=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;f!==void 0?i.moveToPano(f,Object.assign({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>d(!1)},s)):d(!1)})}),n=s=>{const r=i.state,a=gs(r.latitude),l=gs(s.latitude),{from:c,to:u}=Yi(r.longitude,s.longitude,s.rotation||Ke.Loop),h=r.fov,d=s.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:u,fov:d}}};return{move:e,rotate:(l,c,...u)=>_(exports,[l,c,...u],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==Ce.Five.Mode.Panorama&&(yield i.changeMode(Ce.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((f,g)=>{if(!s.panoIndex){f(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>f(!0),moveCancelCallback:()=>g(!1)})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:d}=n(s);return yield new Promise(f=>{const g=({progress:w})=>{const k={};k.longitude=Li(h.longitude,d.longitude,w),k.latitude=Li(h.latitude,d.latitude,w),k.fov=Li(h.fov,d.fov,w),i.setState(k,!0)},v=()=>{f(!0)},p=()=>{f(!1)},A=s.rotateSpeed?Math.ceil(Math.abs(d.longitude-h.longitude)/s.rotateSpeed*1e3):r,y=zh(A,li.Easing.Linear.None).onUpdate(g).onComplete(v).onDestroy(p);s.rotation===Ke.Loop&&y.repeat(1/0).yoyo(!0),t.interruptCallback=(w=!0)=>{y.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),f(w)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function As(i,t){return i.x===t.x&&i.y===t.y}function Ya(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function ri(i,t){return(t.y-i.y)/(t.x-i.x)}function Ua(i,t,e){const n=ri(i[1],i[0]),o=ri(t[1],t[0]);if(isNaN(n)||isNaN(o)||Ya(n,o))return!1;if(jn(i[0],t))return i[0];if(jn(i[1],t))return i[1];if(jn(t[0],i))return t[0];if(jn(t[1],i))return t[1];if(e&&!jh(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function jn(i,t){return As(i,t[0])||As(i,t[1])?!0:(t[0].x-i.x)*(i.x-t[1].x)>=0&&(t[0].y-i.y)*(i.y-t[1].y)>=0&&Ya(ri(t[0],i),ri(i,t[1]))}function Vn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function jh(i,t){return Math.max(i[0].x,i[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(i[0].x,i[1].x)&&Math.max(i[0].y,i[1].y)>=Math.min(t[0].y,t[1].y)&&Vn(t[0],i[1],i[0])*Vn(i[1],t[1],i[0])>0&&Vn(i[0],t[1],t[0])*Vn(t[1],i[1],t[0])>0?1:0}function qa(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>qa(i,t-1))}const Vh=`<style type="text/css">
115
+ `;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Bu extends oe{constructor(t){super(),ie(this,t,zu,Tu,ne,{content:0},Mu)}}function ju(i){ce(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function Vu(i){let t,e;return t=new Su({props:{url:i[1].url}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Qu(i){let t,e;return t=new Bu({props:{content:i[0]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Ou(i){let t,e,n,o;const s=[Qu,Vu],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=z("div"),n&&n.c(),b(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){M(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),E(n,1),n.m(t,null)):n=null)},i(l){o||(E(n),o=!0)},o(l){D(n),o=!1},d(l){l&&S(t),~e&&r[e].d()}}}function Ru(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class Oa extends oe{constructor(t){super(),ie(this,t,Ru,Ou,ne,{floorIndex:2,floorplanData:3},ju)}}function Fu(i){ce(i,"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}")}function Hu(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new Kn(!1),n=me(),t.a=n},m(o,s){t.m(e,o,s),M(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&S(n),o&&t.d()}}}function Gu(i){let t,e,n=i[1]&&Ro(i),o=i[0]&&Fo(i);return{c(){n&&n.c(),t=ee(),o&&o.c(),e=me()},m(s,r){n&&n.m(s,r),M(s,t,r),o&&o.m(s,r),M(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=Ro(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Fo(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&S(t),o&&o.d(s),s&&S(e)}}}function Ro(i){let t,e=i[2].name+"",n;return{c(){t=z("span"),n=Ie(e),b(t,"class","floorplan-plugin__room-name")},m(o,s){M(o,t,s),B(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Me(n,e)},d(o){o&&S(t)}}}function Fo(i){let t,e;return{c(){t=z("span"),e=Ie(i[7]),b(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){M(n,t,o),B(t,e)},p(n,o){o&128&&Me(e,n[7])},d(n){n&&S(t)}}}function Wu(i){let t,e;function n(r,a){if(r[3]===void 0)return Gu;if(r[8])return Hu}let o=n(i),s=o&&o(i);return{c(){t=z("div"),s&&s.c(),b(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),ke(()=>i[19].call(t)),T(t,"left",i[9]),T(t,"top",i[10]),T(t,"font-size",i[11]),T(t,"opacity",i[6]?"1":"0")},m(r,a){M(r,t,a),s&&s.m(t,null),e=tt(t,i[19].bind(t))},p(r,[a]){o===(o=n(r))&&s?s.p(r,a):(s&&s.d(1),s=o&&o(r),s&&(s.c(),s.m(t,null))),a&64&&T(t,"opacity",r[6]?"1":"0")},i:Y,o:Y,d(r){r&&S(t),s&&s.d(),e()}}}function _u(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],u=t[r][1];l>n!=u>n&&e<(c-a)*(n-l)/(u-l)+a&&(o=!o)}return o}function Nu(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:u}=t,{room:h}=t,{hoveredRoom:d}=t,{getRoomAreaText:f}=t,{getLabelElement:g}=t,{adaptiveRoomLabelVisibleEnable:v}=t;function p(R,U){if(U.width===0||U.height===0)return()=>!1;const j=R.path.map(({x:he,y:ue})=>[he,ue]),H=R.roomLabel.position,{x:O,y:N}=H,{width:G,height:$}=U,X=G/2,ae=$/2;return function(ue){const pe=O*ue,Pe=N*ue,Le=j.map(([le,ge])=>[le*ue,ge*ue]);return[[pe+X,Pe-ae],[pe-X,Pe-ae],[pe-X,Pe+ae],[pe+X,Pe+ae]].every(le=>_u(le,Le))}}const A=document.body.clientWidth,y=document.body.clientHeight,w=h.roomLabel,k=w.positionInImage.x*100+"%",P=w.positionInImage.y*100+"%",C=(A<500||y<500?10:14)+"px";let L=0,x=0,Q=!1;d.subscribe(function(U){e(16,Q=!!U&&U.id===h.id)});function W(){L=this.clientWidth,x=this.clientHeight,e(4,L),e(5,x)}return i.$$set=R=>{"pxmm"in R&&e(12,l=R.pxmm),"roomAreaEnable"in R&&e(0,c=R.roomAreaEnable),"roomNameEnable"in R&&e(1,u=R.roomNameEnable),"room"in R&&e(2,h=R.room),"hoveredRoom"in R&&e(13,d=R.hoveredRoom),"getRoomAreaText"in R&&e(14,f=R.getRoomAreaText),"getLabelElement"in R&&e(3,g=R.getLabelElement),"adaptiveRoomLabelVisibleEnable"in R&&e(15,v=R.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=g==null?void 0:g(h)),i.$$.dirty&16388&&e(7,o=h.size?f(h.size):""),i.$$.dirty&48&&e(18,s={width:L,height:x}),i.$$.dirty&262148&&e(17,r=s?p(h,s):void 0),i.$$.dirty&233472&&e(6,a=v?Q?!0:!!(r!=null&&r(l)):!0)},[c,u,h,g,L,x,a,o,n,k,P,C,l,d,f,v,Q,r,s,W]}class Xu extends oe{constructor(t){super(),ie(this,t,Nu,Wu,ne,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Fu)}}function Yu(i){ce(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function Ho(i,t,e){const n=i.slice();return n[12]=t[e],n}function Go(i){let t,e=[],n=new Map,o,s,r=i[8];const a=l=>l[12].id;for(let l=0;l<r.length;l+=1){let c=Ho(i,r,l),u=a(c);n.set(u,e[l]=Wo(u,c))}return{c(){t=z("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","floorplan-plugin__room-labels svelte-13xux0b"),ke(()=>i[11].call(t))},m(l,c){M(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=tt(t,i[11].bind(t)),s=!0},p(l,c){c&447&&(r=l[8],se(),e=Ue(e,c,a,1,l,r,n,t,Et,Wo,null,Ho),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)D(e[c]);s=!1},d(l){l&&S(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function Wo(i,t){let e,n,o;const s=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new Xu({props:r}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&447?Oe(s,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){o||(E(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&S(e),Z(n,a)}}}function Uu(i){let t,e,n=i[8]&&Go(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&E(n,1)):(n=Go(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function qu(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:u}=t,{adaptiveRoomLabelVisibleEnable:h}=t,d=0,f=0;function g(){d=this.clientWidth,e(6,d)}return i.$$set=v=>{"floorIndex"in v&&e(9,o=v.floorIndex),"roomAreaEnable"in v&&e(0,s=v.roomAreaEnable),"roomNameEnable"in v&&e(1,r=v.roomNameEnable),"floorplanData"in v&&e(10,a=v.floorplanData),"hoveredRoom"in v&&e(2,l=v.hoveredRoom),"getRoomAreaText"in v&&e(3,c=v.getRoomAreaText),"getLabelElement"in v&&e(4,u=v.getLabelElement),"adaptiveRoomLabelVisibleEnable"in v&&e(5,h=v.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:v,min:p}=a.bounding,A=v.x-p.x;e(7,f=d/A)}},[s,r,l,c,u,h,d,f,n,o,a,g]}class Ju extends oe{constructor(t){super(),ie(this,t,qu,Uu,ne,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Yu)}}function Zu(i){ce(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function _o(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function No(i,t,e){const n=i.slice();return n[14]=t[e],n}function Xo(i){let t;return{c(){t=z("div"),b(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),T(t,"left",i[14].left*100+"%"),T(t,"bottom",i[14].bottom*100+"%")},m(e,n){M(e,t,n)},p:Y,d(e){e&&S(t)}}}function Yo(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=z("div"),n=z("div"),s=Ie(o),r=ee(),b(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),q(n,"is-row",t[2]),b(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),T(e,"left",t[11].left*100+"%"),T(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){M(a,e,l),B(e,n),B(n,s),B(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Me(s,o)},d(a){a&&S(e)}}}function Ku(i){let t,e,n,o,s,r,a=[],l=new Map,c,u=i[3],h=[];for(let g=0;g<u.length;g+=1)h[g]=Xo(No(i,u,g));let d=i[4];const f=g=>g[13];for(let g=0;g<d.length;g+=1){let v=_o(i,d,g),p=f(v);l.set(p,a[g]=Yo(p,v))}return{c(){t=z("div"),e=z("div"),n=ee(),o=z("div");for(let g=0;g<h.length;g+=1)h[g].c();s=ee(),r=z("div");for(let g=0;g<a.length;g+=1)a[g].c();b(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),b(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),q(o,"is-row",i[2]),b(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),b(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),q(t,"is-row",i[2]),T(t,"width",i[2]?"100%":1/16+"rem"),T(t,"height",i[2]?1/16+"rem":"100%")},m(g,v){M(g,t,v),B(t,e),B(t,n),B(t,o);for(let p=0;p<h.length;p+=1)h[p].m(o,null);B(t,s),B(t,r);for(let p=0;p<a.length;p+=1)a[p].m(r,null)},p(g,[v]){if(v&8){u=g[3];let p;for(p=0;p<u.length;p+=1){const A=No(g,u,p);h[p]?h[p].p(A,v):(h[p]=Xo(A),h[p].c(),h[p].m(o,null))}for(;p<h.length;p+=1)h[p].d(1);h.length=u.length}v&22&&(d=g[4],a=Ue(a,v,f,1,g,d,l,r,ao,Yo,null,_o)),v&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&b(t,"class",c),v&5&&q(t,"is-row",g[2])},i:Y,o:Y,d(g){g&&S(t),at(h,g);for(let v=0;v<a.length;v+=1)a[v].d()}}}const Ot=1e3,Rt=180;function $u(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(Ot-Rt)*2,c=s.max.y-s.min.y-(Ot-Rt)*2,u=o.map(([g,v])=>a?[g.x,v.x]:[g.y,v.y]).flat().sort().filter((g,v,p)=>v===0?!0:g!==p[v-1]),h=u.map(g=>{const v=a?(g-s.min.x-Ot+Rt)/l:0,p=a?0:(g-s.min.y-Ot+Rt)/c;return{left:v,bottom:p}});h.unshift({left:0,bottom:0}),h.push(a?{left:1,bottom:0}:{left:0,bottom:1});const d=u[u.length-1]-u[0],f=u.map((g,v,p)=>{const A=v===0?0:g-p[v-1],y=v===0?0:(g+p[v-1])/2,w=a?(y-s.min.x-Ot+Rt)/l:0,k=a?0:(y-s.min.y-Ot+Rt)/c;return{left:w,bottom:k,distance:A}}).filter(({distance:g})=>g/d>.1);return i.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,o=g.data),"bounding"in g&&e(6,s=g.bounding),"getRuleDistanceText"in g&&e(1,r=g.getRuleDistanceText)},[n,r,a,h,f,o,s]}class ed extends oe{constructor(t){super(),ie(this,t,$u,Ku,ne,{type:0,data:5,bounding:6,getRuleDistanceText:1},Zu)}}function td(i){ce(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Uo(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function qo(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new ed({props:r}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Oe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(E(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&S(e),Z(n,a)}}}function nd(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=Uo(i,s,a),c=r(l);n.set(c,e[a]=qo(c,l))}return{c(){t=z("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),T(t,"width",i[3]),T(t,"height",i[2])},m(a,l){M(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],se(),e=Ue(e,l,r,1,a,s,n,t,Et,qo,null,Uo),re()),l&8&&T(t,"width",a[3]),l&4&&T(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)E(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&S(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Jo=1e3,Zo=180;function id(i,t,e){let n,o,s,r,a,l,c,u,h,d,{floorIndex:f}=t,{floorplanData:g}=t,{getRuleDistanceText:v}=t;return i.$$set=p=>{"floorIndex"in p&&e(5,f=p.floorIndex),"floorplanData"in p&&e(6,g=p.floorplanData),"getRuleDistanceText"in p&&e(0,v=p.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=g.bounding),i.$$.dirty&96&&e(11,o=g.floorDatas[f].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(p=>[p,o[p]])),i.$$.dirty&2&&e(9,a=n.max.x-n.min.x),i.$$.dirty&2&&e(7,l=n.max.y-n.min.y),i.$$.dirty&2&&e(10,c=n.max.x-n.min.x-(Jo-Zo)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(Jo-Zo)*2),i.$$.dirty&1536&&e(3,h=c/a*100+"%"),i.$$.dirty&384&&e(2,d=u/l*100+"%")},[v,n,d,h,r,f,g,l,u,a,c,o,s]}class od extends oe{constructor(t){super(),ie(this,t,id,nd,ne,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},td)}}function di(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,u=l+","+c;return a===0?(e+="M"+u,e):o!=null&&o[a]?(e+="A"+o[a]+","+u,e):(e+="L"+u,e)}),e+(n?"Z":"")}function Ra({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function sd(i,t){const e=i.x*1e3+t.bounding.origin.x,n=-i.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function rd(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function ad(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function ld(i){let t;return{c(){t=ye("path"),b(t,"d",i[0]),b(t,"fill","#2F313A")},m(e,n){M(e,t,n)},p(e,[n]){n&1&&b(t,"d",e[0])},i:Y,o:Y,d(e){e&&S(t)}}}function cd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=di(o,{needZ:!0}))},[n,o]}class ud extends oe{constructor(t){super(),ie(this,t,cd,ld,ne,{path:1})}}function dd(i){let t,e,n,o,s,r;return{c(){t=ye("defs"),e=ye("pattern"),n=ye("rect"),o=ye("path"),s=ee(),r=ye("path"),b(n,"x","0"),b(n,"y","0"),b(n,"width",i[1]),b(n,"height",i[1]),b(n,"fill","#323747"),b(o,"d",i[2]),b(o,"stroke","#ffffff"),b(o,"stroke-opacity","0.06"),b(o,"stroke-width","0.5"),b(o,"fill","none"),b(e,"id","fpm-room-pattern-0"),b(e,"x","0"),b(e,"y","0"),b(e,"width",i[1]),b(e,"height",i[1]),b(e,"patternUnits","userSpaceOnUse"),b(e,"patternTransform","scale(50 50)"),b(r,"d",i[0]),b(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){M(a,t,l),B(t,e),B(e,n),B(e,o),M(a,s,l),M(a,r,l)},p(a,[l]){l&1&&b(r,"d",a[0])},i:Y,o:Y,d(a){a&&S(t),a&&S(s),a&&S(r)}}}const xi=6;function hd(i,t,e){let n,{path:o}=t;const s=xi*2,r=`M0 ${xi} h ${s} M${xi} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=di(o,{needZ:!0}))},[n,s,r,o]}class fd extends oe{constructor(t){super(),ie(this,t,hd,dd,ne,{path:3})}}function md(i){let t,e,n,o,s,r,a,l,c,u,h;return{c(){t=ye("defs"),e=ye("pattern"),n=ye("rect"),o=ye("pattern"),s=ye("rect"),r=ee(),a=ye("path"),l=ee(),c=ye("path"),u=ee(),h=ye("path"),b(n,"x","0"),b(n,"y","0"),b(n,"width","6"),b(n,"height","50"),b(n,"fill","none"),b(n,"stroke","#4B4B57"),b(n,"stroke-width","0.5"),b(e,"id","room-material-pattern-1"),b(e,"x","0"),b(e,"y","0"),b(e,"width","12"),b(e,"height","50"),b(e,"patternUnits","userSpaceOnUse"),b(e,"patternTransform","scale(50 50)"),b(s,"x","0"),b(s,"y","0"),b(s,"width","6"),b(s,"height","50"),b(s,"fill","none"),b(s,"stroke","#4B4B57"),b(s,"stroke-width","0.5"),b(o,"id","room-material-pattern-2"),b(o,"x","6"),b(o,"y","25"),b(o,"width","12"),b(o,"height","50"),b(o,"patternUnits","userSpaceOnUse"),b(o,"patternTransform","scale(50 50)"),b(a,"d",i[0]),b(a,"fill","#43434D"),b(c,"d",i[0]),b(c,"fill","url(#room-material-pattern-1)"),b(h,"d",i[0]),b(h,"fill","url(#room-material-pattern-2)")},m(d,f){M(d,t,f),B(t,e),B(e,n),B(t,o),B(o,s),M(d,r,f),M(d,a,f),M(d,l,f),M(d,c,f),M(d,u,f),M(d,h,f)},p(d,[f]){f&1&&b(a,"d",d[0]),f&1&&b(c,"d",d[0]),f&1&&b(h,"d",d[0])},i:Y,o:Y,d(d){d&&S(t),d&&S(r),d&&S(a),d&&S(l),d&&S(c),d&&S(u),d&&S(h)}}}function pd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=di(o,{needZ:!0}))},[n,o]}class gd extends oe{constructor(t){super(),ie(this,t,pd,md,ne,{path:1})}}function Ad(i){ce(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Ko(i,t,e){const n=i.slice();return n[5]=t[e],n}function vd(i){let t,e;return t=new fd({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function bd(i){let t,e;return t=new gd({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function yd(i){let t,e;return t=new ud({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function $o(i){let t,e,n,o;const s=[yd,bd,vd],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=ye("svg"),n.c(),b(t,"width","100%"),b(t,"height","100%"),b(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),b(t,"class","svelte-1dykexu")},m(l,c){M(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),E(n,1),n.m(t,null))},i(l){o||(E(n),o=!0)},o(l){D(n),o=!1},d(l){l&&S(t),r[e].d()}}}function wd(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=$o(Ko(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){t=z("div");for(let r=0;r<o.length;r+=1)o[r].c();b(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){M(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Ko(r,n,l);o[l]?(o[l].p(c,a),E(o[l],1)):(o[l]=$o(c),o[l].c(),E(o[l],1),o[l].m(t,null))}for(se(),l=n.length;l<o.length;l+=1)s(l);re()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)E(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)D(o[a]);e=!1},d(r){r&&S(t),at(o,r)}}}function Cd(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>fe(F({},l),{path:l.path.map(c=>Ra(c,s.bounding))})))},[n,r,a,o,s]}class Pd extends oe{constructor(t){super(),ie(this,t,Cd,wd,ne,{floorIndex:3,floorplanData:4},Ad)}}function Ed(i){ce(i,"svelte-19uvvss","path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}")}function Id(i){let t,e,n;return{c(){t=ye("path"),b(t,"d",i[2]),b(t,"fill","#fff"),b(t,"class","svelte-19uvvss")},m(o,s){M(o,t,s),e||(n=[we(t,"mouseenter",i[0]),we(t,"mouseleave",i[1])],e=!0)},p:Y,i:Y,o:Y,d(o){o&&S(t),e=!1,ct(n)}}}function kd(i,t,e){let{room:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;function r(){s.set(n)}function a(){s.set(void 0)}const{bounding:l}=o,c=di(n.path,{needZ:!0,format:u=>Ra(u,l)});return i.$$set=u=>{"room"in u&&e(3,n=u.room),"floorplanData"in u&&e(4,o=u.floorplanData),"hoveredRoom"in u&&e(5,s=u.hoveredRoom)},[r,a,c,n,o,s]}class xd extends oe{constructor(t){super(),ie(this,t,kd,Id,ne,{room:3,floorplanData:4,hoveredRoom:5},Ed)}}function Dd(i){ce(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function es(i,t,e){const n=i.slice();return n[5]=t[e],n}function ts(i,t){let e,n,o;const s=[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new xd({props:r}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&7?Oe(s,[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}]):{};n.$set(c)},i(a){o||(E(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&S(e),Z(n,a)}}}function Ld(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[5].id;for(let l=0;l<r.length;l+=1){let c=es(i,r,l),u=a(c);o.set(u,n[l]=ts(u,c))}return{c(){t=z("div"),e=ye("svg");for(let l=0;l<n.length;l+=1)n[l].c();b(e,"width","100%"),b(e,"height","100%"),b(e,"viewBox",`0 0 ${i[3]} ${i[4]}`),b(e,"class","svelte-1kqo6e4"),b(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){M(l,t,c),B(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);s=!0},p(l,[c]){c&7&&(r=l[1].floorDatas[l[0]].rooms,se(),n=Ue(n,c,a,1,l,r,o,e,Et,ts,null,es),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)D(n[c]);s=!1},d(l){l&&S(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Sd(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(0,n=l.floorIndex),"floorplanData"in l&&e(1,o=l.floorplanData),"hoveredRoom"in l&&e(2,s=l.hoveredRoom)},[n,o,s,r,a]}class Fa extends oe{constructor(t){super(),ie(this,t,Sd,Ld,ne,{floorIndex:0,floorplanData:1,hoveredRoom:2},Dd)}}function Md(i){ce(i,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function ns(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[7],hoveredRoom:i[12]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Fa({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&4226?Oe(n,[{floorIndex:s[1],floorplanData:s[7],hoveredRoom:s[12]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function is(i){let t,e;const n=[{floorplanData:i[7],roomAreaEnable:i[4],roomNameEnable:i[5],floorIndex:i[1],getRoomAreaText:i[8],getLabelElement:i[9],hoveredRoom:i[12],adaptiveRoomLabelVisibleEnable:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Ju({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&7090?Oe(n,[{floorplanData:s[7],roomAreaEnable:s[4],roomNameEnable:s[5],floorIndex:s[1],getRoomAreaText:s[8],getLabelElement:s[9],hoveredRoom:s[12],adaptiveRoomLabelVisibleEnable:s[11]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function os(i){let t,e;const n=[{floorplanData:i[7],floorIndex:i[1],getRuleDistanceText:i[10]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new od({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&1154?Oe(n,[{floorplanData:s[7],floorIndex:s[1],getRuleDistanceText:s[10]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function Td(i){let t,e,n,o,s,r,a,l,c;const u=[{floorIndex:i[1],floorplanData:i[7]}];let h={};for(let A=0;A<u.length;A+=1)h=je(h,u[A]);e=new Pd({props:h});let d=i[2]&&ns(i);const f=[{floorplanData:i[7],floorIndex:i[1]}];let g={};for(let A=0;A<f.length;A+=1)g=je(g,f[A]);s=new Oa({props:g});let v=i[3]&&is(i),p=i[6]&&os(i);return{c(){t=z("div"),K(e.$$.fragment),n=ee(),d&&d.c(),o=ee(),K(s.$$.fragment),r=ee(),v&&v.c(),a=ee(),p&&p.c(),b(t,"class",l=Te(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(A,y){M(A,t,y),J(e,t,null),B(t,n),d&&d.m(t,null),B(t,o),J(s,t,null),B(t,r),v&&v.m(t,null),B(t,a),p&&p.m(t,null),c=!0},p(A,[y]){const w=y&130?Oe(u,[{floorIndex:A[1],floorplanData:A[7]}]):{};e.$set(w),A[2]?d?(d.p(A,y),y&4&&E(d,1)):(d=ns(A),d.c(),E(d,1),d.m(t,o)):d&&(se(),D(d,1,1,()=>{d=null}),re());const k=y&130?Oe(f,[{floorplanData:A[7],floorIndex:A[1]}]):{};s.$set(k),A[3]?v?(v.p(A,y),y&8&&E(v,1)):(v=is(A),v.c(),E(v,1),v.m(t,a)):v&&(se(),D(v,1,1,()=>{v=null}),re()),A[6]?p?(p.p(A,y),y&64&&E(p,1)):(p=os(A),p.c(),E(p,1),p.m(t,null)):p&&(se(),D(p,1,1,()=>{p=null}),re()),(!c||y&1&&l!==(l=Te(`floorplan-plugin__floor${A[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&b(t,"class",l)},i(A){c||(E(e.$$.fragment,A),E(d),E(s.$$.fragment,A),E(v),E(p),c=!0)},o(A){D(e.$$.fragment,A),D(d),D(s.$$.fragment,A),D(v),D(p),c=!1},d(A){A&&S(t),Z(e),d&&d.d(),Z(s),v&&v.d(),p&&p.d()}}}function zd(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{hoverEnable:s}=t,{roomLabelsEnable:r}=t,{roomAreaEnable:a}=t,{roomNameEnable:l}=t,{ruleLabelsEnable:c}=t,{floorplanData:u}=t,{getRoomAreaText:h}=t,{getLabelElement:d}=t,{getRuleDistanceText:f}=t,{adaptiveRoomLabelVisibleEnable:g}=t;const v=co(void 0);return i.$$set=p=>{"isCurrent"in p&&e(0,n=p.isCurrent),"floorIndex"in p&&e(1,o=p.floorIndex),"hoverEnable"in p&&e(2,s=p.hoverEnable),"roomLabelsEnable"in p&&e(3,r=p.roomLabelsEnable),"roomAreaEnable"in p&&e(4,a=p.roomAreaEnable),"roomNameEnable"in p&&e(5,l=p.roomNameEnable),"ruleLabelsEnable"in p&&e(6,c=p.ruleLabelsEnable),"floorplanData"in p&&e(7,u=p.floorplanData),"getRoomAreaText"in p&&e(8,h=p.getRoomAreaText),"getLabelElement"in p&&e(9,d=p.getLabelElement),"getRuleDistanceText"in p&&e(10,f=p.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in p&&e(11,g=p.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,u,h,d,f,g,v]}class Bd extends oe{constructor(t){super(),ie(this,t,zd,Td,ne,{isCurrent:0,floorIndex:1,hoverEnable:2,roomLabelsEnable:3,roomAreaEnable:4,roomNameEnable:5,ruleLabelsEnable:6,floorplanData:7,getRoomAreaText:8,getLabelElement:9,getRuleDistanceText:10,adaptiveRoomLabelVisibleEnable:11},Md)}}function jd(i){ce(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function ss(i,t,e){const n=i.slice();return n[18]=t[e],n}function rs(i){let t,e,n,o,s,r,a=i[11].floorDatas,l=[];for(let f=0;f<a.length;f+=1)l[f]=as(ss(i,a,f));const c=f=>D(l[f],1,1,()=>{l[f]=null}),u=[{panoIndex:i[3],floorplanData:i[11],lastPanoramaLongitude:i[12],cameraImageUrl:i[13]}];let h={};for(let f=0;f<u.length;f+=1)h=je(h,u[f]);n=new bu({props:h});let d=i[6]&&ls(i);return{c(){t=z("div");for(let f=0;f<l.length;f+=1)l[f].c();e=ee(),K(n.$$.fragment),o=ee(),d&&d.c(),b(t,"class","floorplan-main svelte-86bqav")},m(f,g){M(f,t,g);for(let v=0;v<l.length;v+=1)l[v].m(t,null);B(t,e),J(n,t,null),B(t,o),d&&d.m(t,null),r=!0},p(f,g){if(i=f,g&249776){a=i[11].floorDatas;let p;for(p=0;p<a.length;p+=1){const A=ss(i,a,p);l[p]?(l[p].p(A,g),E(l[p],1)):(l[p]=as(A),l[p].c(),E(l[p],1),l[p].m(t,e))}for(se(),p=a.length;p<l.length;p+=1)c(p);re()}const v=g&14344?Oe(u,[{panoIndex:i[3],floorplanData:i[11],lastPanoramaLongitude:i[12],cameraImageUrl:i[13]}]):{};n.$set(v),i[6]?d?(d.p(i,g),g&64&&E(d,1)):(d=ls(i),d.c(),E(d,1),d.m(t,null)):d&&(se(),D(d,1,1,()=>{d=null}),re())},i(f){if(!r){for(let g=0;g<a.length;g+=1)E(l[g]);E(n.$$.fragment,f),E(d),s||ke(()=>{s=Tt(t,Mt,{duration:i[0],easing:At}),s.start()}),r=!0}},o(f){l=l.filter(Boolean);for(let g=0;g<l.length;g+=1)D(l[g]);D(n.$$.fragment,f),D(d),r=!1},d(f){f&&S(t),at(l,f),Z(n),d&&d.d()}}}function as(i){let t,e;const n=[{hoverEnable:i[5],floorplanData:i[11],getRoomAreaText:i[14],getLabelElement:i[15],getRuleDistanceText:i[16],roomLabelsEnable:i[7],roomAreaEnable:i[8],roomNameEnable:i[9],ruleLabelsEnable:i[10],adaptiveRoomLabelVisibleEnable:i[17]},{floorIndex:i[18].floorIndex},{isCurrent:i[18].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Bd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&249776?Oe(n,[r&249760&&{hoverEnable:s[5],floorplanData:s[11],getRoomAreaText:s[14],getLabelElement:s[15],getRuleDistanceText:s[16],roomLabelsEnable:s[7],roomAreaEnable:s[8],roomNameEnable:s[9],ruleLabelsEnable:s[10],adaptiveRoomLabelVisibleEnable:s[17]},r&2048&&{floorIndex:s[18].floorIndex},r&2064&&{isCurrent:s[18].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ls(i){let t,e;return t=new ku({props:{floorplanData:i[11],northDesc:i[2]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2048&&(s.floorplanData=n[11]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Vd(i){let t,e,n=i[1]&&rs(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&E(n,1)):(n=rs(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function Qd(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{hoverEnable:l}=t,{compassEnable:c}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:h}=t,{roomNameEnable:d}=t,{ruleLabelsEnable:f}=t,{floorplanData:g}=t,{lastPanoramaLongitude:v}=t,{cameraImageUrl:p}=t,{getRoomAreaText:A}=t,{getLabelElement:y}=t,{getRuleDistanceText:w}=t,{adaptiveRoomLabelVisibleEnable:k}=t;return i.$$set=P=>{"duration"in P&&e(0,n=P.duration),"visible"in P&&e(1,o=P.visible),"northDesc"in P&&e(2,s=P.northDesc),"panoIndex"in P&&e(3,r=P.panoIndex),"floorIndex"in P&&e(4,a=P.floorIndex),"hoverEnable"in P&&e(5,l=P.hoverEnable),"compassEnable"in P&&e(6,c=P.compassEnable),"roomLabelsEnable"in P&&e(7,u=P.roomLabelsEnable),"roomAreaEnable"in P&&e(8,h=P.roomAreaEnable),"roomNameEnable"in P&&e(9,d=P.roomNameEnable),"ruleLabelsEnable"in P&&e(10,f=P.ruleLabelsEnable),"floorplanData"in P&&e(11,g=P.floorplanData),"lastPanoramaLongitude"in P&&e(12,v=P.lastPanoramaLongitude),"cameraImageUrl"in P&&e(13,p=P.cameraImageUrl),"getRoomAreaText"in P&&e(14,A=P.getRoomAreaText),"getLabelElement"in P&&e(15,y=P.getLabelElement),"getRuleDistanceText"in P&&e(16,w=P.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in P&&e(17,k=P.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,u,h,d,f,g,v,p,A,y,w,k]}class uo extends oe{constructor(t){super(),ie(this,t,Qd,Vd,ne,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,hoverEnable:5,compassEnable:6,roomLabelsEnable:7,roomAreaEnable:8,roomNameEnable:9,ruleLabelsEnable:10,floorplanData:11,lastPanoramaLongitude:12,cameraImageUrl:13,getRoomAreaText:14,getLabelElement:15,getRuleDistanceText:16,adaptiveRoomLabelVisibleEnable:17},jd)}}const Od="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function Rd(i){return _(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return _(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function Fd(i){return{id:i.id,size:i.size,name:i.name,path:i.path,roomType:i.room_type,floorType:i.floor_type,roomLabel:{position:i.room_label.position,positionInImage:i.room_label.position_in_image},observerIndexs:i.observer_indexs}}function Hd(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Fd),rules:i.rules}}function Gd(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function Wd(i){return{rad:i.rad,position:i.position,positionInImage:i.position_in_image,northRad:i.north_rad,roomId:i.room_id,floorIndex:i.floor_index}}function bt(i){return _(this,null,function*(){const t=yield Rd(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Hd),o=i.computed_data.entrance?Wd(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Gd)}})}function _d(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:Od,width:45,height:48},a=ad(s,t),l=sd(s,e),c=rd(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Nd(i,t){return t(i),i}function hi(i,t){return Nd({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function cs(i,t){const e=Math.max(...i.work.observers.map(n=>n.floorIndex));return t>e?i.model.bounding.max.y:Math.max(...i.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function ho(i,t,e=pt.BOUNDING_CENTER){const n=cs(i,t),o=cs(i,t+1);return e===pt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===pt.CEILING?o:n}function fo(i,t,e,n){const o=ho(i,e,n==null?void 0:n.attachedTo),s=new I.Vector3(0,o,0),r=new I.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}class Pn{constructor(t,e){m(this,"VERSION","2.11.0-alpha.1");m(this,"five");m(this,"hooks",new Jt);m(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class zt extends Pn{}var Ge=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(Ge||{});const Ha=500,Xd=80;function Xi(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function Ga(i,t){return _(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const h=l[c];return typeof u=="number"&&typeof h=="number"?Xi(u,h,2):u===h}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function mo(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!Xi(e,s,2)||!Xi(n,r,2)||o!==a)}function Wa(i,t,e=!0){return _(this,null,function*(){if(mo(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield ii(Ga(i,[t.mode,t,void 0,e]));if(u)throw new Error(Ge.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ii(i.updateCamera(t,l,e));if(c)throw new Error(Ge.UpdateCameraError)})}function Yt(i,t,e=300){const n=i.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function Yd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Ud(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class qd extends zt{constructor(e,n){var a;super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>_(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));m(this,"hide",(...n)=>_(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!mo(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=fo(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ge.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>_(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ge.ModelNotLoaded);if(!this.data)throw new Error(Ge.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=F(F({},n),e),s=()=>_(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield ii(Wa(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ge.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:Ha;Yt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ge.BreakOffByHide),this.showPromise=void 0;const o=F(F({},{userAction:!0,isAutoHide:!1}),e);Yt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||Ud(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();Yd(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});m(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:Xd/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?hi(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return _(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield bt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return _(this,null,function*(){return yield bt(e.data)})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=fe(F(F({},this.state),e),{config:s}),!$e(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new uo({target:this.container,intro:!0,props:n})}}const Jd=(i,t)=>new qd(i,t);function Zd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Kd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class $d extends zt{constructor(e,n){super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>_(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));m(this,"hide",(...n)=>_(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!mo(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=fo(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ge.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>_(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ge.ModelNotLoaded);if(!this.data)throw new Error(Ge.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=F(F({},n),e),s=()=>_(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield ii(Wa(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ge.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:Ha;Yt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ge.BreakOffByHide),this.showPromise=void 0;const o=F(F({},{userAction:!0,isAutoHide:!1}),e);Yt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Zd(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(Kd(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?hi(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return _(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield bt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=ho(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new I.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return _(this,null,function*(){return yield bt(e.data)})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=fe(F(F({},this.state),e),{config:s}),!$e(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new uo({target:this.container,intro:!0,props:n})}}const eh=(i,t)=>new $d(i,t);class th extends zt{constructor(e,n){super(e);m(this,"name","topviewFloorplanPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"selector");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=fo(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"_disable",e=>{var o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});m(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});m(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});m(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?hi(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return _(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield bt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=ho(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new I.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return _(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return _(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return _(this,null,function*(){return yield bt(e.data)})}_show(e){return _(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield Ga(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;Yt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return _(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Yt(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=fe(F(F({},this.state),e),{config:s}),!$e(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new uo({target:this.container,intro:!0,props:n})}}const nh=(i,t)=>new th(i,t);function po(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function ih(i){ce(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function oh(i){let t,e,n;return{c(){t=z("div"),e=z("div"),n=z("div"),b(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),T(n,"background-image","url("+(i[0]||vt)+")"),T(n,"transform",i[1]),b(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),T(e,"transform",i[2]),b(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){M(o,t,s),B(t,e),B(e,n)},p(o,[s]){s&1&&T(n,"background-image","url("+(o[0]||vt)+")"),s&2&&T(n,"transform",o[1]),s&4&&T(e,"transform",o[2])},i:Y,o:Y,d(o){o&&S(t)}}}function sh(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function rh(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,u=s.getCurrentState().longitude;function h(g,v){const p=g.bounding,A=g.observers[v];if(!A)return"";const y=(p.max.x-p.min.x)*r,w=(p.max.y-p.min.y)*r,k=Math.floor(A.positionInImage.x*y),P=Math.floor(A.positionInImage.y*w);return`translate(${k}px, ${P}px)`}function d(g){e(6,c=g)}const f=po(g=>{e(7,u=g.longitude)},1e3/60);return Ye(()=>(s.on("panoWillArrive",d),s.on("cameraDirectionUpdate",f),function(){s.off("panoWillArrive",d),s.off("cameraDirectionUpdate",f)})),i.$$set=g=>{"five"in g&&e(3,s=g.five),"pxmm"in g&&e(4,r=g.pxmm),"floorplanData"in g&&e(5,a=g.floorplanData),"cameraImageUrl"in g&&e(0,l=g.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=h(a,c)),i.$$.dirty&128&&e(1,o=sh(u))},[l,o,n,s,r,a,c,u]}class ah extends oe{constructor(t){super(),ie(this,t,rh,oh,ne,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},ih)}}function lh(i){ce(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function us(i,t,e){const n=i.slice();return n[1]=t[e],n}function ds(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=z("div"),n=z("div"),r=ee(),b(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),T(n,"background-image",`url(${t[1].icon.url})`),T(n,"width",o),T(n,"height",s),b(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),T(e,"top",a),T(e,"left",l),this.first=e},m(c,u){M(c,e,u),B(e,n),B(e,r)},p(c,u){t=c,u&1&&T(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&T(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&T(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&T(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&T(e,"left",l)},d(c){c&&S(e)}}}function ch(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=us(i,o,r),l=s(a);n.set(l,e[r]=ds(l,a))}return{c(){t=z("div");for(let r=0;r<e.length;r+=1)e[r].c();b(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){M(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=Ue(e,a,s,1,r,o,n,t,ao,ds,null,us))},i:Y,o:Y,d(r){r&&S(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function uh(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class dh extends oe{constructor(t){super(),ie(this,t,uh,ch,ne,{extraObjects:0},lh)}}function hs(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[6]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Fa({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&87?Oe(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[6]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function hh(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let u=0;u<a.length;u+=1)l=je(l,a[u]);t=new Oa({props:l}),n=new dh({props:{extraObjects:i[5]}});let c=i[3]&&hs(i);return{c(){K(t.$$.fragment),e=ee(),K(n.$$.fragment),o=ee(),c&&c.c(),s=me()},m(u,h){J(t,u,h),M(u,e,h),J(n,u,h),M(u,o,h),c&&c.m(u,h),M(u,s,h),r=!0},p(u,[h]){const d=h&20?Oe(a,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(d);const f={};h&32&&(f.extraObjects=u[5]),n.$set(f),u[3]?c?(c.p(u,h),h&8&&E(c,1)):(c=hs(u),c.c(),E(c,1),c.m(s.parentNode,s)):c&&(se(),D(c,1,1,()=>{c=null}),re())},i(u){r||(E(t.$$.fragment,u),E(n.$$.fragment,u),E(c),r=!0)},o(u){D(t.$$.fragment,u),D(n.$$.fragment,u),D(c),r=!1},d(u){Z(t,u),u&&S(e),Z(n,u),u&&S(o),c&&c.d(u),u&&S(s)}}}function fh(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const u=void 0;return i.$$set=h=>{"five"in h&&e(0,o=h.five),"pxmm"in h&&e(1,s=h.pxmm),"floorIndex"in h&&e(2,r=h.floorIndex),"hoverEnable"in h&&e(3,a=h.hoverEnable),"floorplanData"in h&&e(4,l=h.floorplanData),"extraObjects"in h&&e(7,c=h.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(h=>h.floorIndex===r))},[o,s,r,a,l,n,u,c]}class mh extends oe{constructor(t){super(),ie(this,t,fh,hh,ne,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function ph(i){ce(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function fs(i){let t,e,n,o=i[6]!==0&&ms(i);return{c(){t=z("div"),o&&o.c(),b(t,"class","plugin-floorplan-radar svelte-1mvqyqq"),ke(()=>i[12].call(t))},m(s,r){M(s,t,r),o&&o.m(t,null),e=tt(t,i[12].bind(t)),n=!0},p(s,r){s[6]!==0?o?(o.p(s,r),r&64&&E(o,1)):(o=ms(s),o.c(),E(o,1),o.m(t,null)):o&&(se(),D(o,1,1,()=>{o=null}),re())},i(s){n||(E(o),n=!0)},o(s){D(o),n=!1},d(s){s&&S(t),o&&o.d(),e()}}}function ms(i){let t,e,n,o,s=`${i[8]}px`,r=`${i[11]}px`,a;const l=[{five:i[0],pxmm:i[9],floorIndex:i[10],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5]}];let c={};for(let d=0;d<l.length;d+=1)c=je(c,l[d]);e=new mh({props:c});const u=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let h={};for(let d=0;d<u.length;d+=1)h=je(h,u[d]);return o=new ah({props:h}),{c(){t=z("div"),K(e.$$.fragment),n=ee(),K(o.$$.fragment),b(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),T(t,"width",s),T(t,"height",r)},m(d,f){M(d,t,f),J(e,t,null),B(t,n),J(o,t,null),a=!0},p(d,f){const g=f&1581?Oe(l,[{five:d[0],pxmm:d[9],floorIndex:d[10],floorplanData:d[3],hoverEnable:d[2],extraObjects:d[5]}]):{};e.$set(g);const v=f&537?Oe(u,[{pxmm:d[9],five:d[0],floorplanData:d[3],cameraImageUrl:d[4]}]):{};o.$set(v),f&256&&s!==(s=`${d[8]}px`)&&T(t,"width",s),f&2048&&r!==(r=`${d[11]}px`)&&T(t,"height",r)},i(d){a||(E(e.$$.fragment,d),E(o.$$.fragment,d),a=!0)},o(d){D(e.$$.fragment,d),D(o.$$.fragment,d),a=!1},d(d){d&&S(t),Z(e),Z(o)}}}function gh(i){let t,e,n=i[1]&&fs(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&E(n,1)):(n=fs(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function Ah(i,t,e){var A,y;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,u=(y=(A=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:A.floorIndex)!=null?y:0,h=0,d=0,f=0,g=0;function v(w){e(10,u=n.work.observers[w].floorIndex)}Ye(()=>(n.on("panoArrived",v),()=>{n.off("panoArrived",v)}));function p(){h=this.clientWidth,d=this.clientHeight,e(6,h),e(7,d)}return i.$$set=w=>{"five"in w&&e(0,n=w.five),"visible"in w&&e(1,o=w.visible),"hoverEnable"in w&&e(2,s=w.hoverEnable),"floorplanData"in w&&e(3,r=w.floorplanData),"cameraImageUrl"in w&&e(4,a=w.cameraImageUrl),"extraObjects"in w&&e(5,l=w.extraObjects)},i.$$.update=()=>{if(i.$$.dirty&456){const w=Math.min(h,d),{max:k,min:P}=r.bounding,C=k.x-P.x,L=k.y-P.y,x=function(){return C>L?[w,w/C*L]:[w/L*C,w]}();e(8,f=x[0]),e(11,g=x[1]),e(9,c=f/C)}},[n,o,s,r,a,l,h,d,f,c,u,g,p]}class vh extends oe{constructor(t){super(),ie(this,t,Ah,gh,ne,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},ph)}}class bh extends zt{constructor(e,n){super(e);m(this,"name","panoFloorplanRadarPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"wrapperSelector","");m(this,"wrapper",null);m(this,"disposed",!1);m(this,"extraObjects",[]);m(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});m(this,"_disable",e=>{var o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!1,cameraImageUrl:vt},s=n!=null&&n.configs?n.configs:{},r=F(F({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return _(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield bt(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return _(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return _(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=_d(e,this.five,this.data),this.render())}formatData(e){return _(this,null,function*(){return yield bt(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=F(F({},this.state),e),!$e(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=fe(F({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects});this.app?this.app.$set(e):this.app=new vh({target:this.wrapper,props:e})}}const yh=(i,t)=>new bh(i,t),wh=[{type:0,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6"},{type:1,floorType:1,roomType:"100900000002",name:"\u5BA2\u5385"},{type:2,floorType:1,roomType:"100900000002",name:"\u9910\u5385"},{type:3,floorType:0,roomType:"100900000001",name:"\u5367\u5BA4"},{type:4,floorType:0,roomType:"100900000001",name:"\u4E66\u623F"},{type:5,floorType:3,roomType:"100900000004",name:"\u536B\u751F\u95F4"},{type:6,floorType:3,roomType:"100900000004",name:"\u6DCB\u6D74\u95F4"},{type:7,floorType:3,roomType:"100900000004",name:"\u6D17\u624B\u95F4"},{type:8,floorType:3,roomType:"100900000003",name:"\u53A8\u623F"},{type:9,floorType:1,roomType:"100900000003",name:"\u5F00\u653E\u53A8\u623F",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"\u591A\u529F\u80FD\u95F4"},{type:11,floorType:0,roomType:"100900000009",name:"\u4FDD\u59C6\u95F4"},{type:12,floorType:4,roomType:"100900000005",name:"\u9633\u53F0"},{type:13,floorType:4,roomType:"100900000006",name:"\u9732\u53F0"},{type:14,floorType:0,roomType:"100900000008",name:"\u50A8\u7269\u95F4"},{type:15,floorType:0,roomType:"100900000013",name:"\u8863\u5E3D\u95F4"},{type:16,floorType:0,roomType:"100900000011",name:"\u9601\u697C"},{type:17,floorType:2,roomType:"100900000007",name:"\u82B1\u56ED"},{type:18,floorType:5,roomType:"100900000010",name:"\u8F66\u5E93"},{type:19,floorType:1,roomType:"100900000012",name:"\u7535\u68AF"},{type:20,floorType:1,roomType:"100900000012",name:"\u5730\u4E0B\u5BA4"},{type:21,floorType:1,roomType:"100900000012",name:"\u5929\u4E95"},{type:22,floorType:1,roomType:"100900000012",name:"\u9633\u5149\u623F"},{type:23,floorType:1,roomType:"100900000012",name:"\u8FC7\u9053"},{type:24,floorType:1,roomType:"100900000012",name:"\u697C\u68AF\u95F4"},{type:25,floorType:1,roomType:"100900000012",name:"\u95E8\u5385"},{type:26,floorType:2,roomType:"100900000012",name:"\u5165\u6237\u82B1\u56ED"},{type:27,floorType:1,roomType:"100900000012",name:"\u7384\u5173"},{type:28,floorType:1,roomType:"100900000012",name:"\u6311\u7A7A"},{type:29,floorType:4,roomType:"100900000012",name:"\u667E\u6652\u533A"},{type:30,floorType:4,roomType:"100900000012",name:"\u6D17\u8863\u623F"},{type:31,floorType:0,roomType:"100900000012",name:"\u5A31\u4E50\u533A"},{type:32,floorType:0,roomType:"100900000012",name:"\u5065\u8EAB\u533A"},{type:33,floorType:0,roomType:"100900000012",name:"\u63A5\u5F85\u533A"},{type:34,floorType:0,roomType:"100900000012",name:"\u5F71\u97F3\u533A"},{type:35,floorType:1,roomType:"100900000012",name:"\u9910\u996E\u533A"},{type:36,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"\u8D77\u5C45\u5BA4"},{type:38,floorType:0,roomType:"100900000001",name:"\u4E3B\u5367"},{type:39,floorType:0,roomType:"100900000001",name:"\u6B21\u5367"},{type:40,floorType:0,roomType:"100900000001",name:"\u4F18\u5316\u95F4"},{type:41,floorType:0,roomType:"100900000001",name:"\u529E\u516C\u5BA4"},{type:42,floorType:0,roomType:"100900000001",name:"\u4F1A\u8BAE\u5BA4"},{type:43,floorType:0,roomType:"100900000001",name:"\u6D3D\u8C08\u95F4"},{type:44,floorType:1,roomType:"100900000002",name:"\u5171\u4EAB\u5927\u5385"},{type:45,floorType:1,roomType:"100900000012",name:"\u6C34\u5427"},{type:46,floorType:0,roomType:"100900000015",name:"\u51FA\u5165\u53E3"},{type:47,floorType:0,roomType:"100900000015",name:"\u5927\u5385"},{type:48,floorType:0,roomType:"100900000015",name:"\u5305\u53A2"},{type:49,floorType:0,roomType:"100900000015",name:"\u5176\u4ED6"},{type:50,floorType:0,roomType:"100900000016",name:"\u51FA\u5165\u53E3"},{type:51,floorType:0,roomType:"100900000016",name:"\u529E\u516C\u533A"},{type:52,floorType:0,roomType:"100900000016",name:"\u8001\u677F\u95F4"},{type:53,floorType:0,roomType:"100900000016",name:"\u4F1A\u8BAE\u5BA4"},{type:54,floorType:0,roomType:"100900000016",name:"\u4F11\u606F\u533A/\u6C34\u5427"},{type:55,floorType:0,roomType:"100900000016",name:"\u5176\u4ED6"},{type:56,floorType:2,roomType:"100900000012",name:"\u7A7A\u4E2D\u82B1\u56ED"},{type:57,floorType:0,roomType:"100900000001",name:"\u6D0B\u5BA4"},{type:58,floorType:0,roomType:"100900000001",name:"\u548C\u5BA4"}],Ch=[{type:0,description:"\u6728\u8D28\u5730\u677F"},{type:1,description:"\u74F7\u7816\u5730\u9762"},{type:2,description:"\u6237\u5916\u5730\u9762"},{type:3,description:"\u536B\u751F\u95F4\u5730\u9762"},{type:4,description:"\u9633\u53F0\u5730\u9762"},{type:5,description:"\u8F66\u5E93\u5730\u9762"}],Ph=[{roomType:"100900000001",description:"\u5BA4"},{roomType:"100900000002",description:"\u5385"},{roomType:"100900000003",description:"\u53A8"},{roomType:"100900000004",description:"\u536B"},{roomType:"100900000005",description:"\u9633\u53F0"},{roomType:"100900000006",description:"\u9732\u53F0"},{roomType:"100900000007",description:"\u82B1\u56ED"},{roomType:"100900000008",description:"\u50A8"},{roomType:"100900000009",description:"\u4FDD\u59C6\u95F4"},{roomType:"100900000010",description:"\u8F66\u5E93"},{roomType:"100900000011",description:"\u9601\u697C"},{roomType:"100900000012",description:"\u5176\u4ED6"},{roomType:"100900000013",description:"\u8863"},{roomType:"100900000015",description:"\u5546\u94FA"},{roomType:"100900000016",description:"\u5199\u5B57\u697C"}],Di=(i,t,e)=>{const n=new I.Matrix4,o=new I.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},Eh=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(Di(o,0,0)),s&&i.applyMatrix4(Di(0,s,0)),r&&i.applyMatrix4(Di(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function _a(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=F({map:o.material.map||{}},t);o.material=new V.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const Ih=(i,t)=>{var u;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(u=t.north_rad)!=null?u:void 0,o={},s=h=>_(exports,null,function*(){var U;const d=(h==null?void 0:h.fbx_url)||e,f=(U=h==null?void 0:h.north_rad)!=null?U:n;if(typeof f!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const g=i.model.bounding,v=g.max.x-g.min.x,p=g.max.z-g.min.z,A=Math.max(v,p),w=yield new da.FBXLoader().loadAsync(d);_a(w,{transparent:!0,side:I.DoubleSide,blending:I.AdditiveBlending});const k=[0,f-Math.PI/2,0],{model:{bounding:{max:{x:P,z:C},min:{x:L,y:x,z:Q}}}}=i;o.yBase=x;const W={x:(P+L)/2,y:x-1.6,z:(C+Q)/2},R=.0045*A;return Eh(w,{position:W,rotation:k,scale:R}),o.object=w,!0}),r=({latitude:h})=>{if(!o.object)return;const d=a(h);d&&(o.object.position.y=d)},a=h=>{if(o.yBase===void 0)return;const d=.6;if(h>=Math.PI/4)return o.yBase-(d+1.6);const f=h*(4/Math.PI);return o.yBase-(d*f+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const h=a(i.getPose().latitude);h&&(o.object.position.y=h),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function kh(i,t){var c,u,h,d,f;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,o=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",s=(d=t==null?void 0:t.fontColor)!=null?d:"#fff",r=(f=t==null?void 0:t.textAlign)!=null?f:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new V.CanvasTexture(a)}const xh=({x:i,y:t,z:e})=>new V.Vector3(i,t,e),Dh=(i,t)=>{var v,p,A;const e={},n=(v=t.animationEnabled)!=null?v:!0,o=(p=t.position)!=null?p:void 0,s=(A=t.rad)!=null?A:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=y=>_(exports,null,function*(){var W,R,U,j,H,O,N,G;const w=(W=y==null?void 0:y.position)!=null?W:o;if(!w)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const k=xh(w),P=(R=y==null?void 0:y.rad)!=null?R:s,C=(U=y==null?void 0:y.fbx_url)!=null?U:r;if(e.rad=P,P===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${P}`));const L=yield new da.FBXLoader().loadAsync(C);L.position.copy(k),L.rotation.z=P,L.scale.set(.8,.8,.8),_a(L,{transparent:!0,side:I.DoubleSide});const x=(N=(O=(H=(j=L.children)==null?void 0:j[0])==null?void 0:H.children)==null?void 0:O[3])==null?void 0:N.clone();if(!x)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${x}`));const Q=(G=t.name)!=null?G:"\u5165\u6237\u95E8";return x.material=new V.MeshBasicMaterial({transparent:!0,map:kh(Q)}),x.renderOrder=3,L.children[0].add(x),e.object=L,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const y=1,w=new V.AnimationMixer(e.object);a.push(w);const k=w.clipAction(e.object.animations[0]);k.timeScale=y;let P;const C=()=>{let W=0,R=0;const U=1e3/30,j=H=>{W=requestAnimationFrame(j);const O=H-R;O<U||(R=H,a.forEach(N=>N.update(O/1e3)),i.needsRender=!0)};return W=requestAnimationFrame(j),()=>{cancelAnimationFrame(W)}},Q={play:()=>{P||(k.play(),P=C(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{k.stop(),P==null||P(),P=void 0}};e.animation=Q},u=y=>{var k;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((k=y==null?void 0:y.animationEnable)!=null?k:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},h=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},d=y=>y==="Floorplan"?u():h();return{load:l,enable:y=>(e.enabled||(e.enabled=!0,d(i.currentMode),i.on("modeChange",d),u(y)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),i.off("modeChange",d)),!0)}};class go extends An.default.Tween{constructor(){super(...arguments);m(this,"disposeMethods",[]);m(this,"animationFrameDisposer");m(this,"onDispose",e=>(this.disposeMethods.push(e),this));m(this,"play",()=>(this.start(0),this.animationFrameDisposer=En(e=>this.update(e)),this));m(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],An.default.remove(this)})}}function Na(i,t=An.default.Easing.Linear.None){const e=new go({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const yn=window.requestAnimationFrame||(i=>setTimeout(i,16)),Lh=window.cancelAnimationFrame||clearTimeout;function fi(i,t=0){t<=0?yn(i):yn(()=>fi(i,t-1))}function En(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=yn(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=yn(r),function(){Lh(e)}}function Sh(){const i=Date.now();return new Promise(t=>{yn(()=>{t(Date.now()-i)})})}const Mh=li.Easing;function Th(i,t,e,n=Mh.Linear.None){const o=new li.Tween(i).to(t,e).easing(n);fi(()=>o.start(0));const s=En(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function zh(i,t){return Th({progress:0},{progress:1},i,t)}var Xa=(i=>(i.Move="Move",i.Rotate="Rotate",i))(Xa||{}),Ke=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(Ke||{});const Un=Math.PI*2;function ps(i){return(i%Un+Un)%Un}function gs(i){return i%Un}function Li(i,t,e){return i+(t-i)*e}const Yi=(i,t,e)=>{const n=Math.PI,o=n*2;return i=ps(i),t=ps(t),e===Ke.Anticlockwise&&i<t&&(i+=o),e===Ke.Clockwise&&t<i&&(t+=o),e===Ke.Loop&&t-i>n?Yi(i,t,Ke.Anticlockwise):e===Ke.Loop&&i-t>n?Yi(i,t,Ke.Clockwise):{from:i,to:t}},Bh=i=>{const t={},e=(l,c,...u)=>_(exports,[l,c,...u],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((h,d)=>{const f=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;f!==void 0?i.moveToPano(f,Object.assign({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>d(!1)},s)):d(!1)})}),n=s=>{const r=i.state,a=gs(r.latitude),l=gs(s.latitude),{from:c,to:u}=Yi(r.longitude,s.longitude,s.rotation||Ke.Loop),h=r.fov,d=s.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:u,fov:d}}};return{move:e,rotate:(l,c,...u)=>_(exports,[l,c,...u],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==Ce.Five.Mode.Panorama&&(yield i.changeMode(Ce.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((f,g)=>{if(!s.panoIndex){f(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>f(!0),moveCancelCallback:()=>g(!1)})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:d}=n(s);return yield new Promise(f=>{const g=({progress:w})=>{const k={};k.longitude=Li(h.longitude,d.longitude,w),k.latitude=Li(h.latitude,d.latitude,w),k.fov=Li(h.fov,d.fov,w),i.setState(k,!0)},v=()=>{f(!0)},p=()=>{f(!1)},A=s.rotateSpeed?Math.ceil(Math.abs(d.longitude-h.longitude)/s.rotateSpeed*1e3):r,y=zh(A,li.Easing.Linear.None).onUpdate(g).onComplete(v).onDestroy(p);s.rotation===Ke.Loop&&y.repeat(1/0).yoyo(!0),t.interruptCallback=(w=!0)=>{y.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),f(w)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function As(i,t){return i.x===t.x&&i.y===t.y}function Ya(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function ri(i,t){return(t.y-i.y)/(t.x-i.x)}function Ua(i,t,e){const n=ri(i[1],i[0]),o=ri(t[1],t[0]);if(isNaN(n)||isNaN(o)||Ya(n,o))return!1;if(jn(i[0],t))return i[0];if(jn(i[1],t))return i[1];if(jn(t[0],i))return t[0];if(jn(t[1],i))return t[1];if(e&&!jh(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function jn(i,t){return As(i,t[0])||As(i,t[1])?!0:(t[0].x-i.x)*(i.x-t[1].x)>=0&&(t[0].y-i.y)*(i.y-t[1].y)>=0&&Ya(ri(t[0],i),ri(i,t[1]))}function Vn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function jh(i,t){return Math.max(i[0].x,i[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(i[0].x,i[1].x)&&Math.max(i[0].y,i[1].y)>=Math.min(t[0].y,t[1].y)&&Vn(t[0],i[1],i[0])*Vn(i[1],t[1],i[0])>0&&Vn(i[0],t[1],t[0])*Vn(t[1],i[1],t[0])>0?1:0}function qa(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>qa(i,t-1))}const Vh=`<style type="text/css">
116
116
  .PanoRulerPlugin-rule-line {
117
117
  position: absolute;
118
118
  transform-origin: left center;
@@ -559,7 +559,7 @@ void main() {
559
559
  gl_FragColor = vec4(1.0,1.0,1.0,match);
560
560
  }
561
561
  `;function oA(){const i=new I.PlaneGeometry(.4,.4),t=tA,e=new I.TextureLoader().load(t);e.encoding=I.sRGBEncoding;const n=new I.MeshBasicMaterial({map:e,transparent:!0,depthTest:!1});return new I.Mesh(i,n)}function sA(){const i=new I.CurvePath;i.add(new I.LineCurve3(new I.Vector3(0,0,0),new I.Vector3(0,0,.1)));const t=new I.TubeGeometry(i,8,.003),e=new I.ShaderMaterial({vertexShader:nA,fragmentShader:iA,depthTest:!1,transparent:!0});return new I.Mesh(t,e)}function rA(){const i=new I.SphereGeometry(.01,20,20),t=new I.MeshBasicMaterial({color:10349931,depthTest:!1,transparent:!0,side:I.DoubleSide}),e=new I.Mesh(i,t);return e.position.set(0,0,.1),e}class El extends I.Object3D{constructor(){super();m(this,"planeMesh");m(this,"lineMesh");m(this,"ballMesh");this.planeMesh=oA(),this.lineMesh=sA(),this.ballMesh=rA(),this.add(this.planeMesh,this.lineMesh,this.ballMesh)}updateWithIntersect(e){if(!e.face)return;const n=new I.Vector3().addVectors(e.point,e.face.normal);this.position.copy(e.point),this.lookAt(n)}dispose(){var e;(e=this.planeMesh.material.map)==null||e.dispose()}}class Il{constructor(t){m(this,"five");m(this,"contentElement",document.createElement("div"));m(this,"animeIns");m(this,"container");m(this,"css3DObject");m(this,"disposeCss3DObject");m(this,"state",{enabled:!1});this.five=t;const n=.4/2,s=Zt(t).create3DDomContainer([[-n,n,0],[-n,-n,0],[n,-n,0],[n,n,0]].map(r=>new I.Vector3().fromArray(r)));if(s){const{container:r,dispose:a,css3DObject:l}=s;this.container=r,this.css3DObject=l,this.disposeCss3DObject=a}this.contentElement.style.width="100%",this.contentElement.style.height="100%",this.contentElement.style.backgroundImage=`url(${tl})`,this.contentElement.style.backgroundSize="100%",this.contentElement.style.backgroundRepeat="no-repeat"}enable(){var t;this.state.enabled||(this.state.enabled=!0,(t=this.container)==null||t.appendChild(this.contentElement))}disable(){!this.state.enabled||(this.state.enabled=!1,this.contentElement.remove())}updateWithIntersect(t){if(!t.face||!this.css3DObject)return;const e=new I.Vector3().addVectors(t.point,t.face.normal);this.css3DObject.position.copy(t.point),this.css3DObject.lookAt(e),this.five.needsRender=!0}doAnimation(){var t;(t=this.animeIns)==null||t.dispose(),new go({progress:0}).to({progress:[1,0]}).duration(500).easing(li.Easing.Quadratic.InOut).onUpdate(({progress:e})=>{}).play()}dispose(){var t;(t=this.disposeCss3DObject)==null||t.call(this)}}class aA{constructor(t,e){m(this,"five");m(this,"hooks",new Ce.Subscribe);m(this,"magnifier",null);m(this,"pointHelper",null);m(this,"pointDomHelper",null);m(this,"contentDom",document.createElement("div"));m(this,"state",{enabled:!1});m(this,"group",new I.Group);this.five=t,this.magnifier=(e==null?void 0:e.magnifier)===void 0?new Cl(t,{dragEnabled:!0}):null,this.pointHelper=(e==null?void 0:e.pointHelper)===void 0?new El:null,this.pointDomHelper=(e==null?void 0:e.pointDomHelper)===void 0?new Il(t):null,this.group.name="five-point-selector",this.five.scene.add(this.group),this.contentDom.classList.add("five-point-selector-content"),this.contentDom.style.position="absolute",this.contentDom.style.top="0",this.contentDom.style.left="0",this.contentDom.style.width="100%",this.contentDom.style.height="100%",this.contentDom.style.pointerEvents="none"}enable(){var t,e;this.state.enabled||(this.state.enabled=!0,this.pointHelper&&this.group.add(this.pointHelper),(t=this.magnifier)==null||t.enable(),(e=this.pointDomHelper)==null||e.enable(),this.five.needsRender=!0,this.hooks.emit("enabled"))}disable(){var t,e;!this.state.enabled||(this.state.enabled=!1,this.pointHelper&&this.group.remove(this.pointHelper),(t=this.magnifier)==null||t.disable(),(e=this.pointDomHelper)==null||e.disable(),this.hooks.emit("disabled"))}dispose(){this.hooks.off(),this.disable(),this.magnifier=null,this.pointHelper=null,this.pointDomHelper=null}updateWithIntersect(t){var s;this.hooks.emit("pointChanged",{panoIndex:this.five.getCurrentState().panoIndex,position:t.point.toArray(),normal:(s=t.face)==null?void 0:s.normal.toArray()});const e=this.magnifier;e&&e.renderWithPoint(t.point);const n=this.pointHelper;n&&n.updateWithIntersect(t);const o=this.pointDomHelper;o&&o.updateWithIntersect(t),this.five.needsRender=!0}}const lA=Object.freeze(Object.defineProperty({__proto__:null,Interval:eo,Rectangle:J0,Magnifier:Cl,getCoordsFromClient:K0,getCoordsFromElement:Pl,getRaycasterFromFivePointer:$0,getIntersectFromRelativePosition:eA,PointHelper:El,PointDomHelper:Il,FivePointSelector:aA,isNil:up,notNil:yt,BetterTween:go,tweenProgress:Na,nextFrame:fi,requestAnimationFrameInterval:En,getFrameTime:Sh},Symbol.toStringTag,{value:"Module"}));function cA(i){ce(i,"svelte-sezqcq",'@charset "UTF-8";.svelte-sezqcq.svelte-sezqcq{box-sizing:border-box}.marketing.svelte-sezqcq.svelte-sezqcq{transform:translateY(-100%)}.marketing.svelte-sezqcq .line.svelte-sezqcq{position:absolute;height:1.875rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.marketing.svelte-sezqcq .content.svelte-sezqcq{position:relative;min-width:7.5rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition-property:opacity, transform;transition-duration:500ms}.marketing.svelte-sezqcq .content .headerImage.svelte-sezqcq{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.title-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;width:100%;height:1.125rem}.title-wrapper.svelte-sezqcq .title.svelte-sezqcq{border-radius:0.25rem;width:100%;padding-left:0.625rem;padding-right:0.625rem}.title-wrapper.svelte-sezqcq .title .text.svelte-sezqcq{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem}.footer.svelte-sezqcq.svelte-sezqcq{position:relative;padding:0.5rem 0.625rem 0 0;width:100%;display:flex;align-items:center}.footer.svelte-sezqcq .goto-button.svelte-sezqcq{display:flex;align-self:flex-end;flex-wrap:wrap;align-items:center;overflow:hidden;height:0.875rem}.footer.svelte-sezqcq .goto-button .gap.svelte-sezqcq{height:100%;width:0.625rem}.footer.svelte-sezqcq .goto-button .text.svelte-sezqcq{display:block;height:100%;font-size:0.625rem}.footer.svelte-sezqcq .arrow-wrapper.svelte-sezqcq{height:0.875rem;display:flex;align-self:flex-end;flex-grow:0;flex-shrink:0;align-items:center;margin-left:0.25rem}.footer.svelte-sezqcq .arrow-wrapper svg.arrow.svelte-sezqcq{width:0.375rem;height:0.625rem}.footer.svelte-sezqcq .price.svelte-sezqcq{flex-shrink:0;margin-right:auto;white-space:nowrap;display:flex;align-items:baseline;margin-left:0.625rem}.footer.svelte-sezqcq .price .value.svelte-sezqcq{position:relative;font-size:0.875rem;line-height:1rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.footer.svelte-sezqcq .price .unit.svelte-sezqcq{padding-left:0.125rem;font-size:0.625rem}.tags-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;overflow:hidden;height:1rem;margin-top:0.25rem}.tags-wrapper.svelte-sezqcq .tags.svelte-sezqcq{position:relative;display:inline-flex;max-width:100%;flex-wrap:wrap;padding-left:0.625rem;padding-right:0.375rem}.tags-wrapper.svelte-sezqcq .tags .tag.svelte-sezqcq{display:flex;align-items:center;justify-content:center;flex-shrink:0;flex-grow:0;font-size:0.625rem;height:1rem;margin-right:0.25rem;margin-bottom:0.625rem;padding:0 0.25rem;border-radius:0.125rem;max-width:100%;text-overflow:ellipsis;overflow:hidden}.marketing.light.svelte-sezqcq .content.svelte-sezqcq{background-color:white}.marketing.light.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:rgba(0, 0, 0, 0.8)}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:#946700}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.5)}.marketing.light.svelte-sezqcq .content .footer.svelte-sezqcq{color:#946700;fill:#946700}.marketing.dark.svelte-sezqcq .content.svelte-sezqcq{background-color:rgba(0, 0, 0, 0.5)}.marketing.dark.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(255, 255, 255, 0.15);color:rgba(255, 255, 255, 0.85)}.marketing.dark.svelte-sezqcq .content .footer.svelte-sezqcq{color:#ead09a;fill:#ead09a}.marketing.unfolded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 1)}.marketing.folded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.marketing.unfolded.svelte-sezqcq .content.svelte-sezqcq{opacity:1}.marketing.folded.svelte-sezqcq .content.svelte-sezqcq{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}')}function jr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Vr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Qr(i){let t,e;return{c(){t=z("img"),b(t,"class","headerImage svelte-sezqcq"),_e(t.src,e=i[3].headerPictureUrl)||b(t,"src",e),b(t,"alt","")},m(n,o){M(n,t,o)},p(n,o){o&8&&!_e(t.src,e=n[3].headerPictureUrl)&&b(t,"src",e)},d(n){n&&S(t)}}}function Or(i){let t,e,n,o,s=i[2]||[],r=[];for(let c=0;c<s.length;c+=1)r[c]=Rr(Vr(i,s,c));let a=i[5]||[],l=[];for(let c=0;c<a.length;c+=1)l[c]=Fr(jr(i,a,c));return{c(){t=z("div"),e=z("div");for(let c=0;c<r.length;c+=1)r[c].c();n=ee();for(let c=0;c<l.length;c+=1)l[c].c();b(e,"class","tags svelte-sezqcq"),ke(()=>i[17].call(e)),b(t,"class","tags-wrapper svelte-sezqcq")},m(c,u){M(c,t,u),B(t,e);for(let h=0;h<r.length;h+=1)r[h].m(e,null);B(e,n);for(let h=0;h<l.length;h+=1)l[h].m(e,null);o=tt(e,i[17].bind(e))},p(c,u){if(u&4){s=c[2]||[];let h;for(h=0;h<s.length;h+=1){const d=Vr(c,s,h);r[h]?r[h].p(d,u):(r[h]=Rr(d),r[h].c(),r[h].m(e,n))}for(;h<r.length;h+=1)r[h].d(1);r.length=s.length}if(u&32){a=c[5]||[];let h;for(h=0;h<a.length;h+=1){const d=jr(c,a,h);l[h]?l[h].p(d,u):(l[h]=Fr(d),l[h].c(),l[h].m(e,null))}for(;h<l.length;h+=1)l[h].d(1);l.length=a.length}},d(c){c&&S(t),at(r,c),at(l,c),o()}}}function Rr(i){let t,e=i[0]+"",n;return{c(){t=z("div"),n=Ie(e),b(t,"class","tag primary-tag svelte-sezqcq"),T(t,"min-width",wo)},m(o,s){M(o,t,s),B(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Me(n,e)},d(o){o&&S(t)}}}function Fr(i){let t,e=i[0]+"",n;return{c(){t=z("div"),n=Ie(e),b(t,"class","tag secondary-tag svelte-sezqcq"),T(t,"min-width",wo)},m(o,s){M(o,t,s),B(t,n)},p(o,s){s&32&&e!==(e=o[0]+"")&&Me(n,e)},d(o){o&&S(t)}}}function Hr(i){let t,e,n=i[7]&&Gr(i),o=i[3].highlightText&&_r(i);return{c(){t=z("div"),n&&n.c(),e=ee(),o&&o.c(),b(t,"class","footer svelte-sezqcq")},m(s,r){M(s,t,r),n&&n.m(t,null),B(t,e),o&&o.m(t,null)},p(s,r){s[7]?n?n.p(s,r):(n=Gr(s),n.c(),n.m(t,e)):n&&(n.d(1),n=null),s[3].highlightText?o?o.p(s,r):(o=_r(s),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(s){s&&S(t),n&&n.d(),o&&o.d()}}}function Gr(i){let t,e,n=i[3].price.value+"",o,s,r=i[3].price.unit&&Wr(i);return{c(){t=z("div"),e=z("span"),o=Ie(n),s=ee(),r&&r.c(),b(e,"class","value svelte-sezqcq"),b(t,"class","price svelte-sezqcq")},m(a,l){M(a,t,l),B(t,e),B(e,o),B(t,s),r&&r.m(t,null)},p(a,l){l&8&&n!==(n=a[3].price.value+"")&&Me(o,n),a[3].price.unit?r?r.p(a,l):(r=Wr(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&S(t),r&&r.d()}}}function Wr(i){let t,e=i[3].price.unit+"",n;return{c(){t=z("span"),n=Ie(e),b(t,"class","unit svelte-sezqcq")},m(o,s){M(o,t,s),B(t,n)},p(o,s){s&8&&e!==(e=o[3].price.unit+"")&&Me(n,e)},d(o){o&&S(t)}}}function _r(i){let t,e,n,o,s=i[3].highlightText+"",r,a,l;return{c(){t=z("div"),e=z("div"),n=ee(),o=z("span"),r=Ie(s),a=ee(),l=z("div"),l.innerHTML='<svg class="arrow svelte-sezqcq" viewBox="0 0 6 9"><g transform="translate(-3, -2)" fill-rule="nonzero" class="svelte-sezqcq"><path d="M4.43868724,2.12056563 C4.28121824,1.95989074 4.02582143,1.95979988 3.86824251,2.1203627 C3.72498894,2.26632889 3.71189225,2.49481723 3.82900374,2.65587166 L6.57092402,5.92894326 C6.72651763,6.11470411 6.72651763,6.38529589 6.57092402,6.57105674 L3.86804348,9.79798499 C3.72488984,9.94405307 3.71194952,10.1725507 3.8291712,10.3335217 L3.86824251,10.3796373 C4.01149607,10.5256035 4.23559087,10.5387981 4.39346025,10.4192733 L4.43868724,10.3794344 L8.1144599,6.5985342 C8.30312347,6.40447482 8.30312347,6.09552518 8.1144599,5.9014658 L4.43868724,2.12056563 Z" class="svelte-sezqcq"></path></g></svg>',b(e,"class","gap svelte-sezqcq"),b(o,"class","text svelte-sezqcq"),b(t,"class","goto-button goto-icon svelte-sezqcq"),b(l,"class","arrow-wrapper svelte-sezqcq")},m(c,u){M(c,t,u),B(t,e),B(t,n),B(t,o),B(o,r),M(c,a,u),M(c,l,u)},p(c,u){u&8&&s!==(s=c[3].highlightText+"")&&Me(r,s)},d(c){c&&S(t),c&&S(a),c&&S(l)}}}function uA(i){var k,P;let t,e,n,o,s,r,a,l,c,u,h=i[3].title+"",d,f,g,v,p;e=new nt({props:{visible:i[4],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let A=i[3].headerPictureUrl&&Qr(i),y=((k=i[2].length)!=null?k:0)+((P=i[5].length)!=null?P:0)>0&&Or(i),w=(i[7]||i[3].highlightText)&&Hr(i);return{c(){t=z("div"),K(e.$$.fragment),n=ee(),o=z("div"),s=ee(),r=z("div"),A&&A.c(),a=ee(),l=z("div"),c=z("div"),u=z("div"),d=Ie(h),f=ee(),y&&y.c(),g=ee(),w&&w.c(),b(o,"class","line svelte-sezqcq"),T(o,"transition-delay",i[4]?Wn+"ms":_n+Xr-Nr-40+"ms"),b(u,"class","text svelte-sezqcq"),b(c,"class","title svelte-sezqcq"),b(l,"class","title-wrapper svelte-sezqcq"),b(r,"class","content svelte-sezqcq"),T(r,"max-width",et(i[9])),T(r,"transition-delay",i[4]?Wn+_n+"ms":"0ms"),b(t,"class",v=Te(`marketing ${i[6]}`)+" svelte-sezqcq"),q(t,"unfolded",i[4]),q(t,"folded",i[8])},m(C,L){M(C,t,L),J(e,t,null),B(t,n),B(t,o),B(t,s),B(t,r),A&&A.m(r,null),B(r,a),B(r,l),B(l,c),B(c,u),B(u,d),B(r,f),y&&y.m(r,null),B(r,g),w&&w.m(r,null),p=!0},p(C,[L]){var Q,W;const x={};L&16&&(x.visible=C[4]),e.$set(x),L&16&&T(o,"transition-delay",C[4]?Wn+"ms":_n+Xr-Nr-40+"ms"),C[3].headerPictureUrl?A?A.p(C,L):(A=Qr(C),A.c(),A.m(r,a)):A&&(A.d(1),A=null),(!p||L&8)&&h!==(h=C[3].title+"")&&Me(d,h),((Q=C[2].length)!=null?Q:0)+((W=C[5].length)!=null?W:0)>0?y?y.p(C,L):(y=Or(C),y.c(),y.m(r,g)):y&&(y.d(1),y=null),C[7]||C[3].highlightText?w?w.p(C,L):(w=Hr(C),w.c(),w.m(r,null)):w&&(w.d(1),w=null),L&16&&T(r,"transition-delay",C[4]?Wn+_n+"ms":"0ms"),(!p||L&64&&v!==(v=Te(`marketing ${C[6]}`)+" svelte-sezqcq"))&&b(t,"class",v),(!p||L&80)&&q(t,"unfolded",C[4]),(!p||L&320)&&q(t,"folded",C[8])},i(C){p||(E(e.$$.fragment,C),p=!0)},o(C){D(e.$$.fragment,C),p=!1},d(C){C&&S(t),Z(e),A&&A.d(),y&&y.d(),w&&w.d()}}}const wo=40,Wn=400,Nr=500,_n=180,Xr=500;function dA(i,t,e){let n,o,s,r,a,l,c,u;var h,d,f,g,v,p;let{tag:A}=t,y,w=(()=>{var P;const C=(P=A.data.limitWidth)!==null&&P!==void 0?P:!0;if(typeof C=="number")return C;if(C===!0)return 172})();function k(){y=this.offsetHeight,e(1,y)}return i.$$set=P=>{"tag"in P&&e(0,A=P.tag)},i.$$.update=()=>{i.$$.dirty&3073&&e(4,n=e(11,d=e(10,h=A.state)===null||h===void 0?void 0:h.unfolded)!==null&&d!==void 0?d:!1),i.$$.dirty&16&&e(8,o=!n),i.$$.dirty&1&&e(3,s=A.data),i.$$.dirty&12296&&e(7,r=yt(e(12,f=s.price)===null||f===void 0?void 0:f.value)&&(e(13,g=s.price)===null||g===void 0?void 0:g.value)!==""),i.$$.dirty&1&&e(6,a=A.data.theme||"light"),i.$$.dirty&65538&&y>40&&e(16,l=l-1),i.$$.dirty&81928&&e(2,c=(e(14,v=s.brandTags)===null||v===void 0?void 0:v.slice(0,l).filter(Boolean))||[]),i.$$.dirty&98316&&e(5,u=(e(15,p=s.tags)===null||p===void 0?void 0:p.slice(0,l-c.length).filter(Boolean))||[])},e(16,l=(w-20)/wo),[A,y,c,s,n,u,a,r,o,w,h,d,f,g,v,p,l,k]}class hA extends oe{constructor(t){super(),ie(this,t,dA,uA,ne,{tag:0},cA)}}const qt="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAgAAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//uQxAACFEII9ACZ/sJZwWEoEb8w/////N//////JcxjHjf+7/v/H2PzCCFAiDtGeyBCIx7bJJ1mmEEMy6g8mm2c8nrGABB4h2Mkmn//4z/73u773R5qHHu/j/w7Kxkzh5lWRWdsifCkNAnY9Zc1HvDAhjhSHdFkHFzLmabt/AQxSg2wwzLhHIJOBnAWwVY4zrhIYhhc2kvhYDfQ4hDi2Gmh5KyFn8EcGIrHAngNgIwVIEMf5bzbAiTRoAD///8z/KVhkkWEle6IX+d/z4fvH3BShK1e5kmjkCMoxVmXhd4ROlTKo3iipasvTilY21q19ta30/v/0/idPX1v8PNxJL6ramnOVsdvMv2akO0iSYIzdJFirtzWXCZicS9vHqvSKyqm5XJBdqBwPxyfJdykhWTZ0G0ZyTZGpLKxsNwwoRhsx3tZfhwmeOBVISm3impAC/IT/8hP/EKEM1KMdVdVKM2rHV4x7HVXZvbVVKN/qq8CiV9VL9jjH/6l6qf7MBCjZmOqsAibjcP+qqqv0oxqpa/NVW286hPo1nz2L/h8+jXt//uSxCmDU2IK/ECN98KKtE5IYzNoCfbw+u9i5r8PoadUMFPKqWL4LK3T/LCraMSHGkW4bpLXR/E6LlHOVQxmslKVJ8IULktMN06N0FKCpHCoYsjC4F+Z0NVqdNFoGSTjSiyjzLdnZ2fNqTi2eHKONONKLMPMKLONKLMPQRJGlFxZRoKcJFAYEeIFiRQkUWUeYfef//Ko04soswso40UJAgMw8wosososy0EalnZyjQUGBRQGIFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsqFdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",gn={};var ai=(i=>(i.Default="default",i.GetAudioDuration="getAudioDuration",i.PlayAudio="playAudio",i))(ai||{});function kl(i,t){const e=(t==null?void 0:t.namespace)||"default",n=gn[e]||(gn[e]=[]);let o=n.find(s=>!s.realSrc||s.realSrc===qt);return o||(console.warn("\u672A\u627E\u5230\u7F13\u5B58\u97F3\u9891\uFF0C\u5DF2\u65B0\u5EFA",gn),o=new Co(qt),n.push(o)),i&&(o.src=i),o}function fA(i){return _(this,null,function*(){const t=(()=>i instanceof Co?i:kl(i,{namespace:"getAudioDuration"}))(),e=yield new Promise(n=>{t.duration?t.isBlankAudio?n(0):n(t.duration):(t.addEventListener("loadedmetadata",()=>{t.isBlankAudio?n(0):n(t.duration)}),t.addEventListener("canplaythrough",()=>{t.isBlankAudio?n(0):n(t.duration)}))});return typeof i=="string"&&t.clear(),e})}function Yr(i,t){const e=(t==null?void 0:t.namespace)||"default",n=gn[e]||(gn[e]=[]),o=i-n.length;if(!(o<=0))for(let s=0;s<o;s++)n.push(new Co(qt))}class Co extends Audio{constructor(e){super(e);m(this,"preload","auto");m(this,"realSrc","");m(this,"inited",!1);m(this,"removeDocumentEventListener");this.realSrc=e!=null?e:"",super.addEventListener("ended",()=>{this.src=""});const n=()=>mA(this);document.addEventListener("click",n),document.addEventListener("touchend",n),this.removeDocumentEventListener=()=>{document.removeEventListener("click",n),document.removeEventListener("touchend",n)}}get isBlankAudio(){return this.realSrc===qt||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e}clear(){this.src=qt,this.currentTime=0}}function mA(i){!i||i.inited||(i.src&&(i.inited=!0,i.removeDocumentEventListener()),i.src===qt&&i.play())}class pA extends Audio{constructor(e){super();m(this,"sharedAudioSrc");m(this,"sharedAudioPaused",!0);m(this,"sharedAudioCurrentTime",0);m(this,"tryplaying",!1);m(this,"audioInstance");m(this,"eventListenerDisposer");this.sharedAudioSrc=e}get paused(){var e;return(e=this.sharedAudioPaused)!=null?e:!0}get currentTime(){return this.sharedAudioCurrentTime}play(){return _(this,null,function*(){var e,n,o;this.tryplaying||(this.tryplaying=!0,(!this.audioInstance||((e=this.audioInstance)==null?void 0:e.realSrc)!==this.sharedAudioSrc)&&(this.audioInstance=kl(this.sharedAudioSrc,{namespace:ai.PlayAudio})),(n=this.eventListenerDisposer)==null||n.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.currentTime=(o=this.currentTime)!=null?o:0,this.audioInstance.play().then(()=>{var s;this.audioInstance.currentTime=(s=this.currentTime)!=null?s:0,this.sharedAudioPaused=!1}).catch(s=>{this.pause(),console.warn(s)}).finally(()=>{this.tryplaying=!1}))})}pause(){!this.audioInstance||this.paused||(this.sharedAudioPaused=!0,this.audioInstance.addEventListener("pause",()=>{var e;(e=this.eventListenerDisposer)==null||e.call(this)},{once:!0}),this.audioInstance.pause())}dispose(){this.clear(),this.audioInstance=void 0}clear(){var e;(e=this.audioInstance)==null||e.clear()}addEventListeners(){const e=this.audioInstance;if(!e)return;const n=d=>{var f;this.sharedAudioCurrentTime=e.currentTime,this.sharedAudioPaused=e.paused,(f=this.ontimeupdate)==null||f.call(this,d)},o=d=>{var f;return(f=this.onplay)==null?void 0:f.call(this,d)},s=d=>{var f;(f=this.onpause)==null||f.call(this,d),this.sharedAudioPaused=!0,this.clear()},r=d=>{var f;(f=this.onended)==null||f.call(this,d),this.sharedAudioPaused=!0,this.sharedAudioCurrentTime=0},a=d=>{var f;return(f=this.onerror)==null?void 0:f.call(this,d)},l=d=>{var f;return(f=this.oncanplay)==null?void 0:f.call(this,d)},c=d=>{var f;return(f=this.oncanplaythrough)==null?void 0:f.call(this,d)},u=d=>{var f;return(f=this.onloadeddata)==null?void 0:f.call(this,d)},h=d=>{var f;return(f=this.onloadedmetadata)==null?void 0:f.call(this,d)};return e.addEventListener("timeupdate",n),e.addEventListener("play",o),e.addEventListener("pause",s),e.addEventListener("ended",r),e.addEventListener("error",a),e.addEventListener("canplay",l),e.addEventListener("canplaythrough",c),e.addEventListener("loadeddata",u),e.addEventListener("loadedmetadata",h),()=>{e.removeEventListener("timeupdate",n),e.removeEventListener("play",o),e.removeEventListener("pause",s),e.removeEventListener("ended",r),e.removeEventListener("error",a),e.removeEventListener("canplay",l),e.removeEventListener("canplaythrough",c),e.removeEventListener("loadeddata",u),e.removeEventListener("loadedmetadata",h)}}}function gA(i){ce(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function AA(i){let t,e,n,o;const s=i[8].default,r=$t(s,i,i[7],null);return{c(){t=z("div"),r&&r.c(),b(t,"class","audio svelte-13e7hxv"),b(t,"style",i[0])},m(a,l){M(a,t,l),r&&r.m(t,null),e=!0,n||(o=we(t,"click",ka(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&tn(r,s,a,a[7],e?en(s,a[7],l,null):nn(a[7]),null),(!e||l&1)&&b(t,"style",a[0])},i(a){e||(E(r,a),e=!0)},o(a){D(r,a),e=!1},d(a){a&&S(t),r&&r.d(a),n=!1,o()}}}function vA(i,t,e){let{$$slots:n={},$$scope:o}=t,{url:s}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=ci(),u=St("hooks"),h=St("mediaStore");let d,f=!0;function g(){e(5,d.onplay=p=>{u.emit("playStateChange",Object.assign({event:p,state:"playing",mediaInstance:d},l)),c("play"),e(6,f=!1)},d),e(5,d.onpause=p=>{u.emit("playStateChange",Object.assign({event:p,state:"paused",mediaInstance:d},l)),c("pause"),e(6,f=!0)},d),e(5,d.onloadedmetadata=p=>{typeof d.duration=="number"&&!Number.isNaN(d.duration)&&c("duration",d.duration)},d),e(5,d.ontimeupdate=p=>{c("timeupdate",d.currentTime)},d)}h.subscribe(({currentMediaElement:p})=>{p!==d&&(f||d==null||d.pause())});function v(p){!d||(u.emit("click",Object.assign({event:p,target:"AudioTagPlayIcon",audioInstance:d},l)),h.set({currentMediaElement:d}),u.emit("playStateChange",Object.assign({event:p,state:d.paused?"playing":"paused",mediaInstance:d},l)),d.paused?d.play():d.pause())}return i.$$set=p=>{"url"in p&&e(2,s=p.url),"enable"in p&&e(3,r=p.enable),"style"in p&&e(0,a=p.style),"hooksInfo"in p&&e(4,l=p.hooksInfo),"$$scope"in p&&e(7,o=p.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(s||c("duration",0)),i.$$.dirty&36&&(d==null||d.dispose(),e(5,d=new pA(s)),c("audioRef",d),setTimeout(()=>c("audioRef",d),200),fA(s).then(p=>c("duration",p)),g()),i.$$.dirty&40&&(r||d==null||d.pause()),i.$$.dirty&72&&c(r&&!f?"play":"pause")},[a,v,s,r,l,d,f,o,n]}class xl extends oe{constructor(t){super(),ie(this,t,vA,AA,ne,{url:2,enable:3,style:0,hooksInfo:4},gA)}}function bA(i){ce(i,"svelte-srt2pi",".audio-icon__wrapper.svelte-srt2pi.svelte-srt2pi{display:inline-block}.audio-icon.svelte-srt2pi.svelte-srt2pi{display:flex;justify-content:center;align-items:center;position:relative;width:100%;height:100%;border-radius:50%;background-color:rgba(255, 255, 255, 0.8)}.audio-icon.svelte-srt2pi .sound-wave__container.svelte-srt2pi{position:absolute;pointer-events:none;width:60%;height:60%}.sound-wave.svelte-srt2pi.svelte-srt2pi{animation-duration:2s;animation-iteration-count:infinite;animation-play-state:paused;transition:opacity 0}.playing.svelte-srt2pi .sound-wave.svelte-srt2pi{animation-play-state:running}.playing.svelte-srt2pi .sound-wave-1.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_1_animation}.playing.svelte-srt2pi .sound-wave-2.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_2_animation}.playing.svelte-srt2pi .sound-wave-3.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_3_animation}@keyframes svelte-srt2pi-sound_wave_1_animation{0%,10%{opacity:0}25%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_2_animation{0%,35%{opacity:0}50%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_3_animation{0%,60%{opacity:0}75%,100%{opacity:1}}")}function Ur(i){let t,e;return t=new nt({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function yA(i){let t,e,n,o,s,r=i[1]&&Ur();return{c(){t=z("div"),r&&r.c(),e=ee(),n=z("div"),o=z("div"),o.innerHTML='<svg width="100%" height="100%" viewBox="0 0 128 128"><g transform="rotate(-45 12 64) translate(12 64)" fill="black" stroke="black" fill-opacity="0.6" stroke-opacity="0.6"><path stroke="none" class="sound-wave sound-wave-1 svelte-srt2pi" d="M0,23 A23,23 0 0,0 23,0 L0,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-2 svelte-srt2pi" d="M0,46 A46,46 0 0,0 46,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-3 svelte-srt2pi" d="M0,80 A80,80 0 0,0 80,0"></path></g></svg>',b(o,"class","sound-wave__container svelte-srt2pi"),b(n,"class","audio-icon svelte-srt2pi"),q(n,"playing",i[0]),b(t,"class","audio-icon__wrapper svelte-srt2pi"),b(t,"style",i[2]),T(t,"width",i[5]),T(t,"height",i[5])},m(a,l){M(a,t,l),r&&r.m(t,null),B(t,e),B(t,n),B(n,o),i[7](o),i[8](t),s=!0},p(a,[l]){a[1]?r?l&2&&E(r,1):(r=Ur(),r.c(),E(r,1),r.m(t,e)):r&&(se(),D(r,1,1,()=>{r=null}),re()),(!s||l&1)&&q(n,"playing",a[0]),(!s||l&4)&&b(t,"style",a[2]),l&32&&T(t,"width",a[5]),l&32&&T(t,"height",a[5])},i(a){s||(E(r),s=!0)},o(a){D(r),s=!1},d(a){a&&S(t),r&&r.d(),i[7](null),i[8](null)}}}function wA(i,t,e){let n,{playing:o}=t,{shadow:s=!1}=t,{style:r=null}=t,{width:a="100%"}=t,l,c;function u(d){Qe[d?"unshift":"push"](()=>{c=d,e(4,c)})}function h(d){Qe[d?"unshift":"push"](()=>{l=d,e(3,l)})}return i.$$set=d=>{"playing"in d&&e(0,o=d.playing),"shadow"in d&&e(1,s=d.shadow),"style"in d&&e(2,r=d.style),"width"in d&&e(6,a=d.width)},i.$$.update=()=>{i.$$.dirty&64&&e(5,n=typeof a=="number"?et(a):a)},[o,s,r,l,c,n,a,u,h]}class Dl extends oe{constructor(t){super(),ie(this,t,wA,yA,ne,{playing:0,shadow:1,style:2,width:6},bA)}}function CA(i){ce(i,"svelte-1s6gk4a",".audio-tag.svelte-1s6gk4a{position:absolute;left:0;top:0;width:0;height:0;overflow:visible}.audio-icon__wrapper.svelte-1s6gk4a{position:relative;vertical-align:top;width:100%;height:100%}.content.svelte-1s6gk4a{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0.125rem;overflow:hidden;box-sizing:border-box;font-size:0;white-space:nowrap;font-weight:600}.wrapper.svelte-1s6gk4a{position:relative;width:100%;height:100%}.audio-icon.svelte-1s6gk4a{pointer-events:none;vertical-align:top;display:inline-block;width:1rem;height:1rem;margin-right:0.25rem;margin-top:0.0625rem}.audio.svelte-1s6gk4a{position:relative;width:100%;height:100%}")}function qr(i){var A,y;let t,e,n,o,s,r,a,l,c,u,h,d,f,g,v;e=new nt({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let p=i[6]&&Jr(i);return c=new gl({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),d=new vo({props:{unfolded:i[6],length:i[3],outDelay:i[4]+20*Math.min((y=(A=i[5])==null?void 0:A.length)!=null?y:10,15),useLinearColor:!0}}),{c(){t=z("div"),K(e.$$.fragment),n=ee(),o=z("div"),s=z("div"),r=z("div"),p&&p.c(),a=ee(),l=z("div"),K(c.$$.fragment),h=ee(),K(d.$$.fragment),b(r,"class","audio-icon svelte-1s6gk4a"),ke(()=>i[14].call(l)),T(l,"display","inline-block"),b(s,"class","wrapper svelte-1s6gk4a"),b(o,"class","content svelte-1s6gk4a"),b(t,"class","audio-tag svelte-1s6gk4a"),q(t,"unfolded",i[6])},m(w,k){M(w,t,k),J(e,t,null),B(t,n),B(t,o),B(o,s),B(s,r),p&&p.m(r,null),B(s,a),B(s,l),J(c,l,null),u=tt(l,i[14].bind(l)),B(t,h),J(d,t,null),f=!0,g||(v=we(l,"click",i[7]),g=!0)},p(w,k){var x,Q;const P={};k&64&&(P.visible=w[6]),k&8&&(P.left=w[3]/2+"px"),e.$set(P),w[6]?p?(p.p(w,k),k&64&&E(p,1)):(p=Jr(w),p.c(),E(p,1),p.m(r,null)):p&&(se(),D(p,1,1,()=>{p=null}),re());const C={};k&64&&(C.visible=w[6]),k&2&&(C.textUnfolded=w[1]),k&32&&(C.content=w[5]),c.$set(C);const L={};k&64&&(L.unfolded=w[6]),k&8&&(L.length=w[3]),k&48&&(L.outDelay=w[4]+20*Math.min((Q=(x=w[5])==null?void 0:x.length)!=null?Q:10,15)),d.$set(L),(!f||k&64)&&q(t,"unfolded",w[6])},i(w){f||(E(e.$$.fragment,w),E(p),E(c.$$.fragment,w),E(d.$$.fragment,w),f=!0)},o(w){D(e.$$.fragment,w),D(p),D(c.$$.fragment,w),D(d.$$.fragment,w),f=!1},d(w){w&&S(t),Z(e),p&&p.d(),Z(c),u(),Z(d),g=!1,v()}}}function Jr(i){let t,e,n,o,s,r,a;return e=new nt({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new xl({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[PA]},$$scope:{ctx:i}}}),o.$on("play",i[11]),o.$on("pause",i[12]),o.$on("audioRef",i[13]),{c(){t=z("div"),K(e.$$.fragment),n=ee(),K(o.$$.fragment),b(t,"class","audio svelte-1s6gk4a")},m(l,c){M(l,t,c),J(e,t,null),B(t,n),J(o,t,null),a=!0},p(l,c){i=l;const u={};c&64&&(u.enable=i[6]),c&1&&(u.url=i[0].data.audioUrl),c&1&&(u.hooksInfo={tag:i[0]}),c&32772&&(u.$$scope={dirty:c,ctx:i}),o.$set(u)},i(l){a||(E(e.$$.fragment,l),E(o.$$.fragment,l),l&&ke(()=>{r&&r.end(1),s=Tt(t,Mt,{duration:1e3,delay:0,easing:Xt}),s.start()}),a=!0)},o(l){var c,u;D(e.$$.fragment,l),D(o.$$.fragment,l),s&&s.invalidate(),l&&(r=sn(t,Mt,{duration:1e3,delay:20*Math.min((u=(c=i[5])==null?void 0:c.length)!=null?u:10,15),easing:Xt})),a=!1},d(l){l&&S(t),Z(e),Z(o),l&&r&&r.end()}}}function PA(i){let t,e,n;return e=new Dl({props:{playing:i[2]}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){M(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&S(t),Z(e)}}}function EA(i){let t,e,n=i[0].state&&qr(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&E(n,1)):(n=qr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function IA(i,t,e){let n,o,s;var r,a,l;let{tag:c}=t,u=!1,h=!1,d;function f(){e(1,u=!u)}const g=()=>{e(2,h=!0)},v=()=>{e(2,h=!1)};function p(y){on.call(this,i,y)}function A(){d=this.clientWidth,e(3,d)}return i.$$set=y=>{"tag"in y&&e(0,c=y.tag)},i.$$.update=()=>{i.$$.dirty&257&&e(6,n=!!(!(e(8,r=c.state)===null||r===void 0)&&r.unfolded)),i.$$.dirty&1537&&e(5,o=e(10,l=e(9,a=c.data.title)!==null&&a!==void 0?a:c.data.text)!==null&&l!==void 0?l:""),i.$$.dirty&2&&e(4,s=u?450:0)},[c,u,h,d,s,o,n,f,r,a,l,g,v,p,A]}class kA extends oe{constructor(t){super(),ie(this,t,IA,EA,ne,{tag:0},CA)}}function xA(i){ce(i,"svelte-58hfjf",".audio-tag__wrapper.svelte-58hfjf{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.audio-tag.svelte-58hfjf{position:relative;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;padding:0.1875rem;padding-right:0.625rem;border-radius:624999.9375rem;border:0.03125rem solid rgba(255, 255, 255, 0.2)}.audio__inner.svelte-58hfjf{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.text.svelte-58hfjf{font-weight:bold;font-size:0.75rem;margin-left:0.25rem}.audio-icon__wrapper.svelte-58hfjf{position:relative;vertical-align:top;pointer-events:none;width:1.375rem;height:1.375rem}")}function Zr(i){let t,e,n,o;return n=new xl({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[LA]},$$scope:{ctx:i}}}),n.$on("play",i[11]),n.$on("pause",i[12]),n.$on("timeupdate",i[13]),n.$on("duration",i[14]),n.$on("audioRef",i[15]),{c(){t=z("div"),e=z("div"),K(n.$$.fragment),b(e,"class","audio-tag svelte-58hfjf"),T(e,"background-color",i[5]),T(e,"color",i[4]),b(t,"class","audio-tag__wrapper svelte-58hfjf")},m(s,r){M(s,t,r),B(t,e),J(n,e,null),o=!0},p(s,r){const a={};r&1&&(a.enable=s[0].state.visible),r&1&&(a.url=s[0].data.audioUrl),r&1&&(a.hooksInfo={tag:s[0]}),r&65608&&(a.$$scope={dirty:r,ctx:s}),n.$set(a),r&32&&T(e,"background-color",s[5]),r&16&&T(e,"color",s[4])},i(s){o||(E(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&S(t),Z(n)}}}function DA(i){let t;return{c(){t=Ie(i[6])},m(e,n){M(e,t,n)},p(e,n){n&64&&Me(t,e[6])},d(e){e&&S(t)}}}function LA(i){let t,e,n,o,s,r,a;return n=new Dl({props:{playing:i[3]}}),r=new bo({props:{maxWidth:72,$$slots:{default:[DA]},$$scope:{ctx:i}}}),{c(){t=z("div"),e=z("div"),K(n.$$.fragment),o=ee(),s=z("div"),K(r.$$.fragment),b(e,"class","audio-icon__wrapper svelte-58hfjf"),b(s,"class","text svelte-58hfjf"),b(t,"class","audio__inner svelte-58hfjf")},m(l,c){M(l,t,c),B(t,e),J(n,e,null),B(t,o),B(t,s),J(r,s,null),a=!0},p(l,c){const u={};c&8&&(u.playing=l[3]),n.$set(u);const h={};c&65600&&(h.$$scope={dirty:c,ctx:l}),r.$set(h)},i(l){a||(E(n.$$.fragment,l),E(r.$$.fragment,l),a=!0)},o(l){D(n.$$.fragment,l),D(r.$$.fragment,l),a=!1},d(l){l&&S(t),Z(n),Z(r)}}}function SA(i){let t,e,n=i[0].state&&Zr(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&E(n,1)):(n=Zr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function MA(i,t,e){let n,o,s,r;var a,l,c;let{tag:u}=t,h=0,d=0,f=!1;const g=()=>{e(3,f=!0)},v=()=>{e(3,f=!1)},p=w=>{e(1,h=w.detail)},A=w=>{e(2,d=w.detail)};function y(w){on.call(this,i,w)}return i.$$set=w=>{"tag"in w&&e(0,u=w.tag)},i.$$.update=()=>{i.$$.dirty&385&&e(6,n=e(8,l=e(7,a=u.data.title)!==null&&a!==void 0?a:u.data.text)!==null&&l!==void 0?l:""),i.$$.dirty&513&&e(10,o=e(9,c=u.data.theme)!==null&&c!==void 0?c:"light"),i.$$.dirty&1024&&e(5,s=(()=>{if(o==="dark")return"rgba(0, 0, 0, 0.3)";if(o==="light")return"rgba(255, 255, 255, 0.3)"})()),i.$$.dirty&1024&&e(4,r=(()=>{if(o==="dark")return"white";if(o==="light")return"rgba(0, 0, 0, 0.6)"})())},[u,h,d,f,r,s,n,a,l,c,o,g,v,p,A,y]}class TA extends oe{constructor(t){super(),ie(this,t,MA,SA,ne,{tag:0},xA)}}function zA(i){let t,e;return t=new TA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function BA(i){let t,e;return t=new kA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function jA(i){let t,e,n,o;const s=[BA,zA],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=s[t](i)),{c(){e&&e.c(),n=me()},m(l,c){~t&&r[t].m(l,c),M(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?~t&&r[t].p(l,c):(e&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),E(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(E(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&S(n)}}}function VA(i,t,e){let n;var o;let{tag:s}=t,r;function a(l){r=l.detail}return s.play=()=>r.play(),s.pause=()=>r.pause(),i.$$set=l=>{"tag"in l&&e(0,s=l.tag)},i.$$.update=()=>{i.$$.dirty&9&&e(1,n=e(3,o=s.data.appearance)!==null&&o!==void 0?o:"line")},[s,n,a,o]}class QA extends oe{constructor(t){super(),ie(this,t,VA,jA,ne,{tag:0})}}function OA(i){ce(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function Kr(i){var o;let t,e,n;return e=new wl({props:{mediaItemConfig:{canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(o=i[4])!=null?o:"withText",disableVideoIfHavePoster:!1,objectFit:i[2]},unfolded:i[6],mediaData:i[5],enableCarousel:i[1],autoplayConfig:i[3],tag:i[0],inDelay:500,duration:500}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","media-wrapper svelte-10cw0el")},m(s,r){M(s,t,r),J(e,t,null),n=!0},p(s,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=s[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:s[2]}),r&64&&(a.unfolded=s[6]),r&32&&(a.mediaData=s[5]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(E(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&S(t),Z(e)}}}function RA(i){let t,e,n=i[0].state&&i[5]&&Kr(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state&&o[5]?n?(n.p(o,s),s&33&&E(n,1)):(n=Kr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function FA(i,t,e){let n,o,s,r,a,l;var c,u;let{tag:h}=t;return i.$$set=d=>{"tag"in d&&e(0,h=d.tag)},i.$$.update=()=>{i.$$.dirty&1&&e(6,n=h.state?h.state.unfolded:!1),i.$$.dirty&1&&e(5,o=h.data.mediaData),i.$$.dirty&1&&e(1,s=h.data.enableCarousel),i.$$.dirty&1&&e(4,r=h.data.playIcon),i.$$.dirty&131&&e(3,a=e(7,c=h.data.autoplayConfig)!==null&&c!==void 0?c:{autoplay:s!=null?s:!0,autoplayVideo:!0}),i.$$.dirty&257&&e(2,l=e(8,u=h.data.objectFit)!==null&&u!==void 0?u:(()=>h.data.adaptationMode==="stretch"?"fill":h.data.adaptationMode==="proportional"?"contain":void 0)())},[h,s,l,a,r,o,n,c,u]}class HA extends oe{constructor(t){super(),ie(this,t,FA,RA,ne,{tag:0},OA)}}function Ll(i){return _(this,null,function*(){return new Promise((t,e)=>{if(!i){e(Error("url is empty"));return}const n=new Image;n.src=i,n.onload=()=>t({width:n.width,height:n.height}),n.onerror=e})})}function GA(i){return _(this,null,function*(){const{url:t,ratio:e=3}=i;i.ratio||console.warn("Tag icon ratio is not set, default is 3");const{width:n,height:o}=yield Ll(t);return fe(F({},i),{width:n/e,height:o/e})})}function WA(i){return _(this,null,function*(){const{steps:t,url:e,ratio:n=3,fps:o=24}=i;if(!t)throw new Error("KeyframeIcon requires steps");const{width:s,height:r}=yield Ll(e),a=s/n,l=r/n,c=a/t,u=l,h=1/o*t+"s";return fe(F({},i),{width:c,height:u,duration:h})})}function _A(i){ce(i,"svelte-316sq3","@keyframes svelte-316sq3-sprites-animation{0%{background-position:0 0}100%{background-position:100% 0}}.icon-image.svelte-316sq3{display:block;width:auto}.icon-keyframe.svelte-316sq3{background-repeat:no-repeat;background-size:auto 100%;animation-direction:normal;animation-iteration-count:infinite;animation-name:svelte-316sq3-sprites-animation;animation-delay:0}")}function $r(i){i[1]=i[22].width}function ea(i){i[1]=i[22].width,i[19]=i[22].height,i[20]=i[22].steps,i[21]=i[22].duration}function ta(i){let t,e,n,o=i[0]&&na();function s(l,c){return l[8]?XA:NA}let r=s(i),a=r(i);return{c(){t=z("div"),o&&o.c(),e=ee(),a.c(),b(t,"class","icon"),T(t,"width",i[1])},m(l,c){M(l,t,c),o&&o.m(t,null),B(t,e),a.m(t,null),n=!0},p(l,c){l[0]?o?c&1&&E(o,1):(o=na(),o.c(),E(o,1),o.m(t,e)):o&&(se(),D(o,1,1,()=>{o=null}),re()),r===(r=s(l))&&a?a.p(l,c):(a.d(1),a=r(l),a&&(a.c(),a.m(t,null))),c&2&&T(t,"width",l[1])},i(l){n||(E(o),n=!0)},o(l){D(o),n=!1},d(l){l&&S(t),o&&o.d(),a.d()}}}function na(i){let t,e;return t=new nt({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function NA(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:qA,then:UA,catch:YA,value:22};return ni(e=i[11](De({url:i[7],ratio:i[5]})),n),{c(){t=me(),n.block.c()},m(o,s){M(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&160&&e!==(e=i[11](De({url:i[7],ratio:i[5]})))&&ni(e,n)||Ba(n,i,s)},d(o){o&&S(t),n.block.d(o),n.token=null,n=null}}}function XA(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:KA,then:ZA,catch:JA,value:22};return ni(e=i[10](De({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})),n),{c(){t=me(),n.block.c()},m(o,s){M(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&228&&e!==(e=i[10](De({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})))&&ni(e,n)||Ba(n,i,s)},d(o){o&&S(t),n.block.d(o),n.token=null,n=null}}}function YA(i){return{c:Y,m:Y,p:Y,d:Y}}function UA(i){$r(i);let t,e;return{c(){t=z("img"),b(t,"alt","tag-icon"),b(t,"class","icon-image svelte-316sq3"),_e(t.src,e=i[7])||b(t,"src",e),T(t,"width",et(Ht({originWidth:i[1],scale:i[4],wantedWidth:i[3]}).width))},m(n,o){M(n,t,o)},p(n,o){$r(n),o&128&&!_e(t.src,e=n[7])&&b(t,"src",e),o&184&&T(t,"width",et(Ht({originWidth:n[1],scale:n[4],wantedWidth:n[3]}).width))},d(n){n&&S(t)}}}function qA(i){return{c:Y,m:Y,p:Y,d:Y}}function JA(i){return{c:Y,m:Y,p:Y,d:Y}}function ZA(i){ea(i);let t,e=`url(${i[7]})`,n=`steps(${i[20]}, jump-none)`;return{c(){t=z("div"),b(t,"class","icon-keyframe svelte-316sq3"),T(t,"width",et(Ht({originWidth:i[1],originHeight:i[19],scale:i[4],wantedWidth:i[3]}).width)),T(t,"height",et(Ht({originWidth:i[1],originHeight:i[19],scale:i[4],wantedWidth:i[3]}).height)),T(t,"background-image",e),T(t,"animation-duration",i[21]),T(t,"animation-timing-function",n)},m(o,s){M(o,t,s)},p(o,s){ea(o),s&252&&T(t,"width",et(Ht({originWidth:o[1],originHeight:o[19],scale:o[4],wantedWidth:o[3]}).width)),s&252&&T(t,"height",et(Ht({originWidth:o[1],originHeight:o[19],scale:o[4],wantedWidth:o[3]}).height)),s&128&&e!==(e=`url(${o[7]})`)&&T(t,"background-image",e),s&228&&T(t,"animation-duration",o[21]),s&228&&n!==(n=`steps(${o[20]}, jump-none)`)&&T(t,"animation-timing-function",n)},d(o){o&&S(t)}}}function KA(i){return{c:Y,m:Y,p:Y,d:Y}}function $A(i){let t,e,n=i[9]&&ta(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[9]?n?(n.p(o,s),s&512&&E(n,1)):(n=ta(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function Ht(i){const{originWidth:t,originHeight:e,scale:n=1,wantedWidth:o}=i,s=(o!=null?o:t)*n,r=typeof e=="number"?s*(e/t):void 0;return Object.assign(Object.assign({},i),{width:s,height:r})}function ev(i,t,e){let n,o,s,r,a,l,c,u,h;var d=this&&this.__awaiter||function(C,L,x,Q){function W(R){return R instanceof x?R:new x(function(U){U(R)})}return new(x||(x=Promise))(function(R,U){function j(N){try{O(Q.next(N))}catch(G){U(G)}}function H(N){try{O(Q.throw(N))}catch(G){U(G)}}function O(N){N.done?R(N.value):W(N.value).then(j,H)}O((Q=Q.apply(C,L||[])).next())})},f,g;let{width:v=null}=t,{icon:p=null}=t,{shadow:A=!1}=t;const y=ci();function w(C){return d(this,void 0,void 0,function*(){const L=yield WA(C);return y("iconLoaded",L),L})}function k(C){return d(this,void 0,void 0,function*(){if(typeof h=="number")return Object.assign(Object.assign({},C),{width:h});const L=yield GA(C);return y("iconLoaded",L),L})}function P(){u||y("iconLoaded")}return Ye(()=>{P()}),i.$$set=C=>{"width"in C&&e(1,v=C.width),"icon"in C&&e(12,p=C.icon),"shadow"in C&&e(0,A=C.shadow)},i.$$.update=()=>{i.$$.dirty&4096&&e(7,n=p==null?void 0:p.url),i.$$.dirty&12288&&e(2,o=e(13,f=p==null?void 0:p.steps)!==null&&f!==void 0?f:1),i.$$.dirty&4096&&e(6,s=p==null?void 0:p.fps),i.$$.dirty&4096&&e(5,r=p==null?void 0:p.ratio),i.$$.dirty&20480&&e(4,a=e(14,g=p==null?void 0:p.scale)!==null&&g!==void 0?g:1),i.$$.dirty&4096&&e(3,l=p==null?void 0:p.width),i.$$.dirty&252&&e(9,c=De({url:n,steps:o,fps:s,ratio:r,scale:a,width:l})),i.$$.dirty&4&&e(8,u=o>1),i.$$.dirty&2&&(h=v)},P(),[A,v,o,l,a,r,s,n,u,c,w,k,p,f,g]}class Sl extends oe{constructor(t){super(),ie(this,t,ev,$A,ne,{width:1,icon:12,shadow:0},_A)}}function tv(i){ce(i,"svelte-e58ijk",".wrapper.svelte-e58ijk{font-weight:600;cursor:pointer;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:auto}.text-wrapper.svelte-e58ijk{position:relative;display:flex;align-items:center;justify-content:center}.text.svelte-e58ijk{position:absolute;top:0;font-size:0.875rem;color:#ffffff;letter-spacing:0;text-align:center;max-width:8.75rem;width:-moz-max-content;width:max-content;line-height:1.125rem;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function ia(i){let t,e,n,o,s,r;return e=new nt({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=z("div"),K(e.$$.fragment),n=ee(),o=z("div"),s=Ie(i[1]),b(o,"class","text svelte-e58ijk"),b(t,"class","text-wrapper svelte-e58ijk")},m(a,l){M(a,t,l),J(e,t,null),B(t,n),B(t,o),B(o,s),r=!0},p(a,l){(!r||l&2)&&Me(s,a[1])},i(a){r||(E(e.$$.fragment,a),r=!0)},o(a){D(e.$$.fragment,a),r=!1},d(a){a&&S(t),Z(e)}}}function nv(i){let t,e,n,o;e=new Sl({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[7]);let s=i[1]&&i[2]&&ia(i);return{c(){t=z("div"),K(e.$$.fragment),n=ee(),s&&s.c(),b(t,"class","wrapper svelte-e58ijk")},m(r,a){M(r,t,a),J(e,t,null),B(t,n),s&&s.m(t,null),o=!0},p(r,[a]){const l={};a&1&&(l.icon=r[0]),e.$set(l),r[1]&&r[2]?s?(s.p(r,a),a&6&&E(s,1)):(s=ia(r),s.c(),E(s,1),s.m(t,null)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){o||(E(e.$$.fragment,r),E(s),o=!0)},o(r){D(e.$$.fragment,r),D(s),o=!1},d(r){r&&S(t),Z(e),s&&s.d()}}}function iv(i,t,e){let n,o,s;var r,a,l;let{tag:c}=t;const u=()=>{e(2,n=!0)};return i.$$set=h=>{"tag"in h&&e(3,c=h.tag)},i.$$.update=()=>{i.$$.dirty&24&&e(1,o=e(4,r=c.data.title)!==null&&r!==void 0?r:c.data.text),i.$$.dirty&104&&e(0,s=e(5,a=c.data.icon)!==null&&a!==void 0?a:e(6,l=c.style)===null||l===void 0?void 0:l.point)},e(2,n=!1),[s,o,n,c,r,a,l,u]}class ov extends oe{constructor(t){super(),ie(this,t,iv,nv,ne,{tag:3},tv)}}function sv(i){ce(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function oa(i){let t,e=i[0].element+"",n;return{c(){t=new Kn(!1),n=me(),t.a=n},m(o,s){t.m(e,o,s),M(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&S(n),o&&t.d()}}}function rv(i){let t,e=typeof i[0].element=="string"&&oa(i);return{c(){t=z("div"),e&&e.c(),b(t,"class","customElement__container svelte-kzl2aj")},m(n,o){M(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=oa(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:Y,o:Y,d(n){n&&S(t),e&&e.d(),i[2](null)}}}function av(i,t,e){let{tag:n}=t,o,s;Ye(()=>{if(o){if(n.element instanceof Element){const a=n.element;o.appendChild(a),s=()=>a.remove()}else if(typeof n.element=="function"){const a=n.element;s=a(o)}}}),Pt(()=>{s==null||s()});function r(a){Qe[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class lv extends oe{constructor(t){super(),ie(this,t,av,rv,ne,{tag:0},sv)}}function cv(i){ce(i,"svelte-1r4fqvg",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAAAhAAAAAkaG10eJ9gBO8AAADsAAABJG1heHAASVAAAAAArAAAAAZuYW1lqczkZQAAApQAAAJecG9zdP+4ADIAAAZwAAAAIAAAUAAASQAAAAEAAAABAADkeHeyXw889QADA+gAAAAA2NoRKwAAAADY2hErACn/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACCAA7AcwAdwIIADMCCAA0AhwAMwISADkCCAAuAfQANAH+ACsB/gApAggANAEeAFABHgBQAR4AUAIIADQCCAAuAR4AUAEeAFABfAAxAAEAAAPo/zgAAAIcACkAKQHgAAEAAAAAAAAAAAAAAAAAAABJAAMCLgGQAAUACAKKAlgAAABLAooCWAAAAV4AMgEsAAAAAAgAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFVLV04AIAAg/xsDIP84AMgD6ADIAAAAAQAAAAAB9AK8AAAAIAAAAAAAEADGAAEAAAAAAAEADAAAAAEAAAAAAAIABAAMAAEAAAAAAAMAGwAQAAEAAAAAAAQAEQArAAEAAAAAAAUAPAA8AAEAAAAAAAYAEAB4AAEAAAAAAAgADAAAAAEAAAAAAAkADAAAAAMAAQQJAAEAGACIAAMAAQQJAAIACACgAAMAAQQJAAMANgCoAAMAAQQJAAQAIgDeAAMAAQQJAAUAeAEAAAMAAQQJAAYAIAF4AAMAAQQJAAgAGACIAAMAAQQJAAkAGACIQUxJQkFCQSBGb250Qm9sZDEuMDAwO1VLV047QUxJQkFCQUZvbnQtQm9sZEFMSUJBQkEgRm9udCBCb2xkVmVyc2lvbiAxLjAwMDtQUyAwMDEuMDAwO2hvdGNvbnYgMS4wLjg4O21ha2VvdGYubGliMi41LjY0Nzc1QUxJQkFCQUZvbnQtQm9sZABBAEwASQBCAEEAQgBBACAARgBvAG4AdABCAG8AbABkADEALgAwADAAMAA7AFUASwBXAE4AOwBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAEEATABJAEIAQQBCAEEAIABGAG8AbgB0ACAAQgBvAGwAZABWAGUAcgBzAGkAbwBuACAAMQAuADAAMAAwADsAUABTACAAMAAwADEALgAwADAAMAA7AGgAbwB0AGMAbwBuAHYAIAAxAC4AMAAuADgAOAA7AG0AYQBrAGUAbwB0AGYALgBsAGkAYgAyAC4ANQAuADYANAA3ADcANQBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAAAAAAADAAAAAwAAASIAAQAAAAAAHAADAAEAAAEiAAABBgAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAABCSEMANjc4OTo7PD0+PwAAAAAAAAACAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGwAAAAAAABwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAFoAAAAQABAAAwAAACAALgA5AFoAegCl/xv//wAAACAALAAwAEEAYQCl/xr////hAAAABv/B/7v/nwAAAAEAAAAOAAAAAAAAAAAACgAAAEIASABDAEYARwADAAAAAAAA/7UAMgAAAAAAAAAAAAAAAAAAAAAAAAAAAQAEAgABAQERQUxJQkFCQUZvbnQtQm9sZAABAQEg+A8A+CAB+CEC+BgEtPtc+HT5tAX3KA/3UBGcHAZWEgAHAQENExoiKTpLbmluZS4wMDEuMDAxbW9uZXkudW5pRkYxQm5pbmUuMDAxdW5pRkYxQWNvcHlyaWdodCBtaXNzaW5nQUxJQkFCQSBGb250IEJvbGQAAAEAAQAAIhkAQhkAEQkBhwABigAADQAADwAAZAABiAABiwABiQAADgAASQIAAQCtAK4ArwCwALEAsgCzALQAtQC2ALcAuAC5ALoAuwC8AL0AvgC/AMAAwQDCAMMAxADFAMYAxwDIAMkAygDLAMwAzQDOAM8A0ADRANIA0wDUANUA1gDXANgA2QDaANsA3ADdAN4A3wDgAOEA4gFDAVoBqwIsAloCuAMcAzkDzwQ4BDoEPARRBFMEVQTNBOIE8QUEmPtc0Ky6rKKsuqzHrKPDoa2irLCspq2vraWssKzOAejVrKytrKzYA/gu+bQV+9H+fPfRBj76ORVqSWbNavs6rM2wSqwH7vsVFUXNafs68wfNaRVqZ6wG704VaklFJ6zNsEmsB/c6TxUn+zqt9xnNB6z7DhX7Bfs69wWsO++6anRpwwfv+0EV+wX7OvcFB/cZahUnXO8GrFMVamsHRVwF8Wr7OqwG0boFRawGDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OrIr5UQH3OPdUA/ebihVmaZSdbB9Mr2TL0xr3vgewlK2eqh7Kr86y1BuvrIJ5qh/HZrJIQhr7vgdngmp5bR5OZ0tkQxv46ARUX2FSH/u+B1a5YMDAs7TCHve+B8RjtVYeDnD4utkB93HzA/cL+QgVPfH8vPP5UgcOrIn5UgG++DYD+GmJFfw28wb3svfUBZ2glKSnGsNduFBWXF1UiB4ijgaMsJWsnqoIyLHMstYbsa6Ceawfy2ezSUAaVndXZ2Me+2/7jQX3pwYOrIvy92Tz90ryEr/zM/L3SvMu8hPy+B/3/xUT7LCwpMDDGq6CrHqoHsZnTK5DG2lrg3puH09pZk5EGobykAe4tba6vrViXFZiYlcedyOfBhPyxLpdUlJcW1JSXLvEH5ojfAdllGiebB5LsM5j1xuwrpSeqx/KsLPO1xrKcMNerx4OwPL1Affi8gP4dPdlFWD4fPshBvuJ/HkF+wH3ryPy87YH+8z1Ffc69+QF++QHDrb3ZNf3ZfAB9zX3YwP3nRZlaJSebB9LsGPO1xrzBlK6XMTEubrEHtcHxF26UlJcXFIeI/g0+BYh+677JAaorK2ZsBuwroJ4qx/LZrNHPxo/B2aCaHhrHktmR2NAGw6si/X3b/IBufX3b/ID95n4QBWAg4uKhh/3EfelBfsHBvtK/CMFfnCFbm0aZJVnnmoeSrLPYdobsq6Vnqwfy7K10dgasoGueKwey2RHtT4b+9YETlu7yMe8vcfHvVlPT1laTx8OmIr5UQG/+B8D93iKFfsIBvdo+OYF+6T2+B8oBg6iifL3bPX3QPEStvNB8vc/8jXxE/L4EvgHFRPss7Cnu78arYOreqgexWpNr0YbaWyDem4fUmlmTUcaXqBftGAeE/JWYmROSxpklWieax5Ksc9i2BuxrpWerB/LsbTP2BrHaMVath4T7PsN93QVu7FjXFtlZltcZbC7urGzuh8T8oX8ghVPW7zHx7q6yMa9W1BPWVpQHw6i96Tz92/0AbTz93DzA/hp+HkVsIGveKwezmNFtUAbZGeBeGofSmNiRT8aZJVnnmseSrHPYtoboAb7EvukBfcHBvdL+CEFmaySqaQa+9gWxry+yJ6dhoGcHq12oWZmGk5YW1BMXLnKHg4gCiEK+11L91IlCvdiyhWtb6hpJgoeJAoOIQogCqz3pe/3b/UBufX3bfQD+G74dxWyga94rB7NZEW0PhtlaIF4ah9KY2FFPxo7tkTPZh6MjIqKjB+TiJCIjYoIjgaCoKGHoRuanY6QoB+IgfsB+6QF9wcG9y/4IgWYppGnqhr7a/sCFVBbvMjHu7zGyLxbTk5aWk4fDvtd+AojCoz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-1r4fqvg{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.withAnimation.svelte-1r4fqvg{transition:opacity 0.3s linear}.content__container.unClickable.svelte-1r4fqvg{pointer-events:none !important}.content__container.unClickable.svelte-1r4fqvg *{pointer-events:none !important}.content__wrapper.svelte-1r4fqvg{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-1r4fqvg{opacity:0;pointer-events:none}.content__container.hide.svelte-1r4fqvg *{pointer-events:none !important}.content__container.disable.svelte-1r4fqvg{display:none}.content.svelte-1r4fqvg{position:relative;width:100%;height:100%;font-size:0.75rem;color:#fff}.content.svelte-1r4fqvg:not(.unfolded){pointer-events:none}.content.svelte-1r4fqvg:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-1r4fqvg{pointer-events:auto}')}function uv(i){let t,e;return{c(){t=z("div"),b(t,"data-info","tag content is keep folded"),b(t,"data-id",e=i[1].id)},m(n,o){M(n,t,o)},p(n,o){o&2&&e!==(e=n[1].id)&&b(t,"data-id",e)},i:Y,o:Y,d(n){n&&S(t)}}}function dv(i){let t,e,n,o,s,r,a,l,c;const u=[vv,Av,gv,pv,mv,fv,hv],h=[];function d(f,g){return f[1].element?0:f[1].contentType==="Text"?1:f[1].contentType==="ImageText"||f[1].contentType==="Image"||f[1].contentType==="Video"?2:f[1].contentType==="Audio"?3:f[1].contentType==="Marketing"?4:f[1].contentType==="Link"||f[1].contentType==="VRLink"||f[1].contentType==="PanoLink"||f[1].contentType==="Sticker"?5:f[1].contentType==="MediaPlane"||f[1].contentType==="MediaModel"?6:-1}return~(o=d(i))&&(s=h[o]=u[o](i)),{c(){var f;t=z("div"),e=z("div"),n=z("div"),s&&s.c(),b(n,"class","content svelte-1r4fqvg"),q(n,"unfolded",(f=i[1].state)==null?void 0:f.unfolded),b(e,"class","content__wrapper svelte-1r4fqvg"),b(t,"class","content__container svelte-1r4fqvg"),b(t,"data-id",r=i[1].id),q(t,"disable",i[1].enabled===!1),q(t,"hide",i[4]),q(t,"withAnimation",i[0]),q(t,"unClickable",i[1].clickable===!1),T(t,"width",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0),T(t,"height",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0)},m(f,g){M(f,t,g),B(t,e),B(e,n),~o&&h[o].m(n,null),a=!0,l||(c=we(t,"click",ka(i[24])),l=!0)},p(f,g){var p;let v=o;o=d(f),o===v?~o&&h[o].p(f,g):(s&&(se(),D(h[v],1,1,()=>{h[v]=null}),re()),~o?(s=h[o],s?s.p(f,g):(s=h[o]=u[o](f),s.c()),E(s,1),s.m(n,null)):s=null),(!a||g&2)&&q(n,"unfolded",(p=f[1].state)==null?void 0:p.unfolded),(!a||g&2&&r!==(r=f[1].id))&&b(t,"data-id",r),(!a||g&2)&&q(t,"disable",f[1].enabled===!1),(!a||g&16)&&q(t,"hide",f[4]),(!a||g&1)&&q(t,"withAnimation",f[0]),(!a||g&2)&&q(t,"unClickable",f[1].clickable===!1),g&2&&T(t,"width",f[1].stickType==="Plane"||f[1].contentType==="MediaModel"?"100%":0),g&2&&T(t,"height",f[1].stickType==="Plane"||f[1].contentType==="MediaModel"?"100%":0)},i(f){a||(E(s),a=!0)},o(f){D(s),a=!1},d(f){f&&S(t),~o&&h[o].d(),l=!1,c()}}}function hv(i){let t,e;return t=new HA({props:{tag:De(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=De(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function fv(i){let t,e;return t=new ov({props:{tag:De(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=De(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function mv(i){let t,e;return t=new hA({props:{tag:De(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=De(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function pv(i){let t,e;return t=new QA({props:{tag:De(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=De(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function gv(i){let t,e;return t=new q0({props:{tag:De(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=De(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Av(i){let t,e;return t=new mg({props:{tag:De(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=De(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function vv(i){let t,e;return t=new lv({props:{tag:De(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=De(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function bv(i){let t,e,n,o;const s=[dv,uv],r=[];function a(l,c){return l[3]?0:1}return t=a(i),e=r[t]=s[t](i),{c(){e.c(),n=me()},m(l,c){r[t].m(l,c),M(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?r[t].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),E(e,1),e.m(n.parentNode,n))},i(l){o||(E(e),o=!0)},o(l){D(e),o=!1},d(l){r[t].d(l),l&&S(n)}}}function yv(i,t,e){let n,o,s,r,a,l;var c,u,h,d,f,g,v,p,A,y,w;let{withAnimation:k=!1}=t,{tag:P}=t,{hooks:C}=t,{state:L}=t,{mediaStore:x}=t,{temporaryState:Q}=t;Wi("hooks",C),Wi("mediaStore",x);let W,R;function U(O){O?C.emit("exposure",{id:r,type:"start"}):C.emit("exposure",{id:r,type:"end"})}function j(O,N,G){var $,X;return!(!N.visible||!N.enabled||!G.visible||!(!(($=O.state)===null||$===void 0)&&$.visible)||((X=O.temporaryState)===null||X===void 0?void 0:X.visible)===!1||Fe(O)&&!O.mediaVisible)}const H=O=>C.emit("click",{event:O,target:"TagContent",tag:P});return i.$$set=O=>{"withAnimation"in O&&e(0,k=O.withAnimation),"tag"in O&&e(1,P=O.tag),"hooks"in O&&e(2,C=O.hooks),"state"in O&&e(5,L=O.state),"mediaStore"in O&&e(6,x=O.mediaStore),"temporaryState"in O&&e(7,Q=O.temporaryState)},i.$$.update=()=>{i.$$.dirty&258&&e(22,n=e(8,c=P.state)===null||c===void 0?void 0:c.unfolded),i.$$.dirty&514&&e(21,o=e(9,u=P.state)===null||u===void 0?void 0:u.visible),i.$$.dirty&1186&&e(23,s=L.visible&&Q.visible&&(e(10,h=P.state)===null||h===void 0?void 0:h.visible)),i.$$.dirty&2&&(r=P.id),i.$$.dirty&162&&e(4,a=!j(P,L,Q)),i.$$.dirty&8388608&&U(s),i.$$.dirty&8386562&&P.hooks&&(n!==void 0&&n!==R&&(e(20,R=n),n?e(12,f=e(11,d=P.hooks).emit)===null||f===void 0||f.call(d,"unfolded"):e(14,v=P==null?void 0:e(13,g=P.hooks).emit)===null||v===void 0||v.call(g,"folded")),o!==void 0&&o!==W&&(e(19,W=o),o?e(16,A=e(15,p=P.hooks).emit)===null||A===void 0||A.call(p,"show"):e(18,w=e(17,y=P.hooks).emit)===null||w===void 0||w.call(y,"hide"))),i.$$.dirty&2&&e(3,l=(()=>!(typeof P.mergedConfig.unfoldedConfig=="object"&&P.mergedConfig.unfoldedConfig.keep==="folded"))())},[k,P,C,l,a,L,x,Q,c,u,h,d,f,g,v,p,A,y,w,W,R,o,n,s,H]}class Ml extends oe{constructor(t){super(),ie(this,t,yv,bv,ne,{withAnimation:0,tag:1,hooks:2,state:5,mediaStore:6,temporaryState:7},cv)}}function wv(i){ce(i,"svelte-1jkrwn7",'@charset "UTF-8";.tag-point-click-helper.svelte-1jkrwn7.svelte-1jkrwn7{position:absolute;pointer-events:auto;cursor:pointer;width:calc(100% + 0.75rem);height:calc(100% + 0.75rem);left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-1jkrwn7.svelte-1jkrwn7{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);z-index:-1}.tag-folded-point.svelte-1jkrwn7.svelte-1jkrwn7,.tag-unfolded-point.svelte-1jkrwn7.svelte-1jkrwn7{transition:all 0.5s}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.3125rem;height:0.3125rem;border-radius:50%;background-color:white}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7:before{content:"";position:absolute;width:0.875rem;height:0.875rem;border-radius:50%;background-color:rgba(0, 0, 0, 0.2)}.tag-point-wrapper.folded.svelte-1jkrwn7 .tag-folded-point.svelte-1jkrwn7{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-1jkrwn7 .tag-folded-point.svelte-1jkrwn7{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{opacity:1;scale:1}')}function Cv(i){let t,e,n,o,s,r,a,l,c,u,h,d;return o=new nt({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new Sl({props:{icon:i[2],width:i[1]}}),c.$on("iconLoaded",i[11]),{c(){t=z("div"),e=z("div"),n=ee(),K(o.$$.fragment),s=ee(),r=z("div"),a=ee(),l=z("div"),K(c.$$.fragment),b(e,"class","tag-point-click-helper svelte-1jkrwn7"),b(r,"class","tag-unfolded-point svelte-1jkrwn7"),T(r,"transition-delay",(i[3]?i[5]:0)+"ms"),b(l,"class","tag-folded-point svelte-1jkrwn7"),T(l,"transition-delay",(i[3]?i[5]:0)+"ms"),b(t,"class","tag-point-wrapper svelte-1jkrwn7"),q(t,"unfolded",i[0]),q(t,"folded",i[3])},m(f,g){M(f,t,g),B(t,e),B(t,n),J(o,t,null),B(t,s),B(t,r),B(t,a),B(t,l),J(c,l,null),u=!0,h||(d=we(e,"click",i[4]),h=!0)},p(f,[g]){g&8&&T(r,"transition-delay",(f[3]?f[5]:0)+"ms");const v={};g&4&&(v.icon=f[2]),g&2&&(v.width=f[1]),c.$set(v),g&8&&T(l,"transition-delay",(f[3]?f[5]:0)+"ms"),(!u||g&1)&&q(t,"unfolded",f[0]),(!u||g&8)&&q(t,"folded",f[3])},i(f){u||(E(o.$$.fragment,f),E(c.$$.fragment,f),u=!0)},o(f){D(o.$$.fragment,f),D(c.$$.fragment,f),u=!1},d(f){f&&S(t),Z(o),Z(c),h=!1,d()}}}function Pv(i,t,e){let n,o,s,r;var a,l,c,u;const h=St("hooks");let{tag:d}=t,f,g=!1;const v=()=>{f!==void 0&&clearTimeout(f),g=!0,f=setTimeout(()=>{g=!1},800)},p=w=>{g||h.emit("click",{event:w,target:"TagPoint",tag:d})},A=(()=>d.contentType==="Text"&&d.data.appearance==="plane"?500:800)();function y(w){on.call(this,i,w)}return i.$$set=w=>{"tag"in w&&e(6,d=w.tag)},i.$$.update=()=>{i.$$.dirty&192&&e(0,n=e(7,a=d.state)===null||a===void 0?void 0:a.unfolded),i.$$.dirty&1&&e(3,o=!n),i.$$.dirty&1856&&e(2,s=!(e(9,c=e(8,l=d.style)===null||l===void 0?void 0:l.point)===null||c===void 0)&&c.url?e(10,u=d.style)===null||u===void 0?void 0:u.point:{url:Hp}),i.$$.dirty&64&&e(1,r=(()=>{var w,k,P,C;const L=(k=(w=d.style)===null||w===void 0?void 0:w.point)===null||k===void 0?void 0:k.width;if(typeof L=="number")return L;const x=(C=(P=d.style)===null||P===void 0?void 0:P.point)===null||C===void 0?void 0:C.size;if(typeof x=="number")return x;if(x==="S")return 18;if(x==="M")return 20;if(x==="L")return 24;if(x==="XL")return 28})())},v(),[n,r,s,o,p,A,d,a,l,c,u,y]}class Ev extends oe{constructor(t){super(),ie(this,t,Pv,Cv,ne,{tag:6},wv)}}function Iv(i){ce(i,"svelte-pzwdws",".tag.withAnimation.svelte-pzwdws{transition:opacity 0.3s linear}.tag.hide.svelte-pzwdws{opacity:0;pointer-events:none}.tag.hide.svelte-pzwdws *{pointer-events:none !important}.tag.unClickable.svelte-pzwdws{pointer-events:none !important}.tag.unClickable.svelte-pzwdws *{pointer-events:none !important}.tag.disable.svelte-pzwdws{display:none}.wrapper.svelte-pzwdws{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto}")}function kv(i){let t;return{c(){t=z("div"),b(t,"data-info","tag content is disable")},m(e,n){M(e,t,n)},p:Y,i:Y,o:Y,d(e){e&&S(t)}}}function xv(i){let t,e;return t=new Ml({props:{mediaStore:i[2],withAnimation:i[0],tag:De(i[1]),hooks:i[14],state:i[3],temporaryState:i[4]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&4&&(s.mediaStore=n[2]),o&1&&(s.withAnimation=n[0]),o&2&&(s.tag=De(n[1])),o&8&&(s.state=n[3]),o&16&&(s.temporaryState=n[4]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Dv(i){let t;return{c(){t=z("div"),b(t,"data-info","tag point is disable")},m(e,n){M(e,t,n)},p:Y,i:Y,o:Y,d(e){e&&S(t)}}}function Lv(i){let t,e;return t=new Ev({props:{tag:i[1]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=n[1]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Sv(i){let t,e,n,o,s,r,a,l,c;const u=[xv,kv],h=[];function d(p,A){return p[12]?0:1}n=d(i),o=h[n]=u[n](i);const f=[Lv,Dv],g=[];function v(p,A){return p[13]?0:1}return r=v(i),a=g[r]=f[r](i),{c(){t=z("div"),e=z("div"),o.c(),s=ee(),a.c(),b(e,"class","wrapper svelte-pzwdws"),b(e,"data-tag-unfolded",i[8]),b(e,"data-tag-id",i[11]),b(e,"data-content-type",l=i[1].contentType),T(e,"left",i[7]),T(e,"top",i[6]),T(e,"z-index",i[5]),b(t,"class","tag svelte-pzwdws"),b(t,"data-tag-id",i[11]),q(t,"unClickable",i[1].clickable===!1),q(t,"disable",i[10]),q(t,"hide",i[9]),q(t,"withAnimation",i[0])},m(p,A){M(p,t,A),B(t,e),h[n].m(e,null),B(e,s),g[r].m(e,null),c=!0},p(p,[A]){let y=n;n=d(p),n===y?h[n].p(p,A):(se(),D(h[y],1,1,()=>{h[y]=null}),re(),o=h[n],o?o.p(p,A):(o=h[n]=u[n](p),o.c()),E(o,1),o.m(e,s));let w=r;r=v(p),r===w?g[r].p(p,A):(se(),D(g[w],1,1,()=>{g[w]=null}),re(),a=g[r],a?a.p(p,A):(a=g[r]=f[r](p),a.c()),E(a,1),a.m(e,null)),(!c||A&256)&&b(e,"data-tag-unfolded",p[8]),(!c||A&2048)&&b(e,"data-tag-id",p[11]),(!c||A&2&&l!==(l=p[1].contentType))&&b(e,"data-content-type",l),A&128&&T(e,"left",p[7]),A&64&&T(e,"top",p[6]),A&32&&T(e,"z-index",p[5]),(!c||A&2048)&&b(t,"data-tag-id",p[11]),(!c||A&2)&&q(t,"unClickable",p[1].clickable===!1),(!c||A&1024)&&q(t,"disable",p[10]),(!c||A&512)&&q(t,"hide",p[9]),(!c||A&1)&&q(t,"withAnimation",p[0])},i(p){c||(E(o),E(a),c=!0)},o(p){D(o),D(a),c=!1},d(p){p&&S(t),h[n].d(),g[r].d()}}}function Mv(i,t,e){let n,o,s,r,a,l,c,u,h;var d,f,g,v,p,A,y,w;let{withAnimation:k=!1}=t,{tag:P}=t,{mediaStore:C}=t,{state:L}=t,{temporaryState:x}=t;const Q=St("hooks");return i.$$set=W=>{"withAnimation"in W&&e(0,k=W.withAnimation),"tag"in W&&e(1,P=W.tag),"mediaStore"in W&&e(2,C=W.mediaStore),"state"in W&&e(3,L=W.state),"temporaryState"in W&&e(4,x=W.temporaryState)},i.$$.update=()=>{i.$$.dirty&2&&e(13,n=(()=>!(P.contentType==="Sticker"||P.contentType==="Link"||P.contentType==="VRLink"||P.contentType==="PanoLink"||P.contentType==="Audio"&&P.data.appearance==="plane"))()),i.$$.dirty&2&&e(12,o=(()=>P.stickType==="2DPoint")()),i.$$.dirty&2&&e(11,s=P.id),i.$$.dirty&98306&&e(10,r=!(!(e(15,d=P.pointTagStyle)===null||d===void 0)&&d.leftPercent)||!(!(e(16,f=P.pointTagStyle)===null||f===void 0)&&f.topPercent)||P.enabled===!1||!P.state),i.$$.dirty&393218&&e(9,a=!(!(e(17,g=P.state)===null||g===void 0)&&g.visible)||(e(18,v=P.temporaryState)===null||v===void 0?void 0:v.visible)===!1),i.$$.dirty&524290&&e(8,l=e(19,p=P.state)===null||p===void 0?void 0:p.unfolded),i.$$.dirty&1048578&&e(7,c=(e(20,A=P.pointTagStyle)===null||A===void 0?void 0:A.leftPercent)+"%"),i.$$.dirty&2097154&&e(6,u=(e(21,y=P.pointTagStyle)===null||y===void 0?void 0:y.topPercent)+"%"),i.$$.dirty&4194306&&e(5,h=!(e(22,w=P.state)===null||w===void 0)&&w.unfolded?1:0)},[k,P,C,L,x,h,u,c,l,a,r,s,o,n,Q,d,f,g,v,p,A,y,w]}class Tv extends oe{constructor(t){super(),ie(this,t,Mv,Sv,ne,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},Iv)}}function zv(i){ce(i,"svelte-uq11d5",".tag--container.svelte-uq11d5{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:translate3d(0, 0, 0)}.withAnimation.svelte-uq11d5{transition:opacity 0.3s linear}.tag--container.hide.svelte-uq11d5{opacity:0;pointer-events:none}.tag--container.hide.svelte-uq11d5 *{pointer-events:none !important}")}function sa(i,t,e){const n=i.slice();return n[6]=t[e],n}function ra(i){let t,e=[],n=new Map,o,s=i[1];const r=a=>a[6].id;for(let a=0;a<s.length;a+=1){let l=sa(i,s,a),c=r(l);n.set(c,e[a]=aa(c,l))}return{c(){t=z("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","tag--container svelte-uq11d5"),q(t,"hide",!i[3].visible||!i[4].visible),q(t,"withAnimation",i[0])},m(a,l){M(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,l){l&31&&(s=a[1],se(),e=Ue(e,l,r,1,a,s,n,t,Et,aa,null,sa),re()),(!o||l&24)&&q(t,"hide",!a[3].visible||!a[4].visible),(!o||l&1)&&q(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)E(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&S(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function aa(i,t){let e,n,o;return n=new Tv({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(s,r){M(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&8&&(a.state=t[3]),r&16&&(a.temporaryState=t[4]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[6]),r&4&&(a.mediaStore=t[2]),n.$set(a)},i(s){o||(E(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&S(e),Z(n,s)}}}function Bv(i){let t,e,n=i[3].enabled&&ra(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&E(n,1)):(n=ra(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function jv(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return Wi("hooks",s),i.$$set=c=>{"withAnimation"in c&&e(0,n=c.withAnimation),"tags"in c&&e(1,o=c.tags),"hooks"in c&&e(5,s=c.hooks),"mediaStore"in c&&e(2,r=c.mediaStore),"state"in c&&e(3,a=c.state),"temporaryState"in c&&e(4,l=c.temporaryState)},[n,o,r,a,l,s]}class Vv extends oe{constructor(t){super(),ie(this,t,jv,Bv,ne,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},zv)}}const Qv={globalConfig:{unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},Link:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},VRLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},PanoLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0}},MediaModel:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{keep:"visible",visibleFiveMode:["Panorama","Floorplan","Model","Mapview"],alwaysShowWhenMovePano:!0}}}};class Ov extends Pn{constructor(e){super(e);m(this,"tagCacheByPanoIndex",{})}getCache({panoIndex:e,id:n,key:o}){var c,u,h,d;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(h=(u=s.work)==null?void 0:u.workCode)!=null?h:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const f=l.get(n);return f||(l.set(n,{}),l.get(n))}return(d=l.get(n))==null?void 0:d[o]}clearCache(){this.tagCacheByPanoIndex={}}removeCache(){}}class Rv extends Ov{constructor(e){super(e);m(this,"tags",[]);m(this,"config",Qv);m(this,"raycaster",new I.Raycaster)}get isPanorama(){return this.five.currentMode==="Panorama"}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.warn(`error: can not find tag id ${e} by getTagById()`);return}return n}changeContentTypeConfig(e,n,o=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),o?this.config.contentTypeConfig[e]=ht.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache()}getVisibleByPanoIndex(e,n){var r;const o=this.getCache({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(Fe(e))return!0;if(o.visible!==void 0)return o.visible;{const a=(()=>{var u,h,d;const l=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},c=this.getDistance(e);if(typeof l=="function")return{value:l(this.five,{tag:e,distance:c}),reason:"config function result"};if(l.keep==="hidden")return{value:!1,reason:"config.keep is hidden"};if(l.keep==="visible")return{value:!0,reason:"config.keep is visible"};if(l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&s!==void 0){if(Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(s))return{value:!1,reason:`current panoIndex is not included in visiblePano. currentPanoIndex: ${s}, visiblePanoIndex: ${l.visiblePanoIndex}`};if(l.visiblePanoIndex==="current"&&s!==((h=e.fiveState)==null?void 0:h.panoIndex))return{value:!1,reason:`current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${s}, tag.panoIndex: ${(d=e.fiveState)==null?void 0:d.panoIndex}`}}if(l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&cn(c,l.visibleDistance)===!1)return{value:!1,reason:`distance is not in visibleDistance. distance: ${c}, visibleDistance: ${l.visibleDistance}`};if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s===void 0)return{value:!1,reason:`intersectRaycaster check failed: fivePanoIndex is ${s}`};const f=this.getRaycasterFromPanoIndex(e,s),g=this.getTagEnableByIntersect(e,f);if(g.value===!1)return g}if(l.angleRange&&xp(e)){const f=this.getAngle(e);if(cn(f,l.angleRange)===!1)return{value:!1,reason:`angle is not in angleRange. angle: ${f}, angleRange: ${l.angleRange}`}}return{value:!0,reason:"all check passed"}})();return o.visible=a.value,o.__debug_visible_reason__=a,o.visible}}getVisibleByFiveMode(e,n){var r;const o=(r=this.getTagConfig(e).visibleConfig)!=null?r:{};if(typeof o=="function")return n==="Panorama";const s=o==null?void 0:o.visibleFiveMode;return s?s.includes(n):n==="Panorama"}getVisibleByFloorIndex(e){var a;const n=e.fiveState;if(!n)return!0;const o=n.panoIndex,s=(a=this.five.work.observers[o])==null?void 0:a.floorIndex,r=this.five.model.shownFloor;return r===null||r===s}getVisible(e){const n=this.five.getCurrentState(),o=this.getVisibleByFiveMode(e,n.mode),s=Fe(e)?this.getVisibleByFloorIndex(e):!0,r=n.mode==="Panorama"?this.getVisibleByPanoIndex(e,n.panoIndex):!0;return o&&r&&s}getModelMedialVisibleByPanoIndex(e){const n=this.five.getCurrentState().panoIndex,o=this.getCache({panoIndex:n,id:e.id});if(o.modelMedialVisible!==void 0)return o.modelMedialVisible;const s=this.getRaycasterFromPanoIndex(e,n),r=this.getTagEnableByIntersect(e,s);return o.modelMedialVisible=r.value,o.__debug_visible_reason__=r,r.value!==!1}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCache({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.unfoldDistance&&cn(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1||!r.autoUnfold.strategy)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&cn(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.autoUnfold.strategy==="MinimumDistance"){const u=this.filterPointTag().filter(d=>this.getVisibleByPanoIndex(d)).filter(d=>{const f=this.getTagProject(d);if(!f)return!1;const{x:g,y:v,z:p}=f;return!(Math.abs(p)>1||Math.abs(g)>1||Math.abs(v)>1)}).map(d=>({tag:d,id:d.id,tagConfig:this.getTagConfig(d).unfoldedConfig})).filter(({tag:d,tagConfig:f})=>{var g,v;return!(typeof f!="object"||f.keep||f.autoUnfold===!1||((g=f.autoUnfold)==null?void 0:g.enable)===!1||((v=f.autoUnfold)==null?void 0:v.strategy)!=="MinimumDistance")}).map(d=>fe(F({},d),{distance:this.getDistance(d.tag)})).filter(({distance:d,tagConfig:f})=>{var g,v;return!(d===void 0||typeof f!="object"||f.autoUnfold===!1||((g=f.autoUnfold)==null?void 0:g.enable)===!1||((v=f.autoUnfold)==null?void 0:v.strategy)!=="MinimumDistance"||f.autoUnfold.distance&&cn(d,f.autoUnfold.distance)===!1)}).sort((d,f)=>d.distance-f.distance).findIndex(d=>d.id===e.id);if(u===-1||u<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const u=Ks(e);if(!u)return-1;const h=c.distanceTo(u);return s.distance=h,h}}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const u=(()=>e.stickType==="3DPoint"?vn(e.normal):Zi(e.position))();if(!u)return;const h=new I.Vector3().copy(c).sub(Ki(e.position)),d=u.angleTo(h)*180/Math.PI;return s.angle=d,s.angle}}getTagConfig(e){var s,r;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(a=>{const l=a;if(n[l])return;const c=l.split("-");if(c.length===1){const[u]=c;e.contentType===u&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===2){const[u="Any",h="Any"]=c;(e.stickType===u||u==="Any")&&(e.contentType===h||h==="Any")&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===3){const[u="Any",h,d]=c;if(h==="Audio"&&e.contentType==="Audio"){const f=e;(f.stickType===u||u==="Any")&&f.data.appearance===d&&(n[l]=this.config.contentTypeConfig[l])}}});const o=ht.default({},this.config.globalConfig,...Object.values(n),e.config);return typeof o.unfoldedConfig=="object"&&(o.unfoldedConfig.disableFold&&(o.unfoldedConfig={keep:"unfolded"}),o.unfoldedConfig.disableUnfold&&(o.unfoldedConfig={keep:"folded"}),o.unfoldedConfig.keep&&(o.unfoldedConfig={keep:o.unfoldedConfig.keep})),typeof o.visibleConfig=="object"&&o.visibleConfig.keep&&(o.visibleConfig={keep:o.visibleConfig.keep,visibleFiveMode:(r=o.visibleConfig)==null?void 0:r.visibleFiveMode}),o}can(e,n){const o=this.getTagConfig(n);if(!o||typeof o!="object")return!0;if(e==="show"||e==="hide"){if(!o.visibleConfig||typeof o.visibleConfig!="object")return!0;if(e==="show"&&o.visibleConfig.keep==="hidden"||e==="hide"&&(o.visibleConfig.keep==="visible"||o.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!o.unfoldedConfig||typeof o.unfoldedConfig!="object")return!0;if(e==="fold"&&o.unfoldedConfig.keep==="unfolded"||e==="unfold"&&o.unfoldedConfig.keep==="folded")return!1}return!0}sort(e){return e.sort((n,o)=>{const s=this.getDistance(n),r=this.getDistance(o);return s===void 0||r===void 0?0:r-s})}setPointTagPosition(){const e=this.filterPointTag();e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=null;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=null;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setModelMedialVisible(){const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{var s;if(!Fe(n))return;if(!((s=n.model)!=null&&s.object)){n.mediaVisible=!1;return}const o=e==="Panorama"?this.getModelMedialVisibleByPanoIndex(n):!0;n.mediaVisible=o})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e)||!e.position)return;const o=Ki(e.position),{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}filterPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint"||e.stickType==="3DPoint").filter(e=>e.position)}filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint").filter(e=>e.position)}filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint").filter(e=>e.position)}filterModelTag(){return this.tags.filter(e=>e.stickType==="Model")}filter3DTag(){return this.tags.filter(e=>e.stickType==="3DPoint"||e.stickType==="Plane"||e.stickType==="Model")}filterPlaneTag(){return this.tags.filter(e=>e.stickType==="Plane")}updateTagConfig(e){e!=null&&e.force&&this.clearCache(),this.tags.forEach(n=>{const o=this.getTagConfig(n);n.mergedConfig=o})}getTagEnableByIntersect(e,n){var u,h,d;const o=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},s=this.getDistance(e),[r]=this.five.model.intersectRaycaster(n),a=(()=>{if(!Fe(e))return;const f=this.tags.filter(Fe).map(v=>{var p;return(p=v.model)==null?void 0:p.object}).filter(yt);return n.intersectObjects(f,!0)[0]})(),l=(()=>{var f;return typeof o=="object"&&typeof o.intersectRaycaster=="object"&&(f=o.intersectRaycaster.distanceAccuracy)!=null?f:.01})();return Math.min((h=r==null?void 0:r.distance)!=null?h:1/0,(d=a==null?void 0:a.distance)!=null?d:1/0)+l<s?{value:!1,reason:`intersectRaycaster check failed: distance is ${s}, intersection.point is ${r==null?void 0:r.point.toArray()},
562
- customModelIntersection.point is ${a==null?void 0:a.point.toArray()} distanceError is ${l}`}:{value:!0,reason:""}}getRaycasterFromPanoIndex(e,n){var r;const o=(r=this.five.work.observers[n])==null?void 0:r.position;if(o===void 0)throw new Error(`getVisible(): observerPosition is ${o}`);const s=Ks(e).sub(o).normalize();return this.raycaster.set(o,s),this.raycaster}}function Fv(i){var t,e,n,o;if(!i.stickType){const s=(()=>i.pointType==="PointTag"&&i.dimensionType==="3D"?"3DPoint":i.pointType==="PlaneTag"?"Plane":"2DPoint")();i.stickType=s}if(i.contentType==="VRLink"||i.contentType==="PanoLink"||i.contentType==="Link"){const s=i;!((e=(t=s.data)==null?void 0:t.icon)!=null&&e.url)&&!((o=(n=s.style)==null?void 0:n.point)!=null&&o.url)&&(s.data.icon={url:"//vrlab-static.ljcdn.com/release/web/test.09dee741.png",steps:28})}return i}const Hv=new sc.GLTFLoader;function Gv(i){return new Promise((t,e)=>{function n(s){t(s)}function o(s){e(s)}Hv.load(i,n,void 0,o)})}const to="DnalogelPlugin-PanoTagPlugin",Wv=!1,_v=i=>`${to}--${i}`;class Tl extends Rv{constructor(e,n){super(e);m(this,"state",{enabled:!0,visible:!0});m(this,"params");m(this,"debug");m(this,"css3DRenderPlugin");m(this,"TagContainerSvelte");m(this,"temporaryState",{visible:!0});m(this,"mediaStore",co({currentMediaElement:null}));m(this,"group",new V.Group);m(this,"gltfObjectGroup",new V.Group);m(this,"isIOSWX",navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1&&navigator.userAgent.toLowerCase().indexOf("iphone")!==-1);m(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});m(this,"enabledModelTagSet",new Set);m(this,"changeTagModel",(e,n)=>_(this,null,function*(){e.data=ht.default({},e.data,n),yield this.loadModel(e),this.updateRenderAllTags()}));m(this,"disposedErrorLog",()=>{console.error(`${to} is disposed`)});m(this,"handleFiveInitAnimationEnded",()=>{const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{Fe(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags(),this.updateRenderAllTags()});m(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{!Fe(e)||(e.state.visible=this.getVisible(e))}),this.updateRenderAllTags()});m(this,"loadModel",e=>_(this,null,function*(){var l;const n=e.data.modelUrl;if(!n)return;const o=Gv(n).then(c=>Object.assign(c.scene,{customID:e.id,isTagModel:!0}));e.model={promise:o};const s=yield o;if(((l=e.model)==null?void 0:l.promise)!==o||(e.model.object=s,!this.tags.includes(e)))return;s.visible=e.state.visible,new V.Matrix4().fromArray(e.matrix).decompose(s.position,s.quaternion,s.scale),s.updateWorldMatrix(!0,!0),this.getVisibleByFloorIndex(e)||(s.visible=!1);const a=this.gltfObjectGroup.children.find(c=>c.customID===e.id);return a&&this.gltfObjectGroup.remove(a),this.gltfObjectGroup.add(s),this.updateTagCss3DObjectMatrix(e,s),s}));this.group.name="PanoTagPluginModelGroup",this.gltfObjectGroup.name="PanoTagPluginGLTFObjectGroup",this.group.add(this.gltfObjectGroup),this.params=F({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,Yr(1,{namespace:ai.GetAudioDuration}),Yr(1,{namespace:ai.PlayAudio}),Object.assign(window,{[`__PANOTAGPLUGIN_DEBUG_${Date.now()}__`]:this}),Object.assign(window,{__PANOTAGPLUGIN_DEBUG__:this}),this.state.enabled&&this.five.scene.add(this.group)}load(e,n){return _(this,null,function*(){var s,r;this.clearTags(),console.info(to," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=ht.default({},this.config,{globalConfig:(s=e.globalConfig)!=null?s:{},contentTypeConfig:(r=e.contentTypeConfig)!=null?r:{}});const o=yield this.addTag(e.tagList,n);if(this.debug)try{kp(this.five,this.tags)}catch(a){console.error(a)}return o})}addTag(e,n){return _(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r);return fe(F({},r),{state:F({visible:void 0,unfolded:Wv},a.initialState),hooks:new Ce.Subscribe,clickable:a.clickable,mergedConfig:a})}).filter(r=>r.position);return s.forEach(Fv),this.tags.push(...s),Dp(this.five).then(()=>{var r,a,l;return this.store.eventListenerDisposer&&((a=(r=this.store).eventListenerDisposer)==null||a.call(r)),this.state.enabled&&(this.store.eventListenerDisposer=this.addEventListener()),this.addResizeListener(),this.checkPanelTag(),this.setVisibleAndUnfolded({withAnimation:(l=n==null?void 0:n.withAnimation)!=null?l:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags(),this.addMediaModelTag(s)})})}changeConfig(e,n=!0){n?this.config=ht.default({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=ht.default({},this.config.globalConfig,e):this.config.globalConfig=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}clearTags(){this.tags=[],this.enabledModelTagSet.clear(),this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}show(e){return _(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("show",{userAction:n,withAnimation:o})})}hide(e){return _(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("hide",{userAction:n,withAnimation:o})})}enable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.five.scene.children.includes(this.group)||this.five.scene.add(this.group),this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n}),this.five.needsRender=!0}disable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:n}),this.five.scene.remove(this.group),this.hooks.emit("disable",{userAction:n}),this.five.needsRender=!0}dispose(){var e,n,o,s,r,a;this.pauseCurrentMedia(),this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filter3DTag().forEach(l=>{var c;return(c=l.tag3DContentSvelte)==null?void 0:c.svelteApp.$destroy()}),this.tags=[],(n=this.store.disposers)==null||n.forEach(l=>l==null?void 0:l()),this.store.disposers=[],this.store.disposed=!0,(s=(o=this.store).eventListenerDisposer)==null||s.call(o),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.gltfObjectGroup.remove(...this.gltfObjectGroup.children),this.clearCache(),this.five.needsRender=!0,this.hooks.emit("dispose")}setState(e,n){if(this.store.disposed)return this.disposedErrorLog();const{userAction:o=!0,visibleWithAnimation:s=!1}=n,r=F({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}changeUnfoldedById(e,n){var r;const o=this.getTagById(e);if(!o)return;o.state.unfolded=n;const s=this.filterPointTag();(r=this.TagContainerSvelte)==null||r.$set({tags:s})}changeTagNormalById(e,n){const o=this.getTagById(e);!o||!o.tag3DContentSvelte||(o.tag3DContentSvelte.currentNormal=ft(n),this.updateRenderPlaneTag())}changeDataById(e,n,o=!0){const s=this.getTagById(e);!s||(o?s.data=ht.default({},s.data,n):s.data=F(F({},s.data),n),this.checkPanelTag(),this.updateRenderAllTags())}changeStickTypeById(e,n,o=!0){this.changeTagById(e,n,o)}changeTagById(e,n,o=!0){const s=this.getTagById(e);!n||(o?ht.default(s,n):Object.assign(s,n),(s==null?void 0:s.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(s.tag3DContentSvelte.currentNormal=ft(n.normal)),this.updateRenderAllTags(),this.checkPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(o=>{const s=this.tags.findIndex(r=>r.id===o);s!==-1&&this.tags.splice(s,1)}),this.updateRenderAllTags()}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}updateTagCss3DObjectMatrix(e,n){var v,p,A,y;const o=(A=(p=(v=e.mergedConfig)==null?void 0:v.tag3DConfig)==null?void 0:p.ratio)!=null?A:.00216,s=(y=e.tag3DContentSvelte)==null?void 0:y.domContainer.css3DObject;if(!s)return;const r=Fe(e)?e.data.mediaPosition:e.position;n.updateWorldMatrix(!1,!1);const a=n.matrixWorld,l=new V.Vector3().fromArray(r[0]),c=new V.Vector3().fromArray(r[2]),u=new V.Vector3().lerpVectors(l,c,.5).add(new V.Vector3(0,0,5e-4)),h=new V.Matrix4().setPosition(u),d=new V.Matrix4().makeScale(o,o,o),f=new V.Matrix4().multiply(a).multiply(h).multiply(d);f.decompose(s.position,s.quaternion,s.scale);const g=s.opacityMesh;!g||f.decompose(g.position,g.quaternion,g.scale)}updateTagCss3DObjectVisible(e){var s,r,a,l,c;const n=(s=e.tag3DContentSvelte)==null?void 0:s.domContainer.css3DObject;if(!n)return;n.visible=(a=(r=e.state)==null?void 0:r.visible)!=null?a:!0;const o=n.opacityMesh;!o||(o.visible=(c=(l=e.state)==null?void 0:l.visible)!=null?c:!0)}setVisibleAndUnfolded(){return _(this,arguments,function*({withAnimation:e}={withAnimation:!1}){if(!!this.isPanorama)return this.setVisibleByPanoIndex(),e?new Promise((n,o)=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.updateTagContainerVisible()}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.updateTagContainerVisible()}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.updateRenderAllTags()}handleDisable(){var e,n,o;this.pauseCurrentMedia(),this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),(o=this.TagContainerSvelte)==null||o.$set({tags:[]}),this.filter3DTag().forEach(s=>{var r;(r=s.tag3DContentSvelte)==null||r.svelteApp.$destroy(),s.tag3DContentSvelte=void 0})}addEventListener(){const{five:e,hooks:n}=this,o=this.handleFiveWantsMoveToPano.bind(this),s=this.handleFiveModeChange.bind(this),r=this.handleFiveCameraUpdate.bind(this),a=this.handleFiveCameraUpdateDebounce(),l=this.handleFivePanoArrived.bind(this),c=this.loadVideoFirstFrame.bind(this),u=this.clickhandler.bind(this),h=this.five.currentMode;return this.handleFiveModeChange(h),this.handleFivePanoArrived(),e.on("wantsMoveToPano",o),e.on("modeChange",s),e.on("initAnimationEnded",this.handleFiveInitAnimationEnded),e.on("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),e.on("panoArrived",c),n.on("click",u),()=>{e.off("wantsMoveToPano",o),e.off("modeChange",s),e.off("initAnimationEnded",this.handleFiveInitAnimationEnded),e.off("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),e.off("panoArrived",c),n.off("click",u),this.store.eventListenerDisposer=void 0}}loadVideoFirstFrame(){this.isIOSWX&&this.hooks.emit("loadVideoFirstFrame")}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const e=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=e,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(!this.store.disposed)return;const e=this.five.getElement(),n=()=>{!this.state.enabled||(this.show(),this.updateRenderAllTags())},o=()=>{!this.state.enabled||this.hide()},{observe:s,unobserve:r}=er(Sp(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=er($s(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.setModelMedialVisible(),this.tags.forEach(n=>{Fe(n)&&e!=="Panorama"&&this.changeTagMode(n,"behind"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags(),this.updateRenderAllTags()}handleFiveWantsMoveToPano(){this.tags.forEach(e=>{const n=this.getTagConfig(e);typeof n.visibleConfig=="object"&&(n.visibleConfig.keep?e.temporaryState=fe(F({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=fe(F({},e.temporaryState),{visible:Boolean(n.visibleConfig.alwaysShowWhenMovePano)}))}),this.updateTagContainerVisible()}temporaryShow({withAnimation:e}={withAnimation:!1}){this.store.visibleWithAnimation=e,this.temporaryState.visible=!0,this.updateTagContainerVisible()}temporaryHide({withAnimation:e}={withAnimation:!1}){this.store.visibleWithAnimation=e,this.temporaryState.visible=!1,this.updateTagContainerVisible()}clickhandler(e){if(e.target!=="TagPoint")return;if(!e.tag.state)return console.warn("Clickhandler: params.tag.state is undefined");const n=this.can("fold",e.tag),o=this.can("unfold",e.tag);n&&o&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(s=>{s.id!==e.tag.id&&s.state&&this.can("fold",s)&&(s.state.unfolded=!1)}),this.updateRenderAllTags())}updateRenderAllTags(){this.enabledModelTagSet.clear(),this.tags.forEach(e=>e.stickType==="Model"&&this.enabledModelTagSet.add(e.id)),this.updateRenderPointTag(),this.updateRenderPlaneTag(),this.updateRenderModelTag()}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filter3DTag().forEach(n=>{var o;(o=n.tag3DContentSvelte)==null||o.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}handleFiveCameraUpdateDebounce(){return $s(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return _(this,null,function*(){this.setModelMedialVisible(),yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=fe(F({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible(),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);!n.state||o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.keep)||n.state&&(n.state.unfolded=!1)})}updateRenderPointTag(){var n;const e=this.sort(this.filterPointTag());if(this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const o=(n=this.five.getElement())==null?void 0:n.parentElement;if(!o)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new Vv({target:o,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateRenderPlaneTag(){this.sort([...this.filterPlaneTag(),...this.filter3DPointTag(),...this.filterModelTag()]).forEach(n=>{var l,c,u;if(Fe(n)&&((l=n.model)==null?void 0:l.object)&&this.updateTagCss3DObjectMatrix(n,(c=n.model)==null?void 0:c.object),n.tag3DContentSvelte){const{svelteApp:h,domContainer:d,initialNormal:f,currentNormal:g}=n.tag3DContentSvelte;if(this.updateTagCss3DObjectVisible(n),h.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!f.equals(g)){const v=new V.Quaternion().setFromUnitVectors(f,g);d.css3DObject.setRotationFromQuaternion(v)}return}if(((u=n.state)==null?void 0:u.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=Zt(this.five)),n.stickType==="3DPoint"&&!n.normal)return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");const o=(()=>n.stickType==="Plane"?n.position:Fe(n)?n.data.mediaPosition:Lp(this.five.camera.position,ft(n.position),ft(n.normal)))();if(!o)return;const s=function(){if(n.normal)return ft(n.normal);if(n.stickType==="Plane")return Zi(n.position);if(n.contentType==="MediaModel")return Zi(o)}();if(!s)return;const r=this.getTagConfig(n).tag3DConfig,a=this.css3DRenderPlugin.create3DDomContainer(o,r);!a||(this.updateTagCss3DObjectVisible(n),this.store.css3DRenderDisposer.set(n.id,a.dispose),n.tag3DContentSvelte={svelteApp:new Ml({target:a.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:a,initialNormal:s,currentNormal:s})}),this.checkPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID);this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)),this.tags.filter(Fe).forEach(o=>{var s;(s=o.model)==null||s.promise.then(r=>{r.visible=o.state.visible})})}disposeAllCSS3DContainer(){for(const[e,n]of this.store.css3DRenderDisposer)n==null||n();this.store.css3DRenderDisposer=new Map}checkPanelTag(){this.filter2DPointTag().forEach(e=>{var n;(n=e.tag3DContentSvelte)==null||n.domContainer.dispose(),e.tag3DContentSvelte=void 0});for(const[e,n]of this.store.css3DRenderDisposer){const o=this.getTagById(e);(!o||o.stickType==="2DPoint")&&(n==null||n(),this.store.css3DRenderDisposer.delete(e))}}addMediaModelTag(e){return _(this,null,function*(){const n=e.filter(Fe).map(this.loadModel);yield Promise.all(n),this.setModelMedialVisible(),this.updateRenderAllTags()})}changeTagMode(e,n){var o,s,r,a,l;((r=(s=(o=e.tag3DContentSvelte)==null?void 0:o.domContainer)==null?void 0:s.css3DObject)==null?void 0:r.mode)!==n&&((a=e.config)!=null&&a.tag3DConfig?e.config.tag3DConfig.mode=n:e.config?e.config.tag3DConfig={mode:n}:e.config={tag3DConfig:{mode:n}},(l=this.store.css3DRenderDisposer.get(e.id))==null||l(),e.tag3DContentSvelte=void 0)}}var zl=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.Sticker="Sticker",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.MediaModel="MediaModel",i.Custom="Custom",i.Unknown="Unknown",i))(zl||{}),Bl=(i=>(i.Two="2D",i.Three="3D",i))(Bl||{}),jl=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(jl||{});const Nv=(i,t)=>new Tl(i,t);function be(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new I.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}be.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)};be.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];be.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}};be.prototype._objectCtxInit=function(i){i._3xDomEvent={}};be.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent};be.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent};be.prototype._objectCtxGet=function(i){return i._3xDomEvent};be.prototype.camera=function(i){return i&&(this._camera=i),this._camera};be.prototype.bind=function(i,t,e,n){console.assert(be.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)};be.prototype.addEventListener=be.prototype.bind;be.prototype.unbind=function(i,t,e,n){console.assert(be.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);this._boundObjs[t].splice(l,1)};be.prototype.removeEventListener=be.prototype.unbind;be.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1};be.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new I.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,u,h=r[0],d=h.object;this._selected=d,u=this._bound("mousemove",d),a!=d&&(l=this._bound("mouseover",d),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;u&&this._notify("mousemove",d,n,h),l&&this._notify("mouseover",d,n,h),c&&this._notify("mouseout",a,n,h)}};be.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new I.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),u=l.parent;typeof c=="undefined"&&u;)c=this._objectCtxGet(u),u=u.parent;!c||this._notify(i,l,n,a)}}};be.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),!!l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}};be.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)};be.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)};be.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)};be.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)};be.prototype._onClick=function(i){this._onMouseEvent("click",i)};be.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)};be.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)};be.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)};be.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)};be.prototype._onTouchMove=function(i){if(i.touches.length==1){i.preventDefault();var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}};be.prototype._onTouchEvent=function(i,t){if(t.touches.length==1){t.preventDefault();var e=Number(t.touches[0].pageX/window.innerWidth)*2-1,n=-(t.touches[0].pageY/window.innerHeight)*2+1;this._onEvent(i,e,n,t)}};function Vl(i){const t=new I.Box3,e=new I.Vector3;if(i.traverse(n=>{var s;if(n.name==="shadow")return;const o=n.geometry;if(o!==void 0)if((s=o==null?void 0:o.attributes)!=null&&s.position){const r=o.attributes.position;for(let a=0,l=r.count;a<l;a++)e.fromBufferAttribute(r,a).applyMatrix4(n.matrix),t.expandByPoint(e)}else o.vertices.forEach(r=>{const a=r.clone().applyMatrix4(n.matrix);t.expandByPoint(a)})}),!t.isEmpty())return t}class In{constructor(t,e){m(this,"originObject3D");m(this,"hooks");m(this,"disposers",[]);m(this,"helperObject3D");m(this,"camera");m(this,"model");m(this,"scene");m(this,"container");m(this,"domEvents");m(this,"isDragging",!1);m(this,"enabled",!1);m(this,"name","BaseController");m(this,"boundingBox");m(this,"offset");m(this,"onRender");m(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});var c,u;this.hooks=(c=t.sharedHooks)!=null?c:new Jt,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new be(t.camera,t.container),this.onRender=(u=t.onRender)!=null?u:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const n=(...h)=>this.onSetOriginObjectScale(...h),o=(...h)=>this.onSetOriginObjectRotate(...h),s=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",n),this.hooks.on("setObjectRotate",o),this.hooks.on("setObjectPosition",s),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",n),this.hooks.off("setObjectRotate",o),this.hooks.off("setObjectPosition",s),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){!this.enabled||(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,n=new I.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),o=new I.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),s=this.calculateOffset(this.offset,{min:o,max:n});this.helperObject3D.position.copy(s),this.helperObject3D.initialPosition()}}hoverListener(t,e=16777215,n=1){const o=(Array.isArray(t)?t:[t]).filter(yt),s=[];for(const r of o)if(r instanceof I.Mesh||r instanceof I.Group){const a=r instanceof I.Group?r.children.filter(d=>d instanceof I.Mesh):[r];a.forEach(d=>{d.__originalColor__=d.material.color.clone(),d.__originalOpacity__=d.material.opacity});const l=()=>{a.forEach(d=>{d.material.color.set(e),d.material.opacity=n}),this.render()},c=()=>{a.forEach(d=>{d.material.color.copy(d.__originalColor__),d.material.opacity=d.__originalOpacity__}),this.render()},u=()=>{this.isDragging||l()},h=()=>{this.isDragging||c()};for(const d of a)this.domEvents.addEventListener(d,"mouseover",u),this.domEvents.addEventListener(d,"mouseout",h),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),s.push(()=>{this.domEvents.removeEventListener(d,"mouseover",u),this.domEvents.removeEventListener(d,"mouseout",h),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>s.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;const o=this.helperObject3D.raycasterIntersectObject(t)[0];if(!o)return;const s=o;if(s.object=n,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<s.point.distanceTo(e))return}return s.object}calculateOffset(t,e){const n=this.originObject3D,o=new I.Vector3(0,0,0);if(!t)return o;const s=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=Vl(n),this.boundingBox));if(typeof t.x=="number")o.setX(t.x);else if(typeof t.x=="object"){const r=s();o.setX((r.max.x-r.min.x)*t.x.percents)}if(typeof t.y=="number")o.setY(t.y);else if(typeof t.y=="object"){const r=s();o.setY((r.max.y-r.min.y)*t.y.percents)}if(typeof t.z=="number")o.setZ(t.z);else if(typeof t.z=="object"){const r=s();o.setZ((r.max.z-r.min.z)*t.z.percents)}return o}}class Xv extends In{constructor(...e){super(...e);m(this,"name","ScaleController")}setScale(e){var l,c,u;let n=1,o=1,s=1;typeof e=="number"?(n=e,o=e,s=e):typeof e=="object"&&(n=(l=e.x)!=null?l:1,o=(c=e.y)!=null?c:1,s=(u=e.z)!=null?u:1);const r=new I.Vector3(n,o,s);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.hooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}function Ql(i,t,e){if(e){const o=new I.Vector3().subVectors(i.position,e).applyQuaternion(i.quaternion.clone().inverse()).applyQuaternion(t).add(e);i.position.copy(o)}i.quaternion.copy(t)}class Yv extends V.Object3D{constructor(){super()}add(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.add(...e)}remove(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.remove(...e)}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}}class vi extends Yv{constructor(e,n){var o;super();m(this,"originObject3D");m(this,"onRender");this.originObject3D=e,this.onRender=(o=n==null?void 0:n.onRender)!=null?o:()=>{}}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,n=[]){return e.intersectObject(this,!0,n)}initialPosition(){this.position.add(this.originObject3D.position)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}setHelperQuaternion(e,n){Ql(this,e,n)}applyHelperQuaternion(e,n){if(n){const o=new V.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(o)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class Uv extends vi{}class qv extends vi{}class Jv extends vi{}class Ol extends vi{}class Zv extends Ol{}class Kv extends I.Group{constructor(e){super();m(this,"direction");this.direction=e||"x"}}class la extends I.Mesh{constructor(e,n,o){super(e,n);m(this,"direction");this.direction=o||"x"}}function $v(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new I.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function Po(i,t,e){if(!t||!e||!i)return;const n=$v(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new I.Raycaster;return o.setFromCamera(n,i),o}function eb(i,t){return!(Math.abs(i.x-t.x)>1e-5||Math.abs(i.y-t.y)>1e-5||Math.abs(i.z-t.z)>1e-5)}class Qi extends Kv{constructor(e){var u;super(e.direction);m(this,"line");m(this,"arrow");m(this,"lineHeight",.4);m(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new I.Color((u=e.color)!=null?u:16214315),o=new I.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:I.DoubleSide}),s=new I.ConeGeometry(.04,.1,32),r=new la(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new I.CylinderGeometry(a,a,.4,32),c=new la(l,o.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const Oi={X:15618642,Y:4765519,Z:4227839};class _t{static get X(){return new I.Color(Oi.X).convertSRGBToLinear().clone()}static get Y(){return new I.Color(Oi.Y).convertSRGBToLinear().clone()}static get Z(){return new I.Color(Oi.Z).convertSRGBToLinear().clone()}}class tb extends Uv{constructor(e){super(e);m(this,"xArrow",new Qi({direction:"x",color:_t.X}));m(this,"yArrow",new Qi({direction:"y",color:_t.Y}));m(this,"zArrow",new Qi({direction:"z",color:_t.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function Lt(i,t){return nb(document.createElement(t!=null?t:"div"),i)}function nb(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function ib(i){const t=Lt(F({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class ob extends Jv{constructor(e,n){super(e);m(this,"xCircle");m(this,"yCircle");m(this,"zCircle");m(this,"children",[]);m(this,"angleTips");m(this,"container");(n==null?void 0:n.yzCircleEnable)!==!1&&(this.xCircle=new Ri({direction:"x",color:_t.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.yCircle=new Ri({direction:"y",color:_t.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.zCircle=new Ri({direction:"z",color:_t.Z})),(n==null?void 0:n.container)&&(n==null?void 0:n.angleTipsEnable)!==!1&&(this.container=n==null?void 0:n.container,this.angleTips=ib({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(n=>n.showCircle()),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.children.filter(o=>e.includes(o.direction)).forEach(o=>o.showRing()),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.removeFromParent(),(n=(e=this.angleTips)==null?void 0:e.element)==null||n.remove()}}class Ri extends I.Group{constructor(e){super();m(this,"direction");m(this,"circle");m(this,"ring");m(this,"angleSector");this.direction=e.direction,this.circle=new sb(e),this.ring=new rb(e),this.angleSector=new ab(e),this.add(this.circle,this.ring,this.angleSector),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}showCircle(){this.add(this.circle),this.remove(this.ring,this.angleSector)}showRing(){this.add(this.ring,this.angleSector),this.remove(this.circle)}hide(){this.remove(this.ring,this.angleSector,this.circle)}}class sb extends I.Mesh{constructor(e){var n;super();m(this,"direction");m(this,"gapAngle",.02);m(this,"geometry",new I.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new I.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:I.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`}}class rb extends I.Group{constructor(e){super();m(this,"direction");this.direction=e.direction;const n=.015,o=new Array(8).fill(null).map((s,r)=>{const a=new I.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new I.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:I.DoubleSide}),c=new I.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...o)}}class ab extends I.Mesh{constructor(e){var o;super();m(this,"direction");m(this,"baseAxes");m(this,"angleDirection");switch(e.direction){case"x":this.baseAxes=new I.Vector3(0,0,1);break;case"y":this.baseAxes=new I.Vector3(1,0,0);break;case"z":this.baseAxes=new I.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new I.CircleGeometry(n,48,0,1e-4),this.material=new I.MeshBasicMaterial({opacity:.4,color:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:I.DoubleSide}),this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function lb(){const i=Lt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Lt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Lt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element:dt({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:dt({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:dt({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:dt({cursor:"ew-resize",right:n})},l={direction:"nesw",element:dt({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:dt({cursor:"ns-resize",top:n})},u={direction:"nwse",element:dt({cursor:"nwse-resize",left:n,top:n})},h={direction:"ew",element:dt({cursor:"ew-resize",left:n})};return new Array(s,a,c,h,o,r,l,u).forEach(f=>t.appendChild(f.element)),{container:i,squares:[o,s,r,a,l,c,u,h]}}function dt(i){const t=Lt(F({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Lt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Lt({width:"15px",height:"15px",cursor:i==null?void 0:i.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class cb extends Zv{constructor(e,n,o,s){super(e);m(this,"points",[]);m(this,"cornerPositions",[]);m(this,"css3DInstance");m(this,"plane");m(this,"css3DRenderer",new Nt);m(this,"camera");m(this,"scene");m(this,"container");m(this,"enabled",!1);this.camera=o,this.scene=s,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(o=>o.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var o;(o=this.plane)==null||o.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,o)=>{n.position.copy(e[o])})}applyHelperQuaternion(e,n){var s;const o=(s=this.css3DInstance)==null?void 0:s.css3DObject;if(o){const r=new I.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.applyQuaternion(e)}if(this.plane){const r=new I.Vector3().subVectors(this.plane.position,n).applyQuaternion(e).add(n);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new I.Vector3().subVectors(r,n).applyQuaternion(e).add(n);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;!this.enabled||(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a,l;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const n=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!n)return;this.css3DInstance=n,n.appendToElement(this.container);const o=n.css3DObject.container,{container:s,squares:r}=lb();this.points=r.map((c,u)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[u]})),o.insertBefore(s,(a=o.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("\u5F53\u524D\u7269\u4F53\u6682\u65F6\u4E0D\u652F\u6301 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}class ub extends qv{constructor(e){super(e);m(this,"box");m(this,"outline");m(this,"originObject");m(this,"positionAttribute");this.originObject=e,this.positionAttribute=new I.BufferAttribute(new Float32Array(8*3),3),this.box=this.createBox(),this.outline=this.createOutline(),this.add(this.box,this.outline),this.update()}raycasterIntersectObject(e,n){return e.intersectObject(this,!1,n)}raycast(e,n){this.box.raycast(e,n)}update(){const e=Vl(this.originObject);if(!e)return;const{min:n,max:o}=e;this.positionAttribute.setXYZ(0,o.x,o.y,o.z),this.positionAttribute.setXYZ(1,n.x,o.y,o.z),this.positionAttribute.setXYZ(2,n.x,n.y,o.z),this.positionAttribute.setXYZ(3,o.x,n.y,o.z),this.positionAttribute.setXYZ(4,o.x,o.y,n.z),this.positionAttribute.setXYZ(5,n.x,o.y,n.z),this.positionAttribute.setXYZ(6,n.x,n.y,n.z),this.positionAttribute.setXYZ(7,o.x,n.y,n.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new I.BufferGeometry;n.setIndex(new I.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new I.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),s=new I.LineSegments(n,o);return s.matrixAutoUpdate=!1,s}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),n=new I.BufferGeometry;n.setIndex(new I.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new I.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new I.Mesh(n,o)}}class db extends In{constructor(...e){super(...e);m(this,"name","MoveController");m(this,"startInfo");m(this,"_moveByMouseEnable",!1);m(this,"mouseInfo");m(this,"mousedownEventListenerDisposer");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("rotateStart",l),this.hooks.on("rotateEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("rotateStart",l),this.hooks.off("rotateEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouseEnable}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(n=>n==null?void 0:n())}moveByMouse(){this._moveByMouseEnable=!0;const e=this.handleMouseDown.bind(this),n=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",n)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",n)}}disableMoveByMouse(){var e;this._moveByMouseEnable=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){!this.moveByMouseEnable||this.hooks.emit("wantToMove",e.point)||(this.originObject3D.position.copy(e.point),this.hooks.emit("setObjectPosition",e.point),this.hooks.emit("move",e.point))}onApplyOriginObjectScale(e){}handleMouseDown(e){const{x:n,y:o}=e;this.mouseInfo={x:n,y:o,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:n,y:o}=e;this.mouseInfo.x===n&&this.mouseInfo.y===o&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}dragStart(e){if(this._moveByMouseEnable||this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=new I.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new I.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new I.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(o){case"x":return s;case"y":return r;case"z":return a}})(),c=(()=>{switch(o){case"x":case"y":return a;case"z":return s}})(),u=n.point.clone(),h=new I.Plane;h.setFromNormalAndCoplanarPoint(c,u),this.startInfo={startVectorProject:u.clone().projectOnVector(l),directionVector:l,plane:h},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("moveStart"),this.isDragging=!0}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=Po(this.camera,e,this.container);return n?(this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:o,startVectorProject:s}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new I.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),u=new I.Matrix4;u.setPosition(c);const h=r.position.clone().applyMatrix4(u);this.hooks.emit("wantToMove",h)||(r.applyMatrix4(u),s.copy(l),this.hooks.emit("applyObjectPosition",{matrix:u}),this.hooks.emit("move",h))}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class un{constructor(t,e,n,o,s,r){m(this,"helperController");m(this,"five");m(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});m(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});m(this,"onFiveIntersectionOnModelUpdate",(...t)=>{!this.helperController||this.helperController.onIntersectionOnModelUpdate(...t)});const{camera:a,model:l,scene:c}=t,u=t.getElement();if(this.five=t,!a||!l||!u||!c)return;const h=()=>{t.needsRender=!0};this.helperController=new e({camera:a,model:l,originObject3D:n,helperObject3D:o,container:u,scene:c,onRender:h,sharedHooks:r},s),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const hb="v1.0.1",fb="Object3DHelper",Eo=`${fb}@${hb}`,mb=()=>{console.error(`${Eo} is disposed`)},pb=()=>{console.warn(`${Eo} is disabled`)},gb=()=>{console.error(`${Eo} is disabled`)};class Ab{constructor(t){m(this,"controllers",{});m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"hooks",new Jt);m(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return _(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return _(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return mb();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return gb();const n=F({},this.state);this.state=F(F({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=F(F({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose()});for(const n in this.controllers){if(!n)continue;const o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&pb()}}function Fi(i){return i*Math.PI/180}class vb extends In{constructor(...e){var c,u,h;super(...e);m(this,"name","RotateController");m(this,"startInfo");m(this,"removeListener");const n=this.helperObject3D;this.hoverListener([(c=n.xCircle)==null?void 0:c.circle,(u=n.yCircle)==null?void 0:u.circle,(h=n.zCircle)==null?void 0:h.circle].filter(Boolean));const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.removeListener=()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}}get rotateCenter(){return this.helperObject3D.position.clone()}initialHelperQuaternion(){this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:n=0,y:o=0,z:s=0}=e,r=new I.Euler(Fi(n),Fi(o),Fi(s)),a=new I.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:u}=this;Ql(c,a,u),this.hooks.emit("setObjectRotate",a,u),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=n.point,r=this.getAngleHelper(o);this.setTipsAngle(0);const a=s.clone();a.y+=.2,this.setTipsPosition(a);const l=(()=>{if(o==="x")return new I.Vector3(1,0,0).applyQuaternion(this.originObject3D.quaternion);if(o==="y")return new I.Vector3(0,1,0).applyQuaternion(this.originObject3D.quaternion);if(o==="z")return new I.Vector3(0,0,1).applyQuaternion(this.originObject3D.quaternion)})(),c=new I.Plane().setFromNormalAndCoplanarPoint(l,s),h=c.projectPoint(s.clone(),new I.Vector3).clone().sub(this.rotateCenter),d=h.angleTo(r.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));this.setAngleHelperStart(o,d),this.setAngleHelperLength(o,0),this.startInfo={direction:o,startVector:h,plane:c,angleHelper:r,angle:0,objectQuaternion:this.originObject3D.quaternion.clone()},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=Po(this.camera,e,this.container);return n?(this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,direction:r,objectQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(o,new I.Vector3);if(!c)return;const u=this.rotateCenter.clone(),d=o.projectPoint(c.clone(),new I.Vector3).clone().sub(u);if(n.angleTo(d)===0)return;const f=new I.Quaternion().setFromUnitVectors(n.clone().normalize(),d.clone().normalize()),g=l.quaternion.clone().premultiply(f);if(this.hooks.emit("wantToRotate",g))return;const A=new I.Euler().setFromQuaternion(new I.Quaternion().setFromUnitVectors(n.clone().normalize().applyQuaternion(a.clone().inverse()),d.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*s.angleDirection;if(this.startInfo.angle+=A,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle(Qa(this.startInfo.angle)),u){const y=new I.Vector3().subVectors(l.position,u).applyQuaternion(f).add(u);l.position.copy(y)}l.applyQuaternion(f),this.hooks.emit("applyObjectRotate",{quaternion:f,origin:u}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=d}dragEnd(){!this.isDragging||(this.hooks.emit("setObjectRotate",this.originObject3D.quaternion,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var n,o,s;switch(e){case"x":return(n=this.helperObject3D.xCircle)==null?void 0:n.angleSector;case"y":return(o=this.helperObject3D.yCircle)==null?void 0:o.angleSector;case"z":return(s=this.helperObject3D.zCircle)==null?void 0:s.angleSector}}setAngleHelperStart(e,n){const o=this.getAngleHelper(e);if(!o){console.warn("angleHelper is undefined");return}if(o instanceof I.Mesh&&o.geometry instanceof I.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new I.CircleGeometry(s,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const s=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof I.Mesh&&r.geometry instanceof I.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new I.CircleGeometry(a,c,l,s)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var o;const n=(o=this.helperObject3D.angleTips)==null?void 0:o.element;!n||(n.innerText=`${e.toFixed(0)}\xB0`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const o=e.project(this.camera),{x:s,y:r,z:a}=o;if(a>1)return;const l=(s+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class bb extends In{constructor(...e){super(...e);m(this,"startInfo");m(this,"name","RectangleScaleController")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}onApplyOriginObjectPosition(e){this.isDragging||super.onApplyOriginObjectPosition(e)}onApplyOriginObjectScale(e){this.helperObject3D.applyHelperScaleMatrix4(e.matrix,e.origin)}getDragPlane(){const e=new I.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new V.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var s,r;(r=(s=this.helperObject3D).updatePoints)==null||r.call(s);const o=this.getDragPlane();if(!o)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:o},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=Po(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n)}scale(e){var Q,W;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:o,plane:s}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(s,new V.Vector3);if(!a||eb(a,this.camera.position))return;const l=new V.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:u}=o,h=new V.Vector3().subVectors(r[1],r[0]),d=new V.Vector3().subVectors(r[3],r[0]),f=R=>{const U=new V.Vector3(0,0,0);if(!this.startInfo)return U;const j=(R==="ew"?h:d).clone(),H=c.clone().projectOnVector(j),O=a.clone().projectOnVector(j),N=l.clone().projectOnVector(j);if(O.equals(H))return U;if(R==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const X=new V.Vector3().subVectors(O,N),ae=X.x<0&&j.x>=0,he=X.y<0&&j.y>=0,ue=X.z<0&&j.z>=0;this.startInfo.dragPointInCenterBottom=ae||he||ue}if(R==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const X=new V.Vector3().subVectors(O,N),ae=X.x<0&&j.x>=0,he=X.y<0&&j.y>=0,ue=X.z<0&&j.z>=0;this.startInfo.dragPointInCenterLeft=ae||he||ue}const G=new V.Vector3().subVectors(O,H),$=G.length();return $>.3?(console.warn("offset.length() > 0.3, skipped",$),U):G},g=f("ew"),v=f("ns"),p=()=>{const R=g;this.helperObject3D.cornerPositions.forEach((U,j)=>{var H;(H=this.startInfo)!=null&&H.dragPointInCenterLeft?(j===0||j===3)&&U.add(R):(j===1||j===2)&&U.add(R)})},A=()=>{const R=v;this.helperObject3D.cornerPositions.forEach((U,j)=>{var H;(H=this.startInfo)!=null&&H.dragPointInCenterBottom?(j===0||j===1)&&U.add(R):(j===2||j===3)&&U.add(R)})};switch(u){case"ew":p();break;case"ns":A();break;case"nesw":case"nwse":p(),A()}const y=new V.Vector3().subVectors(r[1],r[0]).length()/h.length(),w=new V.Vector3().subVectors(r[3],r[0]).length()/d.length(),k=new V.Vector3(y,w,1),P=new I.Matrix4().scale(k);n.isCSS3DObjectPlus?n.applyScaleMatrix4(P):n.scale.applyMatrix4(P),o.position.copy(a);const C=new V.Vector3().addVectors(r[0],r[2]).divideScalar(2),L=new V.Vector3().subVectors(C,l),x=new I.Matrix4().setPosition(L);n.applyMatrix4(x),(Q=this.helperObject3D.css3DInstance)==null||Q.css3DObject.applyMatrix4(x),(W=this.helperObject3D.plane)==null||W.applyMatrix4(x),this.hooks.emit("applyObjectScale",{matrix:P}),this.hooks.emit("applyObjectPosition",{matrix:x}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class yb extends bb{constructor(...e){super(...e);m(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const n=e.point,o=a=>this.dragStart(a,e),s=this.dragging.bind(this),r=this.dragEnd.bind(this);n.addEventListener("dragstart",o),n.addEventListener("drag",s),n.addEventListener("dragend",r)})}}class wb extends In{constructor(...e){super(...e);m(this,"name","BoundingBoxController")}}class Cb extends Ol{constructor(t){super(t)}}const Io="v1.0.0",no="Object3DHelperPlugin",bi=`${no}@${Io}`,Pb=()=>{console.error(`${bi} is disposed`)},Eb=()=>{console.warn(`${bi} is disabled`)},Ib=()=>{console.error(`${bi} is disabled`)};class Rl extends Pn{constructor(e){super(e);m(this,"version",Io);m(this,"name",no);m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"objectHelperMap",new Map);m(this,"css3DObjectParentMap",new Map);m(this,"css3DRender");this.five=e,this.css3DRender=new Nt(this.five.scene),console.warn("Object3DHelper: \u4F7F\u7528\u6B64\u63D2\u4EF6\uFF0C\u9700\u8981\u5728\u521D\u59CB\u5316five\u65F6\uFF0C\u8BBE\u7F6Efive\u53C2\u6570: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${no.toUpperCase()}_DEBUG__`]:this})}show(e){return _(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return _(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){if(this.state.disposed)return Pb();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Ib();const o=F({},this.state);this.state=F(F({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var f;if(!e)return console.error("Object3D is undefined");if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const o=new Ab,s=[],r=(f=this.five.getElement())==null?void 0:f.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:u=!0,boundingBoxHelper:h=!1}=n,d=new Ce.Subscribe;if(l){const g=new tb(e),v=this.getConfig(n.moveHelper),p=new un(this.five,db,e,g,v,d);o.addControllers({moveController:p.helperController}),s.push(()=>p.dispose())}if(c){const g=this.getConfig(n.rotateHelper),v=new ob(e,F({container:r},g)),p=new un(this.five,vb,e,v,g,d);o.addControllers({rotateController:p.helperController}),s.push(()=>p.dispose())}if(h){const g=new ub(e),v=new un(this.five,wb,e,g,void 0,d);o.addControllers({boundingBoxController:v.helperController})}if(u)if(e.isCSS3DObjectPlus&&r){const g=new cb(e,r,a,this.five.scene),v=new un(this.five,yb,e,g,void 0,d);o.addControllers({scaleController:v.helperController}),s.push(()=>v.dispose()),ga(this.five).then(()=>{var p,A;if(e.isCSS3DObjectPlus){const y=e;if(!y||y.mode!=="front")return;const w=(p=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?p:Aa(this.five);w&&(this.css3DObjectParentMap.set(y,y.parent),y.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(w),(A=this.css3DRender.getBehindCSS3DObjectGroup())==null||A.add(y),this.css3DRender.render(this.five.camera))}})}else{const g=new Cb(e),v=new un(this.five,Xv,e,g,void 0,d);o.addControllers({scaleController:v.helperController}),s.push(()=>v.dispose())}return this.objectHelperMap.set(e,{helper:o,disposers:s}),o.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:n,disposers:o}=this.objectHelperMap.get(e);if(!!n){if(e.isCSS3DObjectPlus){const s=e,r=this.css3DObjectParentMap.get(s);r&&r.add(s),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose(),o==null||o.forEach(s=>s==null?void 0:s())}}handleEnable(e,n=!0){e?(this.everyHelperDo(o=>o.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(o=>o.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(o=>o.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(o=>o.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.objectHelperMap.forEach(({helper:e,disposers:n})=>{e.dispose(),n==null||n.forEach(o=>o==null?void 0:o())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:n,disposers:o})=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&Eb()}getConfig(e){if(!!e&&typeof e!="boolean"&&e.enable)return e}}const kb=i=>new Rl(i),xb=`
562
+ customModelIntersection.point is ${a==null?void 0:a.point.toArray()} distanceError is ${l}`}:{value:!0,reason:""}}getRaycasterFromPanoIndex(e,n){var r;const o=(r=this.five.work.observers[n])==null?void 0:r.position;if(o===void 0)throw new Error(`getVisible(): observerPosition is ${o}`);const s=Ks(e).sub(o).normalize();return this.raycaster.set(o,s),this.raycaster}}function Fv(i){var t,e,n,o;if(!i.stickType){const s=(()=>i.pointType==="PointTag"&&i.dimensionType==="3D"?"3DPoint":i.pointType==="PlaneTag"?"Plane":"2DPoint")();i.stickType=s}if(i.contentType==="VRLink"||i.contentType==="PanoLink"||i.contentType==="Link"){const s=i;!((e=(t=s.data)==null?void 0:t.icon)!=null&&e.url)&&!((o=(n=s.style)==null?void 0:n.point)!=null&&o.url)&&(s.data.icon={url:"//vrlab-static.ljcdn.com/release/web/test.09dee741.png",steps:28})}return i}const Hv=new sc.GLTFLoader;function Gv(i){return new Promise((t,e)=>{function n(s){t(s)}function o(s){e(s)}Hv.load(i,n,void 0,o)})}const to="DnalogelPlugin-PanoTagPlugin",Wv=!1,_v=i=>`${to}--${i}`;class Tl extends Rv{constructor(e,n){super(e);m(this,"state",{enabled:!0,visible:!0});m(this,"params");m(this,"debug");m(this,"css3DRenderPlugin");m(this,"TagContainerSvelte");m(this,"temporaryState",{visible:!0});m(this,"mediaStore",co({currentMediaElement:null}));m(this,"group",new V.Group);m(this,"gltfObjectGroup",new V.Group);m(this,"isIOSWX",navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1&&navigator.userAgent.toLowerCase().indexOf("iphone")!==-1);m(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});m(this,"enabledModelTagSet",new Set);m(this,"changeTagModel",(e,n)=>_(this,null,function*(){e.data=ht.default({},e.data,n),yield this.loadModel(e),this.updateRenderAllTags()}));m(this,"disposedErrorLog",()=>{console.error(`${to} is disposed`)});m(this,"handleFiveInitAnimationEnded",()=>{const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{Fe(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags(),this.updateRenderAllTags()});m(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{!Fe(e)||(e.state.visible=this.getVisible(e))}),this.updateRenderAllTags()});m(this,"loadModel",e=>_(this,null,function*(){var l;const n=e.data.modelUrl;if(!n)return;const o=Gv(n).then(c=>Object.assign(c.scene,{customID:e.id,isTagModel:!0}));e.model={promise:o};const s=yield o;if(((l=e.model)==null?void 0:l.promise)!==o||(e.model.object=s,!this.tags.includes(e)))return;s.visible=e.state.visible,new V.Matrix4().fromArray(e.matrix).decompose(s.position,s.quaternion,s.scale),s.updateWorldMatrix(!0,!0),this.getVisibleByFloorIndex(e)||(s.visible=!1);const a=this.gltfObjectGroup.children.find(c=>c.customID===e.id);return a&&this.gltfObjectGroup.remove(a),this.gltfObjectGroup.add(s),this.updateTagCss3DObjectMatrix(e,s),s}));this.group.name="PanoTagPluginModelGroup",this.gltfObjectGroup.name="PanoTagPluginGLTFObjectGroup",this.group.add(this.gltfObjectGroup),this.params=F({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,Yr(1,{namespace:ai.GetAudioDuration}),Yr(1,{namespace:ai.PlayAudio}),Object.assign(window,{[`__PANOTAGPLUGIN_DEBUG_${Date.now()}__`]:this}),Object.assign(window,{__PANOTAGPLUGIN_DEBUG__:this}),this.state.enabled&&this.five.scene.add(this.group)}load(e,n){return _(this,null,function*(){var s,r;this.clearTags(),console.info(to," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=ht.default({},this.config,{globalConfig:(s=e.globalConfig)!=null?s:{},contentTypeConfig:(r=e.contentTypeConfig)!=null?r:{}});const o=yield this.addTag(e.tagList,n);if(this.debug)try{kp(this.five,this.tags)}catch(a){console.error(a)}return o})}addTag(e,n){return _(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r);return fe(F({},r),{state:F({visible:void 0,unfolded:Wv},a.initialState),hooks:new Ce.Subscribe,clickable:a.clickable,mergedConfig:a})}).filter(r=>r.position);return s.forEach(Fv),this.tags.push(...s),Dp(this.five).then(()=>{var r,a,l;return this.store.eventListenerDisposer&&((a=(r=this.store).eventListenerDisposer)==null||a.call(r)),this.state.enabled&&(this.store.eventListenerDisposer=this.addEventListener()),this.addResizeListener(),this.checkPanelTag(),this.setVisibleAndUnfolded({withAnimation:(l=n==null?void 0:n.withAnimation)!=null?l:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags(),this.addMediaModelTag(s)})})}changeConfig(e,n=!0){n?this.config=ht.default({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=ht.default({},this.config.globalConfig,e):this.config.globalConfig=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}clearTags(){this.tags=[],this.enabledModelTagSet.clear(),this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}show(e){return _(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("show",{userAction:n,withAnimation:o})})}hide(e){return _(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("hide",{userAction:n,withAnimation:o})})}enable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.five.scene.children.includes(this.group)||this.five.scene.add(this.group),this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n}),this.five.needsRender=!0}disable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:n}),this.five.scene.remove(this.group),this.hooks.emit("disable",{userAction:n}),this.five.needsRender=!0}dispose(){var e,n,o,s,r,a;this.pauseCurrentMedia(),this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filter3DTag().forEach(l=>{var c;return(c=l.tag3DContentSvelte)==null?void 0:c.svelteApp.$destroy()}),this.tags=[],(n=this.store.disposers)==null||n.forEach(l=>l==null?void 0:l()),this.store.disposers=[],this.store.disposed=!0,(s=(o=this.store).eventListenerDisposer)==null||s.call(o),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.gltfObjectGroup.remove(...this.gltfObjectGroup.children),this.clearCache(),this.five.needsRender=!0,this.hooks.emit("dispose")}setState(e,n){if(this.store.disposed)return this.disposedErrorLog();const{userAction:o=!0,visibleWithAnimation:s=!1}=n,r=F({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}changeUnfoldedById(e,n){var r;const o=this.getTagById(e);if(!o)return;let s=!1;if(n&&this.can("unfold",o)&&(o.state.unfolded=!0,s=!0),n&&(this.can("unfold",o)?(o.state.unfolded=!0,s=!0):console.warn(`tag ${e} cannot be unfolded`)),n||(this.can("fold",o)?(o.state.unfolded=!1,s=!0):console.warn(`tag ${e} cannot be folded`)),s){const a=this.filterPointTag();(r=this.TagContainerSvelte)==null||r.$set({tags:a})}}changeTagNormalById(e,n){const o=this.getTagById(e);!o||!o.tag3DContentSvelte||(o.tag3DContentSvelte.currentNormal=ft(n),this.updateRenderPlaneTag())}changeDataById(e,n,o=!0){const s=this.getTagById(e);!s||(o?s.data=ht.default({},s.data,n):s.data=F(F({},s.data),n),this.checkPanelTag(),this.updateRenderAllTags())}changeStickTypeById(e,n,o=!0){this.changeTagById(e,n,o)}changeTagById(e,n,o=!0){const s=this.getTagById(e);!n||(o?ht.default(s,n):Object.assign(s,n),(s==null?void 0:s.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(s.tag3DContentSvelte.currentNormal=ft(n.normal)),this.updateRenderAllTags(),this.checkPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(o=>{const s=this.tags.findIndex(r=>r.id===o);s!==-1&&this.tags.splice(s,1)}),this.updateRenderAllTags()}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}updateTagCss3DObjectMatrix(e,n){var v,p,A,y;const o=(A=(p=(v=e.mergedConfig)==null?void 0:v.tag3DConfig)==null?void 0:p.ratio)!=null?A:.00216,s=(y=e.tag3DContentSvelte)==null?void 0:y.domContainer.css3DObject;if(!s)return;const r=Fe(e)?e.data.mediaPosition:e.position;n.updateWorldMatrix(!1,!1);const a=n.matrixWorld,l=new V.Vector3().fromArray(r[0]),c=new V.Vector3().fromArray(r[2]),u=new V.Vector3().lerpVectors(l,c,.5).add(new V.Vector3(0,0,5e-4)),h=new V.Matrix4().setPosition(u),d=new V.Matrix4().makeScale(o,o,o),f=new V.Matrix4().multiply(a).multiply(h).multiply(d);f.decompose(s.position,s.quaternion,s.scale);const g=s.opacityMesh;!g||f.decompose(g.position,g.quaternion,g.scale)}updateTagCss3DObjectVisible(e){var s,r,a,l,c;const n=(s=e.tag3DContentSvelte)==null?void 0:s.domContainer.css3DObject;if(!n)return;n.visible=(a=(r=e.state)==null?void 0:r.visible)!=null?a:!0;const o=n.opacityMesh;!o||(o.visible=(c=(l=e.state)==null?void 0:l.visible)!=null?c:!0)}setVisibleAndUnfolded(){return _(this,arguments,function*({withAnimation:e}={withAnimation:!1}){if(!!this.isPanorama)return this.setVisibleByPanoIndex(),e?new Promise((n,o)=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.updateTagContainerVisible()}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.updateTagContainerVisible()}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.updateRenderAllTags()}handleDisable(){var e,n,o;this.pauseCurrentMedia(),this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),(o=this.TagContainerSvelte)==null||o.$set({tags:[]}),this.filter3DTag().forEach(s=>{var r;(r=s.tag3DContentSvelte)==null||r.svelteApp.$destroy(),s.tag3DContentSvelte=void 0})}addEventListener(){const{five:e,hooks:n}=this,o=this.handleFiveWantsMoveToPano.bind(this),s=this.handleFiveModeChange.bind(this),r=this.handleFiveCameraUpdate.bind(this),a=this.handleFiveCameraUpdateDebounce(),l=this.handleFivePanoArrived.bind(this),c=this.loadVideoFirstFrame.bind(this),u=this.clickhandler.bind(this),h=this.five.currentMode;return this.handleFiveModeChange(h),this.handleFivePanoArrived(),e.on("wantsMoveToPano",o),e.on("modeChange",s),e.on("initAnimationEnded",this.handleFiveInitAnimationEnded),e.on("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),e.on("panoArrived",c),n.on("click",u),()=>{e.off("wantsMoveToPano",o),e.off("modeChange",s),e.off("initAnimationEnded",this.handleFiveInitAnimationEnded),e.off("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),e.off("panoArrived",c),n.off("click",u),this.store.eventListenerDisposer=void 0}}loadVideoFirstFrame(){this.isIOSWX&&this.hooks.emit("loadVideoFirstFrame")}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const e=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=e,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(!this.store.disposed)return;const e=this.five.getElement(),n=()=>{!this.state.enabled||(this.show(),this.updateRenderAllTags())},o=()=>{!this.state.enabled||this.hide()},{observe:s,unobserve:r}=er(Sp(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=er($s(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.setModelMedialVisible(),this.tags.forEach(n=>{Fe(n)&&e!=="Panorama"&&this.changeTagMode(n,"behind"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags(),this.updateRenderAllTags()}handleFiveWantsMoveToPano(){this.tags.forEach(e=>{const n=this.getTagConfig(e);typeof n.visibleConfig=="object"&&(n.visibleConfig.keep?e.temporaryState=fe(F({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=fe(F({},e.temporaryState),{visible:Boolean(n.visibleConfig.alwaysShowWhenMovePano)}))}),this.updateTagContainerVisible()}temporaryShow({withAnimation:e}={withAnimation:!1}){this.store.visibleWithAnimation=e,this.temporaryState.visible=!0,this.updateTagContainerVisible()}temporaryHide({withAnimation:e}={withAnimation:!1}){this.store.visibleWithAnimation=e,this.temporaryState.visible=!1,this.updateTagContainerVisible()}clickhandler(e){if(e.target!=="TagPoint")return;if(!e.tag.state)return console.warn("Clickhandler: params.tag.state is undefined");const n=this.can("fold",e.tag),o=this.can("unfold",e.tag);n&&o&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(s=>{s.id!==e.tag.id&&s.state&&this.can("fold",s)&&(s.state.unfolded=!1)}),this.updateRenderAllTags())}updateRenderAllTags(){this.enabledModelTagSet.clear(),this.tags.forEach(e=>e.stickType==="Model"&&this.enabledModelTagSet.add(e.id)),this.updateRenderPointTag(),this.updateRenderPlaneTag(),this.updateRenderModelTag()}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filter3DTag().forEach(n=>{var o;(o=n.tag3DContentSvelte)==null||o.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}handleFiveCameraUpdateDebounce(){return $s(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return _(this,null,function*(){this.setModelMedialVisible(),yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=fe(F({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible(),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);!n.state||o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.keep)||n.state&&(n.state.unfolded=!1)})}updateRenderPointTag(){var n;const e=this.sort(this.filterPointTag());if(this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const o=(n=this.five.getElement())==null?void 0:n.parentElement;if(!o)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new Vv({target:o,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateRenderPlaneTag(){this.sort([...this.filterPlaneTag(),...this.filter3DPointTag(),...this.filterModelTag()]).forEach(n=>{var l,c,u;if(Fe(n)&&((l=n.model)==null?void 0:l.object)&&this.updateTagCss3DObjectMatrix(n,(c=n.model)==null?void 0:c.object),n.tag3DContentSvelte){const{svelteApp:h,domContainer:d,initialNormal:f,currentNormal:g}=n.tag3DContentSvelte;if(this.updateTagCss3DObjectVisible(n),h.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!f.equals(g)){const v=new V.Quaternion().setFromUnitVectors(f,g);d.css3DObject.setRotationFromQuaternion(v)}return}if(((u=n.state)==null?void 0:u.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=Zt(this.five)),n.stickType==="3DPoint"&&!n.normal)return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");const o=(()=>n.stickType==="Plane"?n.position:Fe(n)?n.data.mediaPosition:Lp(this.five.camera.position,ft(n.position),ft(n.normal)))();if(!o)return;const s=function(){if(n.normal)return ft(n.normal);if(n.stickType==="Plane")return Zi(n.position);if(n.contentType==="MediaModel")return Zi(o)}();if(!s)return;const r=this.getTagConfig(n).tag3DConfig,a=this.css3DRenderPlugin.create3DDomContainer(o,r);!a||(this.updateTagCss3DObjectVisible(n),this.store.css3DRenderDisposer.set(n.id,a.dispose),n.tag3DContentSvelte={svelteApp:new Ml({target:a.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:a,initialNormal:s,currentNormal:s})}),this.checkPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID);this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)),this.tags.filter(Fe).forEach(o=>{var s;(s=o.model)==null||s.promise.then(r=>{r.visible=o.state.visible})})}disposeAllCSS3DContainer(){for(const[e,n]of this.store.css3DRenderDisposer)n==null||n();this.store.css3DRenderDisposer=new Map}checkPanelTag(){this.filter2DPointTag().forEach(e=>{var n;(n=e.tag3DContentSvelte)==null||n.domContainer.dispose(),e.tag3DContentSvelte=void 0});for(const[e,n]of this.store.css3DRenderDisposer){const o=this.getTagById(e);(!o||o.stickType==="2DPoint")&&(n==null||n(),this.store.css3DRenderDisposer.delete(e))}}addMediaModelTag(e){return _(this,null,function*(){const n=e.filter(Fe).map(this.loadModel);yield Promise.all(n),this.setModelMedialVisible(),this.updateRenderAllTags()})}changeTagMode(e,n){var o,s,r,a,l;((r=(s=(o=e.tag3DContentSvelte)==null?void 0:o.domContainer)==null?void 0:s.css3DObject)==null?void 0:r.mode)!==n&&((a=e.config)!=null&&a.tag3DConfig?e.config.tag3DConfig.mode=n:e.config?e.config.tag3DConfig={mode:n}:e.config={tag3DConfig:{mode:n}},(l=this.store.css3DRenderDisposer.get(e.id))==null||l(),e.tag3DContentSvelte=void 0)}}var zl=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.Sticker="Sticker",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.MediaModel="MediaModel",i.Custom="Custom",i.Unknown="Unknown",i))(zl||{}),Bl=(i=>(i.Two="2D",i.Three="3D",i))(Bl||{}),jl=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(jl||{});const Nv=(i,t)=>new Tl(i,t);function be(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new I.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}be.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)};be.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];be.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}};be.prototype._objectCtxInit=function(i){i._3xDomEvent={}};be.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent};be.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent};be.prototype._objectCtxGet=function(i){return i._3xDomEvent};be.prototype.camera=function(i){return i&&(this._camera=i),this._camera};be.prototype.bind=function(i,t,e,n){console.assert(be.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)};be.prototype.addEventListener=be.prototype.bind;be.prototype.unbind=function(i,t,e,n){console.assert(be.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);this._boundObjs[t].splice(l,1)};be.prototype.removeEventListener=be.prototype.unbind;be.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1};be.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new I.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,u,h=r[0],d=h.object;this._selected=d,u=this._bound("mousemove",d),a!=d&&(l=this._bound("mouseover",d),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;u&&this._notify("mousemove",d,n,h),l&&this._notify("mouseover",d,n,h),c&&this._notify("mouseout",a,n,h)}};be.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new I.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),u=l.parent;typeof c=="undefined"&&u;)c=this._objectCtxGet(u),u=u.parent;!c||this._notify(i,l,n,a)}}};be.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),!!l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}};be.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)};be.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)};be.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)};be.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)};be.prototype._onClick=function(i){this._onMouseEvent("click",i)};be.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)};be.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)};be.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)};be.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)};be.prototype._onTouchMove=function(i){if(i.touches.length==1){i.preventDefault();var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}};be.prototype._onTouchEvent=function(i,t){if(t.touches.length==1){t.preventDefault();var e=Number(t.touches[0].pageX/window.innerWidth)*2-1,n=-(t.touches[0].pageY/window.innerHeight)*2+1;this._onEvent(i,e,n,t)}};function Vl(i){const t=new I.Box3,e=new I.Vector3;if(i.traverse(n=>{var s;if(n.name==="shadow")return;const o=n.geometry;if(o!==void 0)if((s=o==null?void 0:o.attributes)!=null&&s.position){const r=o.attributes.position;for(let a=0,l=r.count;a<l;a++)e.fromBufferAttribute(r,a).applyMatrix4(n.matrix),t.expandByPoint(e)}else o.vertices.forEach(r=>{const a=r.clone().applyMatrix4(n.matrix);t.expandByPoint(a)})}),!t.isEmpty())return t}class In{constructor(t,e){m(this,"originObject3D");m(this,"hooks");m(this,"disposers",[]);m(this,"helperObject3D");m(this,"camera");m(this,"model");m(this,"scene");m(this,"container");m(this,"domEvents");m(this,"isDragging",!1);m(this,"enabled",!1);m(this,"name","BaseController");m(this,"boundingBox");m(this,"offset");m(this,"onRender");m(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});var c,u;this.hooks=(c=t.sharedHooks)!=null?c:new Jt,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new be(t.camera,t.container),this.onRender=(u=t.onRender)!=null?u:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const n=(...h)=>this.onSetOriginObjectScale(...h),o=(...h)=>this.onSetOriginObjectRotate(...h),s=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",n),this.hooks.on("setObjectRotate",o),this.hooks.on("setObjectPosition",s),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",n),this.hooks.off("setObjectRotate",o),this.hooks.off("setObjectPosition",s),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){!this.enabled||(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,n=new I.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),o=new I.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),s=this.calculateOffset(this.offset,{min:o,max:n});this.helperObject3D.position.copy(s),this.helperObject3D.initialPosition()}}hoverListener(t,e=16777215,n=1){const o=(Array.isArray(t)?t:[t]).filter(yt),s=[];for(const r of o)if(r instanceof I.Mesh||r instanceof I.Group){const a=r instanceof I.Group?r.children.filter(d=>d instanceof I.Mesh):[r];a.forEach(d=>{d.__originalColor__=d.material.color.clone(),d.__originalOpacity__=d.material.opacity});const l=()=>{a.forEach(d=>{d.material.color.set(e),d.material.opacity=n}),this.render()},c=()=>{a.forEach(d=>{d.material.color.copy(d.__originalColor__),d.material.opacity=d.__originalOpacity__}),this.render()},u=()=>{this.isDragging||l()},h=()=>{this.isDragging||c()};for(const d of a)this.domEvents.addEventListener(d,"mouseover",u),this.domEvents.addEventListener(d,"mouseout",h),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),s.push(()=>{this.domEvents.removeEventListener(d,"mouseover",u),this.domEvents.removeEventListener(d,"mouseout",h),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>s.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;const o=this.helperObject3D.raycasterIntersectObject(t)[0];if(!o)return;const s=o;if(s.object=n,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<s.point.distanceTo(e))return}return s.object}calculateOffset(t,e){const n=this.originObject3D,o=new I.Vector3(0,0,0);if(!t)return o;const s=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=Vl(n),this.boundingBox));if(typeof t.x=="number")o.setX(t.x);else if(typeof t.x=="object"){const r=s();o.setX((r.max.x-r.min.x)*t.x.percents)}if(typeof t.y=="number")o.setY(t.y);else if(typeof t.y=="object"){const r=s();o.setY((r.max.y-r.min.y)*t.y.percents)}if(typeof t.z=="number")o.setZ(t.z);else if(typeof t.z=="object"){const r=s();o.setZ((r.max.z-r.min.z)*t.z.percents)}return o}}class Xv extends In{constructor(...e){super(...e);m(this,"name","ScaleController")}setScale(e){var l,c,u;let n=1,o=1,s=1;typeof e=="number"?(n=e,o=e,s=e):typeof e=="object"&&(n=(l=e.x)!=null?l:1,o=(c=e.y)!=null?c:1,s=(u=e.z)!=null?u:1);const r=new I.Vector3(n,o,s);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.hooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}function Ql(i,t,e){if(e){const o=new I.Vector3().subVectors(i.position,e).applyQuaternion(i.quaternion.clone().inverse()).applyQuaternion(t).add(e);i.position.copy(o)}i.quaternion.copy(t)}class Yv extends V.Object3D{constructor(){super()}add(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.add(...e)}remove(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.remove(...e)}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}}class vi extends Yv{constructor(e,n){var o;super();m(this,"originObject3D");m(this,"onRender");this.originObject3D=e,this.onRender=(o=n==null?void 0:n.onRender)!=null?o:()=>{}}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,n=[]){return e.intersectObject(this,!0,n)}initialPosition(){this.position.add(this.originObject3D.position)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}setHelperQuaternion(e,n){Ql(this,e,n)}applyHelperQuaternion(e,n){if(n){const o=new V.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(o)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class Uv extends vi{}class qv extends vi{}class Jv extends vi{}class Ol extends vi{}class Zv extends Ol{}class Kv extends I.Group{constructor(e){super();m(this,"direction");this.direction=e||"x"}}class la extends I.Mesh{constructor(e,n,o){super(e,n);m(this,"direction");this.direction=o||"x"}}function $v(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new I.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function Po(i,t,e){if(!t||!e||!i)return;const n=$v(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new I.Raycaster;return o.setFromCamera(n,i),o}function eb(i,t){return!(Math.abs(i.x-t.x)>1e-5||Math.abs(i.y-t.y)>1e-5||Math.abs(i.z-t.z)>1e-5)}class Qi extends Kv{constructor(e){var u;super(e.direction);m(this,"line");m(this,"arrow");m(this,"lineHeight",.4);m(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new I.Color((u=e.color)!=null?u:16214315),o=new I.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:I.DoubleSide}),s=new I.ConeGeometry(.04,.1,32),r=new la(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new I.CylinderGeometry(a,a,.4,32),c=new la(l,o.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const Oi={X:15618642,Y:4765519,Z:4227839};class _t{static get X(){return new I.Color(Oi.X).convertSRGBToLinear().clone()}static get Y(){return new I.Color(Oi.Y).convertSRGBToLinear().clone()}static get Z(){return new I.Color(Oi.Z).convertSRGBToLinear().clone()}}class tb extends Uv{constructor(e){super(e);m(this,"xArrow",new Qi({direction:"x",color:_t.X}));m(this,"yArrow",new Qi({direction:"y",color:_t.Y}));m(this,"zArrow",new Qi({direction:"z",color:_t.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function Lt(i,t){return nb(document.createElement(t!=null?t:"div"),i)}function nb(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function ib(i){const t=Lt(F({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class ob extends Jv{constructor(e,n){super(e);m(this,"xCircle");m(this,"yCircle");m(this,"zCircle");m(this,"children",[]);m(this,"angleTips");m(this,"container");(n==null?void 0:n.yzCircleEnable)!==!1&&(this.xCircle=new Ri({direction:"x",color:_t.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.yCircle=new Ri({direction:"y",color:_t.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.zCircle=new Ri({direction:"z",color:_t.Z})),(n==null?void 0:n.container)&&(n==null?void 0:n.angleTipsEnable)!==!1&&(this.container=n==null?void 0:n.container,this.angleTips=ib({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(n=>n.showCircle()),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.children.filter(o=>e.includes(o.direction)).forEach(o=>o.showRing()),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.removeFromParent(),(n=(e=this.angleTips)==null?void 0:e.element)==null||n.remove()}}class Ri extends I.Group{constructor(e){super();m(this,"direction");m(this,"circle");m(this,"ring");m(this,"angleSector");this.direction=e.direction,this.circle=new sb(e),this.ring=new rb(e),this.angleSector=new ab(e),this.add(this.circle,this.ring,this.angleSector),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}showCircle(){this.add(this.circle),this.remove(this.ring,this.angleSector)}showRing(){this.add(this.ring,this.angleSector),this.remove(this.circle)}hide(){this.remove(this.ring,this.angleSector,this.circle)}}class sb extends I.Mesh{constructor(e){var n;super();m(this,"direction");m(this,"gapAngle",.02);m(this,"geometry",new I.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new I.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:I.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`}}class rb extends I.Group{constructor(e){super();m(this,"direction");this.direction=e.direction;const n=.015,o=new Array(8).fill(null).map((s,r)=>{const a=new I.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new I.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:I.DoubleSide}),c=new I.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...o)}}class ab extends I.Mesh{constructor(e){var o;super();m(this,"direction");m(this,"baseAxes");m(this,"angleDirection");switch(e.direction){case"x":this.baseAxes=new I.Vector3(0,0,1);break;case"y":this.baseAxes=new I.Vector3(1,0,0);break;case"z":this.baseAxes=new I.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new I.CircleGeometry(n,48,0,1e-4),this.material=new I.MeshBasicMaterial({opacity:.4,color:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:I.DoubleSide}),this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function lb(){const i=Lt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Lt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Lt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element:dt({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:dt({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:dt({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:dt({cursor:"ew-resize",right:n})},l={direction:"nesw",element:dt({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:dt({cursor:"ns-resize",top:n})},u={direction:"nwse",element:dt({cursor:"nwse-resize",left:n,top:n})},h={direction:"ew",element:dt({cursor:"ew-resize",left:n})};return new Array(s,a,c,h,o,r,l,u).forEach(f=>t.appendChild(f.element)),{container:i,squares:[o,s,r,a,l,c,u,h]}}function dt(i){const t=Lt(F({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Lt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Lt({width:"15px",height:"15px",cursor:i==null?void 0:i.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class cb extends Zv{constructor(e,n,o,s){super(e);m(this,"points",[]);m(this,"cornerPositions",[]);m(this,"css3DInstance");m(this,"plane");m(this,"css3DRenderer",new Nt);m(this,"camera");m(this,"scene");m(this,"container");m(this,"enabled",!1);this.camera=o,this.scene=s,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(o=>o.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var o;(o=this.plane)==null||o.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,o)=>{n.position.copy(e[o])})}applyHelperQuaternion(e,n){var s;const o=(s=this.css3DInstance)==null?void 0:s.css3DObject;if(o){const r=new I.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.applyQuaternion(e)}if(this.plane){const r=new I.Vector3().subVectors(this.plane.position,n).applyQuaternion(e).add(n);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new I.Vector3().subVectors(r,n).applyQuaternion(e).add(n);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;!this.enabled||(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a,l;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const n=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!n)return;this.css3DInstance=n,n.appendToElement(this.container);const o=n.css3DObject.container,{container:s,squares:r}=lb();this.points=r.map((c,u)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[u]})),o.insertBefore(s,(a=o.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("\u5F53\u524D\u7269\u4F53\u6682\u65F6\u4E0D\u652F\u6301 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}class ub extends qv{constructor(e){super(e);m(this,"box");m(this,"outline");m(this,"originObject");m(this,"positionAttribute");this.originObject=e,this.positionAttribute=new I.BufferAttribute(new Float32Array(8*3),3),this.box=this.createBox(),this.outline=this.createOutline(),this.add(this.box,this.outline),this.update()}raycasterIntersectObject(e,n){return e.intersectObject(this,!1,n)}raycast(e,n){this.box.raycast(e,n)}update(){const e=Vl(this.originObject);if(!e)return;const{min:n,max:o}=e;this.positionAttribute.setXYZ(0,o.x,o.y,o.z),this.positionAttribute.setXYZ(1,n.x,o.y,o.z),this.positionAttribute.setXYZ(2,n.x,n.y,o.z),this.positionAttribute.setXYZ(3,o.x,n.y,o.z),this.positionAttribute.setXYZ(4,o.x,o.y,n.z),this.positionAttribute.setXYZ(5,n.x,o.y,n.z),this.positionAttribute.setXYZ(6,n.x,n.y,n.z),this.positionAttribute.setXYZ(7,o.x,n.y,n.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new I.BufferGeometry;n.setIndex(new I.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new I.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),s=new I.LineSegments(n,o);return s.matrixAutoUpdate=!1,s}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),n=new I.BufferGeometry;n.setIndex(new I.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new I.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new I.Mesh(n,o)}}class db extends In{constructor(...e){super(...e);m(this,"name","MoveController");m(this,"startInfo");m(this,"_moveByMouseEnable",!1);m(this,"mouseInfo");m(this,"mousedownEventListenerDisposer");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("rotateStart",l),this.hooks.on("rotateEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("rotateStart",l),this.hooks.off("rotateEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouseEnable}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(n=>n==null?void 0:n())}moveByMouse(){this._moveByMouseEnable=!0;const e=this.handleMouseDown.bind(this),n=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",n)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",n)}}disableMoveByMouse(){var e;this._moveByMouseEnable=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){!this.moveByMouseEnable||this.hooks.emit("wantToMove",e.point)||(this.originObject3D.position.copy(e.point),this.hooks.emit("setObjectPosition",e.point),this.hooks.emit("move",e.point))}onApplyOriginObjectScale(e){}handleMouseDown(e){const{x:n,y:o}=e;this.mouseInfo={x:n,y:o,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:n,y:o}=e;this.mouseInfo.x===n&&this.mouseInfo.y===o&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}dragStart(e){if(this._moveByMouseEnable||this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=new I.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new I.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new I.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(o){case"x":return s;case"y":return r;case"z":return a}})(),c=(()=>{switch(o){case"x":case"y":return a;case"z":return s}})(),u=n.point.clone(),h=new I.Plane;h.setFromNormalAndCoplanarPoint(c,u),this.startInfo={startVectorProject:u.clone().projectOnVector(l),directionVector:l,plane:h},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("moveStart"),this.isDragging=!0}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=Po(this.camera,e,this.container);return n?(this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:o,startVectorProject:s}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new I.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),u=new I.Matrix4;u.setPosition(c);const h=r.position.clone().applyMatrix4(u);this.hooks.emit("wantToMove",h)||(r.applyMatrix4(u),s.copy(l),this.hooks.emit("applyObjectPosition",{matrix:u}),this.hooks.emit("move",h))}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class un{constructor(t,e,n,o,s,r){m(this,"helperController");m(this,"five");m(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});m(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});m(this,"onFiveIntersectionOnModelUpdate",(...t)=>{!this.helperController||this.helperController.onIntersectionOnModelUpdate(...t)});const{camera:a,model:l,scene:c}=t,u=t.getElement();if(this.five=t,!a||!l||!u||!c)return;const h=()=>{t.needsRender=!0};this.helperController=new e({camera:a,model:l,originObject3D:n,helperObject3D:o,container:u,scene:c,onRender:h,sharedHooks:r},s),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const hb="v1.0.1",fb="Object3DHelper",Eo=`${fb}@${hb}`,mb=()=>{console.error(`${Eo} is disposed`)},pb=()=>{console.warn(`${Eo} is disabled`)},gb=()=>{console.error(`${Eo} is disabled`)};class Ab{constructor(t){m(this,"controllers",{});m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"hooks",new Jt);m(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return _(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return _(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return mb();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return gb();const n=F({},this.state);this.state=F(F({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=F(F({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose()});for(const n in this.controllers){if(!n)continue;const o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&pb()}}function Fi(i){return i*Math.PI/180}class vb extends In{constructor(...e){var c,u,h;super(...e);m(this,"name","RotateController");m(this,"startInfo");m(this,"removeListener");const n=this.helperObject3D;this.hoverListener([(c=n.xCircle)==null?void 0:c.circle,(u=n.yCircle)==null?void 0:u.circle,(h=n.zCircle)==null?void 0:h.circle].filter(Boolean));const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.removeListener=()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}}get rotateCenter(){return this.helperObject3D.position.clone()}initialHelperQuaternion(){this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:n=0,y:o=0,z:s=0}=e,r=new I.Euler(Fi(n),Fi(o),Fi(s)),a=new I.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:u}=this;Ql(c,a,u),this.hooks.emit("setObjectRotate",a,u),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=n.point,r=this.getAngleHelper(o);this.setTipsAngle(0);const a=s.clone();a.y+=.2,this.setTipsPosition(a);const l=(()=>{if(o==="x")return new I.Vector3(1,0,0).applyQuaternion(this.originObject3D.quaternion);if(o==="y")return new I.Vector3(0,1,0).applyQuaternion(this.originObject3D.quaternion);if(o==="z")return new I.Vector3(0,0,1).applyQuaternion(this.originObject3D.quaternion)})(),c=new I.Plane().setFromNormalAndCoplanarPoint(l,s),h=c.projectPoint(s.clone(),new I.Vector3).clone().sub(this.rotateCenter),d=h.angleTo(r.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));this.setAngleHelperStart(o,d),this.setAngleHelperLength(o,0),this.startInfo={direction:o,startVector:h,plane:c,angleHelper:r,angle:0,objectQuaternion:this.originObject3D.quaternion.clone()},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=Po(this.camera,e,this.container);return n?(this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,direction:r,objectQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(o,new I.Vector3);if(!c)return;const u=this.rotateCenter.clone(),d=o.projectPoint(c.clone(),new I.Vector3).clone().sub(u);if(n.angleTo(d)===0)return;const f=new I.Quaternion().setFromUnitVectors(n.clone().normalize(),d.clone().normalize()),g=l.quaternion.clone().premultiply(f);if(this.hooks.emit("wantToRotate",g))return;const A=new I.Euler().setFromQuaternion(new I.Quaternion().setFromUnitVectors(n.clone().normalize().applyQuaternion(a.clone().inverse()),d.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*s.angleDirection;if(this.startInfo.angle+=A,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle(Qa(this.startInfo.angle)),u){const y=new I.Vector3().subVectors(l.position,u).applyQuaternion(f).add(u);l.position.copy(y)}l.applyQuaternion(f),this.hooks.emit("applyObjectRotate",{quaternion:f,origin:u}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=d}dragEnd(){!this.isDragging||(this.hooks.emit("setObjectRotate",this.originObject3D.quaternion,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var n,o,s;switch(e){case"x":return(n=this.helperObject3D.xCircle)==null?void 0:n.angleSector;case"y":return(o=this.helperObject3D.yCircle)==null?void 0:o.angleSector;case"z":return(s=this.helperObject3D.zCircle)==null?void 0:s.angleSector}}setAngleHelperStart(e,n){const o=this.getAngleHelper(e);if(!o){console.warn("angleHelper is undefined");return}if(o instanceof I.Mesh&&o.geometry instanceof I.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new I.CircleGeometry(s,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const s=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof I.Mesh&&r.geometry instanceof I.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new I.CircleGeometry(a,c,l,s)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var o;const n=(o=this.helperObject3D.angleTips)==null?void 0:o.element;!n||(n.innerText=`${e.toFixed(0)}\xB0`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const o=e.project(this.camera),{x:s,y:r,z:a}=o;if(a>1)return;const l=(s+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class bb extends In{constructor(...e){super(...e);m(this,"startInfo");m(this,"name","RectangleScaleController")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}onApplyOriginObjectPosition(e){this.isDragging||super.onApplyOriginObjectPosition(e)}onApplyOriginObjectScale(e){this.helperObject3D.applyHelperScaleMatrix4(e.matrix,e.origin)}getDragPlane(){const e=new I.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new V.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var s,r;(r=(s=this.helperObject3D).updatePoints)==null||r.call(s);const o=this.getDragPlane();if(!o)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:o},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=Po(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n)}scale(e){var Q,W;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:o,plane:s}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(s,new V.Vector3);if(!a||eb(a,this.camera.position))return;const l=new V.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:u}=o,h=new V.Vector3().subVectors(r[1],r[0]),d=new V.Vector3().subVectors(r[3],r[0]),f=R=>{const U=new V.Vector3(0,0,0);if(!this.startInfo)return U;const j=(R==="ew"?h:d).clone(),H=c.clone().projectOnVector(j),O=a.clone().projectOnVector(j),N=l.clone().projectOnVector(j);if(O.equals(H))return U;if(R==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const X=new V.Vector3().subVectors(O,N),ae=X.x<0&&j.x>=0,he=X.y<0&&j.y>=0,ue=X.z<0&&j.z>=0;this.startInfo.dragPointInCenterBottom=ae||he||ue}if(R==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const X=new V.Vector3().subVectors(O,N),ae=X.x<0&&j.x>=0,he=X.y<0&&j.y>=0,ue=X.z<0&&j.z>=0;this.startInfo.dragPointInCenterLeft=ae||he||ue}const G=new V.Vector3().subVectors(O,H),$=G.length();return $>.3?(console.warn("offset.length() > 0.3, skipped",$),U):G},g=f("ew"),v=f("ns"),p=()=>{const R=g;this.helperObject3D.cornerPositions.forEach((U,j)=>{var H;(H=this.startInfo)!=null&&H.dragPointInCenterLeft?(j===0||j===3)&&U.add(R):(j===1||j===2)&&U.add(R)})},A=()=>{const R=v;this.helperObject3D.cornerPositions.forEach((U,j)=>{var H;(H=this.startInfo)!=null&&H.dragPointInCenterBottom?(j===0||j===1)&&U.add(R):(j===2||j===3)&&U.add(R)})};switch(u){case"ew":p();break;case"ns":A();break;case"nesw":case"nwse":p(),A()}const y=new V.Vector3().subVectors(r[1],r[0]).length()/h.length(),w=new V.Vector3().subVectors(r[3],r[0]).length()/d.length(),k=new V.Vector3(y,w,1),P=new I.Matrix4().scale(k);n.isCSS3DObjectPlus?n.applyScaleMatrix4(P):n.scale.applyMatrix4(P),o.position.copy(a);const C=new V.Vector3().addVectors(r[0],r[2]).divideScalar(2),L=new V.Vector3().subVectors(C,l),x=new I.Matrix4().setPosition(L);n.applyMatrix4(x),(Q=this.helperObject3D.css3DInstance)==null||Q.css3DObject.applyMatrix4(x),(W=this.helperObject3D.plane)==null||W.applyMatrix4(x),this.hooks.emit("applyObjectScale",{matrix:P}),this.hooks.emit("applyObjectPosition",{matrix:x}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class yb extends bb{constructor(...e){super(...e);m(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const n=e.point,o=a=>this.dragStart(a,e),s=this.dragging.bind(this),r=this.dragEnd.bind(this);n.addEventListener("dragstart",o),n.addEventListener("drag",s),n.addEventListener("dragend",r)})}}class wb extends In{constructor(...e){super(...e);m(this,"name","BoundingBoxController")}}class Cb extends Ol{constructor(t){super(t)}}const Io="v1.0.0",no="Object3DHelperPlugin",bi=`${no}@${Io}`,Pb=()=>{console.error(`${bi} is disposed`)},Eb=()=>{console.warn(`${bi} is disabled`)},Ib=()=>{console.error(`${bi} is disabled`)};class Rl extends Pn{constructor(e){super(e);m(this,"version",Io);m(this,"name",no);m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"objectHelperMap",new Map);m(this,"css3DObjectParentMap",new Map);m(this,"css3DRender");this.five=e,this.css3DRender=new Nt(this.five.scene),console.warn("Object3DHelper: \u4F7F\u7528\u6B64\u63D2\u4EF6\uFF0C\u9700\u8981\u5728\u521D\u59CB\u5316five\u65F6\uFF0C\u8BBE\u7F6Efive\u53C2\u6570: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${no.toUpperCase()}_DEBUG__`]:this})}show(e){return _(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return _(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){if(this.state.disposed)return Pb();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Ib();const o=F({},this.state);this.state=F(F({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var f;if(!e)return console.error("Object3D is undefined");if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const o=new Ab,s=[],r=(f=this.five.getElement())==null?void 0:f.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:u=!0,boundingBoxHelper:h=!1}=n,d=new Ce.Subscribe;if(l){const g=new tb(e),v=this.getConfig(n.moveHelper),p=new un(this.five,db,e,g,v,d);o.addControllers({moveController:p.helperController}),s.push(()=>p.dispose())}if(c){const g=this.getConfig(n.rotateHelper),v=new ob(e,F({container:r},g)),p=new un(this.five,vb,e,v,g,d);o.addControllers({rotateController:p.helperController}),s.push(()=>p.dispose())}if(h){const g=new ub(e),v=new un(this.five,wb,e,g,void 0,d);o.addControllers({boundingBoxController:v.helperController})}if(u)if(e.isCSS3DObjectPlus&&r){const g=new cb(e,r,a,this.five.scene),v=new un(this.five,yb,e,g,void 0,d);o.addControllers({scaleController:v.helperController}),s.push(()=>v.dispose()),ga(this.five).then(()=>{var p,A;if(e.isCSS3DObjectPlus){const y=e;if(!y||y.mode!=="front")return;const w=(p=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?p:Aa(this.five);w&&(this.css3DObjectParentMap.set(y,y.parent),y.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(w),(A=this.css3DRender.getBehindCSS3DObjectGroup())==null||A.add(y),this.css3DRender.render(this.five.camera))}})}else{const g=new Cb(e),v=new un(this.five,Xv,e,g,void 0,d);o.addControllers({scaleController:v.helperController}),s.push(()=>v.dispose())}return this.objectHelperMap.set(e,{helper:o,disposers:s}),o.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:n,disposers:o}=this.objectHelperMap.get(e);if(!!n){if(e.isCSS3DObjectPlus){const s=e,r=this.css3DObjectParentMap.get(s);r&&r.add(s),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose(),o==null||o.forEach(s=>s==null?void 0:s())}}handleEnable(e,n=!0){e?(this.everyHelperDo(o=>o.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(o=>o.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(o=>o.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(o=>o.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.objectHelperMap.forEach(({helper:e,disposers:n})=>{e.dispose(),n==null||n.forEach(o=>o==null?void 0:o())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:n,disposers:o})=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&Eb()}getConfig(e){if(!!e&&typeof e!="boolean"&&e.enable)return e}}const kb=i=>new Rl(i),xb=`
563
563
  varying vec2 vUv;
564
564
  void main() {
565
565
  vUv = uv;