@realsee/dnalogel 2.3.5 → 2.3.6-alpha.0

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 (212) hide show
  1. package/dist/CruisePlugin/typing.d.ts +4 -0
  2. package/dist/index.cjs.js +1 -1
  3. package/dist/index.js +19 -16
  4. package/dist/index.umd.js +1 -1
  5. package/docs/classes/CSS3DRender.html +31 -31
  6. package/docs/classes/CruisePluginController.html +26 -26
  7. package/docs/classes/Magnifier.html +16 -16
  8. package/docs/classes/ModelRoomLabelController.html +11 -11
  9. package/docs/classes/Object3DHelperController.html +24 -24
  10. package/docs/classes/PaintBrush.html +15 -15
  11. package/docs/classes/PanoTagPluginController.html +39 -39
  12. package/docs/classes/Util.BetterTween.html +8 -8
  13. package/docs/classes/Util.FivePointSelector.html +12 -12
  14. package/docs/classes/Util.Interval.html +12 -12
  15. package/docs/classes/Util.Magnifier.html +17 -17
  16. package/docs/classes/Util.PointDomHelper.html +11 -11
  17. package/docs/classes/Util.PointHelper.html +11 -11
  18. package/docs/classes/Util.Rectangle.html +13 -13
  19. package/docs/enums/CameraMovementEffect.html +7 -7
  20. package/docs/enums/ContentType.html +12 -12
  21. package/docs/enums/DIRECTION.html +9 -9
  22. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
  23. package/docs/enums/DimensionType.html +7 -7
  24. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
  25. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
  26. package/docs/enums/LinkType.html +7 -7
  27. package/docs/enums/PaintBrushTypeEnum.html +8 -8
  28. package/docs/enums/PointType.html +7 -7
  29. package/docs/enums/Rotation.html +8 -8
  30. package/docs/functions/CSS3DRenderPlugin.html +4 -4
  31. package/docs/functions/CameraMovementPlugin.html +4 -4
  32. package/docs/functions/CruisePlugin.html +4 -4
  33. package/docs/functions/GuideLinePlugin.html +5 -5
  34. package/docs/functions/ItemLabelPlugin.html +4 -4
  35. package/docs/functions/MapviewFloorplanPlugin.html +4 -4
  36. package/docs/functions/ModelChassisCompassPlugin.html +4 -4
  37. package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
  38. package/docs/functions/ModelFloorplanPlugin.html +4 -4
  39. package/docs/functions/ModelItemLabelPlugin.html +4 -4
  40. package/docs/functions/ModelRoomLabelPlugin.html +4 -4
  41. package/docs/functions/ModelTVVideoPlugin.html +4 -4
  42. package/docs/functions/ModelViewPlugin.html +4 -4
  43. package/docs/functions/Object3DHelperPlugin.html +4 -4
  44. package/docs/functions/PanoCompassPlugin.html +4 -4
  45. package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
  46. package/docs/functions/PanoDoorLabelPlugin.html +4 -4
  47. package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
  48. package/docs/functions/PanoMeasurePlugin.html +4 -4
  49. package/docs/functions/PanoRulerPlugin.html +4 -4
  50. package/docs/functions/PanoRulerProPlugin.html +4 -4
  51. package/docs/functions/PanoSpatialTagPlugin.html +4 -4
  52. package/docs/functions/PanoTagPlugin.html +4 -4
  53. package/docs/functions/TopviewFloorplanPlugin.html +4 -4
  54. package/docs/functions/Util.getCoordsFromClient.html +5 -5
  55. package/docs/functions/Util.getCoordsFromElement.html +5 -5
  56. package/docs/functions/Util.getFrameTime.html +5 -5
  57. package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
  58. package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
  59. package/docs/functions/Util.isNil.html +5 -5
  60. package/docs/functions/Util.nextFrame.html +5 -5
  61. package/docs/functions/Util.notNil.html +5 -5
  62. package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
  63. package/docs/functions/Util.tweenProgress.html +5 -5
  64. package/docs/functions/pluginFlag.html +5 -5
  65. package/docs/index.html +4 -4
  66. package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
  67. package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
  68. package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
  69. package/docs/interfaces/ContentTypeMap.html +12 -12
  70. package/docs/interfaces/FloorplanBounding.html +8 -8
  71. package/docs/interfaces/FloorplanData.html +10 -10
  72. package/docs/interfaces/FloorplanEntrance.html +11 -11
  73. package/docs/interfaces/FloorplanExtraObject.html +10 -10
  74. package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
  75. package/docs/interfaces/FloorplanFloorData.html +9 -9
  76. package/docs/interfaces/FloorplanImagePosition.html +7 -7
  77. package/docs/interfaces/FloorplanObserver.html +9 -9
  78. package/docs/interfaces/FloorplanOutlineItem.html +9 -9
  79. package/docs/interfaces/FloorplanPosition.html +7 -7
  80. package/docs/interfaces/FloorplanRoomItem.html +13 -13
  81. package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
  82. package/docs/interfaces/FloorplanServerBounding.html +8 -8
  83. package/docs/interfaces/FloorplanServerComputedData.html +10 -10
  84. package/docs/interfaces/FloorplanServerData.html +7 -7
  85. package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
  86. package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
  87. package/docs/interfaces/FloorplanServerEntrance.html +11 -11
  88. package/docs/interfaces/FloorplanServerFloorData.html +9 -9
  89. package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
  90. package/docs/interfaces/FloorplanServerObserver.html +9 -9
  91. package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
  92. package/docs/interfaces/FloorplanServerPosition.html +7 -7
  93. package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
  94. package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
  95. package/docs/interfaces/ItemLabelPluginData.html +6 -6
  96. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
  97. package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
  98. package/docs/interfaces/LineJson.html +7 -7
  99. package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
  100. package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
  101. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
  102. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
  103. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
  104. package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
  105. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
  106. package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
  107. package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
  108. package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
  109. package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
  110. package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
  111. package/docs/interfaces/ModelViewPluginExportType.html +11 -11
  112. package/docs/interfaces/Object3DHelperState.html +8 -8
  113. package/docs/interfaces/OpenParameter.html +7 -7
  114. package/docs/interfaces/PaintBrushAction.html +12 -12
  115. package/docs/interfaces/PaintBrushConfigs.html +12 -12
  116. package/docs/interfaces/PaintBrushState.html +10 -10
  117. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
  118. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +5 -5
  119. package/docs/interfaces/PanoMeasureParameterType.html +11 -11
  120. package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
  121. package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
  122. package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
  123. package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
  124. package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
  125. package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
  126. package/docs/interfaces/PanoRulerProPluginState.html +8 -8
  127. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +5 -5
  128. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +5 -5
  129. package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
  130. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
  131. package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
  132. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
  133. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
  134. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
  135. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
  136. package/docs/interfaces/Point.html +8 -8
  137. package/docs/interfaces/PointJson.html +8 -8
  138. package/docs/interfaces/Room.html +9 -9
  139. package/docs/interfaces/RoomInfo.html +7 -7
  140. package/docs/interfaces/RoomLabel.html +14 -14
  141. package/docs/interfaces/RoomRules.html +5 -5
  142. package/docs/interfaces/Rooms.html +5 -5
  143. package/docs/interfaces/Scissor.html +9 -9
  144. package/docs/interfaces/TagConfig.html +10 -10
  145. package/docs/interfaces/Tags.html +9 -9
  146. package/docs/interfaces/Util.MagnifierParameter.html +11 -11
  147. package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
  148. package/docs/modules/Util.html +5 -5
  149. package/docs/modules.html +4 -4
  150. package/docs/types/ArrayPosition.html +5 -5
  151. package/docs/types/CSS3DRenderExportType.html +5 -5
  152. package/docs/types/CSS3DRenderPluginExportType.html +5 -5
  153. package/docs/types/CSS3DRenderPluginParameterType.html +5 -5
  154. package/docs/types/Color.html +5 -5
  155. package/docs/types/ContentTypeConfigKey.html +5 -5
  156. package/docs/types/ContentTypeConfigKeyArray.html +5 -5
  157. package/docs/types/Create3DDomContainerReturnType.html +5 -5
  158. package/docs/types/Create3DElementReturnType.html +5 -5
  159. package/docs/types/CruisePluginExportType.html +5 -5
  160. package/docs/types/Direction-1.html +5 -5
  161. package/docs/types/Direction4.html +5 -5
  162. package/docs/types/FloorplanRuleLabels.html +5 -5
  163. package/docs/types/FloorplanServerRuleLabels.html +5 -5
  164. package/docs/types/GuideLinePluginExportType.html +5 -5
  165. package/docs/types/HelperEventMap.html +5 -5
  166. package/docs/types/MapviewFloorplanPluginParameterType.html +5 -5
  167. package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
  168. package/docs/types/MediaData.html +5 -5
  169. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +5 -5
  170. package/docs/types/ModelFloorplanPluginParameterType.html +5 -5
  171. package/docs/types/ModelFloorplanPluginReturnType.html +5 -5
  172. package/docs/types/ModelRoomLabelPluginParameters.html +5 -5
  173. package/docs/types/ModelRoomLabelPluginReturnType.html +5 -5
  174. package/docs/types/MoveArgs.html +5 -5
  175. package/docs/types/MoveOpts.html +5 -5
  176. package/docs/types/Object3DHelperEventMap.html +5 -5
  177. package/docs/types/ObjectFit.html +5 -5
  178. package/docs/types/PaintBrushEventMap.html +5 -5
  179. package/docs/types/PanoCompassPluginData.html +5 -5
  180. package/docs/types/PanoCompassPluginExportType.html +5 -5
  181. package/docs/types/PanoCompassPluginParameterType.html +5 -5
  182. package/docs/types/PanoFloorplanRadarPluginParameterType.html +5 -5
  183. package/docs/types/PanoFloorplanRadarPluginReturnType.html +5 -5
  184. package/docs/types/PanoMeasurePluginEvent.html +5 -5
  185. package/docs/types/PanoMeasureReturnType.html +5 -5
  186. package/docs/types/PanoSpatialTagPluginId.html +5 -5
  187. package/docs/types/PanoTagPluginExportInterface.html +5 -5
  188. package/docs/types/PanoTagPluginParamsInterface.html +5 -5
  189. package/docs/types/PlaneTag.html +5 -5
  190. package/docs/types/PointTag.html +5 -5
  191. package/docs/types/Position.html +5 -5
  192. package/docs/types/RotateArgs.html +5 -5
  193. package/docs/types/RotateOpts.html +5 -5
  194. package/docs/types/RuleLabelsKey.html +5 -5
  195. package/docs/types/RuleLabelsValue.html +5 -5
  196. package/docs/types/Tag.html +5 -5
  197. package/docs/types/Tag2D.html +5 -5
  198. package/docs/types/Tag3D.html +5 -5
  199. package/docs/types/TagId.html +5 -5
  200. package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
  201. package/docs/types/TopviewFloorplanPluginReturnType.html +5 -5
  202. package/docs/variables/FLOOR_TYPE_MAP.html +5 -5
  203. package/docs/variables/PLUGIN.html +5 -5
  204. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +5 -5
  205. package/docs/variables/ROOM_TYPE_MAP.html +5 -5
  206. package/docs/variables/VERSION.html +5 -5
  207. package/docs/variables/itemLabelPluginServerParams.html +5 -5
  208. package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
  209. package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
  210. package/libs/CruisePlugin/Controller.js +146 -143
  211. package/libs/CruisePlugin/typing.d.ts +4 -0
  212. package/package.json +1 -1
