@realsee/dnalogel 2.6.2-dev.0 → 2.6.3-dev.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.
- package/dist/PanoTagPlugin/controller/TagCacheController.d.ts +3 -3
- package/dist/PanoTagPlugin/controller/index.d.ts +1 -1
- package/dist/PanoTagPlugin/typings/controller.d.ts +4 -0
- package/dist/PanoTagPlugin/typings/tag/TagData.d.ts +0 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.js +92 -63
- package/dist/index.umd.js +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/classes/CSS3DRender.html +31 -31
- package/docs/classes/CruisePluginController.html +24 -24
- package/docs/classes/Magnifier.html +20 -20
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +24 -24
- package/docs/classes/PaintBrush.html +15 -15
- package/docs/classes/PanoMeasurePluginLine.html +23 -23
- package/docs/classes/PanoMeasurePluginModel.html +22 -22
- package/docs/classes/PanoMeasurePluginPoint.html +14 -14
- package/docs/classes/PanoMeasurePluginPolyline.html +26 -26
- package/docs/classes/PanoTagPluginController.html +43 -43
- package/docs/classes/Util.BetterTween.html +8 -8
- package/docs/classes/Util.FivePointSelector.html +12 -12
- package/docs/classes/Util.Interval.html +12 -12
- package/docs/classes/Util.Magnifier.html +17 -17
- package/docs/classes/Util.PointDomHelper.html +11 -11
- package/docs/classes/Util.PointHelper.html +11 -11
- package/docs/classes/Util.Rectangle.html +13 -13
- package/docs/enums/CameraMovementEffect.html +7 -7
- package/docs/enums/ContentType.html +52 -56
- package/docs/enums/DIRECTION.html +9 -9
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/DimensionType.html +7 -7
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/PaintBrushTypeEnum.html +8 -8
- package/docs/enums/PointType.html +7 -7
- package/docs/enums/Rotation.html +8 -8
- package/docs/functions/CSS3DRenderPlugin.html +5 -5
- package/docs/functions/CameraMovementPlugin.html +5 -5
- package/docs/functions/CruisePlugin.html +5 -5
- package/docs/functions/GuideLinePlugin.html +6 -6
- package/docs/functions/ItemLabelPlugin.html +5 -5
- package/docs/functions/MapviewFloorplanPlugin.html +5 -5
- package/docs/functions/ModelChassisCompassPlugin.html +5 -5
- package/docs/functions/ModelEntryDoorGuidePlugin.html +5 -5
- package/docs/functions/ModelFloorplanPlugin.html +5 -5
- package/docs/functions/ModelItemLabelPlugin.html +5 -5
- package/docs/functions/ModelRoomLabelPlugin.html +5 -5
- package/docs/functions/ModelTVVideoPlugin.html +5 -5
- package/docs/functions/ModelViewPlugin.html +5 -5
- package/docs/functions/Object3DHelperPlugin.html +5 -5
- package/docs/functions/PanoCompassPlugin.html +5 -5
- package/docs/functions/PanoCursorRaycasterPlugin.html +5 -5
- package/docs/functions/PanoDoorLabelPlugin.html +5 -5
- package/docs/functions/PanoFloorplanRadarPlugin.html +5 -5
- package/docs/functions/PanoMeasurePlugin.html +5 -5
- package/docs/functions/PanoRulerPlugin.html +5 -5
- package/docs/functions/PanoRulerProPlugin.html +5 -5
- package/docs/functions/PanoSpatialTagPlugin.html +5 -5
- package/docs/functions/PanoTagPlugin.html +5 -5
- package/docs/functions/TopviewFloorplanPlugin.html +5 -5
- package/docs/functions/Util.getCoordsFromClient.html +5 -5
- package/docs/functions/Util.getCoordsFromElement.html +5 -5
- package/docs/functions/Util.getFrameTime.html +5 -5
- package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
- package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
- package/docs/functions/Util.isNil.html +5 -5
- package/docs/functions/Util.nextFrame.html +5 -5
- package/docs/functions/Util.notNil.html +5 -5
- package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
- package/docs/functions/Util.tweenProgress.html +5 -5
- package/docs/functions/pluginFlag.html +6 -6
- package/docs/index.html +5 -5
- package/docs/interfaces/AddTagConfig.html +6 -6
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
- package/docs/interfaces/EventMap.html +15 -15
- package/docs/interfaces/FloorplanBounding.html +8 -8
- package/docs/interfaces/FloorplanData.html +10 -10
- package/docs/interfaces/FloorplanEntrance.html +11 -11
- package/docs/interfaces/FloorplanExtraObject.html +10 -10
- package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
- package/docs/interfaces/FloorplanFloorData.html +9 -9
- package/docs/interfaces/FloorplanImagePosition.html +7 -7
- package/docs/interfaces/FloorplanObserver.html +9 -9
- package/docs/interfaces/FloorplanOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanPosition.html +7 -7
- package/docs/interfaces/FloorplanRoomItem.html +13 -13
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
- package/docs/interfaces/FloorplanServerBounding.html +8 -8
- package/docs/interfaces/FloorplanServerComputedData.html +10 -10
- package/docs/interfaces/FloorplanServerData.html +7 -7
- package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
- package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
- package/docs/interfaces/FloorplanServerEntrance.html +11 -11
- package/docs/interfaces/FloorplanServerFloorData.html +9 -9
- package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
- package/docs/interfaces/FloorplanServerObserver.html +9 -9
- package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanServerPosition.html +7 -7
- package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
- package/docs/interfaces/ItemLabelPluginData.html +6 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
- package/docs/interfaces/MinMax.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
- package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
- package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
- package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
- package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
- package/docs/interfaces/ModelViewPluginExportType.html +11 -11
- package/docs/interfaces/Object3DHelperState.html +8 -8
- package/docs/interfaces/PaintBrushAction.html +12 -12
- package/docs/interfaces/PaintBrushConfigs.html +12 -12
- package/docs/interfaces/PaintBrushState.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +6 -6
- package/docs/interfaces/PanoMeasureParameterType.html +12 -12
- package/docs/interfaces/PanoMeasurePluginLineJson.html +8 -8
- package/docs/interfaces/PanoMeasurePluginOpenParameter.html +7 -7
- package/docs/interfaces/PanoMeasurePluginPointJson.html +7 -7
- package/docs/interfaces/PanoMeasurePluginPolylineJson.html +8 -8
- package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
- package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
- package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
- package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
- package/docs/interfaces/PanoRulerProPluginState.html +8 -8
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +6 -6
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +6 -6
- package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
- package/docs/interfaces/Point.html +8 -8
- package/docs/interfaces/Room.html +9 -9
- package/docs/interfaces/RoomInfo.html +7 -7
- package/docs/interfaces/RoomLabel.html +14 -14
- package/docs/interfaces/RoomRules.html +6 -6
- package/docs/interfaces/Rooms.html +6 -6
- package/docs/interfaces/Scissor.html +9 -9
- package/docs/interfaces/State.html +8 -8
- package/docs/interfaces/TagCache.html +26 -12
- package/docs/interfaces/TagConfig.html +10 -10
- package/docs/interfaces/TagIconUrl.html +9 -9
- package/docs/interfaces/Tags.html +9 -9
- package/docs/interfaces/TemporaryState.html +6 -6
- package/docs/interfaces/Util.MagnifierParameter.html +11 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
- package/docs/modules/Util.html +5 -5
- package/docs/modules.html +6 -6
- package/docs/types/ArrayPosition.html +6 -6
- package/docs/types/AudioAppearance.html +6 -6
- package/docs/types/AudioTagTypeConfigKey.html +6 -6
- package/docs/types/CSS3DRenderExportType.html +6 -6
- package/docs/types/CSS3DRenderPluginExportType.html +6 -6
- package/docs/types/CSS3DRenderPluginParameterType.html +6 -6
- package/docs/types/Color.html +6 -6
- package/docs/types/ContentTypeConfigKey.html +6 -6
- package/docs/types/ContentTypeConfigKeySplit.html +6 -6
- package/docs/types/ContentTypeMap.html +6 -6
- package/docs/types/Create3DDomContainerReturnType.html +6 -6
- package/docs/types/Create3DElementReturnType.html +6 -6
- package/docs/types/CruisePluginExportType.html +6 -6
- package/docs/types/Direction-1.html +6 -6
- package/docs/types/Direction4.html +6 -6
- package/docs/types/FloorplanRuleLabels.html +6 -6
- package/docs/types/FloorplanServerRuleLabels.html +6 -6
- package/docs/types/GuideLinePluginExportType.html +6 -6
- package/docs/types/HelperEventMap.html +6 -6
- package/docs/types/LoadTagConfig.html +6 -6
- package/docs/types/MapviewFloorplanPluginParameterType.html +6 -6
- package/docs/types/MapviewFloorplanPluginReturnType.html +6 -6
- package/docs/types/MediaData.html +6 -6
- package/docs/types/MediaStore.html +6 -6
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +6 -6
- package/docs/types/ModelFloorplanPluginParameterType.html +6 -6
- package/docs/types/ModelFloorplanPluginReturnType.html +6 -6
- package/docs/types/ModelRoomLabelPluginParameters.html +6 -6
- package/docs/types/ModelRoomLabelPluginReturnType.html +6 -6
- package/docs/types/MoveArgs.html +6 -6
- package/docs/types/MoveOpts.html +6 -6
- package/docs/types/Object3DHelperEventMap.html +6 -6
- package/docs/types/ObjectFit.html +6 -6
- package/docs/types/PaintBrushEventMap.html +6 -6
- package/docs/types/PanoCompassPluginData.html +6 -6
- package/docs/types/PanoCompassPluginExportType.html +6 -6
- package/docs/types/PanoCompassPluginParameterType.html +6 -6
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +6 -6
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +6 -6
- package/docs/types/PanoIndex.html +6 -6
- package/docs/types/PanoMeasurePluginEvent.html +6 -6
- package/docs/types/PanoMeasureReturnType.html +6 -6
- package/docs/types/PanoSpatialTagPluginId.html +6 -6
- package/docs/types/PanoTagPluginExportInterface.html +6 -6
- package/docs/types/PanoTagPluginParamsInterface.html +6 -6
- package/docs/types/PlaneTag.html +6 -6
- package/docs/types/PlaneTagElement.html +6 -6
- package/docs/types/Point2DElement.html +6 -6
- package/docs/types/Point2DTag.html +6 -6
- package/docs/types/Point3DElement.html +6 -6
- package/docs/types/Point3DTag.html +6 -6
- package/docs/types/PointTag.html +6 -6
- package/docs/types/PointTagElement.html +6 -6
- package/docs/types/Position.html +6 -6
- package/docs/types/RotateArgs.html +6 -6
- package/docs/types/RotateOpts.html +6 -6
- package/docs/types/RuleLabelsKey.html +6 -6
- package/docs/types/RuleLabelsValue.html +6 -6
- package/docs/types/StickType.html +6 -6
- package/docs/types/Tag.html +6 -6
- package/docs/types/Tag2D.html +6 -6
- package/docs/types/Tag3D.html +6 -6
- package/docs/types/TagContentType.html +6 -6
- package/docs/types/TagDimensionType.html +6 -6
- package/docs/types/TagElement.html +6 -6
- package/docs/types/TagEvents.html +6 -6
- package/docs/types/TagHooks.html +6 -6
- package/docs/types/TagIconSize.html +6 -6
- package/docs/types/TagId.html +6 -6
- package/docs/types/TagPointType.html +6 -6
- package/docs/types/TopviewFloorplanPluginParameterType.html +6 -6
- package/docs/types/TopviewFloorplanPluginReturnType.html +6 -6
- package/docs/types/WorkCode.html +6 -6
- package/docs/variables/FLOOR_TYPE_MAP.html +6 -6
- package/docs/variables/PLUGIN.html +6 -6
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +6 -6
- package/docs/variables/ROOM_TYPE_MAP.html +6 -6
- package/docs/variables/VERSION.html +6 -6
- package/docs/variables/itemLabelPluginServerParams.html +6 -6
- package/docs/variables/modelItemLabelPluginServerParams.html +6 -6
- package/docs/variables/modelRoomLabelPluginServerParams.html +6 -6
- package/libs/CruisePlugin/Controller.js +124 -124
- package/libs/GuideLinePlugin/Controller.js +51 -51
- package/libs/PanoTagPlugin/controller/TagCacheController.d.ts +3 -3
- package/libs/PanoTagPlugin/controller/TagCacheController.js +6 -6
- package/libs/PanoTagPlugin/controller/TagComputer.js +159 -130
- package/libs/PanoTagPlugin/controller/index.d.ts +1 -1
- package/libs/PanoTagPlugin/typings/controller.d.ts +4 -0
- package/libs/PanoTagPlugin/typings/tag/TagData.d.ts +0 -1
- package/package.json +1 -1
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=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=gm(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{d(),e.container.remove()},l=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new pm({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",f),i.once("dispose",a)},d=()=>{i.off("modeChange",f)},f=g=>{if(g!==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}},bm={name:"ItemLabelPlugin",version:0};class ym extends li{constructor(e){super(e);m(this,"state");m(this,"container");m(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(G({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(he(G({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(he(G({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(he(G({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=G({},this.state);this.state=G(G(G({},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(G({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function wm(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 Cm(i){let t,e,n,o,s,r,a,l;return{c(){t=V("div"),e=V("div"),n=V("span"),n.textContent=`${i[8]}`,o=ee(),s=V("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=je(Ye.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,d){z(c,t,d),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=Se(e,"click",i[9]),a=!0)},p(c,[d]){d&1&&r!==(r=je(Ye.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:Z,o:Z,d(c){c&&M(t),i[10](null),a=!1,l()}}}function Pm(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:d,cameraToward:f,name:u}=n,h=0;const p=()=>{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;d!==h&&(console.log("panoDoorLabelPlugin",d,"\u89E6\u53D1\u57CB\u70B9"),h=d)},A=v=>{o&&o()};function g(v){Le[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)},p(),[n,o,s,r,a,l,c,f,u,A,g]}class Em extends oe{constructor(t){super(),ie(this,t,Pm,Cm,ne,{props:0,onClick:1},wm)}}function Im(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 km(i){const{camera:t}=i,e=t.getWorldDirection(new H.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 xm(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 Lm={userAction:!0};class Sm extends ym{constructor(e){super(e);m(this,"MinVisibledistance",1.8);m(this,"MaxVisibledistance",5);m(this,"OffsetHeight",-1.3);m(this,"rooms");m(this,"floorplanServerData");m(this,"doorLabelItems");m(this,"visibleLabelMap",new Map);m(this,"labelItems",[]);m(this,"doorLabels");m(this,"roomObservers");m(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()})});m(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,d=e==null?void 0:e.find(f=>f.floor_index===c);if(d){const f=d.rooms.find(u=>u.observer_indexs.includes(l));if(f)return{panoIndex:l,floorIndex:c,name:f.name}}}).filter(Boolean);this.roomObservers=o});m(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});m(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 d=l.position.clone(),f=d.distanceTo(s);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const u=new H.Raycaster,h=d.clone().sub(s).normalize();u.set(s,h);const[p]=this.five.model.intersectRaycaster(u);p&&p.distance+.1<f||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});m(this,"fixDoorPosition",()=>{var d,f,u,h,p,A,g,v,w,y,E,I;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 H.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,L)=>{if(C.visible){const D=n.position.distanceTo(C.position),B=C.position.clone().add(new H.Vector3(0,this.OffsetHeight,0)),F=B.clone().sub(n.position).normalize().angleTo(a),X=B.clone().project(n),j=(X.x+1)/2.2*100,P=(-X.y+1)/2.2*100,R=j>=0&&j<=100&&P>=0&&P<=100&&D>this.MinVisibledistance&&D<=this.MaxVisibledistance;C.left=j,C.top=P,C.inSight=R&&F<Math.PI/2,C.cameraToward=km(this.five),R?l.push({disFromCameraToLabel:D,left:j,top:P,index:L}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((L,D)=>D.disFromCameraToLabel-L.disFromCameraToLabel);for(let L=1;L<l.length;L++){const{index:D,left:B,top:N}=l[L-1],{index:F,left:X,top:j}=l[L],P=this.container.children[D],R=this.container.children[F];if(!P||!R)return;const O={left:s*B/100,top:r*N/100,width:(u=(f=(d=P.children)==null?void 0:d[0])==null?void 0:f.clientWidth)!=null?u:0,height:(A=(p=(h=P.children)==null?void 0:h[0])==null?void 0:p.clientHeight)!=null?A:0},W={left:s*X/100,top:r*j/100,width:(w=(v=(g=R.children)==null?void 0:g[0])==null?void 0:v.clientWidth)!=null?w:0,height:(I=(E=(y=R.children)==null?void 0:y[0])==null?void 0:E.clientHeight)!=null?I:0};Im(O,W)&&(C++,c[D].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[F].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});m(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(d=>d.panoIndex===l.panoIndex&&d.name===e)){const d=l.standingPosition,f=n.distanceTo(d);f<a&&(s=l.panoIndex,r=d.clone().sub(n).normalize(),a=f)}if(r!==null&&s!==null){const l={};if(a>0){const d=new H.Vector3(0,0,-1),f=r.clone(),u=new H.Quaternion;u.setFromUnitVectors(d,f);const h=new H.Euler;h.setFromQuaternion(u,"YXZ"),l.longitude=h.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});m(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(d=>!!(d&&d.name===r.name)),l=this.five.work.observers.filter((d,f)=>!!r.observer_indexs.find(u=>u===f));a&&a.forEach(d=>{const f=d.position;let u=1/0,h;l.forEach(A=>{const g=A.standingPosition,v={x:g.x,y:g.y,z:g.z},w=xm(f,v);w<u&&(u=w,h=v)}),h&&(f.y=h.y+.01);const p=new H.Vector3(f.x,f.y,f.z);p.add(new H.Vector3(-.2,1.8,0).applyEuler(new H.Euler(0,d.rad,0))),this.doorLabels.push({roomName:r.name,name:d.name,position:p,toward:Dm(d.rad)})})}),this.labelItems=this.doorLabels.map(r=>he(G({},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:Lm.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 Em({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 Tm=i=>new Sm(i),Mm=2,zm=3,Bm=3,Vm=2;function jm(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 x.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),d=s.getPoints(c),f=[];let u=0;const h=i;return h.forEach((p,A)=>{let g=0,v=99999999;d.forEach((C,L)=>{const D=C.distanceTo(p);D<v&&(g=L,v=D)});const w=d[g+1],y=w==null?void 0:w.distanceTo(p),E=d[g-1],I=E==null?void 0:E.distanceTo(p);if(g>u&&g-u>1){let C=g;E!==void 0&&I>.8&&(C=g+1),E!==void 0&&I>.2&&I<.3?C=g:v>.2&&v<.3&&(C=g+1);let L=u;if(w!==void 0&&y>.2&&y<.3?L=u+1:v>.2&&v<.3&&(L=u),d[L]&&d[L+1]){const N=h[A-1];if(N)if(N.equals(d[L]))L+=1;else{const F=new H.Vector3().subVectors(d[L+1],d[L]),X=new H.Vector3().subVectors(N,d[L]);F.angleTo(X)<Math.PI/2&&(L+=1)}}if(C<L||C-L<=1)return;const D=d.slice(L,C),B=Os(D,e,n);f.push(B),u=g}}),f}else{const c=Math.ceil(s.getLength()),d=s.getPoints(c);return[Os(d,e,n)]}}function Os(i,t,e){const n=t/2,o=e/t,s=i.length,r=jl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*Mm*zm,c=2*s,d=c*Bm,f=c*Vm,u=new Uint32Array(l),h=new Float32Array(d),p=new Float32Array(f);i.forEach((v,w)=>{});let A=0;for(let v=0;v<i.length;v++){const[w,y]=r[v][0],E=i[v],{x:I,y:C,z:L}=E,D=new H.Vector3(I+w*n,C+.05,L+y*n);h[v*6+0]=D.x,h[v*6+1]=D.y,h[v*6+2]=D.z;const B=new H.Vector3(I-w*n,C+.05,L-y*n);h[v*6+3]=B.x,h[v*6+4]=B.y,h[v*6+5]=B.z,A+=v>0?i[v-1].clone().sub(i[v]).length():0;const N=A/t/o;p[v*4+0]=0,p[v*4+1]=N,p[v*4+2]=1,p[v*4+3]=N,v!==i.length-1&&(u[v*6+0]=v*2+0,u[v*6+1]=v*2+2,u[v*6+2]=v*2+1,u[v*6+3]=v*2+2,u[v*6+4]=v*2+3,u[v*6+5]=v*2+1)}const g=new x.BufferGeometry;return g.setAttribute("position",new x.BufferAttribute(h,3)),g.setAttribute("uv",new x.BufferAttribute(p,2)),g.setIndex(new x.BufferAttribute(u,1)),g}function Qm(i){const t=new x.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=x.RepeatWrapping,t.encoding=x.sRGBEncoding,new x.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function Rm(i){return!We(i)}function We(i){return i!=null}const Ya="v1.1.0",Ua="GuideLinePlugin",Gi=`${Ua}@${Ya}`,Hs=i=>`${Gi}--${i}`;class Ja extends Ht{constructor(e,n){super(e,n);m(this,"state",{visible:!1,enabled:!0,disposed:!1});m(this,"data");m(this,"linesGroup");m(this,"disposedErrorLog",()=>{console.error(`${Gi} is disposed`)});m(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Ua}_DEBUG__`]:this})}load(e,n,o=!0){return Y(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,r.config);!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(`${Gi} loaded`,r))})}formatData(e){return Y(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return Y(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Y(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=G({},this.state);this.state=G(G({},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),Je(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,n){const o=e.map(r=>this.getLine(r,n)).filter(We),s=new x.Group;if(s.name=Hs("route-group"),o.length!==0)return s.add(...o),s}getLine(e,n){var l,c,d,f,u,h,p,A;const o=new x.Group,s=e.panoIndexList.map(g=>{var v;return(v=this.five.work.observers[g])==null?void 0:v.standingPosition}).filter(We),r=jm(s,{skipPanoIndexMesh:(c=(l=e.skipPanoIndexMesh)!=null?l:n==null?void 0:n.skipPanoIndexMesh)!=null?c:!0,unitWidth:(f=(d=e.unitWidth)!=null?d:n.unitWidth)!=null?f:.6,unitHeight:(h=(u=e.unitHeight)!=null?u:n.unitHeight)!=null?h:.4});if(!r)return;const a=Qm({textureUrl:(A=(p=e.arrowTextureUrl)!=null?p:n.arrowTextureUrl)!=null?A:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return r.forEach(g=>{const v=new x.Mesh(g,a);v.name=Hs("route-line-mesh"),o.add(v)}),o}waitFiveModelLoaded(){return Y(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}m(Ja,"lasestVersion",Ya);const Za=(i,t)=>new Ja(i,t);function Fs(i){const t=Math.abs(Math.cos(i.latitude));return new x.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Om(i,t){const e=Fs(i),n=Fs(t);return e.angleTo(n)}const Hm=i=>Y(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Tn=Math.PI*2;function Fm(i){return i>=0&&i<Tn?i:(i%Tn+Tn)%Tn}function Gm(i){return{longitude:Fm(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function Nm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function Wm(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const qa="v1.0.6",Ka="CruisePlugin",mi=`${Ka}@${qa}`,Gs=()=>{console.error(`${mi} is disposed`)},_m=()=>{console.warn(`${mi} is disabled`)},Xm=()=>{console.error(`${mi} is disabled`)},ki=new Map;class uo extends Ht{constructor(e,n){super(e,n);m(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});m(this,"data");m(this,"config");m(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});m(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Ka}_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 Y(this,null,function*(){var d,f,u,h,p;if(this.state.disposed)return Gs();this.privateState.fiveOriginGetProgress||(f=(d=this.five.controller)==null?void 0:d.cameraMotion)!=null&&f.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(h=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:h.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(A=>A.data.panoIndex!==void 0);c.filter((A,g)=>{var v;return A.data.panoIndex!==((v=c[g-1])==null?void 0:v.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var v,w;const g=(v=this.five.work.observers[A])==null?void 0:v.floorIndex;if(g!==void 0)if(l===g){const y=a.length-1;a[y]=[...(w=a[y])!=null?w:[],A]}else{l=g;const y=a.length;a[y]=[A]}}),this.GuideLine||(this.GuideLine=Za(this.five,this.config)),(p=this.GuideLine)==null||p.load({routes:a.map(A=>({panoIndexList:A})),config:r.guildPluginOptions}),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(`${mi} 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(G({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return Y(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Y(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 Gs();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Xm();const o=G({},this.state);this.state=G(G({},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),Je(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 Y(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 he(G({id:(c=s.uuid)!=null?c:He(),moveIndex:r,stay:l,index:r},s),{guildPluginOptions:o.guildPluginOptions})})};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,d)=>{const f=(()=>{var g,v,w,y;const u=o.panoIndexList.slice(d).find(E=>E!==c);if(u===void 0)return;const h=(g=n[c])==null?void 0:g.position,p=(v=n[u])==null?void 0:v.position;if(!p||!h||((w=n[c])==null?void 0:w.floorIndex)!==((y=n[u])==null?void 0:y.floorIndex))return;const A=new x.Vector3().subVectors(p,h);return Gm(A)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:d,stay:o.stay,data:G({effect:"Move",panoIndex:c,moveEffect:r},f!=null?f:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:d,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),f&&s.push({moveIndex:d,stay:o.stay,data:G({effect:"Rotate",panoIndex:c},f)}))}),{keyframesId:He(),keyframes:s.map((c,d)=>G({id:He(),index:d},c)),guildPluginOptions:o.guildPluginOptions}}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 Y(this,null,function*(){var h;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:(h=e==null?void 0:e.userAction)!=null?h:!0});let d=!1;const u=yield(()=>Y(this,null,function*(){var p,A;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(p=this.data)==null?void 0:p.keyframes.findIndex(g=>g.id===e.playFromId);if(c!=null&&c.keyframeId){const g=(A=this.data)==null?void 0:A.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),g){if(g.data.effect==="Move")return g.index;if(g.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(g,{duration:v}),d=!0,g.index+1}}}}))();this.clearPauseData();for(const p of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(u!==void 0&&p.index<u))try{r.emit("playIndexChange",p.index,p),yield this.playKeyframe(p,{moveEffect:d===!1?s.moveToFirstPanoEffect:void 0,duration:d===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:void 0}),p.stay&&(yield Wm(p.stay)),d===!1&&(d=!0)}catch(A){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 Y(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 Y(this,null,function*(){var s;const o=e.data;if(n.duration=(s=n==null?void 0:n.duration)!=null?s:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!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 Y(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 Y(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 Y(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)})}updateCamera(e,n){return Y(this,null,function*(){const{five:o,privateState:s,state:r}=this,a=(()=>{var u,h;const d=(u=r.config)==null?void 0:u.speedConfig,f=(h=e.rotateSpeed)!=null?h:d==null?void 0:d.rotateSpeed;if((d==null?void 0:d.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return d.rotateSpeedUnit==="rad/ms"?f:f/1e3})(),l=(()=>{if(n.duration)return n.duration;if(a){const d=this.five.getCurrentState();return Om(d,e)/a}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const c=this.getSpeededDuration(l);return new Promise(d=>{Hm(()=>o.updateCamera(e,c)),setTimeout(()=>d(),c)})})}changePano(e,n){return Y(this,null,function*(){const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var u,h;const d=(u=r.config)==null?void 0:u.speedConfig,f=(h=e.moveSpeed)!=null?h:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return f;if(f!==void 0)return d.moveSpeedUnit==="m/ms"?f:f/1e3})(),c=(()=>{if(n!=null&&n.duration)return n.duration;if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=o.work.observers[o.panoIndex].position,f=o.work.observers[e.panoIndex].position;return d.distanceTo(f)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(d=>{var f,u,h;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(h=(u=n==null?void 0:n.moveEffect)!=null?u:(f=this.state.config)==null?void 0:f.moveEffect)!=null?h: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 Y(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 ki.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return ki.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 ki.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&&_m()}waitFiveLoaded(){return Y(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-Nm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}m(uo,"PluginVersion",qa);const Ym=i=>new uo(i);function Um(i){le(i,"svelte-xuejcm",".line.svelte-xuejcm{position:absolute;pointer-events:none}.line.vertical.svelte-xuejcm{transform:rotate(-90deg) translate3d(0.03125rem, 0, 0.625rem);transform-origin:0 0}.line.horizontal.svelte-xuejcm{transform:translate3d(0, -0.03125rem, 0.625rem)}.straight-line.svelte-xuejcm{display:block;width:100%;height:100%;overflow:visible}")}function Ns(i){let t,e,n,o,s,r,a,l=i[3]&&Ws(i);return{c(){t=V("div"),e=Ae("svg"),n=Ae("defs"),o=Ae("linearGradient"),s=Ae("stop"),r=Ae("stop"),l&&l.c(),b(s,"offset","25%"),b(s,"stop-color",i[5]),b(s,"stop-opacity","1"),b(r,"offset","100%"),b(r,"stop-color",i[5]),b(r,"stop-opacity","0.5"),b(o,"x1",.5),b(o,"y1",.5),b(o,"x2",i[8]),b(o,"y2",.5),b(o,"id",i[10]),b(o,"gradientUnits","userSpaceOnUse"),b(e,"class","straight-line svelte-xuejcm"),b(e,"viewBox",a="0 0 "+i[8]+" "+i[7]),b(e,"preserveAspectRatio","none"),b(t,"class","line svelte-xuejcm"),te(t,"vertical",i[9]),te(t,"horizontal",!i[9]),T(t,"width",i[8]+"px"),T(t,"height",i[7]+"px")},m(c,d){z(c,t,d),Q(t,e),Q(e,n),Q(n,o),Q(o,s),Q(o,r),l&&l.m(e,null)},p(c,d){d&32&&b(s,"stop-color",c[5]),d&32&&b(r,"stop-color",c[5]),d&256&&b(o,"x2",c[8]),c[3]?l?(l.p(c,d),d&8&&k(l,1)):(l=Ws(c),l.c(),k(l,1),l.m(e,null)):l&&(se(),S(l,1,1,()=>{l=null}),re()),d&384&&a!==(a="0 0 "+c[8]+" "+c[7])&&b(e,"viewBox",a),d&512&&te(t,"vertical",c[9]),d&512&&te(t,"horizontal",!c[9]),d&256&&T(t,"width",c[8]+"px"),d&128&&T(t,"height",c[7]+"px")},d(c){c&&M(t),l&&l.d()}}}function Ws(i){let t,e,n,o,s;return{c(){t=Ae("path"),b(t,"fill","none"),b(t,"stroke",e=i[4]?`url(#${i[10]})`:i[5]),b(t,"stroke-width",1),b(t,"d",i[6])},m(r,a){z(r,t,a),s=!0},p(r,a){i=r,(!s||a&48&&e!==(e=i[4]?`url(#${i[10]})`:i[5]))&&b(t,"stroke",e),(!s||a&64)&&b(t,"d",i[6])},i(r){s||(r&&De(()=>{o&&o.end(1),n=Rt(t,Kn,{duration:i[2],delay:i[0],easing:yt}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=tn(t,Kn,{duration:i[2],delay:i[1],easing:yt})),s=!1},d(r){r&&M(t),r&&o&&o.end()}}}function Jm(i){let t,e=i[8]&&Ns(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),z(n,t,o)},p(n,[o]){n[8]?e?e.p(n,o):(e=Ns(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:Z,o:Z,d(n){e&&e.d(n),n&&M(t)}}}function Zm(i,t,e){let n,o,s,r,{inDelay:a=0}=t,{outDelay:l=0}=t,{duration:c=1e3}=t,{unfolded:d}=t,{length:f}=t,{direction:u="horizontal"}=t,{useLinearColor:h=!1}=t,{color:p="white"}=t;const A=He();return i.$$set=g=>{"inDelay"in g&&e(0,a=g.inDelay),"outDelay"in g&&e(1,l=g.outDelay),"duration"in g&&e(2,c=g.duration),"unfolded"in g&&e(3,d=g.unfolded),"length"in g&&e(11,f=g.length),"direction"in g&&e(12,u=g.direction),"useLinearColor"in g&&e(4,h=g.useLinearColor),"color"in g&&e(5,p=g.color)},i.$$.update=()=>{i.$$.dirty&4096&&e(9,n=u==="vertical"),i.$$.dirty&2048&&e(8,o=f),i.$$.dirty&2048&&e(6,r=`M0.5 0.5 H ${f}`)},e(7,s=1),[a,l,c,d,h,p,r,s,o,n,A,f,u]}class fo extends oe{constructor(t){super(),ie(this,t,Zm,Jm,ne,{inDelay:0,outDelay:1,duration:2,unfolded:3,length:11,direction:12,useLinearColor:4,color:5},Um)}}function qm(i){le(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function _s(i){let t,e,n,o,s;return{c(){t=V("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
|
|
530
|
+
`,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=gm(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{d(),e.container.remove()},l=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new pm({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",f),i.once("dispose",a)},d=()=>{i.off("modeChange",f)},f=g=>{if(g!==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}},bm={name:"ItemLabelPlugin",version:0};class ym extends li{constructor(e){super(e);m(this,"state");m(this,"container");m(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(G({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(he(G({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(he(G({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(he(G({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=G({},this.state);this.state=G(G(G({},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(G({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function wm(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 Cm(i){let t,e,n,o,s,r,a,l;return{c(){t=V("div"),e=V("div"),n=V("span"),n.textContent=`${i[8]}`,o=ee(),s=V("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=je(Ye.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,d){z(c,t,d),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=Se(e,"click",i[9]),a=!0)},p(c,[d]){d&1&&r!==(r=je(Ye.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:Z,o:Z,d(c){c&&M(t),i[10](null),a=!1,l()}}}function Pm(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:d,cameraToward:f,name:u}=n,h=0;const p=()=>{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;d!==h&&(console.log("panoDoorLabelPlugin",d,"\u89E6\u53D1\u57CB\u70B9"),h=d)},A=v=>{o&&o()};function g(v){Le[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)},p(),[n,o,s,r,a,l,c,f,u,A,g]}class Em extends oe{constructor(t){super(),ie(this,t,Pm,Cm,ne,{props:0,onClick:1},wm)}}function Im(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 km(i){const{camera:t}=i,e=t.getWorldDirection(new H.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 xm(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 Lm={userAction:!0};class Sm extends ym{constructor(e){super(e);m(this,"MinVisibledistance",1.8);m(this,"MaxVisibledistance",5);m(this,"OffsetHeight",-1.3);m(this,"rooms");m(this,"floorplanServerData");m(this,"doorLabelItems");m(this,"visibleLabelMap",new Map);m(this,"labelItems",[]);m(this,"doorLabels");m(this,"roomObservers");m(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()})});m(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,d=e==null?void 0:e.find(f=>f.floor_index===c);if(d){const f=d.rooms.find(u=>u.observer_indexs.includes(l));if(f)return{panoIndex:l,floorIndex:c,name:f.name}}}).filter(Boolean);this.roomObservers=o});m(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});m(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 d=l.position.clone(),f=d.distanceTo(s);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const u=new H.Raycaster,h=d.clone().sub(s).normalize();u.set(s,h);const[p]=this.five.model.intersectRaycaster(u);p&&p.distance+.1<f||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});m(this,"fixDoorPosition",()=>{var d,f,u,h,p,A,g,v,w,y,E,I;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 H.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,L)=>{if(C.visible){const D=n.position.distanceTo(C.position),B=C.position.clone().add(new H.Vector3(0,this.OffsetHeight,0)),F=B.clone().sub(n.position).normalize().angleTo(a),X=B.clone().project(n),j=(X.x+1)/2.2*100,P=(-X.y+1)/2.2*100,R=j>=0&&j<=100&&P>=0&&P<=100&&D>this.MinVisibledistance&&D<=this.MaxVisibledistance;C.left=j,C.top=P,C.inSight=R&&F<Math.PI/2,C.cameraToward=km(this.five),R?l.push({disFromCameraToLabel:D,left:j,top:P,index:L}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((L,D)=>D.disFromCameraToLabel-L.disFromCameraToLabel);for(let L=1;L<l.length;L++){const{index:D,left:B,top:N}=l[L-1],{index:F,left:X,top:j}=l[L],P=this.container.children[D],R=this.container.children[F];if(!P||!R)return;const O={left:s*B/100,top:r*N/100,width:(u=(f=(d=P.children)==null?void 0:d[0])==null?void 0:f.clientWidth)!=null?u:0,height:(A=(p=(h=P.children)==null?void 0:h[0])==null?void 0:p.clientHeight)!=null?A:0},W={left:s*X/100,top:r*j/100,width:(w=(v=(g=R.children)==null?void 0:g[0])==null?void 0:v.clientWidth)!=null?w:0,height:(I=(E=(y=R.children)==null?void 0:y[0])==null?void 0:E.clientHeight)!=null?I:0};Im(O,W)&&(C++,c[D].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[F].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});m(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(d=>d.panoIndex===l.panoIndex&&d.name===e)){const d=l.standingPosition,f=n.distanceTo(d);f<a&&(s=l.panoIndex,r=d.clone().sub(n).normalize(),a=f)}if(r!==null&&s!==null){const l={};if(a>0){const d=new H.Vector3(0,0,-1),f=r.clone(),u=new H.Quaternion;u.setFromUnitVectors(d,f);const h=new H.Euler;h.setFromQuaternion(u,"YXZ"),l.longitude=h.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});m(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(d=>!!(d&&d.name===r.name)),l=this.five.work.observers.filter((d,f)=>!!r.observer_indexs.find(u=>u===f));a&&a.forEach(d=>{const f=d.position;let u=1/0,h;l.forEach(A=>{const g=A.standingPosition,v={x:g.x,y:g.y,z:g.z},w=xm(f,v);w<u&&(u=w,h=v)}),h&&(f.y=h.y+.01);const p=new H.Vector3(f.x,f.y,f.z);p.add(new H.Vector3(-.2,1.8,0).applyEuler(new H.Euler(0,d.rad,0))),this.doorLabels.push({roomName:r.name,name:d.name,position:p,toward:Dm(d.rad)})})}),this.labelItems=this.doorLabels.map(r=>he(G({},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:Lm.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 Em({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 Tm=i=>new Sm(i),Mm=2,zm=3,Bm=3,Vm=2;function jm(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 x.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),d=s.getPoints(c),f=[];let u=0;const h=i;return h.forEach((p,A)=>{let g=0,v=99999999;d.forEach((C,L)=>{const D=C.distanceTo(p);D<v&&(g=L,v=D)});const w=d[g+1],y=w==null?void 0:w.distanceTo(p),E=d[g-1],I=E==null?void 0:E.distanceTo(p);if(g>u&&g-u>1){let C=g;E!==void 0&&I>.8&&(C=g+1),E!==void 0&&I>.2&&I<.3?C=g:v>.2&&v<.3&&(C=g+1);let L=u;if(w!==void 0&&y>.2&&y<.3?L=u+1:v>.2&&v<.3&&(L=u),d[L]&&d[L+1]){const N=h[A-1];if(N)if(N.equals(d[L]))L+=1;else{const F=new H.Vector3().subVectors(d[L+1],d[L]),X=new H.Vector3().subVectors(N,d[L]);F.angleTo(X)<Math.PI/2&&(L+=1)}}if(C<L||C-L<=1)return;const D=d.slice(L,C),B=Os(D,e,n);f.push(B),u=g}}),f}else{const c=Math.ceil(s.getLength()),d=s.getPoints(c);return[Os(d,e,n)]}}function Os(i,t,e){const n=t/2,o=e/t,s=i.length,r=jl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*Mm*zm,c=2*s,d=c*Bm,f=c*Vm,u=new Uint32Array(l),h=new Float32Array(d),p=new Float32Array(f);i.forEach((v,w)=>{});let A=0;for(let v=0;v<i.length;v++){const[w,y]=r[v][0],E=i[v],{x:I,y:C,z:L}=E,D=new H.Vector3(I+w*n,C+.05,L+y*n);h[v*6+0]=D.x,h[v*6+1]=D.y,h[v*6+2]=D.z;const B=new H.Vector3(I-w*n,C+.05,L-y*n);h[v*6+3]=B.x,h[v*6+4]=B.y,h[v*6+5]=B.z,A+=v>0?i[v-1].clone().sub(i[v]).length():0;const N=A/t/o;p[v*4+0]=0,p[v*4+1]=N,p[v*4+2]=1,p[v*4+3]=N,v!==i.length-1&&(u[v*6+0]=v*2+0,u[v*6+1]=v*2+2,u[v*6+2]=v*2+1,u[v*6+3]=v*2+2,u[v*6+4]=v*2+3,u[v*6+5]=v*2+1)}const g=new x.BufferGeometry;return g.setAttribute("position",new x.BufferAttribute(h,3)),g.setAttribute("uv",new x.BufferAttribute(p,2)),g.setIndex(new x.BufferAttribute(u,1)),g}function Qm(i){const t=new x.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=x.RepeatWrapping,t.encoding=x.sRGBEncoding,new x.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function Rm(i){return!We(i)}function We(i){return i!=null}const Ya="v1.1.0",Ua="GuideLinePlugin",Gi=`${Ua}@${Ya}`,Hs=i=>`${Gi}--${i}`;class Ja extends Ht{constructor(e,n){super(e,n);m(this,"state",{visible:!1,enabled:!0,disposed:!1});m(this,"data");m(this,"linesGroup");m(this,"disposedErrorLog",()=>{console.error(`${Gi} is disposed`)});m(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Ua}_DEBUG__`]:this})}load(e,n,o=!0){return Y(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,r.config);!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(`${Gi} loaded`,r))})}formatData(e){return Y(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return Y(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Y(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=G({},this.state);this.state=G(G({},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),Je(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,n){const o=e.map(r=>this.getLine(r,n)).filter(We),s=new x.Group;if(s.name=Hs("route-group"),o.length!==0)return s.add(...o),s}getLine(e,n){var l,c,d,f,u,h,p,A;const o=new x.Group,s=e.panoIndexList.map(g=>{var v;return(v=this.five.work.observers[g])==null?void 0:v.standingPosition}).filter(We),r=jm(s,{skipPanoIndexMesh:(c=(l=e.skipPanoIndexMesh)!=null?l:n==null?void 0:n.skipPanoIndexMesh)!=null?c:!0,unitWidth:(f=(d=e.unitWidth)!=null?d:n==null?void 0:n.unitWidth)!=null?f:.6,unitHeight:(h=(u=e.unitHeight)!=null?u:n==null?void 0:n.unitHeight)!=null?h:.4});if(!r)return;const a=Qm({textureUrl:(A=(p=e.arrowTextureUrl)!=null?p:n==null?void 0:n.arrowTextureUrl)!=null?A:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return r.forEach(g=>{const v=new x.Mesh(g,a);v.name=Hs("route-line-mesh"),o.add(v)}),o}waitFiveModelLoaded(){return Y(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}m(Ja,"lasestVersion",Ya);const Za=(i,t)=>new Ja(i,t);function Fs(i){const t=Math.abs(Math.cos(i.latitude));return new x.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Om(i,t){const e=Fs(i),n=Fs(t);return e.angleTo(n)}const Hm=i=>Y(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Tn=Math.PI*2;function Fm(i){return i>=0&&i<Tn?i:(i%Tn+Tn)%Tn}function Gm(i){return{longitude:Fm(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function Nm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function Wm(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const qa="v1.0.6",Ka="CruisePlugin",mi=`${Ka}@${qa}`,Gs=()=>{console.error(`${mi} is disposed`)},_m=()=>{console.warn(`${mi} is disabled`)},Xm=()=>{console.error(`${mi} is disabled`)},ki=new Map;class uo extends Ht{constructor(e,n){super(e,n);m(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});m(this,"data");m(this,"config");m(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});m(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Ka}_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 Y(this,null,function*(){var d,f,u,h,p;if(this.state.disposed)return Gs();this.privateState.fiveOriginGetProgress||(f=(d=this.five.controller)==null?void 0:d.cameraMotion)!=null&&f.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(h=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:h.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(A=>A.data.panoIndex!==void 0);c.filter((A,g)=>{var v;return A.data.panoIndex!==((v=c[g-1])==null?void 0:v.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var v,w;const g=(v=this.five.work.observers[A])==null?void 0:v.floorIndex;if(g!==void 0)if(l===g){const y=a.length-1;a[y]=[...(w=a[y])!=null?w:[],A]}else{l=g;const y=a.length;a[y]=[A]}}),this.GuideLine||(this.GuideLine=Za(this.five,this.config)),(p=this.GuideLine)==null||p.load({routes:a.map(A=>({panoIndexList:A})),config:r.guildPluginOptions}),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(`${mi} 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(G({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return Y(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Y(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 Gs();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Xm();const o=G({},this.state);this.state=G(G({},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),Je(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 Y(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 he(G({id:(c=s.uuid)!=null?c:He(),moveIndex:r,stay:l,index:r},s),{guildPluginOptions:o.guildPluginOptions})})};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,d)=>{const f=(()=>{var g,v,w,y;const u=o.panoIndexList.slice(d).find(E=>E!==c);if(u===void 0)return;const h=(g=n[c])==null?void 0:g.position,p=(v=n[u])==null?void 0:v.position;if(!p||!h||((w=n[c])==null?void 0:w.floorIndex)!==((y=n[u])==null?void 0:y.floorIndex))return;const A=new x.Vector3().subVectors(p,h);return Gm(A)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:d,stay:o.stay,data:G({effect:"Move",panoIndex:c,moveEffect:r},f!=null?f:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:d,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),f&&s.push({moveIndex:d,stay:o.stay,data:G({effect:"Rotate",panoIndex:c},f)}))}),{keyframesId:He(),keyframes:s.map((c,d)=>G({id:He(),index:d},c)),guildPluginOptions:o.guildPluginOptions}}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 Y(this,null,function*(){var h;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:(h=e==null?void 0:e.userAction)!=null?h:!0});let d=!1;const u=yield(()=>Y(this,null,function*(){var p,A;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(p=this.data)==null?void 0:p.keyframes.findIndex(g=>g.id===e.playFromId);if(c!=null&&c.keyframeId){const g=(A=this.data)==null?void 0:A.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),g){if(g.data.effect==="Move")return g.index;if(g.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(g,{duration:v}),d=!0,g.index+1}}}}))();this.clearPauseData();for(const p of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(u!==void 0&&p.index<u))try{r.emit("playIndexChange",p.index,p),yield this.playKeyframe(p,{moveEffect:d===!1?s.moveToFirstPanoEffect:void 0,duration:d===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:void 0}),p.stay&&(yield Wm(p.stay)),d===!1&&(d=!0)}catch(A){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 Y(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(o){return Y(this,arguments,function*(e,n={}){var r;const s=e.data;if(n.duration=(r=n.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!s)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const d=()=>{a(),c=!0};switch(s.effect){case"Move":this.move(s,n).then(d);break;case"Rotate":this.rotate(s,n).then(d);break;default:this.rotate(s,n).then(d)}}catch(d){}})})}actionPromiseQueue(){return Y(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 Y(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 Y(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)})}updateCamera(o){return Y(this,arguments,function*(e,n={}){const{five:s,privateState:r,state:a}=this,l=(()=>{var h,p;const f=(h=a.config)==null?void 0:h.speedConfig,u=(p=e.rotateSpeed)!=null?p:f==null?void 0:f.rotateSpeed;if((f==null?void 0:f.rotateSpeedUnit)===void 0)return u;if(u!==void 0)return f.rotateSpeedUnit==="rad/ms"?u:u/1e3})(),c=(()=>{if(n.duration)return n.duration;if(l){const f=this.five.getCurrentState();return Om(f,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const d=this.getSpeededDuration(c);return new Promise(f=>{Hm(()=>s.updateCamera(e,d)),setTimeout(()=>f(),d)})})}changePano(e,n){return Y(this,null,function*(){const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var u,h;const d=(u=r.config)==null?void 0:u.speedConfig,f=(h=e.moveSpeed)!=null?h:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return f;if(f!==void 0)return d.moveSpeedUnit==="m/ms"?f:f/1e3})(),c=(()=>{if(n!=null&&n.duration)return n.duration;if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=o.work.observers[o.panoIndex].position,f=o.work.observers[e.panoIndex].position;return d.distanceTo(f)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(d=>{var f,u,h;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(h=(u=n==null?void 0:n.moveEffect)!=null?u:(f=this.state.config)==null?void 0:f.moveEffect)!=null?h: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 Y(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 ki.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return ki.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 ki.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&&_m()}waitFiveLoaded(){return Y(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-Nm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}m(uo,"PluginVersion",qa);const Ym=i=>new uo(i);function Um(i){le(i,"svelte-xuejcm",".line.svelte-xuejcm{position:absolute;pointer-events:none}.line.vertical.svelte-xuejcm{transform:rotate(-90deg) translate3d(0.03125rem, 0, 0.625rem);transform-origin:0 0}.line.horizontal.svelte-xuejcm{transform:translate3d(0, -0.03125rem, 0.625rem)}.straight-line.svelte-xuejcm{display:block;width:100%;height:100%;overflow:visible}")}function Ns(i){let t,e,n,o,s,r,a,l=i[3]&&Ws(i);return{c(){t=V("div"),e=Ae("svg"),n=Ae("defs"),o=Ae("linearGradient"),s=Ae("stop"),r=Ae("stop"),l&&l.c(),b(s,"offset","25%"),b(s,"stop-color",i[5]),b(s,"stop-opacity","1"),b(r,"offset","100%"),b(r,"stop-color",i[5]),b(r,"stop-opacity","0.5"),b(o,"x1",.5),b(o,"y1",.5),b(o,"x2",i[8]),b(o,"y2",.5),b(o,"id",i[10]),b(o,"gradientUnits","userSpaceOnUse"),b(e,"class","straight-line svelte-xuejcm"),b(e,"viewBox",a="0 0 "+i[8]+" "+i[7]),b(e,"preserveAspectRatio","none"),b(t,"class","line svelte-xuejcm"),te(t,"vertical",i[9]),te(t,"horizontal",!i[9]),T(t,"width",i[8]+"px"),T(t,"height",i[7]+"px")},m(c,d){z(c,t,d),Q(t,e),Q(e,n),Q(n,o),Q(o,s),Q(o,r),l&&l.m(e,null)},p(c,d){d&32&&b(s,"stop-color",c[5]),d&32&&b(r,"stop-color",c[5]),d&256&&b(o,"x2",c[8]),c[3]?l?(l.p(c,d),d&8&&k(l,1)):(l=Ws(c),l.c(),k(l,1),l.m(e,null)):l&&(se(),S(l,1,1,()=>{l=null}),re()),d&384&&a!==(a="0 0 "+c[8]+" "+c[7])&&b(e,"viewBox",a),d&512&&te(t,"vertical",c[9]),d&512&&te(t,"horizontal",!c[9]),d&256&&T(t,"width",c[8]+"px"),d&128&&T(t,"height",c[7]+"px")},d(c){c&&M(t),l&&l.d()}}}function Ws(i){let t,e,n,o,s;return{c(){t=Ae("path"),b(t,"fill","none"),b(t,"stroke",e=i[4]?`url(#${i[10]})`:i[5]),b(t,"stroke-width",1),b(t,"d",i[6])},m(r,a){z(r,t,a),s=!0},p(r,a){i=r,(!s||a&48&&e!==(e=i[4]?`url(#${i[10]})`:i[5]))&&b(t,"stroke",e),(!s||a&64)&&b(t,"d",i[6])},i(r){s||(r&&De(()=>{o&&o.end(1),n=Rt(t,Kn,{duration:i[2],delay:i[0],easing:yt}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=tn(t,Kn,{duration:i[2],delay:i[1],easing:yt})),s=!1},d(r){r&&M(t),r&&o&&o.end()}}}function Jm(i){let t,e=i[8]&&Ns(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),z(n,t,o)},p(n,[o]){n[8]?e?e.p(n,o):(e=Ns(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:Z,o:Z,d(n){e&&e.d(n),n&&M(t)}}}function Zm(i,t,e){let n,o,s,r,{inDelay:a=0}=t,{outDelay:l=0}=t,{duration:c=1e3}=t,{unfolded:d}=t,{length:f}=t,{direction:u="horizontal"}=t,{useLinearColor:h=!1}=t,{color:p="white"}=t;const A=He();return i.$$set=g=>{"inDelay"in g&&e(0,a=g.inDelay),"outDelay"in g&&e(1,l=g.outDelay),"duration"in g&&e(2,c=g.duration),"unfolded"in g&&e(3,d=g.unfolded),"length"in g&&e(11,f=g.length),"direction"in g&&e(12,u=g.direction),"useLinearColor"in g&&e(4,h=g.useLinearColor),"color"in g&&e(5,p=g.color)},i.$$.update=()=>{i.$$.dirty&4096&&e(9,n=u==="vertical"),i.$$.dirty&2048&&e(8,o=f),i.$$.dirty&2048&&e(6,r=`M0.5 0.5 H ${f}`)},e(7,s=1),[a,l,c,d,h,p,r,s,o,n,A,f,u]}class fo extends oe{constructor(t){super(),ie(this,t,Zm,Jm,ne,{inDelay:0,outDelay:1,duration:2,unfolded:3,length:11,direction:12,useLinearColor:4,color:5},Um)}}function qm(i){le(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function _s(i){let t,e,n,o,s;return{c(){t=V("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
|
|
531
531
|
left:${Ge(i[5])};
|
|
532
532
|
bottom:${Ge(i[6])};
|
|
533
533
|
box-shadow: 0 0 ${Ge(i[10])} ${Ge(i[11])} rgba(0, 0, 0, ${i[12]});
|
|
@@ -556,4 +556,4 @@ void main() {
|
|
|
556
556
|
float match = 1.0 - uv.x;
|
|
557
557
|
gl_FragColor = vec4(1.0,1.0,1.0,match);
|
|
558
558
|
}
|
|
559
|
-
`;function Qg(){const i=new x.PlaneGeometry(.4,.4),t=Bg,e=new x.TextureLoader().load(t);e.encoding=x.sRGBEncoding;const n=new x.MeshBasicMaterial({map:e,transparent:!0,depthTest:!1});return new x.Mesh(i,n)}function Rg(){const i=new x.CurvePath;i.add(new x.LineCurve3(new x.Vector3(0,0,0),new x.Vector3(0,0,.1)));const t=new x.TubeGeometry(i,8,.003),e=new x.ShaderMaterial({vertexShader:Vg,fragmentShader:jg,depthTest:!1,transparent:!0});return new x.Mesh(t,e)}function Og(){const i=new x.SphereGeometry(.01,20,20),t=new x.MeshBasicMaterial({color:10349931,depthTest:!1,transparent:!0,side:x.DoubleSide}),e=new x.Mesh(i,t);return e.position.set(0,0,.1),e}class al extends x.Object3D{constructor(){super();m(this,"planeMesh");m(this,"lineMesh");m(this,"ballMesh");this.planeMesh=Qg(),this.lineMesh=Rg(),this.ballMesh=Og(),this.add(this.planeMesh,this.lineMesh,this.ballMesh)}updateWithIntersect(e){if(!e.face)return;const n=new x.Vector3().addVectors(e.point,e.face.normal);this.position.copy(e.point),this.lookAt(n)}dispose(){var e;(e=this.planeMesh.material.map)==null||e.dispose()}}class ll{constructor(t){m(this,"five");m(this,"contentElement",document.createElement("div"));m(this,"animeIns");m(this,"container");m(this,"css3DObject");m(this,"disposeCss3DObject");m(this,"state",{enabled:!1});this.five=t;const n=.4/2,s=en(t).create3DDomContainer([[-n,n,0],[-n,-n,0],[n,-n,0],[n,n,0]].map(r=>new x.Vector3().fromArray(r)));if(s){const{container:r,dispose:a,css3DObject:l}=s;this.container=r,this.css3DObject=l,this.disposeCss3DObject=a}this.contentElement.style.width="100%",this.contentElement.style.height="100%",this.contentElement.style.backgroundImage=`url(${Oa})`,this.contentElement.style.backgroundSize="100%",this.contentElement.style.backgroundRepeat="no-repeat"}enable(){var t;this.state.enabled||(this.state.enabled=!0,(t=this.container)==null||t.appendChild(this.contentElement))}disable(){!this.state.enabled||(this.state.enabled=!1,this.contentElement.remove())}updateWithIntersect(t){if(!t.face||!this.css3DObject)return;const e=new x.Vector3().addVectors(t.point,t.face.normal);this.css3DObject.position.copy(t.point),this.css3DObject.lookAt(e),this.five.needsRender=!0}doAnimation(){var t;(t=this.animeIns)==null||t.dispose(),new co({progress:0}).to({progress:[1,0]}).duration(500).easing(ni.Easing.Quadratic.InOut).onUpdate(({progress:e})=>{}).play()}dispose(){var t;(t=this.disposeCss3DObject)==null||t.call(this)}}class Hg{constructor(t,e){m(this,"five");m(this,"hooks",new be.Subscribe);m(this,"magnifier",null);m(this,"pointHelper",null);m(this,"pointDomHelper",null);m(this,"contentDom",document.createElement("div"));m(this,"state",{enabled:!1});m(this,"group",new x.Group);this.five=t,this.magnifier=(e==null?void 0:e.magnifier)===void 0?new sl(t,{dragEnabled:!0}):null,this.pointHelper=(e==null?void 0:e.pointHelper)===void 0?new al:null,this.pointDomHelper=(e==null?void 0:e.pointDomHelper)===void 0?new ll(t):null,this.group.name="five-point-selector",this.five.scene.add(this.group),this.contentDom.classList.add("five-point-selector-content"),this.contentDom.style.position="absolute",this.contentDom.style.top="0",this.contentDom.style.left="0",this.contentDom.style.width="100%",this.contentDom.style.height="100%",this.contentDom.style.pointerEvents="none"}enable(){var t,e;this.state.enabled||(this.state.enabled=!0,this.pointHelper&&this.group.add(this.pointHelper),(t=this.magnifier)==null||t.enable(),(e=this.pointDomHelper)==null||e.enable(),this.five.needsRender=!0,this.hooks.emit("enabled"))}disable(){var t,e;!this.state.enabled||(this.state.enabled=!1,this.pointHelper&&this.group.remove(this.pointHelper),(t=this.magnifier)==null||t.disable(),(e=this.pointDomHelper)==null||e.disable(),this.hooks.emit("disabled"))}dispose(){this.hooks.off(),this.disable(),this.magnifier=null,this.pointHelper=null,this.pointDomHelper=null}updateWithIntersect(t){var s;this.hooks.emit("pointChanged",{panoIndex:this.five.getCurrentState().panoIndex,position:t.point.toArray(),normal:(s=t.face)==null?void 0:s.normal.toArray()});const e=this.magnifier;e&&e.renderWithPoint(t.point);const n=this.pointHelper;n&&n.updateWithIntersect(t);const o=this.pointDomHelper;o&&o.updateWithIntersect(t),this.five.needsRender=!0}}const Fg=Object.freeze(Object.defineProperty({__proto__:null,Interval:Xi,Rectangle:Lg,Magnifier:sl,getCoordsFromClient:Tg,getCoordsFromElement:rl,getRaycasterFromFivePointer:Mg,getIntersectFromRelativePosition:zg,PointHelper:al,PointDomHelper:ll,FivePointSelector:Hg,isNil:Rm,notNil:We,BetterTween:co,tweenProgress:La,nextFrame:ci,requestAnimationFrameInterval:di,getFrameTime:sf},Symbol.toStringTag,{value:"Module"}));function Gg(i){le(i,"svelte-8mby9k",".svelte-8mby9k.svelte-8mby9k{box-sizing:border-box}.marketing.svelte-8mby9k.svelte-8mby9k{transform:translateY(-100%)}.content.svelte-8mby9k .headerImage.svelte-8mby9k{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.line.svelte-8mby9k.svelte-8mby9k{position:absolute;height:2.0625rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.content.svelte-8mby9k.svelte-8mby9k{background-color:white;position:relative;display:flex;flex-direction:column;min-width:11.125rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition:all 500ms}.title.svelte-8mby9k.svelte-8mby9k{position:absolute;background-color:white;border-radius:0.25rem;width:100%;top:0.5rem;padding-left:0.75rem;padding-right:0.75rem}.title.svelte-8mby9k .text.svelte-8mby9k{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem;color:#000}.footer.svelte-8mby9k.svelte-8mby9k{position:relative;padding-left:0.75rem;padding-right:0.75rem;width:100%;height:1.375rem;display:flex;align-items:center}.footer.svelte-8mby9k .goto-button.svelte-8mby9k{flex-shrink:0;white-space:nowrap;background-image:linear-gradient(to right, rgba(87, 144, 253, 1) 0, rgba(42, 114, 254, 1) 100%);color:#fff;font-size:0.625rem;border-radius:0.875rem;font-weight:bold;padding-left:0.5rem;padding-right:0.5rem;height:1.25rem;margin-left:auto;display:flex;align-items:center}.footer.svelte-8mby9k .goto-icon.svelte-8mby9k::after{content:'';display:inline-block;width:0.75rem;height:0.75rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAeFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////GqOSsAAAAJ3RSTlMAFNO2pYt4bErz8uP6ysawgVtBPDcR5C4s2L6ZmJBzZGJXUyEeDws/0G2zAAAAkklEQVQ4y+3TRw6DMBAF0OAeJ3QCpCe0uf8NwRILLBYfiS1/aT3JoymnI+sERZ5VCH0iVto3QDfBLmeSSMUTogRV9bBEpJAKaYpGijn13aTSLeraeG9D0NZFZv4/rRL5FDHnITlllqjv6tykWsmX4JHr05y7j6oFKq2P8He48B0tAM0EY0EDxquClw6vLz6EI35GmwwSZpe+WOgAAAAASUVORK5CYII=);background-size:100% auto;background-repeat:no-repeat}.price.svelte-8mby9k.svelte-8mby9k{flex-shrink:0;margin-right:0.75rem;white-space:nowrap;color:#ff6600;display:flex;align-items:baseline}.price.svelte-8mby9k .value.svelte-8mby9k{position:relative;top:0.0625rem;font-size:1.125rem;line-height:1.375rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.price.svelte-8mby9k .unit.svelte-8mby9k{padding-left:0.125rem;font-size:0.625rem}.tag.svelte-8mby9k.svelte-8mby9k{position:relative;background-color:white;display:flex;width:-moz-max-content;width:max-content;padding-left:0.75rem;padding-right:0.75rem;min-height:1.75rem}.tag.svelte-8mby9k .base-tag.svelte-8mby9k{height:1rem;margin-top:1.375rem;margin-bottom:0.5rem;margin-right:0.25rem;font-size:0.625rem;line-height:0.875rem;padding:0.0625rem 0.25rem;border-radius:0.125rem;overflow:hidden}.tag.svelte-8mby9k .primary-tag.svelte-8mby9k{background:#e5eefe;color:#0055ff}.tag.svelte-8mby9k .secondary-tag.svelte-8mby9k{background:rgba(255, 102, 0, 0.08);color:rgba(255, 102, 0, 1)}.unfolded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 1)}.folded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.unfolded.svelte-8mby9k .content.svelte-8mby9k{opacity:1}.folded.svelte-8mby9k .content.svelte-8mby9k{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}")}function Cr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Pr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Er(i){let t,e=i[0]+"",n;return{c(){t=V("div"),n=Pe(e),b(t,"class","base-tag primary-tag svelte-8mby9k")},m(o,s){z(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&xe(n,e)},d(o){o&&M(t)}}}function Ir(i){let t,e=i[0]&&Er(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),z(n,t,o)},p(n,o){n[0]?e?e.p(n,o):(e=Er(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&M(t)}}}function kr(i){let t,e=i[0]+"",n;return{c(){t=V("div"),n=Pe(e),b(t,"class","base-tag secondary-tag svelte-8mby9k")},m(o,s){z(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&xe(n,e)},d(o){o&&M(t)}}}function xr(i){let t,e=i[0]&&kr(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),z(n,t,o)},p(n,o){n[0]?e?e.p(n,o):(e=kr(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&M(t)}}}function Dr(i){let t,e,n=i[2].price.value+"",o,s,r=i[2].price.unit&&Lr(i);return{c(){t=V("div"),e=V("span"),o=Pe(n),s=ee(),r&&r.c(),b(e,"class","value svelte-8mby9k"),b(t,"class","price svelte-8mby9k")},m(a,l){z(a,t,l),Q(t,e),Q(e,o),Q(t,s),r&&r.m(t,null)},p(a,l){l&4&&n!==(n=a[2].price.value+"")&&xe(o,n),a[2].price.unit?r?r.p(a,l):(r=Lr(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&M(t),r&&r.d()}}}function Lr(i){let t,e=i[2].price.unit+"",n;return{c(){t=V("span"),n=Pe(e),b(t,"class","unit svelte-8mby9k")},m(o,s){z(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[2].price.unit+"")&&xe(n,e)},d(o){o&&M(t)}}}function Sr(i){let t,e=i[2].highlightText+"",n;return{c(){t=V("div"),n=Pe(e),b(t,"class","goto-button goto-icon svelte-8mby9k")},m(o,s){z(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[2].highlightText+"")&&xe(n,e)},d(o){o&&M(t)}}}function Ng(i){var X,j;let t,e,n,o,s,r,a,l,c,d,f,u,h,p,A=i[2].title+"",g,v,w,y=We((X=i[2].price)==null?void 0:X.value)&&((j=i[2].price)==null?void 0:j.value)!=="",E,I;e=new Ke({props:{visible:i[1],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let C=i[2].brandTags||[],L=[];for(let P=0;P<C.length;P+=1)L[P]=Ir(Pr(i,C,P));let D=i[2].tags||[],B=[];for(let P=0;P<D.length;P+=1)B[P]=xr(Cr(i,D,P));let N=y&&Dr(i),F=i[2].highlightText&&Sr(i);return{c(){var P;t=V("div"),$(e.$$.fragment),n=ee(),o=V("div"),s=ee(),r=V("div"),a=V("img"),c=ee(),d=V("div");for(let R=0;R<L.length;R+=1)L[R].c();f=ee();for(let R=0;R<B.length;R+=1)B[R].c();u=ee(),h=V("div"),p=V("div"),g=Pe(A),v=ee(),w=V("div"),N&&N.c(),E=ee(),F&&F.c(),b(o,"class","line svelte-8mby9k"),T(o,"transition-delay",i[1]?Bn+"ms":Vn+Mr-Tr-40+"ms"),b(a,"class","headerImage svelte-8mby9k"),Ne(a.src,l=i[2].headerPictureUrl)||b(a,"src",l),b(a,"alt",""),b(d,"class","tag svelte-8mby9k"),b(p,"class","text svelte-8mby9k"),b(h,"class","title svelte-8mby9k"),b(w,"class","footer svelte-8mby9k"),T(w,"height",We((P=i[2].price)==null?void 0:P.value)&&i[2].highlightText?void 0:"1rem"),b(r,"class","content svelte-8mby9k"),T(r,"transition-delay",i[1]?Bn+Vn+"ms":"0ms"),b(t,"class","marketing svelte-8mby9k"),te(t,"unfolded",i[1]),te(t,"folded",i[3])},m(P,R){z(P,t,R),q(e,t,null),Q(t,n),Q(t,o),Q(t,s),Q(t,r),Q(r,a),Q(r,c),Q(r,d);for(let O=0;O<L.length;O+=1)L[O].m(d,null);Q(d,f);for(let O=0;O<B.length;O+=1)B[O].m(d,null);Q(r,u),Q(r,h),Q(h,p),Q(p,g),Q(r,v),Q(r,w),N&&N.m(w,null),Q(w,E),F&&F.m(w,null),I=!0},p(P,[R]){var W,U,_;const O={};if(R&2&&(O.visible=P[1]),e.$set(O),R&2&&T(o,"transition-delay",P[1]?Bn+"ms":Vn+Mr-Tr-40+"ms"),(!I||R&4&&!Ne(a.src,l=P[2].headerPictureUrl))&&b(a,"src",l),R&4){C=P[2].brandTags||[];let J;for(J=0;J<C.length;J+=1){const de=Pr(P,C,J);L[J]?L[J].p(de,R):(L[J]=Ir(de),L[J].c(),L[J].m(d,f))}for(;J<L.length;J+=1)L[J].d(1);L.length=C.length}if(R&4){D=P[2].tags||[];let J;for(J=0;J<D.length;J+=1){const de=Cr(P,D,J);B[J]?B[J].p(de,R):(B[J]=xr(de),B[J].c(),B[J].m(d,null))}for(;J<B.length;J+=1)B[J].d(1);B.length=D.length}(!I||R&4)&&A!==(A=P[2].title+"")&&xe(g,A),R&4&&(y=We((W=P[2].price)==null?void 0:W.value)&&((U=P[2].price)==null?void 0:U.value)!==""),y?N?N.p(P,R):(N=Dr(P),N.c(),N.m(w,E)):N&&(N.d(1),N=null),P[2].highlightText?F?F.p(P,R):(F=Sr(P),F.c(),F.m(w,null)):F&&(F.d(1),F=null),R&4&&T(w,"height",We((_=P[2].price)==null?void 0:_.value)&&P[2].highlightText?void 0:"1rem"),R&2&&T(r,"transition-delay",P[1]?Bn+Vn+"ms":"0ms"),(!I||R&2)&&te(t,"unfolded",P[1]),(!I||R&8)&&te(t,"folded",P[3])},i(P){I||(k(e.$$.fragment,P),I=!0)},o(P){S(e.$$.fragment,P),I=!1},d(P){P&&M(t),K(e),lt(L,P),lt(B,P),N&&N.d(),F&&F.d()}}}const Bn=400,Tr=500,Vn=180,Mr=500;function Wg(i,t,e){let n,o,s,{tag:r}=t;return i.$$set=a=>{"tag"in a&&e(0,r=a.tag)},i.$$.update=()=>{var a,l;i.$$.dirty&1&&e(1,n=(l=(a=r.state)==null?void 0:a.unfolded)!=null?l:!1),i.$$.dirty&2&&e(3,o=!n),i.$$.dirty&1&&e(2,s=r.data)},[r,n,s,o]}class _g extends oe{constructor(t){super(),ie(this,t,Wg,Ng,ne,{tag:0},Gg)}}const Kt="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAgAAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//uQxAACFEII9ACZ/sJZwWEoEb8w/////N//////JcxjHjf+7/v/H2PzCCFAiDtGeyBCIx7bJJ1mmEEMy6g8mm2c8nrGABB4h2Mkmn//4z/73u773R5qHHu/j/w7Kxkzh5lWRWdsifCkNAnY9Zc1HvDAhjhSHdFkHFzLmabt/AQxSg2wwzLhHIJOBnAWwVY4zrhIYhhc2kvhYDfQ4hDi2Gmh5KyFn8EcGIrHAngNgIwVIEMf5bzbAiTRoAD///8z/KVhkkWEle6IX+d/z4fvH3BShK1e5kmjkCMoxVmXhd4ROlTKo3iipasvTilY21q19ta30/v/0/idPX1v8PNxJL6ramnOVsdvMv2akO0iSYIzdJFirtzWXCZicS9vHqvSKyqm5XJBdqBwPxyfJdykhWTZ0G0ZyTZGpLKxsNwwoRhsx3tZfhwmeOBVISm3impAC/IT/8hP/EKEM1KMdVdVKM2rHV4x7HVXZvbVVKN/qq8CiV9VL9jjH/6l6qf7MBCjZmOqsAibjcP+qqqv0oxqpa/NVW286hPo1nz2L/h8+jXt//uSxCmDU2IK/ECN98KKtE5IYzNoCfbw+u9i5r8PoadUMFPKqWL4LK3T/LCraMSHGkW4bpLXR/E6LlHOVQxmslKVJ8IULktMN06N0FKCpHCoYsjC4F+Z0NVqdNFoGSTjSiyjzLdnZ2fNqTi2eHKONONKLMPMKLONKLMPQRJGlFxZRoKcJFAYEeIFiRQkUWUeYfef//Ko04soswso40UJAgMw8wosososy0EalnZyjQUGBRQGIFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsqFdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",un={};var ti=(i=>(i.Default="default",i.GetAudioDuration="getAudioDuration",i.PlayAudio="playAudio",i))(ti||{});function cl(i,t){const e=(t==null?void 0:t.namespace)||"default",n=un[e]||(un[e]=[]);let o=n.find(s=>!s.realSrc||s.realSrc===Kt);return o||(console.warn("\u672A\u627E\u5230\u7F13\u5B58\u97F3\u9891\uFF0C\u5DF2\u65B0\u5EFA",un),o=new mo(Kt),n.push(o)),i&&(o.src=i),o}function Xg(i){return Y(this,null,function*(){const t=(()=>i instanceof mo?i:cl(i,{namespace:"getAudioDuration"}))(),e=yield new Promise(n=>{t.duration?t.isBlankAudio?n(0):n(t.duration):(t.addEventListener("loadedmetadata",()=>{t.isBlankAudio?n(0):n(t.duration)}),t.addEventListener("canplaythrough",()=>{t.isBlankAudio?n(0):n(t.duration)}))});return typeof i=="string"&&t.clear(),e})}function zr(i,t){const e=(t==null?void 0:t.namespace)||"default",n=un[e]||(un[e]=[]),o=i-n.length;if(!(o<=0))for(let s=0;s<o;s++)n.push(new mo(Kt))}class mo extends Audio{constructor(e){super(e);m(this,"preload","auto");m(this,"realSrc","");m(this,"inited",!1);m(this,"removeDocumentEventListener");this.realSrc=e!=null?e:"",super.addEventListener("ended",()=>{this.src=""});const n=()=>Yg(this);document.addEventListener("click",n),document.addEventListener("touchend",n),this.removeDocumentEventListener=()=>{document.removeEventListener("click",n),document.removeEventListener("touchend",n)}}get isBlankAudio(){return this.realSrc===Kt||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e}clear(){this.src=Kt,this.currentTime=0}}function Yg(i){!i||i.inited||(i.src&&(i.inited=!0,i.removeDocumentEventListener()),i.src===Kt&&i.play())}class Ug extends Audio{constructor(e){super();m(this,"sharedAudioSrc");m(this,"sharedAudioPaused",!0);m(this,"sharedAudioCurrentTime",0);m(this,"tryplaying",!1);m(this,"audioInstance");m(this,"eventListenerDisposer");this.sharedAudioSrc=e}get paused(){var e;return(e=this.sharedAudioPaused)!=null?e:!0}get currentTime(){return this.sharedAudioCurrentTime}play(){return Y(this,null,function*(){var e,n,o;this.tryplaying||(this.tryplaying=!0,(!this.audioInstance||((e=this.audioInstance)==null?void 0:e.realSrc)!==this.sharedAudioSrc)&&(this.audioInstance=cl(this.sharedAudioSrc,{namespace:ti.PlayAudio})),this.audioInstance.currentTime=(n=this.currentTime)!=null?n:0,(o=this.eventListenerDisposer)==null||o.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.play().then(()=>{this.sharedAudioPaused=!1}).catch(s=>{this.pause(),console.warn(s)}).finally(()=>{this.tryplaying=!1}))})}pause(){!this.audioInstance||this.paused||(this.sharedAudioPaused=!0,this.audioInstance.addEventListener("pause",()=>{var e;(e=this.eventListenerDisposer)==null||e.call(this)},{once:!0}),this.audioInstance.pause())}dispose(){this.clear(),this.audioInstance=void 0}clear(){var e;(e=this.audioInstance)==null||e.clear()}addEventListeners(){const e=this.audioInstance;if(!e)return;const n=u=>{var h;this.sharedAudioCurrentTime=e.currentTime,(h=this.ontimeupdate)==null||h.call(this,u)},o=u=>{var h;return(h=this.onplay)==null?void 0:h.call(this,u)},s=u=>{var h;(h=this.onpause)==null||h.call(this,u),this.clear()},r=u=>{var h;(h=this.onended)==null||h.call(this,u),this.sharedAudioCurrentTime=0},a=u=>{var h;return(h=this.onerror)==null?void 0:h.call(this,u)},l=u=>{var h;return(h=this.oncanplay)==null?void 0:h.call(this,u)},c=u=>{var h;return(h=this.oncanplaythrough)==null?void 0:h.call(this,u)},d=u=>{var h;return(h=this.onloadeddata)==null?void 0:h.call(this,u)},f=u=>{var h;return(h=this.onloadedmetadata)==null?void 0:h.call(this,u)};return e.addEventListener("timeupdate",n),e.addEventListener("play",o),e.addEventListener("pause",s),e.addEventListener("ended",r),e.addEventListener("error",a),e.addEventListener("canplay",l),e.addEventListener("canplaythrough",c),e.addEventListener("loadeddata",d),e.addEventListener("loadedmetadata",f),()=>{e.removeEventListener("timeupdate",n),e.removeEventListener("play",o),e.removeEventListener("pause",s),e.removeEventListener("ended",r),e.removeEventListener("error",a),e.removeEventListener("canplay",l),e.removeEventListener("canplaythrough",c),e.removeEventListener("loadeddata",d),e.removeEventListener("loadedmetadata",f)}}}function Jg(i){le(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function Zg(i){let t,e,n,o;const s=i[8].default,r=it(s,i,i[7],null);return{c(){t=V("div"),r&&r.c(),b(t,"class","audio svelte-13e7hxv"),b(t,"style",i[0])},m(a,l){z(a,t,l),r&&r.m(t,null),e=!0,n||(o=Se(t,"click",ha(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&st(r,s,a,a[7],e?ot(s,a[7],l,null):rt(a[7]),null),(!e||l&1)&&b(t,"style",a[0])},i(a){e||(k(r,a),e=!0)},o(a){S(r,a),e=!1},d(a){a&&M(t),r&&r.d(a),n=!1,o()}}}function qg(i,t,e){let{$$slots:n={},$$scope:o}=t,{url:s}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=oi(),d=ct("hooks"),f=ct("mediaStore");let u,h=!0;function p(){e(5,u.onplay=g=>{d.emit("playStateChange",G({event:g,state:"playing",mediaInstance:u},l)),c("play"),e(6,h=!1)},u),e(5,u.onpause=g=>{d.emit("playStateChange",G({event:g,state:"paused",mediaInstance:u},l)),c("pause"),e(6,h=!0)},u),e(5,u.onloadedmetadata=g=>{typeof u.duration=="number"&&!Number.isNaN(u.duration)&&c("duration",u.duration)},u),e(5,u.ontimeupdate=g=>{c("timeupdate",u.currentTime)},u)}f.subscribe(({currentMediaElement:g})=>{g!==u&&(h||u==null||u.pause())});function A(g){!u||(d.emit("click",G({event:g,target:"AudioTagPlayIcon",audioInstance:u},l)),f.set({currentMediaElement:u}),d.emit("playStateChange",G({event:g,state:u.paused?"playing":"paused",mediaInstance:u},l)),u.paused?u.play():u.pause())}return i.$$set=g=>{"url"in g&&e(2,s=g.url),"enable"in g&&e(3,r=g.enable),"style"in g&&e(0,a=g.style),"hooksInfo"in g&&e(4,l=g.hooksInfo),"$$scope"in g&&e(7,o=g.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(s||c("duration",0)),i.$$.dirty&36&&(u==null||u.dispose(),e(5,u=new Ug(s)),c("audioRef",u),setTimeout(()=>c("audioRef",u),200),Xg(s).then(g=>c("duration",g)),p()),i.$$.dirty&40&&(r||u==null||u.pause()),i.$$.dirty&72&&c(r&&!h?"play":"pause")},[a,A,s,r,l,u,h,o,n]}class dl extends oe{constructor(t){super(),ie(this,t,qg,Zg,ne,{url:2,enable:3,style:0,hooksInfo:4},Jg)}}function Kg(i){le(i,"svelte-srt2pi",".audio-icon__wrapper.svelte-srt2pi.svelte-srt2pi{display:inline-block}.audio-icon.svelte-srt2pi.svelte-srt2pi{display:flex;justify-content:center;align-items:center;position:relative;width:100%;height:100%;border-radius:50%;background-color:rgba(255, 255, 255, 0.8)}.audio-icon.svelte-srt2pi .sound-wave__container.svelte-srt2pi{position:absolute;pointer-events:none;width:60%;height:60%}.sound-wave.svelte-srt2pi.svelte-srt2pi{animation-duration:2s;animation-iteration-count:infinite;animation-play-state:paused;transition:opacity 0}.playing.svelte-srt2pi .sound-wave.svelte-srt2pi{animation-play-state:running}.playing.svelte-srt2pi .sound-wave-1.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_1_animation}.playing.svelte-srt2pi .sound-wave-2.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_2_animation}.playing.svelte-srt2pi .sound-wave-3.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_3_animation}@keyframes svelte-srt2pi-sound_wave_1_animation{0%,10%{opacity:0}25%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_2_animation{0%,35%{opacity:0}50%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_3_animation{0%,60%{opacity:0}75%,100%{opacity:1}}")}function Br(i){let t,e;return t=new Ke({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function $g(i){let t,e,n,o,s,r=i[1]&&Br();return{c(){t=V("div"),r&&r.c(),e=ee(),n=V("div"),o=V("div"),o.innerHTML='<svg width="100%" height="100%" viewBox="0 0 128 128"><g transform="rotate(-45 12 64) translate(12 64)" fill="black" stroke="black" fill-opacity="0.6" stroke-opacity="0.6"><path stroke="none" class="sound-wave sound-wave-1 svelte-srt2pi" d="M0,23 A23,23 0 0,0 23,0 L0,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-2 svelte-srt2pi" d="M0,46 A46,46 0 0,0 46,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-3 svelte-srt2pi" d="M0,80 A80,80 0 0,0 80,0"></path></g></svg>',b(o,"class","sound-wave__container svelte-srt2pi"),b(n,"class","audio-icon svelte-srt2pi"),te(n,"playing",i[0]),b(t,"class","audio-icon__wrapper svelte-srt2pi"),b(t,"style",i[2]),T(t,"width",i[5]),T(t,"height",i[5])},m(a,l){z(a,t,l),r&&r.m(t,null),Q(t,e),Q(t,n),Q(n,o),i[7](o),i[8](t),s=!0},p(a,[l]){a[1]?r?l&2&&k(r,1):(r=Br(),r.c(),k(r,1),r.m(t,e)):r&&(se(),S(r,1,1,()=>{r=null}),re()),(!s||l&1)&&te(n,"playing",a[0]),(!s||l&4)&&b(t,"style",a[2]),l&32&&T(t,"width",a[5]),l&32&&T(t,"height",a[5])},i(a){s||(k(r),s=!0)},o(a){S(r),s=!1},d(a){a&&M(t),r&&r.d(),i[7](null),i[8](null)}}}function e0(i,t,e){let n,{playing:o}=t,{shadow:s=!1}=t,{style:r=null}=t,{width:a="100%"}=t,l,c;function d(u){Le[u?"unshift":"push"](()=>{c=u,e(4,c)})}function f(u){Le[u?"unshift":"push"](()=>{l=u,e(3,l)})}return i.$$set=u=>{"playing"in u&&e(0,o=u.playing),"shadow"in u&&e(1,s=u.shadow),"style"in u&&e(2,r=u.style),"width"in u&&e(6,a=u.width)},i.$$.update=()=>{i.$$.dirty&64&&e(5,n=typeof a=="number"?ye(a):a)},[o,s,r,l,c,n,a,d,f]}class ul extends oe{constructor(t){super(),ie(this,t,e0,$g,ne,{playing:0,shadow:1,style:2,width:6},Kg)}}function t0(i){le(i,"svelte-1s6gk4a",".audio-tag.svelte-1s6gk4a{position:absolute;left:0;top:0;width:0;height:0;overflow:visible}.audio-icon__wrapper.svelte-1s6gk4a{position:relative;vertical-align:top;width:100%;height:100%}.content.svelte-1s6gk4a{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0.125rem;overflow:hidden;box-sizing:border-box;font-size:0;white-space:nowrap;font-weight:600}.wrapper.svelte-1s6gk4a{position:relative;width:100%;height:100%}.audio-icon.svelte-1s6gk4a{pointer-events:none;vertical-align:top;display:inline-block;width:1rem;height:1rem;margin-right:0.25rem;margin-top:0.0625rem}.audio.svelte-1s6gk4a{position:relative;width:100%;height:100%}")}function Vr(i){var v,w;let t,e,n,o,s,r,a,l,c,d,f,u,h,p,A;e=new Ke({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let g=i[6]&&jr(i);return c=new tl({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),u=new fo({props:{unfolded:i[6],length:i[3],outDelay:i[4]+20*Math.min((w=(v=i[5])==null?void 0:v.length)!=null?w:10,15),useLinearColor:!0}}),{c(){t=V("div"),$(e.$$.fragment),n=ee(),o=V("div"),s=V("div"),r=V("div"),g&&g.c(),a=ee(),l=V("div"),$(c.$$.fragment),f=ee(),$(u.$$.fragment),b(r,"class","audio-icon svelte-1s6gk4a"),De(()=>i[11].call(l)),T(l,"display","inline-block"),b(s,"class","wrapper svelte-1s6gk4a"),b(o,"class","content svelte-1s6gk4a"),b(t,"class","audio-tag svelte-1s6gk4a"),te(t,"unfolded",i[6])},m(y,E){z(y,t,E),q(e,t,null),Q(t,n),Q(t,o),Q(o,s),Q(s,r),g&&g.m(r,null),Q(s,a),Q(s,l),q(c,l,null),d=Pt(l,i[11].bind(l)),Q(t,f),q(u,t,null),h=!0,p||(A=Se(l,"click",i[7]),p=!0)},p(y,E){var D,B;const I={};E&64&&(I.visible=y[6]),E&8&&(I.left=y[3]/2+"px"),e.$set(I),y[6]?g?(g.p(y,E),E&64&&k(g,1)):(g=jr(y),g.c(),k(g,1),g.m(r,null)):g&&(se(),S(g,1,1,()=>{g=null}),re());const C={};E&64&&(C.visible=y[6]),E&2&&(C.textUnfolded=y[1]),E&32&&(C.content=y[5]),c.$set(C);const L={};E&64&&(L.unfolded=y[6]),E&8&&(L.length=y[3]),E&48&&(L.outDelay=y[4]+20*Math.min((B=(D=y[5])==null?void 0:D.length)!=null?B:10,15)),u.$set(L),(!h||E&64)&&te(t,"unfolded",y[6])},i(y){h||(k(e.$$.fragment,y),k(g),k(c.$$.fragment,y),k(u.$$.fragment,y),h=!0)},o(y){S(e.$$.fragment,y),S(g),S(c.$$.fragment,y),S(u.$$.fragment,y),h=!1},d(y){y&&M(t),K(e),g&&g.d(),K(c),d(),K(u),p=!1,A()}}}function jr(i){let t,e,n,o,s,r,a;return e=new Ke({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new dl({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[n0]},$$scope:{ctx:i}}}),o.$on("play",i[8]),o.$on("pause",i[9]),o.$on("audioRef",i[10]),{c(){t=V("div"),$(e.$$.fragment),n=ee(),$(o.$$.fragment),b(t,"class","audio svelte-1s6gk4a")},m(l,c){z(l,t,c),q(e,t,null),Q(t,n),q(o,t,null),a=!0},p(l,c){i=l;const d={};c&64&&(d.enable=i[6]),c&1&&(d.url=i[0].data.audioUrl),c&1&&(d.hooksInfo={tag:i[0]}),c&4100&&(d.$$scope={dirty:c,ctx:i}),o.$set(d)},i(l){a||(k(e.$$.fragment,l),k(o.$$.fragment,l),l&&De(()=>{r&&r.end(1),s=Rt(t,Bt,{duration:1e3,delay:0,easing:Zt}),s.start()}),a=!0)},o(l){var c,d;S(e.$$.fragment,l),S(o.$$.fragment,l),s&&s.invalidate(),l&&(r=tn(t,Bt,{duration:1e3,delay:20*Math.min((d=(c=i[5])==null?void 0:c.length)!=null?d:10,15),easing:Zt})),a=!1},d(l){l&&M(t),K(e),K(o),l&&r&&r.end()}}}function n0(i){let t,e,n;return e=new ul({props:{playing:i[2]}}),{c(){t=V("div"),$(e.$$.fragment),b(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){z(o,t,s),q(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){S(e.$$.fragment,o),n=!1},d(o){o&&M(t),K(e)}}}function i0(i){let t,e,n=i[0].state&&Vr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),z(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&k(n,1)):(n=Vr(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(se(),S(n,1,1,()=>{n=null}),re())},i(o){e||(k(n),e=!0)},o(o){S(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function o0(i,t,e){let n,o,s,{tag:r}=t,a=!1,l=!1,c;function d(){e(1,a=!a)}const f=()=>{e(2,l=!0)},u=()=>{e(2,l=!1)};function h(A){$i.call(this,i,A)}function p(){c=this.clientWidth,e(3,c)}return i.$$set=A=>{"tag"in A&&e(0,r=A.tag)},i.$$.update=()=>{var A,g,v;i.$$.dirty&1&&e(6,n=!!((A=r.state)!=null&&A.unfolded)),i.$$.dirty&1&&e(5,o=(v=(g=r.data.title)!=null?g:r.data.text)!=null?v:""),i.$$.dirty&2&&e(4,s=a?450:0)},[r,a,l,c,s,o,n,d,f,u,h,p]}class s0 extends oe{constructor(t){super(),ie(this,t,o0,i0,ne,{tag:0},t0)}}function r0(i){const t=document.createElement("div");t.style.color=i,document.body.appendChild(t);const e=window.getComputedStyle(t).color;document.body.removeChild(t);const n=(()=>e.search("rgba")===-1?e.replace("rgb","rgba").replace(")",", 1)"):e)(),o=n.replace("rgba","").replace("(","").replace(")","").split(",").map(s=>Number(s.trim()));return{rgba:n,r:o[0],g:o[1],b:o[2],a:o[3]}}function a0(i){le(i,"svelte-58hfjf",".audio-tag__wrapper.svelte-58hfjf{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.audio-tag.svelte-58hfjf{position:relative;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;padding:0.1875rem;padding-right:0.625rem;border-radius:624999.9375rem;border:0.03125rem solid rgba(255, 255, 255, 0.2)}.audio__inner.svelte-58hfjf{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.text.svelte-58hfjf{font-weight:bold;font-size:0.75rem;margin-left:0.25rem}.audio-icon__wrapper.svelte-58hfjf{position:relative;vertical-align:top;pointer-events:none;width:1.375rem;height:1.375rem}")}function Qr(i){let t,e,n,o;return n=new dl({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[c0]},$$scope:{ctx:i}}}),n.$on("play",i[7]),n.$on("pause",i[8]),n.$on("timeupdate",i[9]),n.$on("duration",i[10]),n.$on("audioRef",i[11]),{c(){t=V("div"),e=V("div"),$(n.$$.fragment),b(e,"class","audio-tag svelte-58hfjf"),T(e,"background-color",i[1]),T(e,"color",i[5]),b(t,"class","audio-tag__wrapper svelte-58hfjf")},m(s,r){z(s,t,r),Q(t,e),q(n,e,null),o=!0},p(s,r){const a={};r&1&&(a.enable=s[0].state.visible),r&1&&(a.url=s[0].data.audioUrl),r&1&&(a.hooksInfo={tag:s[0]}),r&8260&&(a.$$scope={dirty:r,ctx:s}),n.$set(a),r&2&&T(e,"background-color",s[1]),r&32&&T(e,"color",s[5])},i(s){o||(k(n.$$.fragment,s),o=!0)},o(s){S(n.$$.fragment,s),o=!1},d(s){s&&M(t),K(n)}}}function l0(i){let t;return{c(){t=Pe(i[6])},m(e,n){z(e,t,n)},p(e,n){n&64&&xe(t,e[6])},d(e){e&&M(t)}}}function c0(i){let t,e,n,o,s,r,a;return n=new ul({props:{playing:i[2]}}),r=new ho({props:{maxWidth:72,$$slots:{default:[l0]},$$scope:{ctx:i}}}),{c(){t=V("div"),e=V("div"),$(n.$$.fragment),o=ee(),s=V("div"),$(r.$$.fragment),b(e,"class","audio-icon__wrapper svelte-58hfjf"),b(s,"class","text svelte-58hfjf"),b(t,"class","audio__inner svelte-58hfjf")},m(l,c){z(l,t,c),Q(t,e),q(n,e,null),Q(t,o),Q(t,s),q(r,s,null),a=!0},p(l,c){const d={};c&4&&(d.playing=l[2]),n.$set(d);const f={};c&8256&&(f.$$scope={dirty:c,ctx:l}),r.$set(f)},i(l){a||(k(n.$$.fragment,l),k(r.$$.fragment,l),a=!0)},o(l){S(n.$$.fragment,l),S(r.$$.fragment,l),a=!1},d(l){l&&M(t),K(n),K(r)}}}function d0(i){let t,e,n=i[0].state&&Qr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),z(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&k(n,1)):(n=Qr(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(se(),S(n,1,1,()=>{n=null}),re())},i(o){e||(k(n),e=!0)},o(o){S(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function u0(i,t,e){let n,o,s,{tag:r}=t;oi();let a=!1,l=0,c=0;const d=()=>{e(2,a=!0)},f=()=>{e(2,a=!1)},u=A=>{e(3,l=A.detail)},h=A=>{e(4,c=A.detail)};function p(A){$i.call(this,i,A)}return i.$$set=A=>{"tag"in A&&e(0,r=A.tag)},i.$$.update=()=>{var A,g;i.$$.dirty&1&&e(6,n=(g=(A=r.data.title)!=null?A:r.data.text)!=null?g:""),i.$$.dirty&1&&e(1,o=(()=>{var v;return r.data.backgroundColor==="dark"?"rgba(0, 0, 0, 0.3)":r.data.backgroundColor==="light"?"rgba(255, 255, 255, 0.3)":(v=r.data.backgroundColor)!=null?v:"rgba(0, 0, 0, 0.3)"})()),i.$$.dirty&2&&e(5,s=(()=>{const{r:v,g:w,b:y}=r0(o);return(v*299+w*587+y*114)/1e3>=128?"rgba(0, 0, 0, 0.6)":"white"})())},[r,o,a,l,c,s,n,d,f,u,h,p]}class f0 extends oe{constructor(t){super(),ie(this,t,u0,d0,ne,{tag:0},a0)}}function h0(i){let t,e;return t=new f0({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function m0(i){let t,e;return t=new s0({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function p0(i){let t,e,n,o;const s=[m0,h0],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=s[t](i)),{c(){e&&e.c(),n=fe()},m(l,c){~t&&r[t].m(l,c),z(l,n,c),o=!0},p(l,[c]){let d=t;t=a(l),t===d?~t&&r[t].p(l,c):(e&&(se(),S(r[d],1,1,()=>{r[d]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),k(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(k(e),o=!0)},o(l){S(e),o=!1},d(l){~t&&r[t].d(l),l&&M(n)}}}function g0(i,t,e){let n,{tag:o}=t,s;function r(a){s=a.detail}return o.play=()=>s.play(),o.pause=()=>s.pause(),i.$$set=a=>{"tag"in a&&e(0,o=a.tag)},i.$$.update=()=>{var a;i.$$.dirty&1&&e(1,n=(a=o.data.appearance)!=null?a:"line")},[o,n,r]}class A0 extends oe{constructor(t){super(),ie(this,t,g0,p0,ne,{tag:0})}}function v0(i){le(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function Rr(i){var o;let t,e,n;return e=new ol({props:{mediaItemConfig:{canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(o=i[4])!=null?o:"withText",disableVideoIfHavePoster:!1,objectFit:i[2]},unfolded:i[6],mediaData:i[5],enableCarousel:i[1],autoplayConfig:i[3],tag:i[0],inDelay:500,duration:500}}),{c(){t=V("div"),$(e.$$.fragment),b(t,"class","media-wrapper svelte-10cw0el")},m(s,r){z(s,t,r),q(e,t,null),n=!0},p(s,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=s[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:s[2]}),r&64&&(a.unfolded=s[6]),r&32&&(a.mediaData=s[5]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){S(e.$$.fragment,s),n=!1},d(s){s&&M(t),K(e)}}}function b0(i){let t,e,n=i[0].state&&i[5]&&Rr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),z(o,t,s),e=!0},p(o,[s]){o[0].state&&o[5]?n?(n.p(o,s),s&33&&k(n,1)):(n=Rr(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(se(),S(n,1,1,()=>{n=null}),re())},i(o){e||(k(n),e=!0)},o(o){S(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function y0(i,t,e){let n,o,s,r,a,l,{tag:c}=t;return i.$$set=d=>{"tag"in d&&e(0,c=d.tag)},i.$$.update=()=>{var d,f;i.$$.dirty&1&&e(6,n=c.state?c.state.unfolded:!1),i.$$.dirty&1&&e(5,o=c.data.mediaData),i.$$.dirty&1&&e(1,s=c.data.enableCarousel),i.$$.dirty&1&&e(4,r=c.data.playIcon),i.$$.dirty&3&&e(3,a=(d=c.data.autoplayConfig)!=null?d:{autoplay:s!=null?s:!0,autoplayVideo:!0}),i.$$.dirty&1&&e(2,l=(f=c.data.objectFit)!=null?f:(()=>c.data.adaptationMode==="stretch"?"cover":c.data.adaptationMode==="proportional"?"contain":void 0)())},[c,s,l,a,r,o,n]}class w0 extends oe{constructor(t){super(),ie(this,t,y0,b0,ne,{tag:0},v0)}}function C0(i){return Y(this,null,function*(){return new Promise((t,e)=>{if(!i){e(Error("url is empty"));return}const n=new Image;n.src=i,n.onload=()=>t({width:n.width,height:n.height}),n.onerror=e})})}function P0(i){return Y(this,null,function*(){const{steps:t,url:e,ratio:n=3,fps:o=24}=i;if(!t)throw new Error("KeyframeIcon requires steps");const{width:s,height:r}=yield C0(e),a=s/n,l=r/n,c=a/t,d=l,f=1/o*t+"s",u=a/t-a;return{url:e,keyframesWidth:a,keyframesHeight:l,wrapperWidth:c,wrapperHeight:d,steps:t,duration:f,offsetX:u,offsetY:0}})}function E0(i){le(i,"svelte-mhs8j5","@keyframes svelte-mhs8j5-sprites-animation{0%{background-position:0 0}100%{background-position:var(--keyframe_offset_x) 0}}.icon-image.svelte-mhs8j5{display:block;width:100%}.icon-keyframe-container.svelte-mhs8j5{overflow:hidden}.icon-keyframe-wrapper.svelte-mhs8j5{transform-origin:0 0}.icon-keyframe.svelte-mhs8j5{background-repeat:no-repeat;animation-direction:normal;animation-iteration-count:infinite;animation-name:svelte-mhs8j5-sprites-animation}")}function Or(i){i[6]=i[14].url,i[7]=i[14].keyframesWidth,i[8]=i[14].keyframesHeight,i[9]=i[14].wrapperWidth,i[10]=i[14].wrapperHeight,i[11]=i[14].steps,i[12]=i[14].duration,i[13]=i[14].offsetX}function Hr(i){let t,e,n,o=i[2]&&Fr();function s(l,c){return l[3]?k0:I0}let r=s(i),a=r(i);return{c(){t=V("div"),o&&o.c(),e=ee(),a.c(),b(t,"class","icon"),T(t,"width",typeof i[0]=="number"?ye(i[0]):i[0])},m(l,c){z(l,t,c),o&&o.m(t,null),Q(t,e),a.m(t,null),n=!0},p(l,c){l[2]?o?c&4&&k(o,1):(o=Fr(),o.c(),k(o,1),o.m(t,e)):o&&(se(),S(o,1,1,()=>{o=null}),re()),r===(r=s(l))&&a?a.p(l,c):(a.d(1),a=r(l),a&&(a.c(),a.m(t,null))),c&1&&T(t,"width",typeof l[0]=="number"?ye(l[0]):l[0])},i(l){n||(k(o),n=!0)},o(l){S(o),n=!1},d(l){l&&M(t),o&&o.d(),a.d()}}}function Fr(i){let t,e;return t=new Ke({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function I0(i){let t,e;return{c(){t=V("img"),b(t,"class","icon-image svelte-mhs8j5"),Ne(t.src,e=i[1].url)||b(t,"src",e),b(t,"alt","icon")},m(n,o){z(n,t,o)},p(n,o){o&2&&!Ne(t.src,e=n[1].url)&&b(t,"src",e)},d(n){n&&M(t)}}}function k0(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:L0,then:D0,catch:x0,value:14};return To(e=i[4](i[1]),n),{c(){t=fe(),n.block.c()},m(o,s){z(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&2&&e!==(e=i[4](i[1]))&&To(e,n)||wc(n,i,s)},d(o){o&&M(t),n.block.d(o),n.token=null,n=null}}}function x0(i){return{c:Z,m:Z,p:Z,d:Z}}function D0(i){Or(i);let t,e,n,o=`url(${i[6]})`,s=`steps(${i[11]-1})`;return{c(){t=V("div"),e=V("div"),n=V("div"),b(n,"class","icon-keyframe svelte-mhs8j5"),T(n,"width",ye(i[7])),T(n,"height",ye(i[8])),T(n,"background-image",o),T(n,"animation-duration",i[12]),T(n,"animation-timing-function",s),T(n,"animation-delay",0),T(n,"background-size","100% 100%"),T(n,"--keyframe_offset_x",ye(i[13])),b(e,"class","icon-keyframe-wrapper svelte-mhs8j5"),T(e,"transform",typeof i[0]=="number"?`scale(${i[0]/i[9]})`:void 0),b(t,"class","icon-keyframe-container svelte-mhs8j5"),T(t,"width",typeof i[0]=="number"?ye(i[0]):ye(i[9])),T(t,"height",typeof i[0]=="number"?ye(i[10]*(i[0]/i[9])):ye(i[10]))},m(r,a){z(r,t,a),Q(t,e),Q(e,n)},p(r,a){Or(r),a&2&&T(n,"width",ye(r[7])),a&2&&T(n,"height",ye(r[8])),a&2&&o!==(o=`url(${r[6]})`)&&T(n,"background-image",o),a&2&&T(n,"animation-duration",r[12]),a&2&&s!==(s=`steps(${r[11]-1})`)&&T(n,"animation-timing-function",s),a&2&&T(n,"--keyframe_offset_x",ye(r[13])),a&3&&T(e,"transform",typeof r[0]=="number"?`scale(${r[0]/r[9]})`:void 0),a&3&&T(t,"width",typeof r[0]=="number"?ye(r[0]):ye(r[9])),a&3&&T(t,"height",typeof r[0]=="number"?ye(r[10]*(r[0]/r[9])):ye(r[10]))},d(r){r&&M(t)}}}function L0(i){return{c:Z,m:Z,p:Z,d:Z}}function S0(i){let t,e,n=i[1]&&Hr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),z(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&k(n,1)):(n=Hr(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(se(),S(n,1,1,()=>{n=null}),re())},i(o){e||(k(n),e=!0)},o(o){S(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function T0(i,t,e){let n,{width:o=null}=t,{icon:s=null}=t,{shadow:r=!1}=t;const a=oi();function l(c){return Y(this,null,function*(){const d=yield P0(c);return a("iconLoaded"),d})}return i.$$set=c=>{"width"in c&&e(0,o=c.width),"icon"in c&&e(1,s=c.icon),"shadow"in c&&e(2,r=c.shadow)},i.$$.update=()=>{i.$$.dirty&2&&e(3,n=(s==null?void 0:s.steps)>=2),i.$$.dirty&8&&!n&&a("iconLoaded")},[o,s,r,n,l]}class fl extends oe{constructor(t){super(),ie(this,t,T0,S0,ne,{width:0,icon:1,shadow:2},E0)}}function M0(i){le(i,"svelte-1lmyni6",".wrapper.svelte-1lmyni6{font-weight:600;cursor:pointer;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:auto}.text-wrapper.svelte-1lmyni6{position:relative;display:flex;align-items:center;justify-content:center}.text.svelte-1lmyni6{position:absolute;top:0;font-size:0.875rem;color:#ffffff;letter-spacing:0;text-align:center;max-width:8.75rem;width:-moz-max-content;width:max-content;word-break:break-all;line-height:1.125rem;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function Gr(i){let t,e,n,o,s,r;return e=new Ke({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=V("div"),$(e.$$.fragment),n=ee(),o=V("div"),s=Pe(i[1]),b(o,"class","text svelte-1lmyni6"),b(t,"class","text-wrapper svelte-1lmyni6")},m(a,l){z(a,t,l),q(e,t,null),Q(t,n),Q(t,o),Q(o,s),r=!0},p(a,l){(!r||l&2)&&xe(s,a[1])},i(a){r||(k(e.$$.fragment,a),r=!0)},o(a){S(e.$$.fragment,a),r=!1},d(a){a&&M(t),K(e)}}}function z0(i){let t,e,n,o;e=new fl({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[9]);let s=i[1]&&i[2]&&Gr(i);return{c(){t=V("div"),$(e.$$.fragment),n=ee(),s&&s.c(),b(t,"class","wrapper svelte-1lmyni6")},m(r,a){z(r,t,a),q(e,t,null),Q(t,n),s&&s.m(t,null),o=!0},p(r,[a]){const l={};a&1&&(l.icon=r[0]),e.$set(l),r[1]&&r[2]?s?(s.p(r,a),a&6&&k(s,1)):(s=Gr(r),s.c(),k(s,1),s.m(t,null)):s&&(se(),S(s,1,1,()=>{s=null}),re())},i(r){o||(k(e.$$.fragment,r),k(s),o=!0)},o(r){S(e.$$.fragment,r),S(s),o=!1},d(r){r&&M(t),K(e),s&&s.d()}}}function B0(i,t,e){let n,o,s,r,a,l,c,d,{tag:f}=t;const u=()=>{e(2,n=!0)};return i.$$set=h=>{"tag"in h&&e(3,f=h.tag)},i.$$.update=()=>{var h,p;i.$$.dirty&8&&e(1,o=(h=f.data.title)!=null?h:f.data.text),i.$$.dirty&8&&e(8,s=(p=f.data.icon)!=null?p:f.style.point),i.$$.dirty&256&&e(7,r=s.url),i.$$.dirty&256&&e(6,a=s.steps),i.$$.dirty&256&&e(5,l=s.fps),i.$$.dirty&256&&e(4,c=s.ratio),i.$$.dirty&240&&e(0,d={url:r,steps:a,fps:l,ratio:c})},e(2,n=!1),[d,o,n,f,c,l,a,r,s,u]}class V0 extends oe{constructor(t){super(),ie(this,t,B0,z0,ne,{tag:3},M0)}}function j0(i){le(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function Nr(i){let t,e=i[0].element+"",n;return{c(){t=new _n(!1),n=fe(),t.a=n},m(o,s){t.m(e,o,s),z(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function Q0(i){let t,e=typeof i[0].element=="string"&&Nr(i);return{c(){t=V("div"),e&&e.c(),b(t,"class","customElement__container svelte-kzl2aj")},m(n,o){z(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=Nr(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:Z,o:Z,d(n){n&&M(t),e&&e.d(),i[2](null)}}}function R0(i,t,e){let{tag:n}=t,o,s;Ze(()=>{if(o){if(n.element instanceof Element){const a=n.element;o.appendChild(a),s=()=>o==null?void 0:o.removeChild(a)}else if(typeof n.element=="function"){const a=n.element;s=a(o)}}}),It(()=>{s==null||s()});function r(a){Le[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class O0 extends oe{constructor(t){super(),ie(this,t,R0,Q0,ne,{tag:0},j0)}}function H0(i){le(i,"svelte-ofx2uu",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAAAhAAAAAkaG10eJ9gBO8AAADsAAABJG1heHAASVAAAAAArAAAAAZuYW1lqczkZQAAApQAAAJecG9zdP+4ADIAAAZwAAAAIAAAUAAASQAAAAEAAAABAADkeHeyXw889QADA+gAAAAA2NoRKwAAAADY2hErACn/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACCAA7AcwAdwIIADMCCAA0AhwAMwISADkCCAAuAfQANAH+ACsB/gApAggANAEeAFABHgBQAR4AUAIIADQCCAAuAR4AUAEeAFABfAAxAAEAAAPo/zgAAAIcACkAKQHgAAEAAAAAAAAAAAAAAAAAAABJAAMCLgGQAAUACAKKAlgAAABLAooCWAAAAV4AMgEsAAAAAAgAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFVLV04AIAAg/xsDIP84AMgD6ADIAAAAAQAAAAAB9AK8AAAAIAAAAAAAEADGAAEAAAAAAAEADAAAAAEAAAAAAAIABAAMAAEAAAAAAAMAGwAQAAEAAAAAAAQAEQArAAEAAAAAAAUAPAA8AAEAAAAAAAYAEAB4AAEAAAAAAAgADAAAAAEAAAAAAAkADAAAAAMAAQQJAAEAGACIAAMAAQQJAAIACACgAAMAAQQJAAMANgCoAAMAAQQJAAQAIgDeAAMAAQQJAAUAeAEAAAMAAQQJAAYAIAF4AAMAAQQJAAgAGACIAAMAAQQJAAkAGACIQUxJQkFCQSBGb250Qm9sZDEuMDAwO1VLV047QUxJQkFCQUZvbnQtQm9sZEFMSUJBQkEgRm9udCBCb2xkVmVyc2lvbiAxLjAwMDtQUyAwMDEuMDAwO2hvdGNvbnYgMS4wLjg4O21ha2VvdGYubGliMi41LjY0Nzc1QUxJQkFCQUZvbnQtQm9sZABBAEwASQBCAEEAQgBBACAARgBvAG4AdABCAG8AbABkADEALgAwADAAMAA7AFUASwBXAE4AOwBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAEEATABJAEIAQQBCAEEAIABGAG8AbgB0ACAAQgBvAGwAZABWAGUAcgBzAGkAbwBuACAAMQAuADAAMAAwADsAUABTACAAMAAwADEALgAwADAAMAA7AGgAbwB0AGMAbwBuAHYAIAAxAC4AMAAuADgAOAA7AG0AYQBrAGUAbwB0AGYALgBsAGkAYgAyAC4ANQAuADYANAA3ADcANQBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAAAAAAADAAAAAwAAASIAAQAAAAAAHAADAAEAAAEiAAABBgAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAABCSEMANjc4OTo7PD0+PwAAAAAAAAACAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGwAAAAAAABwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAFoAAAAQABAAAwAAACAALgA5AFoAegCl/xv//wAAACAALAAwAEEAYQCl/xr////hAAAABv/B/7v/nwAAAAEAAAAOAAAAAAAAAAAACgAAAEIASABDAEYARwADAAAAAAAA/7UAMgAAAAAAAAAAAAAAAAAAAAAAAAAAAQAEAgABAQERQUxJQkFCQUZvbnQtQm9sZAABAQEg+A8A+CAB+CEC+BgEtPtc+HT5tAX3KA/3UBGcHAZWEgAHAQENExoiKTpLbmluZS4wMDEuMDAxbW9uZXkudW5pRkYxQm5pbmUuMDAxdW5pRkYxQWNvcHlyaWdodCBtaXNzaW5nQUxJQkFCQSBGb250IEJvbGQAAAEAAQAAIhkAQhkAEQkBhwABigAADQAADwAAZAABiAABiwABiQAADgAASQIAAQCtAK4ArwCwALEAsgCzALQAtQC2ALcAuAC5ALoAuwC8AL0AvgC/AMAAwQDCAMMAxADFAMYAxwDIAMkAygDLAMwAzQDOAM8A0ADRANIA0wDUANUA1gDXANgA2QDaANsA3ADdAN4A3wDgAOEA4gFDAVoBqwIsAloCuAMcAzkDzwQ4BDoEPARRBFMEVQTNBOIE8QUEmPtc0Ky6rKKsuqzHrKPDoa2irLCspq2vraWssKzOAejVrKytrKzYA/gu+bQV+9H+fPfRBj76ORVqSWbNavs6rM2wSqwH7vsVFUXNafs68wfNaRVqZ6wG704VaklFJ6zNsEmsB/c6TxUn+zqt9xnNB6z7DhX7Bfs69wWsO++6anRpwwfv+0EV+wX7OvcFB/cZahUnXO8GrFMVamsHRVwF8Wr7OqwG0boFRawGDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OrIr5UQH3OPdUA/ebihVmaZSdbB9Mr2TL0xr3vgewlK2eqh7Kr86y1BuvrIJ5qh/HZrJIQhr7vgdngmp5bR5OZ0tkQxv46ARUX2FSH/u+B1a5YMDAs7TCHve+B8RjtVYeDnD4utkB93HzA/cL+QgVPfH8vPP5UgcOrIn5UgG++DYD+GmJFfw28wb3svfUBZ2glKSnGsNduFBWXF1UiB4ijgaMsJWsnqoIyLHMstYbsa6Ceawfy2ezSUAaVndXZ2Me+2/7jQX3pwYOrIvy92Tz90ryEr/zM/L3SvMu8hPy+B/3/xUT7LCwpMDDGq6CrHqoHsZnTK5DG2lrg3puH09pZk5EGobykAe4tba6vrViXFZiYlcedyOfBhPyxLpdUlJcW1JSXLvEH5ojfAdllGiebB5LsM5j1xuwrpSeqx/KsLPO1xrKcMNerx4OwPL1Affi8gP4dPdlFWD4fPshBvuJ/HkF+wH3ryPy87YH+8z1Ffc69+QF++QHDrb3ZNf3ZfAB9zX3YwP3nRZlaJSebB9LsGPO1xrzBlK6XMTEubrEHtcHxF26UlJcXFIeI/g0+BYh+677JAaorK2ZsBuwroJ4qx/LZrNHPxo/B2aCaHhrHktmR2NAGw6si/X3b/IBufX3b/ID95n4QBWAg4uKhh/3EfelBfsHBvtK/CMFfnCFbm0aZJVnnmoeSrLPYdobsq6Vnqwfy7K10dgasoGueKwey2RHtT4b+9YETlu7yMe8vcfHvVlPT1laTx8OmIr5UQG/+B8D93iKFfsIBvdo+OYF+6T2+B8oBg6iifL3bPX3QPEStvNB8vc/8jXxE/L4EvgHFRPss7Cnu78arYOreqgexWpNr0YbaWyDem4fUmlmTUcaXqBftGAeE/JWYmROSxpklWieax5Ksc9i2BuxrpWerB/LsbTP2BrHaMVath4T7PsN93QVu7FjXFtlZltcZbC7urGzuh8T8oX8ghVPW7zHx7q6yMa9W1BPWVpQHw6i96Tz92/0AbTz93DzA/hp+HkVsIGveKwezmNFtUAbZGeBeGofSmNiRT8aZJVnnmseSrHPYtoboAb7EvukBfcHBvdL+CEFmaySqaQa+9gWxry+yJ6dhoGcHq12oWZmGk5YW1BMXLnKHg4gCiEK+11L91IlCvdiyhWtb6hpJgoeJAoOIQogCqz3pe/3b/UBufX3bfQD+G74dxWyga94rB7NZEW0PhtlaIF4ah9KY2FFPxo7tkTPZh6MjIqKjB+TiJCIjYoIjgaCoKGHoRuanY6QoB+IgfsB+6QF9wcG9y/4IgWYppGnqhr7a/sCFVBbvMjHu7zGyLxbTk5aWk4fDvtd+AojCoz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-ofx2uu{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.withAnimation.svelte-ofx2uu{transition:opacity 0.3s linear}.content__container.unClickable.svelte-ofx2uu{pointer-events:none !important}.content__container.unClickable.svelte-ofx2uu *{pointer-events:none !important}.content__wrapper.svelte-ofx2uu{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-ofx2uu{opacity:0;pointer-events:none}.content__container.hide.svelte-ofx2uu *{pointer-events:none !important}.content__container.disable.svelte-ofx2uu{display:none}.content.svelte-ofx2uu{position:relative;width:100%;height:100%;font-size:0.75rem;line-height:1.125rem;color:#fff}.content.svelte-ofx2uu:not(.unfolded){pointer-events:none}.content.svelte-ofx2uu:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-ofx2uu{pointer-events:auto}')}function F0(i){let t,e;return{c(){t=V("div"),b(t,"data-info","tag content is keep folded"),b(t,"data-id",e=i[1].id)},m(n,o){z(n,t,o)},p(n,o){o&2&&e!==(e=n[1].id)&&b(t,"data-id",e)},i:Z,o:Z,d(n){n&&M(t)}}}function G0(i){let t,e,n,o,s,r,a,l,c;const d=[J0,U0,Y0,X0,_0,W0,N0],f=[];function u(h,p){return h[1].element?0:h[1].contentType==="Text"?1:h[1].contentType==="ImageText"||h[1].contentType==="Image"||h[1].contentType==="Video"?2:h[1].contentType==="Audio"?3:h[1].contentType==="Marketing"?4:h[1].contentType==="Link"||h[1].contentType==="VRLink"||h[1].contentType==="PanoLink"?5:h[1].contentType==="MediaPlane"?6:-1}return~(o=u(i))&&(s=f[o]=d[o](i)),{c(){var h,p,A;t=V("div"),e=V("div"),n=V("div"),s&&s.c(),b(n,"class","content svelte-ofx2uu"),te(n,"unfolded",(h=i[1].state)==null?void 0:h.unfolded),b(e,"class","content__wrapper svelte-ofx2uu"),b(t,"class","content__container svelte-ofx2uu"),b(t,"data-id",r=i[1].id),te(t,"disable",i[1].enabled===!1),te(t,"hide",!i[3].visible||!i[3].enabled||!i[4].visible||!((p=i[1].state)!=null&&p.visible)||((A=i[1].temporaryState)==null?void 0:A.visible)===!1),te(t,"withAnimation",i[0]),te(t,"unClickable",i[1].clickable===!1),T(t,"width",i[1].stickType==="Plane"?"100%":0),T(t,"height",i[1].stickType==="Plane"?"100%":0)},m(h,p){z(h,t,p),Q(t,e),Q(e,n),~o&&f[o].m(n,null),a=!0,l||(c=Se(t,"click",ha(i[12])),l=!0)},p(h,p){var g,v,w;let A=o;o=u(h),o===A?~o&&f[o].p(h,p):(s&&(se(),S(f[A],1,1,()=>{f[A]=null}),re()),~o?(s=f[o],s?s.p(h,p):(s=f[o]=d[o](h),s.c()),k(s,1),s.m(n,null)):s=null),(!a||p&2)&&te(n,"unfolded",(g=h[1].state)==null?void 0:g.unfolded),(!a||p&2&&r!==(r=h[1].id))&&b(t,"data-id",r),(!a||p&2)&&te(t,"disable",h[1].enabled===!1),(!a||p&26)&&te(t,"hide",!h[3].visible||!h[3].enabled||!h[4].visible||!((v=h[1].state)!=null&&v.visible)||((w=h[1].temporaryState)==null?void 0:w.visible)===!1),(!a||p&1)&&te(t,"withAnimation",h[0]),(!a||p&2)&&te(t,"unClickable",h[1].clickable===!1),p&2&&T(t,"width",h[1].stickType==="Plane"?"100%":0),p&2&&T(t,"height",h[1].stickType==="Plane"?"100%":0)},i(h){a||(k(s),a=!0)},o(h){S(s),a=!1},d(h){h&&M(t),~o&&f[o].d(),l=!1,c()}}}function N0(i){let t,e;return t=new w0({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function W0(i){let t,e;return t=new V0({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function _0(i){let t,e;return t=new _g({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function X0(i){let t,e;return t=new A0({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function Y0(i){let t,e;return t=new Dg({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function U0(i){let t,e;return t=new Fp({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function J0(i){let t,e;return t=new O0({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function Z0(i){let t,e,n,o;const s=[G0,F0],r=[];function a(l,c){return l[5]?0:1}return t=a(i),e=r[t]=s[t](i),{c(){e.c(),n=fe()},m(l,c){r[t].m(l,c),z(l,n,c),o=!0},p(l,[c]){let d=t;t=a(l),t===d?r[t].p(l,c):(se(),S(r[d],1,1,()=>{r[d]=null}),re(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),k(e,1),e.m(n.parentNode,n))},i(l){o||(k(e),o=!0)},o(l){S(e),o=!1},d(l){r[t].d(l),l&&M(n)}}}function q0(i,t,e){let n,o,s,r,a,{withAnimation:l=!1}=t,{tag:c}=t,{hooks:d}=t,{state:f}=t,{mediaStore:u}=t,{temporaryState:h}=t;Un("hooks",d),Un("mediaStore",u);let p,A;function g(w){w?d.emit("exposure",{id:r,type:"start"}):d.emit("exposure",{id:r,type:"end"})}const v=w=>d.emit("click",{event:w,target:"TagContent",tag:c});return i.$$set=w=>{"withAnimation"in w&&e(0,l=w.withAnimation),"tag"in w&&e(1,c=w.tag),"hooks"in w&&e(2,d=w.hooks),"state"in w&&e(3,f=w.state),"mediaStore"in w&&e(6,u=w.mediaStore),"temporaryState"in w&&e(4,h=w.temporaryState)},i.$$.update=()=>{var w,y,E,I,C,L,D,B,N,F,X;i.$$.dirty&2&&e(10,n=(w=c.state)==null?void 0:w.unfolded),i.$$.dirty&2&&e(9,o=(y=c.state)==null?void 0:y.visible),i.$$.dirty&26&&e(11,s=f.visible&&h.visible&&((E=c.state)==null?void 0:E.visible)),i.$$.dirty&2&&(r=c.id),i.$$.dirty&2048&&g(s),i.$$.dirty&1922&&c.hooks&&(n!==void 0&&n!==A&&(e(8,A=n),n?(C=(I=c.hooks).emit)==null||C.call(I,"unfolded"):(D=c==null?void 0:(L=c.hooks).emit)==null||D.call(L,"folded")),o!==void 0&&o!==p&&(e(7,p=o),o?(N=(B=c.hooks).emit)==null||N.call(B,"show"):(X=(F=c.hooks).emit)==null||X.call(F,"hide"))),i.$$.dirty&2&&e(5,a=(()=>!(typeof c.mergedConfig.unfoldedConfig=="object"&&c.mergedConfig.unfoldedConfig.keep==="folded"))())},[l,c,d,f,h,a,u,p,A,o,n,s,v]}class hl extends oe{constructor(t){super(),ie(this,t,q0,Z0,ne,{withAnimation:0,tag:1,hooks:2,state:3,mediaStore:6,temporaryState:4},H0)}}function K0(i){le(i,"svelte-yex9rb",'@charset "UTF-8";.tag-point-click-helper.svelte-yex9rb.svelte-yex9rb{position:absolute;pointer-events:auto;cursor:pointer;width:2.5rem;height:2.5rem;left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-yex9rb.svelte-yex9rb{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);z-index:-1}.tag-folded-point.svelte-yex9rb.svelte-yex9rb,.tag-unfolded-point.svelte-yex9rb.svelte-yex9rb{transition:all 0.5s}.tag-point-wrapper.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.3125rem;height:0.3125rem;border-radius:50%;background-color:white}.tag-point-wrapper.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb:before{content:"";position:absolute;width:0.875rem;height:0.875rem;border-radius:50%;background-color:rgba(0, 0, 0, 0.2)}.tag-point-wrapper.folded.svelte-yex9rb .tag-folded-point.svelte-yex9rb{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-yex9rb .tag-folded-point.svelte-yex9rb{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb{opacity:1;scale:1}')}function $0(i){let t,e,n,o,s,r,a,l,c,d,f,u;return o=new Ke({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new fl({props:{icon:i[2],width:i[1]}}),{c(){t=V("div"),e=ee(),n=V("div"),$(o.$$.fragment),s=ee(),r=V("div"),a=ee(),l=V("div"),$(c.$$.fragment),b(t,"class","tag-point-click-helper svelte-yex9rb"),b(r,"class","tag-unfolded-point svelte-yex9rb"),T(r,"transition-delay",(i[3]?i[5]:0)+"ms"),b(l,"class","tag-folded-point svelte-yex9rb"),T(l,"transition-delay",(i[3]?i[5]:0)+"ms"),b(n,"class","tag-point-wrapper svelte-yex9rb"),te(n,"unfolded",i[0]),te(n,"folded",i[3]),T(n,"width",ye(i[1])),T(n,"height",ye(i[1]))},m(h,p){z(h,t,p),z(h,e,p),z(h,n,p),q(o,n,null),Q(n,s),Q(n,r),Q(n,a),Q(n,l),q(c,l,null),d=!0,f||(u=Se(t,"click",i[4]),f=!0)},p(h,[p]){p&8&&T(r,"transition-delay",(h[3]?h[5]:0)+"ms");const A={};p&4&&(A.icon=h[2]),p&2&&(A.width=h[1]),c.$set(A),p&8&&T(l,"transition-delay",(h[3]?h[5]:0)+"ms"),(!d||p&1)&&te(n,"unfolded",h[0]),(!d||p&8)&&te(n,"folded",h[3]),p&2&&T(n,"width",ye(h[1])),p&2&&T(n,"height",ye(h[1]))},i(h){d||(k(o.$$.fragment,h),k(c.$$.fragment,h),d=!0)},o(h){S(o.$$.fragment,h),S(c.$$.fragment,h),d=!1},d(h){h&&M(t),h&&M(e),h&&M(n),K(o),K(c),f=!1,u()}}}function eA(i,t,e){let n,o,s,r;const a=ct("hooks");let{tag:l}=t,c,d=!1;const f=()=>{c!==void 0&&clearTimeout(c),d=!0,c=setTimeout(()=>{d=!1},800)},u=p=>{d||a.emit("click",{event:p,target:"TagPoint",tag:l})},h=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();return i.$$set=p=>{"tag"in p&&e(6,l=p.tag)},i.$$.update=()=>{var p,A,g,v;i.$$.dirty&64&&e(0,n=(p=l.state)==null?void 0:p.unfolded),i.$$.dirty&1&&e(3,o=!n),i.$$.dirty&64&&e(2,s=(g=(A=l.style)==null?void 0:A.point)!=null&&g.url?(v=l.style)==null?void 0:v.point:{url:mp}),i.$$.dirty&64&&e(1,r=(()=>{var y,E,I;const w=(I=(E=(y=l.style)==null?void 0:y.point)==null?void 0:E.size)!=null?I:"S";return typeof w=="number"?w:w==="S"?18:w==="M"?20:w==="L"?24:w==="XL"?28:18})())},f(),[n,r,s,o,u,h,l]}class tA extends oe{constructor(t){super(),ie(this,t,eA,$0,ne,{tag:6},K0)}}function nA(i){le(i,"svelte-bdubcv",".tag.hide.svelte-bdubcv{opacity:0;pointer-events:none}.tag.disable.svelte-bdubcv{display:none}.tag.withAnimation.svelte-bdubcv{transition:opacity 0.3s linear}.wrapper.svelte-bdubcv{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto}")}function iA(i){let t;return{c(){t=V("div"),b(t,"data-info","tag content is disable")},m(e,n){z(e,t,n)},p:Z,i:Z,o:Z,d(e){e&&M(t)}}}function oA(i){let t,e;return t=new hl({props:{mediaStore:i[2],withAnimation:i[0],tag:Te(i[1]),hooks:i[14],state:i[3],temporaryState:i[4]}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&4&&(s.mediaStore=n[2]),o&1&&(s.withAnimation=n[0]),o&2&&(s.tag=Te(n[1])),o&8&&(s.state=n[3]),o&16&&(s.temporaryState=n[4]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function sA(i){let t;return{c(){t=V("div"),b(t,"data-info","tag point is disable")},m(e,n){z(e,t,n)},p:Z,i:Z,o:Z,d(e){e&&M(t)}}}function rA(i){let t,e;return t=new tA({props:{tag:i[1]}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=n[1]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function aA(i){let t,e,n,o,s,r,a,l,c;const d=[oA,iA],f=[];function u(g,v){return g[12]?0:1}n=u(i),o=f[n]=d[n](i);const h=[rA,sA],p=[];function A(g,v){return g[13]?0:1}return r=A(i),a=p[r]=h[r](i),{c(){t=V("div"),e=V("div"),o.c(),s=ee(),a.c(),b(e,"class","wrapper svelte-bdubcv"),b(e,"data-tag-unfolded",i[8]),b(e,"data-tag-id",i[11]),b(e,"data-content-type",l=i[1].contentType),T(e,"left",i[7]),T(e,"top",i[6]),T(e,"z-index",i[5]),b(t,"class","tag svelte-bdubcv"),b(t,"data-tag-id",i[11]),te(t,"disable",i[10]),te(t,"hide",i[9]),te(t,"withAnimation",i[0])},m(g,v){z(g,t,v),Q(t,e),f[n].m(e,null),Q(e,s),p[r].m(e,null),c=!0},p(g,[v]){let w=n;n=u(g),n===w?f[n].p(g,v):(se(),S(f[w],1,1,()=>{f[w]=null}),re(),o=f[n],o?o.p(g,v):(o=f[n]=d[n](g),o.c()),k(o,1),o.m(e,s));let y=r;r=A(g),r===y?p[r].p(g,v):(se(),S(p[y],1,1,()=>{p[y]=null}),re(),a=p[r],a?a.p(g,v):(a=p[r]=h[r](g),a.c()),k(a,1),a.m(e,null)),(!c||v&256)&&b(e,"data-tag-unfolded",g[8]),(!c||v&2048)&&b(e,"data-tag-id",g[11]),(!c||v&2&&l!==(l=g[1].contentType))&&b(e,"data-content-type",l),v&128&&T(e,"left",g[7]),v&64&&T(e,"top",g[6]),v&32&&T(e,"z-index",g[5]),(!c||v&2048)&&b(t,"data-tag-id",g[11]),(!c||v&1024)&&te(t,"disable",g[10]),(!c||v&512)&&te(t,"hide",g[9]),(!c||v&1)&&te(t,"withAnimation",g[0])},i(g){c||(k(o),k(a),c=!0)},o(g){S(o),S(a),c=!1},d(g){g&&M(t),f[n].d(),p[r].d()}}}function lA(i,t,e){let n,o,s,r,a,l,c,d,f,{withAnimation:u=!1}=t,{tag:h}=t,{mediaStore:p}=t,{state:A}=t,{temporaryState:g}=t;const v=ct("hooks");return i.$$set=w=>{"withAnimation"in w&&e(0,u=w.withAnimation),"tag"in w&&e(1,h=w.tag),"mediaStore"in w&&e(2,p=w.mediaStore),"state"in w&&e(3,A=w.state),"temporaryState"in w&&e(4,g=w.temporaryState)},i.$$.update=()=>{var w,y,E,I,C,L,D,B;i.$$.dirty&2&&e(13,n=(()=>!(h.contentType==="Link"||h.contentType==="VRLink"||h.contentType==="PanoLink"||h.contentType==="Audio"&&h.data.appearance==="plane"))()),i.$$.dirty&2&&e(12,o=(()=>h.stickType==="2DPoint")()),i.$$.dirty&2&&e(11,s=h.id),i.$$.dirty&2&&e(10,r=!((w=h.pointTagStyle)!=null&&w.leftPercent)||!((y=h.pointTagStyle)!=null&&y.topPercent)||h.enabled===!1||!h.state),i.$$.dirty&2&&e(9,a=!((E=h.state)!=null&&E.visible)||((I=h.temporaryState)==null?void 0:I.visible)===!1),i.$$.dirty&2&&e(8,l=(C=h.state)==null?void 0:C.unfolded),i.$$.dirty&2&&e(7,c=((L=h.pointTagStyle)==null?void 0:L.leftPercent)+"%"),i.$$.dirty&2&&e(6,d=((D=h.pointTagStyle)==null?void 0:D.topPercent)+"%"),i.$$.dirty&2&&e(5,f=(B=h.state)!=null&&B.unfolded?1:0)},[u,h,p,A,g,f,d,c,l,a,r,s,o,n,v]}class cA extends oe{constructor(t){super(),ie(this,t,lA,aA,ne,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},nA)}}function dA(i){le(i,"svelte-uq11d5",".tag--container.svelte-uq11d5{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:translate3d(0, 0, 0)}.withAnimation.svelte-uq11d5{transition:opacity 0.3s linear}.tag--container.hide.svelte-uq11d5{opacity:0;pointer-events:none}.tag--container.hide.svelte-uq11d5 *{pointer-events:none !important}")}function Wr(i,t,e){const n=i.slice();return n[6]=t[e],n}function _r(i){let t,e=[],n=new Map,o,s=i[1];const r=a=>a[6].id;for(let a=0;a<s.length;a+=1){let l=Wr(i,s,a),c=r(l);n.set(c,e[a]=Xr(c,l))}return{c(){t=V("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","tag--container svelte-uq11d5"),te(t,"hide",!i[3].visible||!i[4].visible),te(t,"withAnimation",i[0])},m(a,l){z(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,l){l&31&&(s=a[1],se(),e=qe(e,l,r,1,a,s,n,t,Ot,Xr,null,Wr),re()),(!o||l&24)&&te(t,"hide",!a[3].visible||!a[4].visible),(!o||l&1)&&te(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)k(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)S(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function Xr(i,t){let e,n,o;return n=new cA({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=fe(),$(n.$$.fragment),this.first=e},m(s,r){z(s,e,r),q(n,s,r),o=!0},p(s,r){t=s;const a={};r&8&&(a.state=t[3]),r&16&&(a.temporaryState=t[4]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[6]),r&4&&(a.mediaStore=t[2]),n.$set(a)},i(s){o||(k(n.$$.fragment,s),o=!0)},o(s){S(n.$$.fragment,s),o=!1},d(s){s&&M(e),K(n,s)}}}function uA(i){let t,e,n=i[3].enabled&&_r(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),z(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&k(n,1)):(n=_r(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(se(),S(n,1,1,()=>{n=null}),re())},i(o){e||(k(n),e=!0)},o(o){S(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function fA(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return Un("hooks",s),i.$$set=c=>{"withAnimation"in c&&e(0,n=c.withAnimation),"tags"in c&&e(1,o=c.tags),"hooks"in c&&e(5,s=c.hooks),"mediaStore"in c&&e(2,r=c.mediaStore),"state"in c&&e(3,a=c.state),"temporaryState"in c&&e(4,l=c.temporaryState)},[n,o,r,a,l,s]}class hA extends oe{constructor(t){super(),ie(this,t,fA,uA,ne,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},dA)}}const mA={globalConfig:{unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},Link:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},VRLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},PanoLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0}}}};function pA(i){return i.stickType==="2DPoint"||i.stickType==="3DPoint"}function gA(i){return i.stickType==="3DPoint"||i.stickType==="Plane"}class AA extends li{constructor(e){super(e);m(this,"tagCacheByPanoIndex",{})}getCaches({panoIndex:e,id:n,key:o}){var c,d,f,u;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(f=(d=s.work)==null?void 0:d.workCode)!=null?f:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const h=l.get(n);return h||(l.set(n,{}),l.get(n))}return(u=l.get(n))==null?void 0:u[o]}clearCache(){this.tagCacheByPanoIndex={}}}class vA extends AA{constructor(e){super(e);m(this,"tags",[]);m(this,"config",mA);m(this,"raycaster",new x.Raycaster)}get isPanorama(){return this.five.currentMode==="Panorama"}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.error(`getTagById(): tag is ${n}, id is ${e}`);return}return n}changeContentTypeConfig(e,n,o=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),o?this.config.contentTypeConfig[e]=St.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache()}getVisibleByPanoIndex(e,n){var r;const o=this.getCaches({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(o.visible!==void 0)return o.visible;{const a=(()=>{var d,f,u;const l=(d=this.getTagConfig(e).visibleConfig)!=null?d:{},c=this.getDistance(e);if(typeof l=="function")return l(this.five,{tag:e,distance:c});if(l.keep==="hidden")return!1;if(l.keep==="visible")return!0;if(l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&s!==void 0&&(Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(s)||l.visiblePanoIndex==="current"&&s!==((f=e.fiveState)==null?void 0:f.panoIndex))||l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&rn(c,l.visibleDistance)===!1)return!1;if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s===void 0)return!1;const h=(u=this.five.work.observers[s])==null?void 0:u.position;if(h===void 0)throw new Error(`getVisible(): observerPosition is ${h}`);const p=Mn(e.position).sub(h).normalize();this.raycaster.set(h,p);const[A]=this.five.model.intersectRaycaster(this.raycaster),g=(()=>{var v;return typeof l.intersectRaycaster=="object"&&(v=l.intersectRaycaster.distanceAccuracy)!=null?v:.01})();if(A&&A.distance+g<c)return!1}return!(l.angleRange&&gA(e)&&rn(this.getAngle(e),l.angleRange)===!1)})();return o.visible=a,o.visible}}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCaches({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.unfoldDistance&&rn(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&rn(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.autoUnfold.strategy==="MinimumDistance"){const d=this.filterPointTag().filter(u=>this.getVisibleByPanoIndex(u)).filter(u=>{const h=this.getTagProject(u);if(!h)return!1;const{x:p,y:A,z:g}=h;return!(Math.abs(g)>1||Math.abs(p)>1||Math.abs(A)>1)}).map(u=>({tag:u,id:u.id,tagConfig:this.getTagConfig(u).unfoldedConfig})).filter(({tag:u,tagConfig:h})=>{var p,A;return!(typeof h!="object"||h.keep||h.autoUnfold===!1||((p=h.autoUnfold)==null?void 0:p.enable)===!1||((A=h.autoUnfold)==null?void 0:A.strategy)!=="MinimumDistance")}).map(u=>he(G({},u),{distance:this.getDistance(u.tag)})).filter(({distance:u,tagConfig:h})=>{var p,A;return!(u===void 0||typeof h!="object"||h.autoUnfold===!1||((p=h.autoUnfold)==null?void 0:p.enable)===!1||((A=h.autoUnfold)==null?void 0:A.strategy)!=="MinimumDistance"||h.autoUnfold.distance&&rn(u,h.autoUnfold.distance)===!1)}).sort((u,h)=>u.distance-h.distance).findIndex(u=>u.id===e.id);if(d===-1||d<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCaches({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const d=(()=>pA(e)?nt(e==null?void 0:e.position):Mn(e.position))(),f=c.distanceTo(d);return s.distance=f,f}}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCaches({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const d=(()=>e.stickType==="3DPoint"?hn(e.normal):$a(e.position))();if(!d)return;const f=new x.Vector3().copy(c).sub(Mn(e.position)),u=d.angleTo(f)*180/Math.PI;return s.angle=u,s.angle}}getTagConfig(e){var s;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(r=>{const a=r;if(n[a])return;const l=a.split("-");if(l.length===1){const[c]=l;e.contentType===c&&(n[a]=this.config.contentTypeConfig[a])}if(l.length===2){const[c="Any",d="Any"]=l;(e.stickType===c||c==="Any")&&(e.contentType===d||d==="Any")&&(n[a]=this.config.contentTypeConfig[a])}if(l.length===3){const[c="Any",d,f]=l;if(d==="Audio"&&e.contentType==="Audio"){const u=e;(u.stickType===c||c==="Any")&&u.data.appearance===f&&(n[a]=this.config.contentTypeConfig[a])}}});const o=St.default({},this.config.globalConfig,...Object.values(n),e.config);return typeof o.unfoldedConfig=="object"&&(o.unfoldedConfig.disableFold&&(o.unfoldedConfig={keep:"unfolded"}),o.unfoldedConfig.disableUnfold&&(o.unfoldedConfig={keep:"folded"}),o.unfoldedConfig.keep&&(o.unfoldedConfig={keep:o.unfoldedConfig.keep})),typeof o.visibleConfig=="object"&&o.visibleConfig.keep&&(o.visibleConfig={keep:o.visibleConfig.keep}),o}can(e,n){const o=this.getTagConfig(n);if(!o||typeof o!="object")return!0;if(e==="show"||e==="hide"){if(!o.visibleConfig||typeof o.visibleConfig!="object")return!0;if(e==="show"&&o.visibleConfig.keep==="hidden"||e==="hide"&&(o.visibleConfig.keep==="visible"||o.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!o.unfoldedConfig||typeof o.unfoldedConfig!="object")return!0;if(e==="fold"&&o.unfoldedConfig.keep==="unfolded"||e==="unfold"&&o.unfoldedConfig.keep==="folded")return!1}return!0}sort(e){return e.sort((n,o)=>{const s=this.getDistance(n),r=this.getDistance(o);return s===void 0||r===void 0?0:r-s})}setPointTagPosition(){const e=this.filterPointTag();e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=void 0;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=void 0;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const o=Mn(e.position),{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}filterPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint"||e.stickType==="3DPoint")}filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint")}filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint")}filter3DTag(){return this.tags.filter(e=>e.stickType==="3DPoint"||e.stickType==="Plane")}filterPlaneTag(){return this.tags.filter(e=>e.stickType==="Plane")}updateTagConfig(e){e!=null&&e.force&&this.clearCache(),this.tags.forEach(n=>{const o=this.getTagConfig(n);n.mergedConfig=o})}}function bA(i){var t,e,n,o;if(!i.stickType){const s=(()=>i.pointType==="PointTag"&&i.dimensionType==="3D"?"3DPoint":i.pointType==="PlaneTag"?"Plane":"2DPoint")();i.stickType=s}if(i.contentType==="VRLink"||i.contentType==="PanoLink"||i.contentType==="Link"){const s=i;!((e=(t=s.data)==null?void 0:t.icon)!=null&&e.url)&&!((o=(n=s.style)==null?void 0:n.point)!=null&&o.url)&&(s.data.icon={url:"//vrlab-static.ljcdn.com/release/web/test.09dee741.png",steps:28})}return i}const ml="2.0.7",Yi=`DnalogelPlugin-PanoTagPlugin@${ml}`,yA=!1,wA=i=>`${Yi}--${i}`;class pl extends vA{constructor(e,n){super(e);m(this,"version",ml);m(this,"state",{enabled:!0,visible:!0});m(this,"params");m(this,"debug");m(this,"css3DRenderPlugin");m(this,"TagContainerSvelte");m(this,"temporaryState",{visible:!0});m(this,"mediaStore",io({currentMediaElement:null}));m(this,"isIOSWX",navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1&&navigator.userAgent.toLowerCase().indexOf("iphone")!==-1);m(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});m(this,"disposedErrorLog",()=>{console.error(`${Yi} is disposed`)});this.params=G({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,zr(1,{namespace:ti.GetAudioDuration}),zr(1,{namespace:ti.PlayAudio}),Object.assign(window,{[`__PANOTAGPLUGIN_DEBUG_${Date.now()}__`]:this}),Object.assign(window,{__PANOTAGPLUGIN_DEBUG__:this})}load(e,n){return Y(this,null,function*(){var o,s;if(this.clearTags(),console.log(Yi," load:",{data:e}),this.config=St.default({},this.config,{globalConfig:(o=e.globalConfig)!=null?o:{},contentTypeConfig:(s=e.contentTypeConfig)!=null?s:{}}),this.debug)try{ep(this.five,this.tags)}catch(r){console.error(r)}return this.addTag(e.tagList,n)})}addTag(e,n){return Y(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r);return he(G({},r),{state:G({visible:void 0,unfolded:yA},a.initialState),hooks:new be.Subscribe,clickable:a.clickable,mergedConfig:a})}).filter(r=>r.position);return s.forEach(bA),this.tags.push(...s),tp(this.five).then(()=>{var r,a,l;return this.store.eventListenerDisposer&&((a=(r=this.store).eventListenerDisposer)==null||a.call(r)),this.state.enabled&&(this.store.eventListenerDisposer=this.addEventListener()),this.addResizeListener(),this.checkPanelTag(),this.setVisibleAndUnfolded({withAnimation:(l=n==null?void 0:n.withAnimation)!=null?l:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags(),!0})})}changeConfig(e,n=!0){n?this.config=St.default({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=St.default({},this.config.globalConfig,e):this.config.globalConfig=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}clearTags(){this.tags=[],this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}show(e){return Y(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("show",{userAction:n,withAnimation:o})})}hide(e){return Y(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("hide",{userAction:n,withAnimation:o})})}enable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n})}disable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:n}),this.hooks.emit("disable",{userAction:n})}dispose(){var e,n,o,s,r,a;this.pauseCurrentMedia(),this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filter3DTag().forEach(l=>{var c;return(c=l.tag3DContentSvelte)==null?void 0:c.svelteApp.$destroy()}),this.tags=[],(n=this.store.disposers)==null||n.forEach(l=>l==null?void 0:l()),this.store.disposers=[],this.store.disposed=!0,(s=(o=this.store).eventListenerDisposer)==null||s.call(o),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.clearCache(),this.hooks.emit("dispose")}setState(e,n){if(this.store.disposed)return this.disposedErrorLog();const{userAction:o=!0,visibleWithAnimation:s=!1}=n,r=G({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}changeUnfoldedById(e,n){var r;const o=this.getTagById(e);if(!o)return;o.state.unfolded=n;const s=this.filterPointTag();(r=this.TagContainerSvelte)==null||r.$set({tags:s})}changeTagNormalById(e,n){const o=this.getTagById(e);!o||!o.tag3DContentSvelte||(o.tag3DContentSvelte.currentNormal=nt(n),this.updateRenderPlaneTag())}changeDataById(e,n,o=!0){const s=this.getTagById(e);!s||(o?s.data=St.default({},s.data,n):s.data=G(G({},s.data),n),this.checkPanelTag(),this.updateRenderAllTags())}changeStickTypeById(e,n,o=!0){this.changeTagById(e,n,o)}changeTagById(e,n,o=!0){const s=this.getTagById(e);!n||(o?St.default(s,n):Object.assign(s,n),(s==null?void 0:s.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(s.tag3DContentSvelte.currentNormal=nt(n.normal)),this.updateRenderAllTags(),this.checkPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(o=>{const s=this.tags.findIndex(r=>r.id===o);s!==-1&&this.tags.splice(s,1)}),this.updateRenderAllTags()}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}setVisibleAndUnfolded(){return Y(this,arguments,function*({withAnimation:e}={withAnimation:!1}){if(!!this.isPanorama)return this.setVisibleByPanoIndex(),e?new Promise((n,o)=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.updateTagContainerVisible()}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.updateTagContainerVisible()}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.updateRenderAllTags()}handleDisable(){var e,n,o;this.pauseCurrentMedia(),this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),(o=this.TagContainerSvelte)==null||o.$set({tags:[]}),this.filter3DTag().forEach(s=>{var r;(r=s.tag3DContentSvelte)==null||r.svelteApp.$destroy(),s.tag3DContentSvelte=void 0})}addEventListener(){const{five:e,hooks:n}=this,o=this.handleFiveWantsMoveToPano.bind(this),s=this.handleFiveModeChange.bind(this),r=this.handleFiveCameraUpdate.bind(this),a=this.handleFiveCameraUpdateDebounce(),l=this.handleFivePanoArrived.bind(this),c=this.loadVideoFirstFrame.bind(this),d=this.clickhandler.bind(this);return this.five.currentMode&&(this.isPanorama?(this.handleFivePanoArrived(),this.temporaryShow({withAnimation:!0})):this.temporaryHide()),e.on("wantsMoveToPano",o),e.on("modeChange",s),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),e.on("panoArrived",c),n.on("click",d),()=>{e.off("wantsMoveToPano",o),e.off("modeChange",s),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),e.off("panoArrived",c),n.off("click",d),this.store.eventListenerDisposer=void 0}}loadVideoFirstFrame(){this.isIOSWX&&this.hooks.emit("loadVideoFirstFrame")}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const e=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=e,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(!this.store.disposed)return;const e=this.five.getElement(),n=()=>{!this.state.enabled||(this.show(),this.updateRenderAllTags())},o=()=>{!this.state.enabled||this.hide()},{observe:s,unobserve:r}=Ys(ip(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=Ys(Xs(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){e==="Panorama"?this.five.once("panoArrived",()=>this.temporaryShow({withAnimation:!0})):this.temporaryHide()}handleFiveWantsMoveToPano(){this.tags.forEach(e=>{const n=this.getTagConfig(e);typeof n.visibleConfig=="object"&&(n.visibleConfig.keep?e.temporaryState=he(G({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=he(G({},e.temporaryState),{visible:Boolean(n.visibleConfig.alwaysShowWhenMovePano)}))}),this.updateTagContainerVisible()}temporaryShow({withAnimation:e}={withAnimation:!1}){this.store.visibleWithAnimation=e,this.temporaryState.visible=!0,this.updateTagContainerVisible()}temporaryHide({withAnimation:e}={withAnimation:!1}){this.store.visibleWithAnimation=e,this.temporaryState.visible=!1,this.updateTagContainerVisible()}clickhandler(e){if(e.target!=="TagPoint")return;if(!e.tag.state)return console.warn("Clickhandler: params.tag.state is undefined");const n=this.can("fold",e.tag),o=this.can("unfold",e.tag);n&&o&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(s=>{s.id!==e.tag.id&&s.state&&this.can("fold",s)&&(s.state.unfolded=!1)}),this.updateRenderAllTags())}updateRenderAllTags(){this.updateRenderPointTag(),this.updateRenderPlaneTag()}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filter3DTag().forEach(n=>{var o;(o=n.tag3DContentSvelte)==null||o.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}handleFiveCameraUpdateDebounce(){return Xs(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return Y(this,null,function*(){yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=he(G({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);!n.state||o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.keep)||n.state&&(n.state.unfolded=!1)})}updateRenderPointTag(){var n;const e=this.sort(this.filterPointTag());if(this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const o=(n=this.five.getElement())==null?void 0:n.parentElement;if(!o)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new hA({target:o,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateRenderPlaneTag(){this.sort([...this.filterPlaneTag(),...this.filter3DPointTag()]).forEach(n=>{var o;if(n.tag3DContentSvelte){const{svelteApp:s,domContainer:r,initialNormal:a,currentNormal:l}=n.tag3DContentSvelte;if(s.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!a.equals(l)){const c=new H.Quaternion().setFromUnitVectors(a,l);r.css3DObject.setRotationFromQuaternion(c)}}else{if(((o=n.state)==null?void 0:o.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=en(this.five)),n.stickType==="3DPoint"&&!n.normal)return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");const s=n.stickType==="Plane"?n.position:np(this.five.camera.position,nt(n.position),nt(n.normal)),r=n.stickType==="Plane"?$a(n.position):nt(n.normal),a=this.getTagConfig(n).tag3DConfig,l=this.css3DRenderPlugin.create3DDomContainer(s,a);if(!l)return;this.store.css3DRenderDisposer.set(n.id,l.dispose),n.tag3DContentSvelte={svelteApp:new hl({target:l.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:l,initialNormal:r,currentNormal:r}}}),this.checkPanelTag()}disposeAllCSS3DContainer(){for(const[e,n]of this.store.css3DRenderDisposer)n==null||n();this.store.css3DRenderDisposer=new Map}checkPanelTag(){this.filter2DPointTag().forEach(e=>{var n;(n=e.tag3DContentSvelte)==null||n.domContainer.dispose(),e.tag3DContentSvelte=void 0});for(const[e,n]of this.store.css3DRenderDisposer){const o=this.getTagById(e);(!o||o.stickType==="2DPoint")&&(n==null||n(),this.store.css3DRenderDisposer.delete(e))}}}var gl=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.Custom="Custom",i))(gl||{}),Al=(i=>(i.Two="2D",i.Three="3D",i))(Al||{}),vl=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(vl||{});const CA=(i,t)=>new pl(i,t);class po extends H.Object3D{constructor(e,n){var o;super();m(this,"originObject3D");m(this,"onRender");this.originObject3D=e,this.onRender=(o=n==null?void 0:n.onRender)!=null?o:()=>{}}get helperObject(){return this}render(){this.onRender()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}updatePosition(){this.position.copy(this.originObject3D.position)}updateQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}applyHelperQuaternion(e,n){this.applyQuaternion(e)}}class PA extends po{}class EA extends po{}class IA extends po{}class kA extends IA{}class xA extends x.Group{constructor(e){super();m(this,"direction");this.direction=e||"x"}}class Yr extends x.Mesh{constructor(e,n,o){super(e,n);m(this,"direction");this.direction=o||"x"}}function DA(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new x.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function go(i,t,e){if(!t||!e||!i)return;const n=DA(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new x.Raycaster;return o.setFromCamera(n,i),o}function LA(i,t){return!(Math.abs(i.x-t.x)>1e-5||Math.abs(i.y-t.y)>1e-5||Math.abs(i.z-t.z)>1e-5)}class Di extends xA{constructor(e){var d;super(e.direction);m(this,"line");m(this,"arrow");m(this,"lineHeight",.4);m(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new x.Color((d=e.color)!=null?d:16214315),o=new x.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:x.DoubleSide}),s=new x.ConeGeometry(.04,.1,32),r=new Yr(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new x.CylinderGeometry(a,a,.4,32),c=new Yr(l,o.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const Li={X:15618642,Y:4765519,Z:4227839};class tt{static get X(){return new x.Color(Li.X).convertSRGBToLinear().clone()}static get Y(){return new x.Color(Li.Y).convertSRGBToLinear().clone()}static get Z(){return new x.Color(Li.Z).convertSRGBToLinear().clone()}}class SA extends PA{constructor(e){super(e);m(this,"xArrow",new Di({direction:"x",color:tt.X}));m(this,"yArrow",new Di({direction:"y",color:tt.Y}));m(this,"zArrow",new Di({direction:"z",color:tt.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function zt(i,t){return TA(document.createElement(t!=null?t:"div"),i)}function TA(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function MA(i){const t=zt(G({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class zA extends EA{constructor(e,n){var o;super(e);m(this,"yzCircle",new Si({direction:"x",color:tt.X}));m(this,"xzCircle",new Si({direction:"y",color:tt.Y}));m(this,"xyCircle",new Si({direction:"z",color:tt.Z}));m(this,"xRingHelper",new Ti({direction:"x"}));m(this,"yRingHelper",new Ti({direction:"y"}));m(this,"zRingHelper",new Ti({direction:"z"}));m(this,"xAngleHelper",new Mi({direction:"x",color:tt.X}));m(this,"yAngleHelper",new Mi({direction:"y",color:tt.Y}));m(this,"zAngleHelper",new Mi({direction:"z",color:tt.Z}));m(this,"angleTips");m(this,"container");n&&(this.container=n==null?void 0:n.container,this.angleTips=MA({display:"none"}),(o=this.container)==null||o.appendChild(this.angleTips.element)),this.show()}updateAngleHelperQuaternion(){this.xAngleHelper.quaternion.copy(this.yzCircle.quaternion),this.yAngleHelper.quaternion.copy(this.xzCircle.quaternion),this.zAngleHelper.quaternion.copy(this.xyCircle.quaternion),this.xRingHelper.quaternion.copy(this.yzCircle.quaternion),this.yRingHelper.quaternion.copy(this.xzCircle.quaternion),this.zRingHelper.quaternion.copy(this.xyCircle.quaternion)}applyHelperQuaternion(e,n){this.yzCircle.applyQuaternion(e),this.xzCircle.applyQuaternion(e),this.xyCircle.applyQuaternion(e),this.xAngleHelper.baseAxes.applyQuaternion(e),this.yAngleHelper.baseAxes.applyQuaternion(e),this.zAngleHelper.baseAxes.applyQuaternion(e)}hide(){this.remove(this.yzCircle,this.xzCircle,this.xyCircle,this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper)}show(){var e;this.add(this.xyCircle,this.xzCircle,this.yzCircle),this.remove(this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.add(...this.filterRingHelper(e)),this.add(...this.filterAngleHelper(e)),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.remove(this.yzCircle,this.xzCircle,this.xyCircle,this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper),(e=this.angleTips)!=null&&e.element&&((n=this.container)==null||n.removeChild(this.angleTips.element))}filterRingHelper(e){return[this.xRingHelper,this.yRingHelper,this.zRingHelper].filter(n=>e.includes(n.direction))}filterAngleHelper(e){return[this.xAngleHelper,this.yAngleHelper,this.zAngleHelper].filter(n=>e.includes(n.direction))}}class Si extends x.Mesh{constructor(e){var n;super();m(this,"direction");m(this,"gapAngle",.02);m(this,"geometry",new x.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new x.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:x.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class Ti extends x.Group{constructor(e){super();m(this,"direction");this.direction=e.direction;const n=.015,o=new Array(8).fill(null).map((s,r)=>{const a=new x.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new x.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:x.DoubleSide}),c=new x.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...o),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class Mi extends x.Mesh{constructor(e){var o;super();m(this,"direction");m(this,"baseAxes");switch(e.direction){case"x":this.baseAxes=new x.Vector3(0,0,1);break;case"y":this.baseAxes=new x.Vector3(1,0,0);break;case"z":this.baseAxes=new x.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new x.CircleGeometry(n,48,0,1e-4),this.material=new x.MeshBasicMaterial({opacity:.4,color:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:x.DoubleSide}),this.direction=e.direction,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}function BA(){const i=zt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=zt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=zt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element:ht({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:ht({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:ht({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:ht({cursor:"ew-resize",right:n})},l={direction:"nesw",element:ht({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:ht({cursor:"ns-resize",top:n})},d={direction:"nwse",element:ht({cursor:"nwse-resize",left:n,top:n})},f={direction:"ew",element:ht({cursor:"ew-resize",left:n})};return new Array(s,a,c,f,o,r,l,d).forEach(h=>t.appendChild(h.element)),{container:i,squares:[o,s,r,a,l,c,d,f]}}function ht(i){const t=zt(G({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=zt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=zt({width:"15px",height:"15px",cursor:i==null?void 0:i.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class VA extends kA{constructor(e,n,o,s){super(e);m(this,"points",[]);m(this,"cornerPositions",[]);m(this,"css3DInstance");m(this,"plane");m(this,"css3DRenderer",new Jt);m(this,"camera");m(this,"scene");m(this,"container");m(this,"enabled",!1);this.camera=o,this.scene=s,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}updatePosition(){var e;this.helperObject.position.copy(this.originObject3D.position),(e=this.plane)==null||e.position.copy(this.originObject3D.position)}updateQuaternion(){var e;(e=this.plane)==null||e.quaternion.copy(this.originObject3D.quaternion)}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(o=>o.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var o;(o=this.plane)==null||o.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,o)=>{n.position.copy(e[o])})}applyHelperQuaternion(e,n){var s;const o=(s=this.css3DInstance)==null?void 0:s.css3DObject;if(o){const r=new x.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.applyQuaternion(e)}if(this.plane){const r=new x.Vector3().subVectors(this.plane.position,n).applyQuaternion(e).add(n);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new x.Vector3().subVectors(r,n).applyQuaternion(e).add(n);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;!this.enabled||(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const n=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!n)return;this.css3DInstance=n,n.appendToElement(this.container);const o=n.css3DObject.container,{container:s,squares:r}=BA();this.points=r.map((l,c)=>({direction:l.direction,point:l.element,position:this.calculatePointPosition(e)[c]})),o.insertBefore(s,(a=o.children[0])!=null?a:null),this.updatePosition()}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("\u5F53\u524D\u7269\u4F53\u6682\u65F6\u4E0D\u652F\u6301 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}new x.Vector3;function pe(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new x.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}pe.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)};pe.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];pe.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}};pe.prototype._objectCtxInit=function(i){i._3xDomEvent={}};pe.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent};pe.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent};pe.prototype._objectCtxGet=function(i){return i._3xDomEvent};pe.prototype.camera=function(i){return i&&(this._camera=i),this._camera};pe.prototype.bind=function(i,t,e,n){console.assert(pe.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)};pe.prototype.addEventListener=pe.prototype.bind;pe.prototype.unbind=function(i,t,e,n){console.assert(pe.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);console.assert(l!==-1),this._boundObjs[t].splice(l,1)};pe.prototype.removeEventListener=pe.prototype.unbind;pe.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1};pe.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new x.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,d,f=r[0],u=f.object;this._selected=u,d=this._bound("mousemove",u),a!=u&&(l=this._bound("mouseover",u),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;d&&this._notify("mousemove",u,n,f),l&&this._notify("mouseover",u,n,f),c&&this._notify("mouseout",a,n,f)}};pe.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new x.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),d=l.parent;typeof c=="undefined"&&d;)c=this._objectCtxGet(d),d=d.parent;!c||this._notify(i,l,n,a)}}};pe.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(console.assert(arguments.length===4),!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),!!l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}};pe.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)};pe.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)};pe.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)};pe.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)};pe.prototype._onClick=function(i){this._onMouseEvent("click",i)};pe.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)};pe.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)};pe.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)};pe.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)};pe.prototype._onTouchMove=function(i){if(i.touches.length==1){i.preventDefault();var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}};pe.prototype._onTouchEvent=function(i,t){if(t.touches.length==1){t.preventDefault();var e=Number(t.touches[0].pageX/window.innerWidth)*2-1,n=-(t.touches[0].pageY/window.innerHeight)*2+1;this._onEvent(i,e,n,t)}};let Lt=null;class Ao{constructor(t,e,n,o,s,r,a){m(this,"hooks",new $t);m(this,"helperObject3D");m(this,"originObject3D");m(this,"camera");m(this,"model");m(this,"scene");m(this,"container");m(this,"domEvents");m(this,"isDragging",!1);m(this,"onRender");m(this,"enabled",!1);m(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});this.camera=t,this.model=e,this.originObject3D=n,this.helperObject3D=o,this.container=s,this.scene=r,this.domEvents=new pe(t,s),this.onRender=a!=null?a:()=>{},this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable()}initialHelperPosition(){this.helperObject3D.updatePosition()}initialHelperQuaternion(){this.helperObject3D.updateQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.render())}disable(){!this.enabled||(this.enabled=!1,this.scene.remove(this.helperObject3D),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){this.helperObject3D.dispose(),this.scene.remove(this.helperObject3D),this.render()}setOpacity(t){this.setOriginOpacityProperty();const e=this.originObject3D;if(e instanceof x.Mesh&&(e.material.opacity=t),e.isCSS3DObjectPlus){const n=e;n.container.style.opacity=t.toString()}this.render()}restoreOpacity(){if(Lt===null)return;const t=this.originObject3D;if(t instanceof x.Mesh&&(t.material.opacity=Lt.opacity),t.isCSS3DObjectPlus){const e=t;e.container.style.opacity=Lt.opacity.toString()}this.render()}setOriginOpacityProperty(){var t,e;if(Lt===null){const n=this.originObject3D;n instanceof x.Mesh&&(Lt={opacity:n.material.opacity}),n instanceof ta&&(Lt={opacity:(t=n.container.style.opacity)!=null?t:1}),n.isCSS3DObjectPlus&&(Lt={opacity:Number((e=n.container.style.opacity)!=null?e:1)})}}updateHelperPosition(){this.helperObject3D.updatePosition()}updateHelperQuaternion(){this.helperObject3D.updateQuaternion()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}render(){this.onRender()}hoverListener(t,e=16777215,n=1){const o=(Array.isArray(t)?t:[t]).filter(We),s=[];for(const r of o)if(r instanceof x.Mesh||r instanceof x.Group){const a=r instanceof x.Group?r.children.filter(u=>u instanceof x.Mesh):[r];a.forEach(u=>{u.__originalColor__=u.material.color.clone(),u.__originalOpacity__=u.material.opacity});const l=()=>{a.forEach(u=>{u.material.color.set(e),u.material.opacity=n}),this.render()},c=()=>{a.forEach(u=>{u.material.color.copy(u.__originalColor__),u.material.opacity=u.__originalOpacity__}),this.render()},d=()=>{this.isDragging||l()},f=()=>{this.isDragging||c()};for(const u of a)this.domEvents.addEventListener(u,"mouseover",d),this.domEvents.addEventListener(u,"mouseout",f),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),s.push(()=>{this.domEvents.removeEventListener(u,"mouseover",d),this.domEvents.removeEventListener(u,"mouseout",f),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>s.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;let o;const s=t.intersectObject(n,!0)[0];if(!!s&&(o=s,o.object=n,!!o)){if(this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<o.point.distanceTo(e))return}return o.object}}}class jA extends Ao{constructor(...e){super(...e);m(this,"startInfo");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=new x.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new x.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new x.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(o){case"x":return s;case"y":return r;case"z":return a}})(),c=(()=>{switch(o){case"x":case"y":return a;case"z":return s}})(),d=n.point.clone(),f=new x.Plane;f.setFromNormalAndCoplanarPoint(c,d),this.startInfo={startVectorProject:d.clone().projectOnVector(l),directionVector:l,plane:f},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("moveStart"),this.isDragging=!0,console.log("%c MoveController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=go(this.camera,e,this.container);return n?(console.log("%c RotateController dragging","color: #49de1b"),this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:o,startVectorProject:s}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new x.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),d=new x.Matrix4;d.setPosition(c),r.applyMatrix4(d),this.helperObject3D.applyMatrix4(d),s.copy(l),this.hooks.emit("positionUpdate",{matrix4:d})}dragEnd(){!this.isDragging||(console.log("%c MoveController dragEnd","color: #e94e4e"),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class zi{constructor(t,e,n,o){m(this,"helperController");m(this,"five");m(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});m(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});const{camera:s,model:r,scene:a}=t,l=t.getElement();if(this.five=t,!s||!r||!l||!a)return;const c=()=>{t.needsRender=!0};this.helperController=new e(s,r,n,o,l,a,c),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture)}}const QA="v1.0.1",RA="Object3DHelper",vo=`${RA}@${QA}`,OA=()=>{console.error(`${vo} is disposed`)},HA=()=>{console.warn(`${vo} is disabled`)},FA=()=>{console.error(`${vo} is disabled`)};class GA{constructor(t,e){m(this,"controllers",{});m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"hooks",new $t);m(this,"helpers");m(this,"eventListener",{});m(this,"handlePositionUpdate",(t,...e)=>{var s,r,a,l;const[n]=e,o=n==null?void 0:n.matrix4;o&&(t!==this.controllers.moveController&&((s=this.controllers.moveController)==null||s.applyHelperMatrix4(o)),t!==this.controllers.rotateController&&((r=this.controllers.rotateController)==null||r.applyHelperMatrix4(o)),t!==this.controllers.scaleController&&((a=this.controllers.scaleController)==null||a.applyHelperMatrix4(o)),(l=this.helpers.outlineHelper)==null||l.applyMatrix4(o))});m(this,"handleScaleUpdate",(t,...e)=>{var s,r;const[n]=e,o=n==null?void 0:n.matrix4;o&&((s=this.controllers.scaleController)==null||s.applyHelperScaleMatrix4(o,n),(r=this.helpers.outlineHelper)==null||r.scale.applyMatrix4(o))});m(this,"handleRotateUpdate",(t,...e)=>{var o,s,r,a;const[n]=e;if(n){const{quaternion:l,origin:c}=n;l&&(t!==this.controllers.moveController&&((o=this.controllers.moveController)==null||o.applyHelperQuaternion(l,c)),t!==this.controllers.rotateController&&((s=this.controllers.rotateController)==null||s.applyHelperQuaternion(l,c)),t!==this.controllers.scaleController&&((r=this.controllers.scaleController)==null||r.applyHelperQuaternion(l,c)),(a=this.helpers.outlineHelper)==null||a.applyQuaternion(l))}});t&&this.addControllers(t),this.helpers=e!=null?e:{},this.setState(this.state)}show(t){return Y(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return Y(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return OA();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return FA();const n=G({},this.state);this.state=G(G({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=G(G({},this.controllers),t),this.addEventListener(),this.setState(this.state)}addHelpers(t){this.helpers=G(G({},this.helpers),t)}getCurrentState(){return this.state}addEventListener(){for(const t in this.controllers){if(!t)continue;const e=t;this.eventListener[e]||(this.eventListener[e]=(()=>{const n=this.controllers[e];if(!n)return;const o=()=>this.handleStart(n),s=()=>this.handleEnd(n),r=(...c)=>this.handlePositionUpdate(n,...c),a=(...c)=>this.handleRotateUpdate(n,...c),l=(...c)=>this.handleScaleUpdate(n,...c);return n.hooks.on("moveStart",o),n.hooks.on("rotateStart",o),n.hooks.on("scaleStart",o),n.hooks.on("positionUpdate",r),n.hooks.on("rotateUpdate",a),n.hooks.on("scaleUpdate",l),n.hooks.on("moveEnd",s),n.hooks.on("rotateEnd",s),n.hooks.on("scaleEnd",s),()=>{n.hooks.off("moveStart",o),n.hooks.off("rotateStart",o),n.hooks.off("scaleStart",o),n.hooks.off("positionUpdate",r),n.hooks.off("rotateUpdate",a),n.hooks.off("scaleUpdate",l),n.hooks.off("moveEnd",s),n.hooks.off("rotateEnd",s),n.hooks.off("scaleEnd",s)}})())}}handleEnd(t){t&&this.setOtherHelpersVisible(!0,t)}handleStart(t){t&&this.setOtherHelpersVisible(!1,t)}setOtherHelpersVisible(t,e){var n,o,s,r;t?((s=this.controllers.moveController)==null||s.helperObject3D.show(),(r=this.controllers.rotateController)==null||r.helperObject3D.show()):(e!==this.controllers.moveController&&((n=this.controllers.moveController)==null||n.helperObject3D.hide()),e!==this.controllers.rotateController&&((o=this.controllers.rotateController)==null||o.helperObject3D.hide()))}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable(),n.restoreOpacity()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide(),n.restoreOpacity()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose(),n==null||n.restoreOpacity()});for(const n in this.controllers){if(!n)continue;const o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&HA()}}class NA extends Ao{constructor(...e){super(...e);m(this,"startInfo");m(this,"lastRotation");m(this,"rotations",[]);m(this,"helperObject3DQuaternion",this.originObject3D.quaternion.clone());const n=this.helperObject3D;this.hoverListener([n.xyCircle,n.xzCircle,n.yzCircle]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)}initialHelperQuaternion(){this.helperObject3D.updateAngleHelperQuaternion(),this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();this.helperObject3D.updateAngleHelperQuaternion();const s=n.point,r=this.originObject3D.position.clone(),a=this.getAngleHelper(o);this.setTipsAngle(0);const l=s.clone();l.y+=.2,this.setTipsPosition(l);const c=new x.Vector3(1,0,0).applyQuaternion(this.helperObject3DQuaternion),d=new x.Vector3(0,1,0).applyQuaternion(this.helperObject3DQuaternion),f=new x.Vector3(0,0,1).applyQuaternion(this.helperObject3DQuaternion),u=(()=>{switch(o){case"x":return c;case"y":return d;case"z":return f}})(),h=new x.Plane().setFromNormalAndCoplanarPoint(u,s),p=new x.Vector3;h.projectPoint(s.clone(),p);const A=p.clone().sub(r),g=A.clone(),v=A.angleTo(a.baseAxes);this.setAngleHelperStart(o,v),this.setAngleHelperLength(o,0),this.rotations.push({vector:A.clone(),direction:!0}),this.startInfo={direction:o,startVector:A,staticStartVector:g,plane:h,angleHelper:a},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0,console.log(`%c RotateController dragStart ${o}`,"color: #e5af2e")}dragging(e){var o;if(!this.isDragging)return;const n=go(this.camera,e,this.container);return n?(console.log(`%c RotateController dragging ${(o=this.startInfo)==null?void 0:o.direction}`,"color: #49de1b"),this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,staticStartVector:r,direction:a}=this.startInfo,l=this.originObject3D,c=e.ray.intersectPlane(o,new x.Vector3);if(!c)return;const d=l.position.clone(),f=new x.Vector3;o.projectPoint(c.clone(),f);const u=f.clone().sub(d);if(n.angleTo(u)===0||(this.lastRotation===void 0&&(this.lastRotation={angle:0}),this.rotations.length===0))return;const h=(()=>{if(this.rotations.length===1)return u.angleTo(s.baseAxes)>r.angleTo(s.baseAxes);{const A=this.rotations[this.rotations.length-1],g=this.rotations[this.rotations.length-2],v=u.angleTo(g.vector),w=u.angleTo(A.vector),y=A.vector.angleTo(g.vector);if(y===0||w===0||v===0)return;if(v>w&&v>y)return A.direction;if(v<y&&w<y||v<w&&w>y)return!A.direction}})();if(h===void 0)return console.warn("rotationDirection is undefined");this.rotations.push({vector:u,direction:h}),this.rotations=this.rotations.slice(-2),this.lastRotation.angle=this.lastRotation.angle+u.angleTo(n)*(h?1:-1),this.setAngleHelperLength(a,this.lastRotation.angle),this.setTipsAngle(this.lastRotation.angle/Math.PI*180);const p=new x.Quaternion().setFromUnitVectors(n.clone().normalize(),u.clone().normalize());l.applyQuaternion(p),this.helperObject3D.applyHelperQuaternion(p),this.helperObject3DQuaternion.premultiply(p),this.hooks.emit("rotateUpdate",{quaternion:p,origin:d}),this.startInfo.startVector=u}dragEnd(){!this.isDragging||(console.log("%c RotateController dragEnd","color: #e94e4e"),this.startInfo=void 0,this.isDragging=!1,this.lastRotation=void 0,this.rotations=[],this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){switch(e){case"x":return this.helperObject3D.xAngleHelper;case"y":return this.helperObject3D.yAngleHelper;case"z":return this.helperObject3D.zAngleHelper}}setAngleHelperStart(e,n){const o=this.getAngleHelper(e);if(o instanceof x.Mesh&&o.geometry instanceof x.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new x.CircleGeometry(s,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const s=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof x.Mesh&&r.geometry instanceof x.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new x.CircleGeometry(a,c,l,s)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var o;const n=(o=this.helperObject3D.angleTips)==null?void 0:o.element;!n||(n.innerText=`${e.toFixed(0)}\xB0`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const o=e.project(this.camera),{x:s,y:r,z:a}=o;if(a>1)return;const l=(s+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class WA extends Ao{constructor(...e){super(...e);m(this,"startInfo")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}getDragPlane(){const e=new x.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new H.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var s,r;(r=(s=this.helperObject3D).updatePoints)==null||r.call(s);const o=this.getDragPlane();if(!o)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:o},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0,console.log("%c RectangleScaleController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging)return;const n=go(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n),console.log("%c RectangleScaleController dragging","color: #49de1b")}scale(e){var B,N;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:o,plane:s}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(s,new H.Vector3);if(!a||LA(a,this.camera.position))return;const l=new H.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:d}=o,f=new H.Vector3().subVectors(r[1],r[0]),u=new H.Vector3().subVectors(r[3],r[0]),h=F=>{const X=new H.Vector3(0,0,0);if(!this.startInfo)return X;const j=(F==="ew"?f:u).clone(),P=c.clone().projectOnVector(j),R=a.clone().projectOnVector(j),O=l.clone().projectOnVector(j);if(R.equals(P))return X;if(F==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const _=new H.Vector3().subVectors(R,O),J=_.x<0&&j.x>=0,de=_.y<0&&j.y>=0,ue=_.z<0&&j.z>=0;this.startInfo.dragPointInCenterBottom=J||de||ue}if(F==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const _=new H.Vector3().subVectors(R,O),J=_.x<0&&j.x>=0,de=_.y<0&&j.y>=0,ue=_.z<0&&j.z>=0;this.startInfo.dragPointInCenterLeft=J||de||ue}const W=new H.Vector3().subVectors(R,P),U=W.length();return U>.3?(console.warn("offset.length() > 0.3, skipped",U),X):W},p=h("ew"),A=h("ns"),g=()=>{const F=p;this.helperObject3D.cornerPositions.forEach((X,j)=>{var P;(P=this.startInfo)!=null&&P.dragPointInCenterLeft?(j===0||j===3)&&X.add(F):(j===1||j===2)&&X.add(F)})},v=()=>{const F=A;this.helperObject3D.cornerPositions.forEach((X,j)=>{var P;(P=this.startInfo)!=null&&P.dragPointInCenterBottom?(j===0||j===1)&&X.add(F):(j===2||j===3)&&X.add(F)})};switch(d){case"ew":g();break;case"ns":v();break;case"nesw":case"nwse":g(),v()}const w=new H.Vector3().subVectors(r[1],r[0]).length()/f.length(),y=new H.Vector3().subVectors(r[3],r[0]).length()/u.length(),E=new H.Vector3(w,y,1),I=new x.Matrix4().scale(E);n.isCSS3DObjectPlus?n.applyScaleMatrix4(I):n.scale.applyMatrix4(I),o.position.copy(a);const C=new H.Vector3().addVectors(r[0],r[2]).divideScalar(2),L=new H.Vector3().subVectors(C,l),D=new x.Matrix4().setPosition(L);n.applyMatrix4(D),(B=this.helperObject3D.css3DInstance)==null||B.css3DObject.applyMatrix4(D),(N=this.helperObject3D.plane)==null||N.applyMatrix4(D),this.hooks.emit("scaleUpdate",{matrix4:I,helperOrigin:l}),this.hooks.emit("positionUpdate",{matrix4:D}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render(),console.log("%c RectangleScaleController dragEnd","color: #e94e4e"))}}class _A extends WA{constructor(...t){super(...t),this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(t=>{if(!t)return;const e=t.point,n=r=>this.dragStart(r,t),o=this.dragging.bind(this),s=this.dragEnd.bind(this);e.addEventListener("dragstart",n),e.addEventListener("drag",o),e.addEventListener("dragend",s)})}}const bo="v1.0.0",Ui="Object3DHelperPlugin",pi=`${Ui}@${bo}`,XA=()=>{console.error(`${pi} is disposed`)},YA=()=>{console.warn(`${pi} is disabled`)},UA=()=>{console.error(`${pi} is disabled`)};class bl extends li{constructor(e){super(e);m(this,"version",bo);m(this,"name",Ui);m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"objectHelperMap",new Map);m(this,"css3DObjectParentMap",new Map);m(this,"css3DRender");this.five=e,this.css3DRender=new Jt(this.five.scene),console.warn("Object3DHelper: \u4F7F\u7528\u6B64\u63D2\u4EF6\u9700\u8981\u5728\u521D\u59CB\u5316five\u65F6\uFF0C\u8BBE\u7F6Efive\u53C2\u6570: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${Ui.toUpperCase()}_DEBUG__`]:this})}show(e){return Y(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Y(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){if(this.state.disposed)return XA();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return UA();const o=G({},this.state);this.state=G(G({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var d;if(!e)return console.error("Object3D is undefined");if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const o=new GA;this.objectHelperMap.set(e,o);const s=(d=this.five.getElement())==null?void 0:d.parentElement,r=this.five.camera,{moveHelper:a=!0,rotateHelper:l=!0,scaleHelper:c=!0}=n;if(a){const f=new SA(e),u=new zi(this.five,jA,e,f);o.addControllers({moveController:u.helperController})}if(l){let f;s&&r&&(f={container:s});const u=new zA(e,f),h=new zi(this.five,NA,e,u);o.addControllers({rotateController:h.helperController})}if(c&&s){const f=new VA(e,s,r,this.five.scene),u=new zi(this.five,_A,e,f);o.addControllers({scaleController:u.helperController})}e.isCSS3DObjectPlus&&ia(this.five).then(()=>{var f,u;if(e.isCSS3DObjectPlus){const h=e,p=(f=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?f:oa(this.five);p&&e&&(this.css3DObjectParentMap.set(h,h.parent),h.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(p),(u=this.css3DRender.getBehindCSS3DObjectGroup())==null||u.add(h),this.css3DRender.render(this.five.camera))}})}removeObject3DHelper(e){const n=this.objectHelperMap.get(e);if(!!n){if(e.isCSS3DObjectPlus){const o=e,s=this.css3DObjectParentMap.get(o);s==null||s.add(o),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose()}}handleEnable(e,n=!0){e?(this.everyHelperDo(o=>o.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(o=>o.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(o=>o.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(o=>o.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.everyHelperDo(e=>e.dispose())}everyHelperDo(e){this.objectHelperMap.forEach(n=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&YA()}}const JA=i=>new bl(i);exports.CSS3DRender=Jt;exports.CSS3DRenderPlugin=en;exports.CameraMovementEffect=Sa;exports.CameraMovementPlugin=cf;exports.ContentType=gl;exports.CruisePlugin=Ym;exports.CruisePluginController=uo;exports.DIRECTION=Yt;exports.DISPLAY_STRATEGY_TYPE=Tt;exports.DimensionType=Al;exports.FLOOR_PLAN_ATTACHED_TO=gt;exports.FLOOR_TYPE_MAP=Zu;exports.GuideLinePlugin=Za;exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=Mt;exports.ItemLabelPlugin=vm;exports.Magnifier=Ba;exports.MapviewFloorplanPlugin=Du;exports.ModelChassisCompassPlugin=$u;exports.ModelEntryDoorGuidePlugin=nf;exports.ModelFloorplanPlugin=Eu;exports.ModelItemLabelPlugin=Kh;exports.ModelRoomLabelPlugin=jc;exports.ModelTVVideoPlugin=tm;exports.ModelViewPlugin=Xl;exports.Object3DHelperController=bl;exports.Object3DHelperPlugin=JA;exports.PLUGIN=pi;exports.PaintBrush=_l;exports.PaintBrushTypeEnum=et;exports.PanoCompassPlugin=Sf;exports.PanoCursorRaycasterPlugin=dc;exports.PanoDoorLabelPlugin=Tm;exports.PanoFloorplanRadarPlugin=Uu;exports.PanoMeasurePlugin=kh;exports.PanoMeasurePluginLine=Ft;exports.PanoMeasurePluginModel=fi;exports.PanoMeasurePluginPoint=_e;exports.PanoMeasurePluginPolyline=ui;exports.PanoRulerPlugin=mf;exports.PanoRulerProPlugin=If;exports.PanoSpatialTagPlugin=Fh;exports.PanoTagPlugin=CA;exports.PanoTagPluginController=pl;exports.PointType=vl;exports.ROOM_FETILE_TYPE_MAP=Ju;exports.ROOM_TYPE_MAP=qu;exports.Rotation=Ue;exports.TopviewFloorplanPlugin=Su;exports.Util=Fg;exports.VERSION=bo;exports.itemLabelPluginServerParams=bm;exports.modelItemLabelPluginServerParams=$h;exports.modelRoomLabelPluginServerParams=Qc;exports.pluginFlag=wA;
|
|
559
|
+
`;function Qg(){const i=new x.PlaneGeometry(.4,.4),t=Bg,e=new x.TextureLoader().load(t);e.encoding=x.sRGBEncoding;const n=new x.MeshBasicMaterial({map:e,transparent:!0,depthTest:!1});return new x.Mesh(i,n)}function Rg(){const i=new x.CurvePath;i.add(new x.LineCurve3(new x.Vector3(0,0,0),new x.Vector3(0,0,.1)));const t=new x.TubeGeometry(i,8,.003),e=new x.ShaderMaterial({vertexShader:Vg,fragmentShader:jg,depthTest:!1,transparent:!0});return new x.Mesh(t,e)}function Og(){const i=new x.SphereGeometry(.01,20,20),t=new x.MeshBasicMaterial({color:10349931,depthTest:!1,transparent:!0,side:x.DoubleSide}),e=new x.Mesh(i,t);return e.position.set(0,0,.1),e}class al extends x.Object3D{constructor(){super();m(this,"planeMesh");m(this,"lineMesh");m(this,"ballMesh");this.planeMesh=Qg(),this.lineMesh=Rg(),this.ballMesh=Og(),this.add(this.planeMesh,this.lineMesh,this.ballMesh)}updateWithIntersect(e){if(!e.face)return;const n=new x.Vector3().addVectors(e.point,e.face.normal);this.position.copy(e.point),this.lookAt(n)}dispose(){var e;(e=this.planeMesh.material.map)==null||e.dispose()}}class ll{constructor(t){m(this,"five");m(this,"contentElement",document.createElement("div"));m(this,"animeIns");m(this,"container");m(this,"css3DObject");m(this,"disposeCss3DObject");m(this,"state",{enabled:!1});this.five=t;const n=.4/2,s=en(t).create3DDomContainer([[-n,n,0],[-n,-n,0],[n,-n,0],[n,n,0]].map(r=>new x.Vector3().fromArray(r)));if(s){const{container:r,dispose:a,css3DObject:l}=s;this.container=r,this.css3DObject=l,this.disposeCss3DObject=a}this.contentElement.style.width="100%",this.contentElement.style.height="100%",this.contentElement.style.backgroundImage=`url(${Oa})`,this.contentElement.style.backgroundSize="100%",this.contentElement.style.backgroundRepeat="no-repeat"}enable(){var t;this.state.enabled||(this.state.enabled=!0,(t=this.container)==null||t.appendChild(this.contentElement))}disable(){!this.state.enabled||(this.state.enabled=!1,this.contentElement.remove())}updateWithIntersect(t){if(!t.face||!this.css3DObject)return;const e=new x.Vector3().addVectors(t.point,t.face.normal);this.css3DObject.position.copy(t.point),this.css3DObject.lookAt(e),this.five.needsRender=!0}doAnimation(){var t;(t=this.animeIns)==null||t.dispose(),new co({progress:0}).to({progress:[1,0]}).duration(500).easing(ni.Easing.Quadratic.InOut).onUpdate(({progress:e})=>{}).play()}dispose(){var t;(t=this.disposeCss3DObject)==null||t.call(this)}}class Hg{constructor(t,e){m(this,"five");m(this,"hooks",new be.Subscribe);m(this,"magnifier",null);m(this,"pointHelper",null);m(this,"pointDomHelper",null);m(this,"contentDom",document.createElement("div"));m(this,"state",{enabled:!1});m(this,"group",new x.Group);this.five=t,this.magnifier=(e==null?void 0:e.magnifier)===void 0?new sl(t,{dragEnabled:!0}):null,this.pointHelper=(e==null?void 0:e.pointHelper)===void 0?new al:null,this.pointDomHelper=(e==null?void 0:e.pointDomHelper)===void 0?new ll(t):null,this.group.name="five-point-selector",this.five.scene.add(this.group),this.contentDom.classList.add("five-point-selector-content"),this.contentDom.style.position="absolute",this.contentDom.style.top="0",this.contentDom.style.left="0",this.contentDom.style.width="100%",this.contentDom.style.height="100%",this.contentDom.style.pointerEvents="none"}enable(){var t,e;this.state.enabled||(this.state.enabled=!0,this.pointHelper&&this.group.add(this.pointHelper),(t=this.magnifier)==null||t.enable(),(e=this.pointDomHelper)==null||e.enable(),this.five.needsRender=!0,this.hooks.emit("enabled"))}disable(){var t,e;!this.state.enabled||(this.state.enabled=!1,this.pointHelper&&this.group.remove(this.pointHelper),(t=this.magnifier)==null||t.disable(),(e=this.pointDomHelper)==null||e.disable(),this.hooks.emit("disabled"))}dispose(){this.hooks.off(),this.disable(),this.magnifier=null,this.pointHelper=null,this.pointDomHelper=null}updateWithIntersect(t){var s;this.hooks.emit("pointChanged",{panoIndex:this.five.getCurrentState().panoIndex,position:t.point.toArray(),normal:(s=t.face)==null?void 0:s.normal.toArray()});const e=this.magnifier;e&&e.renderWithPoint(t.point);const n=this.pointHelper;n&&n.updateWithIntersect(t);const o=this.pointDomHelper;o&&o.updateWithIntersect(t),this.five.needsRender=!0}}const Fg=Object.freeze(Object.defineProperty({__proto__:null,Interval:Xi,Rectangle:Lg,Magnifier:sl,getCoordsFromClient:Tg,getCoordsFromElement:rl,getRaycasterFromFivePointer:Mg,getIntersectFromRelativePosition:zg,PointHelper:al,PointDomHelper:ll,FivePointSelector:Hg,isNil:Rm,notNil:We,BetterTween:co,tweenProgress:La,nextFrame:ci,requestAnimationFrameInterval:di,getFrameTime:sf},Symbol.toStringTag,{value:"Module"}));function Gg(i){le(i,"svelte-8mby9k",".svelte-8mby9k.svelte-8mby9k{box-sizing:border-box}.marketing.svelte-8mby9k.svelte-8mby9k{transform:translateY(-100%)}.content.svelte-8mby9k .headerImage.svelte-8mby9k{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.line.svelte-8mby9k.svelte-8mby9k{position:absolute;height:2.0625rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.content.svelte-8mby9k.svelte-8mby9k{background-color:white;position:relative;display:flex;flex-direction:column;min-width:11.125rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition:all 500ms}.title.svelte-8mby9k.svelte-8mby9k{position:absolute;background-color:white;border-radius:0.25rem;width:100%;top:0.5rem;padding-left:0.75rem;padding-right:0.75rem}.title.svelte-8mby9k .text.svelte-8mby9k{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem;color:#000}.footer.svelte-8mby9k.svelte-8mby9k{position:relative;padding-left:0.75rem;padding-right:0.75rem;width:100%;height:1.375rem;display:flex;align-items:center}.footer.svelte-8mby9k .goto-button.svelte-8mby9k{flex-shrink:0;white-space:nowrap;background-image:linear-gradient(to right, rgba(87, 144, 253, 1) 0, rgba(42, 114, 254, 1) 100%);color:#fff;font-size:0.625rem;border-radius:0.875rem;font-weight:bold;padding-left:0.5rem;padding-right:0.5rem;height:1.25rem;margin-left:auto;display:flex;align-items:center}.footer.svelte-8mby9k .goto-icon.svelte-8mby9k::after{content:'';display:inline-block;width:0.75rem;height:0.75rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAeFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////GqOSsAAAAJ3RSTlMAFNO2pYt4bErz8uP6ysawgVtBPDcR5C4s2L6ZmJBzZGJXUyEeDws/0G2zAAAAkklEQVQ4y+3TRw6DMBAF0OAeJ3QCpCe0uf8NwRILLBYfiS1/aT3JoymnI+sERZ5VCH0iVto3QDfBLmeSSMUTogRV9bBEpJAKaYpGijn13aTSLeraeG9D0NZFZv4/rRL5FDHnITlllqjv6tykWsmX4JHr05y7j6oFKq2P8He48B0tAM0EY0EDxquClw6vLz6EI35GmwwSZpe+WOgAAAAASUVORK5CYII=);background-size:100% auto;background-repeat:no-repeat}.price.svelte-8mby9k.svelte-8mby9k{flex-shrink:0;margin-right:0.75rem;white-space:nowrap;color:#ff6600;display:flex;align-items:baseline}.price.svelte-8mby9k .value.svelte-8mby9k{position:relative;top:0.0625rem;font-size:1.125rem;line-height:1.375rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.price.svelte-8mby9k .unit.svelte-8mby9k{padding-left:0.125rem;font-size:0.625rem}.tag.svelte-8mby9k.svelte-8mby9k{position:relative;background-color:white;display:flex;width:-moz-max-content;width:max-content;padding-left:0.75rem;padding-right:0.75rem;min-height:1.75rem}.tag.svelte-8mby9k .base-tag.svelte-8mby9k{height:1rem;margin-top:1.375rem;margin-bottom:0.5rem;margin-right:0.25rem;font-size:0.625rem;line-height:0.875rem;padding:0.0625rem 0.25rem;border-radius:0.125rem;overflow:hidden}.tag.svelte-8mby9k .primary-tag.svelte-8mby9k{background:#e5eefe;color:#0055ff}.tag.svelte-8mby9k .secondary-tag.svelte-8mby9k{background:rgba(255, 102, 0, 0.08);color:rgba(255, 102, 0, 1)}.unfolded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 1)}.folded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.unfolded.svelte-8mby9k .content.svelte-8mby9k{opacity:1}.folded.svelte-8mby9k .content.svelte-8mby9k{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}")}function Cr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Pr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Er(i){let t,e=i[0]+"",n;return{c(){t=V("div"),n=Pe(e),b(t,"class","base-tag primary-tag svelte-8mby9k")},m(o,s){z(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&xe(n,e)},d(o){o&&M(t)}}}function Ir(i){let t,e=i[0]&&Er(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),z(n,t,o)},p(n,o){n[0]?e?e.p(n,o):(e=Er(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&M(t)}}}function kr(i){let t,e=i[0]+"",n;return{c(){t=V("div"),n=Pe(e),b(t,"class","base-tag secondary-tag svelte-8mby9k")},m(o,s){z(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&xe(n,e)},d(o){o&&M(t)}}}function xr(i){let t,e=i[0]&&kr(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),z(n,t,o)},p(n,o){n[0]?e?e.p(n,o):(e=kr(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&M(t)}}}function Dr(i){let t,e,n=i[2].price.value+"",o,s,r=i[2].price.unit&&Lr(i);return{c(){t=V("div"),e=V("span"),o=Pe(n),s=ee(),r&&r.c(),b(e,"class","value svelte-8mby9k"),b(t,"class","price svelte-8mby9k")},m(a,l){z(a,t,l),Q(t,e),Q(e,o),Q(t,s),r&&r.m(t,null)},p(a,l){l&4&&n!==(n=a[2].price.value+"")&&xe(o,n),a[2].price.unit?r?r.p(a,l):(r=Lr(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&M(t),r&&r.d()}}}function Lr(i){let t,e=i[2].price.unit+"",n;return{c(){t=V("span"),n=Pe(e),b(t,"class","unit svelte-8mby9k")},m(o,s){z(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[2].price.unit+"")&&xe(n,e)},d(o){o&&M(t)}}}function Sr(i){let t,e=i[2].highlightText+"",n;return{c(){t=V("div"),n=Pe(e),b(t,"class","goto-button goto-icon svelte-8mby9k")},m(o,s){z(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[2].highlightText+"")&&xe(n,e)},d(o){o&&M(t)}}}function Ng(i){var X,j;let t,e,n,o,s,r,a,l,c,d,f,u,h,p,A=i[2].title+"",g,v,w,y=We((X=i[2].price)==null?void 0:X.value)&&((j=i[2].price)==null?void 0:j.value)!=="",E,I;e=new Ke({props:{visible:i[1],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let C=i[2].brandTags||[],L=[];for(let P=0;P<C.length;P+=1)L[P]=Ir(Pr(i,C,P));let D=i[2].tags||[],B=[];for(let P=0;P<D.length;P+=1)B[P]=xr(Cr(i,D,P));let N=y&&Dr(i),F=i[2].highlightText&&Sr(i);return{c(){var P;t=V("div"),$(e.$$.fragment),n=ee(),o=V("div"),s=ee(),r=V("div"),a=V("img"),c=ee(),d=V("div");for(let R=0;R<L.length;R+=1)L[R].c();f=ee();for(let R=0;R<B.length;R+=1)B[R].c();u=ee(),h=V("div"),p=V("div"),g=Pe(A),v=ee(),w=V("div"),N&&N.c(),E=ee(),F&&F.c(),b(o,"class","line svelte-8mby9k"),T(o,"transition-delay",i[1]?Bn+"ms":Vn+Mr-Tr-40+"ms"),b(a,"class","headerImage svelte-8mby9k"),Ne(a.src,l=i[2].headerPictureUrl)||b(a,"src",l),b(a,"alt",""),b(d,"class","tag svelte-8mby9k"),b(p,"class","text svelte-8mby9k"),b(h,"class","title svelte-8mby9k"),b(w,"class","footer svelte-8mby9k"),T(w,"height",We((P=i[2].price)==null?void 0:P.value)&&i[2].highlightText?void 0:"1rem"),b(r,"class","content svelte-8mby9k"),T(r,"transition-delay",i[1]?Bn+Vn+"ms":"0ms"),b(t,"class","marketing svelte-8mby9k"),te(t,"unfolded",i[1]),te(t,"folded",i[3])},m(P,R){z(P,t,R),q(e,t,null),Q(t,n),Q(t,o),Q(t,s),Q(t,r),Q(r,a),Q(r,c),Q(r,d);for(let O=0;O<L.length;O+=1)L[O].m(d,null);Q(d,f);for(let O=0;O<B.length;O+=1)B[O].m(d,null);Q(r,u),Q(r,h),Q(h,p),Q(p,g),Q(r,v),Q(r,w),N&&N.m(w,null),Q(w,E),F&&F.m(w,null),I=!0},p(P,[R]){var W,U,_;const O={};if(R&2&&(O.visible=P[1]),e.$set(O),R&2&&T(o,"transition-delay",P[1]?Bn+"ms":Vn+Mr-Tr-40+"ms"),(!I||R&4&&!Ne(a.src,l=P[2].headerPictureUrl))&&b(a,"src",l),R&4){C=P[2].brandTags||[];let J;for(J=0;J<C.length;J+=1){const de=Pr(P,C,J);L[J]?L[J].p(de,R):(L[J]=Ir(de),L[J].c(),L[J].m(d,f))}for(;J<L.length;J+=1)L[J].d(1);L.length=C.length}if(R&4){D=P[2].tags||[];let J;for(J=0;J<D.length;J+=1){const de=Cr(P,D,J);B[J]?B[J].p(de,R):(B[J]=xr(de),B[J].c(),B[J].m(d,null))}for(;J<B.length;J+=1)B[J].d(1);B.length=D.length}(!I||R&4)&&A!==(A=P[2].title+"")&&xe(g,A),R&4&&(y=We((W=P[2].price)==null?void 0:W.value)&&((U=P[2].price)==null?void 0:U.value)!==""),y?N?N.p(P,R):(N=Dr(P),N.c(),N.m(w,E)):N&&(N.d(1),N=null),P[2].highlightText?F?F.p(P,R):(F=Sr(P),F.c(),F.m(w,null)):F&&(F.d(1),F=null),R&4&&T(w,"height",We((_=P[2].price)==null?void 0:_.value)&&P[2].highlightText?void 0:"1rem"),R&2&&T(r,"transition-delay",P[1]?Bn+Vn+"ms":"0ms"),(!I||R&2)&&te(t,"unfolded",P[1]),(!I||R&8)&&te(t,"folded",P[3])},i(P){I||(k(e.$$.fragment,P),I=!0)},o(P){S(e.$$.fragment,P),I=!1},d(P){P&&M(t),K(e),lt(L,P),lt(B,P),N&&N.d(),F&&F.d()}}}const Bn=400,Tr=500,Vn=180,Mr=500;function Wg(i,t,e){let n,o,s,{tag:r}=t;return i.$$set=a=>{"tag"in a&&e(0,r=a.tag)},i.$$.update=()=>{var a,l;i.$$.dirty&1&&e(1,n=(l=(a=r.state)==null?void 0:a.unfolded)!=null?l:!1),i.$$.dirty&2&&e(3,o=!n),i.$$.dirty&1&&e(2,s=r.data)},[r,n,s,o]}class _g extends oe{constructor(t){super(),ie(this,t,Wg,Ng,ne,{tag:0},Gg)}}const Kt="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAgAAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//uQxAACFEII9ACZ/sJZwWEoEb8w/////N//////JcxjHjf+7/v/H2PzCCFAiDtGeyBCIx7bJJ1mmEEMy6g8mm2c8nrGABB4h2Mkmn//4z/73u773R5qHHu/j/w7Kxkzh5lWRWdsifCkNAnY9Zc1HvDAhjhSHdFkHFzLmabt/AQxSg2wwzLhHIJOBnAWwVY4zrhIYhhc2kvhYDfQ4hDi2Gmh5KyFn8EcGIrHAngNgIwVIEMf5bzbAiTRoAD///8z/KVhkkWEle6IX+d/z4fvH3BShK1e5kmjkCMoxVmXhd4ROlTKo3iipasvTilY21q19ta30/v/0/idPX1v8PNxJL6ramnOVsdvMv2akO0iSYIzdJFirtzWXCZicS9vHqvSKyqm5XJBdqBwPxyfJdykhWTZ0G0ZyTZGpLKxsNwwoRhsx3tZfhwmeOBVISm3impAC/IT/8hP/EKEM1KMdVdVKM2rHV4x7HVXZvbVVKN/qq8CiV9VL9jjH/6l6qf7MBCjZmOqsAibjcP+qqqv0oxqpa/NVW286hPo1nz2L/h8+jXt//uSxCmDU2IK/ECN98KKtE5IYzNoCfbw+u9i5r8PoadUMFPKqWL4LK3T/LCraMSHGkW4bpLXR/E6LlHOVQxmslKVJ8IULktMN06N0FKCpHCoYsjC4F+Z0NVqdNFoGSTjSiyjzLdnZ2fNqTi2eHKONONKLMPMKLONKLMPQRJGlFxZRoKcJFAYEeIFiRQkUWUeYfef//Ko04soswso40UJAgMw8wosososy0EalnZyjQUGBRQGIFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsqFdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",un={};var ti=(i=>(i.Default="default",i.GetAudioDuration="getAudioDuration",i.PlayAudio="playAudio",i))(ti||{});function cl(i,t){const e=(t==null?void 0:t.namespace)||"default",n=un[e]||(un[e]=[]);let o=n.find(s=>!s.realSrc||s.realSrc===Kt);return o||(console.warn("\u672A\u627E\u5230\u7F13\u5B58\u97F3\u9891\uFF0C\u5DF2\u65B0\u5EFA",un),o=new mo(Kt),n.push(o)),i&&(o.src=i),o}function Xg(i){return Y(this,null,function*(){const t=(()=>i instanceof mo?i:cl(i,{namespace:"getAudioDuration"}))(),e=yield new Promise(n=>{t.duration?t.isBlankAudio?n(0):n(t.duration):(t.addEventListener("loadedmetadata",()=>{t.isBlankAudio?n(0):n(t.duration)}),t.addEventListener("canplaythrough",()=>{t.isBlankAudio?n(0):n(t.duration)}))});return typeof i=="string"&&t.clear(),e})}function zr(i,t){const e=(t==null?void 0:t.namespace)||"default",n=un[e]||(un[e]=[]),o=i-n.length;if(!(o<=0))for(let s=0;s<o;s++)n.push(new mo(Kt))}class mo extends Audio{constructor(e){super(e);m(this,"preload","auto");m(this,"realSrc","");m(this,"inited",!1);m(this,"removeDocumentEventListener");this.realSrc=e!=null?e:"",super.addEventListener("ended",()=>{this.src=""});const n=()=>Yg(this);document.addEventListener("click",n),document.addEventListener("touchend",n),this.removeDocumentEventListener=()=>{document.removeEventListener("click",n),document.removeEventListener("touchend",n)}}get isBlankAudio(){return this.realSrc===Kt||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e}clear(){this.src=Kt,this.currentTime=0}}function Yg(i){!i||i.inited||(i.src&&(i.inited=!0,i.removeDocumentEventListener()),i.src===Kt&&i.play())}class Ug extends Audio{constructor(e){super();m(this,"sharedAudioSrc");m(this,"sharedAudioPaused",!0);m(this,"sharedAudioCurrentTime",0);m(this,"tryplaying",!1);m(this,"audioInstance");m(this,"eventListenerDisposer");this.sharedAudioSrc=e}get paused(){var e;return(e=this.sharedAudioPaused)!=null?e:!0}get currentTime(){return this.sharedAudioCurrentTime}play(){return Y(this,null,function*(){var e,n,o;this.tryplaying||(this.tryplaying=!0,(!this.audioInstance||((e=this.audioInstance)==null?void 0:e.realSrc)!==this.sharedAudioSrc)&&(this.audioInstance=cl(this.sharedAudioSrc,{namespace:ti.PlayAudio})),this.audioInstance.currentTime=(n=this.currentTime)!=null?n:0,(o=this.eventListenerDisposer)==null||o.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.play().then(()=>{this.sharedAudioPaused=!1}).catch(s=>{this.pause(),console.warn(s)}).finally(()=>{this.tryplaying=!1}))})}pause(){!this.audioInstance||this.paused||(this.sharedAudioPaused=!0,this.audioInstance.addEventListener("pause",()=>{var e;(e=this.eventListenerDisposer)==null||e.call(this)},{once:!0}),this.audioInstance.pause())}dispose(){this.clear(),this.audioInstance=void 0}clear(){var e;(e=this.audioInstance)==null||e.clear()}addEventListeners(){const e=this.audioInstance;if(!e)return;const n=u=>{var h;this.sharedAudioCurrentTime=e.currentTime,(h=this.ontimeupdate)==null||h.call(this,u)},o=u=>{var h;return(h=this.onplay)==null?void 0:h.call(this,u)},s=u=>{var h;(h=this.onpause)==null||h.call(this,u),this.clear()},r=u=>{var h;(h=this.onended)==null||h.call(this,u),this.sharedAudioCurrentTime=0},a=u=>{var h;return(h=this.onerror)==null?void 0:h.call(this,u)},l=u=>{var h;return(h=this.oncanplay)==null?void 0:h.call(this,u)},c=u=>{var h;return(h=this.oncanplaythrough)==null?void 0:h.call(this,u)},d=u=>{var h;return(h=this.onloadeddata)==null?void 0:h.call(this,u)},f=u=>{var h;return(h=this.onloadedmetadata)==null?void 0:h.call(this,u)};return e.addEventListener("timeupdate",n),e.addEventListener("play",o),e.addEventListener("pause",s),e.addEventListener("ended",r),e.addEventListener("error",a),e.addEventListener("canplay",l),e.addEventListener("canplaythrough",c),e.addEventListener("loadeddata",d),e.addEventListener("loadedmetadata",f),()=>{e.removeEventListener("timeupdate",n),e.removeEventListener("play",o),e.removeEventListener("pause",s),e.removeEventListener("ended",r),e.removeEventListener("error",a),e.removeEventListener("canplay",l),e.removeEventListener("canplaythrough",c),e.removeEventListener("loadeddata",d),e.removeEventListener("loadedmetadata",f)}}}function Jg(i){le(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function Zg(i){let t,e,n,o;const s=i[8].default,r=it(s,i,i[7],null);return{c(){t=V("div"),r&&r.c(),b(t,"class","audio svelte-13e7hxv"),b(t,"style",i[0])},m(a,l){z(a,t,l),r&&r.m(t,null),e=!0,n||(o=Se(t,"click",ha(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&st(r,s,a,a[7],e?ot(s,a[7],l,null):rt(a[7]),null),(!e||l&1)&&b(t,"style",a[0])},i(a){e||(k(r,a),e=!0)},o(a){S(r,a),e=!1},d(a){a&&M(t),r&&r.d(a),n=!1,o()}}}function qg(i,t,e){let{$$slots:n={},$$scope:o}=t,{url:s}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=oi(),d=ct("hooks"),f=ct("mediaStore");let u,h=!0;function p(){e(5,u.onplay=g=>{d.emit("playStateChange",G({event:g,state:"playing",mediaInstance:u},l)),c("play"),e(6,h=!1)},u),e(5,u.onpause=g=>{d.emit("playStateChange",G({event:g,state:"paused",mediaInstance:u},l)),c("pause"),e(6,h=!0)},u),e(5,u.onloadedmetadata=g=>{typeof u.duration=="number"&&!Number.isNaN(u.duration)&&c("duration",u.duration)},u),e(5,u.ontimeupdate=g=>{c("timeupdate",u.currentTime)},u)}f.subscribe(({currentMediaElement:g})=>{g!==u&&(h||u==null||u.pause())});function A(g){!u||(d.emit("click",G({event:g,target:"AudioTagPlayIcon",audioInstance:u},l)),f.set({currentMediaElement:u}),d.emit("playStateChange",G({event:g,state:u.paused?"playing":"paused",mediaInstance:u},l)),u.paused?u.play():u.pause())}return i.$$set=g=>{"url"in g&&e(2,s=g.url),"enable"in g&&e(3,r=g.enable),"style"in g&&e(0,a=g.style),"hooksInfo"in g&&e(4,l=g.hooksInfo),"$$scope"in g&&e(7,o=g.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(s||c("duration",0)),i.$$.dirty&36&&(u==null||u.dispose(),e(5,u=new Ug(s)),c("audioRef",u),setTimeout(()=>c("audioRef",u),200),Xg(s).then(g=>c("duration",g)),p()),i.$$.dirty&40&&(r||u==null||u.pause()),i.$$.dirty&72&&c(r&&!h?"play":"pause")},[a,A,s,r,l,u,h,o,n]}class dl extends oe{constructor(t){super(),ie(this,t,qg,Zg,ne,{url:2,enable:3,style:0,hooksInfo:4},Jg)}}function Kg(i){le(i,"svelte-srt2pi",".audio-icon__wrapper.svelte-srt2pi.svelte-srt2pi{display:inline-block}.audio-icon.svelte-srt2pi.svelte-srt2pi{display:flex;justify-content:center;align-items:center;position:relative;width:100%;height:100%;border-radius:50%;background-color:rgba(255, 255, 255, 0.8)}.audio-icon.svelte-srt2pi .sound-wave__container.svelte-srt2pi{position:absolute;pointer-events:none;width:60%;height:60%}.sound-wave.svelte-srt2pi.svelte-srt2pi{animation-duration:2s;animation-iteration-count:infinite;animation-play-state:paused;transition:opacity 0}.playing.svelte-srt2pi .sound-wave.svelte-srt2pi{animation-play-state:running}.playing.svelte-srt2pi .sound-wave-1.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_1_animation}.playing.svelte-srt2pi .sound-wave-2.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_2_animation}.playing.svelte-srt2pi .sound-wave-3.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_3_animation}@keyframes svelte-srt2pi-sound_wave_1_animation{0%,10%{opacity:0}25%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_2_animation{0%,35%{opacity:0}50%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_3_animation{0%,60%{opacity:0}75%,100%{opacity:1}}")}function Br(i){let t,e;return t=new Ke({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function $g(i){let t,e,n,o,s,r=i[1]&&Br();return{c(){t=V("div"),r&&r.c(),e=ee(),n=V("div"),o=V("div"),o.innerHTML='<svg width="100%" height="100%" viewBox="0 0 128 128"><g transform="rotate(-45 12 64) translate(12 64)" fill="black" stroke="black" fill-opacity="0.6" stroke-opacity="0.6"><path stroke="none" class="sound-wave sound-wave-1 svelte-srt2pi" d="M0,23 A23,23 0 0,0 23,0 L0,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-2 svelte-srt2pi" d="M0,46 A46,46 0 0,0 46,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-3 svelte-srt2pi" d="M0,80 A80,80 0 0,0 80,0"></path></g></svg>',b(o,"class","sound-wave__container svelte-srt2pi"),b(n,"class","audio-icon svelte-srt2pi"),te(n,"playing",i[0]),b(t,"class","audio-icon__wrapper svelte-srt2pi"),b(t,"style",i[2]),T(t,"width",i[5]),T(t,"height",i[5])},m(a,l){z(a,t,l),r&&r.m(t,null),Q(t,e),Q(t,n),Q(n,o),i[7](o),i[8](t),s=!0},p(a,[l]){a[1]?r?l&2&&k(r,1):(r=Br(),r.c(),k(r,1),r.m(t,e)):r&&(se(),S(r,1,1,()=>{r=null}),re()),(!s||l&1)&&te(n,"playing",a[0]),(!s||l&4)&&b(t,"style",a[2]),l&32&&T(t,"width",a[5]),l&32&&T(t,"height",a[5])},i(a){s||(k(r),s=!0)},o(a){S(r),s=!1},d(a){a&&M(t),r&&r.d(),i[7](null),i[8](null)}}}function e0(i,t,e){let n,{playing:o}=t,{shadow:s=!1}=t,{style:r=null}=t,{width:a="100%"}=t,l,c;function d(u){Le[u?"unshift":"push"](()=>{c=u,e(4,c)})}function f(u){Le[u?"unshift":"push"](()=>{l=u,e(3,l)})}return i.$$set=u=>{"playing"in u&&e(0,o=u.playing),"shadow"in u&&e(1,s=u.shadow),"style"in u&&e(2,r=u.style),"width"in u&&e(6,a=u.width)},i.$$.update=()=>{i.$$.dirty&64&&e(5,n=typeof a=="number"?ye(a):a)},[o,s,r,l,c,n,a,d,f]}class ul extends oe{constructor(t){super(),ie(this,t,e0,$g,ne,{playing:0,shadow:1,style:2,width:6},Kg)}}function t0(i){le(i,"svelte-1s6gk4a",".audio-tag.svelte-1s6gk4a{position:absolute;left:0;top:0;width:0;height:0;overflow:visible}.audio-icon__wrapper.svelte-1s6gk4a{position:relative;vertical-align:top;width:100%;height:100%}.content.svelte-1s6gk4a{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0.125rem;overflow:hidden;box-sizing:border-box;font-size:0;white-space:nowrap;font-weight:600}.wrapper.svelte-1s6gk4a{position:relative;width:100%;height:100%}.audio-icon.svelte-1s6gk4a{pointer-events:none;vertical-align:top;display:inline-block;width:1rem;height:1rem;margin-right:0.25rem;margin-top:0.0625rem}.audio.svelte-1s6gk4a{position:relative;width:100%;height:100%}")}function Vr(i){var v,w;let t,e,n,o,s,r,a,l,c,d,f,u,h,p,A;e=new Ke({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let g=i[6]&&jr(i);return c=new tl({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),u=new fo({props:{unfolded:i[6],length:i[3],outDelay:i[4]+20*Math.min((w=(v=i[5])==null?void 0:v.length)!=null?w:10,15),useLinearColor:!0}}),{c(){t=V("div"),$(e.$$.fragment),n=ee(),o=V("div"),s=V("div"),r=V("div"),g&&g.c(),a=ee(),l=V("div"),$(c.$$.fragment),f=ee(),$(u.$$.fragment),b(r,"class","audio-icon svelte-1s6gk4a"),De(()=>i[11].call(l)),T(l,"display","inline-block"),b(s,"class","wrapper svelte-1s6gk4a"),b(o,"class","content svelte-1s6gk4a"),b(t,"class","audio-tag svelte-1s6gk4a"),te(t,"unfolded",i[6])},m(y,E){z(y,t,E),q(e,t,null),Q(t,n),Q(t,o),Q(o,s),Q(s,r),g&&g.m(r,null),Q(s,a),Q(s,l),q(c,l,null),d=Pt(l,i[11].bind(l)),Q(t,f),q(u,t,null),h=!0,p||(A=Se(l,"click",i[7]),p=!0)},p(y,E){var D,B;const I={};E&64&&(I.visible=y[6]),E&8&&(I.left=y[3]/2+"px"),e.$set(I),y[6]?g?(g.p(y,E),E&64&&k(g,1)):(g=jr(y),g.c(),k(g,1),g.m(r,null)):g&&(se(),S(g,1,1,()=>{g=null}),re());const C={};E&64&&(C.visible=y[6]),E&2&&(C.textUnfolded=y[1]),E&32&&(C.content=y[5]),c.$set(C);const L={};E&64&&(L.unfolded=y[6]),E&8&&(L.length=y[3]),E&48&&(L.outDelay=y[4]+20*Math.min((B=(D=y[5])==null?void 0:D.length)!=null?B:10,15)),u.$set(L),(!h||E&64)&&te(t,"unfolded",y[6])},i(y){h||(k(e.$$.fragment,y),k(g),k(c.$$.fragment,y),k(u.$$.fragment,y),h=!0)},o(y){S(e.$$.fragment,y),S(g),S(c.$$.fragment,y),S(u.$$.fragment,y),h=!1},d(y){y&&M(t),K(e),g&&g.d(),K(c),d(),K(u),p=!1,A()}}}function jr(i){let t,e,n,o,s,r,a;return e=new Ke({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new dl({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[n0]},$$scope:{ctx:i}}}),o.$on("play",i[8]),o.$on("pause",i[9]),o.$on("audioRef",i[10]),{c(){t=V("div"),$(e.$$.fragment),n=ee(),$(o.$$.fragment),b(t,"class","audio svelte-1s6gk4a")},m(l,c){z(l,t,c),q(e,t,null),Q(t,n),q(o,t,null),a=!0},p(l,c){i=l;const d={};c&64&&(d.enable=i[6]),c&1&&(d.url=i[0].data.audioUrl),c&1&&(d.hooksInfo={tag:i[0]}),c&4100&&(d.$$scope={dirty:c,ctx:i}),o.$set(d)},i(l){a||(k(e.$$.fragment,l),k(o.$$.fragment,l),l&&De(()=>{r&&r.end(1),s=Rt(t,Bt,{duration:1e3,delay:0,easing:Zt}),s.start()}),a=!0)},o(l){var c,d;S(e.$$.fragment,l),S(o.$$.fragment,l),s&&s.invalidate(),l&&(r=tn(t,Bt,{duration:1e3,delay:20*Math.min((d=(c=i[5])==null?void 0:c.length)!=null?d:10,15),easing:Zt})),a=!1},d(l){l&&M(t),K(e),K(o),l&&r&&r.end()}}}function n0(i){let t,e,n;return e=new ul({props:{playing:i[2]}}),{c(){t=V("div"),$(e.$$.fragment),b(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){z(o,t,s),q(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){S(e.$$.fragment,o),n=!1},d(o){o&&M(t),K(e)}}}function i0(i){let t,e,n=i[0].state&&Vr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),z(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&k(n,1)):(n=Vr(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(se(),S(n,1,1,()=>{n=null}),re())},i(o){e||(k(n),e=!0)},o(o){S(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function o0(i,t,e){let n,o,s,{tag:r}=t,a=!1,l=!1,c;function d(){e(1,a=!a)}const f=()=>{e(2,l=!0)},u=()=>{e(2,l=!1)};function h(A){$i.call(this,i,A)}function p(){c=this.clientWidth,e(3,c)}return i.$$set=A=>{"tag"in A&&e(0,r=A.tag)},i.$$.update=()=>{var A,g,v;i.$$.dirty&1&&e(6,n=!!((A=r.state)!=null&&A.unfolded)),i.$$.dirty&1&&e(5,o=(v=(g=r.data.title)!=null?g:r.data.text)!=null?v:""),i.$$.dirty&2&&e(4,s=a?450:0)},[r,a,l,c,s,o,n,d,f,u,h,p]}class s0 extends oe{constructor(t){super(),ie(this,t,o0,i0,ne,{tag:0},t0)}}function r0(i){const t=document.createElement("div");t.style.color=i,document.body.appendChild(t);const e=window.getComputedStyle(t).color;document.body.removeChild(t);const n=(()=>e.search("rgba")===-1?e.replace("rgb","rgba").replace(")",", 1)"):e)(),o=n.replace("rgba","").replace("(","").replace(")","").split(",").map(s=>Number(s.trim()));return{rgba:n,r:o[0],g:o[1],b:o[2],a:o[3]}}function a0(i){le(i,"svelte-58hfjf",".audio-tag__wrapper.svelte-58hfjf{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.audio-tag.svelte-58hfjf{position:relative;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;padding:0.1875rem;padding-right:0.625rem;border-radius:624999.9375rem;border:0.03125rem solid rgba(255, 255, 255, 0.2)}.audio__inner.svelte-58hfjf{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.text.svelte-58hfjf{font-weight:bold;font-size:0.75rem;margin-left:0.25rem}.audio-icon__wrapper.svelte-58hfjf{position:relative;vertical-align:top;pointer-events:none;width:1.375rem;height:1.375rem}")}function Qr(i){let t,e,n,o;return n=new dl({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[c0]},$$scope:{ctx:i}}}),n.$on("play",i[7]),n.$on("pause",i[8]),n.$on("timeupdate",i[9]),n.$on("duration",i[10]),n.$on("audioRef",i[11]),{c(){t=V("div"),e=V("div"),$(n.$$.fragment),b(e,"class","audio-tag svelte-58hfjf"),T(e,"background-color",i[1]),T(e,"color",i[5]),b(t,"class","audio-tag__wrapper svelte-58hfjf")},m(s,r){z(s,t,r),Q(t,e),q(n,e,null),o=!0},p(s,r){const a={};r&1&&(a.enable=s[0].state.visible),r&1&&(a.url=s[0].data.audioUrl),r&1&&(a.hooksInfo={tag:s[0]}),r&8260&&(a.$$scope={dirty:r,ctx:s}),n.$set(a),r&2&&T(e,"background-color",s[1]),r&32&&T(e,"color",s[5])},i(s){o||(k(n.$$.fragment,s),o=!0)},o(s){S(n.$$.fragment,s),o=!1},d(s){s&&M(t),K(n)}}}function l0(i){let t;return{c(){t=Pe(i[6])},m(e,n){z(e,t,n)},p(e,n){n&64&&xe(t,e[6])},d(e){e&&M(t)}}}function c0(i){let t,e,n,o,s,r,a;return n=new ul({props:{playing:i[2]}}),r=new ho({props:{maxWidth:72,$$slots:{default:[l0]},$$scope:{ctx:i}}}),{c(){t=V("div"),e=V("div"),$(n.$$.fragment),o=ee(),s=V("div"),$(r.$$.fragment),b(e,"class","audio-icon__wrapper svelte-58hfjf"),b(s,"class","text svelte-58hfjf"),b(t,"class","audio__inner svelte-58hfjf")},m(l,c){z(l,t,c),Q(t,e),q(n,e,null),Q(t,o),Q(t,s),q(r,s,null),a=!0},p(l,c){const d={};c&4&&(d.playing=l[2]),n.$set(d);const f={};c&8256&&(f.$$scope={dirty:c,ctx:l}),r.$set(f)},i(l){a||(k(n.$$.fragment,l),k(r.$$.fragment,l),a=!0)},o(l){S(n.$$.fragment,l),S(r.$$.fragment,l),a=!1},d(l){l&&M(t),K(n),K(r)}}}function d0(i){let t,e,n=i[0].state&&Qr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),z(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&k(n,1)):(n=Qr(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(se(),S(n,1,1,()=>{n=null}),re())},i(o){e||(k(n),e=!0)},o(o){S(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function u0(i,t,e){let n,o,s,{tag:r}=t;oi();let a=!1,l=0,c=0;const d=()=>{e(2,a=!0)},f=()=>{e(2,a=!1)},u=A=>{e(3,l=A.detail)},h=A=>{e(4,c=A.detail)};function p(A){$i.call(this,i,A)}return i.$$set=A=>{"tag"in A&&e(0,r=A.tag)},i.$$.update=()=>{var A,g;i.$$.dirty&1&&e(6,n=(g=(A=r.data.title)!=null?A:r.data.text)!=null?g:""),i.$$.dirty&1&&e(1,o=(()=>{var v;return r.data.backgroundColor==="dark"?"rgba(0, 0, 0, 0.3)":r.data.backgroundColor==="light"?"rgba(255, 255, 255, 0.3)":(v=r.data.backgroundColor)!=null?v:"rgba(0, 0, 0, 0.3)"})()),i.$$.dirty&2&&e(5,s=(()=>{const{r:v,g:w,b:y}=r0(o);return(v*299+w*587+y*114)/1e3>=128?"rgba(0, 0, 0, 0.6)":"white"})())},[r,o,a,l,c,s,n,d,f,u,h,p]}class f0 extends oe{constructor(t){super(),ie(this,t,u0,d0,ne,{tag:0},a0)}}function h0(i){let t,e;return t=new f0({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function m0(i){let t,e;return t=new s0({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function p0(i){let t,e,n,o;const s=[m0,h0],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=s[t](i)),{c(){e&&e.c(),n=fe()},m(l,c){~t&&r[t].m(l,c),z(l,n,c),o=!0},p(l,[c]){let d=t;t=a(l),t===d?~t&&r[t].p(l,c):(e&&(se(),S(r[d],1,1,()=>{r[d]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),k(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(k(e),o=!0)},o(l){S(e),o=!1},d(l){~t&&r[t].d(l),l&&M(n)}}}function g0(i,t,e){let n,{tag:o}=t,s;function r(a){s=a.detail}return o.play=()=>s.play(),o.pause=()=>s.pause(),i.$$set=a=>{"tag"in a&&e(0,o=a.tag)},i.$$.update=()=>{var a;i.$$.dirty&1&&e(1,n=(a=o.data.appearance)!=null?a:"line")},[o,n,r]}class A0 extends oe{constructor(t){super(),ie(this,t,g0,p0,ne,{tag:0})}}function v0(i){le(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function Rr(i){var o;let t,e,n;return e=new ol({props:{mediaItemConfig:{canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(o=i[4])!=null?o:"withText",disableVideoIfHavePoster:!1,objectFit:i[2]},unfolded:i[6],mediaData:i[5],enableCarousel:i[1],autoplayConfig:i[3],tag:i[0],inDelay:500,duration:500}}),{c(){t=V("div"),$(e.$$.fragment),b(t,"class","media-wrapper svelte-10cw0el")},m(s,r){z(s,t,r),q(e,t,null),n=!0},p(s,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=s[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:s[2]}),r&64&&(a.unfolded=s[6]),r&32&&(a.mediaData=s[5]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){S(e.$$.fragment,s),n=!1},d(s){s&&M(t),K(e)}}}function b0(i){let t,e,n=i[0].state&&i[5]&&Rr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),z(o,t,s),e=!0},p(o,[s]){o[0].state&&o[5]?n?(n.p(o,s),s&33&&k(n,1)):(n=Rr(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(se(),S(n,1,1,()=>{n=null}),re())},i(o){e||(k(n),e=!0)},o(o){S(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function y0(i,t,e){let n,o,s,r,a,l,{tag:c}=t;return i.$$set=d=>{"tag"in d&&e(0,c=d.tag)},i.$$.update=()=>{var d,f;i.$$.dirty&1&&e(6,n=c.state?c.state.unfolded:!1),i.$$.dirty&1&&e(5,o=c.data.mediaData),i.$$.dirty&1&&e(1,s=c.data.enableCarousel),i.$$.dirty&1&&e(4,r=c.data.playIcon),i.$$.dirty&3&&e(3,a=(d=c.data.autoplayConfig)!=null?d:{autoplay:s!=null?s:!0,autoplayVideo:!0}),i.$$.dirty&1&&e(2,l=(f=c.data.objectFit)!=null?f:(()=>c.data.adaptationMode==="stretch"?"cover":c.data.adaptationMode==="proportional"?"contain":void 0)())},[c,s,l,a,r,o,n]}class w0 extends oe{constructor(t){super(),ie(this,t,y0,b0,ne,{tag:0},v0)}}function C0(i){return Y(this,null,function*(){return new Promise((t,e)=>{if(!i){e(Error("url is empty"));return}const n=new Image;n.src=i,n.onload=()=>t({width:n.width,height:n.height}),n.onerror=e})})}function P0(i){return Y(this,null,function*(){const{steps:t,url:e,ratio:n=3,fps:o=24}=i;if(!t)throw new Error("KeyframeIcon requires steps");const{width:s,height:r}=yield C0(e),a=s/n,l=r/n,c=a/t,d=l,f=1/o*t+"s",u=a/t-a;return{url:e,keyframesWidth:a,keyframesHeight:l,wrapperWidth:c,wrapperHeight:d,steps:t,duration:f,offsetX:u,offsetY:0}})}function E0(i){le(i,"svelte-mhs8j5","@keyframes svelte-mhs8j5-sprites-animation{0%{background-position:0 0}100%{background-position:var(--keyframe_offset_x) 0}}.icon-image.svelte-mhs8j5{display:block;width:100%}.icon-keyframe-container.svelte-mhs8j5{overflow:hidden}.icon-keyframe-wrapper.svelte-mhs8j5{transform-origin:0 0}.icon-keyframe.svelte-mhs8j5{background-repeat:no-repeat;animation-direction:normal;animation-iteration-count:infinite;animation-name:svelte-mhs8j5-sprites-animation}")}function Or(i){i[6]=i[14].url,i[7]=i[14].keyframesWidth,i[8]=i[14].keyframesHeight,i[9]=i[14].wrapperWidth,i[10]=i[14].wrapperHeight,i[11]=i[14].steps,i[12]=i[14].duration,i[13]=i[14].offsetX}function Hr(i){let t,e,n,o=i[2]&&Fr();function s(l,c){return l[3]?k0:I0}let r=s(i),a=r(i);return{c(){t=V("div"),o&&o.c(),e=ee(),a.c(),b(t,"class","icon"),T(t,"width",typeof i[0]=="number"?ye(i[0]):i[0])},m(l,c){z(l,t,c),o&&o.m(t,null),Q(t,e),a.m(t,null),n=!0},p(l,c){l[2]?o?c&4&&k(o,1):(o=Fr(),o.c(),k(o,1),o.m(t,e)):o&&(se(),S(o,1,1,()=>{o=null}),re()),r===(r=s(l))&&a?a.p(l,c):(a.d(1),a=r(l),a&&(a.c(),a.m(t,null))),c&1&&T(t,"width",typeof l[0]=="number"?ye(l[0]):l[0])},i(l){n||(k(o),n=!0)},o(l){S(o),n=!1},d(l){l&&M(t),o&&o.d(),a.d()}}}function Fr(i){let t,e;return t=new Ke({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function I0(i){let t,e;return{c(){t=V("img"),b(t,"class","icon-image svelte-mhs8j5"),Ne(t.src,e=i[1].url)||b(t,"src",e),b(t,"alt","icon")},m(n,o){z(n,t,o)},p(n,o){o&2&&!Ne(t.src,e=n[1].url)&&b(t,"src",e)},d(n){n&&M(t)}}}function k0(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:L0,then:D0,catch:x0,value:14};return To(e=i[4](i[1]),n),{c(){t=fe(),n.block.c()},m(o,s){z(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&2&&e!==(e=i[4](i[1]))&&To(e,n)||wc(n,i,s)},d(o){o&&M(t),n.block.d(o),n.token=null,n=null}}}function x0(i){return{c:Z,m:Z,p:Z,d:Z}}function D0(i){Or(i);let t,e,n,o=`url(${i[6]})`,s=`steps(${i[11]-1})`;return{c(){t=V("div"),e=V("div"),n=V("div"),b(n,"class","icon-keyframe svelte-mhs8j5"),T(n,"width",ye(i[7])),T(n,"height",ye(i[8])),T(n,"background-image",o),T(n,"animation-duration",i[12]),T(n,"animation-timing-function",s),T(n,"animation-delay",0),T(n,"background-size","100% 100%"),T(n,"--keyframe_offset_x",ye(i[13])),b(e,"class","icon-keyframe-wrapper svelte-mhs8j5"),T(e,"transform",typeof i[0]=="number"?`scale(${i[0]/i[9]})`:void 0),b(t,"class","icon-keyframe-container svelte-mhs8j5"),T(t,"width",typeof i[0]=="number"?ye(i[0]):ye(i[9])),T(t,"height",typeof i[0]=="number"?ye(i[10]*(i[0]/i[9])):ye(i[10]))},m(r,a){z(r,t,a),Q(t,e),Q(e,n)},p(r,a){Or(r),a&2&&T(n,"width",ye(r[7])),a&2&&T(n,"height",ye(r[8])),a&2&&o!==(o=`url(${r[6]})`)&&T(n,"background-image",o),a&2&&T(n,"animation-duration",r[12]),a&2&&s!==(s=`steps(${r[11]-1})`)&&T(n,"animation-timing-function",s),a&2&&T(n,"--keyframe_offset_x",ye(r[13])),a&3&&T(e,"transform",typeof r[0]=="number"?`scale(${r[0]/r[9]})`:void 0),a&3&&T(t,"width",typeof r[0]=="number"?ye(r[0]):ye(r[9])),a&3&&T(t,"height",typeof r[0]=="number"?ye(r[10]*(r[0]/r[9])):ye(r[10]))},d(r){r&&M(t)}}}function L0(i){return{c:Z,m:Z,p:Z,d:Z}}function S0(i){let t,e,n=i[1]&&Hr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),z(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&k(n,1)):(n=Hr(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(se(),S(n,1,1,()=>{n=null}),re())},i(o){e||(k(n),e=!0)},o(o){S(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function T0(i,t,e){let n,{width:o=null}=t,{icon:s=null}=t,{shadow:r=!1}=t;const a=oi();function l(c){return Y(this,null,function*(){const d=yield P0(c);return a("iconLoaded"),d})}return i.$$set=c=>{"width"in c&&e(0,o=c.width),"icon"in c&&e(1,s=c.icon),"shadow"in c&&e(2,r=c.shadow)},i.$$.update=()=>{i.$$.dirty&2&&e(3,n=(s==null?void 0:s.steps)>=2),i.$$.dirty&8&&!n&&a("iconLoaded")},[o,s,r,n,l]}class fl extends oe{constructor(t){super(),ie(this,t,T0,S0,ne,{width:0,icon:1,shadow:2},E0)}}function M0(i){le(i,"svelte-1lmyni6",".wrapper.svelte-1lmyni6{font-weight:600;cursor:pointer;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:auto}.text-wrapper.svelte-1lmyni6{position:relative;display:flex;align-items:center;justify-content:center}.text.svelte-1lmyni6{position:absolute;top:0;font-size:0.875rem;color:#ffffff;letter-spacing:0;text-align:center;max-width:8.75rem;width:-moz-max-content;width:max-content;word-break:break-all;line-height:1.125rem;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function Gr(i){let t,e,n,o,s,r;return e=new Ke({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=V("div"),$(e.$$.fragment),n=ee(),o=V("div"),s=Pe(i[1]),b(o,"class","text svelte-1lmyni6"),b(t,"class","text-wrapper svelte-1lmyni6")},m(a,l){z(a,t,l),q(e,t,null),Q(t,n),Q(t,o),Q(o,s),r=!0},p(a,l){(!r||l&2)&&xe(s,a[1])},i(a){r||(k(e.$$.fragment,a),r=!0)},o(a){S(e.$$.fragment,a),r=!1},d(a){a&&M(t),K(e)}}}function z0(i){let t,e,n,o;e=new fl({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[9]);let s=i[1]&&i[2]&&Gr(i);return{c(){t=V("div"),$(e.$$.fragment),n=ee(),s&&s.c(),b(t,"class","wrapper svelte-1lmyni6")},m(r,a){z(r,t,a),q(e,t,null),Q(t,n),s&&s.m(t,null),o=!0},p(r,[a]){const l={};a&1&&(l.icon=r[0]),e.$set(l),r[1]&&r[2]?s?(s.p(r,a),a&6&&k(s,1)):(s=Gr(r),s.c(),k(s,1),s.m(t,null)):s&&(se(),S(s,1,1,()=>{s=null}),re())},i(r){o||(k(e.$$.fragment,r),k(s),o=!0)},o(r){S(e.$$.fragment,r),S(s),o=!1},d(r){r&&M(t),K(e),s&&s.d()}}}function B0(i,t,e){let n,o,s,r,a,l,c,d,{tag:f}=t;const u=()=>{e(2,n=!0)};return i.$$set=h=>{"tag"in h&&e(3,f=h.tag)},i.$$.update=()=>{var h,p;i.$$.dirty&8&&e(1,o=(h=f.data.title)!=null?h:f.data.text),i.$$.dirty&8&&e(8,s=(p=f.data.icon)!=null?p:f.style.point),i.$$.dirty&256&&e(7,r=s.url),i.$$.dirty&256&&e(6,a=s.steps),i.$$.dirty&256&&e(5,l=s.fps),i.$$.dirty&256&&e(4,c=s.ratio),i.$$.dirty&240&&e(0,d={url:r,steps:a,fps:l,ratio:c})},e(2,n=!1),[d,o,n,f,c,l,a,r,s,u]}class V0 extends oe{constructor(t){super(),ie(this,t,B0,z0,ne,{tag:3},M0)}}function j0(i){le(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function Nr(i){let t,e=i[0].element+"",n;return{c(){t=new _n(!1),n=fe(),t.a=n},m(o,s){t.m(e,o,s),z(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function Q0(i){let t,e=typeof i[0].element=="string"&&Nr(i);return{c(){t=V("div"),e&&e.c(),b(t,"class","customElement__container svelte-kzl2aj")},m(n,o){z(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=Nr(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:Z,o:Z,d(n){n&&M(t),e&&e.d(),i[2](null)}}}function R0(i,t,e){let{tag:n}=t,o,s;Ze(()=>{if(o){if(n.element instanceof Element){const a=n.element;o.appendChild(a),s=()=>o==null?void 0:o.removeChild(a)}else if(typeof n.element=="function"){const a=n.element;s=a(o)}}}),It(()=>{s==null||s()});function r(a){Le[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class O0 extends oe{constructor(t){super(),ie(this,t,R0,Q0,ne,{tag:0},j0)}}function H0(i){le(i,"svelte-ofx2uu",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAAAhAAAAAkaG10eJ9gBO8AAADsAAABJG1heHAASVAAAAAArAAAAAZuYW1lqczkZQAAApQAAAJecG9zdP+4ADIAAAZwAAAAIAAAUAAASQAAAAEAAAABAADkeHeyXw889QADA+gAAAAA2NoRKwAAAADY2hErACn/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACCAA7AcwAdwIIADMCCAA0AhwAMwISADkCCAAuAfQANAH+ACsB/gApAggANAEeAFABHgBQAR4AUAIIADQCCAAuAR4AUAEeAFABfAAxAAEAAAPo/zgAAAIcACkAKQHgAAEAAAAAAAAAAAAAAAAAAABJAAMCLgGQAAUACAKKAlgAAABLAooCWAAAAV4AMgEsAAAAAAgAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFVLV04AIAAg/xsDIP84AMgD6ADIAAAAAQAAAAAB9AK8AAAAIAAAAAAAEADGAAEAAAAAAAEADAAAAAEAAAAAAAIABAAMAAEAAAAAAAMAGwAQAAEAAAAAAAQAEQArAAEAAAAAAAUAPAA8AAEAAAAAAAYAEAB4AAEAAAAAAAgADAAAAAEAAAAAAAkADAAAAAMAAQQJAAEAGACIAAMAAQQJAAIACACgAAMAAQQJAAMANgCoAAMAAQQJAAQAIgDeAAMAAQQJAAUAeAEAAAMAAQQJAAYAIAF4AAMAAQQJAAgAGACIAAMAAQQJAAkAGACIQUxJQkFCQSBGb250Qm9sZDEuMDAwO1VLV047QUxJQkFCQUZvbnQtQm9sZEFMSUJBQkEgRm9udCBCb2xkVmVyc2lvbiAxLjAwMDtQUyAwMDEuMDAwO2hvdGNvbnYgMS4wLjg4O21ha2VvdGYubGliMi41LjY0Nzc1QUxJQkFCQUZvbnQtQm9sZABBAEwASQBCAEEAQgBBACAARgBvAG4AdABCAG8AbABkADEALgAwADAAMAA7AFUASwBXAE4AOwBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAEEATABJAEIAQQBCAEEAIABGAG8AbgB0ACAAQgBvAGwAZABWAGUAcgBzAGkAbwBuACAAMQAuADAAMAAwADsAUABTACAAMAAwADEALgAwADAAMAA7AGgAbwB0AGMAbwBuAHYAIAAxAC4AMAAuADgAOAA7AG0AYQBrAGUAbwB0AGYALgBsAGkAYgAyAC4ANQAuADYANAA3ADcANQBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAAAAAAADAAAAAwAAASIAAQAAAAAAHAADAAEAAAEiAAABBgAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAABCSEMANjc4OTo7PD0+PwAAAAAAAAACAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGwAAAAAAABwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAFoAAAAQABAAAwAAACAALgA5AFoAegCl/xv//wAAACAALAAwAEEAYQCl/xr////hAAAABv/B/7v/nwAAAAEAAAAOAAAAAAAAAAAACgAAAEIASABDAEYARwADAAAAAAAA/7UAMgAAAAAAAAAAAAAAAAAAAAAAAAAAAQAEAgABAQERQUxJQkFCQUZvbnQtQm9sZAABAQEg+A8A+CAB+CEC+BgEtPtc+HT5tAX3KA/3UBGcHAZWEgAHAQENExoiKTpLbmluZS4wMDEuMDAxbW9uZXkudW5pRkYxQm5pbmUuMDAxdW5pRkYxQWNvcHlyaWdodCBtaXNzaW5nQUxJQkFCQSBGb250IEJvbGQAAAEAAQAAIhkAQhkAEQkBhwABigAADQAADwAAZAABiAABiwABiQAADgAASQIAAQCtAK4ArwCwALEAsgCzALQAtQC2ALcAuAC5ALoAuwC8AL0AvgC/AMAAwQDCAMMAxADFAMYAxwDIAMkAygDLAMwAzQDOAM8A0ADRANIA0wDUANUA1gDXANgA2QDaANsA3ADdAN4A3wDgAOEA4gFDAVoBqwIsAloCuAMcAzkDzwQ4BDoEPARRBFMEVQTNBOIE8QUEmPtc0Ky6rKKsuqzHrKPDoa2irLCspq2vraWssKzOAejVrKytrKzYA/gu+bQV+9H+fPfRBj76ORVqSWbNavs6rM2wSqwH7vsVFUXNafs68wfNaRVqZ6wG704VaklFJ6zNsEmsB/c6TxUn+zqt9xnNB6z7DhX7Bfs69wWsO++6anRpwwfv+0EV+wX7OvcFB/cZahUnXO8GrFMVamsHRVwF8Wr7OqwG0boFRawGDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OrIr5UQH3OPdUA/ebihVmaZSdbB9Mr2TL0xr3vgewlK2eqh7Kr86y1BuvrIJ5qh/HZrJIQhr7vgdngmp5bR5OZ0tkQxv46ARUX2FSH/u+B1a5YMDAs7TCHve+B8RjtVYeDnD4utkB93HzA/cL+QgVPfH8vPP5UgcOrIn5UgG++DYD+GmJFfw28wb3svfUBZ2glKSnGsNduFBWXF1UiB4ijgaMsJWsnqoIyLHMstYbsa6Ceawfy2ezSUAaVndXZ2Me+2/7jQX3pwYOrIvy92Tz90ryEr/zM/L3SvMu8hPy+B/3/xUT7LCwpMDDGq6CrHqoHsZnTK5DG2lrg3puH09pZk5EGobykAe4tba6vrViXFZiYlcedyOfBhPyxLpdUlJcW1JSXLvEH5ojfAdllGiebB5LsM5j1xuwrpSeqx/KsLPO1xrKcMNerx4OwPL1Affi8gP4dPdlFWD4fPshBvuJ/HkF+wH3ryPy87YH+8z1Ffc69+QF++QHDrb3ZNf3ZfAB9zX3YwP3nRZlaJSebB9LsGPO1xrzBlK6XMTEubrEHtcHxF26UlJcXFIeI/g0+BYh+677JAaorK2ZsBuwroJ4qx/LZrNHPxo/B2aCaHhrHktmR2NAGw6si/X3b/IBufX3b/ID95n4QBWAg4uKhh/3EfelBfsHBvtK/CMFfnCFbm0aZJVnnmoeSrLPYdobsq6Vnqwfy7K10dgasoGueKwey2RHtT4b+9YETlu7yMe8vcfHvVlPT1laTx8OmIr5UQG/+B8D93iKFfsIBvdo+OYF+6T2+B8oBg6iifL3bPX3QPEStvNB8vc/8jXxE/L4EvgHFRPss7Cnu78arYOreqgexWpNr0YbaWyDem4fUmlmTUcaXqBftGAeE/JWYmROSxpklWieax5Ksc9i2BuxrpWerB/LsbTP2BrHaMVath4T7PsN93QVu7FjXFtlZltcZbC7urGzuh8T8oX8ghVPW7zHx7q6yMa9W1BPWVpQHw6i96Tz92/0AbTz93DzA/hp+HkVsIGveKwezmNFtUAbZGeBeGofSmNiRT8aZJVnnmseSrHPYtoboAb7EvukBfcHBvdL+CEFmaySqaQa+9gWxry+yJ6dhoGcHq12oWZmGk5YW1BMXLnKHg4gCiEK+11L91IlCvdiyhWtb6hpJgoeJAoOIQogCqz3pe/3b/UBufX3bfQD+G74dxWyga94rB7NZEW0PhtlaIF4ah9KY2FFPxo7tkTPZh6MjIqKjB+TiJCIjYoIjgaCoKGHoRuanY6QoB+IgfsB+6QF9wcG9y/4IgWYppGnqhr7a/sCFVBbvMjHu7zGyLxbTk5aWk4fDvtd+AojCoz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-ofx2uu{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.withAnimation.svelte-ofx2uu{transition:opacity 0.3s linear}.content__container.unClickable.svelte-ofx2uu{pointer-events:none !important}.content__container.unClickable.svelte-ofx2uu *{pointer-events:none !important}.content__wrapper.svelte-ofx2uu{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-ofx2uu{opacity:0;pointer-events:none}.content__container.hide.svelte-ofx2uu *{pointer-events:none !important}.content__container.disable.svelte-ofx2uu{display:none}.content.svelte-ofx2uu{position:relative;width:100%;height:100%;font-size:0.75rem;line-height:1.125rem;color:#fff}.content.svelte-ofx2uu:not(.unfolded){pointer-events:none}.content.svelte-ofx2uu:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-ofx2uu{pointer-events:auto}')}function F0(i){let t,e;return{c(){t=V("div"),b(t,"data-info","tag content is keep folded"),b(t,"data-id",e=i[1].id)},m(n,o){z(n,t,o)},p(n,o){o&2&&e!==(e=n[1].id)&&b(t,"data-id",e)},i:Z,o:Z,d(n){n&&M(t)}}}function G0(i){let t,e,n,o,s,r,a,l,c;const d=[J0,U0,Y0,X0,_0,W0,N0],f=[];function u(h,p){return h[1].element?0:h[1].contentType==="Text"?1:h[1].contentType==="ImageText"||h[1].contentType==="Image"||h[1].contentType==="Video"?2:h[1].contentType==="Audio"?3:h[1].contentType==="Marketing"?4:h[1].contentType==="Link"||h[1].contentType==="VRLink"||h[1].contentType==="PanoLink"?5:h[1].contentType==="MediaPlane"?6:-1}return~(o=u(i))&&(s=f[o]=d[o](i)),{c(){var h,p,A;t=V("div"),e=V("div"),n=V("div"),s&&s.c(),b(n,"class","content svelte-ofx2uu"),te(n,"unfolded",(h=i[1].state)==null?void 0:h.unfolded),b(e,"class","content__wrapper svelte-ofx2uu"),b(t,"class","content__container svelte-ofx2uu"),b(t,"data-id",r=i[1].id),te(t,"disable",i[1].enabled===!1),te(t,"hide",!i[3].visible||!i[3].enabled||!i[4].visible||!((p=i[1].state)!=null&&p.visible)||((A=i[1].temporaryState)==null?void 0:A.visible)===!1),te(t,"withAnimation",i[0]),te(t,"unClickable",i[1].clickable===!1),T(t,"width",i[1].stickType==="Plane"?"100%":0),T(t,"height",i[1].stickType==="Plane"?"100%":0)},m(h,p){z(h,t,p),Q(t,e),Q(e,n),~o&&f[o].m(n,null),a=!0,l||(c=Se(t,"click",ha(i[12])),l=!0)},p(h,p){var g,v,w;let A=o;o=u(h),o===A?~o&&f[o].p(h,p):(s&&(se(),S(f[A],1,1,()=>{f[A]=null}),re()),~o?(s=f[o],s?s.p(h,p):(s=f[o]=d[o](h),s.c()),k(s,1),s.m(n,null)):s=null),(!a||p&2)&&te(n,"unfolded",(g=h[1].state)==null?void 0:g.unfolded),(!a||p&2&&r!==(r=h[1].id))&&b(t,"data-id",r),(!a||p&2)&&te(t,"disable",h[1].enabled===!1),(!a||p&26)&&te(t,"hide",!h[3].visible||!h[3].enabled||!h[4].visible||!((v=h[1].state)!=null&&v.visible)||((w=h[1].temporaryState)==null?void 0:w.visible)===!1),(!a||p&1)&&te(t,"withAnimation",h[0]),(!a||p&2)&&te(t,"unClickable",h[1].clickable===!1),p&2&&T(t,"width",h[1].stickType==="Plane"?"100%":0),p&2&&T(t,"height",h[1].stickType==="Plane"?"100%":0)},i(h){a||(k(s),a=!0)},o(h){S(s),a=!1},d(h){h&&M(t),~o&&f[o].d(),l=!1,c()}}}function N0(i){let t,e;return t=new w0({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function W0(i){let t,e;return t=new V0({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function _0(i){let t,e;return t=new _g({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function X0(i){let t,e;return t=new A0({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function Y0(i){let t,e;return t=new Dg({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function U0(i){let t,e;return t=new Fp({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function J0(i){let t,e;return t=new O0({props:{tag:Te(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Te(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function Z0(i){let t,e,n,o;const s=[G0,F0],r=[];function a(l,c){return l[5]?0:1}return t=a(i),e=r[t]=s[t](i),{c(){e.c(),n=fe()},m(l,c){r[t].m(l,c),z(l,n,c),o=!0},p(l,[c]){let d=t;t=a(l),t===d?r[t].p(l,c):(se(),S(r[d],1,1,()=>{r[d]=null}),re(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),k(e,1),e.m(n.parentNode,n))},i(l){o||(k(e),o=!0)},o(l){S(e),o=!1},d(l){r[t].d(l),l&&M(n)}}}function q0(i,t,e){let n,o,s,r,a,{withAnimation:l=!1}=t,{tag:c}=t,{hooks:d}=t,{state:f}=t,{mediaStore:u}=t,{temporaryState:h}=t;Un("hooks",d),Un("mediaStore",u);let p,A;function g(w){w?d.emit("exposure",{id:r,type:"start"}):d.emit("exposure",{id:r,type:"end"})}const v=w=>d.emit("click",{event:w,target:"TagContent",tag:c});return i.$$set=w=>{"withAnimation"in w&&e(0,l=w.withAnimation),"tag"in w&&e(1,c=w.tag),"hooks"in w&&e(2,d=w.hooks),"state"in w&&e(3,f=w.state),"mediaStore"in w&&e(6,u=w.mediaStore),"temporaryState"in w&&e(4,h=w.temporaryState)},i.$$.update=()=>{var w,y,E,I,C,L,D,B,N,F,X;i.$$.dirty&2&&e(10,n=(w=c.state)==null?void 0:w.unfolded),i.$$.dirty&2&&e(9,o=(y=c.state)==null?void 0:y.visible),i.$$.dirty&26&&e(11,s=f.visible&&h.visible&&((E=c.state)==null?void 0:E.visible)),i.$$.dirty&2&&(r=c.id),i.$$.dirty&2048&&g(s),i.$$.dirty&1922&&c.hooks&&(n!==void 0&&n!==A&&(e(8,A=n),n?(C=(I=c.hooks).emit)==null||C.call(I,"unfolded"):(D=c==null?void 0:(L=c.hooks).emit)==null||D.call(L,"folded")),o!==void 0&&o!==p&&(e(7,p=o),o?(N=(B=c.hooks).emit)==null||N.call(B,"show"):(X=(F=c.hooks).emit)==null||X.call(F,"hide"))),i.$$.dirty&2&&e(5,a=(()=>!(typeof c.mergedConfig.unfoldedConfig=="object"&&c.mergedConfig.unfoldedConfig.keep==="folded"))())},[l,c,d,f,h,a,u,p,A,o,n,s,v]}class hl extends oe{constructor(t){super(),ie(this,t,q0,Z0,ne,{withAnimation:0,tag:1,hooks:2,state:3,mediaStore:6,temporaryState:4},H0)}}function K0(i){le(i,"svelte-yex9rb",'@charset "UTF-8";.tag-point-click-helper.svelte-yex9rb.svelte-yex9rb{position:absolute;pointer-events:auto;cursor:pointer;width:2.5rem;height:2.5rem;left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-yex9rb.svelte-yex9rb{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);z-index:-1}.tag-folded-point.svelte-yex9rb.svelte-yex9rb,.tag-unfolded-point.svelte-yex9rb.svelte-yex9rb{transition:all 0.5s}.tag-point-wrapper.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.3125rem;height:0.3125rem;border-radius:50%;background-color:white}.tag-point-wrapper.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb:before{content:"";position:absolute;width:0.875rem;height:0.875rem;border-radius:50%;background-color:rgba(0, 0, 0, 0.2)}.tag-point-wrapper.folded.svelte-yex9rb .tag-folded-point.svelte-yex9rb{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-yex9rb .tag-folded-point.svelte-yex9rb{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb{opacity:1;scale:1}')}function $0(i){let t,e,n,o,s,r,a,l,c,d,f,u;return o=new Ke({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new fl({props:{icon:i[2],width:i[1]}}),{c(){t=V("div"),e=ee(),n=V("div"),$(o.$$.fragment),s=ee(),r=V("div"),a=ee(),l=V("div"),$(c.$$.fragment),b(t,"class","tag-point-click-helper svelte-yex9rb"),b(r,"class","tag-unfolded-point svelte-yex9rb"),T(r,"transition-delay",(i[3]?i[5]:0)+"ms"),b(l,"class","tag-folded-point svelte-yex9rb"),T(l,"transition-delay",(i[3]?i[5]:0)+"ms"),b(n,"class","tag-point-wrapper svelte-yex9rb"),te(n,"unfolded",i[0]),te(n,"folded",i[3]),T(n,"width",ye(i[1])),T(n,"height",ye(i[1]))},m(h,p){z(h,t,p),z(h,e,p),z(h,n,p),q(o,n,null),Q(n,s),Q(n,r),Q(n,a),Q(n,l),q(c,l,null),d=!0,f||(u=Se(t,"click",i[4]),f=!0)},p(h,[p]){p&8&&T(r,"transition-delay",(h[3]?h[5]:0)+"ms");const A={};p&4&&(A.icon=h[2]),p&2&&(A.width=h[1]),c.$set(A),p&8&&T(l,"transition-delay",(h[3]?h[5]:0)+"ms"),(!d||p&1)&&te(n,"unfolded",h[0]),(!d||p&8)&&te(n,"folded",h[3]),p&2&&T(n,"width",ye(h[1])),p&2&&T(n,"height",ye(h[1]))},i(h){d||(k(o.$$.fragment,h),k(c.$$.fragment,h),d=!0)},o(h){S(o.$$.fragment,h),S(c.$$.fragment,h),d=!1},d(h){h&&M(t),h&&M(e),h&&M(n),K(o),K(c),f=!1,u()}}}function eA(i,t,e){let n,o,s,r;const a=ct("hooks");let{tag:l}=t,c,d=!1;const f=()=>{c!==void 0&&clearTimeout(c),d=!0,c=setTimeout(()=>{d=!1},800)},u=p=>{d||a.emit("click",{event:p,target:"TagPoint",tag:l})},h=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();return i.$$set=p=>{"tag"in p&&e(6,l=p.tag)},i.$$.update=()=>{var p,A,g,v;i.$$.dirty&64&&e(0,n=(p=l.state)==null?void 0:p.unfolded),i.$$.dirty&1&&e(3,o=!n),i.$$.dirty&64&&e(2,s=(g=(A=l.style)==null?void 0:A.point)!=null&&g.url?(v=l.style)==null?void 0:v.point:{url:mp}),i.$$.dirty&64&&e(1,r=(()=>{var y,E,I;const w=(I=(E=(y=l.style)==null?void 0:y.point)==null?void 0:E.size)!=null?I:"S";return typeof w=="number"?w:w==="S"?18:w==="M"?20:w==="L"?24:w==="XL"?28:18})())},f(),[n,r,s,o,u,h,l]}class tA extends oe{constructor(t){super(),ie(this,t,eA,$0,ne,{tag:6},K0)}}function nA(i){le(i,"svelte-bdubcv",".tag.hide.svelte-bdubcv{opacity:0;pointer-events:none}.tag.disable.svelte-bdubcv{display:none}.tag.withAnimation.svelte-bdubcv{transition:opacity 0.3s linear}.wrapper.svelte-bdubcv{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto}")}function iA(i){let t;return{c(){t=V("div"),b(t,"data-info","tag content is disable")},m(e,n){z(e,t,n)},p:Z,i:Z,o:Z,d(e){e&&M(t)}}}function oA(i){let t,e;return t=new hl({props:{mediaStore:i[2],withAnimation:i[0],tag:Te(i[1]),hooks:i[14],state:i[3],temporaryState:i[4]}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&4&&(s.mediaStore=n[2]),o&1&&(s.withAnimation=n[0]),o&2&&(s.tag=Te(n[1])),o&8&&(s.state=n[3]),o&16&&(s.temporaryState=n[4]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function sA(i){let t;return{c(){t=V("div"),b(t,"data-info","tag point is disable")},m(e,n){z(e,t,n)},p:Z,i:Z,o:Z,d(e){e&&M(t)}}}function rA(i){let t,e;return t=new tA({props:{tag:i[1]}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=n[1]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){S(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function aA(i){let t,e,n,o,s,r,a,l,c;const d=[oA,iA],f=[];function u(g,v){return g[12]?0:1}n=u(i),o=f[n]=d[n](i);const h=[rA,sA],p=[];function A(g,v){return g[13]?0:1}return r=A(i),a=p[r]=h[r](i),{c(){t=V("div"),e=V("div"),o.c(),s=ee(),a.c(),b(e,"class","wrapper svelte-bdubcv"),b(e,"data-tag-unfolded",i[8]),b(e,"data-tag-id",i[11]),b(e,"data-content-type",l=i[1].contentType),T(e,"left",i[7]),T(e,"top",i[6]),T(e,"z-index",i[5]),b(t,"class","tag svelte-bdubcv"),b(t,"data-tag-id",i[11]),te(t,"disable",i[10]),te(t,"hide",i[9]),te(t,"withAnimation",i[0])},m(g,v){z(g,t,v),Q(t,e),f[n].m(e,null),Q(e,s),p[r].m(e,null),c=!0},p(g,[v]){let w=n;n=u(g),n===w?f[n].p(g,v):(se(),S(f[w],1,1,()=>{f[w]=null}),re(),o=f[n],o?o.p(g,v):(o=f[n]=d[n](g),o.c()),k(o,1),o.m(e,s));let y=r;r=A(g),r===y?p[r].p(g,v):(se(),S(p[y],1,1,()=>{p[y]=null}),re(),a=p[r],a?a.p(g,v):(a=p[r]=h[r](g),a.c()),k(a,1),a.m(e,null)),(!c||v&256)&&b(e,"data-tag-unfolded",g[8]),(!c||v&2048)&&b(e,"data-tag-id",g[11]),(!c||v&2&&l!==(l=g[1].contentType))&&b(e,"data-content-type",l),v&128&&T(e,"left",g[7]),v&64&&T(e,"top",g[6]),v&32&&T(e,"z-index",g[5]),(!c||v&2048)&&b(t,"data-tag-id",g[11]),(!c||v&1024)&&te(t,"disable",g[10]),(!c||v&512)&&te(t,"hide",g[9]),(!c||v&1)&&te(t,"withAnimation",g[0])},i(g){c||(k(o),k(a),c=!0)},o(g){S(o),S(a),c=!1},d(g){g&&M(t),f[n].d(),p[r].d()}}}function lA(i,t,e){let n,o,s,r,a,l,c,d,f,{withAnimation:u=!1}=t,{tag:h}=t,{mediaStore:p}=t,{state:A}=t,{temporaryState:g}=t;const v=ct("hooks");return i.$$set=w=>{"withAnimation"in w&&e(0,u=w.withAnimation),"tag"in w&&e(1,h=w.tag),"mediaStore"in w&&e(2,p=w.mediaStore),"state"in w&&e(3,A=w.state),"temporaryState"in w&&e(4,g=w.temporaryState)},i.$$.update=()=>{var w,y,E,I,C,L,D,B;i.$$.dirty&2&&e(13,n=(()=>!(h.contentType==="Link"||h.contentType==="VRLink"||h.contentType==="PanoLink"||h.contentType==="Audio"&&h.data.appearance==="plane"))()),i.$$.dirty&2&&e(12,o=(()=>h.stickType==="2DPoint")()),i.$$.dirty&2&&e(11,s=h.id),i.$$.dirty&2&&e(10,r=!((w=h.pointTagStyle)!=null&&w.leftPercent)||!((y=h.pointTagStyle)!=null&&y.topPercent)||h.enabled===!1||!h.state),i.$$.dirty&2&&e(9,a=!((E=h.state)!=null&&E.visible)||((I=h.temporaryState)==null?void 0:I.visible)===!1),i.$$.dirty&2&&e(8,l=(C=h.state)==null?void 0:C.unfolded),i.$$.dirty&2&&e(7,c=((L=h.pointTagStyle)==null?void 0:L.leftPercent)+"%"),i.$$.dirty&2&&e(6,d=((D=h.pointTagStyle)==null?void 0:D.topPercent)+"%"),i.$$.dirty&2&&e(5,f=(B=h.state)!=null&&B.unfolded?1:0)},[u,h,p,A,g,f,d,c,l,a,r,s,o,n,v]}class cA extends oe{constructor(t){super(),ie(this,t,lA,aA,ne,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},nA)}}function dA(i){le(i,"svelte-uq11d5",".tag--container.svelte-uq11d5{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:translate3d(0, 0, 0)}.withAnimation.svelte-uq11d5{transition:opacity 0.3s linear}.tag--container.hide.svelte-uq11d5{opacity:0;pointer-events:none}.tag--container.hide.svelte-uq11d5 *{pointer-events:none !important}")}function Wr(i,t,e){const n=i.slice();return n[6]=t[e],n}function _r(i){let t,e=[],n=new Map,o,s=i[1];const r=a=>a[6].id;for(let a=0;a<s.length;a+=1){let l=Wr(i,s,a),c=r(l);n.set(c,e[a]=Xr(c,l))}return{c(){t=V("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","tag--container svelte-uq11d5"),te(t,"hide",!i[3].visible||!i[4].visible),te(t,"withAnimation",i[0])},m(a,l){z(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,l){l&31&&(s=a[1],se(),e=qe(e,l,r,1,a,s,n,t,Ot,Xr,null,Wr),re()),(!o||l&24)&&te(t,"hide",!a[3].visible||!a[4].visible),(!o||l&1)&&te(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)k(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)S(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function Xr(i,t){let e,n,o;return n=new cA({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=fe(),$(n.$$.fragment),this.first=e},m(s,r){z(s,e,r),q(n,s,r),o=!0},p(s,r){t=s;const a={};r&8&&(a.state=t[3]),r&16&&(a.temporaryState=t[4]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[6]),r&4&&(a.mediaStore=t[2]),n.$set(a)},i(s){o||(k(n.$$.fragment,s),o=!0)},o(s){S(n.$$.fragment,s),o=!1},d(s){s&&M(e),K(n,s)}}}function uA(i){let t,e,n=i[3].enabled&&_r(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),z(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&k(n,1)):(n=_r(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(se(),S(n,1,1,()=>{n=null}),re())},i(o){e||(k(n),e=!0)},o(o){S(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function fA(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return Un("hooks",s),i.$$set=c=>{"withAnimation"in c&&e(0,n=c.withAnimation),"tags"in c&&e(1,o=c.tags),"hooks"in c&&e(5,s=c.hooks),"mediaStore"in c&&e(2,r=c.mediaStore),"state"in c&&e(3,a=c.state),"temporaryState"in c&&e(4,l=c.temporaryState)},[n,o,r,a,l,s]}class hA extends oe{constructor(t){super(),ie(this,t,fA,uA,ne,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},dA)}}const mA={globalConfig:{unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},Link:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},VRLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},PanoLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0}}}};function pA(i){return i.stickType==="2DPoint"||i.stickType==="3DPoint"}function gA(i){return i.stickType==="3DPoint"||i.stickType==="Plane"}class AA extends li{constructor(e){super(e);m(this,"tagCacheByPanoIndex",{})}getCache({panoIndex:e,id:n,key:o}){var c,d,f,u;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(f=(d=s.work)==null?void 0:d.workCode)!=null?f:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const h=l.get(n);return h||(l.set(n,{}),l.get(n))}return(u=l.get(n))==null?void 0:u[o]}clearCache(){this.tagCacheByPanoIndex={}}}class vA extends AA{constructor(e){super(e);m(this,"tags",[]);m(this,"config",mA);m(this,"raycaster",new x.Raycaster)}get isPanorama(){return this.five.currentMode==="Panorama"}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.error(`getTagById(): tag is ${n}, id is ${e}`);return}return n}changeContentTypeConfig(e,n,o=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),o?this.config.contentTypeConfig[e]=St.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache()}getVisibleByPanoIndex(e,n){var r;const o=this.getCache({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(o.visible!==void 0)return o.visible;{const a=(()=>{var d,f,u,h;const l=(d=this.getTagConfig(e).visibleConfig)!=null?d:{},c=this.getDistance(e);if(typeof l=="function")return{value:l(this.five,{tag:e,distance:c}),reason:"config function result"};if(l.keep==="hidden")return{value:!1,reason:"config.keep is hidden"};if(l.keep==="visible")return{value:!0,reason:"config.keep is visible"};if(l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&s!==void 0){if(Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(s))return{value:!1,reason:`current panoIndex is not included in visiblePano. currentPanoIndex: ${s}, visiblePanoIndex: ${l.visiblePanoIndex}`};if(l.visiblePanoIndex==="current"&&s!==((f=e.fiveState)==null?void 0:f.panoIndex))return{value:!1,reason:`current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${s}, tag.panoIndex: ${(u=e.fiveState)==null?void 0:u.panoIndex}`}}if(l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&rn(c,l.visibleDistance)===!1)return{value:!1,reason:`distance is not in visibleDistance. distance: ${c}, visibleDistance: ${l.visibleDistance}`};if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s===void 0)return{value:!1,reason:`intersectRaycaster check failed: fivePanoIndex is ${s}`};const p=(h=this.five.work.observers[s])==null?void 0:h.position;if(p===void 0)throw new Error(`getVisible(): observerPosition is ${p}`);const A=Mn(e.position).sub(p).normalize();this.raycaster.set(p,A);const[g]=this.five.model.intersectRaycaster(this.raycaster),v=(()=>{var w;return typeof l.intersectRaycaster=="object"&&(w=l.intersectRaycaster.distanceAccuracy)!=null?w:.01})();if(g&&g.distance+v<c)return{value:!1,reason:`intersectRaycaster check failed: distance is ${c}, intersection.distance is ${g.distance}, distanceError is ${v}`}}if(l.angleRange&&gA(e)){const p=this.getAngle(e);if(rn(p,l.angleRange)===!1)return{value:!1,reason:`angle is not in angleRange. angle: ${p}, angleRange: ${l.angleRange}`}}return{value:!0,reason:"all check passed"}})();return o.visible=a.value,o.__debug_visiblereason__=a,o.visible}}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCache({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.unfoldDistance&&rn(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&rn(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.autoUnfold.strategy==="MinimumDistance"){const d=this.filterPointTag().filter(u=>this.getVisibleByPanoIndex(u)).filter(u=>{const h=this.getTagProject(u);if(!h)return!1;const{x:p,y:A,z:g}=h;return!(Math.abs(g)>1||Math.abs(p)>1||Math.abs(A)>1)}).map(u=>({tag:u,id:u.id,tagConfig:this.getTagConfig(u).unfoldedConfig})).filter(({tag:u,tagConfig:h})=>{var p,A;return!(typeof h!="object"||h.keep||h.autoUnfold===!1||((p=h.autoUnfold)==null?void 0:p.enable)===!1||((A=h.autoUnfold)==null?void 0:A.strategy)!=="MinimumDistance")}).map(u=>he(G({},u),{distance:this.getDistance(u.tag)})).filter(({distance:u,tagConfig:h})=>{var p,A;return!(u===void 0||typeof h!="object"||h.autoUnfold===!1||((p=h.autoUnfold)==null?void 0:p.enable)===!1||((A=h.autoUnfold)==null?void 0:A.strategy)!=="MinimumDistance"||h.autoUnfold.distance&&rn(u,h.autoUnfold.distance)===!1)}).sort((u,h)=>u.distance-h.distance).findIndex(u=>u.id===e.id);if(d===-1||d<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const d=(()=>pA(e)?nt(e==null?void 0:e.position):Mn(e.position))(),f=c.distanceTo(d);return s.distance=f,f}}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const d=(()=>e.stickType==="3DPoint"?hn(e.normal):$a(e.position))();if(!d)return;const f=new x.Vector3().copy(c).sub(Mn(e.position)),u=d.angleTo(f)*180/Math.PI;return s.angle=u,s.angle}}getTagConfig(e){var s;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(r=>{const a=r;if(n[a])return;const l=a.split("-");if(l.length===1){const[c]=l;e.contentType===c&&(n[a]=this.config.contentTypeConfig[a])}if(l.length===2){const[c="Any",d="Any"]=l;(e.stickType===c||c==="Any")&&(e.contentType===d||d==="Any")&&(n[a]=this.config.contentTypeConfig[a])}if(l.length===3){const[c="Any",d,f]=l;if(d==="Audio"&&e.contentType==="Audio"){const u=e;(u.stickType===c||c==="Any")&&u.data.appearance===f&&(n[a]=this.config.contentTypeConfig[a])}}});const o=St.default({},this.config.globalConfig,...Object.values(n),e.config);return typeof o.unfoldedConfig=="object"&&(o.unfoldedConfig.disableFold&&(o.unfoldedConfig={keep:"unfolded"}),o.unfoldedConfig.disableUnfold&&(o.unfoldedConfig={keep:"folded"}),o.unfoldedConfig.keep&&(o.unfoldedConfig={keep:o.unfoldedConfig.keep})),typeof o.visibleConfig=="object"&&o.visibleConfig.keep&&(o.visibleConfig={keep:o.visibleConfig.keep}),o}can(e,n){const o=this.getTagConfig(n);if(!o||typeof o!="object")return!0;if(e==="show"||e==="hide"){if(!o.visibleConfig||typeof o.visibleConfig!="object")return!0;if(e==="show"&&o.visibleConfig.keep==="hidden"||e==="hide"&&(o.visibleConfig.keep==="visible"||o.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!o.unfoldedConfig||typeof o.unfoldedConfig!="object")return!0;if(e==="fold"&&o.unfoldedConfig.keep==="unfolded"||e==="unfold"&&o.unfoldedConfig.keep==="folded")return!1}return!0}sort(e){return e.sort((n,o)=>{const s=this.getDistance(n),r=this.getDistance(o);return s===void 0||r===void 0?0:r-s})}setPointTagPosition(){const e=this.filterPointTag();e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=null;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=null;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const o=Mn(e.position),{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}filterPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint"||e.stickType==="3DPoint")}filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint")}filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint")}filter3DTag(){return this.tags.filter(e=>e.stickType==="3DPoint"||e.stickType==="Plane")}filterPlaneTag(){return this.tags.filter(e=>e.stickType==="Plane")}updateTagConfig(e){e!=null&&e.force&&this.clearCache(),this.tags.forEach(n=>{const o=this.getTagConfig(n);n.mergedConfig=o})}}function bA(i){var t,e,n,o;if(!i.stickType){const s=(()=>i.pointType==="PointTag"&&i.dimensionType==="3D"?"3DPoint":i.pointType==="PlaneTag"?"Plane":"2DPoint")();i.stickType=s}if(i.contentType==="VRLink"||i.contentType==="PanoLink"||i.contentType==="Link"){const s=i;!((e=(t=s.data)==null?void 0:t.icon)!=null&&e.url)&&!((o=(n=s.style)==null?void 0:n.point)!=null&&o.url)&&(s.data.icon={url:"//vrlab-static.ljcdn.com/release/web/test.09dee741.png",steps:28})}return i}const ml="2.0.7",Yi=`DnalogelPlugin-PanoTagPlugin@${ml}`,yA=!1,wA=i=>`${Yi}--${i}`;class pl extends vA{constructor(e,n){super(e);m(this,"version",ml);m(this,"state",{enabled:!0,visible:!0});m(this,"params");m(this,"debug");m(this,"css3DRenderPlugin");m(this,"TagContainerSvelte");m(this,"temporaryState",{visible:!0});m(this,"mediaStore",io({currentMediaElement:null}));m(this,"isIOSWX",navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1&&navigator.userAgent.toLowerCase().indexOf("iphone")!==-1);m(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});m(this,"disposedErrorLog",()=>{console.error(`${Yi} is disposed`)});this.params=G({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,zr(1,{namespace:ti.GetAudioDuration}),zr(1,{namespace:ti.PlayAudio}),Object.assign(window,{[`__PANOTAGPLUGIN_DEBUG_${Date.now()}__`]:this}),Object.assign(window,{__PANOTAGPLUGIN_DEBUG__:this})}load(e,n){return Y(this,null,function*(){var o,s;if(this.clearTags(),console.log(Yi," load:",{data:e}),this.config=St.default({},this.config,{globalConfig:(o=e.globalConfig)!=null?o:{},contentTypeConfig:(s=e.contentTypeConfig)!=null?s:{}}),this.debug)try{ep(this.five,this.tags)}catch(r){console.error(r)}return this.addTag(e.tagList,n)})}addTag(e,n){return Y(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r);return he(G({},r),{state:G({visible:void 0,unfolded:yA},a.initialState),hooks:new be.Subscribe,clickable:a.clickable,mergedConfig:a})}).filter(r=>r.position);return s.forEach(bA),this.tags.push(...s),tp(this.five).then(()=>{var r,a,l;return this.store.eventListenerDisposer&&((a=(r=this.store).eventListenerDisposer)==null||a.call(r)),this.state.enabled&&(this.store.eventListenerDisposer=this.addEventListener()),this.addResizeListener(),this.checkPanelTag(),this.setVisibleAndUnfolded({withAnimation:(l=n==null?void 0:n.withAnimation)!=null?l:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags(),!0})})}changeConfig(e,n=!0){n?this.config=St.default({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=St.default({},this.config.globalConfig,e):this.config.globalConfig=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}clearTags(){this.tags=[],this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}show(e){return Y(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("show",{userAction:n,withAnimation:o})})}hide(e){return Y(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("hide",{userAction:n,withAnimation:o})})}enable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n})}disable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:n}),this.hooks.emit("disable",{userAction:n})}dispose(){var e,n,o,s,r,a;this.pauseCurrentMedia(),this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filter3DTag().forEach(l=>{var c;return(c=l.tag3DContentSvelte)==null?void 0:c.svelteApp.$destroy()}),this.tags=[],(n=this.store.disposers)==null||n.forEach(l=>l==null?void 0:l()),this.store.disposers=[],this.store.disposed=!0,(s=(o=this.store).eventListenerDisposer)==null||s.call(o),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.clearCache(),this.hooks.emit("dispose")}setState(e,n){if(this.store.disposed)return this.disposedErrorLog();const{userAction:o=!0,visibleWithAnimation:s=!1}=n,r=G({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}changeUnfoldedById(e,n){var r;const o=this.getTagById(e);if(!o)return;o.state.unfolded=n;const s=this.filterPointTag();(r=this.TagContainerSvelte)==null||r.$set({tags:s})}changeTagNormalById(e,n){const o=this.getTagById(e);!o||!o.tag3DContentSvelte||(o.tag3DContentSvelte.currentNormal=nt(n),this.updateRenderPlaneTag())}changeDataById(e,n,o=!0){const s=this.getTagById(e);!s||(o?s.data=St.default({},s.data,n):s.data=G(G({},s.data),n),this.checkPanelTag(),this.updateRenderAllTags())}changeStickTypeById(e,n,o=!0){this.changeTagById(e,n,o)}changeTagById(e,n,o=!0){const s=this.getTagById(e);!n||(o?St.default(s,n):Object.assign(s,n),(s==null?void 0:s.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(s.tag3DContentSvelte.currentNormal=nt(n.normal)),this.updateRenderAllTags(),this.checkPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(o=>{const s=this.tags.findIndex(r=>r.id===o);s!==-1&&this.tags.splice(s,1)}),this.updateRenderAllTags()}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}setVisibleAndUnfolded(){return Y(this,arguments,function*({withAnimation:e}={withAnimation:!1}){if(!!this.isPanorama)return this.setVisibleByPanoIndex(),e?new Promise((n,o)=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.updateTagContainerVisible()}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.updateTagContainerVisible()}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.updateRenderAllTags()}handleDisable(){var e,n,o;this.pauseCurrentMedia(),this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),(o=this.TagContainerSvelte)==null||o.$set({tags:[]}),this.filter3DTag().forEach(s=>{var r;(r=s.tag3DContentSvelte)==null||r.svelteApp.$destroy(),s.tag3DContentSvelte=void 0})}addEventListener(){const{five:e,hooks:n}=this,o=this.handleFiveWantsMoveToPano.bind(this),s=this.handleFiveModeChange.bind(this),r=this.handleFiveCameraUpdate.bind(this),a=this.handleFiveCameraUpdateDebounce(),l=this.handleFivePanoArrived.bind(this),c=this.loadVideoFirstFrame.bind(this),d=this.clickhandler.bind(this);return this.five.currentMode&&(this.isPanorama?(this.handleFivePanoArrived(),this.temporaryShow({withAnimation:!0})):this.temporaryHide()),e.on("wantsMoveToPano",o),e.on("modeChange",s),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),e.on("panoArrived",c),n.on("click",d),()=>{e.off("wantsMoveToPano",o),e.off("modeChange",s),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),e.off("panoArrived",c),n.off("click",d),this.store.eventListenerDisposer=void 0}}loadVideoFirstFrame(){this.isIOSWX&&this.hooks.emit("loadVideoFirstFrame")}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const e=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=e,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(!this.store.disposed)return;const e=this.five.getElement(),n=()=>{!this.state.enabled||(this.show(),this.updateRenderAllTags())},o=()=>{!this.state.enabled||this.hide()},{observe:s,unobserve:r}=Ys(ip(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=Ys(Xs(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){e==="Panorama"?this.five.once("panoArrived",()=>this.temporaryShow({withAnimation:!0})):this.temporaryHide()}handleFiveWantsMoveToPano(){this.tags.forEach(e=>{const n=this.getTagConfig(e);typeof n.visibleConfig=="object"&&(n.visibleConfig.keep?e.temporaryState=he(G({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=he(G({},e.temporaryState),{visible:Boolean(n.visibleConfig.alwaysShowWhenMovePano)}))}),this.updateTagContainerVisible()}temporaryShow({withAnimation:e}={withAnimation:!1}){this.store.visibleWithAnimation=e,this.temporaryState.visible=!0,this.updateTagContainerVisible()}temporaryHide({withAnimation:e}={withAnimation:!1}){this.store.visibleWithAnimation=e,this.temporaryState.visible=!1,this.updateTagContainerVisible()}clickhandler(e){if(e.target!=="TagPoint")return;if(!e.tag.state)return console.warn("Clickhandler: params.tag.state is undefined");const n=this.can("fold",e.tag),o=this.can("unfold",e.tag);n&&o&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(s=>{s.id!==e.tag.id&&s.state&&this.can("fold",s)&&(s.state.unfolded=!1)}),this.updateRenderAllTags())}updateRenderAllTags(){this.updateRenderPointTag(),this.updateRenderPlaneTag()}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filter3DTag().forEach(n=>{var o;(o=n.tag3DContentSvelte)==null||o.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}handleFiveCameraUpdateDebounce(){return Xs(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return Y(this,null,function*(){yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=he(G({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);!n.state||o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.keep)||n.state&&(n.state.unfolded=!1)})}updateRenderPointTag(){var n;const e=this.sort(this.filterPointTag());if(this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const o=(n=this.five.getElement())==null?void 0:n.parentElement;if(!o)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new hA({target:o,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateRenderPlaneTag(){this.sort([...this.filterPlaneTag(),...this.filter3DPointTag()]).forEach(n=>{var o;if(n.tag3DContentSvelte){const{svelteApp:s,domContainer:r,initialNormal:a,currentNormal:l}=n.tag3DContentSvelte;if(s.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!a.equals(l)){const c=new H.Quaternion().setFromUnitVectors(a,l);r.css3DObject.setRotationFromQuaternion(c)}}else{if(((o=n.state)==null?void 0:o.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=en(this.five)),n.stickType==="3DPoint"&&!n.normal)return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");const s=n.stickType==="Plane"?n.position:np(this.five.camera.position,nt(n.position),nt(n.normal)),r=n.stickType==="Plane"?$a(n.position):nt(n.normal),a=this.getTagConfig(n).tag3DConfig,l=this.css3DRenderPlugin.create3DDomContainer(s,a);if(!l)return;this.store.css3DRenderDisposer.set(n.id,l.dispose),n.tag3DContentSvelte={svelteApp:new hl({target:l.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:l,initialNormal:r,currentNormal:r}}}),this.checkPanelTag()}disposeAllCSS3DContainer(){for(const[e,n]of this.store.css3DRenderDisposer)n==null||n();this.store.css3DRenderDisposer=new Map}checkPanelTag(){this.filter2DPointTag().forEach(e=>{var n;(n=e.tag3DContentSvelte)==null||n.domContainer.dispose(),e.tag3DContentSvelte=void 0});for(const[e,n]of this.store.css3DRenderDisposer){const o=this.getTagById(e);(!o||o.stickType==="2DPoint")&&(n==null||n(),this.store.css3DRenderDisposer.delete(e))}}}var gl=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.Custom="Custom",i))(gl||{}),Al=(i=>(i.Two="2D",i.Three="3D",i))(Al||{}),vl=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(vl||{});const CA=(i,t)=>new pl(i,t);class po extends H.Object3D{constructor(e,n){var o;super();m(this,"originObject3D");m(this,"onRender");this.originObject3D=e,this.onRender=(o=n==null?void 0:n.onRender)!=null?o:()=>{}}get helperObject(){return this}render(){this.onRender()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}updatePosition(){this.position.copy(this.originObject3D.position)}updateQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}applyHelperQuaternion(e,n){this.applyQuaternion(e)}}class PA extends po{}class EA extends po{}class IA extends po{}class kA extends IA{}class xA extends x.Group{constructor(e){super();m(this,"direction");this.direction=e||"x"}}class Yr extends x.Mesh{constructor(e,n,o){super(e,n);m(this,"direction");this.direction=o||"x"}}function DA(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new x.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function go(i,t,e){if(!t||!e||!i)return;const n=DA(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new x.Raycaster;return o.setFromCamera(n,i),o}function LA(i,t){return!(Math.abs(i.x-t.x)>1e-5||Math.abs(i.y-t.y)>1e-5||Math.abs(i.z-t.z)>1e-5)}class Di extends xA{constructor(e){var d;super(e.direction);m(this,"line");m(this,"arrow");m(this,"lineHeight",.4);m(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new x.Color((d=e.color)!=null?d:16214315),o=new x.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:x.DoubleSide}),s=new x.ConeGeometry(.04,.1,32),r=new Yr(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new x.CylinderGeometry(a,a,.4,32),c=new Yr(l,o.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const Li={X:15618642,Y:4765519,Z:4227839};class tt{static get X(){return new x.Color(Li.X).convertSRGBToLinear().clone()}static get Y(){return new x.Color(Li.Y).convertSRGBToLinear().clone()}static get Z(){return new x.Color(Li.Z).convertSRGBToLinear().clone()}}class SA extends PA{constructor(e){super(e);m(this,"xArrow",new Di({direction:"x",color:tt.X}));m(this,"yArrow",new Di({direction:"y",color:tt.Y}));m(this,"zArrow",new Di({direction:"z",color:tt.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function zt(i,t){return TA(document.createElement(t!=null?t:"div"),i)}function TA(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function MA(i){const t=zt(G({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class zA extends EA{constructor(e,n){var o;super(e);m(this,"yzCircle",new Si({direction:"x",color:tt.X}));m(this,"xzCircle",new Si({direction:"y",color:tt.Y}));m(this,"xyCircle",new Si({direction:"z",color:tt.Z}));m(this,"xRingHelper",new Ti({direction:"x"}));m(this,"yRingHelper",new Ti({direction:"y"}));m(this,"zRingHelper",new Ti({direction:"z"}));m(this,"xAngleHelper",new Mi({direction:"x",color:tt.X}));m(this,"yAngleHelper",new Mi({direction:"y",color:tt.Y}));m(this,"zAngleHelper",new Mi({direction:"z",color:tt.Z}));m(this,"angleTips");m(this,"container");n&&(this.container=n==null?void 0:n.container,this.angleTips=MA({display:"none"}),(o=this.container)==null||o.appendChild(this.angleTips.element)),this.show()}updateAngleHelperQuaternion(){this.xAngleHelper.quaternion.copy(this.yzCircle.quaternion),this.yAngleHelper.quaternion.copy(this.xzCircle.quaternion),this.zAngleHelper.quaternion.copy(this.xyCircle.quaternion),this.xRingHelper.quaternion.copy(this.yzCircle.quaternion),this.yRingHelper.quaternion.copy(this.xzCircle.quaternion),this.zRingHelper.quaternion.copy(this.xyCircle.quaternion)}applyHelperQuaternion(e,n){this.yzCircle.applyQuaternion(e),this.xzCircle.applyQuaternion(e),this.xyCircle.applyQuaternion(e),this.xAngleHelper.baseAxes.applyQuaternion(e),this.yAngleHelper.baseAxes.applyQuaternion(e),this.zAngleHelper.baseAxes.applyQuaternion(e)}hide(){this.remove(this.yzCircle,this.xzCircle,this.xyCircle,this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper)}show(){var e;this.add(this.xyCircle,this.xzCircle,this.yzCircle),this.remove(this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.add(...this.filterRingHelper(e)),this.add(...this.filterAngleHelper(e)),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.remove(this.yzCircle,this.xzCircle,this.xyCircle,this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper),(e=this.angleTips)!=null&&e.element&&((n=this.container)==null||n.removeChild(this.angleTips.element))}filterRingHelper(e){return[this.xRingHelper,this.yRingHelper,this.zRingHelper].filter(n=>e.includes(n.direction))}filterAngleHelper(e){return[this.xAngleHelper,this.yAngleHelper,this.zAngleHelper].filter(n=>e.includes(n.direction))}}class Si extends x.Mesh{constructor(e){var n;super();m(this,"direction");m(this,"gapAngle",.02);m(this,"geometry",new x.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new x.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:x.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class Ti extends x.Group{constructor(e){super();m(this,"direction");this.direction=e.direction;const n=.015,o=new Array(8).fill(null).map((s,r)=>{const a=new x.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new x.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:x.DoubleSide}),c=new x.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...o),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class Mi extends x.Mesh{constructor(e){var o;super();m(this,"direction");m(this,"baseAxes");switch(e.direction){case"x":this.baseAxes=new x.Vector3(0,0,1);break;case"y":this.baseAxes=new x.Vector3(1,0,0);break;case"z":this.baseAxes=new x.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new x.CircleGeometry(n,48,0,1e-4),this.material=new x.MeshBasicMaterial({opacity:.4,color:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:x.DoubleSide}),this.direction=e.direction,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}function BA(){const i=zt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=zt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=zt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element:ht({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:ht({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:ht({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:ht({cursor:"ew-resize",right:n})},l={direction:"nesw",element:ht({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:ht({cursor:"ns-resize",top:n})},d={direction:"nwse",element:ht({cursor:"nwse-resize",left:n,top:n})},f={direction:"ew",element:ht({cursor:"ew-resize",left:n})};return new Array(s,a,c,f,o,r,l,d).forEach(h=>t.appendChild(h.element)),{container:i,squares:[o,s,r,a,l,c,d,f]}}function ht(i){const t=zt(G({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=zt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=zt({width:"15px",height:"15px",cursor:i==null?void 0:i.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class VA extends kA{constructor(e,n,o,s){super(e);m(this,"points",[]);m(this,"cornerPositions",[]);m(this,"css3DInstance");m(this,"plane");m(this,"css3DRenderer",new Jt);m(this,"camera");m(this,"scene");m(this,"container");m(this,"enabled",!1);this.camera=o,this.scene=s,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}updatePosition(){var e;this.helperObject.position.copy(this.originObject3D.position),(e=this.plane)==null||e.position.copy(this.originObject3D.position)}updateQuaternion(){var e;(e=this.plane)==null||e.quaternion.copy(this.originObject3D.quaternion)}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(o=>o.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var o;(o=this.plane)==null||o.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,o)=>{n.position.copy(e[o])})}applyHelperQuaternion(e,n){var s;const o=(s=this.css3DInstance)==null?void 0:s.css3DObject;if(o){const r=new x.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.applyQuaternion(e)}if(this.plane){const r=new x.Vector3().subVectors(this.plane.position,n).applyQuaternion(e).add(n);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new x.Vector3().subVectors(r,n).applyQuaternion(e).add(n);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;!this.enabled||(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const n=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!n)return;this.css3DInstance=n,n.appendToElement(this.container);const o=n.css3DObject.container,{container:s,squares:r}=BA();this.points=r.map((l,c)=>({direction:l.direction,point:l.element,position:this.calculatePointPosition(e)[c]})),o.insertBefore(s,(a=o.children[0])!=null?a:null),this.updatePosition()}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("\u5F53\u524D\u7269\u4F53\u6682\u65F6\u4E0D\u652F\u6301 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}new x.Vector3;function pe(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new x.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}pe.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)};pe.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];pe.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}};pe.prototype._objectCtxInit=function(i){i._3xDomEvent={}};pe.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent};pe.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent};pe.prototype._objectCtxGet=function(i){return i._3xDomEvent};pe.prototype.camera=function(i){return i&&(this._camera=i),this._camera};pe.prototype.bind=function(i,t,e,n){console.assert(pe.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)};pe.prototype.addEventListener=pe.prototype.bind;pe.prototype.unbind=function(i,t,e,n){console.assert(pe.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);console.assert(l!==-1),this._boundObjs[t].splice(l,1)};pe.prototype.removeEventListener=pe.prototype.unbind;pe.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1};pe.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new x.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,d,f=r[0],u=f.object;this._selected=u,d=this._bound("mousemove",u),a!=u&&(l=this._bound("mouseover",u),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;d&&this._notify("mousemove",u,n,f),l&&this._notify("mouseover",u,n,f),c&&this._notify("mouseout",a,n,f)}};pe.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new x.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),d=l.parent;typeof c=="undefined"&&d;)c=this._objectCtxGet(d),d=d.parent;!c||this._notify(i,l,n,a)}}};pe.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(console.assert(arguments.length===4),!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),!!l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}};pe.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)};pe.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)};pe.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)};pe.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)};pe.prototype._onClick=function(i){this._onMouseEvent("click",i)};pe.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)};pe.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)};pe.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)};pe.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)};pe.prototype._onTouchMove=function(i){if(i.touches.length==1){i.preventDefault();var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}};pe.prototype._onTouchEvent=function(i,t){if(t.touches.length==1){t.preventDefault();var e=Number(t.touches[0].pageX/window.innerWidth)*2-1,n=-(t.touches[0].pageY/window.innerHeight)*2+1;this._onEvent(i,e,n,t)}};let Lt=null;class Ao{constructor(t,e,n,o,s,r,a){m(this,"hooks",new $t);m(this,"helperObject3D");m(this,"originObject3D");m(this,"camera");m(this,"model");m(this,"scene");m(this,"container");m(this,"domEvents");m(this,"isDragging",!1);m(this,"onRender");m(this,"enabled",!1);m(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});this.camera=t,this.model=e,this.originObject3D=n,this.helperObject3D=o,this.container=s,this.scene=r,this.domEvents=new pe(t,s),this.onRender=a!=null?a:()=>{},this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable()}initialHelperPosition(){this.helperObject3D.updatePosition()}initialHelperQuaternion(){this.helperObject3D.updateQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.render())}disable(){!this.enabled||(this.enabled=!1,this.scene.remove(this.helperObject3D),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){this.helperObject3D.dispose(),this.scene.remove(this.helperObject3D),this.render()}setOpacity(t){this.setOriginOpacityProperty();const e=this.originObject3D;if(e instanceof x.Mesh&&(e.material.opacity=t),e.isCSS3DObjectPlus){const n=e;n.container.style.opacity=t.toString()}this.render()}restoreOpacity(){if(Lt===null)return;const t=this.originObject3D;if(t instanceof x.Mesh&&(t.material.opacity=Lt.opacity),t.isCSS3DObjectPlus){const e=t;e.container.style.opacity=Lt.opacity.toString()}this.render()}setOriginOpacityProperty(){var t,e;if(Lt===null){const n=this.originObject3D;n instanceof x.Mesh&&(Lt={opacity:n.material.opacity}),n instanceof ta&&(Lt={opacity:(t=n.container.style.opacity)!=null?t:1}),n.isCSS3DObjectPlus&&(Lt={opacity:Number((e=n.container.style.opacity)!=null?e:1)})}}updateHelperPosition(){this.helperObject3D.updatePosition()}updateHelperQuaternion(){this.helperObject3D.updateQuaternion()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}render(){this.onRender()}hoverListener(t,e=16777215,n=1){const o=(Array.isArray(t)?t:[t]).filter(We),s=[];for(const r of o)if(r instanceof x.Mesh||r instanceof x.Group){const a=r instanceof x.Group?r.children.filter(u=>u instanceof x.Mesh):[r];a.forEach(u=>{u.__originalColor__=u.material.color.clone(),u.__originalOpacity__=u.material.opacity});const l=()=>{a.forEach(u=>{u.material.color.set(e),u.material.opacity=n}),this.render()},c=()=>{a.forEach(u=>{u.material.color.copy(u.__originalColor__),u.material.opacity=u.__originalOpacity__}),this.render()},d=()=>{this.isDragging||l()},f=()=>{this.isDragging||c()};for(const u of a)this.domEvents.addEventListener(u,"mouseover",d),this.domEvents.addEventListener(u,"mouseout",f),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),s.push(()=>{this.domEvents.removeEventListener(u,"mouseover",d),this.domEvents.removeEventListener(u,"mouseout",f),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>s.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;let o;const s=t.intersectObject(n,!0)[0];if(!!s&&(o=s,o.object=n,!!o)){if(this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<o.point.distanceTo(e))return}return o.object}}}class jA extends Ao{constructor(...e){super(...e);m(this,"startInfo");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=new x.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new x.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new x.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(o){case"x":return s;case"y":return r;case"z":return a}})(),c=(()=>{switch(o){case"x":case"y":return a;case"z":return s}})(),d=n.point.clone(),f=new x.Plane;f.setFromNormalAndCoplanarPoint(c,d),this.startInfo={startVectorProject:d.clone().projectOnVector(l),directionVector:l,plane:f},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("moveStart"),this.isDragging=!0,console.log("%c MoveController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=go(this.camera,e,this.container);return n?(console.log("%c RotateController dragging","color: #49de1b"),this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:o,startVectorProject:s}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new x.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),d=new x.Matrix4;d.setPosition(c),r.applyMatrix4(d),this.helperObject3D.applyMatrix4(d),s.copy(l),this.hooks.emit("positionUpdate",{matrix4:d})}dragEnd(){!this.isDragging||(console.log("%c MoveController dragEnd","color: #e94e4e"),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class zi{constructor(t,e,n,o){m(this,"helperController");m(this,"five");m(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});m(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});const{camera:s,model:r,scene:a}=t,l=t.getElement();if(this.five=t,!s||!r||!l||!a)return;const c=()=>{t.needsRender=!0};this.helperController=new e(s,r,n,o,l,a,c),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture)}}const QA="v1.0.1",RA="Object3DHelper",vo=`${RA}@${QA}`,OA=()=>{console.error(`${vo} is disposed`)},HA=()=>{console.warn(`${vo} is disabled`)},FA=()=>{console.error(`${vo} is disabled`)};class GA{constructor(t,e){m(this,"controllers",{});m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"hooks",new $t);m(this,"helpers");m(this,"eventListener",{});m(this,"handlePositionUpdate",(t,...e)=>{var s,r,a,l;const[n]=e,o=n==null?void 0:n.matrix4;o&&(t!==this.controllers.moveController&&((s=this.controllers.moveController)==null||s.applyHelperMatrix4(o)),t!==this.controllers.rotateController&&((r=this.controllers.rotateController)==null||r.applyHelperMatrix4(o)),t!==this.controllers.scaleController&&((a=this.controllers.scaleController)==null||a.applyHelperMatrix4(o)),(l=this.helpers.outlineHelper)==null||l.applyMatrix4(o))});m(this,"handleScaleUpdate",(t,...e)=>{var s,r;const[n]=e,o=n==null?void 0:n.matrix4;o&&((s=this.controllers.scaleController)==null||s.applyHelperScaleMatrix4(o,n),(r=this.helpers.outlineHelper)==null||r.scale.applyMatrix4(o))});m(this,"handleRotateUpdate",(t,...e)=>{var o,s,r,a;const[n]=e;if(n){const{quaternion:l,origin:c}=n;l&&(t!==this.controllers.moveController&&((o=this.controllers.moveController)==null||o.applyHelperQuaternion(l,c)),t!==this.controllers.rotateController&&((s=this.controllers.rotateController)==null||s.applyHelperQuaternion(l,c)),t!==this.controllers.scaleController&&((r=this.controllers.scaleController)==null||r.applyHelperQuaternion(l,c)),(a=this.helpers.outlineHelper)==null||a.applyQuaternion(l))}});t&&this.addControllers(t),this.helpers=e!=null?e:{},this.setState(this.state)}show(t){return Y(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return Y(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return OA();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return FA();const n=G({},this.state);this.state=G(G({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=G(G({},this.controllers),t),this.addEventListener(),this.setState(this.state)}addHelpers(t){this.helpers=G(G({},this.helpers),t)}getCurrentState(){return this.state}addEventListener(){for(const t in this.controllers){if(!t)continue;const e=t;this.eventListener[e]||(this.eventListener[e]=(()=>{const n=this.controllers[e];if(!n)return;const o=()=>this.handleStart(n),s=()=>this.handleEnd(n),r=(...c)=>this.handlePositionUpdate(n,...c),a=(...c)=>this.handleRotateUpdate(n,...c),l=(...c)=>this.handleScaleUpdate(n,...c);return n.hooks.on("moveStart",o),n.hooks.on("rotateStart",o),n.hooks.on("scaleStart",o),n.hooks.on("positionUpdate",r),n.hooks.on("rotateUpdate",a),n.hooks.on("scaleUpdate",l),n.hooks.on("moveEnd",s),n.hooks.on("rotateEnd",s),n.hooks.on("scaleEnd",s),()=>{n.hooks.off("moveStart",o),n.hooks.off("rotateStart",o),n.hooks.off("scaleStart",o),n.hooks.off("positionUpdate",r),n.hooks.off("rotateUpdate",a),n.hooks.off("scaleUpdate",l),n.hooks.off("moveEnd",s),n.hooks.off("rotateEnd",s),n.hooks.off("scaleEnd",s)}})())}}handleEnd(t){t&&this.setOtherHelpersVisible(!0,t)}handleStart(t){t&&this.setOtherHelpersVisible(!1,t)}setOtherHelpersVisible(t,e){var n,o,s,r;t?((s=this.controllers.moveController)==null||s.helperObject3D.show(),(r=this.controllers.rotateController)==null||r.helperObject3D.show()):(e!==this.controllers.moveController&&((n=this.controllers.moveController)==null||n.helperObject3D.hide()),e!==this.controllers.rotateController&&((o=this.controllers.rotateController)==null||o.helperObject3D.hide()))}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable(),n.restoreOpacity()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide(),n.restoreOpacity()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose(),n==null||n.restoreOpacity()});for(const n in this.controllers){if(!n)continue;const o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&HA()}}class NA extends Ao{constructor(...e){super(...e);m(this,"startInfo");m(this,"lastRotation");m(this,"rotations",[]);m(this,"helperObject3DQuaternion",this.originObject3D.quaternion.clone());const n=this.helperObject3D;this.hoverListener([n.xyCircle,n.xzCircle,n.yzCircle]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)}initialHelperQuaternion(){this.helperObject3D.updateAngleHelperQuaternion(),this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();this.helperObject3D.updateAngleHelperQuaternion();const s=n.point,r=this.originObject3D.position.clone(),a=this.getAngleHelper(o);this.setTipsAngle(0);const l=s.clone();l.y+=.2,this.setTipsPosition(l);const c=new x.Vector3(1,0,0).applyQuaternion(this.helperObject3DQuaternion),d=new x.Vector3(0,1,0).applyQuaternion(this.helperObject3DQuaternion),f=new x.Vector3(0,0,1).applyQuaternion(this.helperObject3DQuaternion),u=(()=>{switch(o){case"x":return c;case"y":return d;case"z":return f}})(),h=new x.Plane().setFromNormalAndCoplanarPoint(u,s),p=new x.Vector3;h.projectPoint(s.clone(),p);const A=p.clone().sub(r),g=A.clone(),v=A.angleTo(a.baseAxes);this.setAngleHelperStart(o,v),this.setAngleHelperLength(o,0),this.rotations.push({vector:A.clone(),direction:!0}),this.startInfo={direction:o,startVector:A,staticStartVector:g,plane:h,angleHelper:a},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0,console.log(`%c RotateController dragStart ${o}`,"color: #e5af2e")}dragging(e){var o;if(!this.isDragging)return;const n=go(this.camera,e,this.container);return n?(console.log(`%c RotateController dragging ${(o=this.startInfo)==null?void 0:o.direction}`,"color: #49de1b"),this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,staticStartVector:r,direction:a}=this.startInfo,l=this.originObject3D,c=e.ray.intersectPlane(o,new x.Vector3);if(!c)return;const d=l.position.clone(),f=new x.Vector3;o.projectPoint(c.clone(),f);const u=f.clone().sub(d);if(n.angleTo(u)===0||(this.lastRotation===void 0&&(this.lastRotation={angle:0}),this.rotations.length===0))return;const h=(()=>{if(this.rotations.length===1)return u.angleTo(s.baseAxes)>r.angleTo(s.baseAxes);{const A=this.rotations[this.rotations.length-1],g=this.rotations[this.rotations.length-2],v=u.angleTo(g.vector),w=u.angleTo(A.vector),y=A.vector.angleTo(g.vector);if(y===0||w===0||v===0)return;if(v>w&&v>y)return A.direction;if(v<y&&w<y||v<w&&w>y)return!A.direction}})();if(h===void 0)return console.warn("rotationDirection is undefined");this.rotations.push({vector:u,direction:h}),this.rotations=this.rotations.slice(-2),this.lastRotation.angle=this.lastRotation.angle+u.angleTo(n)*(h?1:-1),this.setAngleHelperLength(a,this.lastRotation.angle),this.setTipsAngle(this.lastRotation.angle/Math.PI*180);const p=new x.Quaternion().setFromUnitVectors(n.clone().normalize(),u.clone().normalize());l.applyQuaternion(p),this.helperObject3D.applyHelperQuaternion(p),this.helperObject3DQuaternion.premultiply(p),this.hooks.emit("rotateUpdate",{quaternion:p,origin:d}),this.startInfo.startVector=u}dragEnd(){!this.isDragging||(console.log("%c RotateController dragEnd","color: #e94e4e"),this.startInfo=void 0,this.isDragging=!1,this.lastRotation=void 0,this.rotations=[],this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){switch(e){case"x":return this.helperObject3D.xAngleHelper;case"y":return this.helperObject3D.yAngleHelper;case"z":return this.helperObject3D.zAngleHelper}}setAngleHelperStart(e,n){const o=this.getAngleHelper(e);if(o instanceof x.Mesh&&o.geometry instanceof x.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new x.CircleGeometry(s,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const s=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof x.Mesh&&r.geometry instanceof x.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new x.CircleGeometry(a,c,l,s)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var o;const n=(o=this.helperObject3D.angleTips)==null?void 0:o.element;!n||(n.innerText=`${e.toFixed(0)}\xB0`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const o=e.project(this.camera),{x:s,y:r,z:a}=o;if(a>1)return;const l=(s+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class WA extends Ao{constructor(...e){super(...e);m(this,"startInfo")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}getDragPlane(){const e=new x.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new H.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var s,r;(r=(s=this.helperObject3D).updatePoints)==null||r.call(s);const o=this.getDragPlane();if(!o)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:o},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0,console.log("%c RectangleScaleController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging)return;const n=go(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n),console.log("%c RectangleScaleController dragging","color: #49de1b")}scale(e){var B,N;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:o,plane:s}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(s,new H.Vector3);if(!a||LA(a,this.camera.position))return;const l=new H.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:d}=o,f=new H.Vector3().subVectors(r[1],r[0]),u=new H.Vector3().subVectors(r[3],r[0]),h=F=>{const X=new H.Vector3(0,0,0);if(!this.startInfo)return X;const j=(F==="ew"?f:u).clone(),P=c.clone().projectOnVector(j),R=a.clone().projectOnVector(j),O=l.clone().projectOnVector(j);if(R.equals(P))return X;if(F==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const _=new H.Vector3().subVectors(R,O),J=_.x<0&&j.x>=0,de=_.y<0&&j.y>=0,ue=_.z<0&&j.z>=0;this.startInfo.dragPointInCenterBottom=J||de||ue}if(F==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const _=new H.Vector3().subVectors(R,O),J=_.x<0&&j.x>=0,de=_.y<0&&j.y>=0,ue=_.z<0&&j.z>=0;this.startInfo.dragPointInCenterLeft=J||de||ue}const W=new H.Vector3().subVectors(R,P),U=W.length();return U>.3?(console.warn("offset.length() > 0.3, skipped",U),X):W},p=h("ew"),A=h("ns"),g=()=>{const F=p;this.helperObject3D.cornerPositions.forEach((X,j)=>{var P;(P=this.startInfo)!=null&&P.dragPointInCenterLeft?(j===0||j===3)&&X.add(F):(j===1||j===2)&&X.add(F)})},v=()=>{const F=A;this.helperObject3D.cornerPositions.forEach((X,j)=>{var P;(P=this.startInfo)!=null&&P.dragPointInCenterBottom?(j===0||j===1)&&X.add(F):(j===2||j===3)&&X.add(F)})};switch(d){case"ew":g();break;case"ns":v();break;case"nesw":case"nwse":g(),v()}const w=new H.Vector3().subVectors(r[1],r[0]).length()/f.length(),y=new H.Vector3().subVectors(r[3],r[0]).length()/u.length(),E=new H.Vector3(w,y,1),I=new x.Matrix4().scale(E);n.isCSS3DObjectPlus?n.applyScaleMatrix4(I):n.scale.applyMatrix4(I),o.position.copy(a);const C=new H.Vector3().addVectors(r[0],r[2]).divideScalar(2),L=new H.Vector3().subVectors(C,l),D=new x.Matrix4().setPosition(L);n.applyMatrix4(D),(B=this.helperObject3D.css3DInstance)==null||B.css3DObject.applyMatrix4(D),(N=this.helperObject3D.plane)==null||N.applyMatrix4(D),this.hooks.emit("scaleUpdate",{matrix4:I,helperOrigin:l}),this.hooks.emit("positionUpdate",{matrix4:D}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render(),console.log("%c RectangleScaleController dragEnd","color: #e94e4e"))}}class _A extends WA{constructor(...t){super(...t),this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(t=>{if(!t)return;const e=t.point,n=r=>this.dragStart(r,t),o=this.dragging.bind(this),s=this.dragEnd.bind(this);e.addEventListener("dragstart",n),e.addEventListener("drag",o),e.addEventListener("dragend",s)})}}const bo="v1.0.0",Ui="Object3DHelperPlugin",pi=`${Ui}@${bo}`,XA=()=>{console.error(`${pi} is disposed`)},YA=()=>{console.warn(`${pi} is disabled`)},UA=()=>{console.error(`${pi} is disabled`)};class bl extends li{constructor(e){super(e);m(this,"version",bo);m(this,"name",Ui);m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"objectHelperMap",new Map);m(this,"css3DObjectParentMap",new Map);m(this,"css3DRender");this.five=e,this.css3DRender=new Jt(this.five.scene),console.warn("Object3DHelper: \u4F7F\u7528\u6B64\u63D2\u4EF6\u9700\u8981\u5728\u521D\u59CB\u5316five\u65F6\uFF0C\u8BBE\u7F6Efive\u53C2\u6570: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${Ui.toUpperCase()}_DEBUG__`]:this})}show(e){return Y(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Y(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){if(this.state.disposed)return XA();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return UA();const o=G({},this.state);this.state=G(G({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var d;if(!e)return console.error("Object3D is undefined");if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const o=new GA;this.objectHelperMap.set(e,o);const s=(d=this.five.getElement())==null?void 0:d.parentElement,r=this.five.camera,{moveHelper:a=!0,rotateHelper:l=!0,scaleHelper:c=!0}=n;if(a){const f=new SA(e),u=new zi(this.five,jA,e,f);o.addControllers({moveController:u.helperController})}if(l){let f;s&&r&&(f={container:s});const u=new zA(e,f),h=new zi(this.five,NA,e,u);o.addControllers({rotateController:h.helperController})}if(c&&s){const f=new VA(e,s,r,this.five.scene),u=new zi(this.five,_A,e,f);o.addControllers({scaleController:u.helperController})}e.isCSS3DObjectPlus&&ia(this.five).then(()=>{var f,u;if(e.isCSS3DObjectPlus){const h=e,p=(f=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?f:oa(this.five);p&&e&&(this.css3DObjectParentMap.set(h,h.parent),h.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(p),(u=this.css3DRender.getBehindCSS3DObjectGroup())==null||u.add(h),this.css3DRender.render(this.five.camera))}})}removeObject3DHelper(e){const n=this.objectHelperMap.get(e);if(!!n){if(e.isCSS3DObjectPlus){const o=e,s=this.css3DObjectParentMap.get(o);s==null||s.add(o),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose()}}handleEnable(e,n=!0){e?(this.everyHelperDo(o=>o.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(o=>o.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(o=>o.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(o=>o.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.everyHelperDo(e=>e.dispose())}everyHelperDo(e){this.objectHelperMap.forEach(n=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&YA()}}const JA=i=>new bl(i);exports.CSS3DRender=Jt;exports.CSS3DRenderPlugin=en;exports.CameraMovementEffect=Sa;exports.CameraMovementPlugin=cf;exports.ContentType=gl;exports.CruisePlugin=Ym;exports.CruisePluginController=uo;exports.DIRECTION=Yt;exports.DISPLAY_STRATEGY_TYPE=Tt;exports.DimensionType=Al;exports.FLOOR_PLAN_ATTACHED_TO=gt;exports.FLOOR_TYPE_MAP=Zu;exports.GuideLinePlugin=Za;exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=Mt;exports.ItemLabelPlugin=vm;exports.Magnifier=Ba;exports.MapviewFloorplanPlugin=Du;exports.ModelChassisCompassPlugin=$u;exports.ModelEntryDoorGuidePlugin=nf;exports.ModelFloorplanPlugin=Eu;exports.ModelItemLabelPlugin=Kh;exports.ModelRoomLabelPlugin=jc;exports.ModelTVVideoPlugin=tm;exports.ModelViewPlugin=Xl;exports.Object3DHelperController=bl;exports.Object3DHelperPlugin=JA;exports.PLUGIN=pi;exports.PaintBrush=_l;exports.PaintBrushTypeEnum=et;exports.PanoCompassPlugin=Sf;exports.PanoCursorRaycasterPlugin=dc;exports.PanoDoorLabelPlugin=Tm;exports.PanoFloorplanRadarPlugin=Uu;exports.PanoMeasurePlugin=kh;exports.PanoMeasurePluginLine=Ft;exports.PanoMeasurePluginModel=fi;exports.PanoMeasurePluginPoint=_e;exports.PanoMeasurePluginPolyline=ui;exports.PanoRulerPlugin=mf;exports.PanoRulerProPlugin=If;exports.PanoSpatialTagPlugin=Fh;exports.PanoTagPlugin=CA;exports.PanoTagPluginController=pl;exports.PointType=vl;exports.ROOM_FETILE_TYPE_MAP=Ju;exports.ROOM_TYPE_MAP=qu;exports.Rotation=Ue;exports.TopviewFloorplanPlugin=Su;exports.Util=Fg;exports.VERSION=bo;exports.itemLabelPluginServerParams=bm;exports.modelItemLabelPluginServerParams=$h;exports.modelRoomLabelPluginServerParams=Qc;exports.pluginFlag=wA;
|