@@ -45,6 +45,8 @@ export interface PluginServerData extends BasePluginWithData.ServerData {
45
45
  /** for ts check, no care */
46
46
  moveToFirstPanoEffect?: undefined;
47
47
  /** for ts check, no care */
48
+ moveToFirstPanoDuration?: undefined;
49
+ /** for ts check, no care */
48
50
  stay?: undefined;
49
51
  } | {
50
52
  /** 点位列表 */
@@ -53,6 +55,8 @@ export interface PluginServerData extends BasePluginWithData.ServerData {
53
55
  moveEffect?: MoveEffect;
54
56
  /** 到第一个点的走点动画 / 续播到暂停处的走点动画 */
55
57
  moveToFirstPanoEffect?: MoveEffect;
58
+ /** 到第一个点的走点时长 / 续播到暂停处的走点时长 */
59
+ moveToFirstPanoDuration?: number;
56
60
  /** 漫游方式:justMove 为移动到指定点位,且朝向为下一个点的朝向;moveAndRotate 为先移动到指定点位且朝向不变,然后旋转到下一个点的朝向 */
57
61
  moveType?: 'justMove' | 'moveAndRotate';
58
62
  /** 停留时长 */
package/dist/index.cjs.js CHANGED
@@ -527,7 +527,7 @@ void main() {
527
527
  width: 100%;
528
528
  height: 100%;
529
529
  z-index: 5;
530
- `,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=$f(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var A;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Kf({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=A=>{if(A!==be.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,s()})};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},nm={name:"ItemLabelPlugin",version:0};class im extends ai{constructor(e){super(e);f(this,"state");f(this,"container");f(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(he(N({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(he(N({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(he(N({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(he(N({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=N({},this.state);this.state=N(N(N({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===be.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(he(N({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function om(i){ae(i,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function sm(i){let t,e,n,o,s,r,a,l;return{c(){t=j("div"),e=j("div"),n=j("span"),n.textContent=`${i[8]}`,o=_(),s=j("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=je(_e.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),b(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),b(e,"data-camera-toward",i[7]),b(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),b(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,u){B(c,t,u),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=Pe(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=je(_e.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:te,o:te,d(c){c&&M(t),i[10](null),a=!1,l()}}}function rm(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:h,name:d}=n,p=0;const m=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,w=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=w/2||a>=100-w/2)return;u!==p&&(console.log("panoDoorLabelPlugin",u,"\u89E6\u53D1\u57CB\u70B9"),p=u)},g=v=>{o&&o()};function A(v){Me[v?"unshift":"push"](()=>{s=v,e(2,s)})}return i.$$set=v=>{"props"in v&&e(0,n=v.props),"onClick"in v&&e(1,o=v.onClick)},m(),[n,o,s,r,a,l,c,h,d,g,A]}class am extends oe{constructor(t){super(),ie(this,t,rm,sm,ne,{props:0,onClick:1},om)}}function lm(i,t){const e=Math.abs(i.top+i.height/2-t.top-t.height/2),n=Math.abs(i.left+i.width/2-t.left-t.width/2),o=(i.height+t.height)/2,s=(i.width+t.width)/2;return!(e>o&&n>s)}function cm(i){const{camera:t}=i,e=t.getWorldDirection(new F.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,o="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?o="right":n>45&&n<=135?o="back":n>135&&n<=225?o="left":n>225&&n<=315&&(o="forward"),o}function um(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function dm(i){const t=Math.PI/4;return i>-t&&i<=t?"left":i>t*3||i<=-t*3?"right":i>-t*3&&i<=-t?"forward":i>t&&i<=t*3?"back":""}const hm={userAction:!0};class fm extends im{constructor(e){super(e);f(this,"MinVisibledistance",1.8);f(this,"MaxVisibledistance",5);f(this,"OffsetHeight",-1.3);f(this,"rooms");f(this,"floorplanServerData");f(this,"doorLabelItems");f(this,"visibleLabelMap",new Map);f(this,"labelItems",[]);f(this,"doorLabels");f(this,"roomObservers");f(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});f(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,u=e==null?void 0:e.find(h=>h.floor_index===c);if(u){const h=u.rooms.find(d=>d.observer_indexs.includes(l));if(h)return{panoIndex:l,floorIndex:c,name:h.name}}}).filter(Boolean);this.roomObservers=o});f(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});f(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const u=l.position.clone(),h=u.distanceTo(s);if(h<this.MinVisibledistance||h>this.MaxVisibledistance)return;const d=new F.Raycaster,p=u.clone().sub(s).normalize();d.set(s,p);const[m]=this.five.model.intersectRaycaster(d);m&&m.distance+.1<h||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});f(this,"fixDoorPosition",()=>{var u,h,d,p,m,g,A,v,w,y,x,L;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const o=this.five.getElement(),s=o.clientWidth,r=o.clientHeight,a=n.getWorldDirection(new F.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,S)=>{if(C.visible){const k=n.position.distanceTo(C.position),G=C.position.clone().add(new F.Vector3(0,this.OffsetHeight,0)),W=G.clone().sub(n.position).normalize().angleTo(a),U=G.clone().project(n),P=(U.x+1)/2.2*100,I=(-U.y+1)/2.2*100,z=P>=0&&P<=100&&I>=0&&I<=100&&k>this.MinVisibledistance&&k<=this.MaxVisibledistance;C.left=P,C.top=I,C.inSight=z&&W<Math.PI/2,C.cameraToward=cm(this.five),z?l.push({disFromCameraToLabel:k,left:P,top:I,index:S}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((S,k)=>k.disFromCameraToLabel-S.disFromCameraToLabel);for(let S=1;S<l.length;S++){const{index:k,left:G,top:O}=l[S-1],{index:W,left:U,top:P}=l[S],I=this.container.children[k],z=this.container.children[W];if(!I||!z)return;const H={left:s*G/100,top:r*O/100,width:(d=(h=(u=I.children)==null?void 0:u[0])==null?void 0:h.clientWidth)!=null?d:0,height:(g=(m=(p=I.children)==null?void 0:p[0])==null?void 0:m.clientHeight)!=null?g:0},X={left:s*U/100,top:r*P/100,width:(w=(v=(A=z.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?w:0,height:(L=(x=(y=z.children)==null?void 0:y[0])==null?void 0:x.clientHeight)!=null?L:0};lm(H,X)&&(C++,c[k].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[W].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,h=n.distanceTo(u);h<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const u=new F.Vector3(0,0,-1),h=r.clone(),d=new F.Quaternion;d.setFromUnitVectors(u,h);const p=new F.Euler;p.setFromQuaternion(d,"YXZ"),l.longitude=p.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});f(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,h)=>!!r.observer_indexs.find(d=>d===h));a&&a.forEach(u=>{const h=u.position;let d=1/0,p;l.forEach(g=>{const A=g.standingPosition,v={x:A.x,y:A.y,z:A.z},w=um(h,v);w<d&&(d=w,p=v)}),p&&(h.y=p.y+.01);const m=new F.Vector3(h.x,h.y,h.z);m.add(new F.Vector3(-.2,1.8,0).applyEuler(new F.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:m,toward:dm(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>he(N({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:hm.userAction};this.hooks.emit("stateChange",o)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new am({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this&&this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const mm=i=>new fm(i),pm=2,gm=3,Am=3,vm=2;function bm(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new E.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),h=[];let d=0;const p=i;return p.forEach((m,g)=>{let A=0,v=99999999;u.forEach((C,S)=>{const k=C.distanceTo(m);k<v&&(A=S,v=k)});const w=u[A+1],y=w==null?void 0:w.distanceTo(m),x=u[A-1],L=x==null?void 0:x.distanceTo(m);if(A>d&&A-d>1){let C=A;x!==void 0&&L>.8&&(C=A+1),x!==void 0&&L>.2&&L<.3?C=A:v>.2&&v<.3&&(C=A+1);let S=d;if(w!==void 0&&y>.2&&y<.3?S=d+1:v>.2&&v<.3&&(S=d),u[S]&&u[S+1]){const O=p[g-1];if(O)if(O.equals(u[S]))S+=1;else{const W=new F.Vector3().subVectors(u[S+1],u[S]),U=new F.Vector3().subVectors(O,u[S]);W.angleTo(U)<Math.PI/2&&(S+=1)}}if(C<S||C-S<=1)return;const k=u.slice(S,C),G=Ms(k,e,n);h.push(G),d=A}}),h}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[Ms(u,e,n)]}}function Ms(i,t,e){const n=t/2,o=e/t,s=i.length,r=bl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*pm*gm,c=2*s,u=c*Am,h=c*vm,d=new Uint32Array(l),p=new Float32Array(u),m=new Float32Array(h);i.forEach((v,w)=>{});let g=0;for(let v=0;v<i.length;v++){const[w,y]=r[v][0],x=i[v],{x:L,y:C,z:S}=x,k=new F.Vector3(L+w*n,C+.05,S+y*n);p[v*6+0]=k.x,p[v*6+1]=k.y,p[v*6+2]=k.z;const G=new F.Vector3(L-w*n,C+.05,S-y*n);p[v*6+3]=G.x,p[v*6+4]=G.y,p[v*6+5]=G.z,g+=v>0?i[v-1].clone().sub(i[v]).length():0;const O=g/t/o;m[v*4+0]=0,m[v*4+1]=O,m[v*4+2]=1,m[v*4+3]=O,v!==i.length-1&&(d[v*6+0]=v*2+0,d[v*6+1]=v*2+2,d[v*6+2]=v*2+1,d[v*6+3]=v*2+2,d[v*6+4]=v*2+3,d[v*6+5]=v*2+1)}const A=new E.BufferGeometry;return A.setAttribute("position",new E.BufferAttribute(p,3)),A.setAttribute("uv",new E.BufferAttribute(m,2)),A.setIndex(new E.BufferAttribute(d,1)),A}function ym(i){const t=new E.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=E.RepeatWrapping,t.encoding=E.sRGBEncoding,new E.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function wm(i){return!Bt(i)}function Bt(i){return i!=null}const Qa="v1.0.1",Ra="GuideLinePlugin",Fi=`${Ra}@${Qa}`,Ts=i=>`${Fi}--${i}`;class Oa extends Ht{constructor(e,n){super(e,n);f(this,"state",{visible:!1,enabled:!0,disposed:!1});f(this,"data");f(this,"linesGroup");f(this,"disposedErrorLog",()=>{console.error(`${Fi} is disposed`)});f(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Ra}_DEBUG__`]:this})}load(e,n,o=!0){return J(this,null,function*(){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.log(`${Fi} loaded`,r))})}formatData(e){return J(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(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){var s;if(this.state.disposed)return this.disposedErrorLog();const o=N({},this.state);this.state=N(N({},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,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),qe(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e){const n=e.map(this.getLine.bind(this)).filter(Bt),o=new E.Group;if(o.name=Ts("route-group"),n.length!==0)return o.add(...n),o}getLine(e){var a,l,c,u;const n=new E.Group,o=e.panoIndexList.map(h=>{var d;return(d=this.five.work.observers[h])==null?void 0:d.standingPosition}).filter(Bt),s=bm(o,{skipPanoIndexMesh:(a=e.skipPanoIndexMesh)!=null?a:!0,unitWidth:(l=e.unitWidth)!=null?l:.6,unitHeight:(c=e.unitHeight)!=null?c:.4});if(!s)return;const r=ym({textureUrl:(u=e.arrowTextureUrl)!=null?u:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return s.forEach(h=>{const d=new E.Mesh(h,r);d.name=Ts("route-line-mesh"),n.add(d)}),n}waitFiveModelLoaded(){return J(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}f(Oa,"lasestVersion",Qa);const Ha=(i,t)=>new Oa(i,t);function Bs(i){const t=Math.abs(Math.cos(i.latitude));return new E.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Cm(i,t){const e=Bs(i),n=Bs(t);return e.angleTo(n)}const Em=i=>J(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),zn=Math.PI*2;function Pm(i){return i>=0&&i<zn?i:(i%zn+zn)%zn}function Im(i){return{longitude:Pm(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function xm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function km(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Fa="v1.0.6",Ga="CruisePlugin",di=`${Ga}@${Fa}`,js=()=>{console.error(`${di} is disposed`)},Dm=()=>{console.warn(`${di} is disabled`)},Lm=()=>{console.error(`${di} is disabled`)},Pi=new Map;class lo extends Ht{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Ga}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return J(this,null,function*(){var u,h,d,p,m;if(this.state.disposed)return js();this.privateState.fiveOriginGetProgress||(h=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(p=(d=this.five.controller)==null?void 0:d.cameraMotion)==null?void 0:p.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(g=>g.data.panoIndex!==void 0);c.filter((g,A)=>{var v;return g.data.panoIndex!==((v=c[A-1])==null?void 0:v.data.panoIndex)}).map(g=>g.data.panoIndex).forEach(g=>{var v,w;const A=(v=this.five.work.observers[g])==null?void 0:v.floorIndex;if(A!==void 0)if(l===A){const y=a.length-1;a[y]=[...(w=a[y])!=null?w:[],g]}else{l=A;const y=a.length;a[y]=[g]}}),this.GuideLine||(this.GuideLine=Ha(this.five,this.config)),(m=this.GuideLine)==null||m.load({routes:a.map(g=>({panoIndexList:g}))}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.log(`${di} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:o,userAction:s}=e;this.state.playing&&this.setState({playing:!1},{userAction:s}),this.setState({playing:!0},{userAction:s,playFromIndex:n,playFromId:o})}playFromStart(e){return this.playFrom(he(N({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(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){var s;if(this.state.disposed)return js();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Lm();const o=N({},this.state);this.state=N(N({},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,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),qe(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return J(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:He(),keyframes:o.keyframes.map((s,r)=>{var c;const a=o.keyframes[r+1],l=(()=>!a||a.start===void 0||s.end===void 0?0:a.start-s.end)();return N({id:(c=s.uuid)!=null?c:He(),moveIndex:r,stay:l,index:r},s)})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a}=o;return this.privateState.moveToFirstPanoEffect=a,o.panoIndexList.forEach((l,c)=>{const u=(()=>{var g,A,v,w;const h=o.panoIndexList.slice(c).find(y=>y!==l);if(h===void 0)return;const d=(g=n[l])==null?void 0:g.position,p=(A=n[h])==null?void 0:A.position;if(!p||!d||((v=n[l])==null?void 0:v.floorIndex)!==((w=n[h])==null?void 0:w.floorIndex))return;const m=new E.Vector3().subVectors(p,d);return Im(m)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:c,stay:o.stay,data:N({effect:"Move",panoIndex:l,moveEffect:r},u!=null?u:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r}}),u&&s.push({moveIndex:c,stay:o.stay,data:N({effect:"Rotate",panoIndex:l},u)}))}),{keyframesId:He(),keyframes:s.map((l,c)=>N({id:He(),index:c},l))}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return J(this,null,function*(){var p;const{data:n,state:o,privateState:s,hooks:r}=this;if(s.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=He();s.playId=a,s.playing=!0,s.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(p=e==null?void 0:e.userAction)!=null?p:!0});let u=!1;const d=yield(()=>J(this,null,function*(){var m,g;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(m=this.data)==null?void 0:m.keyframes.findIndex(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(g=this.data)==null?void 0:g.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:v}),u=!0,A.index+1}}}}))();this.clearPauseData();for(const m of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(d!==void 0&&m.index<d))try{r.emit("playIndexChange",m.index,m),yield this.playKeyframe(m,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:800}),m.stay&&(yield km(m.stay)),u===!1&&(u=!0)}catch(g){return Promise.resolve("broke")}}o.playing&&a===s.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:o,hooks:s}=this;n.playing=!1,o.playing!==!1&&(o.playing=!1,this.setPauseData(),o.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&s.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return J(this,null,function*(){var s;const{privateState:o}=this;return((s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),o.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},o=e;return this.five.once("gesture",o),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",o),this.five.once("wantsChangeMode",n)}}getPlayPromise(e,n){return J(this,null,function*(){var s;const o=e.data;if((s=n==null?void 0:n.duration)!=null||e.start!==void 0&&e.end!==void 0&&e.end-e.start,!!o)return new Promise((r,a)=>{let l=!1;this.addInterruptListener(()=>{if(!l)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),l=!0,a(new Error("play is interupted"))});try{if(l)return;const c=()=>{r(),l=!0};switch(o.effect){case"Move":this.move(o,n).then(c);break;case"Rotate":this.rotate(o,n).then(c);break;default:this.rotate(o,n).then(c)}}catch(c){}})})}actionPromiseQueue(){return J(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return J(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,n);else return Promise.resolve()})}rotate(e,n){return J(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n==null?void 0:n.duration)})}updateCamera(e,n=800){return J(this,null,function*(){const{five:o,privateState:s,state:r}=this;let a=n;const l=(()=>{var d,p;const u=(d=r.config)==null?void 0:d.speedConfig,h=(p=e.rotateSpeed)!=null?p:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return h;if(h!==void 0)return u.rotateSpeedUnit==="rad/ms"?h:h/1e3})();if(l){const u=this.five.getCurrentState();a=Cm(u,e)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(u=>{Em(()=>o.updateCamera(e,c)),setTimeout(()=>u(),c)})})}changePano(e,n){return J(this,null,function*(){var h;const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;o.getCurrentState().mode;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);let l=(h=n==null?void 0:n.duration)!=null?h:800;const c=(()=>{var m,g;const d=(m=r.config)==null?void 0:m.speedConfig,p=(g=e.moveSpeed)!=null?g:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return p;if(p!==void 0)return d.moveSpeedUnit==="m/ms"?p:p/1e3})();if(c&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=o.work.observers[o.panoIndex].position,p=o.work.observers[e.panoIndex].position;l=d.distanceTo(p)/c}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const u=this.getSpeededDuration(l);yield new Promise(d=>{var p,m,g;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:u,effect:(g=(m=n==null?void 0:n.moveEffect)!=null?m:(p=this.state.config)==null?void 0:p.moveEffect)!=null?g:e.moveEffect,moveCancelCallback:()=>d(),moveEndCallback:()=>d()}),a&&o.once("panoArrived",()=>d())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:o,privateState:s,hooks:r}=this,{currentPlayKeyframe:a}=s;if(r.emit("speedChange",e,{userAction:n}),o.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});s.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return J(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,n),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Pi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Pi.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Pi.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(o=>o==null?void 0:o())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&Dm()}waitFiveLoaded(){return J(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-xm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(lo,"PluginVersion",Fa);const Sm=i=>new lo(i);function zm(i,t){t.forEach(e=>{const n=new E.SphereGeometry(.02,16,16),o=[],s=[new E.MeshBasicMaterial({color:16776960}),new E.MeshBasicMaterial({color:16711935}),new E.MeshBasicMaterial({color:16711680}),new E.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new E.Mesh(n,l);c.position.copy(st(r)),o.push(c)});else{const r=s[0],a=new E.Mesh(n,r);a.position.copy(st(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Se=i=>i;function Na(i){if(i.length<3)return;const t=i.map(hn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function Mn(i){if(Array.isArray(i)&&i.length===4){const t=i.map(hn);return Wr(t[0],t[2])}else return hn(i)}function Tn(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function Mm(i,t){i.model.loaded?t():i.once("modelLoaded",()=>t())}function Tm(i,t,e){const o=new E.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new E.Vector3(0,1,0)).setLength(.01),r=new E.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new E.Vector3))}const Qs=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function Bm(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function jm(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function Rs(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}var Xe=(i=>(i.Two="2D",i.Three="3D",i))(Xe||{}),Ge=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(Ge||{}),We=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Link="Link",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.Custom="Custom",i))(We||{}),ei=(i=>(i.VrLink="vr",i.NormalLink="normal",i))(ei||{});function Qm(i){ae(i,"svelte-1omzoh4",".straight-line.svelte-1omzoh4{display:block;width:100%;height:100%;overflow:visible}")}function Os(i){let t,e,n,o;return{c(){t=Ae("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 0.5 L 148 0.5")},m(s,r){B(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&xe(()=>{n&&n.end(1),e=Ot(t,qn,{duration:i[1],delay:i[0]}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=$t(t,qn,{duration:i[1],delay:i[2]})),o=!1},d(s){s&&M(t),s&&n&&n.end()}}}function Rm(i){let t,e,n,o,s,r=i[3]&&Os(i);return{c(){t=Ae("svg"),e=Ae("defs"),n=Ae("linearGradient"),o=Ae("stop"),s=Ae("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","straight-line svelte-1omzoh4"),b(t,"viewBox","0 0 148 1"),b(t,"preserveAspectRatio","none")},m(a,l){B(a,t,l),Q(t,e),Q(e,n),Q(n,o),Q(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&D(r,1)):(r=Os(a),r.c(),D(r,1),r.m(t,null)):r&&(le(),T(r,1,1,()=>{r=null}),ce())},i(a){D(r)},o(a){T(r)},d(a){a&&M(t),r&&r.d()}}}function Om(i,t,e){let{inDelay:n=0}=t,{duration:o=0}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=He();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class Wa extends oe{constructor(t){super(),ie(this,t,Om,Rm,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},Qm)}}function Hm(i){ae(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Hs(i){let t,e,n,o,s;return{c(){t=j("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
530
+ `,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=$f(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var A;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Kf({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=A=>{if(A!==be.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,s()})};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},nm={name:"ItemLabelPlugin",version:0};class im extends ai{constructor(e){super(e);f(this,"state");f(this,"container");f(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(he(N({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(he(N({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(he(N({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(he(N({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=N({},this.state);this.state=N(N(N({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===be.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(he(N({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function om(i){ae(i,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function sm(i){let t,e,n,o,s,r,a,l;return{c(){t=j("div"),e=j("div"),n=j("span"),n.textContent=`${i[8]}`,o=_(),s=j("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=je(_e.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),b(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),b(e,"data-camera-toward",i[7]),b(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),b(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,u){B(c,t,u),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=Pe(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=je(_e.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:te,o:te,d(c){c&&M(t),i[10](null),a=!1,l()}}}function rm(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:h,name:d}=n,p=0;const m=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,w=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=w/2||a>=100-w/2)return;u!==p&&(console.log("panoDoorLabelPlugin",u,"\u89E6\u53D1\u57CB\u70B9"),p=u)},g=v=>{o&&o()};function A(v){Me[v?"unshift":"push"](()=>{s=v,e(2,s)})}return i.$$set=v=>{"props"in v&&e(0,n=v.props),"onClick"in v&&e(1,o=v.onClick)},m(),[n,o,s,r,a,l,c,h,d,g,A]}class am extends oe{constructor(t){super(),ie(this,t,rm,sm,ne,{props:0,onClick:1},om)}}function lm(i,t){const e=Math.abs(i.top+i.height/2-t.top-t.height/2),n=Math.abs(i.left+i.width/2-t.left-t.width/2),o=(i.height+t.height)/2,s=(i.width+t.width)/2;return!(e>o&&n>s)}function cm(i){const{camera:t}=i,e=t.getWorldDirection(new F.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,o="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?o="right":n>45&&n<=135?o="back":n>135&&n<=225?o="left":n>225&&n<=315&&(o="forward"),o}function um(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function dm(i){const t=Math.PI/4;return i>-t&&i<=t?"left":i>t*3||i<=-t*3?"right":i>-t*3&&i<=-t?"forward":i>t&&i<=t*3?"back":""}const hm={userAction:!0};class fm extends im{constructor(e){super(e);f(this,"MinVisibledistance",1.8);f(this,"MaxVisibledistance",5);f(this,"OffsetHeight",-1.3);f(this,"rooms");f(this,"floorplanServerData");f(this,"doorLabelItems");f(this,"visibleLabelMap",new Map);f(this,"labelItems",[]);f(this,"doorLabels");f(this,"roomObservers");f(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});f(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,u=e==null?void 0:e.find(h=>h.floor_index===c);if(u){const h=u.rooms.find(d=>d.observer_indexs.includes(l));if(h)return{panoIndex:l,floorIndex:c,name:h.name}}}).filter(Boolean);this.roomObservers=o});f(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});f(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const u=l.position.clone(),h=u.distanceTo(s);if(h<this.MinVisibledistance||h>this.MaxVisibledistance)return;const d=new F.Raycaster,p=u.clone().sub(s).normalize();d.set(s,p);const[m]=this.five.model.intersectRaycaster(d);m&&m.distance+.1<h||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});f(this,"fixDoorPosition",()=>{var u,h,d,p,m,g,A,v,w,y,x,L;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const o=this.five.getElement(),s=o.clientWidth,r=o.clientHeight,a=n.getWorldDirection(new F.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,S)=>{if(C.visible){const k=n.position.distanceTo(C.position),G=C.position.clone().add(new F.Vector3(0,this.OffsetHeight,0)),W=G.clone().sub(n.position).normalize().angleTo(a),U=G.clone().project(n),P=(U.x+1)/2.2*100,I=(-U.y+1)/2.2*100,z=P>=0&&P<=100&&I>=0&&I<=100&&k>this.MinVisibledistance&&k<=this.MaxVisibledistance;C.left=P,C.top=I,C.inSight=z&&W<Math.PI/2,C.cameraToward=cm(this.five),z?l.push({disFromCameraToLabel:k,left:P,top:I,index:S}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((S,k)=>k.disFromCameraToLabel-S.disFromCameraToLabel);for(let S=1;S<l.length;S++){const{index:k,left:G,top:O}=l[S-1],{index:W,left:U,top:P}=l[S],I=this.container.children[k],z=this.container.children[W];if(!I||!z)return;const H={left:s*G/100,top:r*O/100,width:(d=(h=(u=I.children)==null?void 0:u[0])==null?void 0:h.clientWidth)!=null?d:0,height:(g=(m=(p=I.children)==null?void 0:p[0])==null?void 0:m.clientHeight)!=null?g:0},X={left:s*U/100,top:r*P/100,width:(w=(v=(A=z.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?w:0,height:(L=(x=(y=z.children)==null?void 0:y[0])==null?void 0:x.clientHeight)!=null?L:0};lm(H,X)&&(C++,c[k].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[W].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,h=n.distanceTo(u);h<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const u=new F.Vector3(0,0,-1),h=r.clone(),d=new F.Quaternion;d.setFromUnitVectors(u,h);const p=new F.Euler;p.setFromQuaternion(d,"YXZ"),l.longitude=p.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});f(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,h)=>!!r.observer_indexs.find(d=>d===h));a&&a.forEach(u=>{const h=u.position;let d=1/0,p;l.forEach(g=>{const A=g.standingPosition,v={x:A.x,y:A.y,z:A.z},w=um(h,v);w<d&&(d=w,p=v)}),p&&(h.y=p.y+.01);const m=new F.Vector3(h.x,h.y,h.z);m.add(new F.Vector3(-.2,1.8,0).applyEuler(new F.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:m,toward:dm(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>he(N({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:hm.userAction};this.hooks.emit("stateChange",o)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new am({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this&&this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const mm=i=>new fm(i),pm=2,gm=3,Am=3,vm=2;function bm(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new E.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),h=[];let d=0;const p=i;return p.forEach((m,g)=>{let A=0,v=99999999;u.forEach((C,S)=>{const k=C.distanceTo(m);k<v&&(A=S,v=k)});const w=u[A+1],y=w==null?void 0:w.distanceTo(m),x=u[A-1],L=x==null?void 0:x.distanceTo(m);if(A>d&&A-d>1){let C=A;x!==void 0&&L>.8&&(C=A+1),x!==void 0&&L>.2&&L<.3?C=A:v>.2&&v<.3&&(C=A+1);let S=d;if(w!==void 0&&y>.2&&y<.3?S=d+1:v>.2&&v<.3&&(S=d),u[S]&&u[S+1]){const O=p[g-1];if(O)if(O.equals(u[S]))S+=1;else{const W=new F.Vector3().subVectors(u[S+1],u[S]),U=new F.Vector3().subVectors(O,u[S]);W.angleTo(U)<Math.PI/2&&(S+=1)}}if(C<S||C-S<=1)return;const k=u.slice(S,C),G=Ms(k,e,n);h.push(G),d=A}}),h}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[Ms(u,e,n)]}}function Ms(i,t,e){const n=t/2,o=e/t,s=i.length,r=bl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*pm*gm,c=2*s,u=c*Am,h=c*vm,d=new Uint32Array(l),p=new Float32Array(u),m=new Float32Array(h);i.forEach((v,w)=>{});let g=0;for(let v=0;v<i.length;v++){const[w,y]=r[v][0],x=i[v],{x:L,y:C,z:S}=x,k=new F.Vector3(L+w*n,C+.05,S+y*n);p[v*6+0]=k.x,p[v*6+1]=k.y,p[v*6+2]=k.z;const G=new F.Vector3(L-w*n,C+.05,S-y*n);p[v*6+3]=G.x,p[v*6+4]=G.y,p[v*6+5]=G.z,g+=v>0?i[v-1].clone().sub(i[v]).length():0;const O=g/t/o;m[v*4+0]=0,m[v*4+1]=O,m[v*4+2]=1,m[v*4+3]=O,v!==i.length-1&&(d[v*6+0]=v*2+0,d[v*6+1]=v*2+2,d[v*6+2]=v*2+1,d[v*6+3]=v*2+2,d[v*6+4]=v*2+3,d[v*6+5]=v*2+1)}const A=new E.BufferGeometry;return A.setAttribute("position",new E.BufferAttribute(p,3)),A.setAttribute("uv",new E.BufferAttribute(m,2)),A.setIndex(new E.BufferAttribute(d,1)),A}function ym(i){const t=new E.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=E.RepeatWrapping,t.encoding=E.sRGBEncoding,new E.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function wm(i){return!Bt(i)}function Bt(i){return i!=null}const Qa="v1.0.1",Ra="GuideLinePlugin",Fi=`${Ra}@${Qa}`,Ts=i=>`${Fi}--${i}`;class Oa extends Ht{constructor(e,n){super(e,n);f(this,"state",{visible:!1,enabled:!0,disposed:!1});f(this,"data");f(this,"linesGroup");f(this,"disposedErrorLog",()=>{console.error(`${Fi} is disposed`)});f(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Ra}_DEBUG__`]:this})}load(e,n,o=!0){return J(this,null,function*(){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.log(`${Fi} loaded`,r))})}formatData(e){return J(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(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){var s;if(this.state.disposed)return this.disposedErrorLog();const o=N({},this.state);this.state=N(N({},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,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),qe(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e){const n=e.map(this.getLine.bind(this)).filter(Bt),o=new E.Group;if(o.name=Ts("route-group"),n.length!==0)return o.add(...n),o}getLine(e){var a,l,c,u;const n=new E.Group,o=e.panoIndexList.map(h=>{var d;return(d=this.five.work.observers[h])==null?void 0:d.standingPosition}).filter(Bt),s=bm(o,{skipPanoIndexMesh:(a=e.skipPanoIndexMesh)!=null?a:!0,unitWidth:(l=e.unitWidth)!=null?l:.6,unitHeight:(c=e.unitHeight)!=null?c:.4});if(!s)return;const r=ym({textureUrl:(u=e.arrowTextureUrl)!=null?u:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return s.forEach(h=>{const d=new E.Mesh(h,r);d.name=Ts("route-line-mesh"),n.add(d)}),n}waitFiveModelLoaded(){return J(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}f(Oa,"lasestVersion",Qa);const Ha=(i,t)=>new Oa(i,t);function Bs(i){const t=Math.abs(Math.cos(i.latitude));return new E.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Cm(i,t){const e=Bs(i),n=Bs(t);return e.angleTo(n)}const Em=i=>J(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),zn=Math.PI*2;function Pm(i){return i>=0&&i<zn?i:(i%zn+zn)%zn}function Im(i){return{longitude:Pm(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function xm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function km(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Fa="v1.0.6",Ga="CruisePlugin",di=`${Ga}@${Fa}`,js=()=>{console.error(`${di} is disposed`)},Dm=()=>{console.warn(`${di} is disabled`)},Lm=()=>{console.error(`${di} is disabled`)},Pi=new Map;class lo extends Ht{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Ga}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return J(this,null,function*(){var u,h,d,p,m;if(this.state.disposed)return js();this.privateState.fiveOriginGetProgress||(h=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(p=(d=this.five.controller)==null?void 0:d.cameraMotion)==null?void 0:p.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(g=>g.data.panoIndex!==void 0);c.filter((g,A)=>{var v;return g.data.panoIndex!==((v=c[A-1])==null?void 0:v.data.panoIndex)}).map(g=>g.data.panoIndex).forEach(g=>{var v,w;const A=(v=this.five.work.observers[g])==null?void 0:v.floorIndex;if(A!==void 0)if(l===A){const y=a.length-1;a[y]=[...(w=a[y])!=null?w:[],g]}else{l=A;const y=a.length;a[y]=[g]}}),this.GuideLine||(this.GuideLine=Ha(this.five,this.config)),(m=this.GuideLine)==null||m.load({routes:a.map(g=>({panoIndexList:g}))}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.log(`${di} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:o,userAction:s}=e;this.state.playing&&this.setState({playing:!1},{userAction:s}),this.setState({playing:!0},{userAction:s,playFromIndex:n,playFromId:o})}playFromStart(e){return this.playFrom(he(N({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(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){var s;if(this.state.disposed)return js();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Lm();const o=N({},this.state);this.state=N(N({},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,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),qe(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return J(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:He(),keyframes:o.keyframes.map((s,r)=>{var c;const a=o.keyframes[r+1],l=(()=>!a||a.start===void 0||s.end===void 0?0:a.start-s.end)();return N({id:(c=s.uuid)!=null?c:He(),moveIndex:r,stay:l,index:r},s)})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=o;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,o.panoIndexList.forEach((c,u)=>{const h=(()=>{var A,v,w,y;const d=o.panoIndexList.slice(u).find(x=>x!==c);if(d===void 0)return;const p=(A=n[c])==null?void 0:A.position,m=(v=n[d])==null?void 0:v.position;if(!m||!p||((w=n[c])==null?void 0:w.floorIndex)!==((y=n[d])==null?void 0:y.floorIndex))return;const g=new E.Vector3().subVectors(m,p);return Im(g)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:u,stay:o.stay,data:N({effect:"Move",panoIndex:c,moveEffect:r},h!=null?h:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:u,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),h&&s.push({moveIndex:u,stay:o.stay,data:N({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:He(),keyframes:s.map((c,u)=>N({id:He(),index:u},c))}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return J(this,null,function*(){var p;const{data:n,state:o,privateState:s,hooks:r}=this;if(s.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=He();s.playId=a,s.playing=!0,s.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(p=e==null?void 0:e.userAction)!=null?p:!0});let u=!1;const d=yield(()=>J(this,null,function*(){var m,g;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(m=this.data)==null?void 0:m.keyframes.findIndex(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(g=this.data)==null?void 0:g.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:v}),u=!0,A.index+1}}}}))();this.clearPauseData();for(const m of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(d!==void 0&&m.index<d))try{r.emit("playIndexChange",m.index,m),yield this.playKeyframe(m,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:u===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:800}),m.stay&&(yield km(m.stay)),u===!1&&(u=!0)}catch(g){return Promise.resolve("broke")}}o.playing&&a===s.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:o,hooks:s}=this;n.playing=!1,o.playing!==!1&&(o.playing=!1,this.setPauseData(),o.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&s.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return J(this,null,function*(){var s;const{privateState:o}=this;return((s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),o.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},o=e;return this.five.once("gesture",o),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",o),this.five.once("wantsChangeMode",n)}}getPlayPromise(e,n){return J(this,null,function*(){var s;const o=e.data;if((s=n==null?void 0:n.duration)!=null||e.start!==void 0&&e.end!==void 0&&e.end-e.start,!!o)return new Promise((r,a)=>{let l=!1;this.addInterruptListener(()=>{if(!l)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),l=!0,a(new Error("play is interupted"))});try{if(l)return;const c=()=>{r(),l=!0};switch(o.effect){case"Move":this.move(o,n).then(c);break;case"Rotate":this.rotate(o,n).then(c);break;default:this.rotate(o,n).then(c)}}catch(c){}})})}actionPromiseQueue(){return J(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return J(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,n);else return Promise.resolve()})}rotate(e,n){return J(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n==null?void 0:n.duration)})}updateCamera(e,n=800){return J(this,null,function*(){const{five:o,privateState:s,state:r}=this;let a=n;const l=(()=>{var d,p;const u=(d=r.config)==null?void 0:d.speedConfig,h=(p=e.rotateSpeed)!=null?p:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return h;if(h!==void 0)return u.rotateSpeedUnit==="rad/ms"?h:h/1e3})();if(l){const u=this.five.getCurrentState();a=Cm(u,e)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(u=>{Em(()=>o.updateCamera(e,c)),setTimeout(()=>u(),c)})})}changePano(e,n){return J(this,null,function*(){var h;const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;o.getCurrentState().mode;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);let l=(h=n==null?void 0:n.duration)!=null?h:800;const c=(()=>{var m,g;const d=(m=r.config)==null?void 0:m.speedConfig,p=(g=e.moveSpeed)!=null?g:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return p;if(p!==void 0)return d.moveSpeedUnit==="m/ms"?p:p/1e3})();if(c&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=o.work.observers[o.panoIndex].position,p=o.work.observers[e.panoIndex].position;l=d.distanceTo(p)/c}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const u=this.getSpeededDuration(l);yield new Promise(d=>{var p,m,g;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:u,effect:(g=(m=n==null?void 0:n.moveEffect)!=null?m:(p=this.state.config)==null?void 0:p.moveEffect)!=null?g:e.moveEffect,moveCancelCallback:()=>d(),moveEndCallback:()=>d()}),a&&o.once("panoArrived",()=>d())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:o,privateState:s,hooks:r}=this,{currentPlayKeyframe:a}=s;if(r.emit("speedChange",e,{userAction:n}),o.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});s.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return J(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,n),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Pi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Pi.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Pi.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(o=>o==null?void 0:o())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&Dm()}waitFiveLoaded(){return J(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-xm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(lo,"PluginVersion",Fa);const Sm=i=>new lo(i);function zm(i,t){t.forEach(e=>{const n=new E.SphereGeometry(.02,16,16),o=[],s=[new E.MeshBasicMaterial({color:16776960}),new E.MeshBasicMaterial({color:16711935}),new E.MeshBasicMaterial({color:16711680}),new E.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new E.Mesh(n,l);c.position.copy(st(r)),o.push(c)});else{const r=s[0],a=new E.Mesh(n,r);a.position.copy(st(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Se=i=>i;function Na(i){if(i.length<3)return;const t=i.map(hn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function Mn(i){if(Array.isArray(i)&&i.length===4){const t=i.map(hn);return Wr(t[0],t[2])}else return hn(i)}function Tn(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function Mm(i,t){i.model.loaded?t():i.once("modelLoaded",()=>t())}function Tm(i,t,e){const o=new E.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new E.Vector3(0,1,0)).setLength(.01),r=new E.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new E.Vector3))}const Qs=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function Bm(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function jm(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function Rs(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}var Xe=(i=>(i.Two="2D",i.Three="3D",i))(Xe||{}),Ge=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(Ge||{}),We=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Link="Link",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.Custom="Custom",i))(We||{}),ei=(i=>(i.VrLink="vr",i.NormalLink="normal",i))(ei||{});function Qm(i){ae(i,"svelte-1omzoh4",".straight-line.svelte-1omzoh4{display:block;width:100%;height:100%;overflow:visible}")}function Os(i){let t,e,n,o;return{c(){t=Ae("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 0.5 L 148 0.5")},m(s,r){B(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&xe(()=>{n&&n.end(1),e=Ot(t,qn,{duration:i[1],delay:i[0]}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=$t(t,qn,{duration:i[1],delay:i[2]})),o=!1},d(s){s&&M(t),s&&n&&n.end()}}}function Rm(i){let t,e,n,o,s,r=i[3]&&Os(i);return{c(){t=Ae("svg"),e=Ae("defs"),n=Ae("linearGradient"),o=Ae("stop"),s=Ae("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","straight-line svelte-1omzoh4"),b(t,"viewBox","0 0 148 1"),b(t,"preserveAspectRatio","none")},m(a,l){B(a,t,l),Q(t,e),Q(e,n),Q(n,o),Q(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&D(r,1)):(r=Os(a),r.c(),D(r,1),r.m(t,null)):r&&(le(),T(r,1,1,()=>{r=null}),ce())},i(a){D(r)},o(a){T(r)},d(a){a&&M(t),r&&r.d()}}}function Om(i,t,e){let{inDelay:n=0}=t,{duration:o=0}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=He();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class Wa extends oe{constructor(t){super(),ie(this,t,Om,Rm,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},Qm)}}function Hm(i){ae(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Hs(i){let t,e,n,o,s;return{c(){t=j("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
531
531
  left:${Ne(i[5])};
532
532
  bottom:${Ne(i[6])};
533
533
  box-shadow: 0 0 ${Ne(i[10])} ${Ne(i[11])} rgba(0, 0, 0, ${i[12]});
package/dist/index.js CHANGED
@@ -10998,25 +10998,25 @@ class Xa extends Ot {
10998
10998
  };
10999
10999
  if (o.panoIndexList) {
11000
11000
  let s = [];
11001
- const { moveEffect: r, moveToFirstPanoEffect: a } = o;
11002
- return this.privateState.moveToFirstPanoEffect = a, o.panoIndexList.forEach((l, c) => {
11003
- const d = (() => {
11004
- var g, A, v, w;
11005
- const h = o.panoIndexList.slice(c).find((y) => y !== l);
11006
- if (h === void 0)
11001
+ const { moveEffect: r, moveToFirstPanoEffect: a, moveToFirstPanoDuration: l } = o;
11002
+ return this.privateState.moveToFirstPanoEffect = a, this.privateState.moveToFirstPanoDuration = l, o.panoIndexList.forEach((c, d) => {
11003
+ const h = (() => {
11004
+ var A, v, w, y;
11005
+ const u = o.panoIndexList.slice(d).find((x) => x !== c);
11006
+ if (u === void 0)
11007
11007
  return;
11008
- const u = (g = n[l]) == null ? void 0 : g.position, p = (A = n[h]) == null ? void 0 : A.position;
11009
- if (!p || !u || ((v = n[l]) == null ? void 0 : v.floorIndex) !== ((w = n[h]) == null ? void 0 : w.floorIndex))
11008
+ const p = (A = n[c]) == null ? void 0 : A.position, m = (v = n[u]) == null ? void 0 : v.position;
11009
+ if (!m || !p || ((w = n[c]) == null ? void 0 : w.floorIndex) !== ((y = n[u]) == null ? void 0 : y.floorIndex))
11010
11010
  return;
11011
- const m = new E.Vector3().subVectors(p, u);
11012
- return pm(m);
11011
+ const g = new E.Vector3().subVectors(m, p);
11012
+ return pm(g);
11013
11013
  })();
11014
11014
  o.moveType === void 0 || o.moveType === "justMove" ? s.push({
11015
- moveIndex: c,
11015
+ moveIndex: d,
11016
11016
  stay: o.stay,
11017
- data: G({ effect: "Move", panoIndex: l, moveEffect: r }, d != null ? d : {})
11018
- }) : o.moveType === "moveAndRotate" && (s.push({ moveIndex: c, stay: o.stay, data: { effect: "Move", panoIndex: l, moveEffect: r } }), d && s.push({ moveIndex: c, stay: o.stay, data: G({ effect: "Rotate", panoIndex: l }, d) }));
11019
- }), { keyframesId: Fe(), keyframes: s.map((l, c) => G({ id: Fe(), index: c }, l)) };
11017
+ data: G({ effect: "Move", panoIndex: c, moveEffect: r }, h != null ? h : {})
11018
+ }) : o.moveType === "moveAndRotate" && (s.push({ moveIndex: d, stay: o.stay, data: { effect: "Move", panoIndex: c, moveEffect: r } }), h && s.push({ moveIndex: d, stay: o.stay, data: G({ effect: "Rotate", panoIndex: c }, h) }));
11019
+ }), { keyframesId: Fe(), keyframes: s.map((c, d) => G({ id: Fe(), index: d }, c)) };
11020
11020
  } else
11021
11021
  throw new Error("format error: data no keyframes or no panoIndexList");
11022
11022
  });
@@ -11056,7 +11056,10 @@ class Xa extends Ot {
11056
11056
  return (m = this.data) == null ? void 0 : m.keyframes.findIndex((A) => A.id === e.playFromId);
11057
11057
  if (c != null && c.keyframeId) {
11058
11058
  const A = (g = this.data) == null ? void 0 : g.keyframes.find((v) => v.id === c.keyframeId);
11059
- if (c != null && c.fiveState && (yield this.move(c.fiveState, { moveEffect: s.moveToFirstPanoEffect })), A) {
11059
+ if (c != null && c.fiveState && (yield this.move(c.fiveState, {
11060
+ moveEffect: s.moveToFirstPanoEffect,
11061
+ duration: s.moveToFirstPanoDuration
11062
+ })), A) {
11060
11063
  if (A.data.effect === "Move")
11061
11064
  return A.index;
11062
11065
  if (A.data.effect === "Rotate") {
@@ -11074,7 +11077,7 @@ class Xa extends Ot {
11074
11077
  try {
11075
11078
  r.emit("playIndexChange", m.index, m), yield this.playKeyframe(m, {
11076
11079
  moveEffect: d === !1 ? s.moveToFirstPanoEffect : void 0,
11077
- duration: 800
11080
+ duration: d === !1 && typeof s.moveToFirstPanoDuration == "number" ? s.moveToFirstPanoDuration : 800
11078
11081
  }), m.stay && (yield Am(m.stay)), d === !1 && (d = !0);
11079
11082
  } catch (g) {
11080
11083
  return Promise.resolve("broke");
package/dist/index.umd.js CHANGED
@@ -527,7 +527,7 @@ void main() {
527
527
  width: 100%;
528
528
  height: 100%;
529
529
  z-index: 5;
530
- `,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=Rf(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var A;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Of({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=A=>{if(A!==de.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,s()})};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Hf={name:"ItemLabelPlugin",version:0};class Nf extends _n{constructor(e){super(e);f(this,"state");f(this,"container");f(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(me(N({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(me(N({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(me(N({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(me(N({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=N({},this.state);this.state=N(N(N({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===de.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(me(N({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function Wf(i){le(i,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function Xf(i){let t,e,n,o,s,r,a,l;return{c(){t=j("div"),e=j("div"),n=j("span"),n.textContent=`${i[8]}`,o=Z(),s=j("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=Oe(Ze.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),b(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),b(e,"data-camera-toward",i[7]),b(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),b(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,u){T(c,t,u),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=Ie(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=Oe(Ze.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:ne,o:ne,d(c){c&&z(t),i[10](null),a=!1,l()}}}function Yf(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:h,name:d}=n,p=0;const m=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,w=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=w/2||a>=100-w/2)return;u!==p&&(console.log("panoDoorLabelPlugin",u,"\u89E6\u53D1\u57CB\u70B9"),p=u)},g=v=>{o&&o()};function A(v){Te[v?"unshift":"push"](()=>{s=v,e(2,s)})}return i.$$set=v=>{"props"in v&&e(0,n=v.props),"onClick"in v&&e(1,o=v.onClick)},m(),[n,o,s,r,a,l,c,h,d,g,A]}class Uf extends se{constructor(t){super(),oe(this,t,Yf,Xf,ie,{props:0,onClick:1},Wf)}}function Vf(i,t){const e=Math.abs(i.top+i.height/2-t.top-t.height/2),n=Math.abs(i.left+i.width/2-t.left-t.width/2),o=(i.height+t.height)/2,s=(i.width+t.width)/2;return!(e>o&&n>s)}function Jf(i){const{camera:t}=i,e=t.getWorldDirection(new G.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,o="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?o="right":n>45&&n<=135?o="back":n>135&&n<=225?o="left":n>225&&n<=315&&(o="forward"),o}function _f(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Zf(i){const t=Math.PI/4;return i>-t&&i<=t?"left":i>t*3||i<=-t*3?"right":i>-t*3&&i<=-t?"forward":i>t&&i<=t*3?"back":""}const qf={userAction:!0};class Kf extends Nf{constructor(e){super(e);f(this,"MinVisibledistance",1.8);f(this,"MaxVisibledistance",5);f(this,"OffsetHeight",-1.3);f(this,"rooms");f(this,"floorplanServerData");f(this,"doorLabelItems");f(this,"visibleLabelMap",new Map);f(this,"labelItems",[]);f(this,"doorLabels");f(this,"roomObservers");f(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});f(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,u=e==null?void 0:e.find(h=>h.floor_index===c);if(u){const h=u.rooms.find(d=>d.observer_indexs.includes(l));if(h)return{panoIndex:l,floorIndex:c,name:h.name}}}).filter(Boolean);this.roomObservers=o});f(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});f(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const u=l.position.clone(),h=u.distanceTo(s);if(h<this.MinVisibledistance||h>this.MaxVisibledistance)return;const d=new G.Raycaster,p=u.clone().sub(s).normalize();d.set(s,p);const[m]=this.five.model.intersectRaycaster(d);m&&m.distance+.1<h||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});f(this,"fixDoorPosition",()=>{var u,h,d,p,m,g,A,v,w,y,x,L;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const o=this.five.getElement(),s=o.clientWidth,r=o.clientHeight,a=n.getWorldDirection(new G.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,S)=>{if(C.visible){const D=n.position.distanceTo(C.position),H=C.position.clone().add(new G.Vector3(0,this.OffsetHeight,0)),W=H.clone().sub(n.position).normalize().angleTo(a),U=H.clone().project(n),I=(U.x+1)/2.2*100,E=(-U.y+1)/2.2*100,M=I>=0&&I<=100&&E>=0&&E<=100&&D>this.MinVisibledistance&&D<=this.MaxVisibledistance;C.left=I,C.top=E,C.inSight=M&&W<Math.PI/2,C.cameraToward=Jf(this.five),M?l.push({disFromCameraToLabel:D,left:I,top:E,index:S}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((S,D)=>D.disFromCameraToLabel-S.disFromCameraToLabel);for(let S=1;S<l.length;S++){const{index:D,left:H,top:R}=l[S-1],{index:W,left:U,top:I}=l[S],E=this.container.children[D],M=this.container.children[W];if(!E||!M)return;const F={left:s*H/100,top:r*R/100,width:(d=(h=(u=E.children)==null?void 0:u[0])==null?void 0:h.clientWidth)!=null?d:0,height:(g=(m=(p=E.children)==null?void 0:p[0])==null?void 0:m.clientHeight)!=null?g:0},X={left:s*U/100,top:r*I/100,width:(w=(v=(A=M.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?w:0,height:(L=(x=(y=M.children)==null?void 0:y[0])==null?void 0:x.clientHeight)!=null?L:0};Vf(F,X)&&(C++,c[D].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[W].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,h=n.distanceTo(u);h<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const u=new G.Vector3(0,0,-1),h=r.clone(),d=new G.Quaternion;d.setFromUnitVectors(u,h);const p=new G.Euler;p.setFromQuaternion(d,"YXZ"),l.longitude=p.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});f(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,h)=>!!r.observer_indexs.find(d=>d===h));a&&a.forEach(u=>{const h=u.position;let d=1/0,p;l.forEach(g=>{const A=g.standingPosition,v={x:A.x,y:A.y,z:A.z},w=_f(h,v);w<d&&(d=w,p=v)}),p&&(h.y=p.y+.01);const m=new G.Vector3(h.x,h.y,h.z);m.add(new G.Vector3(-.2,1.8,0).applyEuler(new G.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:m,toward:Zf(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>me(N({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:qf.userAction};this.hooks.emit("stateChange",o)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new Uf({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this&&this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const $f=i=>new Kf(i),em=2,tm=3,nm=3,im=2;function om(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new P.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),h=[];let d=0;const p=i;return p.forEach((m,g)=>{let A=0,v=99999999;u.forEach((C,S)=>{const D=C.distanceTo(m);D<v&&(A=S,v=D)});const w=u[A+1],y=w==null?void 0:w.distanceTo(m),x=u[A-1],L=x==null?void 0:x.distanceTo(m);if(A>d&&A-d>1){let C=A;x!==void 0&&L>.8&&(C=A+1),x!==void 0&&L>.2&&L<.3?C=A:v>.2&&v<.3&&(C=A+1);let S=d;if(w!==void 0&&y>.2&&y<.3?S=d+1:v>.2&&v<.3&&(S=d),u[S]&&u[S+1]){const R=p[g-1];if(R)if(R.equals(u[S]))S+=1;else{const W=new G.Vector3().subVectors(u[S+1],u[S]),U=new G.Vector3().subVectors(R,u[S]);W.angleTo(U)<Math.PI/2&&(S+=1)}}if(C<S||C-S<=1)return;const D=u.slice(S,C),H=Mr(D,e,n);h.push(H),d=A}}),h}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[Mr(u,e,n)]}}function Mr(i,t,e){const n=t/2,o=e/t,s=i.length,r=cl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*em*tm,c=2*s,u=c*nm,h=c*im,d=new Uint32Array(l),p=new Float32Array(u),m=new Float32Array(h);i.forEach((v,w)=>{});let g=0;for(let v=0;v<i.length;v++){const[w,y]=r[v][0],x=i[v],{x:L,y:C,z:S}=x,D=new G.Vector3(L+w*n,C+.05,S+y*n);p[v*6+0]=D.x,p[v*6+1]=D.y,p[v*6+2]=D.z;const H=new G.Vector3(L-w*n,C+.05,S-y*n);p[v*6+3]=H.x,p[v*6+4]=H.y,p[v*6+5]=H.z,g+=v>0?i[v-1].clone().sub(i[v]).length():0;const R=g/t/o;m[v*4+0]=0,m[v*4+1]=R,m[v*4+2]=1,m[v*4+3]=R,v!==i.length-1&&(d[v*6+0]=v*2+0,d[v*6+1]=v*2+2,d[v*6+2]=v*2+1,d[v*6+3]=v*2+2,d[v*6+4]=v*2+3,d[v*6+5]=v*2+1)}const A=new P.BufferGeometry;return A.setAttribute("position",new P.BufferAttribute(p,3)),A.setAttribute("uv",new P.BufferAttribute(m,2)),A.setIndex(new P.BufferAttribute(d,1)),A}function sm(i){const t=new P.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=P.RepeatWrapping,t.encoding=P.sRGBEncoding,new P.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function rm(i){return!Ot(i)}function Ot(i){return i!=null}const Br="v1.0.1",Tr="GuideLinePlugin",$i=`${Tr}@${Br}`,jr=i=>`${$i}--${i}`;class Qr extends Tt{constructor(e,n){super(e,n);f(this,"state",{visible:!1,enabled:!0,disposed:!1});f(this,"data");f(this,"linesGroup");f(this,"disposedErrorLog",()=>{console.error(`${$i} is disposed`)});f(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Tr}_DEBUG__`]:this})}load(e,n,o=!0){return _(this,null,function*(){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.log(`${$i} loaded`,r))})}formatData(e){return _(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}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){var s;if(this.state.disposed)return this.disposedErrorLog();const o=N({},this.state);this.state=N(N({},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,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),$e(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e){const n=e.map(this.getLine.bind(this)).filter(Ot),o=new P.Group;if(o.name=jr("route-group"),n.length!==0)return o.add(...n),o}getLine(e){var a,l,c,u;const n=new P.Group,o=e.panoIndexList.map(h=>{var d;return(d=this.five.work.observers[h])==null?void 0:d.standingPosition}).filter(Ot),s=om(o,{skipPanoIndexMesh:(a=e.skipPanoIndexMesh)!=null?a:!0,unitWidth:(l=e.unitWidth)!=null?l:.6,unitHeight:(c=e.unitHeight)!=null?c:.4});if(!s)return;const r=sm({textureUrl:(u=e.arrowTextureUrl)!=null?u:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return s.forEach(h=>{const d=new P.Mesh(h,r);d.name=jr("route-line-mesh"),n.add(d)}),n}waitFiveModelLoaded(){return _(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}f(Qr,"lasestVersion",Br);const Or=(i,t)=>new Qr(i,t);function Rr(i){const t=Math.abs(Math.cos(i.latitude));return new P.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function am(i,t){const e=Rr(i),n=Rr(t);return e.angleTo(n)}const lm=i=>_(this,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),li=Math.PI*2;function cm(i){return i>=0&&i<li?i:(i%li+li)%li}function um(i){return{longitude:cm(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function dm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function hm(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Fr="v1.0.6",Gr="CruisePlugin",ci=`${Gr}@${Fr}`,Hr=()=>{console.error(`${ci} is disposed`)},fm=()=>{console.warn(`${ci} is disabled`)},mm=()=>{console.error(`${ci} is disabled`)},eo=new Map;class to extends Tt{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Gr}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return _(this,null,function*(){var u,h,d,p,m;if(this.state.disposed)return Hr();this.privateState.fiveOriginGetProgress||(h=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(p=(d=this.five.controller)==null?void 0:d.cameraMotion)==null?void 0:p.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(g=>g.data.panoIndex!==void 0);c.filter((g,A)=>{var v;return g.data.panoIndex!==((v=c[A-1])==null?void 0:v.data.panoIndex)}).map(g=>g.data.panoIndex).forEach(g=>{var v,w;const A=(v=this.five.work.observers[g])==null?void 0:v.floorIndex;if(A!==void 0)if(l===A){const y=a.length-1;a[y]=[...(w=a[y])!=null?w:[],g]}else{l=A;const y=a.length;a[y]=[g]}}),this.GuideLine||(this.GuideLine=Or(this.five,this.config)),(m=this.GuideLine)==null||m.load({routes:a.map(g=>({panoIndexList:g}))}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.log(`${ci} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:o,userAction:s}=e;this.state.playing&&this.setState({playing:!1},{userAction:s}),this.setState({playing:!0},{userAction:s,playFromIndex:n,playFromId:o})}playFromStart(e){return this.playFrom(me(N({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}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){var s;if(this.state.disposed)return Hr();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return mm();const o=N({},this.state);this.state=N(N({},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,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),$e(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return _(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:Fe(),keyframes:o.keyframes.map((s,r)=>{var c;const a=o.keyframes[r+1],l=(()=>!a||a.start===void 0||s.end===void 0?0:a.start-s.end)();return N({id:(c=s.uuid)!=null?c:Fe(),moveIndex:r,stay:l,index:r},s)})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a}=o;return this.privateState.moveToFirstPanoEffect=a,o.panoIndexList.forEach((l,c)=>{const u=(()=>{var g,A,v,w;const h=o.panoIndexList.slice(c).find(y=>y!==l);if(h===void 0)return;const d=(g=n[l])==null?void 0:g.position,p=(A=n[h])==null?void 0:A.position;if(!p||!d||((v=n[l])==null?void 0:v.floorIndex)!==((w=n[h])==null?void 0:w.floorIndex))return;const m=new P.Vector3().subVectors(p,d);return um(m)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:c,stay:o.stay,data:N({effect:"Move",panoIndex:l,moveEffect:r},u!=null?u:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r}}),u&&s.push({moveIndex:c,stay:o.stay,data:N({effect:"Rotate",panoIndex:l},u)}))}),{keyframesId:Fe(),keyframes:s.map((l,c)=>N({id:Fe(),index:c},l))}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return _(this,null,function*(){var p;const{data:n,state:o,privateState:s,hooks:r}=this;if(s.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=Fe();s.playId=a,s.playing=!0,s.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(p=e==null?void 0:e.userAction)!=null?p:!0});let u=!1;const d=yield(()=>_(this,null,function*(){var m,g;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(m=this.data)==null?void 0:m.keyframes.findIndex(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(g=this.data)==null?void 0:g.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:v}),u=!0,A.index+1}}}}))();this.clearPauseData();for(const m of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(d!==void 0&&m.index<d))try{r.emit("playIndexChange",m.index,m),yield this.playKeyframe(m,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:800}),m.stay&&(yield hm(m.stay)),u===!1&&(u=!0)}catch(g){return Promise.resolve("broke")}}o.playing&&a===s.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:o,hooks:s}=this;n.playing=!1,o.playing!==!1&&(o.playing=!1,this.setPauseData(),o.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&s.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return _(this,null,function*(){var s;const{privateState:o}=this;return((s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),o.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},o=e;return this.five.once("gesture",o),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",o),this.five.once("wantsChangeMode",n)}}getPlayPromise(e,n){return _(this,null,function*(){var s;const o=e.data;if((s=n==null?void 0:n.duration)!=null||e.start!==void 0&&e.end!==void 0&&e.end-e.start,!!o)return new Promise((r,a)=>{let l=!1;this.addInterruptListener(()=>{if(!l)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),l=!0,a(new Error("play is interupted"))});try{if(l)return;const c=()=>{r(),l=!0};switch(o.effect){case"Move":this.move(o,n).then(c);break;case"Rotate":this.rotate(o,n).then(c);break;default:this.rotate(o,n).then(c)}}catch(c){}})})}actionPromiseQueue(){return _(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return _(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,n);else return Promise.resolve()})}rotate(e,n){return _(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n==null?void 0:n.duration)})}updateCamera(e,n=800){return _(this,null,function*(){const{five:o,privateState:s,state:r}=this;let a=n;const l=(()=>{var d,p;const u=(d=r.config)==null?void 0:d.speedConfig,h=(p=e.rotateSpeed)!=null?p:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return h;if(h!==void 0)return u.rotateSpeedUnit==="rad/ms"?h:h/1e3})();if(l){const u=this.five.getCurrentState();a=am(u,e)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(u=>{lm(()=>o.updateCamera(e,c)),setTimeout(()=>u(),c)})})}changePano(e,n){return _(this,null,function*(){var h;const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;o.getCurrentState().mode;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);let l=(h=n==null?void 0:n.duration)!=null?h:800;const c=(()=>{var m,g;const d=(m=r.config)==null?void 0:m.speedConfig,p=(g=e.moveSpeed)!=null?g:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return p;if(p!==void 0)return d.moveSpeedUnit==="m/ms"?p:p/1e3})();if(c&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=o.work.observers[o.panoIndex].position,p=o.work.observers[e.panoIndex].position;l=d.distanceTo(p)/c}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const u=this.getSpeededDuration(l);yield new Promise(d=>{var p,m,g;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:u,effect:(g=(m=n==null?void 0:n.moveEffect)!=null?m:(p=this.state.config)==null?void 0:p.moveEffect)!=null?g:e.moveEffect,moveCancelCallback:()=>d(),moveEndCallback:()=>d()}),a&&o.once("panoArrived",()=>d())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:o,privateState:s,hooks:r}=this,{currentPlayKeyframe:a}=s;if(r.emit("speedChange",e,{userAction:n}),o.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});s.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return _(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,n),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return eo.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return eo.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return eo.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(o=>o==null?void 0:o())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&fm()}waitFiveLoaded(){return _(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-dm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(to,"PluginVersion",Fr);const pm=i=>new to(i);function gm(i,t){t.forEach(e=>{const n=new P.SphereGeometry(.02,16,16),o=[],s=[new P.MeshBasicMaterial({color:16776960}),new P.MeshBasicMaterial({color:16711935}),new P.MeshBasicMaterial({color:16711680}),new P.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new P.Mesh(n,l);c.position.copy(rt(r)),o.push(c)});else{const r=s[0],a=new P.Mesh(n,r);a.position.copy(rt(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Se=i=>i;function Nr(i){if(i.length<3)return;const t=i.map(hn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function ui(i){if(Array.isArray(i)&&i.length===4){const t=i.map(hn);return Lo(t[0],t[2])}else return hn(i)}function di(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function Am(i,t){i.model.loaded?t():i.once("modelLoaded",()=>t())}function vm(i,t,e){const o=new P.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new P.Vector3(0,1,0)).setLength(.01),r=new P.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new P.Vector3))}const Wr=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function bm(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function ym(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function Xr(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}var Je=(i=>(i.Two="2D",i.Three="3D",i))(Je||{}),We=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(We||{}),Xe=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Link="Link",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.Custom="Custom",i))(Xe||{}),hi=(i=>(i.VrLink="vr",i.NormalLink="normal",i))(hi||{});function wm(i){le(i,"svelte-1omzoh4",".straight-line.svelte-1omzoh4{display:block;width:100%;height:100%;overflow:visible}")}function Yr(i){let t,e,n,o;return{c(){t=ve("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 0.5 L 148 0.5")},m(s,r){T(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&De(()=>{n&&n.end(1),e=Mt(t,Un,{duration:i[1],delay:i[0]}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=Zt(t,Un,{duration:i[1],delay:i[2]})),o=!1},d(s){s&&z(t),s&&n&&n.end()}}}function Cm(i){let t,e,n,o,s,r=i[3]&&Yr(i);return{c(){t=ve("svg"),e=ve("defs"),n=ve("linearGradient"),o=ve("stop"),s=ve("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","straight-line svelte-1omzoh4"),b(t,"viewBox","0 0 148 1"),b(t,"preserveAspectRatio","none")},m(a,l){T(a,t,l),Q(t,e),Q(e,n),Q(n,o),Q(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&k(r,1)):(r=Yr(a),r.c(),k(r,1),r.m(t,null)):r&&(ce(),B(r,1,1,()=>{r=null}),ue())},i(a){k(r)},o(a){B(r)},d(a){a&&z(t),r&&r.d()}}}function Pm(i,t,e){let{inDelay:n=0}=t,{duration:o=0}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=Fe();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class Ur extends se{constructor(t){super(),oe(this,t,Pm,Cm,ie,{inDelay:0,duration:1,outDelay:2,unfolded:3},wm)}}function Im(i){le(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Vr(i){let t,e,n,o,s;return{c(){t=j("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
530
+ `,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=Rf(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var A;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Of({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=A=>{if(A!==de.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,s()})};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Hf={name:"ItemLabelPlugin",version:0};class Nf extends _n{constructor(e){super(e);f(this,"state");f(this,"container");f(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(me(N({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(me(N({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(me(N({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(me(N({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=N({},this.state);this.state=N(N(N({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===de.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(me(N({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function Wf(i){le(i,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function Xf(i){let t,e,n,o,s,r,a,l;return{c(){t=j("div"),e=j("div"),n=j("span"),n.textContent=`${i[8]}`,o=Z(),s=j("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=Oe(Ze.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),b(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),b(e,"data-camera-toward",i[7]),b(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),b(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,u){T(c,t,u),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=Ie(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=Oe(Ze.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:ne,o:ne,d(c){c&&z(t),i[10](null),a=!1,l()}}}function Yf(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:h,name:d}=n,p=0;const m=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,w=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=w/2||a>=100-w/2)return;u!==p&&(console.log("panoDoorLabelPlugin",u,"\u89E6\u53D1\u57CB\u70B9"),p=u)},g=v=>{o&&o()};function A(v){Te[v?"unshift":"push"](()=>{s=v,e(2,s)})}return i.$$set=v=>{"props"in v&&e(0,n=v.props),"onClick"in v&&e(1,o=v.onClick)},m(),[n,o,s,r,a,l,c,h,d,g,A]}class Uf extends se{constructor(t){super(),oe(this,t,Yf,Xf,ie,{props:0,onClick:1},Wf)}}function Vf(i,t){const e=Math.abs(i.top+i.height/2-t.top-t.height/2),n=Math.abs(i.left+i.width/2-t.left-t.width/2),o=(i.height+t.height)/2,s=(i.width+t.width)/2;return!(e>o&&n>s)}function Jf(i){const{camera:t}=i,e=t.getWorldDirection(new G.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,o="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?o="right":n>45&&n<=135?o="back":n>135&&n<=225?o="left":n>225&&n<=315&&(o="forward"),o}function _f(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Zf(i){const t=Math.PI/4;return i>-t&&i<=t?"left":i>t*3||i<=-t*3?"right":i>-t*3&&i<=-t?"forward":i>t&&i<=t*3?"back":""}const qf={userAction:!0};class Kf extends Nf{constructor(e){super(e);f(this,"MinVisibledistance",1.8);f(this,"MaxVisibledistance",5);f(this,"OffsetHeight",-1.3);f(this,"rooms");f(this,"floorplanServerData");f(this,"doorLabelItems");f(this,"visibleLabelMap",new Map);f(this,"labelItems",[]);f(this,"doorLabels");f(this,"roomObservers");f(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});f(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,u=e==null?void 0:e.find(h=>h.floor_index===c);if(u){const h=u.rooms.find(d=>d.observer_indexs.includes(l));if(h)return{panoIndex:l,floorIndex:c,name:h.name}}}).filter(Boolean);this.roomObservers=o});f(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});f(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const u=l.position.clone(),h=u.distanceTo(s);if(h<this.MinVisibledistance||h>this.MaxVisibledistance)return;const d=new G.Raycaster,p=u.clone().sub(s).normalize();d.set(s,p);const[m]=this.five.model.intersectRaycaster(d);m&&m.distance+.1<h||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});f(this,"fixDoorPosition",()=>{var u,h,d,p,m,g,A,v,w,y,x,L;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const o=this.five.getElement(),s=o.clientWidth,r=o.clientHeight,a=n.getWorldDirection(new G.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,S)=>{if(C.visible){const D=n.position.distanceTo(C.position),H=C.position.clone().add(new G.Vector3(0,this.OffsetHeight,0)),W=H.clone().sub(n.position).normalize().angleTo(a),U=H.clone().project(n),I=(U.x+1)/2.2*100,E=(-U.y+1)/2.2*100,M=I>=0&&I<=100&&E>=0&&E<=100&&D>this.MinVisibledistance&&D<=this.MaxVisibledistance;C.left=I,C.top=E,C.inSight=M&&W<Math.PI/2,C.cameraToward=Jf(this.five),M?l.push({disFromCameraToLabel:D,left:I,top:E,index:S}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((S,D)=>D.disFromCameraToLabel-S.disFromCameraToLabel);for(let S=1;S<l.length;S++){const{index:D,left:H,top:R}=l[S-1],{index:W,left:U,top:I}=l[S],E=this.container.children[D],M=this.container.children[W];if(!E||!M)return;const F={left:s*H/100,top:r*R/100,width:(d=(h=(u=E.children)==null?void 0:u[0])==null?void 0:h.clientWidth)!=null?d:0,height:(g=(m=(p=E.children)==null?void 0:p[0])==null?void 0:m.clientHeight)!=null?g:0},X={left:s*U/100,top:r*I/100,width:(w=(v=(A=M.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?w:0,height:(L=(x=(y=M.children)==null?void 0:y[0])==null?void 0:x.clientHeight)!=null?L:0};Vf(F,X)&&(C++,c[D].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[W].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,h=n.distanceTo(u);h<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const u=new G.Vector3(0,0,-1),h=r.clone(),d=new G.Quaternion;d.setFromUnitVectors(u,h);const p=new G.Euler;p.setFromQuaternion(d,"YXZ"),l.longitude=p.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});f(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,h)=>!!r.observer_indexs.find(d=>d===h));a&&a.forEach(u=>{const h=u.position;let d=1/0,p;l.forEach(g=>{const A=g.standingPosition,v={x:A.x,y:A.y,z:A.z},w=_f(h,v);w<d&&(d=w,p=v)}),p&&(h.y=p.y+.01);const m=new G.Vector3(h.x,h.y,h.z);m.add(new G.Vector3(-.2,1.8,0).applyEuler(new G.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:m,toward:Zf(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>me(N({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:qf.userAction};this.hooks.emit("stateChange",o)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new Uf({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this&&this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const $f=i=>new Kf(i),em=2,tm=3,nm=3,im=2;function om(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new P.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),h=[];let d=0;const p=i;return p.forEach((m,g)=>{let A=0,v=99999999;u.forEach((C,S)=>{const D=C.distanceTo(m);D<v&&(A=S,v=D)});const w=u[A+1],y=w==null?void 0:w.distanceTo(m),x=u[A-1],L=x==null?void 0:x.distanceTo(m);if(A>d&&A-d>1){let C=A;x!==void 0&&L>.8&&(C=A+1),x!==void 0&&L>.2&&L<.3?C=A:v>.2&&v<.3&&(C=A+1);let S=d;if(w!==void 0&&y>.2&&y<.3?S=d+1:v>.2&&v<.3&&(S=d),u[S]&&u[S+1]){const R=p[g-1];if(R)if(R.equals(u[S]))S+=1;else{const W=new G.Vector3().subVectors(u[S+1],u[S]),U=new G.Vector3().subVectors(R,u[S]);W.angleTo(U)<Math.PI/2&&(S+=1)}}if(C<S||C-S<=1)return;const D=u.slice(S,C),H=Mr(D,e,n);h.push(H),d=A}}),h}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[Mr(u,e,n)]}}function Mr(i,t,e){const n=t/2,o=e/t,s=i.length,r=cl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*em*tm,c=2*s,u=c*nm,h=c*im,d=new Uint32Array(l),p=new Float32Array(u),m=new Float32Array(h);i.forEach((v,w)=>{});let g=0;for(let v=0;v<i.length;v++){const[w,y]=r[v][0],x=i[v],{x:L,y:C,z:S}=x,D=new G.Vector3(L+w*n,C+.05,S+y*n);p[v*6+0]=D.x,p[v*6+1]=D.y,p[v*6+2]=D.z;const H=new G.Vector3(L-w*n,C+.05,S-y*n);p[v*6+3]=H.x,p[v*6+4]=H.y,p[v*6+5]=H.z,g+=v>0?i[v-1].clone().sub(i[v]).length():0;const R=g/t/o;m[v*4+0]=0,m[v*4+1]=R,m[v*4+2]=1,m[v*4+3]=R,v!==i.length-1&&(d[v*6+0]=v*2+0,d[v*6+1]=v*2+2,d[v*6+2]=v*2+1,d[v*6+3]=v*2+2,d[v*6+4]=v*2+3,d[v*6+5]=v*2+1)}const A=new P.BufferGeometry;return A.setAttribute("position",new P.BufferAttribute(p,3)),A.setAttribute("uv",new P.BufferAttribute(m,2)),A.setIndex(new P.BufferAttribute(d,1)),A}function sm(i){const t=new P.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=P.RepeatWrapping,t.encoding=P.sRGBEncoding,new P.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function rm(i){return!Ot(i)}function Ot(i){return i!=null}const Br="v1.0.1",Tr="GuideLinePlugin",$i=`${Tr}@${Br}`,jr=i=>`${$i}--${i}`;class Qr extends Tt{constructor(e,n){super(e,n);f(this,"state",{visible:!1,enabled:!0,disposed:!1});f(this,"data");f(this,"linesGroup");f(this,"disposedErrorLog",()=>{console.error(`${$i} is disposed`)});f(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Tr}_DEBUG__`]:this})}load(e,n,o=!0){return _(this,null,function*(){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.log(`${$i} loaded`,r))})}formatData(e){return _(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}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){var s;if(this.state.disposed)return this.disposedErrorLog();const o=N({},this.state);this.state=N(N({},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,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),$e(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e){const n=e.map(this.getLine.bind(this)).filter(Ot),o=new P.Group;if(o.name=jr("route-group"),n.length!==0)return o.add(...n),o}getLine(e){var a,l,c,u;const n=new P.Group,o=e.panoIndexList.map(h=>{var d;return(d=this.five.work.observers[h])==null?void 0:d.standingPosition}).filter(Ot),s=om(o,{skipPanoIndexMesh:(a=e.skipPanoIndexMesh)!=null?a:!0,unitWidth:(l=e.unitWidth)!=null?l:.6,unitHeight:(c=e.unitHeight)!=null?c:.4});if(!s)return;const r=sm({textureUrl:(u=e.arrowTextureUrl)!=null?u:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return s.forEach(h=>{const d=new P.Mesh(h,r);d.name=jr("route-line-mesh"),n.add(d)}),n}waitFiveModelLoaded(){return _(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}f(Qr,"lasestVersion",Br);const Or=(i,t)=>new Qr(i,t);function Rr(i){const t=Math.abs(Math.cos(i.latitude));return new P.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function am(i,t){const e=Rr(i),n=Rr(t);return e.angleTo(n)}const lm=i=>_(this,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),li=Math.PI*2;function cm(i){return i>=0&&i<li?i:(i%li+li)%li}function um(i){return{longitude:cm(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function dm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function hm(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Fr="v1.0.6",Gr="CruisePlugin",ci=`${Gr}@${Fr}`,Hr=()=>{console.error(`${ci} is disposed`)},fm=()=>{console.warn(`${ci} is disabled`)},mm=()=>{console.error(`${ci} is disabled`)},eo=new Map;class to extends Tt{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Gr}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return _(this,null,function*(){var u,h,d,p,m;if(this.state.disposed)return Hr();this.privateState.fiveOriginGetProgress||(h=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(p=(d=this.five.controller)==null?void 0:d.cameraMotion)==null?void 0:p.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(g=>g.data.panoIndex!==void 0);c.filter((g,A)=>{var v;return g.data.panoIndex!==((v=c[A-1])==null?void 0:v.data.panoIndex)}).map(g=>g.data.panoIndex).forEach(g=>{var v,w;const A=(v=this.five.work.observers[g])==null?void 0:v.floorIndex;if(A!==void 0)if(l===A){const y=a.length-1;a[y]=[...(w=a[y])!=null?w:[],g]}else{l=A;const y=a.length;a[y]=[g]}}),this.GuideLine||(this.GuideLine=Or(this.five,this.config)),(m=this.GuideLine)==null||m.load({routes:a.map(g=>({panoIndexList:g}))}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.log(`${ci} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:o,userAction:s}=e;this.state.playing&&this.setState({playing:!1},{userAction:s}),this.setState({playing:!0},{userAction:s,playFromIndex:n,playFromId:o})}playFromStart(e){return this.playFrom(me(N({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}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){var s;if(this.state.disposed)return Hr();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return mm();const o=N({},this.state);this.state=N(N({},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,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),$e(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return _(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:Fe(),keyframes:o.keyframes.map((s,r)=>{var c;const a=o.keyframes[r+1],l=(()=>!a||a.start===void 0||s.end===void 0?0:a.start-s.end)();return N({id:(c=s.uuid)!=null?c:Fe(),moveIndex:r,stay:l,index:r},s)})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=o;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,o.panoIndexList.forEach((c,u)=>{const h=(()=>{var A,v,w,y;const d=o.panoIndexList.slice(u).find(x=>x!==c);if(d===void 0)return;const p=(A=n[c])==null?void 0:A.position,m=(v=n[d])==null?void 0:v.position;if(!m||!p||((w=n[c])==null?void 0:w.floorIndex)!==((y=n[d])==null?void 0:y.floorIndex))return;const g=new P.Vector3().subVectors(m,p);return um(g)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:u,stay:o.stay,data:N({effect:"Move",panoIndex:c,moveEffect:r},h!=null?h:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:u,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),h&&s.push({moveIndex:u,stay:o.stay,data:N({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:Fe(),keyframes:s.map((c,u)=>N({id:Fe(),index:u},c))}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return _(this,null,function*(){var p;const{data:n,state:o,privateState:s,hooks:r}=this;if(s.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=Fe();s.playId=a,s.playing=!0,s.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(p=e==null?void 0:e.userAction)!=null?p:!0});let u=!1;const d=yield(()=>_(this,null,function*(){var m,g;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(m=this.data)==null?void 0:m.keyframes.findIndex(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(g=this.data)==null?void 0:g.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:v}),u=!0,A.index+1}}}}))();this.clearPauseData();for(const m of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(d!==void 0&&m.index<d))try{r.emit("playIndexChange",m.index,m),yield this.playKeyframe(m,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:u===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:800}),m.stay&&(yield hm(m.stay)),u===!1&&(u=!0)}catch(g){return Promise.resolve("broke")}}o.playing&&a===s.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:o,hooks:s}=this;n.playing=!1,o.playing!==!1&&(o.playing=!1,this.setPauseData(),o.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&s.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return _(this,null,function*(){var s;const{privateState:o}=this;return((s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),o.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},o=e;return this.five.once("gesture",o),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",o),this.five.once("wantsChangeMode",n)}}getPlayPromise(e,n){return _(this,null,function*(){var s;const o=e.data;if((s=n==null?void 0:n.duration)!=null||e.start!==void 0&&e.end!==void 0&&e.end-e.start,!!o)return new Promise((r,a)=>{let l=!1;this.addInterruptListener(()=>{if(!l)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),l=!0,a(new Error("play is interupted"))});try{if(l)return;const c=()=>{r(),l=!0};switch(o.effect){case"Move":this.move(o,n).then(c);break;case"Rotate":this.rotate(o,n).then(c);break;default:this.rotate(o,n).then(c)}}catch(c){}})})}actionPromiseQueue(){return _(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return _(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,n);else return Promise.resolve()})}rotate(e,n){return _(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n==null?void 0:n.duration)})}updateCamera(e,n=800){return _(this,null,function*(){const{five:o,privateState:s,state:r}=this;let a=n;const l=(()=>{var d,p;const u=(d=r.config)==null?void 0:d.speedConfig,h=(p=e.rotateSpeed)!=null?p:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return h;if(h!==void 0)return u.rotateSpeedUnit==="rad/ms"?h:h/1e3})();if(l){const u=this.five.getCurrentState();a=am(u,e)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(u=>{lm(()=>o.updateCamera(e,c)),setTimeout(()=>u(),c)})})}changePano(e,n){return _(this,null,function*(){var h;const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;o.getCurrentState().mode;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);let l=(h=n==null?void 0:n.duration)!=null?h:800;const c=(()=>{var m,g;const d=(m=r.config)==null?void 0:m.speedConfig,p=(g=e.moveSpeed)!=null?g:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return p;if(p!==void 0)return d.moveSpeedUnit==="m/ms"?p:p/1e3})();if(c&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=o.work.observers[o.panoIndex].position,p=o.work.observers[e.panoIndex].position;l=d.distanceTo(p)/c}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const u=this.getSpeededDuration(l);yield new Promise(d=>{var p,m,g;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:u,effect:(g=(m=n==null?void 0:n.moveEffect)!=null?m:(p=this.state.config)==null?void 0:p.moveEffect)!=null?g:e.moveEffect,moveCancelCallback:()=>d(),moveEndCallback:()=>d()}),a&&o.once("panoArrived",()=>d())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:o,privateState:s,hooks:r}=this,{currentPlayKeyframe:a}=s;if(r.emit("speedChange",e,{userAction:n}),o.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});s.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return _(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,n),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return eo.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return eo.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return eo.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(o=>o==null?void 0:o())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&fm()}waitFiveLoaded(){return _(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-dm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(to,"PluginVersion",Fr);const pm=i=>new to(i);function gm(i,t){t.forEach(e=>{const n=new P.SphereGeometry(.02,16,16),o=[],s=[new P.MeshBasicMaterial({color:16776960}),new P.MeshBasicMaterial({color:16711935}),new P.MeshBasicMaterial({color:16711680}),new P.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new P.Mesh(n,l);c.position.copy(rt(r)),o.push(c)});else{const r=s[0],a=new P.Mesh(n,r);a.position.copy(rt(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Se=i=>i;function Nr(i){if(i.length<3)return;const t=i.map(hn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function ui(i){if(Array.isArray(i)&&i.length===4){const t=i.map(hn);return Lo(t[0],t[2])}else return hn(i)}function di(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function Am(i,t){i.model.loaded?t():i.once("modelLoaded",()=>t())}function vm(i,t,e){const o=new P.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new P.Vector3(0,1,0)).setLength(.01),r=new P.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new P.Vector3))}const Wr=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function bm(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function ym(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function Xr(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}var Je=(i=>(i.Two="2D",i.Three="3D",i))(Je||{}),We=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(We||{}),Xe=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Link="Link",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.Custom="Custom",i))(Xe||{}),hi=(i=>(i.VrLink="vr",i.NormalLink="normal",i))(hi||{});function wm(i){le(i,"svelte-1omzoh4",".straight-line.svelte-1omzoh4{display:block;width:100%;height:100%;overflow:visible}")}function Yr(i){let t,e,n,o;return{c(){t=ve("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 0.5 L 148 0.5")},m(s,r){T(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&De(()=>{n&&n.end(1),e=Mt(t,Un,{duration:i[1],delay:i[0]}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=Zt(t,Un,{duration:i[1],delay:i[2]})),o=!1},d(s){s&&z(t),s&&n&&n.end()}}}function Cm(i){let t,e,n,o,s,r=i[3]&&Yr(i);return{c(){t=ve("svg"),e=ve("defs"),n=ve("linearGradient"),o=ve("stop"),s=ve("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","straight-line svelte-1omzoh4"),b(t,"viewBox","0 0 148 1"),b(t,"preserveAspectRatio","none")},m(a,l){T(a,t,l),Q(t,e),Q(e,n),Q(n,o),Q(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&k(r,1)):(r=Yr(a),r.c(),k(r,1),r.m(t,null)):r&&(ce(),B(r,1,1,()=>{r=null}),ue())},i(a){k(r)},o(a){B(r)},d(a){a&&z(t),r&&r.d()}}}function Pm(i,t,e){let{inDelay:n=0}=t,{duration:o=0}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=Fe();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class Ur extends se{constructor(t){super(),oe(this,t,Pm,Cm,ie,{inDelay:0,duration:1,outDelay:2,unfolded:3},wm)}}function Im(i){le(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Vr(i){let t,e,n,o,s;return{c(){t=j("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
531
531
  left:${Ye(i[5])};
532
532
  bottom:${Ye(i[6])};
533
533
  box-shadow: 0 0 ${Ye(i[10])} ${Ye(i[11])} rgba(0, 0, 0, ${i[12]});