@realsee/dnalogel 2.21.0-dev.4 → 2.21.0-dev.6
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/index.cjs.js +4 -4
- package/dist/index.js +10 -10
- package/dist/index.umd.js +4 -4
- package/docs/classes/CSS3DRender.html +30 -30
- package/docs/classes/CruisePluginController.html +25 -25
- package/docs/classes/GuideLineItem.GuideLineItem.html +19 -19
- package/docs/classes/GuideLineModeItem.GuideLineModeItem.html +34 -34
- package/docs/classes/Magnifier.html +19 -19
- package/docs/classes/ModelRoomLabelController.html +10 -10
- package/docs/classes/Object3DHelperController.html +24 -24
- package/docs/classes/PaintBrush.html +14 -14
- package/docs/classes/PanoMeasurePluginLine.html +24 -24
- package/docs/classes/PanoMeasurePluginModel.html +25 -25
- package/docs/classes/PanoMeasurePluginPoint.html +13 -13
- package/docs/classes/PanoMeasurePluginPolyline.html +26 -26
- package/docs/classes/PanoTagPluginController.html +46 -46
- package/docs/classes/Util.BetterTween.html +8 -8
- package/docs/classes/Util.Interval.html +11 -11
- package/docs/classes/Util.Magnifier.html +17 -17
- package/docs/classes/Util.PointDomHelper.html +10 -10
- package/docs/classes/Util.PointHelper.html +10 -10
- package/docs/classes/Util.PointSelectorHelper.html +16 -16
- package/docs/classes/Util.Rectangle.html +12 -12
- package/docs/enums/CameraMovementEffect.html +6 -6
- package/docs/enums/ContentType.html +19 -19
- package/docs/enums/DIRECTION.html +8 -8
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +8 -8
- package/docs/enums/DimensionType.html +6 -6
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +7 -7
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +8 -8
- package/docs/enums/PaintBrushTypeEnum.html +7 -7
- package/docs/enums/PointType.html +6 -6
- package/docs/enums/Rotation.html +7 -7
- package/docs/functions/CSS3DRenderPlugin.html +3 -3
- package/docs/functions/CameraMovementPlugin.html +3 -3
- package/docs/functions/CruisePlugin.html +3 -3
- package/docs/functions/GuideLinePlugin.html +4 -4
- package/docs/functions/ItemLabelPlugin.html +3 -3
- package/docs/functions/MapviewFloorplanPlugin.html +3 -3
- package/docs/functions/ModelChassisCompassPlugin.html +3 -3
- package/docs/functions/ModelEntryDoorGuidePlugin.html +3 -3
- package/docs/functions/ModelFloorplanPlugin.html +3 -3
- package/docs/functions/ModelItemLabelPlugin.html +3 -3
- package/docs/functions/ModelRoomLabelPlugin.html +3 -3
- package/docs/functions/ModelTVVideoPlugin.html +3 -3
- package/docs/functions/ModelViewPlugin.html +3 -3
- package/docs/functions/Object3DHelperPlugin.html +3 -3
- package/docs/functions/PanoCompassPlugin.html +3 -3
- package/docs/functions/PanoCursorRaycasterPlugin.html +3 -3
- package/docs/functions/PanoDoorLabelPlugin.html +3 -3
- package/docs/functions/PanoFloorplanRadarPlugin.html +3 -3
- package/docs/functions/PanoMeasurePlugin.html +3 -3
- package/docs/functions/PanoRulerPlugin.html +3 -3
- package/docs/functions/PanoRulerProPlugin.html +3 -3
- package/docs/functions/PanoSpatialTagPlugin.html +3 -3
- package/docs/functions/PanoTagPlugin.html +3 -3
- package/docs/functions/PanoVideoPlugin.html +3 -3
- package/docs/functions/TopviewFloorplanPlugin.html +3 -3
- package/docs/functions/Util.getCoordsFromClient.html +4 -4
- package/docs/functions/Util.getCoordsFromElement.html +4 -4
- package/docs/functions/Util.getFrameTime.html +4 -4
- package/docs/functions/Util.getIntersectFromRelativePosition.html +4 -4
- package/docs/functions/Util.getRaycasterFromFivePointer.html +4 -4
- package/docs/functions/Util.isAbsoluteURL.html +4 -4
- package/docs/functions/Util.isModelLike.html +4 -4
- package/docs/functions/Util.isNil.html +4 -4
- package/docs/functions/Util.isPanoramaLike.html +4 -4
- package/docs/functions/Util.nextFrame.html +4 -4
- package/docs/functions/Util.notNil.html +4 -4
- package/docs/functions/Util.requestAnimationFrameInterval.html +4 -4
- package/docs/functions/Util.tweenProgress.html +4 -4
- package/docs/functions/Util.uuid.html +4 -4
- package/docs/functions/pluginFlag.html +4 -4
- package/docs/index.html +4 -4
- package/docs/interfaces/AddTagConfig.html +5 -5
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +10 -10
- package/docs/interfaces/CSS3DRenderPluginState.html +7 -7
- package/docs/interfaces/CameraMovementPluginExportType.html +6 -6
- package/docs/interfaces/CruisePluginTypes.Config.html +7 -7
- package/docs/interfaces/CruisePluginTypes.CruiseKeyframe.html +11 -11
- package/docs/interfaces/CruisePluginTypes.EventMap.html +19 -19
- package/docs/interfaces/CruisePluginTypes.MoveAction.html +11 -11
- package/docs/interfaces/CruisePluginTypes.MoveWithKeyframesAction.html +13 -13
- package/docs/interfaces/CruisePluginTypes.MoveWithPanoIndexAction.html +13 -13
- package/docs/interfaces/CruisePluginTypes.PluginData.html +8 -8
- package/docs/interfaces/CruisePluginTypes.PluginServerData.html +6 -6
- package/docs/interfaces/CruisePluginTypes.PluginState.html +10 -10
- package/docs/interfaces/EventMap.html +14 -14
- package/docs/interfaces/FloorplanBounding.html +7 -7
- package/docs/interfaces/FloorplanData.html +9 -9
- package/docs/interfaces/FloorplanEntrance.html +10 -10
- package/docs/interfaces/FloorplanExtraObject.html +9 -9
- package/docs/interfaces/FloorplanExtraObject3D.html +7 -7
- package/docs/interfaces/FloorplanFloorData.html +8 -8
- package/docs/interfaces/FloorplanImagePosition.html +6 -6
- package/docs/interfaces/FloorplanObserver.html +8 -8
- package/docs/interfaces/FloorplanOutlineItem.html +8 -8
- package/docs/interfaces/FloorplanPosition.html +6 -6
- package/docs/interfaces/FloorplanRoomItem.html +12 -12
- package/docs/interfaces/FloorplanRoomLabelItem.html +6 -6
- package/docs/interfaces/FloorplanServerBounding.html +7 -7
- package/docs/interfaces/FloorplanServerComputedData.html +9 -9
- package/docs/interfaces/FloorplanServerData.html +6 -6
- package/docs/interfaces/FloorplanServerDoorItem.html +9 -9
- package/docs/interfaces/FloorplanServerDoorPosition.html +7 -7
- package/docs/interfaces/FloorplanServerEntrance.html +10 -10
- package/docs/interfaces/FloorplanServerFloorData.html +8 -8
- package/docs/interfaces/FloorplanServerImagePosition.html +6 -6
- package/docs/interfaces/FloorplanServerObserver.html +8 -8
- package/docs/interfaces/FloorplanServerOutlineItem.html +8 -8
- package/docs/interfaces/FloorplanServerPosition.html +6 -6
- package/docs/interfaces/FloorplanServerRoomItem.html +13 -13
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +6 -6
- package/docs/interfaces/GuideLineModeItem.GuideLineTagContainer.html +7 -7
- package/docs/interfaces/GuideLinePluginType.CatmullRomCurve3.html +9 -9
- package/docs/interfaces/GuideLinePluginType.EventMap.html +12 -12
- package/docs/interfaces/GuideLinePluginType.GuideLineGeometryStyle.html +7 -7
- package/docs/interfaces/GuideLinePluginType.GuideLineItemContainer.html +5 -5
- package/docs/interfaces/GuideLinePluginType.GuideLineMaterialStyle.html +12 -12
- package/docs/interfaces/GuideLinePluginType.LineGeometriesConfig.html +7 -7
- package/docs/interfaces/GuideLinePluginType.ModelGuideLineStyle.html +17 -17
- package/docs/interfaces/GuideLinePluginType.ModelGuideLineTagData.html +6 -6
- package/docs/interfaces/GuideLinePluginType.PanoramaGuideLineStyle.html +17 -17
- package/docs/interfaces/GuideLinePluginType.PluginDataV2.html +4 -4
- package/docs/interfaces/GuideLinePluginType.PluginServerData.html +6 -6
- package/docs/interfaces/GuideLinePluginType.PluginState.html +7 -7
- package/docs/interfaces/GuideLinePluginType.Route.html +10 -10
- package/docs/interfaces/GuideLinePluginType.RouteConfig.html +8 -8
- package/docs/interfaces/HelperOffset.html +7 -7
- package/docs/interfaces/ImagePlaneGroup.html +5 -5
- package/docs/interfaces/ItemLabelPluginData.html +5 -5
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +10 -10
- package/docs/interfaces/ItemLabelPluginParametersType.html +8 -8
- package/docs/interfaces/MinMax.html +6 -6
- package/docs/interfaces/ModelChassisCompassPluginData.html +6 -6
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +6 -6
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +7 -7
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +7 -7
- package/docs/interfaces/ModelItemLabelPluginData.html +5 -5
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +10 -10
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +6 -6
- package/docs/interfaces/ModelRoomLabelPluginData.html +5 -5
- package/docs/interfaces/ModelTVVideoPluginData.html +8 -8
- package/docs/interfaces/ModelTVVideoPluginExportType.html +7 -7
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +5 -5
- package/docs/interfaces/ModelViewPluginExportType.html +10 -10
- package/docs/interfaces/Object3DHelperState.html +7 -7
- package/docs/interfaces/ObjectHelperControllers.html +8 -8
- package/docs/interfaces/PaintBrushAction.html +11 -11
- package/docs/interfaces/PaintBrushConfigs.html +11 -11
- package/docs/interfaces/PaintBrushState.html +9 -9
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +9 -9
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +4 -4
- package/docs/interfaces/PanoMeasureParameterType.html +14 -14
- package/docs/interfaces/PanoMeasurePluginLineJson.html +7 -7
- package/docs/interfaces/PanoMeasurePluginOpenParameter.html +6 -6
- package/docs/interfaces/PanoMeasurePluginPointJson.html +6 -6
- package/docs/interfaces/PanoMeasurePluginPolylineJson.html +7 -7
- package/docs/interfaces/PanoRulerPluginExportType.html +9 -9
- package/docs/interfaces/PanoRulerPluginOptions.html +6 -6
- package/docs/interfaces/PanoRulerPluginParameterType.html +7 -7
- package/docs/interfaces/PanoRulerProPluginExportType.html +8 -8
- package/docs/interfaces/PanoRulerProPluginOptions.html +6 -6
- package/docs/interfaces/PanoRulerProPluginParameterType.html +6 -6
- package/docs/interfaces/PanoRulerProPluginState.html +7 -7
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +4 -4
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +4 -4
- package/docs/interfaces/PanoSpatialTagPluginData.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +9 -9
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +12 -12
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +9 -9
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +12 -12
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +9 -9
- package/docs/interfaces/PanoVideoPluginType.LoadParams.html +5 -5
- package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +7 -7
- package/docs/interfaces/PanoVideoPluginType.PluginData.html +5 -5
- package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +8 -8
- package/docs/interfaces/PanoVideoPluginType.PluginState.html +5 -5
- package/docs/interfaces/PanoVideoPluginType.VideoItem.html +7 -7
- package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +9 -9
- package/docs/interfaces/Point.html +7 -7
- package/docs/interfaces/Room.html +8 -8
- package/docs/interfaces/RoomInfo.html +6 -6
- package/docs/interfaces/RoomLabel.html +13 -13
- package/docs/interfaces/RoomRules.html +4 -4
- package/docs/interfaces/Rooms.html +4 -4
- package/docs/interfaces/Scissor.html +8 -8
- package/docs/interfaces/State.html +7 -7
- package/docs/interfaces/TagCacheInterface.html +11 -11
- package/docs/interfaces/TagConfig.html +12 -12
- package/docs/interfaces/TagGLTFObjectGroup.html +5 -5
- package/docs/interfaces/TagIconUrl.html +11 -11
- package/docs/interfaces/TagObjectGroup.html +5 -5
- package/docs/interfaces/TagStyle.html +5 -5
- package/docs/interfaces/Tags.html +8 -8
- package/docs/interfaces/TemporaryState.html +5 -5
- package/docs/interfaces/Util.MagnifierParameter.html +10 -10
- package/docs/interfaces/Util.MouseGroupParameter.html +7 -7
- package/docs/interfaces/Util.PointIntersection.html +7 -7
- package/docs/modules/CruisePluginTypes.html +4 -4
- package/docs/modules/GuideLineItem.html +4 -4
- package/docs/modules/GuideLineModeItem.html +4 -4
- package/docs/modules/GuideLinePluginType.html +4 -4
- package/docs/modules/PanoVideoPluginType.html +4 -4
- package/docs/modules/Util.html +4 -4
- package/docs/modules.html +4 -4
- package/docs/types/ArrayPosition.html +4 -4
- package/docs/types/AudioAppearance.html +4 -4
- package/docs/types/AudioTagTypeConfigKey.html +4 -4
- package/docs/types/CSS3DRenderExportType.html +4 -4
- package/docs/types/CSS3DRenderPluginExportType.html +4 -4
- package/docs/types/CSS3DRenderPluginParameterType.html +4 -4
- package/docs/types/ClassFunctionParameters.html +4 -4
- package/docs/types/Color.html +4 -4
- package/docs/types/ContentTypeConfigKey.html +4 -4
- package/docs/types/ContentTypeConfigKeySplit.html +4 -4
- package/docs/types/ContentTypeMap.html +4 -4
- package/docs/types/Create3DDomContainerReturnType.html +4 -4
- package/docs/types/Create3DElementReturnType.html +4 -4
- package/docs/types/CruisePluginExportType.html +4 -4
- package/docs/types/CruisePluginTypes.CruiseData.html +4 -4
- package/docs/types/CruisePluginTypes.MoveEffect.html +4 -4
- package/docs/types/DeprecatedMediaPlaneProperty.html +4 -4
- package/docs/types/DeprecatedTagProperty.html +4 -4
- package/docs/types/Direction-1.html +4 -4
- package/docs/types/Direction4.html +4 -4
- package/docs/types/ElementRenderer.html +4 -4
- package/docs/types/FloorplanRuleLabels.html +4 -4
- package/docs/types/FloorplanServerRuleLabels.html +4 -4
- package/docs/types/GuideLinePluginExportType.html +4 -4
- package/docs/types/GuideLinePluginType.GuideLineItem.html +4 -4
- package/docs/types/GuideLinePluginType.GuideLineItemEventMap.html +4 -4
- package/docs/types/GuideLinePluginType.GuideLineModeItemMode.html +4 -4
- package/docs/types/GuideLinePluginType.GuideLineStyle.html +4 -4
- package/docs/types/GuideLinePluginType.ModelGuideLineTag.html +4 -4
- package/docs/types/GuideLinePluginType.PathItem.html +4 -4
- package/docs/types/GuideLinePluginType.PluginData.html +4 -4
- package/docs/types/HelperEventMap.html +4 -4
- package/docs/types/LoadTagConfig.html +4 -4
- package/docs/types/MapviewFloorplanPluginParameterType.html +4 -4
- package/docs/types/MapviewFloorplanPluginReturnType.html +4 -4
- package/docs/types/MediaData.html +4 -4
- package/docs/types/MediaStore.html +4 -4
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +4 -4
- package/docs/types/ModelFloorplanPluginParameterType.html +4 -4
- package/docs/types/ModelFloorplanPluginReturnType.html +4 -4
- package/docs/types/ModelRoomLabelPluginParameters.html +4 -4
- package/docs/types/ModelRoomLabelPluginReturnType.html +4 -4
- package/docs/types/MoveArgs.html +4 -4
- package/docs/types/MoveOpts.html +4 -4
- package/docs/types/Object3DHelperEventMap.html +4 -4
- package/docs/types/ObjectFit.html +4 -4
- package/docs/types/PaintBrushEventMap.html +4 -4
- package/docs/types/PanoCompassPluginData.html +4 -4
- package/docs/types/PanoCompassPluginExportType.html +4 -4
- package/docs/types/PanoCompassPluginParameterType.html +4 -4
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +4 -4
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +4 -4
- package/docs/types/PanoIndex.html +4 -4
- package/docs/types/PanoMeasurePluginEvent.html +4 -4
- package/docs/types/PanoMeasureReturnType.html +4 -4
- package/docs/types/PanoSpatialTagPluginId.html +4 -4
- package/docs/types/PanoTagPluginExportInterface.html +4 -4
- package/docs/types/PanoTagPluginParamsInterface.html +4 -4
- package/docs/types/PanoVideoPluginParameterType.html +4 -4
- package/docs/types/PanoVideoPluginReturnType.html +4 -4
- package/docs/types/PartialObjectDeep.html +4 -4
- package/docs/types/PickTagContentTypeInContentTypeConfigKey.html +4 -4
- package/docs/types/PlaneTag.html +4 -4
- package/docs/types/Point2DTag.html +4 -4
- package/docs/types/Point3DTag.html +4 -4
- package/docs/types/PointTag.html +4 -4
- package/docs/types/PointTagInstance.html +4 -4
- package/docs/types/Position.html +4 -4
- package/docs/types/RotateArgs.html +4 -4
- package/docs/types/RotateOpts.html +4 -4
- package/docs/types/RuleLabelsKey.html +4 -4
- package/docs/types/RuleLabelsValue.html +4 -4
- package/docs/types/StickType.html +4 -4
- package/docs/types/Tag.html +4 -4
- package/docs/types/Tag2D.html +4 -4
- package/docs/types/Tag3D.html +4 -4
- package/docs/types/TagContentType.html +4 -4
- package/docs/types/TagDimensionType.html +4 -4
- package/docs/types/TagElement.html +4 -4
- package/docs/types/TagEvents.html +4 -4
- package/docs/types/TagGLTFObject.html +4 -4
- package/docs/types/TagHooks.html +4 -4
- package/docs/types/TagId.html +4 -4
- package/docs/types/TagInstance.html +4 -4
- package/docs/types/TagPointType.html +4 -4
- package/docs/types/TagRendererMap.html +4 -4
- package/docs/types/TopviewFloorplanPluginParameterType.html +4 -4
- package/docs/types/TopviewFloorplanPluginReturnType.html +4 -4
- package/docs/types/WorkCode.html +4 -4
- package/docs/variables/FLOOR_TYPE_MAP.html +4 -4
- package/docs/variables/PLUGIN.html +4 -4
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +4 -4
- package/docs/variables/ROOM_TYPE_MAP.html +4 -4
- package/docs/variables/itemLabelPluginServerParams.html +4 -4
- package/docs/variables/modelItemLabelPluginServerParams.html +4 -4
- package/docs/variables/modelRoomLabelPluginServerParams.html +4 -4
- package/libs/GuideLinePlugin/Components/Tag.js +60 -60
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +2 -2
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(te,ve){typeof exports=="object"&&typeof module!="undefined"?ve(exports,require("@realsee/five"),require("three"),require("three/examples/jsm/renderers/CSS3DRenderer"),require("hammerjs"),require("@realsee/five/line"),require("three/examples/jsm/loaders/FBXLoader"),require("earcut"),require("animejs"),require("@realsee/five/gltf-loader")):typeof define=="function"&&define.amd?define(["exports","@realsee/five","three","three/examples/jsm/renderers/CSS3DRenderer","hammerjs","@realsee/five/line","three/examples/jsm/loaders/FBXLoader","earcut","animejs","@realsee/five/gltf-loader"],ve):(te=typeof globalThis!="undefined"?globalThis:te||self,ve(te.dnalogel={},te.FiveSDK,te.THREE,te.CSS3DRenderer,te.Hammer,te.Line,te.FBXLoader,te.earcut,te.anime,te.GLTFLoader))})(this,function(te,ve,_,Bn,en,ds,hs,Ii,zt,Ei){"use strict";var iI=Object.defineProperty,sI=Object.defineProperties;var oI=Object.getOwnPropertyDescriptors;var Wu=Object.getOwnPropertySymbols;var rI=Object.prototype.hasOwnProperty,aI=Object.prototype.propertyIsEnumerable;var Ga=(te,ve,_)=>ve in te?iI(te,ve,{enumerable:!0,configurable:!0,writable:!0,value:_}):te[ve]=_,F=(te,ve)=>{for(var _ in ve||(ve={}))rI.call(ve,_)&&Ga(te,_,ve[_]);if(Wu)for(var _ of Wu(ve))aI.call(ve,_)&&Ga(te,_,ve[_]);return te},we=(te,ve)=>sI(te,oI(ve));var f=(te,ve,_)=>(Ga(te,typeof ve!="symbol"?ve+"":ve,_),_);var Y=(te,ve,_)=>new Promise((Bn,en)=>{var ds=zt=>{try{Ii(_.next(zt))}catch(Ei){en(Ei)}},hs=zt=>{try{Ii(_.throw(zt))}catch(Ei){en(Ei)}},Ii=zt=>zt.done?Bn(zt.value):Promise.resolve(zt.value).then(ds,hs);Ii((_=_.apply(te,ve)).next())});function Nu(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const E=Nu(_);function Yu(){console.debug("%c %c@realsee/dnalogel %cv2.21.0-dev.4",["background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')","background-repeat: no-repeat","background-position: 0 center","padding-left: 8px"].join(";"),"","background-color: #12ce9b;color:black;padding:0 6px;border-radius: 3px")}function Xu(){const i=typeof OffscreenCanvas!="undefined",t=i&&new OffscreenCanvas(1,1).getContext("webgl")!==null;i&&!t&&Object.assign(window,{OffscreenCanvas:function(e,n){const s=document.createElement("canvas");return s.width=e,s.height=n,s}})}function Fa(){}const Ha=()=>Promise.resolve(),Wa={__queue:Promise.resolve()};function Uu(i=Ha){Wa.__queue=Wa.__queue.then(i).catch(Ha)}function us(i,t,e){const n=i.x,s=i.y,o=Math.floor(n/t*1e4)/1e4,r=Math.floor(s/e*1e4)/1e4;return{x:o,y:r}}function jo(i,t,e){const{x:n,y:s}=i,o=n*t,r=s*e;return{x:o,y:r}}function fs(i){if(i.length<2)return{};const t=i.slice(-2),e=t[0],n={x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2};return{control:e,end:n}}function qu(i,t,e=Fa){new Promise(n=>{setTimeout(()=>{e(),n(!0)},t*i)})}const Ju=window,Na=window.requestAnimationFrame||Ju.webkitRequestAnimationFrame||(i=>setTimeout(i,16));function ms(i,t=0){t<=0?Na(i):Na(()=>ms(i,t-1))}var Et=Object.freeze({Linear:Object.freeze({None:function(i){return i},In:function(i){return this.None(i)},Out:function(i){return this.None(i)},InOut:function(i){return this.None(i)}}),Quadratic:Object.freeze({In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}}),Cubic:Object.freeze({In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}}),Quartic:Object.freeze({In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}}),Quintic:Object.freeze({In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}}),Sinusoidal:Object.freeze({In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}}),Exponential:Object.freeze({In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}}),Circular:Object.freeze({In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}}),Elastic:Object.freeze({In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(i){var t=1.70158;return i===1?1:i*i*((t+1)*i-t)},Out:function(i){var t=1.70158;return i===0?0:--i*i*((t+1)*i+t)+1},InOut:function(i){var t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}}),Bounce:Object.freeze({In:function(i){return 1-Et.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?Et.Bounce.In(i*2)*.5:Et.Bounce.Out(i*2-1)*.5+.5}}),generatePow:function(i){return i===void 0&&(i=4),i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return Math.pow(t,i)},Out:function(t){return 1-Math.pow(1-t,i)},InOut:function(t){return t<.5?Math.pow(t*2,i)/2:(1-Math.pow(2-t*2,i))/2+.5}}}}),_n=function(){return performance.now()},Ya=function(){function i(){this._tweens={},this._tweensAddedDuringUpdate={}}return i.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},i.prototype.removeAll=function(){this._tweens={}},i.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},i.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},i.prototype.update=function(t,e){t===void 0&&(t=_n()),e===void 0&&(e=!1);var n=Object.keys(this._tweens);if(n.length===0)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var s=0;s<n.length;s++){var o=this._tweens[n[s]],r=!e;o&&o.update(t,r)===!1&&!e&&delete this._tweens[n[s]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},i}(),bn={Linear:function(i,t){var e=i.length-1,n=e*t,s=Math.floor(n),o=bn.Utils.Linear;return t<0?o(i[0],i[1],n):t>1?o(i[e],i[e-1],e-n):o(i[s],i[s+1>e?e:s+1],n-s)},Bezier:function(i,t){for(var e=0,n=i.length-1,s=Math.pow,o=bn.Utils.Bernstein,r=0;r<=n;r++)e+=s(1-t,n-r)*s(t,r)*i[r]*o(n,r);return e},CatmullRom:function(i,t){var e=i.length-1,n=e*t,s=Math.floor(n),o=bn.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(s=Math.floor(n=e*(1+t))),o(i[(s-1+e)%e],i[s],i[(s+1)%e],i[(s+2)%e],n-s)):t<0?i[0]-(o(i[0],i[0],i[1],i[1],-n)-i[0]):t>1?i[e]-(o(i[e],i[e],i[e-1],i[e-1],n-e)-i[e]):o(i[s?s-1:0],i[s],i[e<s+1?e:s+1],i[e<s+2?e:s+2],n-s)},Utils:{Linear:function(i,t,e){return(t-i)*e+i},Bernstein:function(i,t){var e=bn.Utils.Factorial;return e(i)/e(t)/e(i-t)},Factorial:function(){var i=[1];return function(t){var e=1;if(i[t])return i[t];for(var n=t;n>1;n--)e*=n;return i[t]=e,e}}(),CatmullRom:function(i,t,e,n,s){var o=(e-i)*.5,r=(n-t)*.5,a=s*s,l=s*a;return(2*t-2*e+o+r)*l+(-3*t+3*e-2*o-r)*a+o*s+t}}},Vo=function(){function i(){}return i.nextId=function(){return i._nextId++},i._nextId=0,i}(),Oo=new Ya,ps=function(){function i(t,e){e===void 0&&(e=Oo),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Et.Linear.None,this._interpolationFunction=bn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Vo.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return i.prototype.getId=function(){return this._id},i.prototype.isPlaying=function(){return this._isPlaying},i.prototype.isPaused=function(){return this._isPaused},i.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e,this},i.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t,this},i.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},i.prototype.start=function(t,e){if(t===void 0&&(t=_n()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var s={};for(var o in this._valuesEnd)s[o]=this._valuesEnd[o];this._valuesEnd=s}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},i.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},i.prototype._setupProperties=function(t,e,n,s,o){for(var r in n){var a=t[r],l=Array.isArray(a),c=l?"array":typeof a,d=!l&&Array.isArray(n[r]);if(!(c==="undefined"||c==="function")){if(d){var h=n[r];if(h.length===0)continue;for(var u=[a],m=0,g=h.length;m<g;m+=1){var v=this._handleRelativeValue(a,h[m]);if(isNaN(v)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}u.push(v)}d&&(n[r]=u)}if((c==="object"||l)&&a&&!d){e[r]=l?[]:{};var p=a;for(var b in p)e[r][b]=p[b];s[r]=l?[]:{};var h=n[r];if(!this._isDynamic){var w={};for(var b in h)w[b]=h[b];n[r]=h=w}this._setupProperties(p,e[r],h,s[r],o)}else(typeof e[r]=="undefined"||o)&&(e[r]=a),l||(e[r]*=1),d?s[r]=n[r].slice().reverse():s[r]=e[r]||0}}},i.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},i.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},i.prototype.pause=function(t){return t===void 0&&(t=_n()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},i.prototype.resume=function(t){return t===void 0&&(t=_n()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},i.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},i.prototype.group=function(t){return t===void 0&&(t=Oo),this._group=t,this},i.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},i.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},i.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},i.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},i.prototype.easing=function(t){return t===void 0&&(t=Et.Linear.None),this._easingFunction=t,this},i.prototype.interpolation=function(t){return t===void 0&&(t=bn.Linear),this._interpolationFunction=t,this},i.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},i.prototype.onStart=function(t){return this._onStartCallback=t,this},i.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},i.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},i.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},i.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},i.prototype.onStop=function(t){return this._onStopCallback=t,this},i.prototype.update=function(t,e){if(t===void 0&&(t=_n()),e===void 0&&(e=!0),this._isPaused)return!0;var n,s,o=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>o)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),s=(t-this._startTime)/this._duration,s=this._duration===0||s>1?1:s;var r=this._easingFunction(s);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,r),this._onUpdateCallback&&this._onUpdateCallback(this._object,s),s===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,l=this._chainedTweens.length;a<l;a++)this._chainedTweens[a].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},i.prototype._updateProperties=function(t,e,n,s){for(var o in n)if(e[o]!==void 0){var r=e[o]||0,a=n[o],l=Array.isArray(t[o]),c=Array.isArray(a),d=!l&&c;d?t[o]=this._interpolationFunction(a,s):typeof a=="object"&&a?this._updateProperties(t[o],r,a,s):(a=this._handleRelativeValue(r,a),typeof a=="number"&&(t[o]=r+(a-r)*s))}},i.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},i.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},i}(),Zu="20.0.3",Ku=Vo.nextId,jt=Oo,$u=jt.getAll.bind(jt),ef=jt.removeAll.bind(jt),tf=jt.add.bind(jt),Xa=jt.remove.bind(jt),nf=jt.update.bind(jt),Ua={Easing:Et,Group:Ya,Interpolation:bn,now:_n,Sequence:Vo,nextId:Ku,Tween:ps,VERSION:Zu,getAll:$u,removeAll:ef,add:tf,remove:Xa,update:nf};function sf(i,t,e,n=Et.Linear.None){const s=new ps(i).to(t,e).easing(n).start();function o(r){s.update(r)&&requestAnimationFrame(o)}return requestAnimationFrame(o),s}var Wt=(i=>(i.Drawline="Drawline",i.Undo="Undo",i.Exit="Exit",i))(Wt||{});const ki=Symbol("$$PAINT_BRUSH_EVENT$$");function gs(i){return i[ki]||(i[ki]={}),i[ki]}function of(i){i[ki]||delete i[ki]}let rf=class{hasListener(t){const e=gs(this);return e&&e[t]&&e[t].length>0}on(t,e,n){const s=gs(this);return s[t]||(s[t]=[]),s[t].push([e,n||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){of(this);return}const n=gs(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let s=0;for(;s<n[t].length&&n[t][s][0]!==e;s++);s<n[t].length&&n[t].splice(s,1)}emit(t,...e){let n=!1;const o=gs(this)[t]||[];for(let r of o.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}};function tn(){return((1+Math.random())*65536|0).toString(16).substring(1)}function tt(){return(tn()+tn()+"-"+tn()+"-4"+tn().substr(0,3)+"-"+tn()+"-"+tn()+tn()+tn()).toLowerCase()}const af=`
|
|
1
|
+
(function(te,ve){typeof exports=="object"&&typeof module!="undefined"?ve(exports,require("@realsee/five"),require("three"),require("three/examples/jsm/renderers/CSS3DRenderer"),require("hammerjs"),require("@realsee/five/line"),require("three/examples/jsm/loaders/FBXLoader"),require("earcut"),require("animejs"),require("@realsee/five/gltf-loader")):typeof define=="function"&&define.amd?define(["exports","@realsee/five","three","three/examples/jsm/renderers/CSS3DRenderer","hammerjs","@realsee/five/line","three/examples/jsm/loaders/FBXLoader","earcut","animejs","@realsee/five/gltf-loader"],ve):(te=typeof globalThis!="undefined"?globalThis:te||self,ve(te.dnalogel={},te.FiveSDK,te.THREE,te.CSS3DRenderer,te.Hammer,te.Line,te.FBXLoader,te.earcut,te.anime,te.GLTFLoader))})(this,function(te,ve,_,Bn,en,ds,hs,Ii,zt,Ei){"use strict";var iI=Object.defineProperty,sI=Object.defineProperties;var oI=Object.getOwnPropertyDescriptors;var Wu=Object.getOwnPropertySymbols;var rI=Object.prototype.hasOwnProperty,aI=Object.prototype.propertyIsEnumerable;var Ga=(te,ve,_)=>ve in te?iI(te,ve,{enumerable:!0,configurable:!0,writable:!0,value:_}):te[ve]=_,F=(te,ve)=>{for(var _ in ve||(ve={}))rI.call(ve,_)&&Ga(te,_,ve[_]);if(Wu)for(var _ of Wu(ve))aI.call(ve,_)&&Ga(te,_,ve[_]);return te},we=(te,ve)=>sI(te,oI(ve));var f=(te,ve,_)=>(Ga(te,typeof ve!="symbol"?ve+"":ve,_),_);var Y=(te,ve,_)=>new Promise((Bn,en)=>{var ds=zt=>{try{Ii(_.next(zt))}catch(Ei){en(Ei)}},hs=zt=>{try{Ii(_.throw(zt))}catch(Ei){en(Ei)}},Ii=zt=>zt.done?Bn(zt.value):Promise.resolve(zt.value).then(ds,hs);Ii((_=_.apply(te,ve)).next())});function Nu(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const E=Nu(_);function Yu(){console.debug("%c %c@realsee/dnalogel %cv2.21.0-dev.6",["background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')","background-repeat: no-repeat","background-position: 0 center","padding-left: 8px"].join(";"),"","background-color: #12ce9b;color:black;padding:0 6px;border-radius: 3px")}function Xu(){const i=typeof OffscreenCanvas!="undefined",t=i&&new OffscreenCanvas(1,1).getContext("webgl")!==null;i&&!t&&Object.assign(window,{OffscreenCanvas:function(e,n){const s=document.createElement("canvas");return s.width=e,s.height=n,s}})}function Fa(){}const Ha=()=>Promise.resolve(),Wa={__queue:Promise.resolve()};function Uu(i=Ha){Wa.__queue=Wa.__queue.then(i).catch(Ha)}function us(i,t,e){const n=i.x,s=i.y,o=Math.floor(n/t*1e4)/1e4,r=Math.floor(s/e*1e4)/1e4;return{x:o,y:r}}function jo(i,t,e){const{x:n,y:s}=i,o=n*t,r=s*e;return{x:o,y:r}}function fs(i){if(i.length<2)return{};const t=i.slice(-2),e=t[0],n={x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2};return{control:e,end:n}}function qu(i,t,e=Fa){new Promise(n=>{setTimeout(()=>{e(),n(!0)},t*i)})}const Ju=window,Na=window.requestAnimationFrame||Ju.webkitRequestAnimationFrame||(i=>setTimeout(i,16));function ms(i,t=0){t<=0?Na(i):Na(()=>ms(i,t-1))}var Et=Object.freeze({Linear:Object.freeze({None:function(i){return i},In:function(i){return this.None(i)},Out:function(i){return this.None(i)},InOut:function(i){return this.None(i)}}),Quadratic:Object.freeze({In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}}),Cubic:Object.freeze({In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}}),Quartic:Object.freeze({In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}}),Quintic:Object.freeze({In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}}),Sinusoidal:Object.freeze({In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}}),Exponential:Object.freeze({In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}}),Circular:Object.freeze({In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}}),Elastic:Object.freeze({In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(i){var t=1.70158;return i===1?1:i*i*((t+1)*i-t)},Out:function(i){var t=1.70158;return i===0?0:--i*i*((t+1)*i+t)+1},InOut:function(i){var t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}}),Bounce:Object.freeze({In:function(i){return 1-Et.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?Et.Bounce.In(i*2)*.5:Et.Bounce.Out(i*2-1)*.5+.5}}),generatePow:function(i){return i===void 0&&(i=4),i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return Math.pow(t,i)},Out:function(t){return 1-Math.pow(1-t,i)},InOut:function(t){return t<.5?Math.pow(t*2,i)/2:(1-Math.pow(2-t*2,i))/2+.5}}}}),_n=function(){return performance.now()},Ya=function(){function i(){this._tweens={},this._tweensAddedDuringUpdate={}}return i.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},i.prototype.removeAll=function(){this._tweens={}},i.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},i.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},i.prototype.update=function(t,e){t===void 0&&(t=_n()),e===void 0&&(e=!1);var n=Object.keys(this._tweens);if(n.length===0)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var s=0;s<n.length;s++){var o=this._tweens[n[s]],r=!e;o&&o.update(t,r)===!1&&!e&&delete this._tweens[n[s]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},i}(),bn={Linear:function(i,t){var e=i.length-1,n=e*t,s=Math.floor(n),o=bn.Utils.Linear;return t<0?o(i[0],i[1],n):t>1?o(i[e],i[e-1],e-n):o(i[s],i[s+1>e?e:s+1],n-s)},Bezier:function(i,t){for(var e=0,n=i.length-1,s=Math.pow,o=bn.Utils.Bernstein,r=0;r<=n;r++)e+=s(1-t,n-r)*s(t,r)*i[r]*o(n,r);return e},CatmullRom:function(i,t){var e=i.length-1,n=e*t,s=Math.floor(n),o=bn.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(s=Math.floor(n=e*(1+t))),o(i[(s-1+e)%e],i[s],i[(s+1)%e],i[(s+2)%e],n-s)):t<0?i[0]-(o(i[0],i[0],i[1],i[1],-n)-i[0]):t>1?i[e]-(o(i[e],i[e],i[e-1],i[e-1],n-e)-i[e]):o(i[s?s-1:0],i[s],i[e<s+1?e:s+1],i[e<s+2?e:s+2],n-s)},Utils:{Linear:function(i,t,e){return(t-i)*e+i},Bernstein:function(i,t){var e=bn.Utils.Factorial;return e(i)/e(t)/e(i-t)},Factorial:function(){var i=[1];return function(t){var e=1;if(i[t])return i[t];for(var n=t;n>1;n--)e*=n;return i[t]=e,e}}(),CatmullRom:function(i,t,e,n,s){var o=(e-i)*.5,r=(n-t)*.5,a=s*s,l=s*a;return(2*t-2*e+o+r)*l+(-3*t+3*e-2*o-r)*a+o*s+t}}},Vo=function(){function i(){}return i.nextId=function(){return i._nextId++},i._nextId=0,i}(),Oo=new Ya,ps=function(){function i(t,e){e===void 0&&(e=Oo),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Et.Linear.None,this._interpolationFunction=bn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Vo.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return i.prototype.getId=function(){return this._id},i.prototype.isPlaying=function(){return this._isPlaying},i.prototype.isPaused=function(){return this._isPaused},i.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e,this},i.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t,this},i.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},i.prototype.start=function(t,e){if(t===void 0&&(t=_n()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var s={};for(var o in this._valuesEnd)s[o]=this._valuesEnd[o];this._valuesEnd=s}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},i.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},i.prototype._setupProperties=function(t,e,n,s,o){for(var r in n){var a=t[r],l=Array.isArray(a),c=l?"array":typeof a,d=!l&&Array.isArray(n[r]);if(!(c==="undefined"||c==="function")){if(d){var h=n[r];if(h.length===0)continue;for(var u=[a],m=0,g=h.length;m<g;m+=1){var v=this._handleRelativeValue(a,h[m]);if(isNaN(v)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}u.push(v)}d&&(n[r]=u)}if((c==="object"||l)&&a&&!d){e[r]=l?[]:{};var p=a;for(var b in p)e[r][b]=p[b];s[r]=l?[]:{};var h=n[r];if(!this._isDynamic){var w={};for(var b in h)w[b]=h[b];n[r]=h=w}this._setupProperties(p,e[r],h,s[r],o)}else(typeof e[r]=="undefined"||o)&&(e[r]=a),l||(e[r]*=1),d?s[r]=n[r].slice().reverse():s[r]=e[r]||0}}},i.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},i.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},i.prototype.pause=function(t){return t===void 0&&(t=_n()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},i.prototype.resume=function(t){return t===void 0&&(t=_n()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},i.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},i.prototype.group=function(t){return t===void 0&&(t=Oo),this._group=t,this},i.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},i.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},i.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},i.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},i.prototype.easing=function(t){return t===void 0&&(t=Et.Linear.None),this._easingFunction=t,this},i.prototype.interpolation=function(t){return t===void 0&&(t=bn.Linear),this._interpolationFunction=t,this},i.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},i.prototype.onStart=function(t){return this._onStartCallback=t,this},i.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},i.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},i.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},i.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},i.prototype.onStop=function(t){return this._onStopCallback=t,this},i.prototype.update=function(t,e){if(t===void 0&&(t=_n()),e===void 0&&(e=!0),this._isPaused)return!0;var n,s,o=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>o)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),s=(t-this._startTime)/this._duration,s=this._duration===0||s>1?1:s;var r=this._easingFunction(s);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,r),this._onUpdateCallback&&this._onUpdateCallback(this._object,s),s===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,l=this._chainedTweens.length;a<l;a++)this._chainedTweens[a].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},i.prototype._updateProperties=function(t,e,n,s){for(var o in n)if(e[o]!==void 0){var r=e[o]||0,a=n[o],l=Array.isArray(t[o]),c=Array.isArray(a),d=!l&&c;d?t[o]=this._interpolationFunction(a,s):typeof a=="object"&&a?this._updateProperties(t[o],r,a,s):(a=this._handleRelativeValue(r,a),typeof a=="number"&&(t[o]=r+(a-r)*s))}},i.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},i.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},i}(),Zu="20.0.3",Ku=Vo.nextId,jt=Oo,$u=jt.getAll.bind(jt),ef=jt.removeAll.bind(jt),tf=jt.add.bind(jt),Xa=jt.remove.bind(jt),nf=jt.update.bind(jt),Ua={Easing:Et,Group:Ya,Interpolation:bn,now:_n,Sequence:Vo,nextId:Ku,Tween:ps,VERSION:Zu,getAll:$u,removeAll:ef,add:tf,remove:Xa,update:nf};function sf(i,t,e,n=Et.Linear.None){const s=new ps(i).to(t,e).easing(n).start();function o(r){s.update(r)&&requestAnimationFrame(o)}return requestAnimationFrame(o),s}var Wt=(i=>(i.Drawline="Drawline",i.Undo="Undo",i.Exit="Exit",i))(Wt||{});const ki=Symbol("$$PAINT_BRUSH_EVENT$$");function gs(i){return i[ki]||(i[ki]={}),i[ki]}function of(i){i[ki]||delete i[ki]}let rf=class{hasListener(t){const e=gs(this);return e&&e[t]&&e[t].length>0}on(t,e,n){const s=gs(this);return s[t]||(s[t]=[]),s[t].push([e,n||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){of(this);return}const n=gs(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let s=0;for(;s<n[t].length&&n[t][s][0]!==e;s++);s<n[t].length&&n[t].splice(s,1)}emit(t,...e){let n=!1;const o=gs(this)[t]||[];for(let r of o.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}};function tn(){return((1+Math.random())*65536|0).toString(16).substring(1)}function tt(){return(tn()+tn()+"-"+tn()+"-4"+tn().substr(0,3)+"-"+tn()+"-"+tn()+tn()+tn()).toLowerCase()}const af=`
|
|
2
2
|
<style type="text/css">
|
|
3
3
|
|
|
4
4
|
#_gl_paintBrush {
|
|
@@ -191,7 +191,7 @@ void main() {
|
|
|
191
191
|
svg [type='lineItemGroup'] g g g g {
|
|
192
192
|
stroke: #ffffff;
|
|
193
193
|
}</style>
|
|
194
|
-
`;return i.$$set=o=>{"content"in o&&e(0,n=o.content)},[n,s]}class op extends ce{constructor(t){super(),le(this,t,sp,ip,ae,{content:0},np)}}function rp(i){he(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function ap(i){let t,e;return t=new tp({props:{url:i[1].url}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.url=n[1].url),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function lp(i){let t,e;return t=new op({props:{content:i[0]}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.content=n[0]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function cp(i){let t,e,n,s;const o=[lp,ap],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=o[e](i)),{c(){t=S("div"),n&&n.c(),y(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){O(l,t,c),~e&&r[e].m(t,null),s=!0},p(l,[c]){let d=e;e=a(l),e===d?~e&&r[e].p(l,c):(n&&(ue(),z(r[d],1,1,()=>{r[d]=null}),fe()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=o[e](l),n.c()),x(n,1),n.m(t,null)):n=null)},i(l){s||(x(n),s=!0)},o(l){z(n),s=!1},d(l){l&&V(t),~e&&r[e].d()}}}function dp(i,t,e){let n,s,{floorIndex:o}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,o=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[o]),i.$$.dirty&12&&e(0,s=(l=(a=r.outlines)==null?void 0:a[o])==null?void 0:l.svgContent)},[s,n,o,r]}class Gl extends ce{constructor(t){super(),le(this,t,dp,cp,ae,{floorIndex:2,floorplanData:3},rp)}}function hp(i){he(i,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-12pzct5{opacity:0.45}")}function up(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new xs(!1),n=ke(),t.a=n},m(s,o){t.m(e,s,o),O(s,n,o)},p(s,o){o&256&&e!==(e=s[8].outerHTML+"")&&t.p(e)},d(s){s&&V(n),s&&t.d()}}}function fp(i){let t,e,n=i[1]&&Fl(i),s=i[0]&&Hl(i);return{c(){n&&n.c(),t=ee(),s&&s.c(),e=ke()},m(o,r){n&&n.m(o,r),O(o,t,r),s&&s.m(o,r),O(o,e,r)},p(o,r){o[1]?n?n.p(o,r):(n=Fl(o),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),o[0]?s?s.p(o,r):(s=Hl(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null)},d(o){n&&n.d(o),o&&V(t),s&&s.d(o),o&&V(e)}}}function Fl(i){let t,e=i[2].name+"",n;return{c(){t=S("span"),n=Te(e),y(t,"class","floorplan-plugin__room-name")},m(s,o){O(s,t,o),D(t,n)},p(s,o){o&4&&e!==(e=s[2].name+"")&&Oe(n,e)},d(s){s&&V(t)}}}function Hl(i){let t,e;return{c(){t=S("span"),e=Te(i[7]),y(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,s){O(n,t,s),D(t,e)},p(n,s){s&128&&Oe(e,n[7])},d(n){n&&V(t)}}}function mp(i){let t,e,n;function s(a,l){if(a[3]===void 0)return fp;if(a[8])return up}let o=s(i),r=o&&o(i);return{c(){t=S("div"),r&&r.c(),y(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),j(t,"left",i[9]),j(t,"top",i[10]),j(t,"font-size",i[11]),j(t,"opacity",i[6]?"1":"0")},m(a,l){O(a,t,l),r&&r.m(t,null),e||(n=[Nt(ei.call(null,t)),ye(t,"clientWidth",i[19]),ye(t,"clientHeight",i[20])],e=!0)},p(a,[l]){o===(o=s(a))&&r?r.p(a,l):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null))),l&64&&j(t,"opacity",a[6]?"1":"0")},i:J,o:J,d(a){a&&V(t),r&&r.d(),e=!1,Ze(n)}}}function pp(i,t){const e=i[0],n=i[1];let s=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){const a=t[o][0],l=t[o][1],c=t[r][0],d=t[r][1];l>n!=d>n&&e<(c-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function gp(i,t,e){let n,s,o,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:d}=t,{room:h}=t,{hoveredRoom:u}=t,{getRoomAreaText:m}=t,{getLabelElement:g}=t,{adaptiveRoomLabelVisibleEnable:v}=t;function p(R,H){if(H.width===0||H.height===0)return()=>!1;const Q=R.path.map(({x:Ie,y:Ae})=>[Ie,Ae]),W=R.roomLabel.position,{x:q,y:U}=W,{width:K,height:de}=H,oe=K/2,Pe=de/2;return function(Ae){const Be=q*Ae,be=U*Ae,Ne=Q.map(([Ce,ze])=>[Ce*Ae,ze*Ae]);return[[Be+oe,be-Pe],[Be-oe,be-Pe],[Be-oe,be+Pe],[Be+oe,be+Pe]].every(Ce=>pp(Ce,Ne))}}const b=document.body.clientWidth,w=document.body.clientHeight,P=h.roomLabel,k=P.positionInImage.x*100+"%",T=P.positionInImage.y*100+"%",I=(b<500||w<500?10:14)+"px";let B=0,L=0,X=!1;u.subscribe(function(H){e(16,X=!!H&&H.id===h.id)});const Z=R=>{e(4,B=R.detail)},G=R=>{e(5,L=R.detail)};return i.$$set=R=>{"pxmm"in R&&e(12,l=R.pxmm),"roomAreaEnable"in R&&e(0,c=R.roomAreaEnable),"roomNameEnable"in R&&e(1,d=R.roomNameEnable),"room"in R&&e(2,h=R.room),"hoveredRoom"in R&&e(13,u=R.hoveredRoom),"getRoomAreaText"in R&&e(14,m=R.getRoomAreaText),"getLabelElement"in R&&e(3,g=R.getLabelElement),"adaptiveRoomLabelVisibleEnable"in R&&e(15,v=R.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=g==null?void 0:g(h)),i.$$.dirty&16388&&e(7,s=h.size?m(h.size):""),i.$$.dirty&48&&e(18,o={width:B,height:L}),i.$$.dirty&262148&&e(17,r=o?p(h,o):void 0),i.$$.dirty&233472&&e(6,a=v?X?!0:!!(r!=null&&r(l)):!0)},[c,d,h,g,B,L,a,s,n,k,T,I,l,u,m,v,X,r,o,Z,G]}class vp extends ce{constructor(t){super(),le(this,t,gp,mp,ae,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},hp)}}function Ap(i){he(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function Wl(i,t,e){const n=i.slice();return n[12]=t[e],n}function Nl(i){let t,e=[],n=new Map,s,o,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let d=Wl(i,a,c),h=l(d);n.set(h,e[c]=Yl(h,d))}return{c(){t=S("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,d){O(c,t,d);for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(t,null);s=!0,o||(r=[Nt(ei.call(null,t)),ye(t,"clientWidth",i[11])],o=!0)},p(c,d){d&447&&(a=c[8],ue(),e=St(e,d,l,1,c,a,n,t,dn,Yl,null,Wl),fe())},i(c){if(!s){for(let d=0;d<a.length;d+=1)x(e[d]);s=!0}},o(c){for(let d=0;d<e.length;d+=1)z(e[d]);s=!1},d(c){c&&V(t);for(let d=0;d<e.length;d+=1)e[d].d();o=!1,Ze(r)}}}function Yl(i,t){let e,n,s;const o=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<o.length;a+=1)r=Je(r,o[a]);return n=new vp({props:r}),{key:i,first:null,c(){e=ke(),se(n.$$.fragment),this.first=e},m(a,l){O(a,e,l),ne(n,a,l),s=!0},p(a,l){t=a;const c=l&447?it(o,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){s||(x(n.$$.fragment,a),s=!0)},o(a){z(n.$$.fragment,a),s=!1},d(a){a&&V(e),ie(n,a)}}}function bp(i){let t,e,n=i[8]&&Nl(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[8]?n?(n.p(s,o),o&256&&x(n,1)):(n=Nl(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function yp(i,t,e){let n,{floorIndex:s}=t,{roomAreaEnable:o}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:d}=t,{adaptiveRoomLabelVisibleEnable:h}=t,u=0,m=0;const g=v=>{e(6,u=v.detail)};return i.$$set=v=>{"floorIndex"in v&&e(9,s=v.floorIndex),"roomAreaEnable"in v&&e(0,o=v.roomAreaEnable),"roomNameEnable"in v&&e(1,r=v.roomNameEnable),"floorplanData"in v&&e(10,a=v.floorplanData),"hoveredRoom"in v&&e(2,l=v.hoveredRoom),"getRoomAreaText"in v&&e(3,c=v.getRoomAreaText),"getLabelElement"in v&&e(4,d=v.getLabelElement),"adaptiveRoomLabelVisibleEnable"in v&&e(5,h=v.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[s].rooms),i.$$.dirty&1088){const{max:v,min:p}=a.bounding,b=v.x-p.x;e(7,m=u/b)}},[o,r,l,c,d,h,u,m,n,s,a,g]}class wp extends ce{constructor(t){super(),le(this,t,yp,bp,ae,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Ap)}}function Cp(i){he(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function Xl(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function Ul(i,t,e){const n=i.slice();return n[14]=t[e],n}function ql(i){let t;return{c(){t=S("div"),y(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),j(t,"left",i[14].left*100+"%"),j(t,"bottom",i[14].bottom*100+"%")},m(e,n){O(e,t,n)},p:J,d(e){e&&V(t)}}}function Jl(i,t){let e,n,s=t[1](t[11].distance)+"",o,r;return{key:i,first:null,c(){e=S("div"),n=S("div"),o=Te(s),r=ee(),y(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),$(n,"is-row",t[2]),y(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),j(e,"left",t[11].left*100+"%"),j(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){O(a,e,l),D(e,n),D(n,o),D(e,r)},p(a,l){t=a,l&2&&s!==(s=t[1](t[11].distance)+"")&&Oe(o,s)},d(a){a&&V(e)}}}function Pp(i){let t,e,n,s,o,r,a=[],l=new Map,c,d=i[3],h=[];for(let g=0;g<d.length;g+=1)h[g]=ql(Ul(i,d,g));let u=i[4];const m=g=>g[13];for(let g=0;g<u.length;g+=1){let v=Xl(i,u,g),p=m(v);l.set(p,a[g]=Jl(p,v))}return{c(){t=S("div"),e=S("div"),n=ee(),s=S("div");for(let g=0;g<h.length;g+=1)h[g].c();o=ee(),r=S("div");for(let g=0;g<a.length;g+=1)a[g].c();y(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),y(s,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),$(s,"is-row",i[2]),y(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),y(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),$(t,"is-row",i[2]),j(t,"width",i[2]?"100%":1/16+"rem"),j(t,"height",i[2]?1/16+"rem":"100%")},m(g,v){O(g,t,v),D(t,e),D(t,n),D(t,s);for(let p=0;p<h.length;p+=1)h[p]&&h[p].m(s,null);D(t,o),D(t,r);for(let p=0;p<a.length;p+=1)a[p]&&a[p].m(r,null)},p(g,[v]){if(v&8){d=g[3];let p;for(p=0;p<d.length;p+=1){const b=Ul(g,d,p);h[p]?h[p].p(b,v):(h[p]=ql(b),h[p].c(),h[p].m(s,null))}for(;p<h.length;p+=1)h[p].d(1);h.length=d.length}v&22&&(u=g[4],a=St(a,v,m,1,g,u,l,r,tr,Jl,null,Xl)),v&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&y(t,"class",c),v&5&&$(t,"is-row",g[2])},i:J,o:J,d(g){g&&V(t),Mt(h,g);for(let v=0;v<a.length;v+=1)a[v].d()}}}const si=1e3,oi=180;function Ip(i,t,e){let{type:n}=t,{data:s}=t,{bounding:o}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=o.max.x-o.min.x-(si-oi)*2,c=o.max.y-o.min.y-(si-oi)*2,d=s.map(([g,v])=>a?[g.x,v.x]:[g.y,v.y]).flat().sort().filter((g,v,p)=>v===0?!0:g!==p[v-1]),h=d.map(g=>{const v=a?(g-o.min.x-si+oi)/l:0,p=a?0:(g-o.min.y-si+oi)/c;return{left:v,bottom:p}});h.unshift({left:0,bottom:0}),h.push(a?{left:1,bottom:0}:{left:0,bottom:1});const u=d[d.length-1]-d[0],m=d.map((g,v,p)=>{const b=v===0?0:g-p[v-1],w=v===0?0:(g+p[v-1])/2,P=a?(w-o.min.x-si+oi)/l:0,k=a?0:(w-o.min.y-si+oi)/c;return{left:P,bottom:k,distance:b}}).filter(({distance:g})=>g/u>.1);return i.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,s=g.data),"bounding"in g&&e(6,o=g.bounding),"getRuleDistanceText"in g&&e(1,r=g.getRuleDistanceText)},[n,r,a,h,m,s,o]}class Ep extends ce{constructor(t){super(),le(this,t,Ip,Pp,ae,{type:0,data:5,bounding:6,getRuleDistanceText:1},Cp)}}function kp(i){he(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Zl(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Kl(i,t){let e,n,s;const o=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<o.length;a+=1)r=Je(r,o[a]);return n=new Ep({props:r}),{key:i,first:null,c(){e=ke(),se(n.$$.fragment),this.first=e},m(a,l){O(a,e,l),ne(n,a,l),s=!0},p(a,l){t=a;const c=l&19?it(o,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){s||(x(n.$$.fragment,a),s=!0)},o(a){z(n.$$.fragment,a),s=!1},d(a){a&&V(e),ie(n,a)}}}function xp(i){let t,e=[],n=new Map,s,o=i[4];const r=a=>a[13];for(let a=0;a<o.length;a+=1){let l=Zl(i,o,a),c=r(l);n.set(c,e[a]=Kl(c,l))}return{c(){t=S("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),j(t,"width",i[3]),j(t,"height",i[2])},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(a,[l]){l&19&&(o=a[4],ue(),e=St(e,l,r,1,a,o,n,t,dn,Kl,null,Zl),fe()),l&8&&j(t,"width",a[3]),l&4&&j(t,"height",a[2])},i(a){if(!s){for(let l=0;l<o.length;l+=1)x(e[l]);s=!0}},o(a){for(let l=0;l<e.length;l+=1)z(e[l]);s=!1},d(a){a&&V(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const $l=1e3,ec=180;function Mp(i,t,e){let n,s,o,r,a,l,c,d,h,u,{floorIndex:m}=t,{floorplanData:g}=t,{getRuleDistanceText:v}=t;return i.$$set=p=>{"floorIndex"in p&&e(5,m=p.floorIndex),"floorplanData"in p&&e(6,g=p.floorplanData),"getRuleDistanceText"in p&&e(0,v=p.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=g.bounding),i.$$.dirty&96&&e(11,s=g.floorDatas[m].rules),i.$$.dirty&2048&&e(12,o=Object.keys(s)),i.$$.dirty&6144&&e(4,r=o.map(p=>[p,s[p]])),i.$$.dirty&2&&e(9,a=n.max.x-n.min.x),i.$$.dirty&2&&e(7,l=n.max.y-n.min.y),i.$$.dirty&2&&e(10,c=n.max.x-n.min.x-($l-ec)*2),i.$$.dirty&2&&e(8,d=n.max.y-n.min.y-($l-ec)*2),i.$$.dirty&1536&&e(3,h=c/a*100+"%"),i.$$.dirty&384&&e(2,u=d/l*100+"%")},[v,n,u,h,r,m,g,l,d,a,c,s,o]}class Sp extends ce{constructor(t){super(),le(this,t,Mp,xp,ae,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},kp)}}function Rs(i,t={}){let e="";const{needZ:n,needA:s}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,d=l+","+c;return a===0?(e+="M"+d,e):s!=null&&s[a]?(e+="A"+s[a]+","+d,e):(e+="L"+d,e)}),e+(n?"Z":"")}function tc({x:i,y:t},e){const{max:n,min:s}=e;return{x:i-s.x,y:n.y-t}}function Dp(i,t){const e=i.x*1e3+t.bounding.origin.x,n=-i.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function Lp(i,t){const e=t.bounding,n=e.max.x-e.min.x,s=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/s}}function Tp(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function zp(i){let t;return{c(){t=je("path"),y(t,"d",i[0]),y(t,"fill","#2F313A")},m(e,n){O(e,t,n)},p(e,[n]){n&1&&y(t,"d",e[0])},i:J,o:J,d(e){e&&V(t)}}}function jp(i,t,e){let n,{path:s}=t;return i.$$set=o=>{"path"in o&&e(1,s=o.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Rs(s,{needZ:!0}))},[n,s]}class Vp extends ce{constructor(t){super(),le(this,t,jp,zp,ae,{path:1})}}function Op(i){let t,e,n,s,o,r;return{c(){t=je("defs"),e=je("pattern"),n=je("rect"),s=je("path"),o=ee(),r=je("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width",i[1]),y(n,"height",i[1]),y(n,"fill","#323747"),y(s,"d",i[2]),y(s,"stroke","#ffffff"),y(s,"stroke-opacity","0.06"),y(s,"stroke-width","0.5"),y(s,"fill","none"),y(e,"id","fpm-room-pattern-0"),y(e,"x","0"),y(e,"y","0"),y(e,"width",i[1]),y(e,"height",i[1]),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(r,"d",i[0]),y(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){O(a,t,l),D(t,e),D(e,n),D(e,s),O(a,o,l),O(a,r,l)},p(a,[l]){l&1&&y(r,"d",a[0])},i:J,o:J,d(a){a&&V(t),a&&V(o),a&&V(r)}}}const rr=6;function Bp(i,t,e){let n,{path:s}=t;const o=rr*2,r=`M0 ${rr} h ${o} M${rr} 0 v ${o}`;return i.$$set=a=>{"path"in a&&e(3,s=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=Rs(s,{needZ:!0}))},[n,o,r,s]}class _p extends ce{constructor(t){super(),le(this,t,Bp,Op,ae,{path:3})}}function Qp(i){let t,e,n,s,o,r,a,l,c,d,h;return{c(){t=je("defs"),e=je("pattern"),n=je("rect"),s=je("pattern"),o=je("rect"),r=ee(),a=je("path"),l=ee(),c=je("path"),d=ee(),h=je("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width","6"),y(n,"height","50"),y(n,"fill","none"),y(n,"stroke","#4B4B57"),y(n,"stroke-width","0.5"),y(e,"id","room-material-pattern-1"),y(e,"x","0"),y(e,"y","0"),y(e,"width","12"),y(e,"height","50"),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(o,"x","0"),y(o,"y","0"),y(o,"width","6"),y(o,"height","50"),y(o,"fill","none"),y(o,"stroke","#4B4B57"),y(o,"stroke-width","0.5"),y(s,"id","room-material-pattern-2"),y(s,"x","6"),y(s,"y","25"),y(s,"width","12"),y(s,"height","50"),y(s,"patternUnits","userSpaceOnUse"),y(s,"patternTransform","scale(50 50)"),y(a,"d",i[0]),y(a,"fill","#43434D"),y(c,"d",i[0]),y(c,"fill","url(#room-material-pattern-1)"),y(h,"d",i[0]),y(h,"fill","url(#room-material-pattern-2)")},m(u,m){O(u,t,m),D(t,e),D(e,n),D(t,s),D(s,o),O(u,r,m),O(u,a,m),O(u,l,m),O(u,c,m),O(u,d,m),O(u,h,m)},p(u,[m]){m&1&&y(a,"d",u[0]),m&1&&y(c,"d",u[0]),m&1&&y(h,"d",u[0])},i:J,o:J,d(u){u&&V(t),u&&V(r),u&&V(a),u&&V(l),u&&V(c),u&&V(d),u&&V(h)}}}function Rp(i,t,e){let n,{path:s}=t;return i.$$set=o=>{"path"in o&&e(1,s=o.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Rs(s,{needZ:!0}))},[n,s]}class Gp extends ce{constructor(t){super(),le(this,t,Rp,Qp,ae,{path:1})}}function Fp(i){he(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function nc(i,t,e){const n=i.slice();return n[5]=t[e],n}function Hp(i){let t,e;return t=new _p({props:{path:i[5].path}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.path=n[5].path),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function Wp(i){let t,e;return t=new Gp({props:{path:i[5].path}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.path=n[5].path),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function Np(i){let t,e;return t=new Vp({props:{path:i[5].path}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.path=n[5].path),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function ic(i){let t,e,n,s;const o=[Np,Wp,Hp],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=o[e](i),{c(){t=je("svg"),n.c(),y(t,"width","100%"),y(t,"height","100%"),y(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),y(t,"class","svelte-1dykexu")},m(l,c){O(l,t,c),r[e].m(t,null),s=!0},p(l,c){let d=e;e=a(l),e===d?r[e].p(l,c):(ue(),z(r[d],1,1,()=>{r[d]=null}),fe(),n=r[e],n?n.p(l,c):(n=r[e]=o[e](l),n.c()),x(n,1),n.m(t,null))},i(l){s||(x(n),s=!0)},o(l){z(n),s=!1},d(l){l&&V(t),r[e].d()}}}function Yp(i){let t,e,n=i[0],s=[];for(let r=0;r<n.length;r+=1)s[r]=ic(nc(i,n,r));const o=r=>z(s[r],1,1,()=>{s[r]=null});return{c(){t=S("div");for(let r=0;r<s.length;r+=1)s[r].c();y(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){O(r,t,a);for(let l=0;l<s.length;l+=1)s[l]&&s[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=nc(r,n,l);s[l]?(s[l].p(c,a),x(s[l],1)):(s[l]=ic(c),s[l].c(),x(s[l],1),s[l].m(t,null))}for(ue(),l=n.length;l<s.length;l+=1)o(l);fe()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)x(s[a]);e=!0}},o(r){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)z(s[a]);e=!1},d(r){r&&V(t),Mt(s,r)}}}function Xp(i,t,e){let n,{floorIndex:s}=t,{floorplanData:o}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,s=l.floorIndex),"floorplanData"in l&&e(4,o=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=o.floorDatas[s].rooms.map(l=>we(F({},l),{path:l.path.map(c=>tc(c,o.bounding))})))},[n,r,a,s,o]}class Up extends ce{constructor(t){super(),le(this,t,Xp,Yp,ae,{floorIndex:3,floorplanData:4},Fp)}}function qp(i){he(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function Jp(i){let t,e,n,s;return{c(){t=je("path"),y(t,"d",i[5]),y(t,"fill","#fff"),y(t,"style",i[2]),y(t,"id",e=`${i[1]}_${i[0].id}`),y(t,"class","svelte-qq2273")},m(o,r){O(o,t,r),n||(s=[ye(t,"mouseenter",i[3]),ye(t,"mouseleave",i[4])],n=!0)},p(o,[r]){r&4&&y(t,"style",o[2]),r&3&&e!==(e=`${o[1]}_${o[0].id}`)&&y(t,"id",e)},i:J,o:J,d(o){o&&V(t),n=!1,Ze(s)}}}function Zp(i,t,e){let n,s,{room:o}=t,{floorIndex:r}=t,{floorplanData:a}=t,{highlightData:l}=t,{hoveredRoom:c}=t;function d(){c==null||c.set(o)}function h(){c==null||c.set(void 0)}const{bounding:u}=a,m=Rs(o.path,{needZ:!0,format:g=>tc(g,u)});return i.$$set=g=>{"room"in g&&e(0,o=g.room),"floorIndex"in g&&e(1,r=g.floorIndex),"floorplanData"in g&&e(6,a=g.floorplanData),"highlightData"in g&&e(7,l=g.highlightData),"hoveredRoom"in g&&e(8,c=g.hoveredRoom)},i.$$.update=()=>{i.$$.dirty&131&&e(9,n=l[`${r}_${o.id}`]),i.$$.dirty&512&&e(2,s=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[o,r,s,d,h,m,a,l,c,n]}class Kp extends ce{constructor(t){super(),le(this,t,Zp,Jp,ae,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},qp)}}function $p(i){he(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function sc(i,t,e){const n=i.slice();return n[6]=t[e],n}function oc(i,t){let e,n,s;const o=[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}];let r={};for(let a=0;a<o.length;a+=1)r=Je(r,o[a]);return n=new Kp({props:r}),{key:i,first:null,c(){e=ke(),se(n.$$.fragment),this.first=e},m(a,l){O(a,e,l),ne(n,a,l),s=!0},p(a,l){t=a;const c=l&15?it(o,[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}]):{};n.$set(c)},i(a){s||(x(n.$$.fragment,a),s=!0)},o(a){z(n.$$.fragment,a),s=!1},d(a){a&&V(e),ie(n,a)}}}function eg(i){let t,e,n=[],s=new Map,o,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=sc(i,r,l),d=a(c);s.set(d,n[l]=oc(d,c))}return{c(){t=S("div"),e=je("svg");for(let l=0;l<n.length;l+=1)n[l].c();y(e,"width","100%"),y(e,"height","100%"),y(e,"viewBox",`0 0 ${i[4]} ${i[5]}`),y(e,"class","svelte-1kqo6e4"),y(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){O(l,t,c),D(t,e);for(let d=0;d<n.length;d+=1)n[d]&&n[d].m(e,null);o=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,ue(),n=St(n,c,a,1,l,r,s,e,dn,oc,null,sc),fe())},i(l){if(!o){for(let c=0;c<r.length;c+=1)x(n[c]);o=!0}},o(l){for(let c=0;c<n.length;c+=1)z(n[c]);o=!1},d(l){l&&V(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function tg(i,t,e){let{floorIndex:n}=t,{floorplanData:s}=t,{highlightData:o}=t,{hoveredRoom:r}=t;const a=s.bounding.max.x-s.bounding.min.x,l=s.bounding.max.y-s.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,s=c.floorplanData),"highlightData"in c&&e(2,o=c.highlightData),"hoveredRoom"in c&&e(3,r=c.hoveredRoom)},[n,s,o,r,a,l]}class rc extends ce{constructor(t){super(),le(this,t,tg,eg,ae,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},$p)}}function ng(i){he(i,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function ac(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let s={};for(let o=0;o<n.length;o+=1)s=Je(s,n[o]);return t=new rc({props:s}),{c(){se(t.$$.fragment)},m(o,r){ne(t,o,r),e=!0},p(o,r){const a=r&24834?it(n,[{floorIndex:o[1],floorplanData:o[8],hoveredRoom:o[14],highlightData:o[13]}]):{};t.$set(a)},i(o){e||(x(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function lc(i){let t,e;const n=[{floorplanData:i[8],roomAreaEnable:i[5],roomNameEnable:i[6],floorIndex:i[1],getRoomAreaText:i[9],getLabelElement:i[10],hoveredRoom:i[14],adaptiveRoomLabelVisibleEnable:i[12]}];let s={};for(let o=0;o<n.length;o+=1)s=Je(s,n[o]);return t=new wp({props:s}),{c(){se(t.$$.fragment)},m(o,r){ne(t,o,r),e=!0},p(o,r){const a=r&22370?it(n,[{floorplanData:o[8],roomAreaEnable:o[5],roomNameEnable:o[6],floorIndex:o[1],getRoomAreaText:o[9],getLabelElement:o[10],hoveredRoom:o[14],adaptiveRoomLabelVisibleEnable:o[12]}]):{};t.$set(a)},i(o){e||(x(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function cc(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let s={};for(let o=0;o<n.length;o+=1)s=Je(s,n[o]);return t=new Sp({props:s}),{c(){se(t.$$.fragment)},m(o,r){ne(t,o,r),e=!0},p(o,r){const a=r&2306?it(n,[{floorplanData:o[8],floorIndex:o[1],getRuleDistanceText:o[11]}]):{};t.$set(a)},i(o){e||(x(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function ig(i){let t,e,n,s,o,r,a,l,c;const d=[{floorIndex:i[1],floorplanData:i[8]}];let h={};for(let b=0;b<d.length;b+=1)h=Je(h,d[b]);e=new Up({props:h});let u=(i[2]||i[3])&&ac(i);const m=[{floorplanData:i[8],floorIndex:i[1]}];let g={};for(let b=0;b<m.length;b+=1)g=Je(g,m[b]);o=new Gl({props:g});let v=i[4]&&lc(i),p=i[7]&&cc(i);return{c(){t=S("div"),se(e.$$.fragment),n=ee(),u&&u.c(),s=ee(),se(o.$$.fragment),r=ee(),v&&v.c(),a=ee(),p&&p.c(),y(t,"class",l=Qe(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(b,w){O(b,t,w),ne(e,t,null),D(t,n),u&&u.m(t,null),D(t,s),ne(o,t,null),D(t,r),v&&v.m(t,null),D(t,a),p&&p.m(t,null),c=!0},p(b,[w]){const P=w&258?it(d,[{floorIndex:b[1],floorplanData:b[8]}]):{};e.$set(P),b[2]||b[3]?u?(u.p(b,w),w&12&&x(u,1)):(u=ac(b),u.c(),x(u,1),u.m(t,s)):u&&(ue(),z(u,1,1,()=>{u=null}),fe());const k=w&258?it(m,[{floorplanData:b[8],floorIndex:b[1]}]):{};o.$set(k),b[4]?v?(v.p(b,w),w&16&&x(v,1)):(v=lc(b),v.c(),x(v,1),v.m(t,a)):v&&(ue(),z(v,1,1,()=>{v=null}),fe()),b[7]?p?(p.p(b,w),w&128&&x(p,1)):(p=cc(b),p.c(),x(p,1),p.m(t,null)):p&&(ue(),z(p,1,1,()=>{p=null}),fe()),(!c||w&1&&l!==(l=Qe(`floorplan-plugin__floor${b[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&y(t,"class",l)},i(b){c||(x(e.$$.fragment,b),x(u),x(o.$$.fragment,b),x(v),x(p),c=!0)},o(b){z(e.$$.fragment,b),z(u),z(o.$$.fragment,b),z(v),z(p),c=!1},d(b){b&&V(t),ie(e),u&&u.d(),ie(o),v&&v.d(),p&&p.d()}}}function sg(i,t,e){let{isCurrent:n}=t,{floorIndex:s}=t,{highlightEnable:o}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:d}=t,{floorplanData:h}=t,{getRoomAreaText:u}=t,{getLabelElement:m}=t,{getRuleDistanceText:g}=t,{adaptiveRoomLabelVisibleEnable:v}=t,{highlightData:p}=t;const b=or(void 0);return i.$$set=w=>{"isCurrent"in w&&e(0,n=w.isCurrent),"floorIndex"in w&&e(1,s=w.floorIndex),"highlightEnable"in w&&e(2,o=w.highlightEnable),"hoverEnable"in w&&e(3,r=w.hoverEnable),"roomLabelsEnable"in w&&e(4,a=w.roomLabelsEnable),"roomAreaEnable"in w&&e(5,l=w.roomAreaEnable),"roomNameEnable"in w&&e(6,c=w.roomNameEnable),"ruleLabelsEnable"in w&&e(7,d=w.ruleLabelsEnable),"floorplanData"in w&&e(8,h=w.floorplanData),"getRoomAreaText"in w&&e(9,u=w.getRoomAreaText),"getLabelElement"in w&&e(10,m=w.getLabelElement),"getRuleDistanceText"in w&&e(11,g=w.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in w&&e(12,v=w.adaptiveRoomLabelVisibleEnable),"highlightData"in w&&e(13,p=w.highlightData)},[n,s,o,r,a,l,c,d,h,u,m,g,v,p,b]}let og=class extends ce{constructor(t){super(),le(this,t,sg,ig,ae,{isCurrent:0,floorIndex:1,highlightEnable:2,hoverEnable:3,roomLabelsEnable:4,roomAreaEnable:5,roomNameEnable:6,ruleLabelsEnable:7,floorplanData:8,getRoomAreaText:9,getLabelElement:10,getRuleDistanceText:11,adaptiveRoomLabelVisibleEnable:12,highlightData:13},ng)}};function rg(i){he(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function dc(i,t,e){const n=i.slice();return n[21]=t[e],n}function hc(i){let t,e,n,s,o,r=i[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=uc(dc(i,r,h));const l=h=>z(a[h],1,1,()=>{a[h]=null});let c=i[5]&&fc(i),d=i[8]&&mc(i);return{c(){t=S("div");for(let h=0;h<a.length;h+=1)a[h].c();e=ee(),c&&c.c(),n=ee(),d&&d.c(),y(t,"class","floorplan-main svelte-86bqav")},m(h,u){O(h,t,u);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(t,null);D(t,e),c&&c.m(t,null),D(t,n),d&&d.m(t,null),o=!0},p(h,u){if(i=h,u&2047696){r=i[13].floorDatas;let m;for(m=0;m<r.length;m+=1){const g=dc(i,r,m);a[m]?(a[m].p(g,u),x(a[m],1)):(a[m]=uc(g),a[m].c(),x(a[m],1),a[m].m(t,e))}for(ue(),m=r.length;m<a.length;m+=1)l(m);fe()}i[5]?c?(c.p(i,u),u&32&&x(c,1)):(c=fc(i),c.c(),x(c,1),c.m(t,n)):c&&(ue(),z(c,1,1,()=>{c=null}),fe()),i[8]?d?(d.p(i,u),u&256&&x(d,1)):(d=mc(i),d.c(),x(d,1),d.m(t,null)):d&&(ue(),z(d,1,1,()=>{d=null}),fe())},i(h){if(!o){for(let u=0;u<r.length;u+=1)x(a[u]);x(c),x(d),s||nt(()=>{s=yn(t,wn,{duration:i[0],easing:on}),s.start()}),o=!0}},o(h){a=a.filter(Boolean);for(let u=0;u<a.length;u+=1)z(a[u]);z(c),z(d),o=!1},d(h){h&&V(t),Mt(a,h),c&&c.d(),d&&d.d()}}}function uc(i){let t,e;const n=[{hoverEnable:i[6],highlightEnable:i[7],floorplanData:i[13],getRoomAreaText:i[16],getLabelElement:i[17],getRuleDistanceText:i[18],roomLabelsEnable:i[9],roomAreaEnable:i[10],roomNameEnable:i[11],ruleLabelsEnable:i[12],adaptiveRoomLabelVisibleEnable:i[19],highlightData:i[20]},{floorIndex:i[21].floorIndex},{isCurrent:i[21].floorIndex===i[4]}];let s={};for(let o=0;o<n.length;o+=1)s=Je(s,n[o]);return t=new og({props:s}),{c(){se(t.$$.fragment)},m(o,r){ne(t,o,r),e=!0},p(o,r){const a=r&2047696?it(n,[r&2047680&&{hoverEnable:o[6],highlightEnable:o[7],floorplanData:o[13],getRoomAreaText:o[16],getLabelElement:o[17],getRuleDistanceText:o[18],roomLabelsEnable:o[9],roomAreaEnable:o[10],roomNameEnable:o[11],ruleLabelsEnable:o[12],adaptiveRoomLabelVisibleEnable:o[19],highlightData:o[20]},r&8192&&{floorIndex:o[21].floorIndex},r&8208&&{isCurrent:o[21].floorIndex===o[4]}]):{};t.$set(a)},i(o){e||(x(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function fc(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let s={};for(let o=0;o<n.length;o+=1)s=Je(s,n[o]);return t=new Wm({props:s}),{c(){se(t.$$.fragment)},m(o,r){ne(t,o,r),e=!0},p(o,r){const a=r&57352?it(n,[{panoIndex:o[3],floorplanData:o[13],lastPanoramaLongitude:o[14],cameraImageUrl:o[15]}]):{};t.$set(a)},i(o){e||(x(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function mc(i){let t,e;return t=new Zm({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&8192&&(o.floorplanData=n[13]),s&4&&(o.northDesc=n[2]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function ag(i){let t,e,n=i[1]&&hc(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[1]?n?(n.p(s,o),o&2&&x(n,1)):(n=hc(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function lg(i,t,e){let{duration:n=0}=t,{visible:s}=t,{northDesc:o}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:d}=t,{compassEnable:h}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:m}=t,{roomNameEnable:g}=t,{ruleLabelsEnable:v}=t,{floorplanData:p}=t,{lastPanoramaLongitude:b}=t,{cameraImageUrl:w}=t,{getRoomAreaText:P}=t,{getLabelElement:k}=t,{getRuleDistanceText:T}=t,{adaptiveRoomLabelVisibleEnable:I}=t,{highlightData:B}=t;return i.$$set=L=>{"duration"in L&&e(0,n=L.duration),"visible"in L&&e(1,s=L.visible),"northDesc"in L&&e(2,o=L.northDesc),"panoIndex"in L&&e(3,r=L.panoIndex),"floorIndex"in L&&e(4,a=L.floorIndex),"cameraEnable"in L&&e(5,l=L.cameraEnable),"hoverEnable"in L&&e(6,c=L.hoverEnable),"highlightEnable"in L&&e(7,d=L.highlightEnable),"compassEnable"in L&&e(8,h=L.compassEnable),"roomLabelsEnable"in L&&e(9,u=L.roomLabelsEnable),"roomAreaEnable"in L&&e(10,m=L.roomAreaEnable),"roomNameEnable"in L&&e(11,g=L.roomNameEnable),"ruleLabelsEnable"in L&&e(12,v=L.ruleLabelsEnable),"floorplanData"in L&&e(13,p=L.floorplanData),"lastPanoramaLongitude"in L&&e(14,b=L.lastPanoramaLongitude),"cameraImageUrl"in L&&e(15,w=L.cameraImageUrl),"getRoomAreaText"in L&&e(16,P=L.getRoomAreaText),"getLabelElement"in L&&e(17,k=L.getLabelElement),"getRuleDistanceText"in L&&e(18,T=L.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in L&&e(19,I=L.adaptiveRoomLabelVisibleEnable),"highlightData"in L&&e(20,B=L.highlightData)},[n,s,o,r,a,l,c,d,h,u,m,g,v,p,b,w,P,k,T,I,B]}let ar=class extends ce{constructor(t){super(),le(this,t,lg,ag,ae,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,ruleLabelsEnable:12,floorplanData:13,lastPanoramaLongitude:14,cameraImageUrl:15,getRoomAreaText:16,getLabelElement:17,getRuleDistanceText:18,adaptiveRoomLabelVisibleEnable:19,highlightData:20},rg)}};const cg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function dg(i){return Y(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(s){return Y(this,null,function*(){const o={index:s.index,url:s.url,svgUrl:s.svg_url};if(s.svg_url){const r=yield fetch(s.svg_url,{headers:t}).then(a=>a.text());o.svgContent=r}return o})};return yield Promise.all(i.map(e))})}function hg(i){return{id:i.id,size:i.size,name:i.name,path:i.path,roomType:i.room_type,floorType:i.floor_type,roomLabel:{position:i.room_label.position,positionInImage:i.room_label.position_in_image},observerIndexs:i.observer_indexs}}function ug(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(hg),rules:i.rules}}function fg(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function mg(i){return{rad:i.rad,position:i.position,positionInImage:i.position_in_image,northRad:i.north_rad,roomId:i.room_id,floorIndex:i.floor_index}}function fn(i){return Y(this,null,function*(){const t=yield dg(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(ug),s=i.computed_data.entrance?mg(i.computed_data.entrance):null;return{outlines:t,entrance:s,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(fg)}})}function pg(i,t,e){return i.map(s=>{const o=s.position,r=s.icon?s.icon:{url:cg,width:45,height:48},a=Tp(o,t),l=Dp(o,e),c=Lp(l,e);return{floorIndex:a,icon:r,id:s.id,position:l,positionInImage:c}})}function gg(i,t){return t(i),i}function Gs(i,t){return gg({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function pc(i,t){const e=Math.max(...i.work.observers.map(n=>n.floorIndex));return t>e?i.model.bounding.max.y:Math.max(...i.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function lr(i,t,e=hn.BOUNDING_CENTER){const n=pc(i,t),s=pc(i,t+1);return e===hn.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===hn.CEILING?s:n}function cr(i,t,e,n){const s=lr(i,e,n==null?void 0:n.attachedTo),o=new E.Vector3(0,s,0),r=new E.Vector3(1,s,0),a=o.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}let ji=class{constructor(t,e){f(this,"VERSION","2.21.0-dev.4");f(this,"five");f(this,"hooks",new Qn);f(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}isAbsoluteURL(t){return Fo(t)?t:`${this.staticPrefix}${t}`}},Cn=class extends ji{};var bt=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(bt||{});const gc=500,vg=80;function dr(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function hr(i,t){return Y(this,null,function*(){const[e]=yield ti(i.changeMode(...t));if(e)throw new Error("change mode canceled");yield new Promise(r=>{i.once("initAnimationWillStart",()=>{i.once("initAnimationEnded",()=>r())})});const n=t[1];if(!n)return!0;const s=i.getCurrentState();if(!Ag(n,s))throw new Error("pose 与预期不符")})}function Ag(i,t){return Object.keys(i).every(e=>{const n=t[e];if(n===void 0)return!0;const s=i[e];return typeof n=="number"&&typeof s=="number"?dr(n,s,2):n===s})}function ur(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:s}=t,{latitude:o,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!dr(e,o,2)||!dr(n,r,2)||s!==a)}function vc(i,t,e=!0){return Y(this,null,function*(){if(ur(i,t)===!0)return;const s=i.getCurrentState();if(s.mode!==t.mode){const[d]=yield ti(hr(i,[t.mode,t,void 0,e]));if(d)throw new Error(bt.ChangeModeError);return}const{latitude:o,longitude:r,fov:a}=s,l=Math.min(1e3,Math.max(200,Math.abs(o-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ti(i.updateCamera(t,l,e));if(c)throw new Error(bt.UpdateCameraError)})}function ri(i,t,e=300){const n=i.getElement();n&&(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(s=>n.addEventListener("transitionend",s,{once:!0})),new Promise(s=>setTimeout(s,e))]).then(()=>{n.style.transition="none"}))}function bg(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||s}function yg(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&s}let wg=class extends Cn{constructor(e,n){var a;super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"show",(...n)=>Y(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));f(this,"hide",(...n)=>Y(this,[...n],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!ur(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,o=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=cr(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s,o,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(s=this.showRejection)==null||s.call(this,bt.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>Y(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(bt.ModelNotLoaded);if(!this.data)throw new Error(bt.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=F(F({},n),e),o=()=>Y(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ti(vc(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(bt.UnknownError);this.updateSize(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex);const d=s.modelOpacity,h=s.immediately?0:gc;ri(this.five,d,h),this.render(h)});return this.showPromise=o().then(()=>{this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,bt.BreakOffByHide),this.showPromise=void 0;const s=F(F({},{userAction:!0,isAutoHide:!1}),e);ri(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();s.mode==="Floorplan"&&(this.state.visible||yg(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();bg(s)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});f(this,"onFiveWantsGesture",(e,n)=>{if(this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:vg/((a=n==null?void 0:n.scale)!=null?a:1)};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:un,attachedTo:hn.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"㎡",getRuleDistanceText:l=>l.toString()},o=n?Gs(n,["selector","scale"]):{},r=F(F({},s),o);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,s=!0){return Y(this,null,function*(){function o(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield fn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return Y(this,null,function*(){return yield fn(e.data)})}updateState(e,n){const s=this.state,o=e.config?F(F({},s.config),e.config):s.config;this.state=we(F(F({},this.state),e),{config:o}),!Ot(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=we(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new ar({target:this.container,intro:!0,props:n})}};const Cg=(i,t)=>new wg(i,t);function Pg(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||s}function Ig(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&s}let Eg=class extends Cn{constructor(e,n){super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"show",(...n)=>Y(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));f(this,"hide",(...n)=>Y(this,[...n],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!ur(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,o=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=cr(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s,o,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(s=this.showRejection)==null||s.call(this,bt.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>Y(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(bt.ModelNotLoaded);if(!this.data)throw new Error(bt.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=F(F({},n),e),o=()=>Y(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ti(vc(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(bt.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex);const d=s.modelOpacity,h=s.immediately?0:gc;ri(this.five,d,h),this.render(h)});return this.showPromise=o().then(()=>{this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,bt.BreakOffByHide),this.showPromise=void 0;const s=F(F({},{userAction:!0,isAutoHide:!1}),e);ri(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Pg(s)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();return s.mode!==this.showState.mode||this.state.visible?void 0:(Ig(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:un,attachedTo:hn.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},o=n?Gs(n,["selector","scale"]):{},r=F(F({},s),o);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,s=!0){return Y(this,null,function*(){function o(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield fn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=lr(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const s=n.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}formatData(e){return Y(this,null,function*(){return yield fn(e.data)})}updateState(e,n){const s=this.state,o=e.config?F(F({},s.config),e.config):s.config;this.state=we(F(F({},this.state),e),{config:o}),!Ot(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=we(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new ar({target:this.container,intro:!0,props:n})}};const kg=(i,t)=>new Eg(i,t);let xg=class extends Cn{constructor(e,n){super(e);f(this,"name","topviewFloorplanPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"selector");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,o=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=cr(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s,o;const{userAction:n}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,(o=this.container)==null||o.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{this.state.visible&&(this.updatePosition(),this.updateSize())});f(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});f(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});f(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"));const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:un,attachedTo:hn.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},o=n?Gs(n,["selector","scale"]):{},r=F(F({},s),o);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,s=!0){return Y(this,null,function*(){function o(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield fn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),this.render()})}updatePosition(){var a;const e=lr(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const s=n.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return Y(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return Y(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return Y(this,null,function*(){return yield fn(e.data)})}_show(e){return Y(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield hr(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const s=500,o=this.state.config.modelOpacity;ri(this.five,o,s),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return Y(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const s=1,o=0;ri(this.five,s,o),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const s=this.state,o=e.config?F(F({},s.config),e.config):s.config;this.state=we(F(F({},this.state),e),{config:o}),!Ot(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=we(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new ar({target:this.container,intro:!0,props:n})}};const Mg=(i,t)=>new xg(i,t);function fr(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Sg(i){he(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function Dg(i){let t,e,n;return{c(){t=S("div"),e=S("div"),n=S("div"),y(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),j(n,"background-image","url("+(i[0]||un)+")"),j(n,"transform",i[1]),y(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),j(e,"transform",i[2]),y(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(s,o){O(s,t,o),D(t,e),D(e,n)},p(s,[o]){o&1&&j(n,"background-image","url("+(s[0]||un)+")"),(o&1||o&3)&&j(n,"transform",s[1]),o&4&&j(e,"transform",s[2])},i:J,o:J,d(s){s&&V(t)}}}function Lg(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Tg(i,t,e){let n,s,{five:o}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=o.getCurrentState().panoIndex,d=o.getCurrentState().longitude;function h(g,v){const p=g.bounding,b=g.observers[v];if(!b)return"";const w=(p.max.x-p.min.x)*r,P=(p.max.y-p.min.y)*r,k=Math.floor(b.positionInImage.x*w),T=Math.floor(b.positionInImage.y*P);return`translate(${k}px, ${T}px)`}function u(g){e(6,c=g)}const m=fr(g=>{e(7,d=g.longitude)},1e3/60);return At(()=>(o.on("panoWillArrive",u),o.on("cameraDirectionUpdate",m),function(){o.off("panoWillArrive",u),o.off("cameraDirectionUpdate",m)})),i.$$set=g=>{"five"in g&&e(3,o=g.five),"pxmm"in g&&e(4,r=g.pxmm),"floorplanData"in g&&e(5,a=g.floorplanData),"cameraImageUrl"in g&&e(0,l=g.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=h(a,c)),i.$$.dirty&128&&e(1,s=Lg(d))},[l,s,n,o,r,a,c,d]}class zg extends ce{constructor(t){super(),le(this,t,Tg,Dg,ae,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Sg)}}function jg(i){he(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function Ac(i,t,e){const n=i.slice();return n[1]=t[e],n}function bc(i,t){let e,n,s=`${t[1].icon.width/16}rem`,o=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=S("div"),n=S("div"),r=ee(),y(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),j(n,"background-image",`url(${t[1].icon.url})`),j(n,"width",s),j(n,"height",o),y(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),j(e,"top",a),j(e,"left",l),this.first=e},m(c,d){O(c,e,d),D(e,n),D(e,r)},p(c,d){t=c,d&1&&j(n,"background-image",`url(${t[1].icon.url})`);const h=d&1;h&&j(n,"width",s),h&&j(n,"height",o),d&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&j(e,"top",a),d&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&j(e,"left",l)},d(c){c&&V(e)}}}function Vg(i){let t,e=[],n=new Map,s=i[0];const o=r=>r[1].id;for(let r=0;r<s.length;r+=1){let a=Ac(i,s,r),l=o(a);n.set(l,e[r]=bc(l,a))}return{c(){t=S("div");for(let r=0;r<e.length;r+=1)e[r].c();y(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){O(r,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(r,[a]){a&1&&(s=r[0],e=St(e,a,o,1,r,s,n,t,tr,bc,null,Ac))},i:J,o:J,d(r){r&&V(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Og(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=s=>{"extraObjects"in s&&e(0,n=s.extraObjects)},[n]}class Bg extends ce{constructor(t){super(),le(this,t,Og,Vg,ae,{extraObjects:0},jg)}}function yc(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[7],highlightData:i[5],hoveredRoom:void 0}];let s={};for(let o=0;o<n.length;o+=1)s=Je(s,n[o]);return t=new rc({props:s}),{c(){se(t.$$.fragment)},m(o,r){ne(t,o,r),e=!0},p(o,r){const a=r&183?it(n,[{five:o[0],pxmm:o[1],floorIndex:o[2],floorplanData:o[4],onRoomHeightClick:o[7],highlightData:o[5],hoveredRoom:void 0}]):{};t.$set(a)},i(o){e||(x(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function _g(i){let t,e,n,s,o,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let d=0;d<a.length;d+=1)l=Je(l,a[d]);t=new Gl({props:l}),n=new Bg({props:{extraObjects:i[6]}});let c=i[3]&&yc(i);return{c(){se(t.$$.fragment),e=ee(),se(n.$$.fragment),s=ee(),c&&c.c(),o=ke()},m(d,h){ne(t,d,h),O(d,e,h),ne(n,d,h),O(d,s,h),c&&c.m(d,h),O(d,o,h),r=!0},p(d,[h]){const u=h&20?it(a,[{floorIndex:d[2],floorplanData:d[4]}]):{};t.$set(u);const m={};h&64&&(m.extraObjects=d[6]),n.$set(m),d[3]?c?(c.p(d,h),h&8&&x(c,1)):(c=yc(d),c.c(),x(c,1),c.m(o.parentNode,o)):c&&(ue(),z(c,1,1,()=>{c=null}),fe())},i(d){r||(x(t.$$.fragment,d),x(n.$$.fragment,d),x(c),r=!0)},o(d){z(t.$$.fragment,d),z(n.$$.fragment,d),z(c),r=!1},d(d){ie(t,d),d&&V(e),ie(n,d),d&&V(s),c&&c.d(d),d&&V(o)}}}function Qg(i,t,e){let n,{five:s}=t,{pxmm:o}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t,{highlightData:d}=t;const h=void 0;return i.$$set=u=>{"five"in u&&e(0,s=u.five),"pxmm"in u&&e(1,o=u.pxmm),"floorIndex"in u&&e(2,r=u.floorIndex),"hoverEnable"in u&&e(3,a=u.hoverEnable),"floorplanData"in u&&e(4,l=u.floorplanData),"extraObjects"in u&&e(8,c=u.extraObjects),"highlightData"in u&&e(5,d=u.highlightData)},i.$$.update=()=>{i.$$.dirty&260&&e(6,n=c==null?void 0:c.filter(u=>u.floorIndex===r))},[s,o,r,a,l,d,n,h,c]}class Rg extends ce{constructor(t){super(),le(this,t,Qg,_g,ae,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function Gg(i){he(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function wc(i){let t,e,n,s,o=i[7]!==0&&Cc(i);return{c(){t=S("div"),o&&o.c(),y(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){O(r,t,a),o&&o.m(t,null),e=!0,n||(s=[Nt(ei.call(null,t)),ye(t,"clientWidth",i[13]),ye(t,"clientHeight",i[14])],n=!0)},p(r,a){r[7]!==0?o?(o.p(r,a),a&128&&x(o,1)):(o=Cc(r),o.c(),x(o,1),o.m(t,null)):o&&(ue(),z(o,1,1,()=>{o=null}),fe())},i(r){e||(x(o),e=!0)},o(r){z(o),e=!1},d(r){r&&V(t),o&&o.d(),n=!1,Ze(s)}}}function Cc(i){let t,e,n,s,o=`${i[9]}px`,r=`${i[12]}px`,a;const l=[{five:i[0],pxmm:i[10],floorIndex:i[11],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5],highlightData:i[6]}];let c={};for(let u=0;u<l.length;u+=1)c=Je(c,l[u]);e=new Rg({props:c});const d=[{pxmm:i[10],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let h={};for(let u=0;u<d.length;u+=1)h=Je(h,d[u]);return s=new zg({props:h}),{c(){t=S("div"),se(e.$$.fragment),n=ee(),se(s.$$.fragment),y(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),j(t,"width",o),j(t,"height",r)},m(u,m){O(u,t,m),ne(e,t,null),D(t,n),ne(s,t,null),a=!0},p(u,m){const g=m&3181?it(l,[{five:u[0],pxmm:u[10],floorIndex:u[11],floorplanData:u[3],hoverEnable:u[2],extraObjects:u[5],highlightData:u[6]}]):{};e.$set(g);const v=m&1049?it(d,[{pxmm:u[10],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};s.$set(v),m&512&&o!==(o=`${u[9]}px`)&&j(t,"width",o),m&4096&&r!==(r=`${u[12]}px`)&&j(t,"height",r)},i(u){a||(x(e.$$.fragment,u),x(s.$$.fragment,u),a=!0)},o(u){z(e.$$.fragment,u),z(s.$$.fragment,u),a=!1},d(u){u&&V(t),ie(e),ie(s)}}}function Fg(i){let t,e,n=i[1]&&wc(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[1]?n?(n.p(s,o),o&2&&x(n,1)):(n=wc(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function Hg(i,t,e){var P,k;let{five:n}=t,{visible:s}=t,{hoverEnable:o}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,d=0,h=(k=(P=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:P.floorIndex)!=null?k:0,u=0,m=0,g=0,v=0;function p(T){e(11,h=n.work.observers[T].floorIndex)}At(()=>(n.on("panoArrived",p),()=>{n.off("panoArrived",p)}));const b=T=>{e(7,u=T.detail)},w=T=>{e(8,m=T.detail)};return i.$$set=T=>{"five"in T&&e(0,n=T.five),"visible"in T&&e(1,s=T.visible),"hoverEnable"in T&&e(2,o=T.hoverEnable),"floorplanData"in T&&e(3,r=T.floorplanData),"cameraImageUrl"in T&&e(4,a=T.cameraImageUrl),"extraObjects"in T&&e(5,l=T.extraObjects),"highlightData"in T&&e(6,c=T.highlightData)},i.$$.update=()=>{if(i.$$.dirty&904){const T=Math.min(u,m),{max:I,min:B}=r.bounding,L=I.x-B.x,X=I.y-B.y,Z=function(){return L>X?[T,T/L*X]:[T/X*L,T]}();e(9,g=Z[0]),e(12,v=Z[1]),e(10,d=g/L)}},[n,s,o,r,a,l,c,u,m,g,d,h,v,b,w]}class Wg extends ce{constructor(t){super(),le(this,t,Hg,Fg,ae,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},Gg)}}let Ng=class extends Cn{constructor(e,n){super(e);f(this,"name","panoFloorplanRadarPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"wrapperSelector","");f(this,"wrapper",null);f(this,"disposed",!1);f(this,"extraObjects",[]);f(this,"highlightData",{});f(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s;const{userAction:n}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const s={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:un},o=n!=null&&n.configs?n.configs:{},r=F(F({},s),o);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,s=!0){return Y(this,null,function*(){function o(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=o(r)?r.data:r,l=this.data;this.data=yield fn(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,s),this.render()})}show(){return Y(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return Y(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){this.data&&(this.extraObjects=pg(e,this.five,this.data),this.render())}formatData(e){return Y(this,null,function*(){return yield fn(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const s=this.state;this.state=F(F({},this.state),e),!Ot(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=we(F({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(e):this.app=new Wg({target:this.wrapper,props:e})}};const Yg=(i,t)=>new Ng(i,t),Xg=[{type:0,floorType:1,roomType:"100900000012",name:"其他"},{type:1,floorType:1,roomType:"100900000002",name:"客厅"},{type:2,floorType:1,roomType:"100900000002",name:"餐厅"},{type:3,floorType:0,roomType:"100900000001",name:"卧室"},{type:4,floorType:0,roomType:"100900000001",name:"书房"},{type:5,floorType:3,roomType:"100900000004",name:"卫生间"},{type:6,floorType:3,roomType:"100900000004",name:"淋浴间"},{type:7,floorType:3,roomType:"100900000004",name:"洗手间"},{type:8,floorType:3,roomType:"100900000003",name:"厨房"},{type:9,floorType:1,roomType:"100900000003",name:"开放厨房",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"多功能间"},{type:11,floorType:0,roomType:"100900000009",name:"保姆间"},{type:12,floorType:4,roomType:"100900000005",name:"阳台"},{type:13,floorType:4,roomType:"100900000006",name:"露台"},{type:14,floorType:0,roomType:"100900000008",name:"储物间"},{type:15,floorType:0,roomType:"100900000013",name:"衣帽间"},{type:16,floorType:0,roomType:"100900000011",name:"阁楼"},{type:17,floorType:2,roomType:"100900000007",name:"花园"},{type:18,floorType:5,roomType:"100900000010",name:"车库"},{type:19,floorType:1,roomType:"100900000012",name:"电梯"},{type:20,floorType:1,roomType:"100900000012",name:"地下室"},{type:21,floorType:1,roomType:"100900000012",name:"天井"},{type:22,floorType:1,roomType:"100900000012",name:"阳光房"},{type:23,floorType:1,roomType:"100900000012",name:"过道"},{type:24,floorType:1,roomType:"100900000012",name:"楼梯间"},{type:25,floorType:1,roomType:"100900000012",name:"门厅"},{type:26,floorType:2,roomType:"100900000012",name:"入户花园"},{type:27,floorType:1,roomType:"100900000012",name:"玄关"},{type:28,floorType:1,roomType:"100900000012",name:"挑空"},{type:29,floorType:4,roomType:"100900000012",name:"晾晒区"},{type:30,floorType:4,roomType:"100900000012",name:"洗衣房"},{type:31,floorType:0,roomType:"100900000012",name:"娱乐区"},{type:32,floorType:0,roomType:"100900000012",name:"健身区"},{type:33,floorType:0,roomType:"100900000012",name:"接待区"},{type:34,floorType:0,roomType:"100900000012",name:"影音区"},{type:35,floorType:1,roomType:"100900000012",name:"餐饮区"},{type:36,floorType:1,roomType:"100900000012",name:"其他",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"起居室"},{type:38,floorType:0,roomType:"100900000001",name:"主卧"},{type:39,floorType:0,roomType:"100900000001",name:"次卧"},{type:40,floorType:0,roomType:"100900000001",name:"优化间"},{type:41,floorType:0,roomType:"100900000001",name:"办公室"},{type:42,floorType:0,roomType:"100900000001",name:"会议室"},{type:43,floorType:0,roomType:"100900000001",name:"洽谈间"},{type:44,floorType:1,roomType:"100900000002",name:"共享大厅"},{type:45,floorType:1,roomType:"100900000012",name:"水吧"},{type:46,floorType:0,roomType:"100900000015",name:"出入口"},{type:47,floorType:0,roomType:"100900000015",name:"大厅"},{type:48,floorType:0,roomType:"100900000015",name:"包厢"},{type:49,floorType:0,roomType:"100900000015",name:"其他"},{type:50,floorType:0,roomType:"100900000016",name:"出入口"},{type:51,floorType:0,roomType:"100900000016",name:"办公区"},{type:52,floorType:0,roomType:"100900000016",name:"老板间"},{type:53,floorType:0,roomType:"100900000016",name:"会议室"},{type:54,floorType:0,roomType:"100900000016",name:"休息区/水吧"},{type:55,floorType:0,roomType:"100900000016",name:"其他"},{type:56,floorType:2,roomType:"100900000012",name:"空中花园"},{type:57,floorType:0,roomType:"100900000001",name:"洋室"},{type:58,floorType:0,roomType:"100900000001",name:"和室"}],Ug=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],qg=[{roomType:"100900000001",description:"室"},{roomType:"100900000002",description:"厅"},{roomType:"100900000003",description:"厨"},{roomType:"100900000004",description:"卫"},{roomType:"100900000005",description:"阳台"},{roomType:"100900000006",description:"露台"},{roomType:"100900000007",description:"花园"},{roomType:"100900000008",description:"储"},{roomType:"100900000009",description:"保姆间"},{roomType:"100900000010",description:"车库"},{roomType:"100900000011",description:"阁楼"},{roomType:"100900000012",description:"其他"},{roomType:"100900000013",description:"衣"},{roomType:"100900000015",description:"商铺"},{roomType:"100900000016",description:"写字楼"}],mr=(i,t,e)=>{const n=new E.Matrix4,s=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(s),n},Jg=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[s,o,r]=e;s&&i.applyMatrix4(mr(s,0,0)),o&&i.applyMatrix4(mr(0,o,0)),r&&i.applyMatrix4(mr(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function Pc(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const s=e,o=F({map:s.material.map||{}},t);s.material=new _.MeshBasicMaterial(o),s.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const Zg=(i,t)=>{var d;const e=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",n=(d=t.north_rad)!=null?d:void 0,s={},o=h=>Y(this,null,function*(){var R;const u=(h==null?void 0:h.fbx_url)||e,m=(R=h==null?void 0:h.north_rad)!=null?R:n;if(typeof m!="number")throw new Error('"northRad"配置参数缺失:未配置指南针指向!');const g=i.model.bounding,v=g.max.x-g.min.x,p=g.max.z-g.min.z,b=Math.max(v,p),P=yield new hs.FBXLoader().loadAsync(u);Pc(P,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const k=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:T,z:I},min:{x:B,y:L,z:X}}}}=i;s.yBase=L;const Z={x:(T+B)/2,y:L-1.6,z:(I+X)/2},G=.0045*b;return Jg(P,{position:Z,rotation:k,scale:G}),s.object=P,!0}),r=({latitude:h})=>{if(!s.object)return;const u=a(h);u&&(s.object.position.y=u)},a=h=>{if(s.yBase===void 0)return;const u=.6;if(h>=Math.PI/4)return s.yBase-(u+1.6);const m=h*(4/Math.PI);return s.yBase-(u*m+1.6)};return{load:o,disable:()=>{s.object&&(i.scene.remove(s.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!s.object)return;const h=a(i.getPose().latitude);h&&(s.object.position.y=h),i.scene.add(s.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function Kg(i,t){var c,d,h,u,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(d=t==null?void 0:t.fontSize)!=null?d:e*(35/256)*1.2,s=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",o=(u=t==null?void 0:t.fontColor)!=null?u:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=s,l.fillRect(0,0,e,e),l.font=`${n}px "微软雅黑"`,l.textAlign=r,l.fillStyle=o,l.fillText(i,e/2,e*.7),new _.CanvasTexture(a)}const $g=({x:i,y:t,z:e})=>new _.Vector3(i,t,e),ev=(i,t)=>{var v,p,b;const e={},n=(v=t.animationEnabled)!=null?v:!0,s=(p=t.position)!=null?p:void 0,o=(b=t.rad)!=null?b:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=w=>Y(this,null,function*(){var Z,G,R,H,Q,W,q,U;const P=(Z=w==null?void 0:w.position)!=null?Z:s;if(!P)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const k=$g(P),T=(G=w==null?void 0:w.rad)!=null?G:o,I=(R=w==null?void 0:w.fbx_url)!=null?R:r;if(e.rad=T,T===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${T}`));const B=yield new hs.FBXLoader().loadAsync(I);B.position.copy(k),B.rotation.z=T,B.scale.set(.8,.8,.8),Pc(B,{transparent:!0,side:E.DoubleSide});const L=(q=(W=(Q=(H=B.children)==null?void 0:H[0])==null?void 0:Q.children)==null?void 0:W[3])==null?void 0:q.clone();if(!L)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${L}`));const X=(U=t.name)!=null?U:"入户门";return L.material=new _.MeshBasicMaterial({transparent:!0,map:Kg(X)}),L.renderOrder=3,B.children[0].add(L),e.object=B,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const w=1,P=new _.AnimationMixer(e.object);a.push(P);const k=P.clipAction(e.object.animations[0]);k.timeScale=w;let T;const I=()=>{let Z=0,G=0;const R=1e3/30,H=Q=>{Z=requestAnimationFrame(H);const W=Q-G;W<R||(G=Q,a.forEach(q=>q.update(W/1e3)),i.needsRender=!0)};return Z=requestAnimationFrame(H),()=>{cancelAnimationFrame(Z)}},X={play:()=>{T||(k.play(),T=I(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{k.stop(),T==null||T(),T=void 0}};e.animation=X},d=w=>{var k;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((k=w==null?void 0:w.animationEnable)!=null?k:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},h=()=>{e.object&&(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},u=w=>w==="Floorplan"?d():h();return{load:l,enable:w=>(e.enabled||(e.enabled=!0,u(i.currentMode),i.on("modeChange",u),d(w)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),i.off("modeChange",u)),!0)}},tv=Et;function nv(i,t,e,n=tv.Linear.None){const s=new ps(i).to(t,e).easing(n);Cs(()=>s.start(0));const o=Li(a=>{s.update(a)===!1&&o()}),r=[];return s.onDestroy=a=>(r.push(a),s),s.destroy=function(){this.stop(),Object.assign(s,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();o()},s}function iv(i,t){return nv({progress:0},{progress:1},i,t)}var Ic=(i=>(i.Move="Move",i.Rotate="Rotate",i))(Ic||{}),Bt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(Bt||{});const Fs=Math.PI*2;function Ec(i){return(i%Fs+Fs)%Fs}function kc(i){return i%Fs}function pr(i,t,e){return i+(t-i)*e}const gr=(i,t,e)=>{const n=Math.PI,s=n*2;let o=Ec(i),r=Ec(t);return e===Bt.Anticlockwise&&o<r&&(o+=s),e===Bt.Clockwise&&r<o&&(r+=s),e===Bt.Loop&&r-o>n?gr(o,r,Bt.Anticlockwise):e===Bt.Loop&&o-r>n?gr(o,r,Bt.Clockwise):{from:o,to:r}},sv=i=>{const t={},e=(l,c,...d)=>Y(this,[l,c,...d],function*(o,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),o.mode&&o.mode!==i.currentMode&&(yield i.changeMode(o.mode)),a.preload&&o.panoIndex!==void 0&&o.panoIndex!==i.panoIndex&&(yield i.preloadPano(o.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),o.panoIndex===void 0&&o.fov===void 0&&o.latitude===void 0&&o.longitude===void 0?!0:yield new Promise((h,u)=>{const m=o.panoIndex!==void 0?o.panoIndex:i.panoIndex;m!==void 0?i.moveToPano(m,F({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>u(new Error("move canceled"))},o)):u(new Error("unexpected error"))})}),n=o=>{const r=i.state,a=kc(r.latitude),l=kc(o.latitude),{from:c,to:d}=gr(r.longitude,o.longitude,o.rotation||Bt.Loop),h=r.fov,u=o.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:d,fov:u}}};return{move:e,rotate:(l,c,...d)=>Y(this,[l,c,...d],function*(o,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==ve.Five.Mode.Panorama&&(yield i.changeMode(ve.Five.Mode.Panorama)),o.panoIndex!==void 0&&o.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(o.panoIndex)),yield new Promise((m,g)=>{if(!o.panoIndex){m(!0);return}i.moveToPano(o.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>g(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:u}=n(o);return yield new Promise(m=>{const g=({progress:P})=>{const k={};k.longitude=pr(h.longitude,u.longitude,P),k.latitude=pr(h.latitude,u.latitude,P),k.fov=pr(h.fov,u.fov,P),i.setState(k,!0)},v=()=>{m(!0)},p=()=>{m(!1)},b=o.rotateSpeed?Math.ceil(Math.abs(u.longitude-h.longitude)/o.rotateSpeed*1e3):r,w=iv(b,Et.Linear.None).onUpdate(g).onComplete(v).onDestroy(p);o.rotation===Bt.Loop&&w.repeat(1/0).yoyo(!0),t.interruptCallback=(P=!0)=>{w.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(P)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function xc(i,t){return i.x===t.x&&i.y===t.y}function Mc(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function Hs(i,t){return(t.y-i.y)/(t.x-i.x)}function Sc(i,t,e){const n=Hs(i[1],i[0]),s=Hs(t[1],t[0]);if(isNaN(n)||isNaN(s)||Mc(n,s))return!1;if(Ws(i[0],t))return i[0];if(Ws(i[1],t))return i[1];if(Ws(t[0],i))return t[0];if(Ws(t[1],i))return t[1];if(e&&!ov(i,t))return!1;const o=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:o.x,y:t[1].y-(t[1].x-o.x)*s};if(Math.abs(s)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-o.y+n*o.x-s*r.x)/(n-s),l=n*a-n*o.x+o.y;return{x:a,y:l}}function Ws(i,t){return xc(i,t[0])||xc(i,t[1])?!0:(t[0].x-i.x)*(i.x-t[1].x)>=0&&(t[0].y-i.y)*(i.y-t[1].y)>=0&&Mc(Hs(t[0],i),Hs(i,t[1]))}function Ns(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function ov(i,t){return Math.max(i[0].x,i[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(i[0].x,i[1].x)&&Math.max(i[0].y,i[1].y)>=Math.min(t[0].y,t[1].y)&&Ns(t[0],i[1],i[0])*Ns(i[1],t[1],i[0])>0&&Ns(i[0],t[1],t[0])*Ns(t[1],i[1],t[0])>0?1:0}function Dc(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>Dc(i,t-1))}const rv=`<style type="text/css">
|
|
194
|
+
`;return i.$$set=o=>{"content"in o&&e(0,n=o.content)},[n,s]}class op extends ce{constructor(t){super(),le(this,t,sp,ip,ae,{content:0},np)}}function rp(i){he(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function ap(i){let t,e;return t=new tp({props:{url:i[1].url}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.url=n[1].url),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function lp(i){let t,e;return t=new op({props:{content:i[0]}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.content=n[0]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function cp(i){let t,e,n,s;const o=[lp,ap],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=o[e](i)),{c(){t=S("div"),n&&n.c(),y(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){O(l,t,c),~e&&r[e].m(t,null),s=!0},p(l,[c]){let d=e;e=a(l),e===d?~e&&r[e].p(l,c):(n&&(ue(),z(r[d],1,1,()=>{r[d]=null}),fe()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=o[e](l),n.c()),x(n,1),n.m(t,null)):n=null)},i(l){s||(x(n),s=!0)},o(l){z(n),s=!1},d(l){l&&V(t),~e&&r[e].d()}}}function dp(i,t,e){let n,s,{floorIndex:o}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,o=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[o]),i.$$.dirty&12&&e(0,s=(l=(a=r.outlines)==null?void 0:a[o])==null?void 0:l.svgContent)},[s,n,o,r]}class Gl extends ce{constructor(t){super(),le(this,t,dp,cp,ae,{floorIndex:2,floorplanData:3},rp)}}function hp(i){he(i,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-12pzct5{opacity:0.45}")}function up(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new xs(!1),n=ke(),t.a=n},m(s,o){t.m(e,s,o),O(s,n,o)},p(s,o){o&256&&e!==(e=s[8].outerHTML+"")&&t.p(e)},d(s){s&&V(n),s&&t.d()}}}function fp(i){let t,e,n=i[1]&&Fl(i),s=i[0]&&Hl(i);return{c(){n&&n.c(),t=ee(),s&&s.c(),e=ke()},m(o,r){n&&n.m(o,r),O(o,t,r),s&&s.m(o,r),O(o,e,r)},p(o,r){o[1]?n?n.p(o,r):(n=Fl(o),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),o[0]?s?s.p(o,r):(s=Hl(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null)},d(o){n&&n.d(o),o&&V(t),s&&s.d(o),o&&V(e)}}}function Fl(i){let t,e=i[2].name+"",n;return{c(){t=S("span"),n=Te(e),y(t,"class","floorplan-plugin__room-name")},m(s,o){O(s,t,o),D(t,n)},p(s,o){o&4&&e!==(e=s[2].name+"")&&Oe(n,e)},d(s){s&&V(t)}}}function Hl(i){let t,e;return{c(){t=S("span"),e=Te(i[7]),y(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,s){O(n,t,s),D(t,e)},p(n,s){s&128&&Oe(e,n[7])},d(n){n&&V(t)}}}function mp(i){let t,e,n;function s(a,l){if(a[3]===void 0)return fp;if(a[8])return up}let o=s(i),r=o&&o(i);return{c(){t=S("div"),r&&r.c(),y(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),j(t,"left",i[9]),j(t,"top",i[10]),j(t,"font-size",i[11]),j(t,"opacity",i[6]?"1":"0")},m(a,l){O(a,t,l),r&&r.m(t,null),e||(n=[Nt(ei.call(null,t)),ye(t,"clientWidth",i[19]),ye(t,"clientHeight",i[20])],e=!0)},p(a,[l]){o===(o=s(a))&&r?r.p(a,l):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null))),l&64&&j(t,"opacity",a[6]?"1":"0")},i:J,o:J,d(a){a&&V(t),r&&r.d(),e=!1,Ze(n)}}}function pp(i,t){const e=i[0],n=i[1];let s=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){const a=t[o][0],l=t[o][1],c=t[r][0],d=t[r][1];l>n!=d>n&&e<(c-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function gp(i,t,e){let n,s,o,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:d}=t,{room:h}=t,{hoveredRoom:u}=t,{getRoomAreaText:m}=t,{getLabelElement:g}=t,{adaptiveRoomLabelVisibleEnable:v}=t;function p(R,H){if(H.width===0||H.height===0)return()=>!1;const Q=R.path.map(({x:Ie,y:Ae})=>[Ie,Ae]),W=R.roomLabel.position,{x:q,y:U}=W,{width:K,height:de}=H,oe=K/2,Pe=de/2;return function(Ae){const Be=q*Ae,be=U*Ae,Ne=Q.map(([Ce,ze])=>[Ce*Ae,ze*Ae]);return[[Be+oe,be-Pe],[Be-oe,be-Pe],[Be-oe,be+Pe],[Be+oe,be+Pe]].every(Ce=>pp(Ce,Ne))}}const b=document.body.clientWidth,w=document.body.clientHeight,P=h.roomLabel,k=P.positionInImage.x*100+"%",T=P.positionInImage.y*100+"%",I=(b<500||w<500?10:14)+"px";let B=0,L=0,X=!1;u.subscribe(function(H){e(16,X=!!H&&H.id===h.id)});const Z=R=>{e(4,B=R.detail)},G=R=>{e(5,L=R.detail)};return i.$$set=R=>{"pxmm"in R&&e(12,l=R.pxmm),"roomAreaEnable"in R&&e(0,c=R.roomAreaEnable),"roomNameEnable"in R&&e(1,d=R.roomNameEnable),"room"in R&&e(2,h=R.room),"hoveredRoom"in R&&e(13,u=R.hoveredRoom),"getRoomAreaText"in R&&e(14,m=R.getRoomAreaText),"getLabelElement"in R&&e(3,g=R.getLabelElement),"adaptiveRoomLabelVisibleEnable"in R&&e(15,v=R.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=g==null?void 0:g(h)),i.$$.dirty&16388&&e(7,s=h.size?m(h.size):""),i.$$.dirty&48&&e(18,o={width:B,height:L}),i.$$.dirty&262148&&e(17,r=o?p(h,o):void 0),i.$$.dirty&233472&&e(6,a=v?X?!0:!!(r!=null&&r(l)):!0)},[c,d,h,g,B,L,a,s,n,k,T,I,l,u,m,v,X,r,o,Z,G]}class vp extends ce{constructor(t){super(),le(this,t,gp,mp,ae,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},hp)}}function Ap(i){he(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function Wl(i,t,e){const n=i.slice();return n[12]=t[e],n}function Nl(i){let t,e=[],n=new Map,s,o,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let d=Wl(i,a,c),h=l(d);n.set(h,e[c]=Yl(h,d))}return{c(){t=S("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,d){O(c,t,d);for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(t,null);s=!0,o||(r=[Nt(ei.call(null,t)),ye(t,"clientWidth",i[11])],o=!0)},p(c,d){d&447&&(a=c[8],ue(),e=St(e,d,l,1,c,a,n,t,dn,Yl,null,Wl),fe())},i(c){if(!s){for(let d=0;d<a.length;d+=1)x(e[d]);s=!0}},o(c){for(let d=0;d<e.length;d+=1)z(e[d]);s=!1},d(c){c&&V(t);for(let d=0;d<e.length;d+=1)e[d].d();o=!1,Ze(r)}}}function Yl(i,t){let e,n,s;const o=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<o.length;a+=1)r=Je(r,o[a]);return n=new vp({props:r}),{key:i,first:null,c(){e=ke(),se(n.$$.fragment),this.first=e},m(a,l){O(a,e,l),ne(n,a,l),s=!0},p(a,l){t=a;const c=l&447?it(o,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){s||(x(n.$$.fragment,a),s=!0)},o(a){z(n.$$.fragment,a),s=!1},d(a){a&&V(e),ie(n,a)}}}function bp(i){let t,e,n=i[8]&&Nl(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[8]?n?(n.p(s,o),o&256&&x(n,1)):(n=Nl(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function yp(i,t,e){let n,{floorIndex:s}=t,{roomAreaEnable:o}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:d}=t,{adaptiveRoomLabelVisibleEnable:h}=t,u=0,m=0;const g=v=>{e(6,u=v.detail)};return i.$$set=v=>{"floorIndex"in v&&e(9,s=v.floorIndex),"roomAreaEnable"in v&&e(0,o=v.roomAreaEnable),"roomNameEnable"in v&&e(1,r=v.roomNameEnable),"floorplanData"in v&&e(10,a=v.floorplanData),"hoveredRoom"in v&&e(2,l=v.hoveredRoom),"getRoomAreaText"in v&&e(3,c=v.getRoomAreaText),"getLabelElement"in v&&e(4,d=v.getLabelElement),"adaptiveRoomLabelVisibleEnable"in v&&e(5,h=v.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[s].rooms),i.$$.dirty&1088){const{max:v,min:p}=a.bounding,b=v.x-p.x;e(7,m=u/b)}},[o,r,l,c,d,h,u,m,n,s,a,g]}class wp extends ce{constructor(t){super(),le(this,t,yp,bp,ae,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Ap)}}function Cp(i){he(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function Xl(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function Ul(i,t,e){const n=i.slice();return n[14]=t[e],n}function ql(i){let t;return{c(){t=S("div"),y(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),j(t,"left",i[14].left*100+"%"),j(t,"bottom",i[14].bottom*100+"%")},m(e,n){O(e,t,n)},p:J,d(e){e&&V(t)}}}function Jl(i,t){let e,n,s=t[1](t[11].distance)+"",o,r;return{key:i,first:null,c(){e=S("div"),n=S("div"),o=Te(s),r=ee(),y(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),$(n,"is-row",t[2]),y(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),j(e,"left",t[11].left*100+"%"),j(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){O(a,e,l),D(e,n),D(n,o),D(e,r)},p(a,l){t=a,l&2&&s!==(s=t[1](t[11].distance)+"")&&Oe(o,s)},d(a){a&&V(e)}}}function Pp(i){let t,e,n,s,o,r,a=[],l=new Map,c,d=i[3],h=[];for(let g=0;g<d.length;g+=1)h[g]=ql(Ul(i,d,g));let u=i[4];const m=g=>g[13];for(let g=0;g<u.length;g+=1){let v=Xl(i,u,g),p=m(v);l.set(p,a[g]=Jl(p,v))}return{c(){t=S("div"),e=S("div"),n=ee(),s=S("div");for(let g=0;g<h.length;g+=1)h[g].c();o=ee(),r=S("div");for(let g=0;g<a.length;g+=1)a[g].c();y(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),y(s,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),$(s,"is-row",i[2]),y(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),y(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),$(t,"is-row",i[2]),j(t,"width",i[2]?"100%":1/16+"rem"),j(t,"height",i[2]?1/16+"rem":"100%")},m(g,v){O(g,t,v),D(t,e),D(t,n),D(t,s);for(let p=0;p<h.length;p+=1)h[p]&&h[p].m(s,null);D(t,o),D(t,r);for(let p=0;p<a.length;p+=1)a[p]&&a[p].m(r,null)},p(g,[v]){if(v&8){d=g[3];let p;for(p=0;p<d.length;p+=1){const b=Ul(g,d,p);h[p]?h[p].p(b,v):(h[p]=ql(b),h[p].c(),h[p].m(s,null))}for(;p<h.length;p+=1)h[p].d(1);h.length=d.length}v&22&&(u=g[4],a=St(a,v,m,1,g,u,l,r,tr,Jl,null,Xl)),v&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&y(t,"class",c),v&5&&$(t,"is-row",g[2])},i:J,o:J,d(g){g&&V(t),Mt(h,g);for(let v=0;v<a.length;v+=1)a[v].d()}}}const si=1e3,oi=180;function Ip(i,t,e){let{type:n}=t,{data:s}=t,{bounding:o}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=o.max.x-o.min.x-(si-oi)*2,c=o.max.y-o.min.y-(si-oi)*2,d=s.map(([g,v])=>a?[g.x,v.x]:[g.y,v.y]).flat().sort().filter((g,v,p)=>v===0?!0:g!==p[v-1]),h=d.map(g=>{const v=a?(g-o.min.x-si+oi)/l:0,p=a?0:(g-o.min.y-si+oi)/c;return{left:v,bottom:p}});h.unshift({left:0,bottom:0}),h.push(a?{left:1,bottom:0}:{left:0,bottom:1});const u=d[d.length-1]-d[0],m=d.map((g,v,p)=>{const b=v===0?0:g-p[v-1],w=v===0?0:(g+p[v-1])/2,P=a?(w-o.min.x-si+oi)/l:0,k=a?0:(w-o.min.y-si+oi)/c;return{left:P,bottom:k,distance:b}}).filter(({distance:g})=>g/u>.1);return i.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,s=g.data),"bounding"in g&&e(6,o=g.bounding),"getRuleDistanceText"in g&&e(1,r=g.getRuleDistanceText)},[n,r,a,h,m,s,o]}class Ep extends ce{constructor(t){super(),le(this,t,Ip,Pp,ae,{type:0,data:5,bounding:6,getRuleDistanceText:1},Cp)}}function kp(i){he(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Zl(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Kl(i,t){let e,n,s;const o=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<o.length;a+=1)r=Je(r,o[a]);return n=new Ep({props:r}),{key:i,first:null,c(){e=ke(),se(n.$$.fragment),this.first=e},m(a,l){O(a,e,l),ne(n,a,l),s=!0},p(a,l){t=a;const c=l&19?it(o,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){s||(x(n.$$.fragment,a),s=!0)},o(a){z(n.$$.fragment,a),s=!1},d(a){a&&V(e),ie(n,a)}}}function xp(i){let t,e=[],n=new Map,s,o=i[4];const r=a=>a[13];for(let a=0;a<o.length;a+=1){let l=Zl(i,o,a),c=r(l);n.set(c,e[a]=Kl(c,l))}return{c(){t=S("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),j(t,"width",i[3]),j(t,"height",i[2])},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(a,[l]){l&19&&(o=a[4],ue(),e=St(e,l,r,1,a,o,n,t,dn,Kl,null,Zl),fe()),l&8&&j(t,"width",a[3]),l&4&&j(t,"height",a[2])},i(a){if(!s){for(let l=0;l<o.length;l+=1)x(e[l]);s=!0}},o(a){for(let l=0;l<e.length;l+=1)z(e[l]);s=!1},d(a){a&&V(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const $l=1e3,ec=180;function Mp(i,t,e){let n,s,o,r,a,l,c,d,h,u,{floorIndex:m}=t,{floorplanData:g}=t,{getRuleDistanceText:v}=t;return i.$$set=p=>{"floorIndex"in p&&e(5,m=p.floorIndex),"floorplanData"in p&&e(6,g=p.floorplanData),"getRuleDistanceText"in p&&e(0,v=p.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=g.bounding),i.$$.dirty&96&&e(11,s=g.floorDatas[m].rules),i.$$.dirty&2048&&e(12,o=Object.keys(s)),i.$$.dirty&6144&&e(4,r=o.map(p=>[p,s[p]])),i.$$.dirty&2&&e(9,a=n.max.x-n.min.x),i.$$.dirty&2&&e(7,l=n.max.y-n.min.y),i.$$.dirty&2&&e(10,c=n.max.x-n.min.x-($l-ec)*2),i.$$.dirty&2&&e(8,d=n.max.y-n.min.y-($l-ec)*2),i.$$.dirty&1536&&e(3,h=c/a*100+"%"),i.$$.dirty&384&&e(2,u=d/l*100+"%")},[v,n,u,h,r,m,g,l,d,a,c,s,o]}class Sp extends ce{constructor(t){super(),le(this,t,Mp,xp,ae,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},kp)}}function Rs(i,t={}){let e="";const{needZ:n,needA:s}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,d=l+","+c;return a===0?(e+="M"+d,e):s!=null&&s[a]?(e+="A"+s[a]+","+d,e):(e+="L"+d,e)}),e+(n?"Z":"")}function tc({x:i,y:t},e){const{max:n,min:s}=e;return{x:i-s.x,y:n.y-t}}function Dp(i,t){const e=i.x*1e3+t.bounding.origin.x,n=-i.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function Lp(i,t){const e=t.bounding,n=e.max.x-e.min.x,s=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/s}}function Tp(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function zp(i){let t;return{c(){t=je("path"),y(t,"d",i[0]),y(t,"fill","#2F313A")},m(e,n){O(e,t,n)},p(e,[n]){n&1&&y(t,"d",e[0])},i:J,o:J,d(e){e&&V(t)}}}function jp(i,t,e){let n,{path:s}=t;return i.$$set=o=>{"path"in o&&e(1,s=o.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Rs(s,{needZ:!0}))},[n,s]}class Vp extends ce{constructor(t){super(),le(this,t,jp,zp,ae,{path:1})}}function Op(i){let t,e,n,s,o,r;return{c(){t=je("defs"),e=je("pattern"),n=je("rect"),s=je("path"),o=ee(),r=je("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width",i[1]),y(n,"height",i[1]),y(n,"fill","#323747"),y(s,"d",i[2]),y(s,"stroke","#ffffff"),y(s,"stroke-opacity","0.06"),y(s,"stroke-width","0.5"),y(s,"fill","none"),y(e,"id","fpm-room-pattern-0"),y(e,"x","0"),y(e,"y","0"),y(e,"width",i[1]),y(e,"height",i[1]),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(r,"d",i[0]),y(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){O(a,t,l),D(t,e),D(e,n),D(e,s),O(a,o,l),O(a,r,l)},p(a,[l]){l&1&&y(r,"d",a[0])},i:J,o:J,d(a){a&&V(t),a&&V(o),a&&V(r)}}}const rr=6;function Bp(i,t,e){let n,{path:s}=t;const o=rr*2,r=`M0 ${rr} h ${o} M${rr} 0 v ${o}`;return i.$$set=a=>{"path"in a&&e(3,s=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=Rs(s,{needZ:!0}))},[n,o,r,s]}class _p extends ce{constructor(t){super(),le(this,t,Bp,Op,ae,{path:3})}}function Qp(i){let t,e,n,s,o,r,a,l,c,d,h;return{c(){t=je("defs"),e=je("pattern"),n=je("rect"),s=je("pattern"),o=je("rect"),r=ee(),a=je("path"),l=ee(),c=je("path"),d=ee(),h=je("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width","6"),y(n,"height","50"),y(n,"fill","none"),y(n,"stroke","#4B4B57"),y(n,"stroke-width","0.5"),y(e,"id","room-material-pattern-1"),y(e,"x","0"),y(e,"y","0"),y(e,"width","12"),y(e,"height","50"),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(o,"x","0"),y(o,"y","0"),y(o,"width","6"),y(o,"height","50"),y(o,"fill","none"),y(o,"stroke","#4B4B57"),y(o,"stroke-width","0.5"),y(s,"id","room-material-pattern-2"),y(s,"x","6"),y(s,"y","25"),y(s,"width","12"),y(s,"height","50"),y(s,"patternUnits","userSpaceOnUse"),y(s,"patternTransform","scale(50 50)"),y(a,"d",i[0]),y(a,"fill","#43434D"),y(c,"d",i[0]),y(c,"fill","url(#room-material-pattern-1)"),y(h,"d",i[0]),y(h,"fill","url(#room-material-pattern-2)")},m(u,m){O(u,t,m),D(t,e),D(e,n),D(t,s),D(s,o),O(u,r,m),O(u,a,m),O(u,l,m),O(u,c,m),O(u,d,m),O(u,h,m)},p(u,[m]){m&1&&y(a,"d",u[0]),m&1&&y(c,"d",u[0]),m&1&&y(h,"d",u[0])},i:J,o:J,d(u){u&&V(t),u&&V(r),u&&V(a),u&&V(l),u&&V(c),u&&V(d),u&&V(h)}}}function Rp(i,t,e){let n,{path:s}=t;return i.$$set=o=>{"path"in o&&e(1,s=o.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Rs(s,{needZ:!0}))},[n,s]}class Gp extends ce{constructor(t){super(),le(this,t,Rp,Qp,ae,{path:1})}}function Fp(i){he(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function nc(i,t,e){const n=i.slice();return n[5]=t[e],n}function Hp(i){let t,e;return t=new _p({props:{path:i[5].path}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.path=n[5].path),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function Wp(i){let t,e;return t=new Gp({props:{path:i[5].path}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.path=n[5].path),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function Np(i){let t,e;return t=new Vp({props:{path:i[5].path}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.path=n[5].path),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function ic(i){let t,e,n,s;const o=[Np,Wp,Hp],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=o[e](i),{c(){t=je("svg"),n.c(),y(t,"width","100%"),y(t,"height","100%"),y(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),y(t,"class","svelte-1dykexu")},m(l,c){O(l,t,c),r[e].m(t,null),s=!0},p(l,c){let d=e;e=a(l),e===d?r[e].p(l,c):(ue(),z(r[d],1,1,()=>{r[d]=null}),fe(),n=r[e],n?n.p(l,c):(n=r[e]=o[e](l),n.c()),x(n,1),n.m(t,null))},i(l){s||(x(n),s=!0)},o(l){z(n),s=!1},d(l){l&&V(t),r[e].d()}}}function Yp(i){let t,e,n=i[0],s=[];for(let r=0;r<n.length;r+=1)s[r]=ic(nc(i,n,r));const o=r=>z(s[r],1,1,()=>{s[r]=null});return{c(){t=S("div");for(let r=0;r<s.length;r+=1)s[r].c();y(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){O(r,t,a);for(let l=0;l<s.length;l+=1)s[l]&&s[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=nc(r,n,l);s[l]?(s[l].p(c,a),x(s[l],1)):(s[l]=ic(c),s[l].c(),x(s[l],1),s[l].m(t,null))}for(ue(),l=n.length;l<s.length;l+=1)o(l);fe()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)x(s[a]);e=!0}},o(r){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)z(s[a]);e=!1},d(r){r&&V(t),Mt(s,r)}}}function Xp(i,t,e){let n,{floorIndex:s}=t,{floorplanData:o}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,s=l.floorIndex),"floorplanData"in l&&e(4,o=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=o.floorDatas[s].rooms.map(l=>we(F({},l),{path:l.path.map(c=>tc(c,o.bounding))})))},[n,r,a,s,o]}class Up extends ce{constructor(t){super(),le(this,t,Xp,Yp,ae,{floorIndex:3,floorplanData:4},Fp)}}function qp(i){he(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function Jp(i){let t,e,n,s;return{c(){t=je("path"),y(t,"d",i[5]),y(t,"fill","#fff"),y(t,"style",i[2]),y(t,"id",e=`${i[1]}_${i[0].id}`),y(t,"class","svelte-qq2273")},m(o,r){O(o,t,r),n||(s=[ye(t,"mouseenter",i[3]),ye(t,"mouseleave",i[4])],n=!0)},p(o,[r]){r&4&&y(t,"style",o[2]),r&3&&e!==(e=`${o[1]}_${o[0].id}`)&&y(t,"id",e)},i:J,o:J,d(o){o&&V(t),n=!1,Ze(s)}}}function Zp(i,t,e){let n,s,{room:o}=t,{floorIndex:r}=t,{floorplanData:a}=t,{highlightData:l}=t,{hoveredRoom:c}=t;function d(){c==null||c.set(o)}function h(){c==null||c.set(void 0)}const{bounding:u}=a,m=Rs(o.path,{needZ:!0,format:g=>tc(g,u)});return i.$$set=g=>{"room"in g&&e(0,o=g.room),"floorIndex"in g&&e(1,r=g.floorIndex),"floorplanData"in g&&e(6,a=g.floorplanData),"highlightData"in g&&e(7,l=g.highlightData),"hoveredRoom"in g&&e(8,c=g.hoveredRoom)},i.$$.update=()=>{i.$$.dirty&131&&e(9,n=l[`${r}_${o.id}`]),i.$$.dirty&512&&e(2,s=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[o,r,s,d,h,m,a,l,c,n]}class Kp extends ce{constructor(t){super(),le(this,t,Zp,Jp,ae,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},qp)}}function $p(i){he(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function sc(i,t,e){const n=i.slice();return n[6]=t[e],n}function oc(i,t){let e,n,s;const o=[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}];let r={};for(let a=0;a<o.length;a+=1)r=Je(r,o[a]);return n=new Kp({props:r}),{key:i,first:null,c(){e=ke(),se(n.$$.fragment),this.first=e},m(a,l){O(a,e,l),ne(n,a,l),s=!0},p(a,l){t=a;const c=l&15?it(o,[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}]):{};n.$set(c)},i(a){s||(x(n.$$.fragment,a),s=!0)},o(a){z(n.$$.fragment,a),s=!1},d(a){a&&V(e),ie(n,a)}}}function eg(i){let t,e,n=[],s=new Map,o,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=sc(i,r,l),d=a(c);s.set(d,n[l]=oc(d,c))}return{c(){t=S("div"),e=je("svg");for(let l=0;l<n.length;l+=1)n[l].c();y(e,"width","100%"),y(e,"height","100%"),y(e,"viewBox",`0 0 ${i[4]} ${i[5]}`),y(e,"class","svelte-1kqo6e4"),y(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){O(l,t,c),D(t,e);for(let d=0;d<n.length;d+=1)n[d]&&n[d].m(e,null);o=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,ue(),n=St(n,c,a,1,l,r,s,e,dn,oc,null,sc),fe())},i(l){if(!o){for(let c=0;c<r.length;c+=1)x(n[c]);o=!0}},o(l){for(let c=0;c<n.length;c+=1)z(n[c]);o=!1},d(l){l&&V(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function tg(i,t,e){let{floorIndex:n}=t,{floorplanData:s}=t,{highlightData:o}=t,{hoveredRoom:r}=t;const a=s.bounding.max.x-s.bounding.min.x,l=s.bounding.max.y-s.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,s=c.floorplanData),"highlightData"in c&&e(2,o=c.highlightData),"hoveredRoom"in c&&e(3,r=c.hoveredRoom)},[n,s,o,r,a,l]}class rc extends ce{constructor(t){super(),le(this,t,tg,eg,ae,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},$p)}}function ng(i){he(i,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function ac(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let s={};for(let o=0;o<n.length;o+=1)s=Je(s,n[o]);return t=new rc({props:s}),{c(){se(t.$$.fragment)},m(o,r){ne(t,o,r),e=!0},p(o,r){const a=r&24834?it(n,[{floorIndex:o[1],floorplanData:o[8],hoveredRoom:o[14],highlightData:o[13]}]):{};t.$set(a)},i(o){e||(x(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function lc(i){let t,e;const n=[{floorplanData:i[8],roomAreaEnable:i[5],roomNameEnable:i[6],floorIndex:i[1],getRoomAreaText:i[9],getLabelElement:i[10],hoveredRoom:i[14],adaptiveRoomLabelVisibleEnable:i[12]}];let s={};for(let o=0;o<n.length;o+=1)s=Je(s,n[o]);return t=new wp({props:s}),{c(){se(t.$$.fragment)},m(o,r){ne(t,o,r),e=!0},p(o,r){const a=r&22370?it(n,[{floorplanData:o[8],roomAreaEnable:o[5],roomNameEnable:o[6],floorIndex:o[1],getRoomAreaText:o[9],getLabelElement:o[10],hoveredRoom:o[14],adaptiveRoomLabelVisibleEnable:o[12]}]):{};t.$set(a)},i(o){e||(x(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function cc(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let s={};for(let o=0;o<n.length;o+=1)s=Je(s,n[o]);return t=new Sp({props:s}),{c(){se(t.$$.fragment)},m(o,r){ne(t,o,r),e=!0},p(o,r){const a=r&2306?it(n,[{floorplanData:o[8],floorIndex:o[1],getRuleDistanceText:o[11]}]):{};t.$set(a)},i(o){e||(x(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function ig(i){let t,e,n,s,o,r,a,l,c;const d=[{floorIndex:i[1],floorplanData:i[8]}];let h={};for(let b=0;b<d.length;b+=1)h=Je(h,d[b]);e=new Up({props:h});let u=(i[2]||i[3])&&ac(i);const m=[{floorplanData:i[8],floorIndex:i[1]}];let g={};for(let b=0;b<m.length;b+=1)g=Je(g,m[b]);o=new Gl({props:g});let v=i[4]&&lc(i),p=i[7]&&cc(i);return{c(){t=S("div"),se(e.$$.fragment),n=ee(),u&&u.c(),s=ee(),se(o.$$.fragment),r=ee(),v&&v.c(),a=ee(),p&&p.c(),y(t,"class",l=Qe(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(b,w){O(b,t,w),ne(e,t,null),D(t,n),u&&u.m(t,null),D(t,s),ne(o,t,null),D(t,r),v&&v.m(t,null),D(t,a),p&&p.m(t,null),c=!0},p(b,[w]){const P=w&258?it(d,[{floorIndex:b[1],floorplanData:b[8]}]):{};e.$set(P),b[2]||b[3]?u?(u.p(b,w),w&12&&x(u,1)):(u=ac(b),u.c(),x(u,1),u.m(t,s)):u&&(ue(),z(u,1,1,()=>{u=null}),fe());const k=w&258?it(m,[{floorplanData:b[8],floorIndex:b[1]}]):{};o.$set(k),b[4]?v?(v.p(b,w),w&16&&x(v,1)):(v=lc(b),v.c(),x(v,1),v.m(t,a)):v&&(ue(),z(v,1,1,()=>{v=null}),fe()),b[7]?p?(p.p(b,w),w&128&&x(p,1)):(p=cc(b),p.c(),x(p,1),p.m(t,null)):p&&(ue(),z(p,1,1,()=>{p=null}),fe()),(!c||w&1&&l!==(l=Qe(`floorplan-plugin__floor${b[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&y(t,"class",l)},i(b){c||(x(e.$$.fragment,b),x(u),x(o.$$.fragment,b),x(v),x(p),c=!0)},o(b){z(e.$$.fragment,b),z(u),z(o.$$.fragment,b),z(v),z(p),c=!1},d(b){b&&V(t),ie(e),u&&u.d(),ie(o),v&&v.d(),p&&p.d()}}}function sg(i,t,e){let{isCurrent:n}=t,{floorIndex:s}=t,{highlightEnable:o}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:d}=t,{floorplanData:h}=t,{getRoomAreaText:u}=t,{getLabelElement:m}=t,{getRuleDistanceText:g}=t,{adaptiveRoomLabelVisibleEnable:v}=t,{highlightData:p}=t;const b=or(void 0);return i.$$set=w=>{"isCurrent"in w&&e(0,n=w.isCurrent),"floorIndex"in w&&e(1,s=w.floorIndex),"highlightEnable"in w&&e(2,o=w.highlightEnable),"hoverEnable"in w&&e(3,r=w.hoverEnable),"roomLabelsEnable"in w&&e(4,a=w.roomLabelsEnable),"roomAreaEnable"in w&&e(5,l=w.roomAreaEnable),"roomNameEnable"in w&&e(6,c=w.roomNameEnable),"ruleLabelsEnable"in w&&e(7,d=w.ruleLabelsEnable),"floorplanData"in w&&e(8,h=w.floorplanData),"getRoomAreaText"in w&&e(9,u=w.getRoomAreaText),"getLabelElement"in w&&e(10,m=w.getLabelElement),"getRuleDistanceText"in w&&e(11,g=w.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in w&&e(12,v=w.adaptiveRoomLabelVisibleEnable),"highlightData"in w&&e(13,p=w.highlightData)},[n,s,o,r,a,l,c,d,h,u,m,g,v,p,b]}let og=class extends ce{constructor(t){super(),le(this,t,sg,ig,ae,{isCurrent:0,floorIndex:1,highlightEnable:2,hoverEnable:3,roomLabelsEnable:4,roomAreaEnable:5,roomNameEnable:6,ruleLabelsEnable:7,floorplanData:8,getRoomAreaText:9,getLabelElement:10,getRuleDistanceText:11,adaptiveRoomLabelVisibleEnable:12,highlightData:13},ng)}};function rg(i){he(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function dc(i,t,e){const n=i.slice();return n[21]=t[e],n}function hc(i){let t,e,n,s,o,r=i[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=uc(dc(i,r,h));const l=h=>z(a[h],1,1,()=>{a[h]=null});let c=i[5]&&fc(i),d=i[8]&&mc(i);return{c(){t=S("div");for(let h=0;h<a.length;h+=1)a[h].c();e=ee(),c&&c.c(),n=ee(),d&&d.c(),y(t,"class","floorplan-main svelte-86bqav")},m(h,u){O(h,t,u);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(t,null);D(t,e),c&&c.m(t,null),D(t,n),d&&d.m(t,null),o=!0},p(h,u){if(i=h,u&2047696){r=i[13].floorDatas;let m;for(m=0;m<r.length;m+=1){const g=dc(i,r,m);a[m]?(a[m].p(g,u),x(a[m],1)):(a[m]=uc(g),a[m].c(),x(a[m],1),a[m].m(t,e))}for(ue(),m=r.length;m<a.length;m+=1)l(m);fe()}i[5]?c?(c.p(i,u),u&32&&x(c,1)):(c=fc(i),c.c(),x(c,1),c.m(t,n)):c&&(ue(),z(c,1,1,()=>{c=null}),fe()),i[8]?d?(d.p(i,u),u&256&&x(d,1)):(d=mc(i),d.c(),x(d,1),d.m(t,null)):d&&(ue(),z(d,1,1,()=>{d=null}),fe())},i(h){if(!o){for(let u=0;u<r.length;u+=1)x(a[u]);x(c),x(d),s||nt(()=>{s=yn(t,wn,{duration:i[0],easing:on}),s.start()}),o=!0}},o(h){a=a.filter(Boolean);for(let u=0;u<a.length;u+=1)z(a[u]);z(c),z(d),o=!1},d(h){h&&V(t),Mt(a,h),c&&c.d(),d&&d.d()}}}function uc(i){let t,e;const n=[{hoverEnable:i[6],highlightEnable:i[7],floorplanData:i[13],getRoomAreaText:i[16],getLabelElement:i[17],getRuleDistanceText:i[18],roomLabelsEnable:i[9],roomAreaEnable:i[10],roomNameEnable:i[11],ruleLabelsEnable:i[12],adaptiveRoomLabelVisibleEnable:i[19],highlightData:i[20]},{floorIndex:i[21].floorIndex},{isCurrent:i[21].floorIndex===i[4]}];let s={};for(let o=0;o<n.length;o+=1)s=Je(s,n[o]);return t=new og({props:s}),{c(){se(t.$$.fragment)},m(o,r){ne(t,o,r),e=!0},p(o,r){const a=r&2047696?it(n,[r&2047680&&{hoverEnable:o[6],highlightEnable:o[7],floorplanData:o[13],getRoomAreaText:o[16],getLabelElement:o[17],getRuleDistanceText:o[18],roomLabelsEnable:o[9],roomAreaEnable:o[10],roomNameEnable:o[11],ruleLabelsEnable:o[12],adaptiveRoomLabelVisibleEnable:o[19],highlightData:o[20]},r&8192&&{floorIndex:o[21].floorIndex},r&8208&&{isCurrent:o[21].floorIndex===o[4]}]):{};t.$set(a)},i(o){e||(x(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function fc(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let s={};for(let o=0;o<n.length;o+=1)s=Je(s,n[o]);return t=new Wm({props:s}),{c(){se(t.$$.fragment)},m(o,r){ne(t,o,r),e=!0},p(o,r){const a=r&57352?it(n,[{panoIndex:o[3],floorplanData:o[13],lastPanoramaLongitude:o[14],cameraImageUrl:o[15]}]):{};t.$set(a)},i(o){e||(x(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function mc(i){let t,e;return t=new Zm({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&8192&&(o.floorplanData=n[13]),s&4&&(o.northDesc=n[2]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function ag(i){let t,e,n=i[1]&&hc(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[1]?n?(n.p(s,o),o&2&&x(n,1)):(n=hc(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function lg(i,t,e){let{duration:n=0}=t,{visible:s}=t,{northDesc:o}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:d}=t,{compassEnable:h}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:m}=t,{roomNameEnable:g}=t,{ruleLabelsEnable:v}=t,{floorplanData:p}=t,{lastPanoramaLongitude:b}=t,{cameraImageUrl:w}=t,{getRoomAreaText:P}=t,{getLabelElement:k}=t,{getRuleDistanceText:T}=t,{adaptiveRoomLabelVisibleEnable:I}=t,{highlightData:B}=t;return i.$$set=L=>{"duration"in L&&e(0,n=L.duration),"visible"in L&&e(1,s=L.visible),"northDesc"in L&&e(2,o=L.northDesc),"panoIndex"in L&&e(3,r=L.panoIndex),"floorIndex"in L&&e(4,a=L.floorIndex),"cameraEnable"in L&&e(5,l=L.cameraEnable),"hoverEnable"in L&&e(6,c=L.hoverEnable),"highlightEnable"in L&&e(7,d=L.highlightEnable),"compassEnable"in L&&e(8,h=L.compassEnable),"roomLabelsEnable"in L&&e(9,u=L.roomLabelsEnable),"roomAreaEnable"in L&&e(10,m=L.roomAreaEnable),"roomNameEnable"in L&&e(11,g=L.roomNameEnable),"ruleLabelsEnable"in L&&e(12,v=L.ruleLabelsEnable),"floorplanData"in L&&e(13,p=L.floorplanData),"lastPanoramaLongitude"in L&&e(14,b=L.lastPanoramaLongitude),"cameraImageUrl"in L&&e(15,w=L.cameraImageUrl),"getRoomAreaText"in L&&e(16,P=L.getRoomAreaText),"getLabelElement"in L&&e(17,k=L.getLabelElement),"getRuleDistanceText"in L&&e(18,T=L.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in L&&e(19,I=L.adaptiveRoomLabelVisibleEnable),"highlightData"in L&&e(20,B=L.highlightData)},[n,s,o,r,a,l,c,d,h,u,m,g,v,p,b,w,P,k,T,I,B]}let ar=class extends ce{constructor(t){super(),le(this,t,lg,ag,ae,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,ruleLabelsEnable:12,floorplanData:13,lastPanoramaLongitude:14,cameraImageUrl:15,getRoomAreaText:16,getLabelElement:17,getRuleDistanceText:18,adaptiveRoomLabelVisibleEnable:19,highlightData:20},rg)}};const cg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function dg(i){return Y(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(s){return Y(this,null,function*(){const o={index:s.index,url:s.url,svgUrl:s.svg_url};if(s.svg_url){const r=yield fetch(s.svg_url,{headers:t}).then(a=>a.text());o.svgContent=r}return o})};return yield Promise.all(i.map(e))})}function hg(i){return{id:i.id,size:i.size,name:i.name,path:i.path,roomType:i.room_type,floorType:i.floor_type,roomLabel:{position:i.room_label.position,positionInImage:i.room_label.position_in_image},observerIndexs:i.observer_indexs}}function ug(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(hg),rules:i.rules}}function fg(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function mg(i){return{rad:i.rad,position:i.position,positionInImage:i.position_in_image,northRad:i.north_rad,roomId:i.room_id,floorIndex:i.floor_index}}function fn(i){return Y(this,null,function*(){const t=yield dg(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(ug),s=i.computed_data.entrance?mg(i.computed_data.entrance):null;return{outlines:t,entrance:s,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(fg)}})}function pg(i,t,e){return i.map(s=>{const o=s.position,r=s.icon?s.icon:{url:cg,width:45,height:48},a=Tp(o,t),l=Dp(o,e),c=Lp(l,e);return{floorIndex:a,icon:r,id:s.id,position:l,positionInImage:c}})}function gg(i,t){return t(i),i}function Gs(i,t){return gg({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function pc(i,t){const e=Math.max(...i.work.observers.map(n=>n.floorIndex));return t>e?i.model.bounding.max.y:Math.max(...i.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function lr(i,t,e=hn.BOUNDING_CENTER){const n=pc(i,t),s=pc(i,t+1);return e===hn.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===hn.CEILING?s:n}function cr(i,t,e,n){const s=lr(i,e,n==null?void 0:n.attachedTo),o=new E.Vector3(0,s,0),r=new E.Vector3(1,s,0),a=o.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}let ji=class{constructor(t,e){f(this,"VERSION","2.21.0-dev.6");f(this,"five");f(this,"hooks",new Qn);f(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}isAbsoluteURL(t){return Fo(t)?t:`${this.staticPrefix}${t}`}},Cn=class extends ji{};var bt=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(bt||{});const gc=500,vg=80;function dr(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function hr(i,t){return Y(this,null,function*(){const[e]=yield ti(i.changeMode(...t));if(e)throw new Error("change mode canceled");yield new Promise(r=>{i.once("initAnimationWillStart",()=>{i.once("initAnimationEnded",()=>r())})});const n=t[1];if(!n)return!0;const s=i.getCurrentState();if(!Ag(n,s))throw new Error("pose 与预期不符")})}function Ag(i,t){return Object.keys(i).every(e=>{const n=t[e];if(n===void 0)return!0;const s=i[e];return typeof n=="number"&&typeof s=="number"?dr(n,s,2):n===s})}function ur(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:s}=t,{latitude:o,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!dr(e,o,2)||!dr(n,r,2)||s!==a)}function vc(i,t,e=!0){return Y(this,null,function*(){if(ur(i,t)===!0)return;const s=i.getCurrentState();if(s.mode!==t.mode){const[d]=yield ti(hr(i,[t.mode,t,void 0,e]));if(d)throw new Error(bt.ChangeModeError);return}const{latitude:o,longitude:r,fov:a}=s,l=Math.min(1e3,Math.max(200,Math.abs(o-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ti(i.updateCamera(t,l,e));if(c)throw new Error(bt.UpdateCameraError)})}function ri(i,t,e=300){const n=i.getElement();n&&(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(s=>n.addEventListener("transitionend",s,{once:!0})),new Promise(s=>setTimeout(s,e))]).then(()=>{n.style.transition="none"}))}function bg(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||s}function yg(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&s}let wg=class extends Cn{constructor(e,n){var a;super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"show",(...n)=>Y(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));f(this,"hide",(...n)=>Y(this,[...n],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!ur(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,o=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=cr(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s,o,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(s=this.showRejection)==null||s.call(this,bt.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>Y(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(bt.ModelNotLoaded);if(!this.data)throw new Error(bt.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=F(F({},n),e),o=()=>Y(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ti(vc(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(bt.UnknownError);this.updateSize(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex);const d=s.modelOpacity,h=s.immediately?0:gc;ri(this.five,d,h),this.render(h)});return this.showPromise=o().then(()=>{this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,bt.BreakOffByHide),this.showPromise=void 0;const s=F(F({},{userAction:!0,isAutoHide:!1}),e);ri(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();s.mode==="Floorplan"&&(this.state.visible||yg(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();bg(s)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});f(this,"onFiveWantsGesture",(e,n)=>{if(this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:vg/((a=n==null?void 0:n.scale)!=null?a:1)};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:un,attachedTo:hn.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"㎡",getRuleDistanceText:l=>l.toString()},o=n?Gs(n,["selector","scale"]):{},r=F(F({},s),o);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,s=!0){return Y(this,null,function*(){function o(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield fn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return Y(this,null,function*(){return yield fn(e.data)})}updateState(e,n){const s=this.state,o=e.config?F(F({},s.config),e.config):s.config;this.state=we(F(F({},this.state),e),{config:o}),!Ot(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=we(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new ar({target:this.container,intro:!0,props:n})}};const Cg=(i,t)=>new wg(i,t);function Pg(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||s}function Ig(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&s}let Eg=class extends Cn{constructor(e,n){super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"show",(...n)=>Y(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));f(this,"hide",(...n)=>Y(this,[...n],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!ur(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,o=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=cr(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s,o,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(s=this.showRejection)==null||s.call(this,bt.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>Y(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(bt.ModelNotLoaded);if(!this.data)throw new Error(bt.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=F(F({},n),e),o=()=>Y(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ti(vc(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(bt.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex);const d=s.modelOpacity,h=s.immediately?0:gc;ri(this.five,d,h),this.render(h)});return this.showPromise=o().then(()=>{this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,bt.BreakOffByHide),this.showPromise=void 0;const s=F(F({},{userAction:!0,isAutoHide:!1}),e);ri(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Pg(s)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();return s.mode!==this.showState.mode||this.state.visible?void 0:(Ig(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:un,attachedTo:hn.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},o=n?Gs(n,["selector","scale"]):{},r=F(F({},s),o);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,s=!0){return Y(this,null,function*(){function o(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield fn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=lr(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const s=n.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}formatData(e){return Y(this,null,function*(){return yield fn(e.data)})}updateState(e,n){const s=this.state,o=e.config?F(F({},s.config),e.config):s.config;this.state=we(F(F({},this.state),e),{config:o}),!Ot(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=we(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new ar({target:this.container,intro:!0,props:n})}};const kg=(i,t)=>new Eg(i,t);let xg=class extends Cn{constructor(e,n){super(e);f(this,"name","topviewFloorplanPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"selector");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,o=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=cr(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s,o;const{userAction:n}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,(o=this.container)==null||o.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{this.state.visible&&(this.updatePosition(),this.updateSize())});f(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});f(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});f(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"));const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:un,attachedTo:hn.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},o=n?Gs(n,["selector","scale"]):{},r=F(F({},s),o);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,s=!0){return Y(this,null,function*(){function o(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield fn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),this.render()})}updatePosition(){var a;const e=lr(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const s=n.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return Y(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return Y(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return Y(this,null,function*(){return yield fn(e.data)})}_show(e){return Y(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield hr(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const s=500,o=this.state.config.modelOpacity;ri(this.five,o,s),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return Y(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const s=1,o=0;ri(this.five,s,o),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const s=this.state,o=e.config?F(F({},s.config),e.config):s.config;this.state=we(F(F({},this.state),e),{config:o}),!Ot(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=we(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new ar({target:this.container,intro:!0,props:n})}};const Mg=(i,t)=>new xg(i,t);function fr(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Sg(i){he(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function Dg(i){let t,e,n;return{c(){t=S("div"),e=S("div"),n=S("div"),y(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),j(n,"background-image","url("+(i[0]||un)+")"),j(n,"transform",i[1]),y(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),j(e,"transform",i[2]),y(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(s,o){O(s,t,o),D(t,e),D(e,n)},p(s,[o]){o&1&&j(n,"background-image","url("+(s[0]||un)+")"),(o&1||o&3)&&j(n,"transform",s[1]),o&4&&j(e,"transform",s[2])},i:J,o:J,d(s){s&&V(t)}}}function Lg(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Tg(i,t,e){let n,s,{five:o}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=o.getCurrentState().panoIndex,d=o.getCurrentState().longitude;function h(g,v){const p=g.bounding,b=g.observers[v];if(!b)return"";const w=(p.max.x-p.min.x)*r,P=(p.max.y-p.min.y)*r,k=Math.floor(b.positionInImage.x*w),T=Math.floor(b.positionInImage.y*P);return`translate(${k}px, ${T}px)`}function u(g){e(6,c=g)}const m=fr(g=>{e(7,d=g.longitude)},1e3/60);return At(()=>(o.on("panoWillArrive",u),o.on("cameraDirectionUpdate",m),function(){o.off("panoWillArrive",u),o.off("cameraDirectionUpdate",m)})),i.$$set=g=>{"five"in g&&e(3,o=g.five),"pxmm"in g&&e(4,r=g.pxmm),"floorplanData"in g&&e(5,a=g.floorplanData),"cameraImageUrl"in g&&e(0,l=g.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=h(a,c)),i.$$.dirty&128&&e(1,s=Lg(d))},[l,s,n,o,r,a,c,d]}class zg extends ce{constructor(t){super(),le(this,t,Tg,Dg,ae,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Sg)}}function jg(i){he(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function Ac(i,t,e){const n=i.slice();return n[1]=t[e],n}function bc(i,t){let e,n,s=`${t[1].icon.width/16}rem`,o=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=S("div"),n=S("div"),r=ee(),y(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),j(n,"background-image",`url(${t[1].icon.url})`),j(n,"width",s),j(n,"height",o),y(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),j(e,"top",a),j(e,"left",l),this.first=e},m(c,d){O(c,e,d),D(e,n),D(e,r)},p(c,d){t=c,d&1&&j(n,"background-image",`url(${t[1].icon.url})`);const h=d&1;h&&j(n,"width",s),h&&j(n,"height",o),d&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&j(e,"top",a),d&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&j(e,"left",l)},d(c){c&&V(e)}}}function Vg(i){let t,e=[],n=new Map,s=i[0];const o=r=>r[1].id;for(let r=0;r<s.length;r+=1){let a=Ac(i,s,r),l=o(a);n.set(l,e[r]=bc(l,a))}return{c(){t=S("div");for(let r=0;r<e.length;r+=1)e[r].c();y(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){O(r,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(r,[a]){a&1&&(s=r[0],e=St(e,a,o,1,r,s,n,t,tr,bc,null,Ac))},i:J,o:J,d(r){r&&V(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Og(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=s=>{"extraObjects"in s&&e(0,n=s.extraObjects)},[n]}class Bg extends ce{constructor(t){super(),le(this,t,Og,Vg,ae,{extraObjects:0},jg)}}function yc(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[7],highlightData:i[5],hoveredRoom:void 0}];let s={};for(let o=0;o<n.length;o+=1)s=Je(s,n[o]);return t=new rc({props:s}),{c(){se(t.$$.fragment)},m(o,r){ne(t,o,r),e=!0},p(o,r){const a=r&183?it(n,[{five:o[0],pxmm:o[1],floorIndex:o[2],floorplanData:o[4],onRoomHeightClick:o[7],highlightData:o[5],hoveredRoom:void 0}]):{};t.$set(a)},i(o){e||(x(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function _g(i){let t,e,n,s,o,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let d=0;d<a.length;d+=1)l=Je(l,a[d]);t=new Gl({props:l}),n=new Bg({props:{extraObjects:i[6]}});let c=i[3]&&yc(i);return{c(){se(t.$$.fragment),e=ee(),se(n.$$.fragment),s=ee(),c&&c.c(),o=ke()},m(d,h){ne(t,d,h),O(d,e,h),ne(n,d,h),O(d,s,h),c&&c.m(d,h),O(d,o,h),r=!0},p(d,[h]){const u=h&20?it(a,[{floorIndex:d[2],floorplanData:d[4]}]):{};t.$set(u);const m={};h&64&&(m.extraObjects=d[6]),n.$set(m),d[3]?c?(c.p(d,h),h&8&&x(c,1)):(c=yc(d),c.c(),x(c,1),c.m(o.parentNode,o)):c&&(ue(),z(c,1,1,()=>{c=null}),fe())},i(d){r||(x(t.$$.fragment,d),x(n.$$.fragment,d),x(c),r=!0)},o(d){z(t.$$.fragment,d),z(n.$$.fragment,d),z(c),r=!1},d(d){ie(t,d),d&&V(e),ie(n,d),d&&V(s),c&&c.d(d),d&&V(o)}}}function Qg(i,t,e){let n,{five:s}=t,{pxmm:o}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t,{highlightData:d}=t;const h=void 0;return i.$$set=u=>{"five"in u&&e(0,s=u.five),"pxmm"in u&&e(1,o=u.pxmm),"floorIndex"in u&&e(2,r=u.floorIndex),"hoverEnable"in u&&e(3,a=u.hoverEnable),"floorplanData"in u&&e(4,l=u.floorplanData),"extraObjects"in u&&e(8,c=u.extraObjects),"highlightData"in u&&e(5,d=u.highlightData)},i.$$.update=()=>{i.$$.dirty&260&&e(6,n=c==null?void 0:c.filter(u=>u.floorIndex===r))},[s,o,r,a,l,d,n,h,c]}class Rg extends ce{constructor(t){super(),le(this,t,Qg,_g,ae,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function Gg(i){he(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function wc(i){let t,e,n,s,o=i[7]!==0&&Cc(i);return{c(){t=S("div"),o&&o.c(),y(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){O(r,t,a),o&&o.m(t,null),e=!0,n||(s=[Nt(ei.call(null,t)),ye(t,"clientWidth",i[13]),ye(t,"clientHeight",i[14])],n=!0)},p(r,a){r[7]!==0?o?(o.p(r,a),a&128&&x(o,1)):(o=Cc(r),o.c(),x(o,1),o.m(t,null)):o&&(ue(),z(o,1,1,()=>{o=null}),fe())},i(r){e||(x(o),e=!0)},o(r){z(o),e=!1},d(r){r&&V(t),o&&o.d(),n=!1,Ze(s)}}}function Cc(i){let t,e,n,s,o=`${i[9]}px`,r=`${i[12]}px`,a;const l=[{five:i[0],pxmm:i[10],floorIndex:i[11],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5],highlightData:i[6]}];let c={};for(let u=0;u<l.length;u+=1)c=Je(c,l[u]);e=new Rg({props:c});const d=[{pxmm:i[10],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let h={};for(let u=0;u<d.length;u+=1)h=Je(h,d[u]);return s=new zg({props:h}),{c(){t=S("div"),se(e.$$.fragment),n=ee(),se(s.$$.fragment),y(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),j(t,"width",o),j(t,"height",r)},m(u,m){O(u,t,m),ne(e,t,null),D(t,n),ne(s,t,null),a=!0},p(u,m){const g=m&3181?it(l,[{five:u[0],pxmm:u[10],floorIndex:u[11],floorplanData:u[3],hoverEnable:u[2],extraObjects:u[5],highlightData:u[6]}]):{};e.$set(g);const v=m&1049?it(d,[{pxmm:u[10],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};s.$set(v),m&512&&o!==(o=`${u[9]}px`)&&j(t,"width",o),m&4096&&r!==(r=`${u[12]}px`)&&j(t,"height",r)},i(u){a||(x(e.$$.fragment,u),x(s.$$.fragment,u),a=!0)},o(u){z(e.$$.fragment,u),z(s.$$.fragment,u),a=!1},d(u){u&&V(t),ie(e),ie(s)}}}function Fg(i){let t,e,n=i[1]&&wc(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[1]?n?(n.p(s,o),o&2&&x(n,1)):(n=wc(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function Hg(i,t,e){var P,k;let{five:n}=t,{visible:s}=t,{hoverEnable:o}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,d=0,h=(k=(P=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:P.floorIndex)!=null?k:0,u=0,m=0,g=0,v=0;function p(T){e(11,h=n.work.observers[T].floorIndex)}At(()=>(n.on("panoArrived",p),()=>{n.off("panoArrived",p)}));const b=T=>{e(7,u=T.detail)},w=T=>{e(8,m=T.detail)};return i.$$set=T=>{"five"in T&&e(0,n=T.five),"visible"in T&&e(1,s=T.visible),"hoverEnable"in T&&e(2,o=T.hoverEnable),"floorplanData"in T&&e(3,r=T.floorplanData),"cameraImageUrl"in T&&e(4,a=T.cameraImageUrl),"extraObjects"in T&&e(5,l=T.extraObjects),"highlightData"in T&&e(6,c=T.highlightData)},i.$$.update=()=>{if(i.$$.dirty&904){const T=Math.min(u,m),{max:I,min:B}=r.bounding,L=I.x-B.x,X=I.y-B.y,Z=function(){return L>X?[T,T/L*X]:[T/X*L,T]}();e(9,g=Z[0]),e(12,v=Z[1]),e(10,d=g/L)}},[n,s,o,r,a,l,c,u,m,g,d,h,v,b,w]}class Wg extends ce{constructor(t){super(),le(this,t,Hg,Fg,ae,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},Gg)}}let Ng=class extends Cn{constructor(e,n){super(e);f(this,"name","panoFloorplanRadarPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"wrapperSelector","");f(this,"wrapper",null);f(this,"disposed",!1);f(this,"extraObjects",[]);f(this,"highlightData",{});f(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s;const{userAction:n}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const s={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:un},o=n!=null&&n.configs?n.configs:{},r=F(F({},s),o);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,s=!0){return Y(this,null,function*(){function o(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=o(r)?r.data:r,l=this.data;this.data=yield fn(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,s),this.render()})}show(){return Y(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return Y(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){this.data&&(this.extraObjects=pg(e,this.five,this.data),this.render())}formatData(e){return Y(this,null,function*(){return yield fn(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const s=this.state;this.state=F(F({},this.state),e),!Ot(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=we(F({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(e):this.app=new Wg({target:this.wrapper,props:e})}};const Yg=(i,t)=>new Ng(i,t),Xg=[{type:0,floorType:1,roomType:"100900000012",name:"其他"},{type:1,floorType:1,roomType:"100900000002",name:"客厅"},{type:2,floorType:1,roomType:"100900000002",name:"餐厅"},{type:3,floorType:0,roomType:"100900000001",name:"卧室"},{type:4,floorType:0,roomType:"100900000001",name:"书房"},{type:5,floorType:3,roomType:"100900000004",name:"卫生间"},{type:6,floorType:3,roomType:"100900000004",name:"淋浴间"},{type:7,floorType:3,roomType:"100900000004",name:"洗手间"},{type:8,floorType:3,roomType:"100900000003",name:"厨房"},{type:9,floorType:1,roomType:"100900000003",name:"开放厨房",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"多功能间"},{type:11,floorType:0,roomType:"100900000009",name:"保姆间"},{type:12,floorType:4,roomType:"100900000005",name:"阳台"},{type:13,floorType:4,roomType:"100900000006",name:"露台"},{type:14,floorType:0,roomType:"100900000008",name:"储物间"},{type:15,floorType:0,roomType:"100900000013",name:"衣帽间"},{type:16,floorType:0,roomType:"100900000011",name:"阁楼"},{type:17,floorType:2,roomType:"100900000007",name:"花园"},{type:18,floorType:5,roomType:"100900000010",name:"车库"},{type:19,floorType:1,roomType:"100900000012",name:"电梯"},{type:20,floorType:1,roomType:"100900000012",name:"地下室"},{type:21,floorType:1,roomType:"100900000012",name:"天井"},{type:22,floorType:1,roomType:"100900000012",name:"阳光房"},{type:23,floorType:1,roomType:"100900000012",name:"过道"},{type:24,floorType:1,roomType:"100900000012",name:"楼梯间"},{type:25,floorType:1,roomType:"100900000012",name:"门厅"},{type:26,floorType:2,roomType:"100900000012",name:"入户花园"},{type:27,floorType:1,roomType:"100900000012",name:"玄关"},{type:28,floorType:1,roomType:"100900000012",name:"挑空"},{type:29,floorType:4,roomType:"100900000012",name:"晾晒区"},{type:30,floorType:4,roomType:"100900000012",name:"洗衣房"},{type:31,floorType:0,roomType:"100900000012",name:"娱乐区"},{type:32,floorType:0,roomType:"100900000012",name:"健身区"},{type:33,floorType:0,roomType:"100900000012",name:"接待区"},{type:34,floorType:0,roomType:"100900000012",name:"影音区"},{type:35,floorType:1,roomType:"100900000012",name:"餐饮区"},{type:36,floorType:1,roomType:"100900000012",name:"其他",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"起居室"},{type:38,floorType:0,roomType:"100900000001",name:"主卧"},{type:39,floorType:0,roomType:"100900000001",name:"次卧"},{type:40,floorType:0,roomType:"100900000001",name:"优化间"},{type:41,floorType:0,roomType:"100900000001",name:"办公室"},{type:42,floorType:0,roomType:"100900000001",name:"会议室"},{type:43,floorType:0,roomType:"100900000001",name:"洽谈间"},{type:44,floorType:1,roomType:"100900000002",name:"共享大厅"},{type:45,floorType:1,roomType:"100900000012",name:"水吧"},{type:46,floorType:0,roomType:"100900000015",name:"出入口"},{type:47,floorType:0,roomType:"100900000015",name:"大厅"},{type:48,floorType:0,roomType:"100900000015",name:"包厢"},{type:49,floorType:0,roomType:"100900000015",name:"其他"},{type:50,floorType:0,roomType:"100900000016",name:"出入口"},{type:51,floorType:0,roomType:"100900000016",name:"办公区"},{type:52,floorType:0,roomType:"100900000016",name:"老板间"},{type:53,floorType:0,roomType:"100900000016",name:"会议室"},{type:54,floorType:0,roomType:"100900000016",name:"休息区/水吧"},{type:55,floorType:0,roomType:"100900000016",name:"其他"},{type:56,floorType:2,roomType:"100900000012",name:"空中花园"},{type:57,floorType:0,roomType:"100900000001",name:"洋室"},{type:58,floorType:0,roomType:"100900000001",name:"和室"}],Ug=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],qg=[{roomType:"100900000001",description:"室"},{roomType:"100900000002",description:"厅"},{roomType:"100900000003",description:"厨"},{roomType:"100900000004",description:"卫"},{roomType:"100900000005",description:"阳台"},{roomType:"100900000006",description:"露台"},{roomType:"100900000007",description:"花园"},{roomType:"100900000008",description:"储"},{roomType:"100900000009",description:"保姆间"},{roomType:"100900000010",description:"车库"},{roomType:"100900000011",description:"阁楼"},{roomType:"100900000012",description:"其他"},{roomType:"100900000013",description:"衣"},{roomType:"100900000015",description:"商铺"},{roomType:"100900000016",description:"写字楼"}],mr=(i,t,e)=>{const n=new E.Matrix4,s=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(s),n},Jg=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[s,o,r]=e;s&&i.applyMatrix4(mr(s,0,0)),o&&i.applyMatrix4(mr(0,o,0)),r&&i.applyMatrix4(mr(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function Pc(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const s=e,o=F({map:s.material.map||{}},t);s.material=new _.MeshBasicMaterial(o),s.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const Zg=(i,t)=>{var d;const e=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",n=(d=t.north_rad)!=null?d:void 0,s={},o=h=>Y(this,null,function*(){var R;const u=(h==null?void 0:h.fbx_url)||e,m=(R=h==null?void 0:h.north_rad)!=null?R:n;if(typeof m!="number")throw new Error('"northRad"配置参数缺失:未配置指南针指向!');const g=i.model.bounding,v=g.max.x-g.min.x,p=g.max.z-g.min.z,b=Math.max(v,p),P=yield new hs.FBXLoader().loadAsync(u);Pc(P,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const k=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:T,z:I},min:{x:B,y:L,z:X}}}}=i;s.yBase=L;const Z={x:(T+B)/2,y:L-1.6,z:(I+X)/2},G=.0045*b;return Jg(P,{position:Z,rotation:k,scale:G}),s.object=P,!0}),r=({latitude:h})=>{if(!s.object)return;const u=a(h);u&&(s.object.position.y=u)},a=h=>{if(s.yBase===void 0)return;const u=.6;if(h>=Math.PI/4)return s.yBase-(u+1.6);const m=h*(4/Math.PI);return s.yBase-(u*m+1.6)};return{load:o,disable:()=>{s.object&&(i.scene.remove(s.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!s.object)return;const h=a(i.getPose().latitude);h&&(s.object.position.y=h),i.scene.add(s.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function Kg(i,t){var c,d,h,u,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(d=t==null?void 0:t.fontSize)!=null?d:e*(35/256)*1.2,s=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",o=(u=t==null?void 0:t.fontColor)!=null?u:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=s,l.fillRect(0,0,e,e),l.font=`${n}px "微软雅黑"`,l.textAlign=r,l.fillStyle=o,l.fillText(i,e/2,e*.7),new _.CanvasTexture(a)}const $g=({x:i,y:t,z:e})=>new _.Vector3(i,t,e),ev=(i,t)=>{var v,p,b;const e={},n=(v=t.animationEnabled)!=null?v:!0,s=(p=t.position)!=null?p:void 0,o=(b=t.rad)!=null?b:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=w=>Y(this,null,function*(){var Z,G,R,H,Q,W,q,U;const P=(Z=w==null?void 0:w.position)!=null?Z:s;if(!P)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const k=$g(P),T=(G=w==null?void 0:w.rad)!=null?G:o,I=(R=w==null?void 0:w.fbx_url)!=null?R:r;if(e.rad=T,T===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${T}`));const B=yield new hs.FBXLoader().loadAsync(I);B.position.copy(k),B.rotation.z=T,B.scale.set(.8,.8,.8),Pc(B,{transparent:!0,side:E.DoubleSide});const L=(q=(W=(Q=(H=B.children)==null?void 0:H[0])==null?void 0:Q.children)==null?void 0:W[3])==null?void 0:q.clone();if(!L)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${L}`));const X=(U=t.name)!=null?U:"入户门";return L.material=new _.MeshBasicMaterial({transparent:!0,map:Kg(X)}),L.renderOrder=3,B.children[0].add(L),e.object=B,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const w=1,P=new _.AnimationMixer(e.object);a.push(P);const k=P.clipAction(e.object.animations[0]);k.timeScale=w;let T;const I=()=>{let Z=0,G=0;const R=1e3/30,H=Q=>{Z=requestAnimationFrame(H);const W=Q-G;W<R||(G=Q,a.forEach(q=>q.update(W/1e3)),i.needsRender=!0)};return Z=requestAnimationFrame(H),()=>{cancelAnimationFrame(Z)}},X={play:()=>{T||(k.play(),T=I(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{k.stop(),T==null||T(),T=void 0}};e.animation=X},d=w=>{var k;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((k=w==null?void 0:w.animationEnable)!=null?k:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},h=()=>{e.object&&(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},u=w=>w==="Floorplan"?d():h();return{load:l,enable:w=>(e.enabled||(e.enabled=!0,u(i.currentMode),i.on("modeChange",u),d(w)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),i.off("modeChange",u)),!0)}},tv=Et;function nv(i,t,e,n=tv.Linear.None){const s=new ps(i).to(t,e).easing(n);Cs(()=>s.start(0));const o=Li(a=>{s.update(a)===!1&&o()}),r=[];return s.onDestroy=a=>(r.push(a),s),s.destroy=function(){this.stop(),Object.assign(s,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();o()},s}function iv(i,t){return nv({progress:0},{progress:1},i,t)}var Ic=(i=>(i.Move="Move",i.Rotate="Rotate",i))(Ic||{}),Bt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(Bt||{});const Fs=Math.PI*2;function Ec(i){return(i%Fs+Fs)%Fs}function kc(i){return i%Fs}function pr(i,t,e){return i+(t-i)*e}const gr=(i,t,e)=>{const n=Math.PI,s=n*2;let o=Ec(i),r=Ec(t);return e===Bt.Anticlockwise&&o<r&&(o+=s),e===Bt.Clockwise&&r<o&&(r+=s),e===Bt.Loop&&r-o>n?gr(o,r,Bt.Anticlockwise):e===Bt.Loop&&o-r>n?gr(o,r,Bt.Clockwise):{from:o,to:r}},sv=i=>{const t={},e=(l,c,...d)=>Y(this,[l,c,...d],function*(o,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),o.mode&&o.mode!==i.currentMode&&(yield i.changeMode(o.mode)),a.preload&&o.panoIndex!==void 0&&o.panoIndex!==i.panoIndex&&(yield i.preloadPano(o.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),o.panoIndex===void 0&&o.fov===void 0&&o.latitude===void 0&&o.longitude===void 0?!0:yield new Promise((h,u)=>{const m=o.panoIndex!==void 0?o.panoIndex:i.panoIndex;m!==void 0?i.moveToPano(m,F({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>u(new Error("move canceled"))},o)):u(new Error("unexpected error"))})}),n=o=>{const r=i.state,a=kc(r.latitude),l=kc(o.latitude),{from:c,to:d}=gr(r.longitude,o.longitude,o.rotation||Bt.Loop),h=r.fov,u=o.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:d,fov:u}}};return{move:e,rotate:(l,c,...d)=>Y(this,[l,c,...d],function*(o,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==ve.Five.Mode.Panorama&&(yield i.changeMode(ve.Five.Mode.Panorama)),o.panoIndex!==void 0&&o.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(o.panoIndex)),yield new Promise((m,g)=>{if(!o.panoIndex){m(!0);return}i.moveToPano(o.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>g(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:u}=n(o);return yield new Promise(m=>{const g=({progress:P})=>{const k={};k.longitude=pr(h.longitude,u.longitude,P),k.latitude=pr(h.latitude,u.latitude,P),k.fov=pr(h.fov,u.fov,P),i.setState(k,!0)},v=()=>{m(!0)},p=()=>{m(!1)},b=o.rotateSpeed?Math.ceil(Math.abs(u.longitude-h.longitude)/o.rotateSpeed*1e3):r,w=iv(b,Et.Linear.None).onUpdate(g).onComplete(v).onDestroy(p);o.rotation===Bt.Loop&&w.repeat(1/0).yoyo(!0),t.interruptCallback=(P=!0)=>{w.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(P)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function xc(i,t){return i.x===t.x&&i.y===t.y}function Mc(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function Hs(i,t){return(t.y-i.y)/(t.x-i.x)}function Sc(i,t,e){const n=Hs(i[1],i[0]),s=Hs(t[1],t[0]);if(isNaN(n)||isNaN(s)||Mc(n,s))return!1;if(Ws(i[0],t))return i[0];if(Ws(i[1],t))return i[1];if(Ws(t[0],i))return t[0];if(Ws(t[1],i))return t[1];if(e&&!ov(i,t))return!1;const o=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:o.x,y:t[1].y-(t[1].x-o.x)*s};if(Math.abs(s)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-o.y+n*o.x-s*r.x)/(n-s),l=n*a-n*o.x+o.y;return{x:a,y:l}}function Ws(i,t){return xc(i,t[0])||xc(i,t[1])?!0:(t[0].x-i.x)*(i.x-t[1].x)>=0&&(t[0].y-i.y)*(i.y-t[1].y)>=0&&Mc(Hs(t[0],i),Hs(i,t[1]))}function Ns(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function ov(i,t){return Math.max(i[0].x,i[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(i[0].x,i[1].x)&&Math.max(i[0].y,i[1].y)>=Math.min(t[0].y,t[1].y)&&Ns(t[0],i[1],i[0])*Ns(i[1],t[1],i[0])>0&&Ns(i[0],t[1],t[0])*Ns(t[1],i[1],t[0])>0?1:0}function Dc(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>Dc(i,t-1))}const rv=`<style type="text/css">
|
|
195
195
|
.PanoRulerPlugin-rule-line {
|
|
196
196
|
position: absolute;
|
|
197
197
|
transform-origin: left center;
|
|
@@ -578,7 +578,7 @@ void main() {
|
|
|
578
578
|
${i[7]?"transform: translate(-50%, -50%); left: 50%; top: 50%;":""}
|
|
579
579
|
`))&&y(t,"style",e);const l=a&8160;(l||a&8168)&&j(t,"width",It(i[3])),(l||a&8176)&&j(t,"height",It(i[4])),(l||a&16352)&&j(t,"z-index",i[13])},i(r){o||(r&&nt(()=>{o&&(s&&s.end(1),n=yn(t,wn,{duration:i[0]}),n.start())}),o=!0)},o(r){n&&n.invalidate(),r&&(s=Kn(t,wn,{duration:i[1]})),o=!1},d(r){r&&V(t),r&&s&&s.end()}}}function n1(i){let t,e=i[2]&&Yd(i);return{c(){e&&e.c(),t=ke()},m(n,s){e&&e.m(n,s),O(n,t,s)},p(n,[s]){n[2]?e?(e.p(n,s),s&4&&x(e,1)):(e=Yd(n),e.c(),x(e,1),e.m(t.parentNode,t)):e&&(ue(),z(e,1,1,()=>{e=null}),fe())},i(n){x(e)},o(n){z(e)},d(n){e&&e.d(n),n&&V(t)}}}function It(i){return typeof i=="number"?i/16+"rem":i}function i1(i,t,e){let{inDelay:n=1e3}=t,{outDelay:s=1e3}=t,{visible:o=!0}=t,{width:r=0}=t,{height:a=0}=t,{left:l=0}=t,{bottom:c=0}=t,{center:d=!1}=t,{horizontalCenter:h=!1}=t,{verticalCenter:u=!1}=t,{blurRadius:m}=t,{spreadRadius:g}=t,{opacity:v=.15}=t,{zIndex:p=-1}=t;return i.$$set=b=>{"inDelay"in b&&e(0,n=b.inDelay),"outDelay"in b&&e(1,s=b.outDelay),"visible"in b&&e(2,o=b.visible),"width"in b&&e(3,r=b.width),"height"in b&&e(4,a=b.height),"left"in b&&e(5,l=b.left),"bottom"in b&&e(6,c=b.bottom),"center"in b&&e(7,d=b.center),"horizontalCenter"in b&&e(8,h=b.horizontalCenter),"verticalCenter"in b&&e(9,u=b.verticalCenter),"blurRadius"in b&&e(10,m=b.blurRadius),"spreadRadius"in b&&e(11,g=b.spreadRadius),"opacity"in b&&e(12,v=b.opacity),"zIndex"in b&&e(13,p=b.zIndex)},[n,s,o,r,a,l,c,d,h,u,m,g,v,p]}class _t extends ce{constructor(t){super(),le(this,t,i1,n1,ae,{inDelay:0,outDelay:1,visible:2,width:3,height:4,left:5,bottom:6,center:7,horizontalCenter:8,verticalCenter:9,blurRadius:10,spreadRadius:11,opacity:12,zIndex:13},t1)}}function s1(){return Math.random().toString(36).slice(-6)}const jr=s1();function o1(i){he(i,"svelte-1b2n9wi",".text-char.svelte-1b2n9wi{display:inline-block;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function Xd(i,t,e){const n=i.slice();return n[18]=t[e].id,n[0]=t[e].content,n[19]=t,n[20]=e,n}function r1(i){let t,e=i[0]+"",n,s=i[20];const o=()=>i[9](t,s),r=()=>i[9](null,s);return{c(){t=S("span"),n=Te(e),y(t,"class","text-char svelte-1b2n9wi")},m(a,l){O(a,t,l),D(t,n),o()},p(a,l){i=a,l&4&&e!==(e=i[0]+"")&&Oe(n,e),s!==i[20]&&(r(),s=i[20],o())},d(a){a&&V(t),r()}}}function a1(i){let t,e=i[20];const n=()=>i[8](t,e),s=()=>i[8](null,e);return{c(){t=S("span"),t.textContent=" ",y(t,"class","text-char svelte-1b2n9wi")},m(o,r){O(o,t,r),n()},p(o,r){i=o,e!==i[20]&&(s(),e=i[20],n())},d(o){o&&V(t),s()}}}function Ud(i,t){let e,n;function s(a,l){return a[0]===a[3]?a1:r1}let o=s(t),r=o(t);return{key:i,first:null,c(){e=ke(),r.c(),n=ke(),this.first=e},m(a,l){O(a,e,l),r.m(a,l),O(a,n,l)},p(a,l){t=a,o===(o=s(t))&&r?r.p(t,l):(r.d(1),r=o(t),r&&(r.c(),r.m(n.parentNode,n)))},d(a){a&&V(e),r.d(a),a&&V(n)}}}function l1(i){let t=[],e=new Map,n,s=i[2];const o=r=>r[18];for(let r=0;r<s.length;r+=1){let a=Xd(i,s,r),l=o(a);e.set(l,t[r]=Ud(l,a))}return{c(){for(let r=0;r<t.length;r+=1)t[r].c();n=ke()},m(r,a){for(let l=0;l<t.length;l+=1)t[l]&&t[l].m(r,a);O(r,n,a)},p(r,[a]){a&14&&(s=r[2],t=St(t,a,o,1,r,s,e,n.parentNode,tr,Ud,n,Xd))},i:J,o:J,d(r){for(let a=0;a<t.length;a+=1)t[a].d(r);r&&V(n)}}}function c1(i,t,e){let n,{inDelay:s=0}=t,{outDelay:o=0}=t,{content:r}=t,{unfolded:a}=t,{isFistUnfoldedUpdate:l=!0}=t;const c=`__EMOJI_SPLIT_${jr}__`,d=`__EMOJI_${jr}__`,h=`__SPACE_${jr}__`;let u,m,g=[];function v(T){const I=[],B=new RegExp(new RegExp("\\p{Regional_Indicator}\\p{Regional_Indicator}|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?(\\u200D\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?)+|\\p{Emoji_Presentation}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)","gu"));return T.slice().replace(B,L=>`${c}${d}${L}${c}`).split(c).forEach(L=>L.startsWith(d)?I.push({id:tt(),content:L.slice(d.length)}):I.push(...L.split("").map(X=>X===" "?h:X).map(X=>({id:tt(),content:X})))),I}function p(){if(!m)return;const T=!a;m.reversed!==T&&m.reverse(),m.play()}function b(T){if(l){e(4,l=!1);return}clearTimeout(u),u=setTimeout(p,T?s:o)}function w(T){const I=function(){const B=Vb(L=>T[L].getBoundingClientRect().x,[Math.min(T.length-1,10),Math.min(T.length-1,30)]);if(B>0)return B}();m=zt({targets:T.slice(0,I).filter(Fn),autoplay:!1,duration:400,scale:[.7,1],rotate:[20,0],opacity:[0,1],translateX:[4,0],translateY:[10,0],delay:zt.stagger(50),easing:"easeInOutCubic"}),a&&m.seek(m.duration)}function P(T,I){Re[T?"unshift":"push"](()=>{g[I]=T,e(1,g)})}function k(T,I){Re[T?"unshift":"push"](()=>{g[I]=T,e(1,g)})}return i.$$set=T=>{"inDelay"in T&&e(5,s=T.inDelay),"outDelay"in T&&e(6,o=T.outDelay),"content"in T&&e(0,r=T.content),"unfolded"in T&&e(7,a=T.unfolded),"isFistUnfoldedUpdate"in T&&e(4,l=T.isFistUnfoldedUpdate)},i.$$.update=()=>{i.$$.dirty&1&&e(2,n=v(r)),i.$$.dirty&128&&b(a),i.$$.dirty&2&&w(g.filter(T=>!!T))},[r,g,n,h,l,s,o,a,P,k]}class qd extends ce{constructor(t){super(),le(this,t,c1,l1,ae,{inDelay:5,outDelay:6,content:0,unfolded:7,isFistUnfoldedUpdate:4},o1)}}function d1(i){he(i,"svelte-1ogmlqq",".arrow.svelte-1ogmlqq{width:100%;height:100%;background-size:100%;transition:transform 400ms ease-in-out;cursor:pointer;pointer-events:auto}.arrow-wrapper.svelte-1ogmlqq{position:relative;width:100%;height:100%}.arrow.left.svelte-1ogmlqq{transform:rotate(0deg)}.arrow.right.svelte-1ogmlqq{transform:rotate(-180deg)}.arrow.top.svelte-1ogmlqq{transform:rotate(90deg)}.arrow.bottom.svelte-1ogmlqq{transform:rotate(-90deg)}")}function Jd(i){let t,e,n,s,o,r,a,l,c,d;return e=new _t({props:{center:!0,blurRadius:9,spreadRadius:3}}),{c(){t=S("div"),se(e.$$.fragment),n=ee(),s=S("div"),y(s,"class",o="arrow "+i[0]+" svelte-1ogmlqq"),j(s,"background-image","url("+Nb+")"),y(t,"class","arrow-wrapper svelte-1ogmlqq")},m(h,u){O(h,t,u),ne(e,t,null),D(t,n),D(t,s),l=!0,c||(d=ye(s,"click",i[5]),c=!0)},p(h,u){i=h,(!l||u&1&&o!==(o="arrow "+i[0]+" svelte-1ogmlqq"))&&y(s,"class",o)},i(h){l||(x(e.$$.fragment,h),h&&nt(()=>{l&&(a&&a.end(1),r=yn(s,wn,{duration:i[2],delay:i[3],easing:ni}),r.start())}),l=!0)},o(h){z(e.$$.fragment,h),r&&r.invalidate(),h&&(a=Kn(s,wn,{duration:i[2],delay:i[4],easing:ni})),l=!1},d(h){h&&V(t),ie(e),h&&a&&a.end(),c=!1,d()}}}function h1(i){let t,e,n=i[1]&&Jd(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[1]?n?(n.p(s,o),o&2&&x(n,1)):(n=Jd(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function u1(i,t,e){let{direction:n="right"}=t,{visible:s=!0}=t,{duration:o=0}=t,{inDelay:r=0}=t,{outDelay:a=0}=t;function l(c){Un.call(this,i,c)}return i.$$set=c=>{"direction"in c&&e(0,n=c.direction),"visible"in c&&e(1,s=c.visible),"duration"in c&&e(2,o=c.duration),"inDelay"in c&&e(3,r=c.inDelay),"outDelay"in c&&e(4,a=c.outDelay)},[n,s,o,r,a,l]}let f1=class extends ce{constructor(t){super(),le(this,t,u1,h1,ae,{direction:0,visible:1,duration:2,inDelay:3,outDelay:4},d1)}};function m1(i,t,e=20,n=5){return new Promise((s,o)=>{let r=0;const a=setInterval(()=>{const l=i();t(l)?(clearInterval(a),s(l)):r>=n&&(clearInterval(a),o(l)),r++},e)})}function p1(i){he(i,"svelte-1fuzm7v",".text.svelte-1fuzm7v{pointer-events:auto;box-sizing:border-box;display:inline-block;max-width:7.5rem;transition:transform 400ms ease-in-out;font-size:0.75rem;line-height:1.125rem;white-space:initial;cursor:pointer}.arrow.svelte-1fuzm7v{pointer-events:auto;display:inline-block;vertical-align:top;width:0.875rem;height:0.875rem;margin-left:0.125rem;margin-top:0.125rem}")}function Zd(i){let t,e,n;return e=new qd({props:{unfolded:i[0],content:i[1],inDelay:500,outDelay:i[5]}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","text svelte-1fuzm7v"),j(t,"transform",i[7])},m(s,o){O(s,t,o),ne(e,t,null),i[10](t),n=!0},p(s,o){const r={};o&1&&(r.unfolded=s[0]),o&2&&(r.content=s[1]),o&32&&(r.outDelay=s[5]),e.$set(r),o&128&&j(t,"transform",s[7])},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e),i[10](null)}}}function Kd(i){let t,e,n;return e=new f1({props:{direction:i[6],visible:i[0],inDelay:600,duration:1e3}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","arrow svelte-1fuzm7v")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o&64&&(r.direction=s[6]),o&1&&(r.visible=s[0]),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function g1(i){let t,e,n,s=i[1]&&Zd(i),o=i[3]<i[4]&&Kd(i);return{c(){s&&s.c(),t=ee(),o&&o.c(),e=ke()},m(r,a){s&&s.m(r,a),O(r,t,a),o&&o.m(r,a),O(r,e,a),n=!0},p(r,[a]){r[1]?s?(s.p(r,a),a&2&&x(s,1)):(s=Zd(r),s.c(),x(s,1),s.m(t.parentNode,t)):s&&(ue(),z(s,1,1,()=>{s=null}),fe()),r[3]<r[4]?o?(o.p(r,a),a&24&&x(o,1)):(o=Kd(r),o.c(),x(o,1),o.m(e.parentNode,e)):o&&(ue(),z(o,1,1,()=>{o=null}),fe())},i(r){n||(x(s),x(o),n=!0)},o(r){z(s),z(o),n=!1},d(r){s&&s.d(r),r&&V(t),o&&o.d(r),r&&V(e)}}}function v1(i,t,e){let n,s,o,{visible:r=!1}=t,{textUnfolded:a=!1}=t,{content:l}=t,c,d=0,h=0,u=0;function m(g){Re[g?"unshift":"push"](()=>{c=g,e(2,c)})}return i.$$set=g=>{"visible"in g&&e(0,r=g.visible),"textUnfolded"in g&&e(8,a=g.textUnfolded),"content"in g&&e(1,l=g.content)},i.$$.update=()=>{if(i.$$.dirty&7&&c&&r&&l){const{lineHeight:g}=getComputedStyle(c);e(4,u=c.offsetHeight),m1(()=>c==null?void 0:c.offsetHeight,Boolean).then(()=>{e(4,u=c.offsetHeight)}),e(3,h=Number(g.replace("px","")))}i.$$.dirty&280&&e(9,d=a?h-u:0),i.$$.dirty&512&&e(7,n=`translateY(${d}px)`),i.$$.dirty&256&&e(6,s=a?"left":"right"),i.$$.dirty&256&&e(5,o=a?450:0)},[r,l,c,h,u,o,s,n,a,d,m]}class $d extends ce{constructor(t){super(),le(this,t,v1,g1,ae,{visible:0,textUnfolded:8,content:1},p1)}}function A1(i){he(i,"svelte-nlvd3x",".content.svelte-nlvd3x{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0;overflow:hidden;box-sizing:border-box;font-size:0;pointer-events:none;white-space:nowrap;font-weight:600}")}function eh(i){var d,h;let t,e,n,s,o,r,a,l,c;return t=new _t({props:{visible:i[2],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),n=new zr({props:{unfolded:i[2],length:i[3],outDelay:i[4]+40*Math.min((h=(d=i[6][0])==null?void 0:d.content.length)!=null?h:10,15),useLinearColor:!0}}),r=new $d({props:{visible:i[2],textUnfolded:i[1],content:i[5]}}),{c(){se(t.$$.fragment),e=ee(),se(n.$$.fragment),s=ee(),o=S("div"),se(r.$$.fragment),y(o,"class","content svelte-nlvd3x")},m(u,m){ne(t,u,m),O(u,e,m),ne(n,u,m),O(u,s,m),O(u,o,m),ne(r,o,null),a=!0,l||(c=[Nt(ei.call(null,o)),ye(o,"clientWidth",i[8]),ye(o,"click",i[7])],l=!0)},p(u,m){var b,w;const g={};m&4&&(g.visible=u[2]),m&8&&(g.left=u[3]/2+"px"),t.$set(g);const v={};m&4&&(v.unfolded=u[2]),m&8&&(v.length=u[3]),m&16&&(v.outDelay=u[4]+40*Math.min((w=(b=u[6][0])==null?void 0:b.content.length)!=null?w:10,15)),n.$set(v);const p={};m&4&&(p.visible=u[2]),m&2&&(p.textUnfolded=u[1]),m&32&&(p.content=u[5]),r.$set(p)},i(u){a||(x(t.$$.fragment,u),x(n.$$.fragment,u),x(r.$$.fragment,u),a=!0)},o(u){z(t.$$.fragment,u),z(n.$$.fragment,u),z(r.$$.fragment,u),a=!1},d(u){ie(t,u),u&&V(e),ie(n,u),u&&V(s),u&&V(o),ie(r),l=!1,Ze(c)}}}function b1(i){let t,e,n=i[0].state&&eh(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[0].state?n?(n.p(s,o),o&1&&x(n,1)):(n=eh(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function y1(i,t,e){let n,s,o,{tag:r}=t,a,l=!1,c=[];function d(){e(1,l=!l)}const h=u=>{e(3,a=u.detail)};return i.$$set=u=>{"tag"in u&&e(0,r=u.tag)},i.$$.update=()=>{var u,m,g;i.$$.dirty&1&&e(2,n=!!((u=r.state)!=null&&u.unfolded)),i.$$.dirty&1&&e(5,s=(g=(m=r.data.title)!=null?m:r.data.text)!=null?g:""),i.$$.dirty&4&&(n||setTimeout(()=>{e(1,l=!1)},20)),i.$$.dirty&2&&e(4,o=l?450:0)},[r,l,n,a,o,s,c,d,h]}class w1 extends ce{constructor(t){super(),le(this,t,y1,b1,ae,{tag:0},A1)}}function Qt(i){return typeof i=="number"?i/16+"rem":i}function C1(i){he(i,"svelte-i9wdo4",".text.svelte-i9wdo4{display:-webkit-box;display:-ms-box;display:-moz-box;position:relative;width:-moz-max-content;width:max-content;max-width:100%;-webkit-box-orient:vertical;-ms-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}@keyframes svelte-i9wdo4-blink{0%{opacity:1}50%{opacity:0}100%{opacity:1}}.caret.svelte-i9wdo4{position:absolute;width:0.0625rem;height:100%;background-color:#fff;animation:svelte-i9wdo4-blink 1.2s infinite}.placeholder.svelte-i9wdo4{opacity:0.5}")}function P1(i){let t;const e=i[6].default,n=Hn(e,i,i[5],null);return{c(){n&&n.c()},m(s,o){n&&n.m(s,o),t=!0},p(s,o){n&&n.p&&(!t||o&32)&&Nn(n,e,s,s[5],t?Wn(e,s[5],o,null):Yn(s[5]),null)},i(s){t||(x(n,s),t=!0)},o(s){z(n,s),t=!1},d(s){n&&n.d(s)}}}function I1(i){var o,r;let t,e,n=((o=i[3])==null?void 0:o.inputting)&&th(),s=((r=i[3])==null?void 0:r.placeholder)&&nh(i);return{c(){n&&n.c(),t=ee(),s&&s.c(),e=ke()},m(a,l){n&&n.m(a,l),O(a,t,l),s&&s.m(a,l),O(a,e,l)},p(a,l){var c,d;(c=a[3])!=null&&c.inputting?n||(n=th(),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),(d=a[3])!=null&&d.placeholder?s?s.p(a,l):(s=nh(a),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null)},i:J,o:J,d(a){n&&n.d(a),a&&V(t),s&&s.d(a),a&&V(e)}}}function E1(i){let t;return{c(){t=Te(i[2])},m(e,n){O(e,t,n)},p(e,n){n&4&&Oe(t,e[2])},i:J,o:J,d(e){e&&V(t)}}}function th(i){let t;return{c(){t=S("div"),y(t,"class","caret svelte-i9wdo4")},m(e,n){O(e,t,n)},d(e){e&&V(t)}}}function nh(i){let t,e=i[3].placeholder+"",n;return{c(){t=S("span"),n=Te(e),y(t,"class","placeholder svelte-i9wdo4")},m(s,o){O(s,t,o),D(t,n)},p(s,o){o&8&&e!==(e=s[3].placeholder+"")&&Oe(n,e)},d(s){s&&V(t)}}}function k1(i){let t,e,n,s;const o=[E1,I1,P1],r=[];function a(l,c){return l[2]?0:l[4]?1:2}return e=a(i),n=r[e]=o[e](i),{c(){t=S("div"),n.c(),y(t,"class","text svelte-i9wdo4"),j(t,"max-width",typeof i[1]=="number"?Qt(i[1]):i[1]),j(t,"-webkit-line-clamp",i[0])},m(l,c){O(l,t,c),r[e].m(t,null),s=!0},p(l,[c]){let d=e;e=a(l),e===d?r[e].p(l,c):(ue(),z(r[d],1,1,()=>{r[d]=null}),fe(),n=r[e],n?n.p(l,c):(n=r[e]=o[e](l),n.c()),x(n,1),n.m(t,null)),c&2&&j(t,"max-width",typeof l[1]=="number"?Qt(l[1]):l[1]),c&1&&j(t,"-webkit-line-clamp",l[0])},i(l){s||(x(n),s=!0)},o(l){z(n),s=!1},d(l){l&&V(t),r[e].d()}}}function x1(i,t,e){let n,{$$slots:s={},$$scope:o}=t,{maxLine:r=1}=t,{maxWidth:a=null}=t,{text:l=null}=t,{edit:c=null}=t;return i.$$set=d=>{"maxLine"in d&&e(0,r=d.maxLine),"maxWidth"in d&&e(1,a=d.maxWidth),"text"in d&&e(2,l=d.text),"edit"in d&&e(3,c=d.edit),"$$scope"in d&&e(5,o=d.$$scope)},i.$$.update=()=>{i.$$.dirty&8&&e(4,n=(c==null?void 0:c.placeholder)||(c==null?void 0:c.inputting))},[r,a,l,c,n,o,s]}class Vr extends ce{constructor(t){super(),le(this,t,x1,k1,ae,{maxLine:0,maxWidth:1,text:2,edit:3},C1)}}function M1(i){he(i,"svelte-1oxrkr1",".plane__container.svelte-1oxrkr1.svelte-1oxrkr1{position:absolute;left:50%;transform:translate(-50%, -100%);width:-moz-max-content;width:max-content}.plane__wrapper.svelte-1oxrkr1.svelte-1oxrkr1{transition:transform 500ms linear, opacity 200ms linear;padding:0.625rem;background-color:rgba(0, 0, 0, 0.5);border:0.03125rem solid rgba(255, 255, 255, 0.3);border-radius:0.25rem}.unfolded.svelte-1oxrkr1 .plane__wrapper.svelte-1oxrkr1{transition-delay:200ms, 500ms;opacity:1}.folded.svelte-1oxrkr1 .plane__wrapper.svelte-1oxrkr1{opacity:0}.plane.svelte-1oxrkr1.svelte-1oxrkr1{max-width:11.75rem}.title.svelte-1oxrkr1.svelte-1oxrkr1{white-space:pre-wrap;font-weight:bold;font-size:0.75rem;line-height:1.125rem}.description.svelte-1oxrkr1.svelte-1oxrkr1{margin-top:0.25rem;white-space:pre-wrap;font-size:0.6875rem;line-height:1rem}")}function ih(i){var h,u;let t,e,n,s,o,r,a,l,c;t=new zr({props:{unfolded:i[1],direction:"vertical",length:15,duration:500,inDelay:200,useLinearColor:!0}}),a=new Vr({props:{text:i[2],edit:(h=i[0].data.edit)==null?void 0:h.title}});let d=(i[0].data.description||((u=i[0].data.edit)==null?void 0:u.description))&&sh(i);return{c(){se(t.$$.fragment),e=ee(),n=S("div"),s=S("div"),o=S("div"),r=S("div"),se(a.$$.fragment),l=ee(),d&&d.c(),y(r,"class","title svelte-1oxrkr1"),y(o,"class","plane svelte-1oxrkr1"),y(s,"class","plane__wrapper svelte-1oxrkr1"),j(s,"transform",i[1]?"translateY(-15px)":"translateY(0)"),y(n,"class","plane__container svelte-1oxrkr1"),$(n,"unfolded",i[1]),$(n,"folded",i[3])},m(m,g){ne(t,m,g),O(m,e,g),O(m,n,g),D(n,s),D(s,o),D(o,r),ne(a,r,null),D(o,l),d&&d.m(o,null),c=!0},p(m,g){var b,w;const v={};g&2&&(v.unfolded=m[1]),t.$set(v);const p={};g&4&&(p.text=m[2]),g&1&&(p.edit=(b=m[0].data.edit)==null?void 0:b.title),a.$set(p),m[0].data.description||(w=m[0].data.edit)!=null&&w.description?d?(d.p(m,g),g&1&&x(d,1)):(d=sh(m),d.c(),x(d,1),d.m(o,null)):d&&(ue(),z(d,1,1,()=>{d=null}),fe()),g&2&&j(s,"transform",m[1]?"translateY(-15px)":"translateY(0)"),(!c||g&2)&&$(n,"unfolded",m[1]),(!c||g&8)&&$(n,"folded",m[3])},i(m){c||(x(t.$$.fragment,m),x(a.$$.fragment,m),x(d),c=!0)},o(m){z(t.$$.fragment,m),z(a.$$.fragment,m),z(d),c=!1},d(m){ie(t,m),m&&V(e),m&&V(n),ie(a),d&&d.d()}}}function sh(i){var s;let t,e,n;return e=new Vr({props:{text:i[0].data.description,edit:(s=i[0].data.edit)==null?void 0:s.description,maxLine:3}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","description svelte-1oxrkr1")},m(o,r){O(o,t,r),ne(e,t,null),n=!0},p(o,r){var l;const a={};r&1&&(a.text=o[0].data.description),r&1&&(a.edit=(l=o[0].data.edit)==null?void 0:l.description),e.$set(a)},i(o){n||(x(e.$$.fragment,o),n=!0)},o(o){z(e.$$.fragment,o),n=!1},d(o){o&&V(t),ie(e)}}}function S1(i){let t,e,n=i[0].state&&ih(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[0].state?n?(n.p(s,o),o&1&&x(n,1)):(n=ih(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function D1(i,t,e){let n,s,o,{tag:r}=t;return i.$$set=a=>{"tag"in a&&e(0,r=a.tag)},i.$$.update=()=>{var a,l,c;i.$$.dirty&1&&e(1,n=!!((a=r.state)!=null&&a.unfolded)),i.$$.dirty&2&&e(3,s=!n),i.$$.dirty&1&&e(2,o=(c=(l=r.data.title)!=null?l:r.data.text)!=null?c:"")},[r,n,o,s]}class L1 extends ce{constructor(t){super(),le(this,t,D1,S1,ae,{tag:0},M1)}}function T1(i){let t,e;return t=new L1({props:{tag:i[0]}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.tag=n[0]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function z1(i){let t,e;return t=new w1({props:{tag:i[0]}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.tag=n[0]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function j1(i){let t,e,n,s;const o=[z1,T1],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=o[t](i)),{c(){e&&e.c(),n=ke()},m(l,c){~t&&r[t].m(l,c),O(l,n,c),s=!0},p(l,[c]){let d=t;t=a(l),t===d?~t&&r[t].p(l,c):(e&&(ue(),z(r[d],1,1,()=>{r[d]=null}),fe()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=o[t](l),e.c()),x(e,1),e.m(n.parentNode,n)):e=null)},i(l){s||(x(e),s=!0)},o(l){z(e),s=!1},d(l){~t&&r[t].d(l),l&&V(n)}}}function V1(i,t,e){let n,{tag:s}=t;return i.$$set=o=>{"tag"in o&&e(0,s=o.tag)},i.$$.update=()=>{var o;i.$$.dirty&1&&e(1,n=(o=s.data.appearance)!=null?o:"line")},[s,n]}class O1 extends ce{constructor(t){super(),le(this,t,V1,j1,ae,{tag:0})}}function B1(i){he(i,"svelte-blgtit",".line.svelte-blgtit{width:100%;height:100%;overflow:visible;pointer-events:none}")}function oh(i){let t,e,n,s;return{c(){t=je("path"),y(t,"fill","none"),y(t,"stroke","url(#"+i[4]+")"),y(t,"stroke-width","1"),y(t,"d","M0 21 L14 0.5 L105 0.5")},m(o,r){O(o,t,r),s=!0},p(o,r){i=o},i(o){s||(o&&nt(()=>{s&&(n&&n.end(1),e=yn(t,Qs,{duration:i[1],delay:i[0],easing:_l}),e.start())}),s=!0)},o(o){e&&e.invalidate(),o&&(n=Kn(t,Qs,{duration:i[1],delay:i[2],easing:ni})),s=!1},d(o){o&&V(t),o&&n&&n.end()}}}function _1(i){let t,e,n,s,o,r=i[3]&&oh(i);return{c(){t=je("svg"),e=je("defs"),n=je("linearGradient"),s=je("stop"),o=je("stop"),r&&r.c(),y(s,"offset","25%"),y(s,"stop-color","white"),y(s,"stop-opacity","1"),y(o,"offset","100%"),y(o,"stop-color","white"),y(o,"stop-opacity","0.5"),y(n,"id",i[4]),y(n,"gradientUnits","userSpaceOnUse"),y(t,"class","line svelte-blgtit"),y(t,"viewBox","0 0 105 21")},m(a,l){O(a,t,l),D(t,e),D(e,n),D(n,s),D(n,o),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&x(r,1)):(r=oh(a),r.c(),x(r,1),r.m(t,null)):r&&(ue(),z(r,1,1,()=>{r=null}),fe())},i(a){x(r)},o(a){z(r)},d(a){a&&V(t),r&&r.d()}}}function Q1(i,t,e){let{inDelay:n=0}=t,{duration:s=1e3}=t,{outDelay:o=0}=t,{unfolded:r}=t;const a=tt();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,s=l.duration),"outDelay"in l&&e(2,o=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,s,o,r,a]}class R1 extends ce{constructor(t){super(),le(this,t,Q1,_1,ae,{inDelay:0,duration:1,outDelay:2,unfolded:3},B1)}}function G1(i){he(i,"svelte-1mgyhhn",`:root{--sc-dot-size:6px;--sc-active-dot-size:8px;--sc-dot-size-animation-time:250ms}.sc-carousel-dot__dot.svelte-1mgyhhn{background-color:var(--sc-color-rgb-light);border-radius:50%;display:inline-block;opacity:0.5;transition:opacity 100ms ease,\r
|
|
580
580
|
height var(--sc-dot-size-animation-time) ease,\r
|
|
581
|
-
width var(--sc-dot-size-animation-time) ease;cursor:pointer;-webkit-tap-highlight-color:transparent;height:var(--sc-dot-size);width:var(--sc-dot-size)}.sc-carousel-dot__dot.svelte-1mgyhhn:hover{opacity:0.9}.sc-carousel-dot__dot_active.svelte-1mgyhhn{opacity:0.7;height:var(--sc-active-dot-size);width:var(--sc-active-dot-size)}`)}function F1(i){let t,e,n;return{c(){t=S("button"),y(t,"class","sc-carousel-button sc-carousel-dot__dot svelte-1mgyhhn"),$(t,"sc-carousel-dot__dot_active",i[0])},m(s,o){O(s,t,o),e||(n=ye(t,"click",i[1]),e=!0)},p(s,[o]){o&1&&$(t,"sc-carousel-dot__dot_active",s[0])},i:J,o:J,d(s){s&&V(t),e=!1,n()}}}function H1(i,t,e){let{active:n=!1}=t;function s(o){Un.call(this,i,o)}return i.$$set=o=>{"active"in o&&e(0,n=o.active)},[n,s]}class W1 extends ce{constructor(t){super(),le(this,t,H1,F1,ae,{active:0},G1)}}function N1(i){he(i,"svelte-670fde",".sc-carousel-dots__container.svelte-670fde{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;padding:0 30px}.sc-carousel-dots__dot-container.svelte-670fde{height:calc(var(--sc-dot-size) + 14px);width:calc(var(--sc-dot-size) + 10px);display:flex;align-items:center;justify-content:center}")}function rh(i,t,e){const n=i.slice();return n[5]=t[e],n[7]=e,n}function ah(i,t){let e,n,s,o;function r(){return t[3](t[7])}return n=new W1({props:{active:t[1]===t[7]}}),n.$on("click",r),{key:i,first:null,c(){e=S("div"),se(n.$$.fragment),s=ee(),y(e,"class","sc-carousel-dots__dot-container svelte-670fde"),this.first=e},m(a,l){O(a,e,l),ne(n,e,null),D(e,s),o=!0},p(a,l){t=a;const c={};l&3&&(c.active=t[1]===t[7]),n.$set(c)},i(a){o||(x(n.$$.fragment,a),o=!0)},o(a){z(n.$$.fragment,a),o=!1},d(a){a&&V(e),ie(n)}}}function Y1(i){let t,e=[],n=new Map,s,o=Array(i[0]);const r=a=>a[7];for(let a=0;a<o.length;a+=1){let l=rh(i,o,a),c=r(l);n.set(c,e[a]=ah(c,l))}return{c(){t=S("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","sc-carousel-dots__container svelte-670fde")},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(a,[l]){l&7&&(o=Array(a[0]),ue(),e=St(e,l,r,1,a,o,n,t,dn,ah,null,rh),fe())},i(a){if(!s){for(let l=0;l<o.length;l+=1)x(e[l]);s=!0}},o(a){for(let l=0;l<e.length;l+=1)z(e[l]);s=!1},d(a){a&&V(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function X1(i,t,e){const n=Ds();let{pagesCount:s=1}=t,{currentPageIndex:o=0}=t;function r(l){n("pageChange",l)}const a=l=>r(l);return i.$$set=l=>{"pagesCount"in l&&e(0,s=l.pagesCount),"currentPageIndex"in l&&e(1,o=l.currentPageIndex)},[s,o,r,a]}class U1 extends ce{constructor(t){super(),le(this,t,X1,Y1,ae,{pagesCount:0,currentPageIndex:1},N1)}}const ci="prev",mn="next";function q1(i){he(i,"svelte-1bftafx",":root{--sc-arrow-size:2px}.sc-carousel-arrow__circle.svelte-1bftafx{width:20px;height:20px;border-radius:50%;background-color:var(--sc-color-rgb-light-50p);display:flex;align-items:center;justify-content:center;transition:opacity 100ms ease;cursor:pointer;-webkit-tap-highlight-color:transparent}.sc-carousel-arrow__circle.svelte-1bftafx:hover{opacity:0.9}.sc-carousel-arrow__arrow.svelte-1bftafx{border:solid var(--sc-color-hex-dark);border-width:0 var(--sc-arrow-size) var(--sc-arrow-size) 0;padding:var(--sc-arrow-size);position:relative}.sc-carousel-arrow__arrow-next.svelte-1bftafx{transform:rotate(-45deg);left:calc(var(--sc-arrow-size) / -2)}.sc-carousel-arrow__arrow-prev.svelte-1bftafx{transform:rotate(135deg);right:calc(var(--sc-arrow-size) / -2)}.sc-carousel-arrow__circle_disabled.svelte-1bftafx,.sc-carousel-arrow__circle_disabled.svelte-1bftafx:hover{opacity:0.5}")}function J1(i){let t,e,n,s;return{c(){t=S("button"),e=S("i"),y(e,"class","sc-carousel-arrow__arrow svelte-1bftafx"),$(e,"sc-carousel-arrow__arrow-next",i[0]===mn),$(e,"sc-carousel-arrow__arrow-prev",i[0]===ci),y(t,"class","sc-carousel-button sc-carousel-arrow__circle svelte-1bftafx"),$(t,"sc-carousel-arrow__circle_disabled",i[1])},m(o,r){O(o,t,r),D(t,e),n||(s=ye(t,"click",i[2]),n=!0)},p(o,[r]){r&1&&$(e,"sc-carousel-arrow__arrow-next",o[0]===mn),r&1&&$(e,"sc-carousel-arrow__arrow-prev",o[0]===ci),r&2&&$(t,"sc-carousel-arrow__circle_disabled",o[1])},i:J,o:J,d(o){o&&V(t),n=!1,s()}}}function Z1(i,t,e){let{direction:n=mn}=t,{disabled:s=!1}=t;function o(r){Un.call(this,i,r)}return i.$$set=r=>{"direction"in r&&e(0,n=r.direction),"disabled"in r&&e(1,s=r.disabled)},[n,s,o]}class lh extends ce{constructor(t){super(),le(this,t,Z1,J1,ae,{direction:0,disabled:1},q1)}}function K1(i){he(i,"svelte-i7yfid",".sc-carousel-progress__indicator.svelte-i7yfid{height:100%;background-color:var(--sc-color-hex-dark-50p)}")}function $1(i){let t;return{c(){t=S("div"),y(t,"class","sc-carousel-progress__indicator svelte-i7yfid"),j(t,"width",i[0]+"%")},m(e,n){O(e,t,n)},p(e,[n]){n&1&&j(t,"width",e[0]+"%")},i:J,o:J,d(e){e&&V(t)}}}const ch=100;function ey(i,t,e){let n,{value:s=0}=t;return i.$$set=o=>{"value"in o&&e(1,s=o.value)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Math.min(Math.max(s*ch,0),ch))},[n,s]}class ty extends ce{constructor(t){super(),le(this,t,ey,$1,ae,{value:1},K1)}}function ny(i,t){i.addEventListener("mousedown",t),i.addEventListener("touchstart",t,{passive:!0})}function iy(i,t){i.removeEventListener("mousedown",t),i.removeEventListener("touchstart",t)}function sy(i,t){i.addEventListener("mouseup",t),i.addEventListener("touchend",t)}function dh(i,t){i.removeEventListener("mouseup",t),i.removeEventListener("touchend",t)}function oy(i,t){i.addEventListener("mousemove",t),i.addEventListener("touchmove",t)}function hh(i,t){i.removeEventListener("mousemove",t),i.removeEventListener("touchmove",t)}function Or(i){return function(t,e){i.dispatchEvent(new CustomEvent(t,{detail:e}))}}const ry=110,ay=9,ly=111,cy=20;function Br(i){if("TouchEvent"in window&&i instanceof TouchEvent){const t=i.touches[0];return{x:t?t.clientX:0,y:t?t.clientY:0}}return{x:i.clientX,y:i.clientY}}function dy(i,{thresholdProvider:t}){const e=Or(i);let n,s,o=0,r,a=!1;function l(){return Date.now()-r>=ly&&Math.abs(o)>=cy}function c(u){r=Date.now(),o=0,a=!0;const m=Br(u);n=m.x,s=m.y,e("swipeStart",{x:n,y:s}),oy(window,d),sy(window,h)}function d(u){if(!a)return;const m=Br(u),g=m.x-n,v=m.y-s;n=m.x,s=m.y,e("swipeMove",{x:n,y:s,dx:g,dy:v}),g!==0&&Math.sign(g)!==Math.sign(o)&&(o=0),o+=g,Math.abs(o)>t()&&(e("swipeThresholdReached",{direction:o>0?ci:mn}),dh(window,h),hh(window,d))}function h(u){if(dh(window,h),hh(window,d),a=!1,!l()){e("swipeFailed");return}const m=Br(u);e("swipeEnd",{x:m.x,y:m.y})}return ny(i,c),{destroy(){iy(i,c)}}}function hy(i,t){i.addEventListener("mouseenter",t)}function uy(i,t){i.removeEventListener("mouseenter",t)}function fy(i,t){i.addEventListener("mouseleave",t)}function uh(i,t){i.removeEventListener("mouseleave",t)}function my(i){const t=Or(i);function e(){fy(i,n),t("hovered",{value:!0})}function n(){t("hovered",{value:!1}),uh(i,n)}return hy(i,e),{destroy(){uy(i,e),uh(i,n)}}}const py=(i,t)=>{const e=t.x-i.x,n=t.y-i.y;return Math.sqrt(e*e+n*n)};function di(i,t,e){return Math.max(i,Math.min(t,e))}function gy(i,t){i.addEventListener("touchstart",t,{passive:!0})}function vy(i,t){i.removeEventListener("touchstart",t)}function Ay(i,t){i.addEventListener("touchend",t)}function fh(i,t){i.removeEventListener("touchend",t)}function by(i){const t=Or(i);let e=0,n={x:0,y:0};function s({tapEndedAt:a,tapEndedPos:l}){const c=a-e,d=py(n,l);return c<=ry&&d<=ay}function o(a){e=Date.now();const l=a.touches[0];n={x:l.clientX,y:l.clientY},Ay(i,r)}function r(a){fh(i,r);const l=a.changedTouches[0];s({tapEndedAt:Date.now(),tapEndedPos:{x:l.clientX,y:l.clientY}})&&t("tapped")}return gy(i,o),{destroy(){vy(i,o),fh(i,r)}}}function yy({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:s}){return i===t-e?0:i===0?mh({particlesCountWithoutClones:t-n,particlesToScroll:s})-1:Math.floor((i-e)/s)}function wy({currentParticleIndex:i,particlesToScroll:t}){return Math.ceil(i/t)}function Cy({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,infinite:s,particlesToScroll:o}){return s?yy({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:o}):wy({currentParticleIndex:i,particlesToScroll:o})}function mh({particlesCountWithoutClones:i,particlesToScroll:t}){return Math.ceil(i/t)}function Py({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e}){const n=ph({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e});return Math.ceil(i/t)-n}function Iy({infinite:i,particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n}){return i?mh({particlesCountWithoutClones:t,particlesToScroll:e}):Py({particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n})}function Ey({pageIndex:i,clonesCountHead:t,clonesCountTail:e,particlesToScroll:n,particlesCount:s}){return di(0,Math.min(t+i*n,s-e),s-1)}function ky({pageIndex:i,particlesToScroll:t,particlesCount:e,particlesToShow:n}){return di(0,Math.min(i*t,e-n),e-1)}function _r({infinite:i,pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:s,particlesCount:o,particlesToShow:r}){return i?Ey({pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:s,particlesCount:o}):ky({pageIndex:t,particlesToScroll:s,particlesCount:o,particlesToShow:r})}function xy({particlesContainerChildren:i,particleWidth:t}){for(let e=0;e<i.length;e++)i[e].style.minWidth=`${t}px`,i[e].style.maxWidth=`${t}px`}function ph({particlesToScroll:i,particlesToShow:t,particlesCountWithoutClones:e}){const n=i-t;let s=t;for(;;){const o=e-s-n;if(o<t)return Math.max(o,0);s+=t+n}}function My(i){return new ResizeObserver(t=>{i({width:t[0].contentRect.width})})}function Sy({clonesCountHead:i,clonesCountTail:t,particlesContainerChildren:e}){const n=[];for(let r=0;r<t;r++)n.push(e[r].cloneNode(!0));const s=[],o=e.length;for(let r=o-1;r>o-1-i;r--)s.push(e[r].cloneNode(!0));return{clonesToAppend:n,clonesToPrepend:s}}function Dy({particlesContainer:i,clonesToAppend:t,clonesToPrepend:e}){for(let n=0;n<t.length;n++)i.append(t[n]);for(let n=0;n<e.length;n++)i.prepend(e[n])}function Ly({infinite:i,particlesToShow:t,partialPageSize:e}){const n=i?{head:Math.ceil(e||t),tail:Math.ceil(t)}:{head:0,tail:0};return we(F({},n),{total:n.head+n.tail})}const Ni=(i,t,e)=>{if(i&&i.hasOwnProperty(t))return i[t];if(e===void 0)throw new Error(`Required arg "${t}" was not provided`);return e},Qr=i=>t=>{i[t]&&i[t]()};var Ty="Expected a function",gh="__lodash_hash_undefined__",vh=1/0,zy="[object Function]",jy="[object GeneratorFunction]",Vy="[object Symbol]",Oy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,By=/^\w*$/,_y=/^\./,Qy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ry=/[\\^$.*+?()[\]{}|]/g,Gy=/\\(\\)?/g,Fy=/^\[object .+?Constructor\]$/,Hy=typeof Pt=="object"&&Pt&&Pt.Object===Object&&Pt,Wy=typeof self=="object"&&self&&self.Object===Object&&self,Rr=Hy||Wy||Function("return this")();function Ny(i,t){return i==null?void 0:i[t]}function Yy(i){var t=!1;if(i!=null&&typeof i.toString!="function")try{t=!!(i+"")}catch(e){}return t}var Xy=Array.prototype,Uy=Function.prototype,Ah=Object.prototype,Gr=Rr["__core-js_shared__"],bh=function(){var i=/[^.]+$/.exec(Gr&&Gr.keys&&Gr.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),yh=Uy.toString,Fr=Ah.hasOwnProperty,wh=Ah.toString,qy=RegExp("^"+yh.call(Fr).replace(Ry,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ch=Rr.Symbol,Jy=Xy.splice,Zy=Eh(Rr,"Map"),Yi=Eh(Object,"create"),Ph=Ch?Ch.prototype:void 0,Ih=Ph?Ph.toString:void 0;function xn(i){var t=-1,e=i?i.length:0;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function Ky(){this.__data__=Yi?Yi(null):{}}function $y(i){return this.has(i)&&delete this.__data__[i]}function ew(i){var t=this.__data__;if(Yi){var e=t[i];return e===gh?void 0:e}return Fr.call(t,i)?t[i]:void 0}function tw(i){var t=this.__data__;return Yi?t[i]!==void 0:Fr.call(t,i)}function nw(i,t){var e=this.__data__;return e[i]=Yi&&t===void 0?gh:t,this}xn.prototype.clear=Ky,xn.prototype.delete=$y,xn.prototype.get=ew,xn.prototype.has=tw,xn.prototype.set=nw;function hi(i){var t=-1,e=i?i.length:0;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function iw(){this.__data__=[]}function sw(i){var t=this.__data__,e=ao(t,i);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():Jy.call(t,e,1),!0}function ow(i){var t=this.__data__,e=ao(t,i);return e<0?void 0:t[e][1]}function rw(i){return ao(this.__data__,i)>-1}function aw(i,t){var e=this.__data__,n=ao(e,i);return n<0?e.push([i,t]):e[n][1]=t,this}hi.prototype.clear=iw,hi.prototype.delete=sw,hi.prototype.get=ow,hi.prototype.has=rw,hi.prototype.set=aw;function Mn(i){var t=-1,e=i?i.length:0;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function lw(){this.__data__={hash:new xn,map:new(Zy||hi),string:new xn}}function cw(i){return lo(this,i).delete(i)}function dw(i){return lo(this,i).get(i)}function hw(i){return lo(this,i).has(i)}function uw(i,t){return lo(this,i).set(i,t),this}Mn.prototype.clear=lw,Mn.prototype.delete=cw,Mn.prototype.get=dw,Mn.prototype.has=hw,Mn.prototype.set=uw;function ao(i,t){for(var e=i.length;e--;)if(Pw(i[e][0],t))return e;return-1}function fw(i,t){t=vw(t,i)?[t]:gw(t);for(var e=0,n=t.length;i!=null&&e<n;)i=i[ww(t[e++])];return e&&e==n?i:void 0}function mw(i){if(!xh(i)||bw(i))return!1;var t=Iw(i)||Yy(i)?qy:Fy;return t.test(Cw(i))}function pw(i){if(typeof i=="string")return i;if(Wr(i))return Ih?Ih.call(i):"";var t=i+"";return t=="0"&&1/i==-vh?"-0":t}function gw(i){return kh(i)?i:yw(i)}function lo(i,t){var e=i.__data__;return Aw(t)?e[typeof t=="string"?"string":"hash"]:e.map}function Eh(i,t){var e=Ny(i,t);return mw(e)?e:void 0}function vw(i,t){if(kh(i))return!1;var e=typeof i;return e=="number"||e=="symbol"||e=="boolean"||i==null||Wr(i)?!0:By.test(i)||!Oy.test(i)||t!=null&&i in Object(t)}function Aw(i){var t=typeof i;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?i!=="__proto__":i===null}function bw(i){return!!bh&&bh in i}var yw=Hr(function(i){i=kw(i);var t=[];return _y.test(i)&&t.push(""),i.replace(Qy,function(e,n,s,o){t.push(s?o.replace(Gy,"$1"):n||e)}),t});function ww(i){if(typeof i=="string"||Wr(i))return i;var t=i+"";return t=="0"&&1/i==-vh?"-0":t}function Cw(i){if(i!=null){try{return yh.call(i)}catch(t){}try{return i+""}catch(t){}}return""}function Hr(i,t){if(typeof i!="function"||t&&typeof t!="function")throw new TypeError(Ty);var e=function(){var n=arguments,s=t?t.apply(this,n):n[0],o=e.cache;if(o.has(s))return o.get(s);var r=i.apply(this,n);return e.cache=o.set(s,r),r};return e.cache=new(Hr.Cache||Mn),e}Hr.Cache=Mn;function Pw(i,t){return i===t||i!==i&&t!==t}var kh=Array.isArray;function Iw(i){var t=xh(i)?wh.call(i):"";return t==zy||t==jy}function xh(i){var t=typeof i;return!!i&&(t=="object"||t=="function")}function Ew(i){return!!i&&typeof i=="object"}function Wr(i){return typeof i=="symbol"||Ew(i)&&wh.call(i)==Vy}function kw(i){return i==null?"":pw(i)}function xw(i,t,e){var n=i==null?void 0:fw(i,t);return n===void 0?e:n}var co=xw,ho={},Mw={get exports(){return ho},set exports(i){ho=i}};(function(i,t){var e=200,n="__lodash_hash_undefined__",s=9007199254740991,o="[object Arguments]",r="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",h="[object GeneratorFunction]",u="[object Map]",m="[object Number]",g="[object Object]",v="[object Promise]",p="[object RegExp]",b="[object Set]",w="[object String]",P="[object Symbol]",k="[object WeakMap]",T="[object ArrayBuffer]",I="[object DataView]",B="[object Float32Array]",L="[object Float64Array]",X="[object Int8Array]",Z="[object Int16Array]",G="[object Int32Array]",R="[object Uint8Array]",H="[object Uint8ClampedArray]",Q="[object Uint16Array]",W="[object Uint32Array]",q=/[\\^$.*+?()[\]{}|]/g,U=/\w*$/,K=/^\[object .+?Constructor\]$/,de=/^(?:0|[1-9]\d*)$/,oe={};oe[o]=oe[r]=oe[T]=oe[I]=oe[a]=oe[l]=oe[B]=oe[L]=oe[X]=oe[Z]=oe[G]=oe[u]=oe[m]=oe[g]=oe[p]=oe[b]=oe[w]=oe[P]=oe[R]=oe[H]=oe[Q]=oe[W]=!0,oe[c]=oe[d]=oe[k]=!1;var Pe=typeof Pt=="object"&&Pt&&Pt.Object===Object&&Pt,Ie=typeof self=="object"&&self&&self.Object===Object&&self,Ae=Pe||Ie||Function("return this")(),Be=t&&!t.nodeType&&t,be=Be&&!0&&i&&!i.nodeType&&i,Ne=be&&be.exports===Be;function me(A,C){return A.set(C[0],C[1]),A}function Ce(A,C){return A.add(C),A}function ze(A,C){for(var M=-1,N=A?A.length:0;++M<N&&C(A[M],M,A)!==!1;);return A}function pe(A,C){for(var M=-1,N=C.length,Ee=A.length;++M<N;)A[Ee+M]=C[M];return A}function Ke(A,C,M,N){var Ee=-1,ge=A?A.length:0;for(N&&ge&&(M=A[++Ee]);++Ee<ge;)M=C(M,A[Ee],Ee,A);return M}function ht(A,C){for(var M=-1,N=Array(A);++M<A;)N[M]=C(M);return N}function Me(A,C){return A==null?void 0:A[C]}function ot(A){var C=!1;if(A!=null&&typeof A.toString!="function")try{C=!!(A+"")}catch(M){}return C}function re(A){var C=-1,M=Array(A.size);return A.forEach(function(N,Ee){M[++C]=[Ee,N]}),M}function xe(A,C){return function(M){return A(C(M))}}function He(A){var C=-1,M=Array(A.size);return A.forEach(function(N){M[++C]=N}),M}var mt=Array.prototype,qt=Function.prototype,yt=Object.prototype,wt=Ae["__core-js_shared__"],_e=function(){var A=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}(),Ge=qt.toString,qe=yt.hasOwnProperty,Dt=yt.toString,Ji=RegExp("^"+Ge.call(qe).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rt=Ne?Ae.Buffer:void 0,gn=Ae.Symbol,Dn=Ae.Uint8Array,pt=xe(Object.getPrototypeOf,Object),mi=Object.create,pi=yt.propertyIsEnumerable,ia=mt.splice,Zi=Object.getOwnPropertySymbols,gi=Rt?Rt.isBuffer:void 0,yo=xe(Object.keys,Object),vi=Tt(Ae,"DataView"),Ln=Tt(Ae,"Map"),Lt=Tt(Ae,"Promise"),Ai=Tt(Ae,"Set"),Ki=Tt(Ae,"WeakMap"),Tn=Tt(Object,"create"),$i=ut(vi),zn=ut(Ln),es=ut(Lt),ts=ut(Ai),ns=ut(Ki),vn=gn?gn.prototype:void 0,wo=vn?vn.valueOf:void 0;function Jt(A){var C=-1,M=A?A.length:0;for(this.clear();++C<M;){var N=A[C];this.set(N[0],N[1])}}function sa(){this.__data__=Tn?Tn(null):{}}function oa(A){return this.has(A)&&delete this.__data__[A]}function ra(A){var C=this.__data__;if(Tn){var M=C[A];return M===n?void 0:M}return qe.call(C,A)?C[A]:void 0}function Co(A){var C=this.__data__;return Tn?C[A]!==void 0:qe.call(C,A)}function is(A,C){var M=this.__data__;return M[A]=Tn&&C===void 0?n:C,this}Jt.prototype.clear=sa,Jt.prototype.delete=oa,Jt.prototype.get=ra,Jt.prototype.has=Co,Jt.prototype.set=is;function $e(A){var C=-1,M=A?A.length:0;for(this.clear();++C<M;){var N=A[C];this.set(N[0],N[1])}}function aa(){this.__data__=[]}function la(A){var C=this.__data__,M=yi(C,A);if(M<0)return!1;var N=C.length-1;return M==N?C.pop():ia.call(C,M,1),!0}function ca(A){var C=this.__data__,M=yi(C,A);return M<0?void 0:C[M][1]}function da(A){return yi(this.__data__,A)>-1}function ha(A,C){var M=this.__data__,N=yi(M,A);return N<0?M.push([A,C]):M[N][1]=C,this}$e.prototype.clear=aa,$e.prototype.delete=la,$e.prototype.get=ca,$e.prototype.has=da,$e.prototype.set=ha;function rt(A){var C=-1,M=A?A.length:0;for(this.clear();++C<M;){var N=A[C];this.set(N[0],N[1])}}function ua(){this.__data__={hash:new Jt,map:new(Ln||$e),string:new Jt}}function fa(A){return Vn(this,A).delete(A)}function ma(A){return Vn(this,A).get(A)}function pa(A){return Vn(this,A).has(A)}function ga(A,C){return Vn(this,A).set(A,C),this}rt.prototype.clear=ua,rt.prototype.delete=fa,rt.prototype.get=ma,rt.prototype.has=pa,rt.prototype.set=ga;function gt(A){this.__data__=new $e(A)}function va(){this.__data__=new $e}function Aa(A){return this.__data__.delete(A)}function ba(A){return this.__data__.get(A)}function ya(A){return this.__data__.has(A)}function wa(A,C){var M=this.__data__;if(M instanceof $e){var N=M.__data__;if(!Ln||N.length<e-1)return N.push([A,C]),this;M=this.__data__=new rt(N)}return M.set(A,C),this}gt.prototype.clear=va,gt.prototype.delete=Aa,gt.prototype.get=ba,gt.prototype.has=ya,gt.prototype.set=wa;function bi(A,C){var M=as(A)||Ci(A)?ht(A.length,String):[],N=M.length,Ee=!!N;for(var ge in A)(C||qe.call(A,ge))&&!(Ee&&(ge=="length"||Va(ge,N)))&&M.push(ge);return M}function Po(A,C,M){var N=A[C];(!(qe.call(A,C)&&Mo(N,M))||M===void 0&&!(C in A))&&(A[C]=M)}function yi(A,C){for(var M=A.length;M--;)if(Mo(A[M][0],C))return M;return-1}function Gt(A,C){return A&&rs(C,cs(C),A)}function ss(A,C,M,N,Ee,ge,Se){var Le;if(N&&(Le=ge?N(A,Ee,ge,Se):N(A)),Le!==void 0)return Le;if(!Ht(A))return A;var Ye=as(A);if(Ye){if(Le=za(A),!C)return Da(A,Le)}else{var Ve=Kt(A),at=Ve==d||Ve==h;if(So(A))return wi(A,C);if(Ve==g||Ve==o||at&&!ge){if(ot(A))return ge?A:{};if(Le=Ft(at?{}:A),!C)return La(A,Gt(Le,A))}else{if(!oe[Ve])return ge?A:{};Le=ja(A,Ve,ss,C)}}Se||(Se=new gt);var vt=Se.get(A);if(vt)return vt;if(Se.set(A,Le),!Ye)var Xe=M?Ta(A):cs(A);return ze(Xe||A,function(lt,et){Xe&&(et=lt,lt=A[et]),Po(Le,et,ss(lt,C,M,N,et,A,Se))}),Le}function Ca(A){return Ht(A)?mi(A):{}}function Pa(A,C,M){var N=C(A);return as(A)?N:pe(N,M(A))}function Ia(A){return Dt.call(A)}function Ea(A){if(!Ht(A)||Ba(A))return!1;var C=ls(A)||ot(A)?Ji:K;return C.test(ut(A))}function ka(A){if(!ko(A))return yo(A);var C=[];for(var M in Object(A))qe.call(A,M)&&M!="constructor"&&C.push(M);return C}function wi(A,C){if(C)return A.slice();var M=new A.constructor(A.length);return A.copy(M),M}function os(A){var C=new A.constructor(A.byteLength);return new Dn(C).set(new Dn(A)),C}function jn(A,C){var M=C?os(A.buffer):A.buffer;return new A.constructor(M,A.byteOffset,A.byteLength)}function Io(A,C,M){var N=C?M(re(A),!0):re(A);return Ke(N,me,new A.constructor)}function Eo(A){var C=new A.constructor(A.source,U.exec(A));return C.lastIndex=A.lastIndex,C}function xa(A,C,M){var N=C?M(He(A),!0):He(A);return Ke(N,Ce,new A.constructor)}function Ma(A){return wo?Object(wo.call(A)):{}}function Sa(A,C){var M=C?os(A.buffer):A.buffer;return new A.constructor(M,A.byteOffset,A.length)}function Da(A,C){var M=-1,N=A.length;for(C||(C=Array(N));++M<N;)C[M]=A[M];return C}function rs(A,C,M,N){M||(M={});for(var Ee=-1,ge=C.length;++Ee<ge;){var Se=C[Ee],Le=N?N(M[Se],A[Se],Se,M,A):void 0;Po(M,Se,Le===void 0?A[Se]:Le)}return M}function La(A,C){return rs(A,Zt(A),C)}function Ta(A){return Pa(A,cs,Zt)}function Vn(A,C){var M=A.__data__;return Oa(C)?M[typeof C=="string"?"string":"hash"]:M.map}function Tt(A,C){var M=Me(A,C);return Ea(M)?M:void 0}var Zt=Zi?xe(Zi,Object):Qa,Kt=Ia;(vi&&Kt(new vi(new ArrayBuffer(1)))!=I||Ln&&Kt(new Ln)!=u||Lt&&Kt(Lt.resolve())!=v||Ai&&Kt(new Ai)!=b||Ki&&Kt(new Ki)!=k)&&(Kt=function(A){var C=Dt.call(A),M=C==g?A.constructor:void 0,N=M?ut(M):void 0;if(N)switch(N){case $i:return I;case zn:return u;case es:return v;case ts:return b;case ns:return k}return C});function za(A){var C=A.length,M=A.constructor(C);return C&&typeof A[0]=="string"&&qe.call(A,"index")&&(M.index=A.index,M.input=A.input),M}function Ft(A){return typeof A.constructor=="function"&&!ko(A)?Ca(pt(A)):{}}function ja(A,C,M,N){var Ee=A.constructor;switch(C){case T:return os(A);case a:case l:return new Ee(+A);case I:return jn(A,N);case B:case L:case X:case Z:case G:case R:case H:case Q:case W:return Sa(A,N);case u:return Io(A,N,M);case m:case w:return new Ee(A);case p:return Eo(A);case b:return xa(A,N,M);case P:return Ma(A)}}function Va(A,C){return C=C==null?s:C,!!C&&(typeof A=="number"||de.test(A))&&A>-1&&A%1==0&&A<C}function Oa(A){var C=typeof A;return C=="string"||C=="number"||C=="symbol"||C=="boolean"?A!=="__proto__":A===null}function Ba(A){return!!_e&&_e in A}function ko(A){var C=A&&A.constructor,M=typeof C=="function"&&C.prototype||yt;return A===M}function ut(A){if(A!=null){try{return Ge.call(A)}catch(C){}try{return A+""}catch(C){}}return""}function xo(A){return ss(A,!0,!0)}function Mo(A,C){return A===C||A!==A&&C!==C}function Ci(A){return _a(A)&&qe.call(A,"callee")&&(!pi.call(A,"callee")||Dt.call(A)==o)}var as=Array.isArray;function Pi(A){return A!=null&&Do(A.length)&&!ls(A)}function _a(A){return Lo(A)&&Pi(A)}var So=gi||Ra;function ls(A){var C=Ht(A)?Dt.call(A):"";return C==d||C==h}function Do(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function Ht(A){var C=typeof A;return!!A&&(C=="object"||C=="function")}function Lo(A){return!!A&&typeof A=="object"}function cs(A){return Pi(A)?bi(A):ka(A)}function Qa(){return[]}function Ra(){return!1}i.exports=xo})(Mw,ho);const Sw=ho;var uo={},Dw={get exports(){return uo},set exports(i){uo=i}};(function(i,t){var e=200,n="__lodash_hash_undefined__",s=1,o=2,r=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",d="[object Boolean]",h="[object Date]",u="[object Error]",m="[object Function]",g="[object GeneratorFunction]",v="[object Map]",p="[object Number]",b="[object Null]",w="[object Object]",P="[object Promise]",k="[object Proxy]",T="[object RegExp]",I="[object Set]",B="[object String]",L="[object Symbol]",X="[object Undefined]",Z="[object WeakMap]",G="[object ArrayBuffer]",R="[object DataView]",H="[object Float32Array]",Q="[object Float64Array]",W="[object Int8Array]",q="[object Int16Array]",U="[object Int32Array]",K="[object Uint8Array]",de="[object Uint8ClampedArray]",oe="[object Uint16Array]",Pe="[object Uint32Array]",Ie=/[\\^$.*+?()[\]{}|]/g,Ae=/^\[object .+?Constructor\]$/,Be=/^(?:0|[1-9]\d*)$/,be={};be[H]=be[Q]=be[W]=be[q]=be[U]=be[K]=be[de]=be[oe]=be[Pe]=!0,be[a]=be[l]=be[G]=be[d]=be[R]=be[h]=be[u]=be[m]=be[v]=be[p]=be[w]=be[T]=be[I]=be[B]=be[Z]=!1;var Ne=typeof Pt=="object"&&Pt&&Pt.Object===Object&&Pt,me=typeof self=="object"&&self&&self.Object===Object&&self,Ce=Ne||me||Function("return this")(),ze=t&&!t.nodeType&&t,pe=ze&&!0&&i&&!i.nodeType&&i,Ke=pe&&pe.exports===ze,ht=Ke&&Ne.process,Me=function(){try{return ht&&ht.binding&&ht.binding("util")}catch(A){}}(),ot=Me&&Me.isTypedArray;function re(A,C){for(var M=-1,N=A==null?0:A.length,Ee=0,ge=[];++M<N;){var Se=A[M];C(Se,M,A)&&(ge[Ee++]=Se)}return ge}function xe(A,C){for(var M=-1,N=C.length,Ee=A.length;++M<N;)A[Ee+M]=C[M];return A}function He(A,C){for(var M=-1,N=A==null?0:A.length;++M<N;)if(C(A[M],M,A))return!0;return!1}function mt(A,C){for(var M=-1,N=Array(A);++M<A;)N[M]=C(M);return N}function qt(A){return function(C){return A(C)}}function yt(A,C){return A.has(C)}function wt(A,C){return A==null?void 0:A[C]}function _e(A){var C=-1,M=Array(A.size);return A.forEach(function(N,Ee){M[++C]=[Ee,N]}),M}function Ge(A,C){return function(M){return A(C(M))}}function qe(A){var C=-1,M=Array(A.size);return A.forEach(function(N){M[++C]=N}),M}var Dt=Array.prototype,Ji=Function.prototype,Rt=Object.prototype,gn=Ce["__core-js_shared__"],Dn=Ji.toString,pt=Rt.hasOwnProperty,mi=function(){var A=/[^.]+$/.exec(gn&&gn.keys&&gn.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}(),pi=Rt.toString,ia=RegExp("^"+Dn.call(pt).replace(Ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zi=Ke?Ce.Buffer:void 0,gi=Ce.Symbol,yo=Ce.Uint8Array,vi=Rt.propertyIsEnumerable,Ln=Dt.splice,Lt=gi?gi.toStringTag:void 0,Ai=Object.getOwnPropertySymbols,Ki=Zi?Zi.isBuffer:void 0,Tn=Ge(Object.keys,Object),$i=Zt(Ce,"DataView"),zn=Zt(Ce,"Map"),es=Zt(Ce,"Promise"),ts=Zt(Ce,"Set"),ns=Zt(Ce,"WeakMap"),vn=Zt(Object,"create"),wo=ut($i),Jt=ut(zn),sa=ut(es),oa=ut(ts),ra=ut(ns),Co=gi?gi.prototype:void 0,is=Co?Co.valueOf:void 0;function $e(A){var C=-1,M=A==null?0:A.length;for(this.clear();++C<M;){var N=A[C];this.set(N[0],N[1])}}function aa(){this.__data__=vn?vn(null):{},this.size=0}function la(A){var C=this.has(A)&&delete this.__data__[A];return this.size-=C?1:0,C}function ca(A){var C=this.__data__;if(vn){var M=C[A];return M===n?void 0:M}return pt.call(C,A)?C[A]:void 0}function da(A){var C=this.__data__;return vn?C[A]!==void 0:pt.call(C,A)}function ha(A,C){var M=this.__data__;return this.size+=this.has(A)?0:1,M[A]=vn&&C===void 0?n:C,this}$e.prototype.clear=aa,$e.prototype.delete=la,$e.prototype.get=ca,$e.prototype.has=da,$e.prototype.set=ha;function rt(A){var C=-1,M=A==null?0:A.length;for(this.clear();++C<M;){var N=A[C];this.set(N[0],N[1])}}function ua(){this.__data__=[],this.size=0}function fa(A){var C=this.__data__,M=wi(C,A);if(M<0)return!1;var N=C.length-1;return M==N?C.pop():Ln.call(C,M,1),--this.size,!0}function ma(A){var C=this.__data__,M=wi(C,A);return M<0?void 0:C[M][1]}function pa(A){return wi(this.__data__,A)>-1}function ga(A,C){var M=this.__data__,N=wi(M,A);return N<0?(++this.size,M.push([A,C])):M[N][1]=C,this}rt.prototype.clear=ua,rt.prototype.delete=fa,rt.prototype.get=ma,rt.prototype.has=pa,rt.prototype.set=ga;function gt(A){var C=-1,M=A==null?0:A.length;for(this.clear();++C<M;){var N=A[C];this.set(N[0],N[1])}}function va(){this.size=0,this.__data__={hash:new $e,map:new(zn||rt),string:new $e}}function Aa(A){var C=Tt(this,A).delete(A);return this.size-=C?1:0,C}function ba(A){return Tt(this,A).get(A)}function ya(A){return Tt(this,A).has(A)}function wa(A,C){var M=Tt(this,A),N=M.size;return M.set(A,C),this.size+=M.size==N?0:1,this}gt.prototype.clear=va,gt.prototype.delete=Aa,gt.prototype.get=ba,gt.prototype.has=ya,gt.prototype.set=wa;function bi(A){var C=-1,M=A==null?0:A.length;for(this.__data__=new gt;++C<M;)this.add(A[C])}function Po(A){return this.__data__.set(A,n),this}function yi(A){return this.__data__.has(A)}bi.prototype.add=bi.prototype.push=Po,bi.prototype.has=yi;function Gt(A){var C=this.__data__=new rt(A);this.size=C.size}function ss(){this.__data__=new rt,this.size=0}function Ca(A){var C=this.__data__,M=C.delete(A);return this.size=C.size,M}function Pa(A){return this.__data__.get(A)}function Ia(A){return this.__data__.has(A)}function Ea(A,C){var M=this.__data__;if(M instanceof rt){var N=M.__data__;if(!zn||N.length<e-1)return N.push([A,C]),this.size=++M.size,this;M=this.__data__=new gt(N)}return M.set(A,C),this.size=M.size,this}Gt.prototype.clear=ss,Gt.prototype.delete=Ca,Gt.prototype.get=Pa,Gt.prototype.has=Ia,Gt.prototype.set=Ea;function ka(A,C){var M=Ci(A),N=!M&&Mo(A),Ee=!M&&!N&&Pi(A),ge=!M&&!N&&!Ee&&Lo(A),Se=M||N||Ee||ge,Le=Se?mt(A.length,String):[],Ye=Le.length;for(var Ve in A)(C||pt.call(A,Ve))&&!(Se&&(Ve=="length"||Ee&&(Ve=="offset"||Ve=="parent")||ge&&(Ve=="buffer"||Ve=="byteLength"||Ve=="byteOffset")||ja(Ve,Ye)))&&Le.push(Ve);return Le}function wi(A,C){for(var M=A.length;M--;)if(xo(A[M][0],C))return M;return-1}function os(A,C,M){var N=C(A);return Ci(A)?N:xe(N,M(A))}function jn(A){return A==null?A===void 0?X:b:Lt&&Lt in Object(A)?Kt(A):ko(A)}function Io(A){return Ht(A)&&jn(A)==a}function Eo(A,C,M,N,Ee){return A===C?!0:A==null||C==null||!Ht(A)&&!Ht(C)?A!==A&&C!==C:xa(A,C,M,N,Eo,Ee)}function xa(A,C,M,N,Ee,ge){var Se=Ci(A),Le=Ci(C),Ye=Se?l:Ft(A),Ve=Le?l:Ft(C);Ye=Ye==a?w:Ye,Ve=Ve==a?w:Ve;var at=Ye==w,vt=Ve==w,Xe=Ye==Ve;if(Xe&&Pi(A)){if(!Pi(C))return!1;Se=!0,at=!1}if(Xe&&!at)return ge||(ge=new Gt),Se||Lo(A)?rs(A,C,M,N,Ee,ge):La(A,C,Ye,M,N,Ee,ge);if(!(M&s)){var lt=at&&pt.call(A,"__wrapped__"),et=vt&&pt.call(C,"__wrapped__");if(lt||et){var An=lt?A.value():A,$t=et?C.value():C;return ge||(ge=new Gt),Ee(An,$t,M,N,ge)}}return Xe?(ge||(ge=new Gt),Ta(A,C,M,N,Ee,ge)):!1}function Ma(A){if(!Do(A)||Oa(A))return!1;var C=So(A)?ia:Ae;return C.test(ut(A))}function Sa(A){return Ht(A)&&ls(A.length)&&!!be[jn(A)]}function Da(A){if(!Ba(A))return Tn(A);var C=[];for(var M in Object(A))pt.call(A,M)&&M!="constructor"&&C.push(M);return C}function rs(A,C,M,N,Ee,ge){var Se=M&s,Le=A.length,Ye=C.length;if(Le!=Ye&&!(Se&&Ye>Le))return!1;var Ve=ge.get(A);if(Ve&&ge.get(C))return Ve==C;var at=-1,vt=!0,Xe=M&o?new bi:void 0;for(ge.set(A,C),ge.set(C,A);++at<Le;){var lt=A[at],et=C[at];if(N)var An=Se?N(et,lt,at,C,A,ge):N(lt,et,at,A,C,ge);if(An!==void 0){if(An)continue;vt=!1;break}if(Xe){if(!He(C,function($t,On){if(!yt(Xe,On)&&(lt===$t||Ee(lt,$t,M,N,ge)))return Xe.push(On)})){vt=!1;break}}else if(!(lt===et||Ee(lt,et,M,N,ge))){vt=!1;break}}return ge.delete(A),ge.delete(C),vt}function La(A,C,M,N,Ee,ge,Se){switch(M){case R:if(A.byteLength!=C.byteLength||A.byteOffset!=C.byteOffset)return!1;A=A.buffer,C=C.buffer;case G:return!(A.byteLength!=C.byteLength||!ge(new yo(A),new yo(C)));case d:case h:case p:return xo(+A,+C);case u:return A.name==C.name&&A.message==C.message;case T:case B:return A==C+"";case v:var Le=_e;case I:var Ye=N&s;if(Le||(Le=qe),A.size!=C.size&&!Ye)return!1;var Ve=Se.get(A);if(Ve)return Ve==C;N|=o,Se.set(A,C);var at=rs(Le(A),Le(C),N,Ee,ge,Se);return Se.delete(A),at;case L:if(is)return is.call(A)==is.call(C)}return!1}function Ta(A,C,M,N,Ee,ge){var Se=M&s,Le=Vn(A),Ye=Le.length,Ve=Vn(C),at=Ve.length;if(Ye!=at&&!Se)return!1;for(var vt=Ye;vt--;){var Xe=Le[vt];if(!(Se?Xe in C:pt.call(C,Xe)))return!1}var lt=ge.get(A);if(lt&&ge.get(C))return lt==C;var et=!0;ge.set(A,C),ge.set(C,A);for(var An=Se;++vt<Ye;){Xe=Le[vt];var $t=A[Xe],On=C[Xe];if(N)var Hu=Se?N(On,$t,Xe,C,A,ge):N($t,On,Xe,A,C,ge);if(!(Hu===void 0?$t===On||Ee($t,On,M,N,ge):Hu)){et=!1;break}An||(An=Xe=="constructor")}if(et&&!An){var To=A.constructor,zo=C.constructor;To!=zo&&"constructor"in A&&"constructor"in C&&!(typeof To=="function"&&To instanceof To&&typeof zo=="function"&&zo instanceof zo)&&(et=!1)}return ge.delete(A),ge.delete(C),et}function Vn(A){return os(A,cs,za)}function Tt(A,C){var M=A.__data__;return Va(C)?M[typeof C=="string"?"string":"hash"]:M.map}function Zt(A,C){var M=wt(A,C);return Ma(M)?M:void 0}function Kt(A){var C=pt.call(A,Lt),M=A[Lt];try{A[Lt]=void 0;var N=!0}catch(ge){}var Ee=pi.call(A);return N&&(C?A[Lt]=M:delete A[Lt]),Ee}var za=Ai?function(A){return A==null?[]:(A=Object(A),re(Ai(A),function(C){return vi.call(A,C)}))}:Qa,Ft=jn;($i&&Ft(new $i(new ArrayBuffer(1)))!=R||zn&&Ft(new zn)!=v||es&&Ft(es.resolve())!=P||ts&&Ft(new ts)!=I||ns&&Ft(new ns)!=Z)&&(Ft=function(A){var C=jn(A),M=C==w?A.constructor:void 0,N=M?ut(M):"";if(N)switch(N){case wo:return R;case Jt:return v;case sa:return P;case oa:return I;case ra:return Z}return C});function ja(A,C){return C=C==null?r:C,!!C&&(typeof A=="number"||Be.test(A))&&A>-1&&A%1==0&&A<C}function Va(A){var C=typeof A;return C=="string"||C=="number"||C=="symbol"||C=="boolean"?A!=="__proto__":A===null}function Oa(A){return!!mi&&mi in A}function Ba(A){var C=A&&A.constructor,M=typeof C=="function"&&C.prototype||Rt;return A===M}function ko(A){return pi.call(A)}function ut(A){if(A!=null){try{return Dn.call(A)}catch(C){}try{return A+""}catch(C){}}return""}function xo(A,C){return A===C||A!==A&&C!==C}var Mo=Io(function(){return arguments}())?Io:function(A){return Ht(A)&&pt.call(A,"callee")&&!vi.call(A,"callee")},Ci=Array.isArray;function as(A){return A!=null&&ls(A.length)&&!So(A)}var Pi=Ki||Ra;function _a(A,C){return Eo(A,C)}function So(A){if(!Do(A))return!1;var C=jn(A);return C==m||C==g||C==c||C==k}function ls(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=r}function Do(A){var C=typeof A;return A!=null&&(C=="object"||C=="function")}function Ht(A){return A!=null&&typeof A=="object"}var Lo=ot?qt(ot):Sa;function cs(A){return as(A)?ka(A):Da(A)}function Qa(){return[]}function Ra(){return!1}i.exports=_a})(Dw,uo);const Lw=uo,Tw=(i,t)=>Lw(i,t),zw=i=>Object.keys(i||{}),jw=(i,t)=>{const e={};return i.forEach(n=>{e[n]=t[n]}),e},Vw=()=>{const i={},t=(e,n)=>{const{watcherName:s,fn:o}=e,{prop:r,value:a}=n;i[s]||(i[s]={deps:{},fn:o}),i[s].deps[r]=a};return{subscribers:i,subscribe(e,n){e&&t(e,n)},notify(e,n){Object.entries(i).forEach(([s,{deps:o,fn:r}])=>{const a=zw(o);if(a.includes(n)){const l=jw(a,e);Tw(o,l)||(i[s].deps=l,r())}})}}},Ow=()=>{let i=null;return{targetWatcher(t,e){i={watcherName:t,fn:e},i.fn(),i=null},getTarget(){return i}}};function Bw(i,t){const e=co(i,"data",{}),n=co(i,"watch",{}),s=co(i,"methods",{}),o=co(t,"onChange",()=>{}),{subscribe:r,notify:a,subscribers:l}=Vw(),{targetWatcher:c,getTarget:d}=Ow();let h;const u={},m=()=>({data:h,methods:u});let g=!1;const v=b=>(...w)=>{g=!0;const P=b(...w);return g=!1,P};Object.entries(s).forEach(([b,w])=>{u[b]=v((...P)=>w(m(),...P)),Object.defineProperty(u[b],"name",{value:b})}),h=new Proxy(Sw(e),{get(b,w){return d()&&!g&&r(d(),{prop:w,value:b[w]}),Reflect.get(...arguments)},set(b,w,P){return b[w]===P||(Reflect.set(...arguments),d()||(o&&o(w,P),a(h,w))),!0}}),Object.entries(n).forEach(([b,w])=>{c(b,()=>{w(m())})});const p=[h,u];return p._internal={_getSubscribers(){return l}},p}function _w({pageIndex:i,particlesToShow:t,particlesToScroll:e,particlesCount:n}){const s=i===0?0:t-e,o=i*t-i*s,r=o+Math.max(t,e)-1,a=[];for(let l=o;l<=Math.min(n-1,r);l++)a.push(l);return a}function Qw({infinite:i,pageIndex:t,pagesCount:e,particlesCount:n,particlesToShow:s,particlesToScroll:o}){const r=di(0,t,e-1);let a=r-1,l=r+1;a=i?a<0?e-1:a:Math.max(0,a),l=i?l>e-1?0:l:Math.min(e-1,l);const c=[...new Set([a,r,l,0,e-1])].sort((h,u)=>h-u),d=c.flatMap(h=>_w({pageIndex:h,particlesToShow:s,particlesToScroll:o,particlesCount:n}));return{pageIndexes:c,particleIndexes:[...new Set(d)].sort((h,u)=>h-u)}}const Rw=(i,t)=>(i(),setInterval(i,t)),Gw=35,Mh=1;class Fw{constructor({onProgressValueChange:t}){this._onProgressValueChange=t,this._autoplayDuration,this._onProgressValueChange,this._interval,this._paused=!1}setAutoplayDuration(t){this._autoplayDuration=t}start(t){return new Promise(e=>{this.reset();const n=Math.min(Gw,Math.max(this._autoplayDuration,1));let s=-n;this._interval=Rw(()=>Y(this,null,function*(){if(this._paused)return;s+=n;const o=s/this._autoplayDuration;this._onProgressValueChange(o),o>Mh&&(this.reset(),yield t(),e())}),n)})}pause(){this._paused=!0}resume(){this._paused=!1}reset(){clearInterval(this._interval),this._onProgressValueChange(Mh)}}function Hw(i){const t=new Fw({onProgressValueChange:r=>{i("progressValue",1-r)}}),e=Bw({data:{particlesCountWithoutClones:0,particlesToShow:1,particlesToShowInit:1,particlesToScroll:1,particlesToScrollInit:1,particlesCount:1,currentParticleIndex:1,infinite:!1,autoplayDuration:1e3,clonesCountHead:0,clonesCountTail:0,clonesCountTotal:0,partialPageSize:1,currentPageIndex:1,pagesCount:1,pauseOnFocus:!1,focused:!1,autoplay:!1,autoplayDirection:"next",disabled:!1,durationMsInit:1e3,durationMs:1e3,offset:0,particleWidth:0,loaded:[]},watch:{setLoaded({data:r}){r.loaded=Qw({infinite:r.infinite,pageIndex:r.currentPageIndex,pagesCount:r.pagesCount,particlesCount:r.particlesCountWithoutClones,particlesToShow:r.particlesToShow,particlesToScroll:r.particlesToScroll}).particleIndexes},setCurrentPageIndex({data:r}){r.currentPageIndex=Cy({currentParticleIndex:r.currentParticleIndex,particlesCount:r.particlesCount,clonesCountHead:r.clonesCountHead,clonesCountTotal:r.clonesCountTotal,infinite:r.infinite,particlesToScroll:r.particlesToScroll})},setPartialPageSize({data:r}){r.partialPageSize=ph({particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow,particlesCountWithoutClones:r.particlesCountWithoutClones})},setClonesCount({data:r}){const{head:a,tail:l}=Ly({infinite:r.infinite,particlesToShow:r.particlesToShow,partialPageSize:r.partialPageSize});r.clonesCountHead=a,r.clonesCountTail=l,r.clonesCountTotal=a+l},setProgressManagerAutoplayDuration({data:r}){t.setAutoplayDuration(r.autoplayDuration)},toggleProgressManager({data:{pauseOnFocus:r,focused:a}}){r&&(a?t.pause():t.resume())},initDuration({data:r}){r.durationMs=r.durationMsInit},applyAutoplay({data:r,methods:{_applyAutoplayIfNeeded:a}}){r.autoplay&&a(r.autoplay)},setPagesCount({data:r}){r.pagesCount=Iy({infinite:r.infinite,particlesCountWithoutClones:r.particlesCountWithoutClones,particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow})},setParticlesToShow({data:r}){r.particlesToShow=di(1,r.particlesToShowInit,r.particlesCountWithoutClones)},setParticlesToScroll({data:r}){r.particlesToScroll=di(1,r.particlesToScrollInit,r.particlesCountWithoutClones)}},methods:{_prev({data:r}){r.currentParticleIndex=_r({infinite:r.infinite,pageIndex:r.currentPageIndex-1,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},_next({data:r}){r.currentParticleIndex=_r({infinite:r.infinite,pageIndex:r.currentPageIndex+1,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},_moveToParticle({data:r},a){r.currentParticleIndex=di(0,a,r.particlesCount-1)},toggleFocused({data:r}){r.focused=!r.focused},_applyAutoplayIfNeeded(l){return Y(this,arguments,function*({data:r,methods:a}){if(!r.infinite&&(r.autoplayDirection===mn&&r.currentParticleIndex===r.particlesCount-1||r.autoplayDirection===ci&&r.currentParticleIndex===0)){t.reset();return}if(r.autoplay){const c=()=>Qr({[mn]:()=>Y(this,null,function*(){return a.showNextPage()}),[ci]:()=>Y(this,null,function*(){return a.showPrevPage()})})(r.autoplayDirection);yield t.start(c)}})},_jumpIfNeeded(l){return Y(this,arguments,function*({data:r,methods:a}){let c=!1;return r.infinite&&(r.currentParticleIndex===0?(yield a.showParticle(r.particlesCount-r.clonesCountTotal,{animated:!1}),c=!0):r.currentParticleIndex===r.particlesCount-r.clonesCountTail&&(yield a.showParticle(r.clonesCountHead,{animated:!1}),c=!0)),c})},changePage(d,h,u){return Y(this,arguments,function*({data:r,methods:a},l,c){if(t.reset(),r.disabled)return;r.disabled=!0,l(),yield a.offsetPage({animated:Ni(c,"animated",!0)}),r.disabled=!1,!(yield a._jumpIfNeeded())&&a._applyAutoplayIfNeeded()})},showNextPage(c,d){return Y(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._next,l))})},showPrevPage(c,d){return Y(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._prev,l))})},showParticle(c,d,h){return Y(this,arguments,function*({methods:r},a,l){yield r.changePage(()=>r._moveToParticle(a),l)})},_getParticleIndexByPageIndex({data:r},a){return _r({infinite:r.infinite,pageIndex:a,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},showPage(c,d,h){return Y(this,arguments,function*({methods:r},a,l){const u=r._getParticleIndexByPageIndex(a);yield r.showParticle(u,l)})},offsetPage({data:r},a){const l=Ni(a,"animated",!0);return new Promise(c=>{r.durationMs=l?r.durationMsInit:0,r.offset=-r.currentParticleIndex*r.particleWidth,setTimeout(()=>{c()},r.durationMs)})}}},{onChange:i}),[n,s]=e;return[{data:n,progressManager:t},s,e._internal]}function Ww(i){he(i,"svelte-sme1z4",":root{--sc-color-rgb-light-50p:rgba(93, 93, 93, 0.5);--sc-color-rgb-light:#5d5d5d;--sc-color-hex-dark-50p:rgba(30, 30, 30, 0.5);--sc-color-hex-dark:#1e1e1e}.sc-carousel__carousel-container.svelte-sme1z4{display:flex;width:100%;flex-direction:column;align-items:center}.sc-carousel__content-container.svelte-sme1z4{position:relative;display:flex;width:100%}.sc-carousel__pages-window.svelte-sme1z4{flex:1;display:flex;overflow:hidden;box-sizing:border-box;position:relative}.sc-carousel__pages-container.svelte-sme1z4{width:100%;display:flex;transition-property:transform}.sc-carousel__arrow-container.svelte-sme1z4{padding:5px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.sc-carousel-progress__container.svelte-sme1z4{width:100%;height:5px;background-color:var(--sc-color-rgb-light-50p);position:absolute;bottom:0}.sc-carousel-button{all:unset;cursor:pointer}.sc-carousel-button:focus{outline:5px auto}")}const Nw=i=>({currentPageIndex:i[0]&32,pagesCount:i[0]&1024,loaded:i[0]&64}),Sh=i=>({currentPageIndex:i[5],pagesCount:i[10],showPage:i[15],loaded:i[6]}),Yw=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Dh=i=>({showNextPage:i[14].showNextPage,loaded:i[6],currentPageIndex:i[5]}),Xw=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Lh=i=>({loaded:i[6],currentPageIndex:i[5]}),Uw=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Th=i=>({showPrevPage:i[14].showPrevPage,loaded:i[6],currentPageIndex:i[5]});function zh(i){let t;const e=i[37].prev,n=Hn(e,i,i[36],Th),s=n||qw(i);return{c(){s&&s.c()},m(o,r){s&&s.m(o,r),t=!0},p(o,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&Nn(n,e,o,o[36],t?Wn(e,o[36],r,Uw):Yn(o[36]),Th):s&&s.p&&(!t||r[0]&36)&&s.p(o,t?r:[-1,-1])},i(o){t||(x(s,o),t=!0)},o(o){z(s,o),t=!1},d(o){s&&s.d(o)}}}function qw(i){let t,e,n;return e=new lh({props:{direction:"prev",disabled:!i[2]&&i[5]===0}}),e.$on("click",i[23]),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o[0]&36&&(r.disabled=!s[2]&&s[5]===0),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function jh(i){let t,e,n;return e=new ty({props:{value:i[7]}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","sc-carousel-progress__container svelte-sme1z4")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o[0]&128&&(r.value=s[7]),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function Vh(i){let t;const e=i[37].next,n=Hn(e,i,i[36],Dh),s=n||Jw(i);return{c(){s&&s.c()},m(o,r){s&&s.m(o,r),t=!0},p(o,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&Nn(n,e,o,o[36],t?Wn(e,o[36],r,Yw):Yn(o[36]),Dh):s&&s.p&&(!t||r[0]&1060)&&s.p(o,t?r:[-1,-1])},i(o){t||(x(s,o),t=!0)},o(o){z(s,o),t=!1},d(o){s&&s.d(o)}}}function Jw(i){let t,e,n;return e=new lh({props:{direction:"next",disabled:!i[2]&&i[5]===i[10]-1}}),e.$on("click",i[14].showNextPage),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o[0]&1060&&(r.disabled=!s[2]&&s[5]===s[10]-1),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function Oh(i){let t;const e=i[37].dots,n=Hn(e,i,i[36],Sh),s=n||Zw(i);return{c(){s&&s.c()},m(o,r){s&&s.m(o,r),t=!0},p(o,r){n?n.p&&(!t||r[0]&1120|r[1]&32)&&Nn(n,e,o,o[36],t?Wn(e,o[36],r,Nw):Yn(o[36]),Sh):s&&s.p&&(!t||r[0]&1056)&&s.p(o,t?r:[-1,-1])},i(o){t||(x(s,o),t=!0)},o(o){z(s,o),t=!1},d(o){s&&s.d(o)}}}function Zw(i){let t,e;return t=new U1({props:{pagesCount:i[10],currentPageIndex:i[5]}}),t.$on("pageChange",i[41]),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s[0]&1024&&(o.pagesCount=n[10]),s[0]&32&&(o.currentPageIndex=n[5]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function Kw(i){let t,e,n,s,o,r,a,l,c,d,h,u,m=i[1]&&zh(i);const g=i[37].default,v=Hn(g,i,i[36],Lh);let p=i[3]&&jh(i),b=i[1]&&Vh(i),w=i[4]&&Oh(i);return{c(){t=S("div"),e=S("div"),m&&m.c(),n=ee(),s=S("div"),o=S("div"),v&&v.c(),a=ee(),p&&p.c(),l=ee(),b&&b.c(),c=ee(),w&&w.c(),y(o,"class","sc-carousel__pages-container svelte-sme1z4"),j(o,"transform","translateX("+i[8]+"px)"),j(o,"transition-duration",i[9]+"ms"),j(o,"transition-timing-function",i[0]),y(s,"class","sc-carousel__pages-window svelte-sme1z4"),y(e,"class","sc-carousel__content-container svelte-sme1z4"),y(t,"class","sc-carousel__carousel-container svelte-sme1z4")},m(P,k){O(P,t,k),D(t,e),m&&m.m(e,null),D(e,n),D(e,s),D(s,o),v&&v.m(o,null),i[39](o),D(s,a),p&&p.m(s,null),i[40](s),D(e,l),b&&b.m(e,null),D(t,c),w&&w.m(t,null),d=!0,h||(u=[Nt(r=dy.call(null,o,{thresholdProvider:i[38]})),ye(o,"swipeStart",i[16]),ye(o,"swipeMove",i[18]),ye(o,"swipeEnd",i[19]),ye(o,"swipeFailed",i[20]),ye(o,"swipeThresholdReached",i[17]),Nt(my.call(null,s)),ye(s,"hovered",i[21]),Nt(by.call(null,s)),ye(s,"tapped",i[22])],h=!0)},p(P,k){P[1]?m?(m.p(P,k),k[0]&2&&x(m,1)):(m=zh(P),m.c(),x(m,1),m.m(e,n)):m&&(ue(),z(m,1,1,()=>{m=null}),fe()),v&&v.p&&(!d||k[0]&96|k[1]&32)&&Nn(v,g,P,P[36],d?Wn(g,P[36],k,Xw):Yn(P[36]),Lh),(!d||k[0]&256)&&j(o,"transform","translateX("+P[8]+"px)"),(!d||k[0]&512)&&j(o,"transition-duration",P[9]+"ms"),(!d||k[0]&1)&&j(o,"transition-timing-function",P[0]),r&&rn(r.update)&&k[0]&2048&&r.update.call(null,{thresholdProvider:P[38]}),P[3]?p?(p.p(P,k),k[0]&8&&x(p,1)):(p=jh(P),p.c(),x(p,1),p.m(s,null)):p&&(ue(),z(p,1,1,()=>{p=null}),fe()),P[1]?b?(b.p(P,k),k[0]&2&&x(b,1)):(b=Vh(P),b.c(),x(b,1),b.m(e,null)):b&&(ue(),z(b,1,1,()=>{b=null}),fe()),P[4]?w?(w.p(P,k),k[0]&16&&x(w,1)):(w=Oh(P),w.c(),x(w,1),w.m(t,null)):w&&(ue(),z(w,1,1,()=>{w=null}),fe())},i(P){d||(x(m),x(v,P),x(p),x(b),x(w),d=!0)},o(P){z(m),z(v,P),z(p),z(b),z(w),d=!1},d(P){P&&V(t),m&&m.d(),v&&v.d(P),i[39](null),p&&p.d(),i[40](null),b&&b.d(),w&&w.d(),h=!1,Ze(u)}}}function $w(i,t,e){let{$$slots:n={},$$scope:s}=t,o=[],r,a,l=0,c=0,d=1;const[{data:h,progressManager:u},m,g]=Hw((re,xe)=>{Qr({currentPageIndex:()=>e(5,r=xe),progressValue:()=>e(7,a=xe),offset:()=>e(8,l=xe),durationMs:()=>e(9,c=xe),pagesCount:()=>e(10,d=xe),loaded:()=>e(6,o=xe)})(re)}),v=Ds();let{timingFunction:p="ease-in-out"}=t,{arrows:b=!0}=t,{infinite:w=!0}=t,{initialPageIndex:P=0}=t,{duration:k=500}=t,{autoplay:T=!1}=t,{autoplayDuration:I=3e3}=t,{autoplayDirection:B=mn}=t,{pauseOnFocus:L=!1}=t,{autoplayProgressVisible:X=!1}=t,{dots:Z=!0}=t,{swiping:G=!0}=t,{particlesToShow:R=1}=t,{particlesToScroll:H=1}=t;function Q(re,xe){return Y(this,null,function*(){const He=Ni(xe,"animated",!0);if(typeof re!="number")throw new Error("pageIndex should be a number");yield m.showPage(re,{animated:He})})}function W(re){return Y(this,null,function*(){const xe=Ni(re,"animated",!0);yield m.showPrevPage({animated:xe})})}function q(re){return Y(this,null,function*(){const xe=Ni(re,"animated",!0);yield m.showNextPage({animated:xe})})}let U=0,K,de;const oe=My(({width:re})=>{e(11,U=re),h.particleWidth=U/h.particlesToShow,xy({particlesContainerChildren:de.children,particleWidth:h.particleWidth}),m.offsetPage({animated:!1})});function Pe(){const{clonesToAppend:re,clonesToPrepend:xe}=Sy({clonesCountHead:h.clonesCountHead,clonesCountTail:h.clonesCountTail,particlesContainerChildren:de.children});Dy({particlesContainer:de,clonesToAppend:re,clonesToPrepend:xe})}At(()=>{Y(this,null,function*(){yield El(),de&&K&&(h.particlesCountWithoutClones=de.children.length,yield El(),h.infinite&&Pe(),h.particlesCount=de.children.length,m.showPage(P,{animated:!1}),oe.observe(K))})}),Vt(()=>{oe.disconnect(),u.reset()});function Ie(re){return Y(this,null,function*(){yield m.showPage(re,{animated:!0})})}function Ae(){G&&(h.durationMs=0)}function Be(re){return Y(this,null,function*(){G&&(yield Qr({[mn]:m.showNextPage,[ci]:m.showPrevPage})(re.detail.direction))})}function be(re){G&&(h.offset+=re.detail.dx)}function Ne(){G&&m.showParticle(h.currentParticleIndex)}function me(){return Y(this,null,function*(){G&&(yield m.offsetPage({animated:!0}))})}function Ce(re){h.focused=re.detail.value}function ze(){m.toggleFocused()}function pe(){m.showPrevPage()}const Ke=()=>U/3;function ht(re){Re[re?"unshift":"push"](()=>{de=re,e(13,de)})}function Me(re){Re[re?"unshift":"push"](()=>{K=re,e(12,K)})}const ot=re=>Ie(re.detail);return i.$$set=re=>{"timingFunction"in re&&e(0,p=re.timingFunction),"arrows"in re&&e(1,b=re.arrows),"infinite"in re&&e(2,w=re.infinite),"initialPageIndex"in re&&e(24,P=re.initialPageIndex),"duration"in re&&e(25,k=re.duration),"autoplay"in re&&e(26,T=re.autoplay),"autoplayDuration"in re&&e(27,I=re.autoplayDuration),"autoplayDirection"in re&&e(28,B=re.autoplayDirection),"pauseOnFocus"in re&&e(29,L=re.pauseOnFocus),"autoplayProgressVisible"in re&&e(3,X=re.autoplayProgressVisible),"dots"in re&&e(4,Z=re.dots),"swiping"in re&&e(30,G=re.swiping),"particlesToShow"in re&&e(31,R=re.particlesToShow),"particlesToScroll"in re&&e(32,H=re.particlesToScroll),"$$scope"in re&&e(36,s=re.$$scope)},i.$$.update=()=>{i.$$.dirty[0]&32&&v("pageChange",r),i.$$.dirty[0]&4&&(h.infinite=w),i.$$.dirty[0]&33554432&&(h.durationMsInit=k),i.$$.dirty[0]&67108864&&(h.autoplay=T),i.$$.dirty[0]&134217728&&(h.autoplayDuration=I),i.$$.dirty[0]&268435456&&(h.autoplayDirection=B),i.$$.dirty[0]&536870912&&(h.pauseOnFocus=L),i.$$.dirty[1]&1&&(h.particlesToShowInit=R),i.$$.dirty[1]&2&&(h.particlesToScrollInit=H)},[p,b,w,X,Z,r,o,a,l,c,d,U,K,de,m,Ie,Ae,Be,be,Ne,me,Ce,ze,pe,P,k,T,I,B,L,G,R,H,Q,W,q,s,n,Ke,ht,Me,ot]}class eC extends ce{constructor(t){super(),le(this,t,$w,Kw,ae,{timingFunction:0,arrows:1,infinite:2,initialPageIndex:24,duration:25,autoplay:26,autoplayDuration:27,autoplayDirection:28,pauseOnFocus:29,autoplayProgressVisible:3,dots:4,swiping:30,particlesToShow:31,particlesToScroll:32,goTo:33,goToPrev:34,goToNext:35},Ww,[-1,-1])}get goTo(){return this.$$.ctx[33]}get goToPrev(){return this.$$.ctx[34]}get goToNext(){return this.$$.ctx[35]}}function tC(i){he(i,"svelte-159ski6",".media-item.svelte-159ski6.svelte-159ski6{position:relative;height:100%}.media-content.svelte-159ski6.svelte-159ski6{position:relative;pointer-events:auto;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;-o-object-fit:inherit;object-fit:inherit}.media-content.showPlayButton.svelte-159ski6.svelte-159ski6{pointer-events:none}.video-icon.svelte-159ski6.svelte-159ski6{width:12.5rem;height:6.25rem;max-width:60%;max-height:60%;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.video-play-button-container.svelte-159ski6.svelte-159ski6{display:none;position:absolute;width:100%;height:100%;top:0;left:0;transform:translate3d(0, 0, 0)}.video-play-button-container.showPlayButton.svelte-159ski6.svelte-159ski6{pointer-events:none;display:block}.video-icon.svelte-159ski6.svelte-159ski6{pointer-events:auto}.video-icon.large.svelte-159ski6.svelte-159ski6{width:12.5rem;height:6.25rem}.video-icon.small.svelte-159ski6.svelte-159ski6{width:1.75rem;height:1.75rem}.video-icon.svelte-159ski6 .video-icon-img.svelte-159ski6{width:100%;height:100%;background-position:center center;background-size:contain;background-repeat:no-repeat}.video-icon.svelte-159ski6 .video-icon-img.canPlay.svelte-159ski6{cursor:pointer}")}function Bh(i){let t;function e(o,r){if(o[2].type==="Image")return iC;if(o[2].type==="Video")return nC}let n=e(i),s=n&&n(i);return{c(){t=S("div"),s&&s.c(),y(t,"class","media-item svelte-159ski6"),y(t,"draggable","false")},m(o,r){O(o,t,r),s&&s.m(t,null)},p(o,r){n===(n=e(o))&&s?s.p(o,r):(s&&s.d(1),s=n&&n(o),s&&(s.c(),s.m(t,null)))},d(o){o&&V(t),s&&s.d()}}}function nC(i){let t,e,n,s,o,r;function a(d,h){return d[7]&&d[2].videoCoverUrl?oC:sC}let l=a(i),c=l(i);return{c(){c.c(),t=ee(),e=S("div"),n=S("div"),s=S("div"),y(s,"class","video-icon-img svelte-159ski6"),j(s,"background-image","url("+i[20]()+")"),$(s,"canPlay",i[5]),y(n,"class","video-icon svelte-159ski6"),$(n,"large",i[4]==="large"),$(n,"small",i[4]==="small"),y(e,"class","video-play-button-container svelte-159ski6"),$(e,"showPlayButton",i[10])},m(d,h){c.m(d,h),O(d,t,h),O(d,e,h),D(e,n),D(n,s),o||(r=ye(s,"click",i[21]),o=!0)},p(d,h){l===(l=a(d))&&c?c.p(d,h):(c.d(1),c=l(d),c&&(c.c(),c.m(t.parentNode,t))),h&8&&j(s,"background-image","url("+d[20]()+")"),h&32&&$(s,"canPlay",d[5]),h&16&&$(n,"large",d[4]==="large"),h&16&&$(n,"small",d[4]==="small"),h&1024&&$(e,"showPlayButton",d[10])},d(d){c.d(d),d&&V(t),d&&V(e),o=!1,r()}}}function iC(i){let t,e,n,s;return{c(){t=S("img"),y(t,"class","media-content svelte-159ski6"),y(t,"style",e=`object-fit: ${i[6]};`),Ct(t.src,n=i[2].url)||y(t,"src",n),y(t,"alt",s=i[2].name),y(t,"draggable",!1)},m(o,r){O(o,t,r)},p(o,r){r&64&&e!==(e=`object-fit: ${o[6]};`)&&y(t,"style",e),r&4&&!Ct(t.src,n=o[2].url)&&y(t,"src",n),r&4&&s!==(s=o[2].name)&&y(t,"alt",s)},d(o){o&&V(t)}}}function sC(i){let t,e,n,s,o,r,a;return{c(){t=S("video"),y(t,"class","media-content svelte-159ski6"),y(t,"style",e=`object-fit: ${i[6]};`),Ct(t.src,n=i[2].videoCoverUrl?i[2].url:i[2].url+"#t=0.1")||y(t,"src",n),y(t,"poster",s=i[2].videoCoverUrl),y(t,"preload",o=i[2].videoCoverUrl?"none":"auto"),y(t,"disablepictureinpicture",""),t.playsInline=!0,y(t,"paused",""),t.muted=!0,y(t,"draggable",!1),t.loop=!1,y(t,"crossorigin",""),t.controls=!1,$(t,"showPlayButton",i[10])},m(l,c){O(l,t,c),i[19](t),r||(a=[ye(t,"play",i[14]),ye(t,"pause",i[15]),ye(t,"error",i[16]),ye(t,"ended",i[17]),ye(t,"click",i[18])],r=!0)},p(l,c){c&64&&e!==(e=`object-fit: ${l[6]};`)&&y(t,"style",e),c&4&&!Ct(t.src,n=l[2].videoCoverUrl?l[2].url:l[2].url+"#t=0.1")&&y(t,"src",n),c&4&&s!==(s=l[2].videoCoverUrl)&&y(t,"poster",s),c&4&&o!==(o=l[2].videoCoverUrl?"none":"auto")&&y(t,"preload",o),c&1024&&$(t,"showPlayButton",l[10])},d(l){l&&V(t),i[19](null),r=!1,Ze(a)}}}function oC(i){let t,e,n,s;return{c(){t=S("img"),y(t,"class","media-content svelte-159ski6"),y(t,"style",e=`object-fit: ${i[6]};`),Ct(t.src,n=i[2].videoCoverUrl)||y(t,"src",n),y(t,"alt",s=i[2].name),y(t,"draggable",!1)},m(o,r){O(o,t,r)},p(o,r){r&64&&e!==(e=`object-fit: ${o[6]};`)&&y(t,"style",e),r&4&&!Ct(t.src,n=o[2].videoCoverUrl)&&y(t,"src",n),r&4&&s!==(s=o[2].name)&&y(t,"alt",s)},d(o){o&&V(t)}}}function rC(i){let t,e=i[2]&&Bh(i);return{c(){e&&e.c(),t=ke()},m(n,s){e&&e.m(n,s),O(n,t,s)},p(n,[s]){n[2]?e?e.p(n,s):(e=Bh(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:J,o:J,d(n){e&&e.d(n),n&&V(t)}}}function aC(i,t,e){let n,s,{mediaInstance:o={videoInstance:void 0,paused:!0}}=t,{tag:r}=t,{media:a}=t,{playButtonIfNeed:l="withoutText"}=t,{playButtonSizeIfNeed:c="small"}=t,{canPlay:d=!0}=t,{objectFit:h="fill"}=t,{disableVideoIfHavePoster:u=!1}=t,m=!0,g=!1;function v(){e(8,g=(a==null?void 0:a.type)==="Video"&&!!a.videoCoverUrl)}const p=ln("mediaStore"),b=ln("hooks"),w=()=>{g||n&&(e(9,n.muted=!0,n),n.play(),n.pause(),e(9,n.muted=!1,n),e(8,g=!0))};b.on("loadVideoFirstFrame",w),At(()=>{p.subscribe(({currentMediaElement:G})=>{G!==n&&(n==null||n.pause())})});const P=G=>{e(10,m=!1),e(0,o.paused=!1,o),e(8,g=!0),n&&p.set({currentMediaElement:n}),b.emit("playStateChange",{event:G,state:"playing",tag:r,mediaInstance:n})},k=G=>{e(10,m=!0),e(0,o.paused=!0,o),b.emit("playStateChange",{event:G,state:"paused",tag:r,mediaInstance:n})},T=G=>{e(10,m=!0),e(0,o.paused=!0,o),b.emit("playStateChange",{event:G,state:"paused",tag:r,mediaInstance:n})},I=G=>{e(10,m=!0),e(0,o.paused=!0,o),b.emit("playStateChange",{event:G,state:"paused",tag:r,mediaInstance:n})},B=G=>{n&&n.pause()};function L(G){Re[G?"unshift":"push"](()=>{o.videoInstance=G,e(0,o)})}const X=()=>l==="withText"?Gd:l==="withoutText"?Lr:l,Z=G=>{d&&n&&(e(9,n.muted=!1,n),n.play())};return i.$$set=G=>{"mediaInstance"in G&&e(0,o=G.mediaInstance),"tag"in G&&e(1,r=G.tag),"media"in G&&e(2,a=G.media),"playButtonIfNeed"in G&&e(3,l=G.playButtonIfNeed),"playButtonSizeIfNeed"in G&&e(4,c=G.playButtonSizeIfNeed),"canPlay"in G&&e(5,d=G.canPlay),"objectFit"in G&&e(6,h=G.objectFit),"disableVideoIfHavePoster"in G&&e(7,u=G.disableVideoIfHavePoster)},i.$$.update=()=>{if(i.$$.dirty&1&&e(9,n=o.videoInstance),i.$$.dirty&4&&e(13,s=a==null?void 0:a.url),i.$$.dirty&8192&&s&&v(),i.$$.dirty&512&&n&&e(10,m=n.paused),i.$$.dirty&772&&(a==null?void 0:a.type)==="Video"&&!g){const G=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1,H=navigator.userAgent.toLowerCase().indexOf("iphone")!==-1&&G;n&&H&&n.paused&&(document.removeEventListener("WeixinJSBridgeReady",w),document.removeEventListener("touchstart",w),document.removeEventListener("click",w),document.addEventListener("WeixinJSBridgeReady",w),document.addEventListener("touchstart",w),document.addEventListener("click",w))}},[o,r,a,l,c,d,h,u,g,n,m,p,b,s,P,k,T,I,B,L,X,Z]}class _h extends ce{constructor(t){super(),le(this,t,aC,rC,ae,{mediaInstance:0,tag:1,media:2,playButtonIfNeed:3,playButtonSizeIfNeed:4,canPlay:5,objectFit:6,disableVideoIfHavePoster:7},tC)}}function lC(i){he(i,"svelte-1mrbqlg",".media-list-wrapper.svelte-1mrbqlg.svelte-1mrbqlg{width:100%;height:100%;position:relative;overflow:hidden;border-radius:0.125rem}.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg{position:relative;pointer-events:auto;height:100%;left:50%;top:50%;transform:translate(-50%, -50%)}.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg .sc-carousel__carousel-container,.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg .sc-carousel__content-container{height:100%}")}function Qh(i,t,e){const n=i.slice();return n[28]=t[e],n[29]=t,n[30]=e,n}function Rh(i){let t,e,n,s,o,r,a;const l=[dC,cC],c=[];function d(h,u){return h[13]&&h[10].length>1?0:1}return n=d(i),s=c[n]=l[n](i),{c(){t=S("div"),e=S("div"),s.c(),y(e,"class","media-list svelte-1mrbqlg"),$(e,"carouselEnabled",i[13]),y(t,"class","media-list-wrapper svelte-1mrbqlg"),$(t,"unfolded",i[5])},m(h,u){O(h,t,u),D(t,e),c[n].m(e,null),a=!0},p(h,u){i=h;let m=n;n=d(i),n===m?c[n].p(i,u):(ue(),z(c[m],1,1,()=>{c[m]=null}),fe(),s=c[n],s?s.p(i,u):(s=c[n]=l[n](i),s.c()),x(s,1),s.m(e,null)),(!a||u[0]&8192)&&$(e,"carouselEnabled",i[13]),(!a||u[0]&32)&&$(t,"unfolded",i[5])},i(h){a||(x(s),h&&nt(()=>{a&&(r&&r.end(1),o=yn(t,Ql,i[6]?{y:4,duration:i[4],delay:i[2],easing:on}:void 0),o.start())}),a=!0)},o(h){z(s),o&&o.invalidate(),h&&(r=Kn(t,Ql,i[6]?{y:4,duration:i[4],delay:i[3],easing:on}:void 0)),a=!1},d(h){h&&V(t),c[n].d(),h&&r&&r.end()}}}function cC(i){let t,e,n;const s=[{media:i[1][0]},i[7],{tag:i[0]}];function o(a){i[20](a)}let r={};for(let a=0;a<s.length;a+=1)r=Je(r,s[a]);return i[8][0]!==void 0&&(r.mediaInstance=i[8][0]),t=new _h({props:r}),Re.push(()=>nr(t,"mediaInstance",o)),{c(){se(t.$$.fragment)},m(a,l){ne(t,a,l),n=!0},p(a,l){const c=l[0]&131?it(s,[l[0]&2&&{media:a[1][0]},l[0]&128&&Sl(a[7]),l[0]&1&&{tag:a[0]}]):{};!e&&l[0]&256&&(e=!0,c.mediaInstance=a[8][0],Ko(()=>e=!1)),t.$set(c)},i(a){n||(x(t.$$.fragment,a),n=!0)},o(a){z(t.$$.fragment,a),n=!1},d(a){ie(t,a)}}}function dC(i){let t,e,n={dots:!1,arrows:!1,$$slots:{default:[hC]},$$scope:{ctx:i}};return t=new eC({props:n}),i[18](t),t.$on("pageChange",i[19]),{c(){se(t.$$.fragment)},m(s,o){ne(t,s,o),e=!0},p(s,o){const r={};o[0]&1409|o[1]&1&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){e||(x(t.$$.fragment,s),e=!0)},o(s){z(t.$$.fragment,s),e=!1},d(s){i[18](null),ie(t,s)}}}function Gh(i){let t,e,n;const s=[i[7],{media:i[28]},{tag:i[0]}];function o(a){i[17](a,i[30])}let r={};for(let a=0;a<s.length;a+=1)r=Je(r,s[a]);return i[8][i[30]]!==void 0&&(r.mediaInstance=i[8][i[30]]),t=new _h({props:r}),Re.push(()=>nr(t,"mediaInstance",o)),{c(){se(t.$$.fragment)},m(a,l){ne(t,a,l),n=!0},p(a,l){i=a;const c=l[0]&1153?it(s,[l[0]&128&&Sl(i[7]),l[0]&1024&&{media:i[28]},l[0]&1&&{tag:i[0]}]):{};!e&&l[0]&256&&(e=!0,c.mediaInstance=i[8][i[30]],Ko(()=>e=!1)),t.$set(c)},i(a){n||(x(t.$$.fragment,a),n=!0)},o(a){z(t.$$.fragment,a),n=!1},d(a){ie(t,a)}}}function hC(i){let t,e,n=i[10],s=[];for(let r=0;r<n.length;r+=1)s[r]=Gh(Qh(i,n,r));const o=r=>z(s[r],1,1,()=>{s[r]=null});return{c(){for(let r=0;r<s.length;r+=1)s[r].c();t=ke()},m(r,a){for(let l=0;l<s.length;l+=1)s[l]&&s[l].m(r,a);O(r,t,a),e=!0},p(r,a){if(a[0]&1409){n=r[10];let l;for(l=0;l<n.length;l+=1){const c=Qh(r,n,l);s[l]?(s[l].p(c,a),x(s[l],1)):(s[l]=Gh(c),s[l].c(),x(s[l],1),s[l].m(t.parentNode,t))}for(ue(),l=n.length;l<s.length;l+=1)o(l);fe()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)x(s[a]);e=!0}},o(r){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)z(s[a]);e=!1},d(r){Mt(s,r),r&&V(t)}}}function uC(i){let t,e,n=i[5]&&Rh(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,o){s[5]?n?(n.p(s,o),o[0]&32&&x(n,1)):(n=Rh(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function fC(i,t,e){let n,s,o,r,{tag:a}=t,{mediaData:l}=t,{inDelay:c=0}=t,{outDelay:d=0}=t,{duration:h=0}=t,{unfolded:u=!0}=t,{animation:m=!0}=t,{mediaItemConfig:g}=t,{enableCarousel:v=!0}=t,{autoplayConfig:p={}}=t;const{autoplayVideo:b=!1,autoplayCarousel:w=!0,autoplayVideoInCarousel:P=!1}=p;let k=[],T=0,I,B=null;const L=ln("hooks"),X=ln("mediaStore");function Z(){const W=k[T],q=W==null?void 0:W.videoInstance;q&&(q.paused?(q.muted=!1,q.play()):q.pause())}At(()=>{L.on("click",W=>{var q,U,K;(K=(U=(q=a.tag3DContentSvelte)==null?void 0:q.css3DInstance)==null?void 0:U.css3DObject)!=null&&K.opacityMesh&&W.tag.id===a.id&&Z()}),B=setInterval(()=>{r&&(I==null||I.goToNext())},3e3)}),Vt(()=>{clearInterval(B),L.off("click",Z)});function G(W,q){i.$$.not_equal(k[q],W)&&(k[q]=W,e(8,k))}function R(W){Re[W?"unshift":"push"](()=>{I=W,e(12,I)})}const H=W=>{n||X.set({currentMediaElement:null}),e(11,T=W.detail)};function Q(W){i.$$.not_equal(k[0],W)&&(k[0]=W,e(8,k))}return i.$$set=W=>{"tag"in W&&e(0,a=W.tag),"mediaData"in W&&e(1,l=W.mediaData),"inDelay"in W&&e(2,c=W.inDelay),"outDelay"in W&&e(3,d=W.outDelay),"duration"in W&&e(4,h=W.duration),"unfolded"in W&&e(5,u=W.unfolded),"animation"in W&&e(6,m=W.animation),"mediaItemConfig"in W&&e(7,g=W.mediaItemConfig),"enableCarousel"in W&&e(15,v=W.enableCarousel),"autoplayConfig"in W&&e(16,p=W.autoplayConfig)},i.$$.update=()=>{i.$$.dirty[0]&256&&e(9,n=k.every(W=>W.paused)),i.$$.dirty[0]&32770&&e(13,s=v&&(l==null?void 0:l.length)>1),i.$$.dirty[0]&2&&e(10,o=l),i.$$.dirty[0]&1536&&(r=o.length>1&&w&&n)},[a,l,c,d,h,u,m,g,k,n,o,T,I,s,X,v,p,G,R,H,Q]}class Fh extends ce{constructor(t){super(),le(this,t,fC,uC,ae,{tag:0,mediaData:1,inDelay:2,outDelay:3,duration:4,unfolded:5,animation:6,mediaItemConfig:7,enableCarousel:15,autoplayConfig:16},lC,[-1,-1])}}function mC(i){he(i,"svelte-1f7m1lj",".line.svelte-1f7m1lj{position:absolute;width:6.5625rem;height:1.3125rem;transform:translateY(-100%)}.text.svelte-1f7m1lj{position:absolute;width:6.25rem;left:1rem;bottom:0.0625rem;font-weight:600}.media-wrapper.svelte-1f7m1lj{position:absolute;left:0.875rem;top:-5.3125rem;width:5.625rem;height:3.75rem;font-weight:600}")}function Hh(i){let t,e,n,s,o,r,a,l;t=new _t({props:{visible:i[3],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),s=new R1({props:{unfolded:i[3],outDelay:400}});let c=i[2]&&Wh(i),d=i[1]&&Nh(i);return{c(){se(t.$$.fragment),e=ee(),n=S("div"),se(s.$$.fragment),o=ee(),c&&c.c(),r=ee(),d&&d.c(),a=ke(),y(n,"class","line svelte-1f7m1lj")},m(h,u){ne(t,h,u),O(h,e,u),O(h,n,u),ne(s,n,null),O(h,o,u),c&&c.m(h,u),O(h,r,u),d&&d.m(h,u),O(h,a,u),l=!0},p(h,u){const m={};u&8&&(m.visible=h[3]),t.$set(m);const g={};u&8&&(g.unfolded=h[3]),s.$set(g),h[2]?c?(c.p(h,u),u&4&&x(c,1)):(c=Wh(h),c.c(),x(c,1),c.m(r.parentNode,r)):c&&(ue(),z(c,1,1,()=>{c=null}),fe()),h[1]?d?(d.p(h,u),u&2&&x(d,1)):(d=Nh(h),d.c(),x(d,1),d.m(a.parentNode,a)):d&&(ue(),z(d,1,1,()=>{d=null}),fe())},i(h){l||(x(t.$$.fragment,h),x(s.$$.fragment,h),x(c),x(d),l=!0)},o(h){z(t.$$.fragment,h),z(s.$$.fragment,h),z(c),z(d),l=!1},d(h){ie(t,h),h&&V(e),h&&V(n),ie(s),h&&V(o),c&&c.d(h),h&&V(r),d&&d.d(h),h&&V(a)}}}function Wh(i){let t,e,n;return e=new qd({props:{unfolded:i[3],content:i[2],inDelay:500}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","text svelte-1f7m1lj")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o&8&&(r.unfolded=s[3]),o&4&&(r.content=s[2]),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function Nh(i){let t,e,n;return e=new Fh({props:{autoplayConfig:{autoplayCarousel:!1},unfolded:i[3],mediaData:i[1],tag:i[0],enableCarousel:!1,mediaItemConfig:{canPlay:!1,playButtonSizeIfNeed:"small",disableVideoIfHavePoster:!0},inDelay:500,duration:500}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","media-wrapper svelte-1f7m1lj")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o&8&&(r.unfolded=s[3]),o&2&&(r.mediaData=s[1]),o&1&&(r.tag=s[0]),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function pC(i){let t,e,n=i[0].state&&Hh(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[0].state?n?(n.p(s,o),o&1&&x(n,1)):(n=Hh(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function gC(i,t,e){let n,s,o,r,{tag:a}=t;return i.$$set=l=>{"tag"in l&&e(0,a=l.tag)},i.$$.update=()=>{var l,c,d;i.$$.dirty&1&&e(3,n=a.state?a.state.unfolded:!1),i.$$.dirty&1&&e(4,s=(c=(l=a.data.title)!=null?l:a.data.text)!=null?c:""),i.$$.dirty&16&&e(2,o=((d=s.length)!=null?d:0)>7?s.substring(0,6)+"...":s),i.$$.dirty&1&&e(1,r=a.data.mediaData)},[a,r,o,n,s]}class vC extends ce{constructor(t){super(),le(this,t,gC,pC,ae,{tag:0},mC)}}function AC(i){he(i,"svelte-sezqcq",'@charset "UTF-8";.svelte-sezqcq.svelte-sezqcq{box-sizing:border-box}.marketing.svelte-sezqcq.svelte-sezqcq{transform:translateY(-100%)}.marketing.svelte-sezqcq .line.svelte-sezqcq{position:absolute;height:1.875rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.marketing.svelte-sezqcq .content.svelte-sezqcq{position:relative;min-width:7.5rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition-property:opacity, transform;transition-duration:500ms}.marketing.svelte-sezqcq .content .headerImage.svelte-sezqcq{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.title-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;width:100%;height:1.125rem}.title-wrapper.svelte-sezqcq .title.svelte-sezqcq{border-radius:0.25rem;width:100%;padding-left:0.625rem;padding-right:0.625rem}.title-wrapper.svelte-sezqcq .title .text.svelte-sezqcq{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem}.footer.svelte-sezqcq.svelte-sezqcq{position:relative;padding:0.5rem 0.625rem 0 0;width:100%;display:flex;align-items:center}.footer.svelte-sezqcq .goto-button.svelte-sezqcq{display:flex;align-self:flex-end;flex-wrap:wrap;align-items:center;overflow:hidden;height:0.875rem}.footer.svelte-sezqcq .goto-button .gap.svelte-sezqcq{height:100%;width:0.625rem}.footer.svelte-sezqcq .goto-button .text.svelte-sezqcq{display:block;height:100%;font-size:0.625rem}.footer.svelte-sezqcq .arrow-wrapper.svelte-sezqcq{height:0.875rem;display:flex;align-self:flex-end;flex-grow:0;flex-shrink:0;align-items:center;margin-left:0.25rem}.footer.svelte-sezqcq .arrow-wrapper svg.arrow.svelte-sezqcq{width:0.375rem;height:0.625rem}.footer.svelte-sezqcq .price.svelte-sezqcq{flex-shrink:0;margin-right:auto;white-space:nowrap;display:flex;align-items:baseline;margin-left:0.625rem}.footer.svelte-sezqcq .price .value.svelte-sezqcq{position:relative;font-size:0.875rem;line-height:1rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.footer.svelte-sezqcq .price .unit.svelte-sezqcq{padding-left:0.125rem;font-size:0.625rem}.tags-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;overflow:hidden;height:1rem;margin-top:0.25rem}.tags-wrapper.svelte-sezqcq .tags.svelte-sezqcq{position:relative;display:inline-flex;max-width:100%;flex-wrap:wrap;padding-left:0.625rem;padding-right:0.375rem}.tags-wrapper.svelte-sezqcq .tags .tag.svelte-sezqcq{display:flex;align-items:center;justify-content:center;flex-shrink:0;flex-grow:0;font-size:0.625rem;height:1rem;margin-right:0.25rem;margin-bottom:0.625rem;padding:0 0.25rem;border-radius:0.125rem;max-width:100%;text-overflow:ellipsis;overflow:hidden}.marketing.light.svelte-sezqcq .content.svelte-sezqcq{background-color:white}.marketing.light.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:rgba(0, 0, 0, 0.8)}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:#946700}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.5)}.marketing.light.svelte-sezqcq .content .footer.svelte-sezqcq{color:#946700;fill:#946700}.marketing.dark.svelte-sezqcq .content.svelte-sezqcq{background-color:rgba(0, 0, 0, 0.5)}.marketing.dark.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(255, 255, 255, 0.15);color:rgba(255, 255, 255, 0.85)}.marketing.dark.svelte-sezqcq .content .footer.svelte-sezqcq{color:#ead09a;fill:#ead09a}.marketing.unfolded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 1)}.marketing.folded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.marketing.unfolded.svelte-sezqcq .content.svelte-sezqcq{opacity:1}.marketing.folded.svelte-sezqcq .content.svelte-sezqcq{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}')}function Yh(i,t,e){const n=i.slice();return n[0]=t[e],n}function Xh(i,t,e){const n=i.slice();return n[0]=t[e],n}function Uh(i){let t,e;return{c(){t=S("img"),y(t,"class","headerImage svelte-sezqcq"),Ct(t.src,e=i[3].headerPictureUrl)||y(t,"src",e),y(t,"alt","")},m(n,s){O(n,t,s)},p(n,s){s&8&&!Ct(t.src,e=n[3].headerPictureUrl)&&y(t,"src",e)},d(n){n&&V(t)}}}function qh(i){let t,e,n,s,o=i[2]||[],r=[];for(let c=0;c<o.length;c+=1)r[c]=Jh(Xh(i,o,c));let a=i[5]||[],l=[];for(let c=0;c<a.length;c+=1)l[c]=Zh(Yh(i,a,c));return{c(){t=S("div"),e=S("div");for(let c=0;c<r.length;c+=1)r[c].c();n=ee();for(let c=0;c<l.length;c+=1)l[c].c();y(e,"class","tags svelte-sezqcq"),nt(()=>i[11].call(e)),y(t,"class","tags-wrapper svelte-sezqcq")},m(c,d){O(c,t,d),D(t,e);for(let h=0;h<r.length;h+=1)r[h]&&r[h].m(e,null);D(e,n);for(let h=0;h<l.length;h+=1)l[h]&&l[h].m(e,null);s=ks(e,i[11].bind(e))},p(c,d){if(d&4){o=c[2]||[];let h;for(h=0;h<o.length;h+=1){const u=Xh(c,o,h);r[h]?r[h].p(u,d):(r[h]=Jh(u),r[h].c(),r[h].m(e,n))}for(;h<r.length;h+=1)r[h].d(1);r.length=o.length}if(d&32){a=c[5]||[];let h;for(h=0;h<a.length;h+=1){const u=Yh(c,a,h);l[h]?l[h].p(u,d):(l[h]=Zh(u),l[h].c(),l[h].m(e,null))}for(;h<l.length;h+=1)l[h].d(1);l.length=a.length}},d(c){c&&V(t),Mt(r,c),Mt(l,c),s()}}}function Jh(i){let t,e=i[0]+"",n;return{c(){t=S("div"),n=Te(e),y(t,"class","tag primary-tag svelte-sezqcq"),j(t,"min-width",Nr)},m(s,o){O(s,t,o),D(t,n)},p(s,o){o&4&&e!==(e=s[0]+"")&&Oe(n,e)},d(s){s&&V(t)}}}function Zh(i){let t,e=i[0]+"",n;return{c(){t=S("div"),n=Te(e),y(t,"class","tag secondary-tag svelte-sezqcq"),j(t,"min-width",Nr)},m(s,o){O(s,t,o),D(t,n)},p(s,o){o&32&&e!==(e=s[0]+"")&&Oe(n,e)},d(s){s&&V(t)}}}function Kh(i){let t,e,n=i[7]&&$h(i),s=i[3].highlightText&&tu(i);return{c(){t=S("div"),n&&n.c(),e=ee(),s&&s.c(),y(t,"class","footer svelte-sezqcq")},m(o,r){O(o,t,r),n&&n.m(t,null),D(t,e),s&&s.m(t,null)},p(o,r){o[7]?n?n.p(o,r):(n=$h(o),n.c(),n.m(t,e)):n&&(n.d(1),n=null),o[3].highlightText?s?s.p(o,r):(s=tu(o),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},d(o){o&&V(t),n&&n.d(),s&&s.d()}}}function $h(i){let t,e,n=i[3].price.value+"",s,o,r=i[3].price.unit&&eu(i);return{c(){t=S("div"),e=S("span"),s=Te(n),o=ee(),r&&r.c(),y(e,"class","value svelte-sezqcq"),y(t,"class","price svelte-sezqcq")},m(a,l){O(a,t,l),D(t,e),D(e,s),D(t,o),r&&r.m(t,null)},p(a,l){l&8&&n!==(n=a[3].price.value+"")&&Oe(s,n),a[3].price.unit?r?r.p(a,l):(r=eu(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&V(t),r&&r.d()}}}function eu(i){let t,e=i[3].price.unit+"",n;return{c(){t=S("span"),n=Te(e),y(t,"class","unit svelte-sezqcq")},m(s,o){O(s,t,o),D(t,n)},p(s,o){o&8&&e!==(e=s[3].price.unit+"")&&Oe(n,e)},d(s){s&&V(t)}}}function tu(i){let t,e,n,s,o=i[3].highlightText+"",r,a,l;return{c(){t=S("div"),e=S("div"),n=ee(),s=S("span"),r=Te(o),a=ee(),l=S("div"),l.innerHTML='<svg class="arrow svelte-sezqcq" viewBox="0 0 6 9"><g transform="translate(-3, -2)" fill-rule="nonzero" class="svelte-sezqcq"><path d="M4.43868724,2.12056563 C4.28121824,1.95989074 4.02582143,1.95979988 3.86824251,2.1203627 C3.72498894,2.26632889 3.71189225,2.49481723 3.82900374,2.65587166 L6.57092402,5.92894326 C6.72651763,6.11470411 6.72651763,6.38529589 6.57092402,6.57105674 L3.86804348,9.79798499 C3.72488984,9.94405307 3.71194952,10.1725507 3.8291712,10.3335217 L3.86824251,10.3796373 C4.01149607,10.5256035 4.23559087,10.5387981 4.39346025,10.4192733 L4.43868724,10.3794344 L8.1144599,6.5985342 C8.30312347,6.40447482 8.30312347,6.09552518 8.1144599,5.9014658 L4.43868724,2.12056563 Z" class="svelte-sezqcq"></path></g></svg>',y(e,"class","gap svelte-sezqcq"),y(s,"class","text svelte-sezqcq"),y(t,"class","goto-button goto-icon svelte-sezqcq"),y(l,"class","arrow-wrapper svelte-sezqcq")},m(c,d){O(c,t,d),D(t,e),D(t,n),D(t,s),D(s,r),O(c,a,d),O(c,l,d)},p(c,d){d&8&&o!==(o=c[3].highlightText+"")&&Oe(r,o)},d(c){c&&V(t),c&&V(a),c&&V(l)}}}function bC(i){var k,T;let t,e,n,s,o,r,a,l,c,d,h=i[3].title+"",u,m,g,v,p;e=new _t({props:{visible:i[4],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let b=i[3].headerPictureUrl&&Uh(i),w=((k=i[2].length)!=null?k:0)+((T=i[5].length)!=null?T:0)>0&&qh(i),P=(i[7]||i[3].highlightText)&&Kh(i);return{c(){t=S("div"),se(e.$$.fragment),n=ee(),s=S("div"),o=ee(),r=S("div"),b&&b.c(),a=ee(),l=S("div"),c=S("div"),d=S("div"),u=Te(h),m=ee(),w&&w.c(),g=ee(),P&&P.c(),y(s,"class","line svelte-sezqcq"),j(s,"transition-delay",i[4]?fo+"ms":mo+iu-nu-40+"ms"),y(d,"class","text svelte-sezqcq"),y(c,"class","title svelte-sezqcq"),y(l,"class","title-wrapper svelte-sezqcq"),y(r,"class","content svelte-sezqcq"),j(r,"max-width",Qt(i[9])),j(r,"transition-delay",i[4]?fo+mo+"ms":"0ms"),y(t,"class",v=Qe(`marketing ${i[6]}`)+" svelte-sezqcq"),$(t,"unfolded",i[4]),$(t,"folded",i[8])},m(I,B){O(I,t,B),ne(e,t,null),D(t,n),D(t,s),D(t,o),D(t,r),b&&b.m(r,null),D(r,a),D(r,l),D(l,c),D(c,d),D(d,u),D(r,m),w&&w.m(r,null),D(r,g),P&&P.m(r,null),p=!0},p(I,[B]){var X,Z;const L={};B&16&&(L.visible=I[4]),e.$set(L),B&16&&j(s,"transition-delay",I[4]?fo+"ms":mo+iu-nu-40+"ms"),I[3].headerPictureUrl?b?b.p(I,B):(b=Uh(I),b.c(),b.m(r,a)):b&&(b.d(1),b=null),(!p||B&8)&&h!==(h=I[3].title+"")&&Oe(u,h),((X=I[2].length)!=null?X:0)+((Z=I[5].length)!=null?Z:0)>0?w?w.p(I,B):(w=qh(I),w.c(),w.m(r,g)):w&&(w.d(1),w=null),I[7]||I[3].highlightText?P?P.p(I,B):(P=Kh(I),P.c(),P.m(r,null)):P&&(P.d(1),P=null),B&16&&j(r,"transition-delay",I[4]?fo+mo+"ms":"0ms"),(!p||B&64&&v!==(v=Qe(`marketing ${I[6]}`)+" svelte-sezqcq"))&&y(t,"class",v),(!p||B&80)&&$(t,"unfolded",I[4]),(!p||B&320)&&$(t,"folded",I[8])},i(I){p||(x(e.$$.fragment,I),p=!0)},o(I){z(e.$$.fragment,I),p=!1},d(I){I&&V(t),ie(e),b&&b.d(),w&&w.d(),P&&P.d()}}}const Nr=40,fo=400,nu=500,mo=180,iu=500;function yC(i,t,e){let n,s,o,r,a,l,c,d,{tag:h}=t,u,m=(()=>{var p;const v=(p=h.data.limitWidth)!=null?p:!0;if(typeof v=="number")return v;if(v===!0)return 172})();function g(){u=this.offsetHeight,e(1,u)}return i.$$set=v=>{"tag"in v&&e(0,h=v.tag)},i.$$.update=()=>{var v,p,b,w,P,k;i.$$.dirty&1&&e(4,n=(p=(v=h.state)==null?void 0:v.unfolded)!=null?p:!1),i.$$.dirty&16&&e(8,s=!n),i.$$.dirty&1&&e(3,o=h.data),i.$$.dirty&8&&e(7,r=Fn((b=o.price)==null?void 0:b.value)&&((w=o.price)==null?void 0:w.value)!==""),i.$$.dirty&1&&e(6,a=h.data.theme||"light"),i.$$.dirty&1026&&u>40&&e(10,l=l-1),i.$$.dirty&1032&&e(2,c=((P=o.brandTags)==null?void 0:P.slice(0,l).filter(Boolean))||[]),i.$$.dirty&1036&&e(5,d=((k=o.tags)==null?void 0:k.slice(0,l-c.length).filter(Boolean))||[])},e(10,l=(m-20)/Nr),[h,u,c,o,n,d,a,r,s,m,l,g]}class wC extends ce{constructor(t){super(),le(this,t,yC,bC,ae,{tag:0},AC)}}class CC extends Audio{constructor(e){super();f(this,"sharedAudioSrc");f(this,"sharedAudioPaused",!0);f(this,"sharedAudioCurrentTime",0);f(this,"tryplaying",!1);f(this,"audioInstance");f(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 n,s,o;if(this.tryplaying)return;this.tryplaying=!0,(!this.audioInstance||((n=this.audioInstance)==null?void 0:n.realSrc)!==this.sharedAudioSrc)&&(this.audioInstance=Bb(this.sharedAudioSrc,{namespace:Sr.PlayAudio})),(s=this.eventListenerDisposer)==null||s.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.currentTime=(o=this.currentTime)!=null?o:0;const e=this.audioInstance.currentTime!==this.currentTime;this.audioInstance.play().then(()=>{var r;this.audioInstance.muted=!1,e&&(this.audioInstance.currentTime=(r=this.currentTime)!=null?r:0),this.sharedAudioPaused=!1}).catch(r=>{var a;r.message==="The operation is not supported."?console.error("Error: 音频文件可能损坏或修改过文件后缀",r):console.error("Error: error playing media in Safari",r),this.endedHandler(),(a=this.onerror)==null||a.call(this,r)}).finally(()=>{this.tryplaying=!1})})}pause(e){var n;if(this.audioInstance&&!this.paused){if(this.sharedAudioPaused=!0,(n=this.eventListenerDisposer)==null||n.call(this),this.audioInstance.ended){this.endedHandler();return}this.audioInstance.paused||this.audioInstance.pause(),this.onpause(e!=null?e:new Event("pause")),this.clear()}}dispose(){var e;(e=this.eventListenerDisposer)==null||e.call(this),this.clear(),this.audioInstance=void 0}clear(){var e;(e=this.audioInstance)==null||e.clear()}endedHandler(e){var n,s;(n=this.onended)==null||n.call(this,e!=null?e:new Event("ended")),(s=this.eventListenerDisposer)==null||s.call(this),this.sharedAudioPaused=!0,this.sharedAudioCurrentTime=0,this.clear()}addEventListeners(){const e=this.audioInstance;if(!e)return;const n=u=>{var m;this.sharedAudioCurrentTime=e.currentTime,(m=this.ontimeupdate)==null||m.call(this,u)},s=u=>{var m;e.isBlankAudio||(this.sharedAudioPaused=!1,(m=this.onplay)==null||m.call(this,u))},o=u=>{this.pause(u)},r=u=>{this.endedHandler(u)},a=u=>{var m;this.sharedAudioPaused=!0,(m=this.onerror)==null||m.call(this,u)},l=u=>{var m;return(m=this.oncanplay)==null?void 0:m.call(this,u)},c=u=>{var m;return(m=this.oncanplaythrough)==null?void 0:m.call(this,u)},d=u=>{var m;return(m=this.onloadeddata)==null?void 0:m.call(this,u)},h=u=>{var m;return(m=this.onloadedmetadata)==null?void 0:m.call(this,u)};return e.addEventListener("timeupdate",n),e.addEventListener("play",s),e.addEventListener("pause",o),e.addEventListener("ended",r),e.addEventListener("error",a),e.addEventListener("canplay",l),e.addEventListener("canplaythrough",c),e.addEventListener("loadeddata",d),e.addEventListener("loadedmetadata",h),()=>{e.removeEventListener("timeupdate",n),e.removeEventListener("play",s),e.removeEventListener("pause",o),e.removeEventListener("ended",r),e.removeEventListener("error",a),e.removeEventListener("canplay",l),e.removeEventListener("canplaythrough",c),e.removeEventListener("loadeddata",d),e.removeEventListener("loadedmetadata",h)}}}function PC(i){he(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function IC(i){let t,e,n,s;const o=i[8].default,r=Hn(o,i,i[7],null);return{c(){t=S("div"),r&&r.c(),y(t,"class","audio svelte-13e7hxv"),y(t,"style",i[0])},m(a,l){O(a,t,l),r&&r.m(t,null),e=!0,n||(s=ye(t,"click",Al(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&Nn(r,o,a,a[7],e?Wn(o,a[7],l,null):Yn(a[7]),null),(!e||l&1)&&y(t,"style",a[0])},i(a){e||(x(r,a),e=!0)},o(a){z(r,a),e=!1},d(a){a&&V(t),r&&r.d(a),n=!1,s()}}}function EC(i,t,e){let{$$slots:n={},$$scope:s}=t,{url:o}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=Ds(),d=ln("hooks"),h=ln("mediaStore");let u,m=!0;function g(){e(5,u.onplay=p=>{d.emit("playStateChange",F({event:p,state:"playing",mediaInstance:u},l)),c("play"),e(6,m=!1)},u),e(5,u.onpause=p=>{d.emit("playStateChange",F({event:p,state:"paused",mediaInstance:u},l)),c("pause"),e(6,m=!0)},u),e(5,u.onended=p=>{d.emit("playStateChange",F({event:p,state:"paused",mediaInstance:u},l)),c("pause"),e(6,m=!0)},u),e(5,u.onloadedmetadata=p=>{typeof u.duration=="number"&&!Number.isNaN(u.duration)&&c("duration",u.duration)},u),e(5,u.onerror=p=>{c("pause"),e(6,m=!0)},u),e(5,u.ontimeupdate=p=>{c("timeupdate",u.currentTime)},u)}h.subscribe(({currentMediaElement:p})=>{p!==u&&(m||u==null||u.pause())});function v(p){u&&(d.emit("click",F({event:p,target:"AudioTagPlayIcon",audioInstance:u},l)),h.set({currentMediaElement:u}),d.emit("playStateChange",F({event:p,state:u.paused?"playing":"paused",mediaInstance:u},l)),u.paused?u.play():u.pause())}return i.$$set=p=>{"url"in p&&e(2,o=p.url),"enable"in p&&e(3,r=p.enable),"style"in p&&e(0,a=p.style),"hooksInfo"in p&&e(4,l=p.hooksInfo),"$$scope"in p&&e(7,s=p.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(o||c("duration",0)),i.$$.dirty&36&&(u==null||u.dispose(),e(5,u=new CC(o)),c("audioRef",u),setTimeout(()=>c("audioRef",u),200),g()),i.$$.dirty&40&&(r||u==null||u.pause()),i.$$.dirty&72&&c(r&&!m?"play":"pause")},[a,v,o,r,l,u,m,s,n]}let su=class extends ce{constructor(t){super(),le(this,t,EC,IC,ae,{url:2,enable:3,style:0,hooksInfo:4},PC)}};function kC(i){he(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 ou(i){let t,e;return t=new _t({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function xC(i){let t,e,n,s,o,r=i[1]&&ou();return{c(){t=S("div"),r&&r.c(),e=ee(),n=S("div"),s=S("div"),s.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>',y(s,"class","sound-wave__container svelte-srt2pi"),y(n,"class","audio-icon svelte-srt2pi"),$(n,"playing",i[0]),y(t,"class","audio-icon__wrapper svelte-srt2pi"),y(t,"style",i[2]),j(t,"width",i[5]),j(t,"height",i[5])},m(a,l){O(a,t,l),r&&r.m(t,null),D(t,e),D(t,n),D(n,s),i[7](s),i[8](t),o=!0},p(a,[l]){a[1]?r?l&2&&x(r,1):(r=ou(),r.c(),x(r,1),r.m(t,e)):r&&(ue(),z(r,1,1,()=>{r=null}),fe()),(!o||l&1)&&$(n,"playing",a[0]),(!o||l&4)&&y(t,"style",a[2]);const c=l&4;(c||l&36)&&j(t,"width",a[5]),(c||l&36)&&j(t,"height",a[5])},i(a){o||(x(r),o=!0)},o(a){z(r),o=!1},d(a){a&&V(t),r&&r.d(),i[7](null),i[8](null)}}}function MC(i,t,e){let n,{playing:s}=t,{shadow:o=!1}=t,{style:r=null}=t,{width:a="100%"}=t,l,c;function d(u){Re[u?"unshift":"push"](()=>{c=u,e(4,c)})}function h(u){Re[u?"unshift":"push"](()=>{l=u,e(3,l)})}return i.$$set=u=>{"playing"in u&&e(0,s=u.playing),"shadow"in u&&e(1,o=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"?Qt(a):a)},[s,o,r,l,c,n,a,d,h]}class ru extends ce{constructor(t){super(),le(this,t,MC,xC,ae,{playing:0,shadow:1,style:2,width:6},kC)}}function SC(i){he(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 au(i){var p,b;let t,e,n,s,o,r,a,l,c,d,h,u,m,g;e=new _t({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let v=i[6]&&lu(i);return c=new $d({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),h=new zr({props:{unfolded:i[6],length:i[3],outDelay:i[4]+20*Math.min((b=(p=i[5])==null?void 0:p.length)!=null?b:10,15),useLinearColor:!0}}),{c(){t=S("div"),se(e.$$.fragment),n=ee(),s=S("div"),o=S("div"),r=S("div"),v&&v.c(),a=ee(),l=S("div"),se(c.$$.fragment),d=ee(),se(h.$$.fragment),y(r,"class","audio-icon svelte-1s6gk4a"),j(l,"display","inline-block"),y(o,"class","wrapper svelte-1s6gk4a"),y(s,"class","content svelte-1s6gk4a"),y(t,"class","audio-tag svelte-1s6gk4a"),$(t,"unfolded",i[6])},m(w,P){O(w,t,P),ne(e,t,null),D(t,n),D(t,s),D(s,o),D(o,r),v&&v.m(r,null),D(o,a),D(o,l),ne(c,l,null),D(t,d),ne(h,t,null),u=!0,m||(g=[ye(l,"click",i[7]),Nt(ei.call(null,l)),ye(l,"clientWidth",i[12])],m=!0)},p(w,P){var B,L;const k={};P&64&&(k.visible=w[6]),P&8&&(k.left=w[3]/2+"px"),e.$set(k),w[6]?v?(v.p(w,P),P&64&&x(v,1)):(v=lu(w),v.c(),x(v,1),v.m(r,null)):v&&(ue(),z(v,1,1,()=>{v=null}),fe());const T={};P&64&&(T.visible=w[6]),P&2&&(T.textUnfolded=w[1]),P&32&&(T.content=w[5]),c.$set(T);const I={};P&64&&(I.unfolded=w[6]),P&8&&(I.length=w[3]),P&48&&(I.outDelay=w[4]+20*Math.min((L=(B=w[5])==null?void 0:B.length)!=null?L:10,15)),h.$set(I),(!u||P&64)&&$(t,"unfolded",w[6])},i(w){u||(x(e.$$.fragment,w),x(v),x(c.$$.fragment,w),x(h.$$.fragment,w),u=!0)},o(w){z(e.$$.fragment,w),z(v),z(c.$$.fragment,w),z(h.$$.fragment,w),u=!1},d(w){w&&V(t),ie(e),v&&v.d(),ie(c),ie(h),m=!1,Ze(g)}}}function lu(i){let t,e,n,s,o,r,a;return e=new _t({props:{center:!0,blurRadius:15,spreadRadius:6}}),s=new su({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[DC]},$$scope:{ctx:i}}}),s.$on("play",i[8]),s.$on("pause",i[9]),s.$on("error",i[10]),s.$on("audioRef",i[11]),{c(){t=S("div"),se(e.$$.fragment),n=ee(),se(s.$$.fragment),y(t,"class","audio svelte-1s6gk4a")},m(l,c){O(l,t,c),ne(e,t,null),D(t,n),ne(s,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&8196&&(d.$$scope={dirty:c,ctx:i}),s.$set(d)},i(l){a||(x(e.$$.fragment,l),x(s.$$.fragment,l),l&&nt(()=>{a&&(r&&r.end(1),o=yn(t,wn,{duration:1e3,delay:0,easing:ni}),o.start())}),a=!0)},o(l){var c,d;z(e.$$.fragment,l),z(s.$$.fragment,l),o&&o.invalidate(),l&&(r=Kn(t,wn,{duration:1e3,delay:20*Math.min((d=(c=i[5])==null?void 0:c.length)!=null?d:10,15),easing:ni})),a=!1},d(l){l&&V(t),ie(e),ie(s),l&&r&&r.end()}}}function DC(i){let t,e,n;return e=new ru({props:{playing:i[2]}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o&4&&(r.playing=s[2]),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function LC(i){let t,e,n=i[0].state&&au(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[0].state?n?(n.p(s,o),o&1&&x(n,1)):(n=au(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function TC(i,t,e){let n,s,o,{tag:r}=t,a=!1,l=!1,c;function d(){e(1,a=!a)}const h=()=>{e(2,l=!0)},u=()=>{e(2,l=!1)},m=()=>{e(2,l=!1)};function g(p){Un.call(this,i,p)}const v=p=>{e(3,c=p.detail)};return i.$$set=p=>{"tag"in p&&e(0,r=p.tag)},i.$$.update=()=>{var p,b,w;i.$$.dirty&1&&e(6,n=!!((p=r.state)!=null&&p.unfolded)),i.$$.dirty&1&&e(5,s=(w=(b=r.data.title)!=null?b:r.data.text)!=null?w:""),i.$$.dirty&2&&e(4,o=a?450:0)},[r,a,l,c,o,s,n,d,h,u,m,g,v]}class zC extends ce{constructor(t){super(),le(this,t,TC,LC,ae,{tag:0},SC)}}function jC(i){he(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 cu(i){let t,e,n,s;return n=new su({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[OC]},$$scope:{ctx:i}}}),n.$on("play",i[6]),n.$on("pause",i[7]),n.$on("error",i[8]),n.$on("timeupdate",i[9]),n.$on("duration",i[10]),n.$on("audioRef",i[11]),{c(){t=S("div"),e=S("div"),se(n.$$.fragment),y(e,"class","audio-tag svelte-58hfjf"),j(e,"background-color",i[4].bgColor),j(e,"color",i[4].fontColor),y(t,"class","audio-tag__wrapper svelte-58hfjf")},m(o,r){O(o,t,r),D(t,e),ne(n,e,null),s=!0},p(o,r){const a={};r&1&&(a.enable=o[0].state.visible),r&1&&(a.url=o[0].data.audioUrl),r&1&&(a.hooksInfo={tag:o[0]}),r&8232&&(a.$$scope={dirty:r,ctx:o}),n.$set(a),r&16&&j(e,"background-color",o[4].bgColor),r&16&&j(e,"color",o[4].fontColor)},i(o){s||(x(n.$$.fragment,o),s=!0)},o(o){z(n.$$.fragment,o),s=!1},d(o){o&&V(t),ie(n)}}}function VC(i){let t;return{c(){t=Te(i[5])},m(e,n){O(e,t,n)},p(e,n){n&32&&Oe(t,e[5])},d(e){e&&V(t)}}}function OC(i){let t,e,n,s,o,r,a;return n=new ru({props:{playing:i[3]}}),r=new Vr({props:{maxWidth:72,$$slots:{default:[VC]},$$scope:{ctx:i}}}),{c(){t=S("div"),e=S("div"),se(n.$$.fragment),s=ee(),o=S("div"),se(r.$$.fragment),y(e,"class","audio-icon__wrapper svelte-58hfjf"),y(o,"class","text svelte-58hfjf"),y(t,"class","audio__inner svelte-58hfjf")},m(l,c){O(l,t,c),D(t,e),ne(n,e,null),D(t,s),D(t,o),ne(r,o,null),a=!0},p(l,c){const d={};c&8&&(d.playing=l[3]),n.$set(d);const h={};c&8224&&(h.$$scope={dirty:c,ctx:l}),r.$set(h)},i(l){a||(x(n.$$.fragment,l),x(r.$$.fragment,l),a=!0)},o(l){z(n.$$.fragment,l),z(r.$$.fragment,l),a=!1},d(l){l&&V(t),ie(n),ie(r)}}}function BC(i){let t,e,n=i[0].state&&cu(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[0].state?n?(n.p(s,o),o&1&&x(n,1)):(n=cu(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function _C(i,t,e){let n,s,{tag:o}=t;const r={light:{bgColor:"rgba(255, 255, 255, 0.3)",fontColor:"rgba(0, 0, 0, 0.6)"},dark:{bgColor:"rgba(0, 0, 0, 0.3)",fontColor:"white"}};let a=0,l=0,c=!1;const d=()=>{e(3,c=!0)},h=()=>{e(3,c=!1)},u=()=>{e(3,c=!1)},m=p=>{e(1,a=p.detail)},g=p=>{e(2,l=p.detail)};function v(p){Un.call(this,i,p)}return i.$$set=p=>{"tag"in p&&e(0,o=p.tag)},i.$$.update=()=>{var p,b,w;i.$$.dirty&1&&e(5,n=(b=(p=o.data.title)!=null?p:o.data.text)!=null?b:""),i.$$.dirty&1&&e(4,s=(w=r[o.data.theme||"light"])!=null?w:r.light)},[o,a,l,c,s,n,d,h,u,m,g,v]}class QC extends ce{constructor(t){super(),le(this,t,_C,BC,ae,{tag:0},jC)}}function RC(i){let t,e;return t=new QC({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.tag=n[0]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function GC(i){let t,e;return t=new zC({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.tag=n[0]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function FC(i){let t,e,n,s;const o=[GC,RC],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=o[t](i)),{c(){e&&e.c(),n=ke()},m(l,c){~t&&r[t].m(l,c),O(l,n,c),s=!0},p(l,[c]){let d=t;t=a(l),t===d?~t&&r[t].p(l,c):(e&&(ue(),z(r[d],1,1,()=>{r[d]=null}),fe()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=o[t](l),e.c()),x(e,1),e.m(n.parentNode,n)):e=null)},i(l){s||(x(e),s=!0)},o(l){z(e),s=!1},d(l){~t&&r[t].d(l),l&&V(n)}}}function HC(i,t,e){let n,{tag:s}=t,o;function r(a){o=a.detail}return s.play=()=>o.play(),s.pause=()=>o.pause(),i.$$set=a=>{"tag"in a&&e(0,s=a.tag)},i.$$.update=()=>{var a;i.$$.dirty&1&&e(1,n=(a=s.data.appearance)!=null?a:"line")},[s,n,r]}class WC extends ce{constructor(t){super(),le(this,t,HC,FC,ae,{tag:0})}}function NC(i){he(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function du(i){var s;let t,e,n;return e=new Fh({props:{mediaItemConfig:{canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(s=i[4])!=null?s:"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=S("div"),se(e.$$.fragment),y(t,"class","media-wrapper svelte-10cw0el")},m(o,r){O(o,t,r),ne(e,t,null),n=!0},p(o,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=o[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:o[2]}),r&64&&(a.unfolded=o[6]),r&32&&(a.mediaData=o[5]),r&2&&(a.enableCarousel=o[1]),r&8&&(a.autoplayConfig=o[3]),r&1&&(a.tag=o[0]),e.$set(a)},i(o){n||(x(e.$$.fragment,o),n=!0)},o(o){z(e.$$.fragment,o),n=!1},d(o){o&&V(t),ie(e)}}}function YC(i){let t,e,n=i[0].state&&i[5]&&du(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[0].state&&s[5]?n?(n.p(s,o),o&33&&x(n,1)):(n=du(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function XC(i,t,e){let n,s,o,r,a,l,{tag:c}=t;return i.$$set=d=>{"tag"in d&&e(0,c=d.tag)},i.$$.update=()=>{var d,h;i.$$.dirty&1&&e(6,n=c.state?c.state.unfolded:!1),i.$$.dirty&1&&e(5,s=c.data.mediaData),i.$$.dirty&1&&e(1,o=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:o!=null?o:!0,autoplayVideo:!0}),i.$$.dirty&1&&e(2,l=(h=c.data.objectFit)!=null?h:(()=>c.data.adaptationMode==="stretch"?"fill":c.data.adaptationMode==="proportional"?"contain":void 0)())},[c,o,l,a,r,s,n]}class UC extends ce{constructor(t){super(),le(this,t,XC,YC,ae,{tag:0},NC)}}function hu(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 qC(i){return Y(this,null,function*(){const{url:t,ratio:e=3}=i;i.ratio||console.warn("Tag icon ratio is not set, default is 3");const{width:n,height:s}=yield hu(t);return we(F({},i),{width:n/e,height:s/e})})}function JC(i){return Y(this,null,function*(){const{steps:t,url:e,ratio:n=3,fps:s=24}=i;if(!t)throw new Error("KeyframeIcon requires steps");const{width:o,height:r}=yield hu(e),a=o/n,l=r/n,c=a/t,d=l,h=1/s*t+"s";return we(F({},i),{width:c,height:d,duration:h})})}function ZC(i){he(i,"svelte-316sq3","@keyframes svelte-316sq3-sprites-animation{0%{background-position:0 0}100%{background-position:100% 0}}.icon-image.svelte-316sq3{display:block;width:auto}.icon-keyframe.svelte-316sq3{background-repeat:no-repeat;background-size:auto 100%;animation-direction:normal;animation-iteration-count:infinite;animation-name:svelte-316sq3-sprites-animation;animation-delay:0}")}function uu(i){i[1]=i[19].width}function fu(i){i[1]=i[19].width,i[16]=i[19].height,i[17]=i[19].steps,i[18]=i[19].duration}function mu(i){let t,e,n,s=i[0]&&pu();function o(l,c){return l[8]?$C:KC}let r=o(i),a=r(i);return{c(){t=S("div"),s&&s.c(),e=ee(),a.c(),y(t,"class","icon"),j(t,"width",i[1])},m(l,c){O(l,t,c),s&&s.m(t,null),D(t,e),a.m(t,null),n=!0},p(l,c){l[0]?s?c&1&&x(s,1):(s=pu(),s.c(),x(s,1),s.m(t,e)):s&&(ue(),z(s,1,1,()=>{s=null}),fe()),r===(r=o(l))&&a?a.p(l,c):(a.d(1),a=r(l),a&&(a.c(),a.m(t,null))),c&2&&j(t,"width",l[1])},i(l){n||(x(s),n=!0)},o(l){z(s),n=!1},d(l){l&&V(t),s&&s.d(),a.d()}}}function pu(i){let t,e;return t=new _t({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function KC(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:nP,then:tP,catch:eP,value:19};return zs(e=i[11](Fe({url:i[7],ratio:i[5]})),n),{c(){t=ke(),n.block.c()},m(s,o){O(s,t,o),n.block.m(s,n.anchor=o),n.mount=()=>t.parentNode,n.anchor=t},p(s,o){i=s,n.ctx=i,o&160&&e!==(e=i[11](Fe({url:i[7],ratio:i[5]})))&&zs(e,n)||Ml(n,i,o)},d(s){s&&V(t),n.block.d(s),n.token=null,n=null}}}function $C(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:oP,then:sP,catch:iP,value:19};return zs(e=i[10](Fe({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})),n),{c(){t=ke(),n.block.c()},m(s,o){O(s,t,o),n.block.m(s,n.anchor=o),n.mount=()=>t.parentNode,n.anchor=t},p(s,o){i=s,n.ctx=i,o&228&&e!==(e=i[10](Fe({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})))&&zs(e,n)||Ml(n,i,o)},d(s){s&&V(t),n.block.d(s),n.token=null,n=null}}}function eP(i){return{c:J,m:J,p:J,d:J}}function tP(i){uu(i);let t,e;return{c(){t=S("img"),y(t,"alt","tag-icon"),y(t,"class","icon-image svelte-316sq3"),Ct(t.src,e=i[7])||y(t,"src",e),j(t,"width",Qt(ui({originWidth:i[1],scale:i[4],wantedWidth:i[3]}).width))},m(n,s){O(n,t,s)},p(n,s){uu(n),s&128&&!Ct(t.src,e=n[7])&&y(t,"src",e),s&184&&j(t,"width",Qt(ui({originWidth:n[1],scale:n[4],wantedWidth:n[3]}).width))},d(n){n&&V(t)}}}function nP(i){return{c:J,m:J,p:J,d:J}}function iP(i){return{c:J,m:J,p:J,d:J}}function sP(i){fu(i);let t,e=`url(${i[7]})`,n=`steps(${i[17]}, jump-none)`;return{c(){t=S("div"),y(t,"class","icon-keyframe svelte-316sq3"),j(t,"width",Qt(ui({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).width)),j(t,"height",Qt(ui({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).height)),j(t,"background-image",e),j(t,"animation-duration",i[18]),j(t,"animation-timing-function",n)},m(s,o){O(s,t,o)},p(s,o){fu(s),o&252&&j(t,"width",Qt(ui({originWidth:s[1],originHeight:s[16],scale:s[4],wantedWidth:s[3]}).width)),o&252&&j(t,"height",Qt(ui({originWidth:s[1],originHeight:s[16],scale:s[4],wantedWidth:s[3]}).height)),o&128&&e!==(e=`url(${s[7]})`)&&j(t,"background-image",e),o&228&&j(t,"animation-duration",s[18]),o&228&&n!==(n=`steps(${s[17]}, jump-none)`)&&j(t,"animation-timing-function",n)},d(s){s&&V(t)}}}function oP(i){return{c:J,m:J,p:J,d:J}}function rP(i){let t,e,n=i[9]&&mu(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[9]?n?(n.p(s,o),o&512&&x(n,1)):(n=mu(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function ui(i){const{originWidth:t,originHeight:e,scale:n=1,wantedWidth:s}=i,o=(s!=null?s:t)*n,r=typeof e=="number"?o*(e/t):void 0;return we(F({},i),{width:o,height:r})}function aP(i,t,e){let n,s,o,r,a,l,c,d,h,{width:u=null}=t,{icon:m=null}=t,{shadow:g=!1}=t;const v=Ds();function p(P){return Y(this,null,function*(){const k=yield JC(P);return v("iconLoaded",k),k})}function b(P){return Y(this,null,function*(){if(typeof h=="number")return we(F({},P),{width:h});const k=yield qC(P);return v("iconLoaded",k),k})}function w(){d||v("iconLoaded")}return At(()=>{w()}),i.$$set=P=>{"width"in P&&e(1,u=P.width),"icon"in P&&e(12,m=P.icon),"shadow"in P&&e(0,g=P.shadow)},i.$$.update=()=>{var P,k;i.$$.dirty&4096&&e(7,n=m==null?void 0:m.url),i.$$.dirty&4096&&e(2,s=(P=m==null?void 0:m.steps)!=null?P:1),i.$$.dirty&4096&&e(6,o=m==null?void 0:m.fps),i.$$.dirty&4096&&e(5,r=m==null?void 0:m.ratio),i.$$.dirty&4096&&e(4,a=(k=m==null?void 0:m.scale)!=null?k:1),i.$$.dirty&4096&&e(3,l=m==null?void 0:m.width),i.$$.dirty&252&&e(9,c=Fe({url:n,steps:s,fps:o,ratio:r,scale:a,width:l})),i.$$.dirty&4&&e(8,d=s>1),i.$$.dirty&2&&(h=u)},w(),[g,u,s,l,a,r,o,n,d,c,p,b,m]}class gu extends ce{constructor(t){super(),le(this,t,aP,rP,ae,{width:1,icon:12,shadow:0},ZC)}}function lP(i){he(i,"svelte-e58ijk",".wrapper.svelte-e58ijk{font-weight:600;cursor:pointer;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:auto}.text-wrapper.svelte-e58ijk{position:relative;display:flex;align-items:center;justify-content:center}.text.svelte-e58ijk{position:absolute;top:0;font-size:0.875rem;color:#ffffff;letter-spacing:0;text-align:center;max-width:8.75rem;width:-moz-max-content;width:max-content;line-height:1.125rem;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function vu(i){let t,e,n,s,o,r;return e=new _t({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=S("div"),se(e.$$.fragment),n=ee(),s=S("div"),o=Te(i[1]),y(s,"class","text svelte-e58ijk"),y(t,"class","text-wrapper svelte-e58ijk")},m(a,l){O(a,t,l),ne(e,t,null),D(t,n),D(t,s),D(s,o),r=!0},p(a,l){(!r||l&2)&&Oe(o,a[1])},i(a){r||(x(e.$$.fragment,a),r=!0)},o(a){z(e.$$.fragment,a),r=!1},d(a){a&&V(t),ie(e)}}}function cP(i){let t,e,n,s;e=new gu({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[4]);let o=i[1]&&i[2]&&vu(i);return{c(){t=S("div"),se(e.$$.fragment),n=ee(),o&&o.c(),y(t,"class","wrapper svelte-e58ijk")},m(r,a){O(r,t,a),ne(e,t,null),D(t,n),o&&o.m(t,null),s=!0},p(r,[a]){const l={};a&1&&(l.icon=r[0]),e.$set(l),r[1]&&r[2]?o?(o.p(r,a),a&6&&x(o,1)):(o=vu(r),o.c(),x(o,1),o.m(t,null)):o&&(ue(),z(o,1,1,()=>{o=null}),fe())},i(r){s||(x(e.$$.fragment,r),x(o),s=!0)},o(r){z(e.$$.fragment,r),z(o),s=!1},d(r){r&&V(t),ie(e),o&&o.d()}}}function dP(i,t,e){let n,s,o,{tag:r}=t;const a=()=>{e(2,n=!0)};return i.$$set=l=>{"tag"in l&&e(3,r=l.tag)},i.$$.update=()=>{var l,c,d;i.$$.dirty&8&&e(1,s=(l=r.data.title)!=null?l:r.data.text),i.$$.dirty&8&&e(0,o=(d=r.data.icon)!=null?d:(c=r.style)==null?void 0:c.point)},e(2,n=!1),[o,s,n,r,a]}class hP extends ce{constructor(t){super(),le(this,t,dP,cP,ae,{tag:3},lP)}}function uP(i){he(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function fP(i){let t,e;return{c(){t=new xs(!1),e=ke(),t.a=e},m(n,s){t.m(i[2],n,s),O(n,e,s)},p:J,d(n){n&&V(e),n&&t.d()}}}function mP(i){let t,e=typeof i[2]=="string"&&fP(i);return{c(){t=S("div"),e&&e.c(),y(t,"class","customElement__container svelte-kzl2aj"),$(t,"unfolded",i[1])},m(n,s){O(n,t,s),e&&e.m(t,null),i[5](t)},p(n,[s]){typeof n[2]=="string"&&e.p(n,s),s&2&&$(t,"unfolded",n[1])},i:J,o:J,d(n){n&&V(t),e&&e.d(),i[5](null)}}}function pP(i,t,e){var d,h;let n,{tag:s}=t,{renderMap:o=new Map}=t,r,a=(h=s.element)!=null?h:(d=o.get(s.contentType))==null?void 0:d.renderer,l;At(()=>{r&&(a instanceof Element?(r.appendChild(a),l=()=>{a instanceof Element&&a.remove()}):typeof a=="function"&&(l=a(r,s)))}),Vt(()=>{l==null||l()});function c(u){Re[u?"unshift":"push"](()=>{r=u,e(0,r)})}return i.$$set=u=>{"tag"in u&&e(3,s=u.tag),"renderMap"in u&&e(4,o=u.renderMap)},i.$$.update=()=>{i.$$.dirty&8&&e(1,n=s.state.unfolded)},[r,n,a,s,o,c]}class gP extends ce{constructor(t){super(),le(this,t,pP,mP,ae,{tag:3,renderMap:4},uP)}}function vP(i){he(i,"svelte-1r4fqvg",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAAAhAAAAAkaG10eJ9gBO8AAADsAAABJG1heHAASVAAAAAArAAAAAZuYW1lqczkZQAAApQAAAJecG9zdP+4ADIAAAZwAAAAIAAAUAAASQAAAAEAAAABAADkeHeyXw889QADA+gAAAAA2NoRKwAAAADY2hErACn/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACCAA7AcwAdwIIADMCCAA0AhwAMwISADkCCAAuAfQANAH+ACsB/gApAggANAEeAFABHgBQAR4AUAIIADQCCAAuAR4AUAEeAFABfAAxAAEAAAPo/zgAAAIcACkAKQHgAAEAAAAAAAAAAAAAAAAAAABJAAMCLgGQAAUACAKKAlgAAABLAooCWAAAAV4AMgEsAAAAAAgAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFVLV04AIAAg/xsDIP84AMgD6ADIAAAAAQAAAAAB9AK8AAAAIAAAAAAAEADGAAEAAAAAAAEADAAAAAEAAAAAAAIABAAMAAEAAAAAAAMAGwAQAAEAAAAAAAQAEQArAAEAAAAAAAUAPAA8AAEAAAAAAAYAEAB4AAEAAAAAAAgADAAAAAEAAAAAAAkADAAAAAMAAQQJAAEAGACIAAMAAQQJAAIACACgAAMAAQQJAAMANgCoAAMAAQQJAAQAIgDeAAMAAQQJAAUAeAEAAAMAAQQJAAYAIAF4AAMAAQQJAAgAGACIAAMAAQQJAAkAGACIQUxJQkFCQSBGb250Qm9sZDEuMDAwO1VLV047QUxJQkFCQUZvbnQtQm9sZEFMSUJBQkEgRm9udCBCb2xkVmVyc2lvbiAxLjAwMDtQUyAwMDEuMDAwO2hvdGNvbnYgMS4wLjg4O21ha2VvdGYubGliMi41LjY0Nzc1QUxJQkFCQUZvbnQtQm9sZABBAEwASQBCAEEAQgBBACAARgBvAG4AdABCAG8AbABkADEALgAwADAAMAA7AFUASwBXAE4AOwBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAEEATABJAEIAQQBCAEEAIABGAG8AbgB0ACAAQgBvAGwAZABWAGUAcgBzAGkAbwBuACAAMQAuADAAMAAwADsAUABTACAAMAAwADEALgAwADAAMAA7AGgAbwB0AGMAbwBuAHYAIAAxAC4AMAAuADgAOAA7AG0AYQBrAGUAbwB0AGYALgBsAGkAYgAyAC4ANQAuADYANAA3ADcANQBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAAAAAAADAAAAAwAAASIAAQAAAAAAHAADAAEAAAEiAAABBgAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAABCSEMANjc4OTo7PD0+PwAAAAAAAAACAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGwAAAAAAABwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAFoAAAAQABAAAwAAACAALgA5AFoAegCl/xv//wAAACAALAAwAEEAYQCl/xr////hAAAABv/B/7v/nwAAAAEAAAAOAAAAAAAAAAAACgAAAEIASABDAEYARwADAAAAAAAA/7UAMgAAAAAAAAAAAAAAAAAAAAAAAAAAAQAEAgABAQERQUxJQkFCQUZvbnQtQm9sZAABAQEg+A8A+CAB+CEC+BgEtPtc+HT5tAX3KA/3UBGcHAZWEgAHAQENExoiKTpLbmluZS4wMDEuMDAxbW9uZXkudW5pRkYxQm5pbmUuMDAxdW5pRkYxQWNvcHlyaWdodCBtaXNzaW5nQUxJQkFCQSBGb250IEJvbGQAAAEAAQAAIhkAQhkAEQkBhwABigAADQAADwAAZAABiAABiwABiQAADgAASQIAAQCtAK4ArwCwALEAsgCzALQAtQC2ALcAuAC5ALoAuwC8AL0AvgC/AMAAwQDCAMMAxADFAMYAxwDIAMkAygDLAMwAzQDOAM8A0ADRANIA0wDUANUA1gDXANgA2QDaANsA3ADdAN4A3wDgAOEA4gFDAVoBqwIsAloCuAMcAzkDzwQ4BDoEPARRBFMEVQTNBOIE8QUEmPtc0Ky6rKKsuqzHrKPDoa2irLCspq2vraWssKzOAejVrKytrKzYA/gu+bQV+9H+fPfRBj76ORVqSWbNavs6rM2wSqwH7vsVFUXNafs68wfNaRVqZ6wG704VaklFJ6zNsEmsB/c6TxUn+zqt9xnNB6z7DhX7Bfs69wWsO++6anRpwwfv+0EV+wX7OvcFB/cZahUnXO8GrFMVamsHRVwF8Wr7OqwG0boFRawGDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OrIr5UQH3OPdUA/ebihVmaZSdbB9Mr2TL0xr3vgewlK2eqh7Kr86y1BuvrIJ5qh/HZrJIQhr7vgdngmp5bR5OZ0tkQxv46ARUX2FSH/u+B1a5YMDAs7TCHve+B8RjtVYeDnD4utkB93HzA/cL+QgVPfH8vPP5UgcOrIn5UgG++DYD+GmJFfw28wb3svfUBZ2glKSnGsNduFBWXF1UiB4ijgaMsJWsnqoIyLHMstYbsa6Ceawfy2ezSUAaVndXZ2Me+2/7jQX3pwYOrIvy92Tz90ryEr/zM/L3SvMu8hPy+B/3/xUT7LCwpMDDGq6CrHqoHsZnTK5DG2lrg3puH09pZk5EGobykAe4tba6vrViXFZiYlcedyOfBhPyxLpdUlJcW1JSXLvEH5ojfAdllGiebB5LsM5j1xuwrpSeqx/KsLPO1xrKcMNerx4OwPL1Affi8gP4dPdlFWD4fPshBvuJ/HkF+wH3ryPy87YH+8z1Ffc69+QF++QHDrb3ZNf3ZfAB9zX3YwP3nRZlaJSebB9LsGPO1xrzBlK6XMTEubrEHtcHxF26UlJcXFIeI/g0+BYh+677JAaorK2ZsBuwroJ4qx/LZrNHPxo/B2aCaHhrHktmR2NAGw6si/X3b/IBufX3b/ID95n4QBWAg4uKhh/3EfelBfsHBvtK/CMFfnCFbm0aZJVnnmoeSrLPYdobsq6Vnqwfy7K10dgasoGueKwey2RHtT4b+9YETlu7yMe8vcfHvVlPT1laTx8OmIr5UQG/+B8D93iKFfsIBvdo+OYF+6T2+B8oBg6iifL3bPX3QPEStvNB8vc/8jXxE/L4EvgHFRPss7Cnu78arYOreqgexWpNr0YbaWyDem4fUmlmTUcaXqBftGAeE/JWYmROSxpklWieax5Ksc9i2BuxrpWerB/LsbTP2BrHaMVath4T7PsN93QVu7FjXFtlZltcZbC7urGzuh8T8oX8ghVPW7zHx7q6yMa9W1BPWVpQHw6i96Tz92/0AbTz93DzA/hp+HkVsIGveKwezmNFtUAbZGeBeGofSmNiRT8aZJVnnmseSrHPYtoboAb7EvukBfcHBvdL+CEFmaySqaQa+9gWxry+yJ6dhoGcHq12oWZmGk5YW1BMXLnKHg4gCiEK+11L91IlCvdiyhWtb6hpJgoeJAoOIQogCqz3pe/3b/UBufX3bfQD+G74dxWyga94rB7NZEW0PhtlaIF4ah9KY2FFPxo7tkTPZh6MjIqKjB+TiJCIjYoIjgaCoKGHoRuanY6QoB+IgfsB+6QF9wcG9y/4IgWYppGnqhr7a/sCFVBbvMjHu7zGyLxbTk5aWk4fDvtd+AojCoz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-1r4fqvg{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.withAnimation.svelte-1r4fqvg{transition:opacity 0.3s linear}.content__container.unClickable.svelte-1r4fqvg{pointer-events:none !important}.content__container.unClickable.svelte-1r4fqvg *{pointer-events:none !important}.content__wrapper.svelte-1r4fqvg{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-1r4fqvg{opacity:0;pointer-events:none}.content__container.hide.svelte-1r4fqvg *{pointer-events:none !important}.content__container.disable.svelte-1r4fqvg{display:none}.content.svelte-1r4fqvg{position:relative;width:100%;height:100%;font-size:0.75rem;color:#fff}.content.svelte-1r4fqvg:not(.unfolded){pointer-events:none}.content.svelte-1r4fqvg:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-1r4fqvg{pointer-events:auto}')}function AP(i){let t,e;return{c(){t=S("div"),y(t,"data-info","tag content is keep folded"),y(t,"data-id",e=i[1].id)},m(n,s){O(n,t,s)},p(n,s){s&2&&e!==(e=n[1].id)&&y(t,"data-id",e)},i:J,o:J,d(n){n&&V(t)}}}function bP(i){let t,e,n,s,o,r,a,l,c,d;const h=[kP,EP,IP,PP,CP,wP],u=[];function m(g,v){return g[1].contentType==="Text"?0:g[1].contentType==="ImageText"||g[1].contentType==="Image"||g[1].contentType==="Video"?1:g[1].contentType==="Audio"?2:g[1].contentType==="Marketing"?3:g[1].contentType==="Link"||g[1].contentType==="VRLink"||g[1].contentType==="PanoLink"||g[1].contentType==="Sticker"?4:g[1].contentType==="MediaPlane"||g[1].contentType==="MediaModel"?5:-1}return~(s=m(i))&&(o=u[s]=h[s](i)),{c(){var g;t=S("div"),e=S("div"),n=S("div"),o&&o.c(),y(n,"class","content svelte-1r4fqvg"),$(n,"unfolded",(g=i[1].state)==null?void 0:g.unfolded),y(e,"class","content__wrapper svelte-1r4fqvg"),y(t,"class",r=Qe(st("content__container",i[1].className))+" svelte-1r4fqvg"),y(t,"data-id",a=i[1].id),$(t,"disable",i[1].enabled===!1),$(t,"hide",i[5]),$(t,"withAnimation",i[0]),$(t,"unClickable",i[1].config.clickable===!1),j(t,"width",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0),j(t,"height",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0)},m(g,v){O(g,t,v),D(t,e),D(e,n),~s&&u[s].m(n,null),l=!0,c||(d=ye(t,"click",Al(i[15])),c=!0)},p(g,v){var b;let p=s;s=m(g),s===p?~s&&u[s].p(g,v):(o&&(ue(),z(u[p],1,1,()=>{u[p]=null}),fe()),~s?(o=u[s],o?o.p(g,v):(o=u[s]=h[s](g),o.c()),x(o,1),o.m(n,null)):o=null),(!l||v&2)&&$(n,"unfolded",(b=g[1].state)==null?void 0:b.unfolded),(!l||v&2&&r!==(r=Qe(st("content__container",g[1].className))+" svelte-1r4fqvg"))&&y(t,"class",r),(!l||v&2&&a!==(a=g[1].id))&&y(t,"data-id",a),(!l||v&2)&&$(t,"disable",g[1].enabled===!1),(!l||v&34)&&$(t,"hide",g[5]),(!l||v&3)&&$(t,"withAnimation",g[0]),(!l||v&2)&&$(t,"unClickable",g[1].config.clickable===!1),v&2&&j(t,"width",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0),v&2&&j(t,"height",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0)},i(g){l||(x(o),l=!0)},o(g){z(o),l=!1},d(g){g&&V(t),~s&&u[s].d(),c=!1,d()}}}function yP(i){let t,e,n,s,o,r,a;return e=new gP({props:{tag:Fe(i[1]),renderMap:i[3]}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class",n=Qe(st("content__container",i[1].className))+" svelte-1r4fqvg"),y(t,"data-id",s=i[1].id),$(t,"custom-tag-disable",i[1].enabled===!1),$(t,"custom-tag-hide",i[5])},m(l,c){O(l,t,c),ne(e,t,null),o=!0,r||(a=ye(t,"click",i[14]),r=!0)},p(l,c){const d={};c&2&&(d.tag=Fe(l[1])),c&8&&(d.renderMap=l[3]),e.$set(d),(!o||c&2&&n!==(n=Qe(st("content__container",l[1].className))+" svelte-1r4fqvg"))&&y(t,"class",n),(!o||c&2&&s!==(s=l[1].id))&&y(t,"data-id",s),(!o||c&2)&&$(t,"custom-tag-disable",l[1].enabled===!1),(!o||c&34)&&$(t,"custom-tag-hide",l[5])},i(l){o||(x(e.$$.fragment,l),o=!0)},o(l){z(e.$$.fragment,l),o=!1},d(l){l&&V(t),ie(e),r=!1,a()}}}function wP(i){let t,e;return t=new UC({props:{tag:Fe(i[1])}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=Fe(n[1])),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function CP(i){let t,e;return t=new hP({props:{tag:Fe(i[1])}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=Fe(n[1])),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function PP(i){let t,e;return t=new wC({props:{tag:Fe(i[1])}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=Fe(n[1])),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function IP(i){let t,e;return t=new WC({props:{tag:Fe(i[1])}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=Fe(n[1])),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function EP(i){let t,e;return t=new vC({props:{tag:Fe(i[1])}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=Fe(n[1])),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function kP(i){let t,e;return t=new O1({props:{tag:Fe(i[1])}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=Fe(n[1])),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function xP(i){let t,e,n,s,o;const r=[yP,bP,AP],a=[];function l(c,d){return d&10&&(t=null),t==null&&(t=!!(c[1].element||c[3].has(c[1].contentType))),t?0:c[4]?1:2}return e=l(i,-1),n=a[e]=r[e](i),{c(){n.c(),s=ke()},m(c,d){a[e].m(c,d),O(c,s,d),o=!0},p(c,[d]){let h=e;e=l(c,d),e===h?a[e].p(c,d):(ue(),z(a[h],1,1,()=>{a[h]=null}),fe(),n=a[e],n?n.p(c,d):(n=a[e]=r[e](c),n.c()),x(n,1),n.m(s.parentNode,s))},i(c){o||(x(n),o=!0)},o(c){z(n),o=!1},d(c){a[e].d(c),c&&V(s)}}}function MP(i,t,e){let n,s,o,r,a,l,{withAnimation:c=!1}=t,{tag:d}=t,{hooks:h}=t,{renderMap:u=new Map}=t,{state:m}=t,{mediaStore:g}=t,{temporaryState:v}=t;qo("hooks",h),qo("mediaStore",g);let p,b;function w(I){I?h.emit("exposure",{id:r,type:"start"}):h.emit("exposure",{id:r,type:"end"})}function P(I,B,L){var X,Z;return!(!B.visible||!B.enabled||!L.visible||!((X=I.state)!=null&&X.visible)||((Z=I.temporaryState)==null?void 0:Z.visible)===!1||ft(I)&&!I.mediaVisible)}const k=I=>h.emit("click",{event:I,target:"TagContent",tag:d}),T=I=>h.emit("click",{event:I,target:"TagContent",tag:d});return i.$$set=I=>{"withAnimation"in I&&e(0,c=I.withAnimation),"tag"in I&&e(1,d=I.tag),"hooks"in I&&e(2,h=I.hooks),"renderMap"in I&&e(3,u=I.renderMap),"state"in I&&e(6,m=I.state),"mediaStore"in I&&e(7,g=I.mediaStore),"temporaryState"in I&&e(8,v=I.temporaryState)},i.$$.update=()=>{var I,B,L,X,Z,G,R,H,Q,W,q;i.$$.dirty&2&&e(12,n=(I=d.state)==null?void 0:I.unfolded),i.$$.dirty&2&&e(11,s=(B=d.state)==null?void 0:B.visible),i.$$.dirty&322&&e(13,o=m.visible&&v.visible&&((L=d.state)==null?void 0:L.visible)),i.$$.dirty&2&&(r=d.id),i.$$.dirty&322&&e(5,a=!P(d,m,v)),i.$$.dirty&8192&&w(o),i.$$.dirty&7682&&d.hooks&&(n!==void 0&&n!==b&&(e(10,b=n),n?(Z=(X=d.hooks).emit)==null||Z.call(X,"unfolded"):(R=d==null?void 0:(G=d.hooks).emit)==null||R.call(G,"folded")),s!==void 0&&s!==p&&(e(9,p=s),s?(Q=(H=d.hooks).emit)==null||Q.call(H,"show"):(q=(W=d.hooks).emit)==null||q.call(W,"hide"))),i.$$.dirty&2&&e(4,l=(()=>!(typeof d.config.unfoldedConfig=="object"&&d.config.unfoldedConfig.keep==="folded"))())},[c,d,h,u,l,a,m,g,v,p,b,s,n,o,k,T]}let Au=class extends ce{constructor(t){super(),le(this,t,MP,xP,ae,{withAnimation:0,tag:1,hooks:2,renderMap:3,state:6,mediaStore:7,temporaryState:8},vP)}};function SP(i){he(i,"svelte-7aiuwz",'@charset "UTF-8";.tag-point-click-helper.svelte-7aiuwz.svelte-7aiuwz{position:absolute;pointer-events:auto;cursor:pointer;width:calc(100% + 0.75rem);height:calc(100% + 0.75rem);left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-7aiuwz.svelte-7aiuwz{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.tag-folded-point.svelte-7aiuwz.svelte-7aiuwz,.tag-unfolded-point.svelte-7aiuwz.svelte-7aiuwz{transition:all 0.5s}.tag-point-wrapper.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz: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-7aiuwz .tag-unfolded-point.svelte-7aiuwz: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-7aiuwz .tag-folded-point.svelte-7aiuwz{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-7aiuwz .tag-folded-point.svelte-7aiuwz{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz{opacity:1;scale:1}')}function DP(i){let t,e,n,s,o,r,a,l,c,d,h,u;return s=new _t({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new gu({props:{icon:i[2],width:i[1]}}),c.$on("iconLoaded",i[7]),{c(){t=S("div"),e=S("div"),n=ee(),se(s.$$.fragment),o=ee(),r=S("div"),a=ee(),l=S("div"),se(c.$$.fragment),y(e,"class","tag-point-click-helper svelte-7aiuwz"),y(r,"class","tag-unfolded-point svelte-7aiuwz"),j(r,"transition-delay",(i[3]?i[5]:0)+"ms"),y(l,"class","tag-folded-point svelte-7aiuwz"),j(l,"transition-delay",(i[3]?i[5]:0)+"ms"),y(t,"class","tag-point-wrapper svelte-7aiuwz"),$(t,"unfolded",i[0]),$(t,"folded",i[3])},m(m,g){O(m,t,g),D(t,e),D(t,n),ne(s,t,null),D(t,o),D(t,r),D(t,a),D(t,l),ne(c,l,null),d=!0,h||(u=ye(e,"click",i[4]),h=!0)},p(m,[g]){g&8&&j(r,"transition-delay",(m[3]?m[5]:0)+"ms");const v={};g&4&&(v.icon=m[2]),g&2&&(v.width=m[1]),c.$set(v),g&8&&j(l,"transition-delay",(m[3]?m[5]:0)+"ms"),(!d||g&1)&&$(t,"unfolded",m[0]),(!d||g&8)&&$(t,"folded",m[3])},i(m){d||(x(s.$$.fragment,m),x(c.$$.fragment,m),d=!0)},o(m){z(s.$$.fragment,m),z(c.$$.fragment,m),d=!1},d(m){m&&V(t),ie(s),ie(c),h=!1,u()}}}function LP(i,t,e){let n,s,o,r;const a=ln("hooks");let{tag:l}=t,c,d=!1;const h=()=>{c!==void 0&&clearTimeout(c),d=!0,c=setTimeout(()=>{d=!1},800)},u=v=>{d||a.emit("click",{event:v,target:"TagPoint",tag:l})},m=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();function g(v){Un.call(this,i,v)}return i.$$set=v=>{"tag"in v&&e(6,l=v.tag)},i.$$.update=()=>{var v,p,b,w;i.$$.dirty&64&&e(0,n=(v=l.state)==null?void 0:v.unfolded),i.$$.dirty&1&&e(3,s=!n),i.$$.dirty&64&&e(2,o=(b=(p=l.style)==null?void 0:p.point)!=null&&b.url?(w=l.style)==null?void 0:w.point:{url:Yb}),i.$$.dirty&64&&e(1,r=(()=>{var T,I,B,L;const P=(I=(T=l.style)==null?void 0:T.point)==null?void 0:I.width;if(typeof P=="number")return P;const k=(L=(B=l.style)==null?void 0:B.point)==null?void 0:L.size;if(typeof k=="number")return k;if(k==="S")return 18;if(k==="M")return 20;if(k==="L")return 24;if(k==="XL")return 28})())},h(),[n,r,o,s,u,m,l,g]}class TP extends ce{constructor(t){super(),le(this,t,LP,DP,ae,{tag:6},SP)}}function zP(i){he(i,"svelte-pzwdws",".tag.withAnimation.svelte-pzwdws{transition:opacity 0.3s linear}.tag.hide.svelte-pzwdws{opacity:0;pointer-events:none}.tag.hide.svelte-pzwdws *{pointer-events:none !important}.tag.unClickable.svelte-pzwdws{pointer-events:none !important}.tag.unClickable.svelte-pzwdws *{pointer-events:none !important}.tag.disable.svelte-pzwdws{display:none}.wrapper.svelte-pzwdws{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto}")}function jP(i){let t;return{c(){t=S("div"),y(t,"data-info","tag point is disable")},m(e,n){O(e,t,n)},p:J,i:J,o:J,d(e){e&&V(t)}}}function VP(i){let t,e;return t=new TP({props:{tag:i[1]}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=n[1]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function OP(i){let t;return{c(){t=S("div"),y(t,"data-info","tag content is disable")},m(e,n){O(e,t,n)},p:J,i:J,o:J,d(e){e&&V(t)}}}function BP(i){let t,e;return t=new Au({props:{mediaStore:i[2],withAnimation:i[0],tag:Fe(i[1]),hooks:i[15],state:i[4],temporaryState:i[5],renderMap:i[3]}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&4&&(o.mediaStore=n[2]),s&1&&(o.withAnimation=n[0]),s&2&&(o.tag=Fe(n[1])),s&16&&(o.state=n[4]),s&32&&(o.temporaryState=n[5]),s&8&&(o.renderMap=n[3]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function _P(i){let t,e,n,s,o,r,a,l,c,d;const h=[VP,jP],u=[];function m(b,w){return b[14]?0:1}n=m(i),s=u[n]=h[n](i);const g=[BP,OP],v=[];function p(b,w){return b[13]?0:1}return r=p(i),a=v[r]=g[r](i),{c(){t=S("div"),e=S("div"),s.c(),o=ee(),a.c(),y(e,"class",l=Qe(st("wrapper",i[1].className?`${i[1].className}__wrapper`:void 0))+" svelte-pzwdws"),y(e,"data-tag-unfolded",i[6]),y(e,"data-tag-id",i[12]),y(e,"data-content-type",c=i[1].contentType),j(e,"left",i[9]),j(e,"top",i[8]),y(t,"class","tag svelte-pzwdws"),y(t,"data-tag-id",i[12]),$(t,"unClickable",i[1].config.clickable===!1),$(t,"disable",i[11]),$(t,"hide",i[10]),$(t,"withAnimation",i[0]),j(t,"z-index",i[7])},m(b,w){O(b,t,w),D(t,e),u[n].m(e,null),D(e,o),v[r].m(e,null),d=!0},p(b,[w]){let P=n;n=m(b),n===P?u[n].p(b,w):(ue(),z(u[P],1,1,()=>{u[P]=null}),fe(),s=u[n],s?s.p(b,w):(s=u[n]=h[n](b),s.c()),x(s,1),s.m(e,o));let k=r;r=p(b),r===k?v[r].p(b,w):(ue(),z(v[k],1,1,()=>{v[k]=null}),fe(),a=v[r],a?a.p(b,w):(a=v[r]=g[r](b),a.c()),x(a,1),a.m(e,null)),(!d||w&2&&l!==(l=Qe(st("wrapper",b[1].className?`${b[1].className}__wrapper`:void 0))+" svelte-pzwdws"))&&y(e,"class",l),(!d||w&64)&&y(e,"data-tag-unfolded",b[6]),(!d||w&4096)&&y(e,"data-tag-id",b[12]),(!d||w&2&&c!==(c=b[1].contentType))&&y(e,"data-content-type",c),w&512&&j(e,"left",b[9]),w&256&&j(e,"top",b[8]),(!d||w&4096)&&y(t,"data-tag-id",b[12]),(!d||w&2)&&$(t,"unClickable",b[1].config.clickable===!1),(!d||w&2048)&&$(t,"disable",b[11]),(!d||w&1024)&&$(t,"hide",b[10]),(!d||w&1)&&$(t,"withAnimation",b[0]),w&128&&j(t,"z-index",b[7])},i(b){d||(x(s),x(a),d=!0)},o(b){z(s),z(a),d=!1},d(b){b&&V(t),u[n].d(),v[r].d()}}}function QP(i,t,e){let n,s,o,r,a,l,c,d,h,{withAnimation:u=!1}=t,{tag:m}=t,{mediaStore:g}=t,{renderMap:v=new Map}=t,{state:p}=t,{temporaryState:b}=t;const w=ln("hooks");return i.$$set=P=>{"withAnimation"in P&&e(0,u=P.withAnimation),"tag"in P&&e(1,m=P.tag),"mediaStore"in P&&e(2,g=P.mediaStore),"renderMap"in P&&e(3,v=P.renderMap),"state"in P&&e(4,p=P.state),"temporaryState"in P&&e(5,b=P.temporaryState)},i.$$.update=()=>{var P,k,T,I,B,L,X,Z;i.$$.dirty&2&&e(14,n=(()=>{var G,R;return!(((R=(G=m.style)==null?void 0:G.point)==null?void 0:R.enabled)===!1||m.contentType==="Sticker"||m.contentType==="Link"||m.contentType==="VRLink"||m.contentType==="PanoLink"||m.contentType==="Audio"&&m.data.appearance==="plane")})()),i.$$.dirty&2&&e(13,s=(()=>m.stickType==="2DPoint")()),i.$$.dirty&2&&e(12,o=m.id),i.$$.dirty&2&&e(11,r=!((P=m.screenPosition)!=null&&P.leftPercent)||!((k=m.screenPosition)!=null&&k.topPercent)||m.enabled===!1||!m.state),i.$$.dirty&2&&e(10,a=!((T=m.state)!=null&&T.visible)||((I=m.temporaryState)==null?void 0:I.visible)===!1),i.$$.dirty&2&&e(6,l=(B=m.state)==null?void 0:B.unfolded),i.$$.dirty&2&&e(9,c=((L=m.screenPosition)==null?void 0:L.leftPercent)+"%"),i.$$.dirty&2&&e(8,d=((X=m.screenPosition)==null?void 0:X.topPercent)+"%"),i.$$.dirty&66&&e(7,h=((Z=m.zIndex)!=null?Z:0)+(l?1e4:0))},[u,m,g,v,p,b,l,h,d,c,a,r,o,s,n,w]}class RP extends ce{constructor(t){super(),le(this,t,QP,_P,ae,{withAnimation:0,tag:1,mediaStore:2,renderMap:3,state:4,temporaryState:5},zP)}}function GP(i){he(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 bu(i,t,e){const n=i.slice();return n[7]=t[e],n}function yu(i){let t,e=[],n=new Map,s,o=i[1];const r=a=>a[7].id;for(let a=0;a<o.length;a+=1){let l=bu(i,o,a),c=r(l);n.set(c,e[a]=wu(c,l))}return{c(){t=S("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","tag--container svelte-uq11d5"),$(t,"hide",!i[4].visible||!i[5].visible),$(t,"withAnimation",i[0])},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(a,l){l&63&&(o=a[1],ue(),e=St(e,l,r,1,a,o,n,t,dn,wu,null,bu),fe()),(!s||l&48)&&$(t,"hide",!a[4].visible||!a[5].visible),(!s||l&1)&&$(t,"withAnimation",a[0])},i(a){if(!s){for(let l=0;l<o.length;l+=1)x(e[l]);s=!0}},o(a){for(let l=0;l<e.length;l+=1)z(e[l]);s=!1},d(a){a&&V(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function wu(i,t){let e,n,s;return n=new RP({props:{state:t[4],temporaryState:t[5],withAnimation:t[0],tag:t[7],mediaStore:t[2],renderMap:t[3]}}),{key:i,first:null,c(){e=ke(),se(n.$$.fragment),this.first=e},m(o,r){O(o,e,r),ne(n,o,r),s=!0},p(o,r){t=o;const a={};r&16&&(a.state=t[4]),r&32&&(a.temporaryState=t[5]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[7]),r&4&&(a.mediaStore=t[2]),r&8&&(a.renderMap=t[3]),n.$set(a)},i(o){s||(x(n.$$.fragment,o),s=!0)},o(o){z(n.$$.fragment,o),s=!1},d(o){o&&V(e),ie(n,o)}}}function FP(i){let t,e,n=i[4].enabled&&yu(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[4].enabled?n?(n.p(s,o),o&16&&x(n,1)):(n=yu(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function HP(i,t,e){let{withAnimation:n=!1}=t,{tags:s=[]}=t,{hooks:o}=t,{mediaStore:r}=t,{renderMap:a}=t,{state:l}=t,{temporaryState:c}=t;return qo("hooks",o),i.$$set=d=>{"withAnimation"in d&&e(0,n=d.withAnimation),"tags"in d&&e(1,s=d.tags),"hooks"in d&&e(6,o=d.hooks),"mediaStore"in d&&e(2,r=d.mediaStore),"renderMap"in d&&e(3,a=d.renderMap),"state"in d&&e(4,l=d.state),"temporaryState"in d&&e(5,c=d.temporaryState)},[n,s,r,a,l,c,o]}class WP extends ce{constructor(t){super(),le(this,t,HP,FP,ae,{withAnimation:0,tags:1,hooks:6,mediaStore:2,renderMap:3,state:4,temporaryState:5},GP)}}const NP=new Ei.GLTFLoader;function YP(i){return new Promise((t,e)=>{function n(o){t(o)}function s(o){e(o)}NP.load(i,n,void 0,s)})}const XP=new Map,UP=new Map;class qP extends Zb{constructor(e){super(e);f(this,"group",new _.Group);f(this,"renderMap",new Map);f(this,"imagePlaneGroup",new _.Group);f(this,"gltfObjectGroup",new _.Group);f(this,"enabledModelTagSet",new Set);f(this,"temporaryState",{visible:!0});f(this,"TagContainerSvelte");f(this,"loadModel",e=>Y(this,null,function*(){var a;const n=e.data.modelUrl;if(!n)return;const s=YP(n).then(l=>{var h,u,m,g,v;const c=Object.assign(l.scene,{customID:e.id,isTagModel:!0,removeEventListener:this.addObjectClickHandler(e,l.scene,p=>{this.hooks.emit("click",{target:"TagModel",tag:e,event:p})})});return c.visible=this.getCurrentVisibleState(e),new _.Matrix4().fromArray(e.matrix).decompose(c.position,c.quaternion,c.scale),c.updateWorldMatrix(!0,!0),c.visible=this.getVisibleByFiveMode(e),(m=(u=(h=this.config)==null?void 0:h.globalConfig)==null?void 0:u.modelConfig)!=null&&m.autoLookAtEnabled&&((v=(g=e.config)==null?void 0:g.modelConfig)!=null&&v.autoLookAtEnabled)&&c.lookAt(this.five.camera.position.clone().setY(c.position.y)),c});e.model={promise:s};const o=yield s;if(((a=e.model)==null?void 0:a.promise)!==s||!this.tags.includes(e))return;e.model.object=o;const r=this.gltfObjectGroup.children.find(l=>l.customID===e.id);if(r&&(this.gltfObjectGroup.remove(r),r.removeEventListener()),this.updateRender3DDomTag(),ft(e)){if(this.getRenderType(e)==="Mesh"&&!e.mediaPlane){const l=e.data.mediaPosition.map(kt);e.mediaPlane=new Hd(e.data.mediaData[0].url,e.data.mediaPosition.map(kt),{objectFit:e.data.objectFit});const c=new _.Vector3().addVectors(l[0],l[2]).divideScalar(2);e.mediaPlane.position.copy(c),o.add(e.mediaPlane)}this.getRenderType(e)!=="Mesh"&&(o.updateTagCss3DObjectMatrix=()=>this.updateTagCss3DObjectMatrix(e,o),o.updateTagCss3DObjectMatrix())}return this.gltfObjectGroup.add(o),o}));this.group.name="PanoTagPluginModelGroup",this.gltfObjectGroup.name="PanoTagPluginGLTFObjectGroup",this.imagePlaneGroup.name="ImagePlaneGroup",this.group.add(this.gltfObjectGroup),this.group.add(this.imagePlaneGroup)}registerRenderer(e,n){this.renderMap.set(e,{renderer:n})}clearTags(){this.tags.forEach(e=>{var n,s;(s=(n=e.mediaPlane)==null?void 0:n.parent)==null||s.remove(e.mediaPlane)}),this.tags=[],this.enabledModelTagSet.clear(),this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}updateRenderAllTags(){this.enabledModelTagSet.clear(),this.tags.forEach(e=>e.stickType==="Model"&&this.enabledModelTagSet.add(e.id)),this.updateRenderPointTag(),this.updateRender3DDomTag(),this.updateRenderModelTag(),this.updateRenderImagePlane()}updateRenderImagePlane(){this.sort(this.filterImagePlane).forEach(n=>{var l,c,d,h,u;const s=n.data.mediaData[0];if(!s)return;const{url:o,type:r}=s;if(!o||(n.mediaPlane&&(n.mediaPlane.visible=(c=(l=n.state)==null?void 0:l.visible)!=null?c:!0,n.mediaPlane.visible||n.mediaPlane instanceof Tr&&((d=n.data.autoplayConfig)!=null&&d.autoplayVideo||n.mediaPlane.pause())),((h=n.mediaPlane)==null?void 0:h.src)===o))return;const a=n.position.map(kt);if(n.mediaPlane&&n.mediaPlane.removeFromParent(),r==="Image")n.mediaPlane=new Hd(o,a,{objectFit:n.data.objectFit}),n.config.clickable!==!1&&this.domEvents.addAutoBindEventListener(n.mediaPlane,"click",m=>{this.hooks.emit("click",{tag:n,target:"TagContent",event:m.origDomEvent})});else if(r==="Video"){const m=new Tr(o,a,{videoCoverSrc:s.videoCoverUrl,playButton:n.data.playIcon,paused:!((u=n.data.autoplayConfig)!=null&&u.autoplayVideo),objectFit:n.data.objectFit,videoTextureMap:XP,ImageTextureMap:UP});m.onVideoReady=v=>{v.addEventListener("play",()=>this.mediaStore.set({currentMediaElement:m.videoInstance}))},m.initialDomEvents(this.domEvents);const g=v=>(this.five.on("renderFrame",v),()=>this.five.off("renderFrame",v));m.initialRenderHooks(g),n.mediaPlane=m}this.imagePlaneGroup.add(n.mediaPlane)})}updateRender3DDomTag(){this.sort([...this.filterCSS3DTag]).forEach(n=>{var s,o,r,a;if(n.tag3DContentSvelte){const{svelteApp:l,css3DInstance:c,initialNormal:d,currentNormal:h}=n.tag3DContentSvelte;if(l.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!d.equals(h)){const u=new _.Quaternion().setFromUnitVectors(d,h);c.css3DObject.setRotationFromQuaternion(u)}return}else{if(ft(n)&&!((s=n.model)!=null&&s.object)||((o=n.state)==null?void 0:o.visible)===!1||!this.state.visible||!this.state.enabled)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=Wo(this.five)),n.stickType==="3DPoint"&&!n.normal)return console.error("updateRenderPlaneTag: 三维点标签缺少法向量!");const l=this.getPositions(n);if(!l)return;const c=this.getTagNormal(n);if(!c)return;const h=(r=this.getTagConfig(n).tag3DConfig)!=null?r:{};if(this.getRenderType(n)==="BehindDom"){h.mode="behind",h.container=document.createElement("div");const g="black";h.container.style.backgroundColor=g,h.container.style.border=`3px solid ${g}`,this.css3DRenderPlugin.hooks.on("render",()=>{var v;if(u.css3DObject.opacityMesh){const p=this.addObjectClickHandler(n,u.css3DObject.opacityMesh,b=>{this.hooks.emit("click",{event:b,target:"TagContent",tag:n})});(v=this.store.css3DRenderDisposer.get(n.id))==null||v.push(p)}})}const u=this.css3DRenderPlugin.create3DDomContainer(l,h);if(!u)return;this.store.css3DRenderDisposer.set(n.id,[u.dispose]);const m=new Au({target:u.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}});n.tag3DContentSvelte={svelteApp:m,domContainer:u,css3DInstance:u,initialNormal:c,currentNormal:c,dispose:()=>{m.$destroy(),u.dispose()}},ft(n)&&((a=n.model)!=null&&a.object)&&this.updateTagCss3DObjectMatrix(n,n.model.object)}}),this.clearUnusedPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID),n=this.gltfObjectGroup.children.filter(e);n.forEach(o=>o.removeEventListener()),this.gltfObjectGroup.remove(...n),this.tags.filter(o=>o.stickType==="Model").forEach(o=>{var r;(r=o.model)==null||r.promise.then(a=>{a.visible=this.getCurrentVisibleState(o)})}),this.five.needsRender=!0}updateTagModelVisible(){this.tags.forEach(e=>{var n;e.mediaPlane&&(e.mediaPlane.visible=this.getCurrentVisibleState(e)),(n=e.model)!=null&&n.object&&(e.model.object.visible=this.getCurrentVisibleState(e))})}updateTagCss3DObjectMatrix(e,n){var v,p,b;const s=(p=(v=e.config.tag3DConfig)==null?void 0:v.ratio)!=null?p:.00216,o=(b=e.tag3DContentSvelte)==null?void 0:b.css3DInstance.css3DObject;if(!o)return;const r=ft(e)?e.data.mediaPosition:e.position;if(!r||r.length!==4||!Array.isArray(r[0])||!Array.isArray(r[2]))return;n.updateWorldMatrix(!1,!1);const a=n.matrixWorld,l=new _.Vector3().fromArray(r[0]),c=new _.Vector3().fromArray(r[2]),d=sn(l,c).add(new _.Vector3(0,0,5e-4)),h=new _.Matrix4().setPosition(d),u=new _.Matrix4().makeScale(s,s,s),m=new _.Matrix4().multiply(a).multiply(h).multiply(u);m.decompose(o.position,o.quaternion,o.scale);const g=o.opacityMesh;g&&m.decompose(g.position,g.quaternion,g.scale)}addMediaModelTag(e){return Y(this,null,function*(){const n=e.filter(Db).map(s=>this.loadModel(s));yield Promise.all(n),this.setModelMedialVisible(),this.updateRenderAllTags()})}updateRenderPointTag(){var n;const e=this.filterPointTag;if(this.setTagZIndex(e),this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const s=(n=this.five.getElement())==null?void 0:n.parentElement;if(!s)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new WP({target:s,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore,renderMap:this.renderMap}})}}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filterCSS3DTag.forEach(n=>{var s,o,r,a,l;(a=(o=(s=n.tag3DContentSvelte)==null?void 0:s.css3DInstance)==null?void 0:o.css3DObject)==null||a.setVisible((this.state.visible&&((r=n.state)==null?void 0:r.visible))!==!1),(l=n.tag3DContentSvelte)==null||l.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}disposeAllCSS3DContainer(){for(const[,e]of this.store.css3DRenderDisposer)e==null||e.forEach(n=>n==null?void 0:n());this.store.css3DRenderDisposer=new Map}clearUnusedPanelTag(){this.filter2DPointTag.forEach(e=>{var n;(n=e.tag3DContentSvelte)==null||n.css3DInstance.dispose(),e.tag3DContentSvelte=void 0});for(const[e,n]of this.store.css3DRenderDisposer){const s=this.getTagById(e);(!s||s.stickType==="2DPoint")&&(n==null||n.forEach(o=>o==null?void 0:o()),this.store.css3DRenderDisposer.delete(e))}}}const Cu="Dnalogel-PanoTagPlugin",JP=i=>`${Cu}--${i}`;class po extends qP{constructor(e,n){super(e);f(this,"state",{enabled:!0,visible:!0});f(this,"params");f(this,"debug");f(this,"changeTagModel",(e,n)=>Y(this,null,function*(){e.data=Ue({},e.data,n),yield this.loadModel(e),this.updateRenderAllTags()}));f(this,"handleFiveInitAnimationEnded",()=>{const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{ft(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags()});f(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{var s,o;const n=this.getTagConfig(e).visibleConfig;typeof n=="object"&&((s=n.visibleFiveMode)!=null&&s.includes("Floorplan")||(o=n.visibleFiveMode)!=null&&o.includes("Mapview"))&&(e.state.visible=this.getVisibleByFiveMode(e))}),this.updateRenderAllTags()});this.params=Ue({},{debug:!1,config:this.config},F({},n)),this.debug=this.params.debug,this.config=this.params.config,_b(1,{namespace:Sr.PlayAudio});try{const s=window;Array.isArray(s.__PANOTAGPLUGIN_DEBUG_LIST__)||(s.__PANOTAGPLUGIN_DEBUG_LIST__=[]),s.__PANOTAGPLUGIN_DEBUG_LIST__.push(this),s.__PANOTAGPLUGIN_DEBUG__=this}catch(s){}}load(e,n){return Y(this,null,function*(){var o,r;this.clearTags(),console.debug(Cu," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=Ue({},this.config,{globalConfig:(o=e.globalConfig)!=null?o:{},contentTypeConfig:(r=e.contentTypeConfig)!=null?r:{}});const s=yield this.addTag(e.tagList,n);if(this.debug)try{Eb(this.five,this.tags)}catch(a){console.error(a)}return s})}addTag(e,n){return Y(this,null,function*(){const o=(Array.isArray(e)?e:[e]).map(r=>{var d,h;const a=this.getTagConfig(r),l=JSON.parse(JSON.stringify(r.data));return we(F({},r),{enabled:(d=r.enabled)!=null?d:!0,id:(h=r.id)!=null?h:tt(),data:Ue(r.data,a.initialData,l),state:F({visible:void 0,unfolded:!this.can("fold",r)},a.initialState),hooks:new ve.Subscribe,initialConfig:r.config,config:a,unfold:()=>this.changeUnfoldedById(r.id,!0),fold:()=>this.changeUnfoldedById(r.id,!1),enable:()=>this.changeEnabledById(r.id,!0),disable:()=>this.changeEnabledById(r.id,!1),destroy:()=>this.destroyTagById(r.id),changeData:u=>this.changeDataById(r.id,u)})}).filter(r=>r.position);return o.forEach(Ob),this.tags.push(...o),Tb(this.five).then(()=>Y(this,null,function*(){var r,a,l;this.store.eventListenerDisposer&&((a=(r=this.store).eventListenerDisposer)==null||a.call(r)),this.state.enabled&&this.handleEnable(),this.addResizeListener(),this.clearUnusedPanelTag(),this.setVisibleAndUnfolded({withAnimation:(l=n==null?void 0:n.withAnimation)!=null?l:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags(),yield this.addMediaModelTag(o)}))})}changeConfig(e,n=!0){n?this.config=Ue({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=Ue({},this.config.globalConfig,e):this.config.globalConfig=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeContentTypeConfig(e,n,s=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),s?this.config.contentTypeConfig[e]=Ue({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}show(e){return Y(this,null,function*(){if(this.checkDisposed())return;const{userAction:n=!0,withAnimation:s=!1}=e!=null?e:{};this.setState({visible:!0},{userAction:n,visibleWithAnimation:s}),this.hooks.emit("show",{userAction:n,withAnimation:s})})}hide(e){return Y(this,null,function*(){if(this.checkDisposed())return;const{userAction:n=!0,withAnimation:s=!1}=e!=null?e:{};this.setState({visible:!1},{userAction:n,visibleWithAnimation:s}),this.hooks.emit("hide",{userAction:n,withAnimation:s})})}enable(e){if(this.checkDisposed())return;const{userAction:n=!0}=e!=null?e:{};this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n})}disable(e){if(this.checkDisposed())return;const{userAction:n=!0}=e!=null?e:{};this.setState({enabled:!1},{userAction:n}),this.hooks.emit("disable",{userAction:n})}setState(e,n){if(this.checkDisposed())return;const{userAction:s=!0,visibleWithAnimation:o=!1}=n,r=F({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=o,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:s})}dispose(){var e,n,s,o,r,a;this.pauseCurrentMedia(),this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filterCSS3DTag.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=[],(o=(s=this.store).eventListenerDisposer)==null||o.call(s),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.gltfObjectGroup.remove(...this.gltfObjectGroup.children),this.imagePlaneGroup.remove(...this.imagePlaneGroup.children),this.clearCache(),this.five.needsRender=!0,this.store.disposed=!0,this.hooks.emit("dispose")}changeUnfoldedById(e,n){var a;const s=this.getTagById(e);if(!s)return;const o=this.can("fold",s),r=this.can("unfold",s);if(o&&r){s.state.unfolded=n;const l=this.filterPointTag;(a=this.TagContainerSvelte)==null||a.$set({tags:l})}else console.warn(`tag ${e} cannot be ${n?"unfolded":"folded"}`)}changeEnabledById(e,n){const s=this.getTagById(e);s&&(s.enabled=n,this.updateRenderAllTags())}changeTagNormalById(e,n){const s=this.getTagById(e);s&&s.tag3DContentSvelte&&(s.tag3DContentSvelte.currentNormal=kt(n))}changeDataById(e,n,s=!0){const o=this.getTagById(e);let r=!1;o&&(o.data&&(r=!0),s?o.data=Ue(o.data,n):o.data=F(F({},o.data),n),this.clearUnusedPanelTag(),this.updateRenderAllTags(),r&&o.hooks.emit("dataChanged",o.data))}changeStickTypeById(e,n,s=!0){this.changeTagById(e,n,s)}changeTagById(e,n,s=!0){const o=this.getTagById(e);let r=!1;n&&(n.data&&(r=!0),s?Ue(o,n):Object.assign(o,n),o!=null&&o.tag3DContentSvelte&&(n!=null&&n.normal)&&(o.tag3DContentSvelte.currentNormal=kt(n.normal)),this.updateRenderAllTags(),this.clearUnusedPanelTag(),r&&o.hooks.emit("dataChanged",o.data))}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(s=>{const o=this.tags.findIndex(r=>r.id===s);o!==-1&&this.tags.splice(o,1)}),this.updateRenderAllTags()}setVisibleAndUnfolded(){return Y(this,arguments,function*({withAnimation:e}={withAnimation:!1}){if(this.isPanorama)return this.setVisible(),e?new Promise(n=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.group.visible=!0,this.updateTagContainerVisible(),this.updateTagModelVisible(),this.five.needsRender=!0}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.group.visible=!1,this.updateTagContainerVisible(),this.updateTagModelVisible(),this.five.needsRender=!0}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.five.scene.children.includes(this.group)||this.five.scene.add(this.group),this.group.traverse(e=>{var n;(n=e==null?void 0:e.updateTagCss3DObjectMatrix)==null||n.call(e)}),this.updateRenderAllTags(),this.five.needsRender=!0}handleDisable(){var e,n,s;this.pauseCurrentMedia(),this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),this.five.scene.remove(this.group),(s=this.TagContainerSvelte)==null||s.$set({tags:[]}),this.filterCSS3DTag.forEach(o=>{var r;(r=o.tag3DContentSvelte)==null||r.dispose(),o.tag3DContentSvelte=void 0}),this.five.needsRender=!0}addEventListener(){const{five:e,hooks:n}=this,s=this.handleFiveWantsMoveToPano.bind(this),o=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),h=this.five.currentMode;return h&&this.handleFiveModeChange(h),this.handleFivePanoArrived(),e.on("wantsMoveToPano",s),e.on("modeChange",o),e.on("initAnimationEnded",this.handleFiveInitAnimationEnded),e.on("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),e.on("panoArrived",c),n.on("click",d),()=>{e.off("wantsMoveToPano",s),e.off("modeChange",o),e.off("initAnimationEnded",this.handleFiveInitAnimationEnded),e.off("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),e.off("panoArrived",c),n.off("click",d),this.store.eventListenerDisposer=void 0}}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())},s=()=>{this.state.enabled&&this.hide()},{observe:o,unobserve:r}=Bd(jb(()=>{this.store.resizeObserverDisposer&&s()},500),e),{observe:a,unobserve:l}=Bd(Od(()=>n(),400),e);return o(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.setModelMedialVisible(),this.tags.forEach(n=>{ft(n)&&e!=="Panorama"&&this.changeTagMode(n,"behind"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags()}handleFiveWantsMoveToPano(){this.tags.forEach(e=>{const n=this.getTagConfig(e);typeof n.visibleConfig=="object"&&(n.visibleConfig.keep?e.temporaryState=we(F({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=we(F({},e.temporaryState),{visible:!!n.visibleConfig.alwaysShowWhenMovePano}))}),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),s=this.can("unfold",e.tag);n&&s&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(o=>{o.id!==e.tag.id&&o.state&&this.can("fold",o)&&(o.state.unfolded=!1)}),this.updateRenderAllTags())}handleFiveCameraUpdateDebounce(){return Od(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return Y(this,null,function*(){var e,n,s;this.setModelMedialVisible(),yield this.setVisibleAndUnfolded(),this.tags.forEach(o=>{o.temporaryState=we(F({},o.temporaryState),{visible:!0})}),(s=(n=(e=this.config)==null?void 0:e.globalConfig)==null?void 0:n.modelConfig)!=null&&s.autoLookAtEnabled&&this.tags.filter(Sb).filter(o=>{var r,a;return(a=(r=o.config)==null?void 0:r.modelConfig)==null?void 0:a.autoLookAtEnabled}).forEach(o=>{var u;const r=new E.Mesh(new E.BoxGeometry,new E.MeshBasicMaterial),a=(u=o.model)==null?void 0:u.object;if(!a)return;r.position.copy(a.position),r.quaternion.copy(a.quaternion);const l=this.five.camera.position;r.lookAt(l.clone().setY(r.position.y));const c=a.quaternion.clone(),d=r.quaternion.clone(),h=ws();h.onUpdate(({progress:m})=>{a.quaternion.copy(c.clone().slerp(d,m))}),h.play()}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible(),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const s=this.getUnfoldedByCamera(n);n.state&&s!==void 0&&(s===!0&&(e=!0),n.state.unfolded=s)}),e&&this.tags.forEach(n=>{const s=this.getTagConfig(n).unfoldedConfig;typeof s=="object"&&(s.autoUnfold||s.keep)||n.state&&(n.state.unfolded=!1)})}changeTagMode(e,n){var s,o,r,a,l,c;((s=this.getTagConfig(e))==null?void 0:s.renderType)!=="Mesh"&&((a=(r=(o=e.tag3DContentSvelte)==null?void 0:o.css3DInstance)==null?void 0:r.css3DObject)==null?void 0:a.mode)!==n&&((l=e.config)!=null&&l.tag3DConfig?e.config.tag3DConfig.mode=n:e.config?e.config.tag3DConfig={mode:n}:e.config={tag3DConfig:{mode:n}},(c=this.store.css3DRenderDisposer.get(e.id))==null||c.forEach(d=>d==null?void 0:d()),e.tag3DContentSvelte=void 0)}}var Pu=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(Pu||{}),Iu=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.Sticker="Sticker",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.MediaModel="MediaModel",i.Model="Model",i.Custom="Custom",i.Unknown="Unknown",i))(Iu||{}),Eu=(i=>(i.Two="2D",i.Three="3D",i))(Eu||{});const ZP=(i,t)=>new po(i,t);function KP(i){he(i,"svelte-1jku181",".guide-line__tag.svelte-1jku181.svelte-1jku181{position:relative}.text-with-distance.svelte-1jku181.svelte-1jku181{display:flex;flex-direction:column;position:relative;padding:0.125rem 0.25rem;border-radius:0.125rem;background:linear-gradient(to top, rgba(147, 147, 147, 0.3), rgba(74, 74, 74, 0.3));box-shadow:0 0.125rem 0.5rem 0 rgba(0, 0, 0, 0.2)}.text-with-distance.svelte-1jku181 .border.svelte-1jku181{position:absolute;top:0;right:0;bottom:0;left:0;padding:0.0625rem;border-radius:0.125rem;background:linear-gradient(to right, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.2));-webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);mask-composite:exclude;-webkit-mask-composite:xor}.distance-and-name.svelte-1jku181.svelte-1jku181{display:flex;gap:0.1875rem}.distance.svelte-1jku181.svelte-1jku181{white-space:nowrap;font-size:0.625rem;line-height:0.875rem;color:#66afff}.name.svelte-1jku181.svelte-1jku181{opacity:0.6;font-size:0.625rem;line-height:0.875rem;white-space:nowrap;color:#ffffff}.line-name.svelte-1jku181.svelte-1jku181{color:#fff;white-space:nowrap;font-size:0.625rem;line-height:0.875rem}.guide-line__tag-point.svelte-1jku181.svelte-1jku181{position:absolute;left:50%;bottom:0.0625rem;width:0.4375rem;height:0.125rem;transform:translateX(-50%);background:#fff;border-radius:50%;opacity:0.5}.guide-line__tag-line.svelte-1jku181.svelte-1jku181{position:absolute;left:50%;bottom:0.0625rem;width:0.0625rem;height:1.875rem;transform:translateX(-50%);background:linear-gradient(to top, #fff, rgba(255, 255, 255, 0))}.guide-line__tag-content.svelte-1jku181.svelte-1jku181{position:absolute;left:-0.9375rem;bottom:1.9375rem;display:flex}.guide-line__tag-icon.svelte-1jku181.svelte-1jku181{width:1.875rem;height:1.875rem;background-size:100%}.guide-line__tag-text.svelte-1jku181.svelte-1jku181{box-sizing:content-box;height:0.875rem;width:-moz-max-content;width:max-content;margin-top:0.3125rem;transform:translateX(-0.1875rem);white-space:nowrap;font-size:0.625rem;line-height:0.875rem;border:solid transparent;border-width:0.125rem 0.5rem 0.125rem 0.375rem;border-image-source:url('https://vrlab-static.ljcdn.com/release/web/jsl/test2.2ea9ddee.png');border-image-slice:6 25 6 18 fill;color:#fff}")}function ku(i){let t,e;return{c(){t=S("div"),e=Te(i[0]),y(t,"class","guide-line__tag-text svelte-1jku181"),j(t,"border-image-source",`url(${i[6]})`)},m(n,s){O(n,t,s),D(t,e)},p(n,s){s&1&&Oe(e,n[0])},d(n){n&&V(t)}}}function xu(i){let t,e,n,s,o=i[5]("全程")+"",r,a,l=i[5]("米")+"",c,d,h,u,m,g,v=i[4]&&Mu(i);return{c(){t=S("div"),v&&v.c(),e=ee(),n=S("div"),s=S("span"),r=Te(o),a=Te(i[2]),c=Te(l),d=ee(),h=S("span"),u=Te(i[0]),m=ee(),g=S("div"),y(s,"class","distance svelte-1jku181"),y(h,"class","name svelte-1jku181"),y(n,"class","distance-and-name svelte-1jku181"),y(g,"class","border svelte-1jku181"),y(t,"class","text-with-distance svelte-1jku181")},m(p,b){O(p,t,b),v&&v.m(t,null),D(t,e),D(t,n),D(n,s),D(s,r),D(s,a),D(s,c),D(n,d),D(n,h),D(h,u),D(t,m),D(t,g)},p(p,b){p[4]?v?v.p(p,b):(v=Mu(p),v.c(),v.m(t,e)):v&&(v.d(1),v=null),b&32&&o!==(o=p[5]("全程")+"")&&Oe(r,o),b&4&&Oe(a,p[2]),b&32&&l!==(l=p[5]("米")+"")&&Oe(c,l),b&1&&Oe(u,p[0])},d(p){p&&V(t),v&&v.d()}}}function Mu(i){let t,e;return{c(){t=S("span"),e=Te(i[4]),y(t,"class","line-name svelte-1jku181")},m(n,s){O(n,t,s),D(t,e)},p(n,s){s&16&&Oe(e,n[4])},d(n){n&&V(t)}}}function $P(i){let t,e,n,s,o,r,a,l,c,d=i[0]&&!i[2]&&ku(i),h=i[2]&&xu(i);return{c(){t=S("div"),e=S("div"),n=ee(),s=S("div"),o=ee(),r=S("div"),a=S("div"),l=ee(),d&&d.c(),c=ee(),h&&h.c(),y(e,"class","guide-line__tag-point svelte-1jku181"),y(s,"class","guide-line__tag-line svelte-1jku181"),y(a,"class","guide-line__tag-icon svelte-1jku181"),j(a,"background-image",`url(${i[1]})`),y(r,"class","guide-line__tag-content svelte-1jku181"),y(t,"class","guide-line__tag svelte-1jku181"),j(t,"opacity",i[3])},m(u,m){O(u,t,m),D(t,e),D(t,n),D(t,s),D(t,o),D(t,r),D(r,a),D(r,l),d&&d.m(r,null),D(r,c),h&&h.m(r,null)},p(u,[m]){m&2&&j(a,"background-image",`url(${u[1]})`),u[0]&&!u[2]?d?d.p(u,m):(d=ku(u),d.c(),d.m(r,c)):d&&(d.d(1),d=null),u[2]?h?h.p(u,m):(h=xu(u),h.c(),h.m(r,null)):h&&(h.d(1),h=null),m&8&&j(t,"opacity",u[3])},i:J,o:J,d(u){u&&V(t),d&&d.d(),h&&h.d()}}}function e2(i,t,e){let{text:n=""}=t,{icon_url:s=""}=t,{distance:o=0}=t,{opacity:r=1}=t,{name:a=""}=t,{i18n:l=d=>d}=t;const c="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHUAAAA2CAMAAADOFiZMAAACEFBMVEUAAACIiIheXl5oaGh6enpsbGxiYmJ9fX1wcHBXV1eBgYFzc3NSUlKNjY2Dg4NOTk51dXVXV1dmZmZTU1N3d3dcXFyMjIyEhIRNTU2QkJC0tLS5ubnHx8fOzs6np6exsbHKysqoqKi9vb3U1NTPz8/Nzc2vr6/Dw8OysrK/v7/X19fS0tKurq62traqqqrJycmurq64uLifn5/Dw8O6urqQkJC6urro6Ojt7e3o6OjU1NS3t7fBwcGjo6Ozs7Orq6u1tbXAwMCurq6rq6vy8vLx8fHr6+vp6enZ2dnd3d3a2trX19fV1dW/v7/IyMihoaGampqVlZWLi4uCgoK+vr6urq7m5ubw8PDk5OTu7u7i4uLg4ODe3t7q6urS0tLi4uLOzs7e3t7Hx8fa2tqrq6vExMTAwMCnp6efn5+WlpaHh4ezs7OoqKiJiYm6urqZmZmurq59fX29vb23t7e4uLipqanp6enc3Nza2trW1tbT09Pm5ubj4+PQ0NDg4ODExMTCwsK7u7vBwcG8vLy5ubm8vLy+vr64uLiysrKdnZ3CwsJoaGisrKzHx8ekpKTExMTv7+/i4uLa2trm5ubk5OTLy8vKysrExMTQ0NDX19ecnJzT09N/f3+dnZ12dnaQkJCXl5etra3Pz8+4uLiXl5fGxsaqqqrr6+vQ0NDKysrNzc3W1takpKShoaGsrKysrKyduRZkAAAAsHRSTlMATE1NTExMTUxNTExMTExNTExMTU1MTU1MTICFc313fnl0iIWAe3h3aYqIgXx7eXZzcnFwaGggxLiog4J0dG9mZF82FMfEtK2pkYqKh3x4cm1rZmEmH8G/vry6trOxoZ2clpKOe3ptbWZjYmFgXFpaVlFPSDYlx7CspaSjoJ6akY6HfXt4bGpmY1xUU0g2LSzCuK6lopiWhoF3YmFaVlZUUU5KPyEJCcl/fXNdXFxZUIUrIQsAAAV6SURBVFjDvZj3VxNBEMePBBIOQgmEQGghISSASSBBUQFBVIpUEaR3aVJExN4F6fbee6//opPN2507E3P7fD4+b54z+935zt7lvPsBYbZ5lyXT7R5xms2ppaVpV615eVeuXL48PPzw4YPBwYsX+/vPnT1bW1t75u7p0729PT13urs7O9vbt2/ffurUp1OQ2ts7O7u77/T09PaevnvmTG3t2XPn+vsvDg4+GH5UVjl/SAjGe29La2vr5EFgm4+WlpYDgNfrbW7etQuuKDPTPTIy4nSa4bJ8lKYBV69arXmA1WpN81FamgqYzU6n0+12ZwI+qzPtyvDlR0dPCoGsecW4FEZcShwEyUDIGvtD+DcOZlrzFvcE3qylFXZ1cTqIgGk0K1xRSL84abaWtwl/8KM5kTiok04B2BpAPUWXAoGnQK3gn0xNW90ryDhpafXvJsYlJuoSdRCyTJHqBOxR9IvbUl1/PN5pL9tFR4gTJJmi7N+wl8qf7k33S+YQE0VRJwZz42RogDZcAxx+sTn1jSDho6VFBKAbp9K1XqfXi3oRgmSqQ2AGePziNpfs2GN2lV5Pp+IJkkwIrDFz+Y+Y90h/Yvtz+f0o1YGnc/lVXvshASk8IHUm6ZMIYhI6YAEyqyHkE/n8Kkuh5AX6ZVdBlypJpRJVIgTJ0IluEGCb1BDYCzWFx79h/yl5ZV3PVUSVAQIDFhCyLO/h9E9KfuOPriOqzUFjmRYYueOqTWLGfhPfHZcGrkOlgcAGskZdAV7/eIVA2eN6qZGA3Yhcxxozn3+mkD3ZQ64Z3EnQJEBouMB+Xr+68LpAuTZBOokDoPXfNIK85vZP5AqUreNqdYI6AUINkBrAtUatgaA67mEft38GvxRThWopOAFrBbj9kYXsa3z0mnrTsLAHe3yRzxGhjoBQ0BT848foqfONkT6FAAWrce3PeEpA5vZPsDf23aIhgpfIiEiIiH/mKftPfKJxTjaNv8bM6zlSzk5dmIsMDk7EGrMEbj+e+q5xLjoyOrQbGiCCaZh5/PgLzy8YiIrgNPmaZtQovP6J3ezNafTvxEfHQ2An8v/2K47hV4J0ExVBDbNCD4e/nH0lKj1+1RBvMEQboiEMUJI1BOmmGq0pVOP1z3nYF3G53EAIN4SHx4djNyxAkutQA1QnGeD2z3rY199RIZ+EtVxDPaDm9VdspYcWj65pteFaonIDBghpzeXyzNNTbyy8CpgCyCehjnvYx+uf9RTTU9cbo7SbRPmKQBnzaKMI2igthD8jVAvIuM/rXytjfyz4MFqBDgLWPGuA05/sqRQobaOzsBMbFQsRhaAWco/A6Z92FAuU446wWL+aHJWcHJtMOzEDwWrU+PyvHEcFRlkutELInT4NFiCRGqA6yQDWfH5jWdFegXLL8V3qDIsNIySHoRsWIGMN/wBY8/mXRosFxrrDCE20EwJzCGQ9XP7crBN46AdHbthmkPvluICccLzgchnDjBD/eqaxKOOtIKGyiEzDqSFOCt7D4X/dlHFDkNCWPu3fjTHGQBgpbI06TkeIpuQ37bbltAlSKstM/g6EdYcEr0jJv2rLfrZXkFKcPhVjMsWY0GGSrTn00H7TakbD11sChd7qa+gCSKdJVitpyvWLlab6uifsieKtLk1N7QZWtvpYXl4aGxsrAtIJBQVNWVlZOTkZGRm2z7bHW0q2lJRkZ2c3NOTn19fV19fn5zfAsmQL8Nhmg66cHOhvKigoSC/Iysk+vH9//jd2n8g6TG7yjbXZYCAMq6s7fBiah4aGLl0aGLhw4f758zuBmpq+vurq6h07dnR1dXTcrqqq2uejqup2R0dXF8jV1X19NTU1O3feu3f+/oWBgUtD++uePHtbLAThNzRClbi+VnseAAAAAElFTkSuQmCC";return i.$$set=d=>{"text"in d&&e(0,n=d.text),"icon_url"in d&&e(1,s=d.icon_url),"distance"in d&&e(2,o=d.distance),"opacity"in d&&e(3,r=d.opacity),"name"in d&&e(4,a=d.name),"i18n"in d&&e(5,l=d.i18n)},[n,s,o,r,a,l,c]}class t2 extends ce{constructor(t){super(),le(this,t,e2,$P,ae,{text:0,icon_url:1,distance:2,opacity:3,name:4,i18n:5},KP)}}function n2(i){return i.length===0?[]:i.filter((t,e)=>t!==i[e-1])}const i2=`
|
|
581
|
+
width var(--sc-dot-size-animation-time) ease;cursor:pointer;-webkit-tap-highlight-color:transparent;height:var(--sc-dot-size);width:var(--sc-dot-size)}.sc-carousel-dot__dot.svelte-1mgyhhn:hover{opacity:0.9}.sc-carousel-dot__dot_active.svelte-1mgyhhn{opacity:0.7;height:var(--sc-active-dot-size);width:var(--sc-active-dot-size)}`)}function F1(i){let t,e,n;return{c(){t=S("button"),y(t,"class","sc-carousel-button sc-carousel-dot__dot svelte-1mgyhhn"),$(t,"sc-carousel-dot__dot_active",i[0])},m(s,o){O(s,t,o),e||(n=ye(t,"click",i[1]),e=!0)},p(s,[o]){o&1&&$(t,"sc-carousel-dot__dot_active",s[0])},i:J,o:J,d(s){s&&V(t),e=!1,n()}}}function H1(i,t,e){let{active:n=!1}=t;function s(o){Un.call(this,i,o)}return i.$$set=o=>{"active"in o&&e(0,n=o.active)},[n,s]}class W1 extends ce{constructor(t){super(),le(this,t,H1,F1,ae,{active:0},G1)}}function N1(i){he(i,"svelte-670fde",".sc-carousel-dots__container.svelte-670fde{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;padding:0 30px}.sc-carousel-dots__dot-container.svelte-670fde{height:calc(var(--sc-dot-size) + 14px);width:calc(var(--sc-dot-size) + 10px);display:flex;align-items:center;justify-content:center}")}function rh(i,t,e){const n=i.slice();return n[5]=t[e],n[7]=e,n}function ah(i,t){let e,n,s,o;function r(){return t[3](t[7])}return n=new W1({props:{active:t[1]===t[7]}}),n.$on("click",r),{key:i,first:null,c(){e=S("div"),se(n.$$.fragment),s=ee(),y(e,"class","sc-carousel-dots__dot-container svelte-670fde"),this.first=e},m(a,l){O(a,e,l),ne(n,e,null),D(e,s),o=!0},p(a,l){t=a;const c={};l&3&&(c.active=t[1]===t[7]),n.$set(c)},i(a){o||(x(n.$$.fragment,a),o=!0)},o(a){z(n.$$.fragment,a),o=!1},d(a){a&&V(e),ie(n)}}}function Y1(i){let t,e=[],n=new Map,s,o=Array(i[0]);const r=a=>a[7];for(let a=0;a<o.length;a+=1){let l=rh(i,o,a),c=r(l);n.set(c,e[a]=ah(c,l))}return{c(){t=S("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","sc-carousel-dots__container svelte-670fde")},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(a,[l]){l&7&&(o=Array(a[0]),ue(),e=St(e,l,r,1,a,o,n,t,dn,ah,null,rh),fe())},i(a){if(!s){for(let l=0;l<o.length;l+=1)x(e[l]);s=!0}},o(a){for(let l=0;l<e.length;l+=1)z(e[l]);s=!1},d(a){a&&V(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function X1(i,t,e){const n=Ds();let{pagesCount:s=1}=t,{currentPageIndex:o=0}=t;function r(l){n("pageChange",l)}const a=l=>r(l);return i.$$set=l=>{"pagesCount"in l&&e(0,s=l.pagesCount),"currentPageIndex"in l&&e(1,o=l.currentPageIndex)},[s,o,r,a]}class U1 extends ce{constructor(t){super(),le(this,t,X1,Y1,ae,{pagesCount:0,currentPageIndex:1},N1)}}const ci="prev",mn="next";function q1(i){he(i,"svelte-1bftafx",":root{--sc-arrow-size:2px}.sc-carousel-arrow__circle.svelte-1bftafx{width:20px;height:20px;border-radius:50%;background-color:var(--sc-color-rgb-light-50p);display:flex;align-items:center;justify-content:center;transition:opacity 100ms ease;cursor:pointer;-webkit-tap-highlight-color:transparent}.sc-carousel-arrow__circle.svelte-1bftafx:hover{opacity:0.9}.sc-carousel-arrow__arrow.svelte-1bftafx{border:solid var(--sc-color-hex-dark);border-width:0 var(--sc-arrow-size) var(--sc-arrow-size) 0;padding:var(--sc-arrow-size);position:relative}.sc-carousel-arrow__arrow-next.svelte-1bftafx{transform:rotate(-45deg);left:calc(var(--sc-arrow-size) / -2)}.sc-carousel-arrow__arrow-prev.svelte-1bftafx{transform:rotate(135deg);right:calc(var(--sc-arrow-size) / -2)}.sc-carousel-arrow__circle_disabled.svelte-1bftafx,.sc-carousel-arrow__circle_disabled.svelte-1bftafx:hover{opacity:0.5}")}function J1(i){let t,e,n,s;return{c(){t=S("button"),e=S("i"),y(e,"class","sc-carousel-arrow__arrow svelte-1bftafx"),$(e,"sc-carousel-arrow__arrow-next",i[0]===mn),$(e,"sc-carousel-arrow__arrow-prev",i[0]===ci),y(t,"class","sc-carousel-button sc-carousel-arrow__circle svelte-1bftafx"),$(t,"sc-carousel-arrow__circle_disabled",i[1])},m(o,r){O(o,t,r),D(t,e),n||(s=ye(t,"click",i[2]),n=!0)},p(o,[r]){r&1&&$(e,"sc-carousel-arrow__arrow-next",o[0]===mn),r&1&&$(e,"sc-carousel-arrow__arrow-prev",o[0]===ci),r&2&&$(t,"sc-carousel-arrow__circle_disabled",o[1])},i:J,o:J,d(o){o&&V(t),n=!1,s()}}}function Z1(i,t,e){let{direction:n=mn}=t,{disabled:s=!1}=t;function o(r){Un.call(this,i,r)}return i.$$set=r=>{"direction"in r&&e(0,n=r.direction),"disabled"in r&&e(1,s=r.disabled)},[n,s,o]}class lh extends ce{constructor(t){super(),le(this,t,Z1,J1,ae,{direction:0,disabled:1},q1)}}function K1(i){he(i,"svelte-i7yfid",".sc-carousel-progress__indicator.svelte-i7yfid{height:100%;background-color:var(--sc-color-hex-dark-50p)}")}function $1(i){let t;return{c(){t=S("div"),y(t,"class","sc-carousel-progress__indicator svelte-i7yfid"),j(t,"width",i[0]+"%")},m(e,n){O(e,t,n)},p(e,[n]){n&1&&j(t,"width",e[0]+"%")},i:J,o:J,d(e){e&&V(t)}}}const ch=100;function ey(i,t,e){let n,{value:s=0}=t;return i.$$set=o=>{"value"in o&&e(1,s=o.value)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Math.min(Math.max(s*ch,0),ch))},[n,s]}class ty extends ce{constructor(t){super(),le(this,t,ey,$1,ae,{value:1},K1)}}function ny(i,t){i.addEventListener("mousedown",t),i.addEventListener("touchstart",t,{passive:!0})}function iy(i,t){i.removeEventListener("mousedown",t),i.removeEventListener("touchstart",t)}function sy(i,t){i.addEventListener("mouseup",t),i.addEventListener("touchend",t)}function dh(i,t){i.removeEventListener("mouseup",t),i.removeEventListener("touchend",t)}function oy(i,t){i.addEventListener("mousemove",t),i.addEventListener("touchmove",t)}function hh(i,t){i.removeEventListener("mousemove",t),i.removeEventListener("touchmove",t)}function Or(i){return function(t,e){i.dispatchEvent(new CustomEvent(t,{detail:e}))}}const ry=110,ay=9,ly=111,cy=20;function Br(i){if("TouchEvent"in window&&i instanceof TouchEvent){const t=i.touches[0];return{x:t?t.clientX:0,y:t?t.clientY:0}}return{x:i.clientX,y:i.clientY}}function dy(i,{thresholdProvider:t}){const e=Or(i);let n,s,o=0,r,a=!1;function l(){return Date.now()-r>=ly&&Math.abs(o)>=cy}function c(u){r=Date.now(),o=0,a=!0;const m=Br(u);n=m.x,s=m.y,e("swipeStart",{x:n,y:s}),oy(window,d),sy(window,h)}function d(u){if(!a)return;const m=Br(u),g=m.x-n,v=m.y-s;n=m.x,s=m.y,e("swipeMove",{x:n,y:s,dx:g,dy:v}),g!==0&&Math.sign(g)!==Math.sign(o)&&(o=0),o+=g,Math.abs(o)>t()&&(e("swipeThresholdReached",{direction:o>0?ci:mn}),dh(window,h),hh(window,d))}function h(u){if(dh(window,h),hh(window,d),a=!1,!l()){e("swipeFailed");return}const m=Br(u);e("swipeEnd",{x:m.x,y:m.y})}return ny(i,c),{destroy(){iy(i,c)}}}function hy(i,t){i.addEventListener("mouseenter",t)}function uy(i,t){i.removeEventListener("mouseenter",t)}function fy(i,t){i.addEventListener("mouseleave",t)}function uh(i,t){i.removeEventListener("mouseleave",t)}function my(i){const t=Or(i);function e(){fy(i,n),t("hovered",{value:!0})}function n(){t("hovered",{value:!1}),uh(i,n)}return hy(i,e),{destroy(){uy(i,e),uh(i,n)}}}const py=(i,t)=>{const e=t.x-i.x,n=t.y-i.y;return Math.sqrt(e*e+n*n)};function di(i,t,e){return Math.max(i,Math.min(t,e))}function gy(i,t){i.addEventListener("touchstart",t,{passive:!0})}function vy(i,t){i.removeEventListener("touchstart",t)}function Ay(i,t){i.addEventListener("touchend",t)}function fh(i,t){i.removeEventListener("touchend",t)}function by(i){const t=Or(i);let e=0,n={x:0,y:0};function s({tapEndedAt:a,tapEndedPos:l}){const c=a-e,d=py(n,l);return c<=ry&&d<=ay}function o(a){e=Date.now();const l=a.touches[0];n={x:l.clientX,y:l.clientY},Ay(i,r)}function r(a){fh(i,r);const l=a.changedTouches[0];s({tapEndedAt:Date.now(),tapEndedPos:{x:l.clientX,y:l.clientY}})&&t("tapped")}return gy(i,o),{destroy(){vy(i,o),fh(i,r)}}}function yy({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:s}){return i===t-e?0:i===0?mh({particlesCountWithoutClones:t-n,particlesToScroll:s})-1:Math.floor((i-e)/s)}function wy({currentParticleIndex:i,particlesToScroll:t}){return Math.ceil(i/t)}function Cy({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,infinite:s,particlesToScroll:o}){return s?yy({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:o}):wy({currentParticleIndex:i,particlesToScroll:o})}function mh({particlesCountWithoutClones:i,particlesToScroll:t}){return Math.ceil(i/t)}function Py({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e}){const n=ph({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e});return Math.ceil(i/t)-n}function Iy({infinite:i,particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n}){return i?mh({particlesCountWithoutClones:t,particlesToScroll:e}):Py({particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n})}function Ey({pageIndex:i,clonesCountHead:t,clonesCountTail:e,particlesToScroll:n,particlesCount:s}){return di(0,Math.min(t+i*n,s-e),s-1)}function ky({pageIndex:i,particlesToScroll:t,particlesCount:e,particlesToShow:n}){return di(0,Math.min(i*t,e-n),e-1)}function _r({infinite:i,pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:s,particlesCount:o,particlesToShow:r}){return i?Ey({pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:s,particlesCount:o}):ky({pageIndex:t,particlesToScroll:s,particlesCount:o,particlesToShow:r})}function xy({particlesContainerChildren:i,particleWidth:t}){for(let e=0;e<i.length;e++)i[e].style.minWidth=`${t}px`,i[e].style.maxWidth=`${t}px`}function ph({particlesToScroll:i,particlesToShow:t,particlesCountWithoutClones:e}){const n=i-t;let s=t;for(;;){const o=e-s-n;if(o<t)return Math.max(o,0);s+=t+n}}function My(i){return new ResizeObserver(t=>{i({width:t[0].contentRect.width})})}function Sy({clonesCountHead:i,clonesCountTail:t,particlesContainerChildren:e}){const n=[];for(let r=0;r<t;r++)n.push(e[r].cloneNode(!0));const s=[],o=e.length;for(let r=o-1;r>o-1-i;r--)s.push(e[r].cloneNode(!0));return{clonesToAppend:n,clonesToPrepend:s}}function Dy({particlesContainer:i,clonesToAppend:t,clonesToPrepend:e}){for(let n=0;n<t.length;n++)i.append(t[n]);for(let n=0;n<e.length;n++)i.prepend(e[n])}function Ly({infinite:i,particlesToShow:t,partialPageSize:e}){const n=i?{head:Math.ceil(e||t),tail:Math.ceil(t)}:{head:0,tail:0};return we(F({},n),{total:n.head+n.tail})}const Ni=(i,t,e)=>{if(i&&i.hasOwnProperty(t))return i[t];if(e===void 0)throw new Error(`Required arg "${t}" was not provided`);return e},Qr=i=>t=>{i[t]&&i[t]()};var Ty="Expected a function",gh="__lodash_hash_undefined__",vh=1/0,zy="[object Function]",jy="[object GeneratorFunction]",Vy="[object Symbol]",Oy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,By=/^\w*$/,_y=/^\./,Qy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ry=/[\\^$.*+?()[\]{}|]/g,Gy=/\\(\\)?/g,Fy=/^\[object .+?Constructor\]$/,Hy=typeof Pt=="object"&&Pt&&Pt.Object===Object&&Pt,Wy=typeof self=="object"&&self&&self.Object===Object&&self,Rr=Hy||Wy||Function("return this")();function Ny(i,t){return i==null?void 0:i[t]}function Yy(i){var t=!1;if(i!=null&&typeof i.toString!="function")try{t=!!(i+"")}catch(e){}return t}var Xy=Array.prototype,Uy=Function.prototype,Ah=Object.prototype,Gr=Rr["__core-js_shared__"],bh=function(){var i=/[^.]+$/.exec(Gr&&Gr.keys&&Gr.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),yh=Uy.toString,Fr=Ah.hasOwnProperty,wh=Ah.toString,qy=RegExp("^"+yh.call(Fr).replace(Ry,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ch=Rr.Symbol,Jy=Xy.splice,Zy=Eh(Rr,"Map"),Yi=Eh(Object,"create"),Ph=Ch?Ch.prototype:void 0,Ih=Ph?Ph.toString:void 0;function xn(i){var t=-1,e=i?i.length:0;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function Ky(){this.__data__=Yi?Yi(null):{}}function $y(i){return this.has(i)&&delete this.__data__[i]}function ew(i){var t=this.__data__;if(Yi){var e=t[i];return e===gh?void 0:e}return Fr.call(t,i)?t[i]:void 0}function tw(i){var t=this.__data__;return Yi?t[i]!==void 0:Fr.call(t,i)}function nw(i,t){var e=this.__data__;return e[i]=Yi&&t===void 0?gh:t,this}xn.prototype.clear=Ky,xn.prototype.delete=$y,xn.prototype.get=ew,xn.prototype.has=tw,xn.prototype.set=nw;function hi(i){var t=-1,e=i?i.length:0;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function iw(){this.__data__=[]}function sw(i){var t=this.__data__,e=ao(t,i);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():Jy.call(t,e,1),!0}function ow(i){var t=this.__data__,e=ao(t,i);return e<0?void 0:t[e][1]}function rw(i){return ao(this.__data__,i)>-1}function aw(i,t){var e=this.__data__,n=ao(e,i);return n<0?e.push([i,t]):e[n][1]=t,this}hi.prototype.clear=iw,hi.prototype.delete=sw,hi.prototype.get=ow,hi.prototype.has=rw,hi.prototype.set=aw;function Mn(i){var t=-1,e=i?i.length:0;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function lw(){this.__data__={hash:new xn,map:new(Zy||hi),string:new xn}}function cw(i){return lo(this,i).delete(i)}function dw(i){return lo(this,i).get(i)}function hw(i){return lo(this,i).has(i)}function uw(i,t){return lo(this,i).set(i,t),this}Mn.prototype.clear=lw,Mn.prototype.delete=cw,Mn.prototype.get=dw,Mn.prototype.has=hw,Mn.prototype.set=uw;function ao(i,t){for(var e=i.length;e--;)if(Pw(i[e][0],t))return e;return-1}function fw(i,t){t=vw(t,i)?[t]:gw(t);for(var e=0,n=t.length;i!=null&&e<n;)i=i[ww(t[e++])];return e&&e==n?i:void 0}function mw(i){if(!xh(i)||bw(i))return!1;var t=Iw(i)||Yy(i)?qy:Fy;return t.test(Cw(i))}function pw(i){if(typeof i=="string")return i;if(Wr(i))return Ih?Ih.call(i):"";var t=i+"";return t=="0"&&1/i==-vh?"-0":t}function gw(i){return kh(i)?i:yw(i)}function lo(i,t){var e=i.__data__;return Aw(t)?e[typeof t=="string"?"string":"hash"]:e.map}function Eh(i,t){var e=Ny(i,t);return mw(e)?e:void 0}function vw(i,t){if(kh(i))return!1;var e=typeof i;return e=="number"||e=="symbol"||e=="boolean"||i==null||Wr(i)?!0:By.test(i)||!Oy.test(i)||t!=null&&i in Object(t)}function Aw(i){var t=typeof i;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?i!=="__proto__":i===null}function bw(i){return!!bh&&bh in i}var yw=Hr(function(i){i=kw(i);var t=[];return _y.test(i)&&t.push(""),i.replace(Qy,function(e,n,s,o){t.push(s?o.replace(Gy,"$1"):n||e)}),t});function ww(i){if(typeof i=="string"||Wr(i))return i;var t=i+"";return t=="0"&&1/i==-vh?"-0":t}function Cw(i){if(i!=null){try{return yh.call(i)}catch(t){}try{return i+""}catch(t){}}return""}function Hr(i,t){if(typeof i!="function"||t&&typeof t!="function")throw new TypeError(Ty);var e=function(){var n=arguments,s=t?t.apply(this,n):n[0],o=e.cache;if(o.has(s))return o.get(s);var r=i.apply(this,n);return e.cache=o.set(s,r),r};return e.cache=new(Hr.Cache||Mn),e}Hr.Cache=Mn;function Pw(i,t){return i===t||i!==i&&t!==t}var kh=Array.isArray;function Iw(i){var t=xh(i)?wh.call(i):"";return t==zy||t==jy}function xh(i){var t=typeof i;return!!i&&(t=="object"||t=="function")}function Ew(i){return!!i&&typeof i=="object"}function Wr(i){return typeof i=="symbol"||Ew(i)&&wh.call(i)==Vy}function kw(i){return i==null?"":pw(i)}function xw(i,t,e){var n=i==null?void 0:fw(i,t);return n===void 0?e:n}var co=xw,ho={},Mw={get exports(){return ho},set exports(i){ho=i}};(function(i,t){var e=200,n="__lodash_hash_undefined__",s=9007199254740991,o="[object Arguments]",r="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",h="[object GeneratorFunction]",u="[object Map]",m="[object Number]",g="[object Object]",v="[object Promise]",p="[object RegExp]",b="[object Set]",w="[object String]",P="[object Symbol]",k="[object WeakMap]",T="[object ArrayBuffer]",I="[object DataView]",B="[object Float32Array]",L="[object Float64Array]",X="[object Int8Array]",Z="[object Int16Array]",G="[object Int32Array]",R="[object Uint8Array]",H="[object Uint8ClampedArray]",Q="[object Uint16Array]",W="[object Uint32Array]",q=/[\\^$.*+?()[\]{}|]/g,U=/\w*$/,K=/^\[object .+?Constructor\]$/,de=/^(?:0|[1-9]\d*)$/,oe={};oe[o]=oe[r]=oe[T]=oe[I]=oe[a]=oe[l]=oe[B]=oe[L]=oe[X]=oe[Z]=oe[G]=oe[u]=oe[m]=oe[g]=oe[p]=oe[b]=oe[w]=oe[P]=oe[R]=oe[H]=oe[Q]=oe[W]=!0,oe[c]=oe[d]=oe[k]=!1;var Pe=typeof Pt=="object"&&Pt&&Pt.Object===Object&&Pt,Ie=typeof self=="object"&&self&&self.Object===Object&&self,Ae=Pe||Ie||Function("return this")(),Be=t&&!t.nodeType&&t,be=Be&&!0&&i&&!i.nodeType&&i,Ne=be&&be.exports===Be;function me(A,C){return A.set(C[0],C[1]),A}function Ce(A,C){return A.add(C),A}function ze(A,C){for(var M=-1,N=A?A.length:0;++M<N&&C(A[M],M,A)!==!1;);return A}function pe(A,C){for(var M=-1,N=C.length,Ee=A.length;++M<N;)A[Ee+M]=C[M];return A}function Ke(A,C,M,N){var Ee=-1,ge=A?A.length:0;for(N&&ge&&(M=A[++Ee]);++Ee<ge;)M=C(M,A[Ee],Ee,A);return M}function ht(A,C){for(var M=-1,N=Array(A);++M<A;)N[M]=C(M);return N}function Me(A,C){return A==null?void 0:A[C]}function ot(A){var C=!1;if(A!=null&&typeof A.toString!="function")try{C=!!(A+"")}catch(M){}return C}function re(A){var C=-1,M=Array(A.size);return A.forEach(function(N,Ee){M[++C]=[Ee,N]}),M}function xe(A,C){return function(M){return A(C(M))}}function He(A){var C=-1,M=Array(A.size);return A.forEach(function(N){M[++C]=N}),M}var mt=Array.prototype,qt=Function.prototype,yt=Object.prototype,wt=Ae["__core-js_shared__"],_e=function(){var A=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}(),Ge=qt.toString,qe=yt.hasOwnProperty,Dt=yt.toString,Ji=RegExp("^"+Ge.call(qe).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rt=Ne?Ae.Buffer:void 0,gn=Ae.Symbol,Dn=Ae.Uint8Array,pt=xe(Object.getPrototypeOf,Object),mi=Object.create,pi=yt.propertyIsEnumerable,ia=mt.splice,Zi=Object.getOwnPropertySymbols,gi=Rt?Rt.isBuffer:void 0,yo=xe(Object.keys,Object),vi=Tt(Ae,"DataView"),Ln=Tt(Ae,"Map"),Lt=Tt(Ae,"Promise"),Ai=Tt(Ae,"Set"),Ki=Tt(Ae,"WeakMap"),Tn=Tt(Object,"create"),$i=ut(vi),zn=ut(Ln),es=ut(Lt),ts=ut(Ai),ns=ut(Ki),vn=gn?gn.prototype:void 0,wo=vn?vn.valueOf:void 0;function Jt(A){var C=-1,M=A?A.length:0;for(this.clear();++C<M;){var N=A[C];this.set(N[0],N[1])}}function sa(){this.__data__=Tn?Tn(null):{}}function oa(A){return this.has(A)&&delete this.__data__[A]}function ra(A){var C=this.__data__;if(Tn){var M=C[A];return M===n?void 0:M}return qe.call(C,A)?C[A]:void 0}function Co(A){var C=this.__data__;return Tn?C[A]!==void 0:qe.call(C,A)}function is(A,C){var M=this.__data__;return M[A]=Tn&&C===void 0?n:C,this}Jt.prototype.clear=sa,Jt.prototype.delete=oa,Jt.prototype.get=ra,Jt.prototype.has=Co,Jt.prototype.set=is;function $e(A){var C=-1,M=A?A.length:0;for(this.clear();++C<M;){var N=A[C];this.set(N[0],N[1])}}function aa(){this.__data__=[]}function la(A){var C=this.__data__,M=yi(C,A);if(M<0)return!1;var N=C.length-1;return M==N?C.pop():ia.call(C,M,1),!0}function ca(A){var C=this.__data__,M=yi(C,A);return M<0?void 0:C[M][1]}function da(A){return yi(this.__data__,A)>-1}function ha(A,C){var M=this.__data__,N=yi(M,A);return N<0?M.push([A,C]):M[N][1]=C,this}$e.prototype.clear=aa,$e.prototype.delete=la,$e.prototype.get=ca,$e.prototype.has=da,$e.prototype.set=ha;function rt(A){var C=-1,M=A?A.length:0;for(this.clear();++C<M;){var N=A[C];this.set(N[0],N[1])}}function ua(){this.__data__={hash:new Jt,map:new(Ln||$e),string:new Jt}}function fa(A){return Vn(this,A).delete(A)}function ma(A){return Vn(this,A).get(A)}function pa(A){return Vn(this,A).has(A)}function ga(A,C){return Vn(this,A).set(A,C),this}rt.prototype.clear=ua,rt.prototype.delete=fa,rt.prototype.get=ma,rt.prototype.has=pa,rt.prototype.set=ga;function gt(A){this.__data__=new $e(A)}function va(){this.__data__=new $e}function Aa(A){return this.__data__.delete(A)}function ba(A){return this.__data__.get(A)}function ya(A){return this.__data__.has(A)}function wa(A,C){var M=this.__data__;if(M instanceof $e){var N=M.__data__;if(!Ln||N.length<e-1)return N.push([A,C]),this;M=this.__data__=new rt(N)}return M.set(A,C),this}gt.prototype.clear=va,gt.prototype.delete=Aa,gt.prototype.get=ba,gt.prototype.has=ya,gt.prototype.set=wa;function bi(A,C){var M=as(A)||Ci(A)?ht(A.length,String):[],N=M.length,Ee=!!N;for(var ge in A)(C||qe.call(A,ge))&&!(Ee&&(ge=="length"||Va(ge,N)))&&M.push(ge);return M}function Po(A,C,M){var N=A[C];(!(qe.call(A,C)&&Mo(N,M))||M===void 0&&!(C in A))&&(A[C]=M)}function yi(A,C){for(var M=A.length;M--;)if(Mo(A[M][0],C))return M;return-1}function Gt(A,C){return A&&rs(C,cs(C),A)}function ss(A,C,M,N,Ee,ge,Se){var Le;if(N&&(Le=ge?N(A,Ee,ge,Se):N(A)),Le!==void 0)return Le;if(!Ht(A))return A;var Ye=as(A);if(Ye){if(Le=za(A),!C)return Da(A,Le)}else{var Ve=Kt(A),at=Ve==d||Ve==h;if(So(A))return wi(A,C);if(Ve==g||Ve==o||at&&!ge){if(ot(A))return ge?A:{};if(Le=Ft(at?{}:A),!C)return La(A,Gt(Le,A))}else{if(!oe[Ve])return ge?A:{};Le=ja(A,Ve,ss,C)}}Se||(Se=new gt);var vt=Se.get(A);if(vt)return vt;if(Se.set(A,Le),!Ye)var Xe=M?Ta(A):cs(A);return ze(Xe||A,function(lt,et){Xe&&(et=lt,lt=A[et]),Po(Le,et,ss(lt,C,M,N,et,A,Se))}),Le}function Ca(A){return Ht(A)?mi(A):{}}function Pa(A,C,M){var N=C(A);return as(A)?N:pe(N,M(A))}function Ia(A){return Dt.call(A)}function Ea(A){if(!Ht(A)||Ba(A))return!1;var C=ls(A)||ot(A)?Ji:K;return C.test(ut(A))}function ka(A){if(!ko(A))return yo(A);var C=[];for(var M in Object(A))qe.call(A,M)&&M!="constructor"&&C.push(M);return C}function wi(A,C){if(C)return A.slice();var M=new A.constructor(A.length);return A.copy(M),M}function os(A){var C=new A.constructor(A.byteLength);return new Dn(C).set(new Dn(A)),C}function jn(A,C){var M=C?os(A.buffer):A.buffer;return new A.constructor(M,A.byteOffset,A.byteLength)}function Io(A,C,M){var N=C?M(re(A),!0):re(A);return Ke(N,me,new A.constructor)}function Eo(A){var C=new A.constructor(A.source,U.exec(A));return C.lastIndex=A.lastIndex,C}function xa(A,C,M){var N=C?M(He(A),!0):He(A);return Ke(N,Ce,new A.constructor)}function Ma(A){return wo?Object(wo.call(A)):{}}function Sa(A,C){var M=C?os(A.buffer):A.buffer;return new A.constructor(M,A.byteOffset,A.length)}function Da(A,C){var M=-1,N=A.length;for(C||(C=Array(N));++M<N;)C[M]=A[M];return C}function rs(A,C,M,N){M||(M={});for(var Ee=-1,ge=C.length;++Ee<ge;){var Se=C[Ee],Le=N?N(M[Se],A[Se],Se,M,A):void 0;Po(M,Se,Le===void 0?A[Se]:Le)}return M}function La(A,C){return rs(A,Zt(A),C)}function Ta(A){return Pa(A,cs,Zt)}function Vn(A,C){var M=A.__data__;return Oa(C)?M[typeof C=="string"?"string":"hash"]:M.map}function Tt(A,C){var M=Me(A,C);return Ea(M)?M:void 0}var Zt=Zi?xe(Zi,Object):Qa,Kt=Ia;(vi&&Kt(new vi(new ArrayBuffer(1)))!=I||Ln&&Kt(new Ln)!=u||Lt&&Kt(Lt.resolve())!=v||Ai&&Kt(new Ai)!=b||Ki&&Kt(new Ki)!=k)&&(Kt=function(A){var C=Dt.call(A),M=C==g?A.constructor:void 0,N=M?ut(M):void 0;if(N)switch(N){case $i:return I;case zn:return u;case es:return v;case ts:return b;case ns:return k}return C});function za(A){var C=A.length,M=A.constructor(C);return C&&typeof A[0]=="string"&&qe.call(A,"index")&&(M.index=A.index,M.input=A.input),M}function Ft(A){return typeof A.constructor=="function"&&!ko(A)?Ca(pt(A)):{}}function ja(A,C,M,N){var Ee=A.constructor;switch(C){case T:return os(A);case a:case l:return new Ee(+A);case I:return jn(A,N);case B:case L:case X:case Z:case G:case R:case H:case Q:case W:return Sa(A,N);case u:return Io(A,N,M);case m:case w:return new Ee(A);case p:return Eo(A);case b:return xa(A,N,M);case P:return Ma(A)}}function Va(A,C){return C=C==null?s:C,!!C&&(typeof A=="number"||de.test(A))&&A>-1&&A%1==0&&A<C}function Oa(A){var C=typeof A;return C=="string"||C=="number"||C=="symbol"||C=="boolean"?A!=="__proto__":A===null}function Ba(A){return!!_e&&_e in A}function ko(A){var C=A&&A.constructor,M=typeof C=="function"&&C.prototype||yt;return A===M}function ut(A){if(A!=null){try{return Ge.call(A)}catch(C){}try{return A+""}catch(C){}}return""}function xo(A){return ss(A,!0,!0)}function Mo(A,C){return A===C||A!==A&&C!==C}function Ci(A){return _a(A)&&qe.call(A,"callee")&&(!pi.call(A,"callee")||Dt.call(A)==o)}var as=Array.isArray;function Pi(A){return A!=null&&Do(A.length)&&!ls(A)}function _a(A){return Lo(A)&&Pi(A)}var So=gi||Ra;function ls(A){var C=Ht(A)?Dt.call(A):"";return C==d||C==h}function Do(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function Ht(A){var C=typeof A;return!!A&&(C=="object"||C=="function")}function Lo(A){return!!A&&typeof A=="object"}function cs(A){return Pi(A)?bi(A):ka(A)}function Qa(){return[]}function Ra(){return!1}i.exports=xo})(Mw,ho);const Sw=ho;var uo={},Dw={get exports(){return uo},set exports(i){uo=i}};(function(i,t){var e=200,n="__lodash_hash_undefined__",s=1,o=2,r=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",d="[object Boolean]",h="[object Date]",u="[object Error]",m="[object Function]",g="[object GeneratorFunction]",v="[object Map]",p="[object Number]",b="[object Null]",w="[object Object]",P="[object Promise]",k="[object Proxy]",T="[object RegExp]",I="[object Set]",B="[object String]",L="[object Symbol]",X="[object Undefined]",Z="[object WeakMap]",G="[object ArrayBuffer]",R="[object DataView]",H="[object Float32Array]",Q="[object Float64Array]",W="[object Int8Array]",q="[object Int16Array]",U="[object Int32Array]",K="[object Uint8Array]",de="[object Uint8ClampedArray]",oe="[object Uint16Array]",Pe="[object Uint32Array]",Ie=/[\\^$.*+?()[\]{}|]/g,Ae=/^\[object .+?Constructor\]$/,Be=/^(?:0|[1-9]\d*)$/,be={};be[H]=be[Q]=be[W]=be[q]=be[U]=be[K]=be[de]=be[oe]=be[Pe]=!0,be[a]=be[l]=be[G]=be[d]=be[R]=be[h]=be[u]=be[m]=be[v]=be[p]=be[w]=be[T]=be[I]=be[B]=be[Z]=!1;var Ne=typeof Pt=="object"&&Pt&&Pt.Object===Object&&Pt,me=typeof self=="object"&&self&&self.Object===Object&&self,Ce=Ne||me||Function("return this")(),ze=t&&!t.nodeType&&t,pe=ze&&!0&&i&&!i.nodeType&&i,Ke=pe&&pe.exports===ze,ht=Ke&&Ne.process,Me=function(){try{return ht&&ht.binding&&ht.binding("util")}catch(A){}}(),ot=Me&&Me.isTypedArray;function re(A,C){for(var M=-1,N=A==null?0:A.length,Ee=0,ge=[];++M<N;){var Se=A[M];C(Se,M,A)&&(ge[Ee++]=Se)}return ge}function xe(A,C){for(var M=-1,N=C.length,Ee=A.length;++M<N;)A[Ee+M]=C[M];return A}function He(A,C){for(var M=-1,N=A==null?0:A.length;++M<N;)if(C(A[M],M,A))return!0;return!1}function mt(A,C){for(var M=-1,N=Array(A);++M<A;)N[M]=C(M);return N}function qt(A){return function(C){return A(C)}}function yt(A,C){return A.has(C)}function wt(A,C){return A==null?void 0:A[C]}function _e(A){var C=-1,M=Array(A.size);return A.forEach(function(N,Ee){M[++C]=[Ee,N]}),M}function Ge(A,C){return function(M){return A(C(M))}}function qe(A){var C=-1,M=Array(A.size);return A.forEach(function(N){M[++C]=N}),M}var Dt=Array.prototype,Ji=Function.prototype,Rt=Object.prototype,gn=Ce["__core-js_shared__"],Dn=Ji.toString,pt=Rt.hasOwnProperty,mi=function(){var A=/[^.]+$/.exec(gn&&gn.keys&&gn.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}(),pi=Rt.toString,ia=RegExp("^"+Dn.call(pt).replace(Ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zi=Ke?Ce.Buffer:void 0,gi=Ce.Symbol,yo=Ce.Uint8Array,vi=Rt.propertyIsEnumerable,Ln=Dt.splice,Lt=gi?gi.toStringTag:void 0,Ai=Object.getOwnPropertySymbols,Ki=Zi?Zi.isBuffer:void 0,Tn=Ge(Object.keys,Object),$i=Zt(Ce,"DataView"),zn=Zt(Ce,"Map"),es=Zt(Ce,"Promise"),ts=Zt(Ce,"Set"),ns=Zt(Ce,"WeakMap"),vn=Zt(Object,"create"),wo=ut($i),Jt=ut(zn),sa=ut(es),oa=ut(ts),ra=ut(ns),Co=gi?gi.prototype:void 0,is=Co?Co.valueOf:void 0;function $e(A){var C=-1,M=A==null?0:A.length;for(this.clear();++C<M;){var N=A[C];this.set(N[0],N[1])}}function aa(){this.__data__=vn?vn(null):{},this.size=0}function la(A){var C=this.has(A)&&delete this.__data__[A];return this.size-=C?1:0,C}function ca(A){var C=this.__data__;if(vn){var M=C[A];return M===n?void 0:M}return pt.call(C,A)?C[A]:void 0}function da(A){var C=this.__data__;return vn?C[A]!==void 0:pt.call(C,A)}function ha(A,C){var M=this.__data__;return this.size+=this.has(A)?0:1,M[A]=vn&&C===void 0?n:C,this}$e.prototype.clear=aa,$e.prototype.delete=la,$e.prototype.get=ca,$e.prototype.has=da,$e.prototype.set=ha;function rt(A){var C=-1,M=A==null?0:A.length;for(this.clear();++C<M;){var N=A[C];this.set(N[0],N[1])}}function ua(){this.__data__=[],this.size=0}function fa(A){var C=this.__data__,M=wi(C,A);if(M<0)return!1;var N=C.length-1;return M==N?C.pop():Ln.call(C,M,1),--this.size,!0}function ma(A){var C=this.__data__,M=wi(C,A);return M<0?void 0:C[M][1]}function pa(A){return wi(this.__data__,A)>-1}function ga(A,C){var M=this.__data__,N=wi(M,A);return N<0?(++this.size,M.push([A,C])):M[N][1]=C,this}rt.prototype.clear=ua,rt.prototype.delete=fa,rt.prototype.get=ma,rt.prototype.has=pa,rt.prototype.set=ga;function gt(A){var C=-1,M=A==null?0:A.length;for(this.clear();++C<M;){var N=A[C];this.set(N[0],N[1])}}function va(){this.size=0,this.__data__={hash:new $e,map:new(zn||rt),string:new $e}}function Aa(A){var C=Tt(this,A).delete(A);return this.size-=C?1:0,C}function ba(A){return Tt(this,A).get(A)}function ya(A){return Tt(this,A).has(A)}function wa(A,C){var M=Tt(this,A),N=M.size;return M.set(A,C),this.size+=M.size==N?0:1,this}gt.prototype.clear=va,gt.prototype.delete=Aa,gt.prototype.get=ba,gt.prototype.has=ya,gt.prototype.set=wa;function bi(A){var C=-1,M=A==null?0:A.length;for(this.__data__=new gt;++C<M;)this.add(A[C])}function Po(A){return this.__data__.set(A,n),this}function yi(A){return this.__data__.has(A)}bi.prototype.add=bi.prototype.push=Po,bi.prototype.has=yi;function Gt(A){var C=this.__data__=new rt(A);this.size=C.size}function ss(){this.__data__=new rt,this.size=0}function Ca(A){var C=this.__data__,M=C.delete(A);return this.size=C.size,M}function Pa(A){return this.__data__.get(A)}function Ia(A){return this.__data__.has(A)}function Ea(A,C){var M=this.__data__;if(M instanceof rt){var N=M.__data__;if(!zn||N.length<e-1)return N.push([A,C]),this.size=++M.size,this;M=this.__data__=new gt(N)}return M.set(A,C),this.size=M.size,this}Gt.prototype.clear=ss,Gt.prototype.delete=Ca,Gt.prototype.get=Pa,Gt.prototype.has=Ia,Gt.prototype.set=Ea;function ka(A,C){var M=Ci(A),N=!M&&Mo(A),Ee=!M&&!N&&Pi(A),ge=!M&&!N&&!Ee&&Lo(A),Se=M||N||Ee||ge,Le=Se?mt(A.length,String):[],Ye=Le.length;for(var Ve in A)(C||pt.call(A,Ve))&&!(Se&&(Ve=="length"||Ee&&(Ve=="offset"||Ve=="parent")||ge&&(Ve=="buffer"||Ve=="byteLength"||Ve=="byteOffset")||ja(Ve,Ye)))&&Le.push(Ve);return Le}function wi(A,C){for(var M=A.length;M--;)if(xo(A[M][0],C))return M;return-1}function os(A,C,M){var N=C(A);return Ci(A)?N:xe(N,M(A))}function jn(A){return A==null?A===void 0?X:b:Lt&&Lt in Object(A)?Kt(A):ko(A)}function Io(A){return Ht(A)&&jn(A)==a}function Eo(A,C,M,N,Ee){return A===C?!0:A==null||C==null||!Ht(A)&&!Ht(C)?A!==A&&C!==C:xa(A,C,M,N,Eo,Ee)}function xa(A,C,M,N,Ee,ge){var Se=Ci(A),Le=Ci(C),Ye=Se?l:Ft(A),Ve=Le?l:Ft(C);Ye=Ye==a?w:Ye,Ve=Ve==a?w:Ve;var at=Ye==w,vt=Ve==w,Xe=Ye==Ve;if(Xe&&Pi(A)){if(!Pi(C))return!1;Se=!0,at=!1}if(Xe&&!at)return ge||(ge=new Gt),Se||Lo(A)?rs(A,C,M,N,Ee,ge):La(A,C,Ye,M,N,Ee,ge);if(!(M&s)){var lt=at&&pt.call(A,"__wrapped__"),et=vt&&pt.call(C,"__wrapped__");if(lt||et){var An=lt?A.value():A,$t=et?C.value():C;return ge||(ge=new Gt),Ee(An,$t,M,N,ge)}}return Xe?(ge||(ge=new Gt),Ta(A,C,M,N,Ee,ge)):!1}function Ma(A){if(!Do(A)||Oa(A))return!1;var C=So(A)?ia:Ae;return C.test(ut(A))}function Sa(A){return Ht(A)&&ls(A.length)&&!!be[jn(A)]}function Da(A){if(!Ba(A))return Tn(A);var C=[];for(var M in Object(A))pt.call(A,M)&&M!="constructor"&&C.push(M);return C}function rs(A,C,M,N,Ee,ge){var Se=M&s,Le=A.length,Ye=C.length;if(Le!=Ye&&!(Se&&Ye>Le))return!1;var Ve=ge.get(A);if(Ve&&ge.get(C))return Ve==C;var at=-1,vt=!0,Xe=M&o?new bi:void 0;for(ge.set(A,C),ge.set(C,A);++at<Le;){var lt=A[at],et=C[at];if(N)var An=Se?N(et,lt,at,C,A,ge):N(lt,et,at,A,C,ge);if(An!==void 0){if(An)continue;vt=!1;break}if(Xe){if(!He(C,function($t,On){if(!yt(Xe,On)&&(lt===$t||Ee(lt,$t,M,N,ge)))return Xe.push(On)})){vt=!1;break}}else if(!(lt===et||Ee(lt,et,M,N,ge))){vt=!1;break}}return ge.delete(A),ge.delete(C),vt}function La(A,C,M,N,Ee,ge,Se){switch(M){case R:if(A.byteLength!=C.byteLength||A.byteOffset!=C.byteOffset)return!1;A=A.buffer,C=C.buffer;case G:return!(A.byteLength!=C.byteLength||!ge(new yo(A),new yo(C)));case d:case h:case p:return xo(+A,+C);case u:return A.name==C.name&&A.message==C.message;case T:case B:return A==C+"";case v:var Le=_e;case I:var Ye=N&s;if(Le||(Le=qe),A.size!=C.size&&!Ye)return!1;var Ve=Se.get(A);if(Ve)return Ve==C;N|=o,Se.set(A,C);var at=rs(Le(A),Le(C),N,Ee,ge,Se);return Se.delete(A),at;case L:if(is)return is.call(A)==is.call(C)}return!1}function Ta(A,C,M,N,Ee,ge){var Se=M&s,Le=Vn(A),Ye=Le.length,Ve=Vn(C),at=Ve.length;if(Ye!=at&&!Se)return!1;for(var vt=Ye;vt--;){var Xe=Le[vt];if(!(Se?Xe in C:pt.call(C,Xe)))return!1}var lt=ge.get(A);if(lt&&ge.get(C))return lt==C;var et=!0;ge.set(A,C),ge.set(C,A);for(var An=Se;++vt<Ye;){Xe=Le[vt];var $t=A[Xe],On=C[Xe];if(N)var Hu=Se?N(On,$t,Xe,C,A,ge):N($t,On,Xe,A,C,ge);if(!(Hu===void 0?$t===On||Ee($t,On,M,N,ge):Hu)){et=!1;break}An||(An=Xe=="constructor")}if(et&&!An){var To=A.constructor,zo=C.constructor;To!=zo&&"constructor"in A&&"constructor"in C&&!(typeof To=="function"&&To instanceof To&&typeof zo=="function"&&zo instanceof zo)&&(et=!1)}return ge.delete(A),ge.delete(C),et}function Vn(A){return os(A,cs,za)}function Tt(A,C){var M=A.__data__;return Va(C)?M[typeof C=="string"?"string":"hash"]:M.map}function Zt(A,C){var M=wt(A,C);return Ma(M)?M:void 0}function Kt(A){var C=pt.call(A,Lt),M=A[Lt];try{A[Lt]=void 0;var N=!0}catch(ge){}var Ee=pi.call(A);return N&&(C?A[Lt]=M:delete A[Lt]),Ee}var za=Ai?function(A){return A==null?[]:(A=Object(A),re(Ai(A),function(C){return vi.call(A,C)}))}:Qa,Ft=jn;($i&&Ft(new $i(new ArrayBuffer(1)))!=R||zn&&Ft(new zn)!=v||es&&Ft(es.resolve())!=P||ts&&Ft(new ts)!=I||ns&&Ft(new ns)!=Z)&&(Ft=function(A){var C=jn(A),M=C==w?A.constructor:void 0,N=M?ut(M):"";if(N)switch(N){case wo:return R;case Jt:return v;case sa:return P;case oa:return I;case ra:return Z}return C});function ja(A,C){return C=C==null?r:C,!!C&&(typeof A=="number"||Be.test(A))&&A>-1&&A%1==0&&A<C}function Va(A){var C=typeof A;return C=="string"||C=="number"||C=="symbol"||C=="boolean"?A!=="__proto__":A===null}function Oa(A){return!!mi&&mi in A}function Ba(A){var C=A&&A.constructor,M=typeof C=="function"&&C.prototype||Rt;return A===M}function ko(A){return pi.call(A)}function ut(A){if(A!=null){try{return Dn.call(A)}catch(C){}try{return A+""}catch(C){}}return""}function xo(A,C){return A===C||A!==A&&C!==C}var Mo=Io(function(){return arguments}())?Io:function(A){return Ht(A)&&pt.call(A,"callee")&&!vi.call(A,"callee")},Ci=Array.isArray;function as(A){return A!=null&&ls(A.length)&&!So(A)}var Pi=Ki||Ra;function _a(A,C){return Eo(A,C)}function So(A){if(!Do(A))return!1;var C=jn(A);return C==m||C==g||C==c||C==k}function ls(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=r}function Do(A){var C=typeof A;return A!=null&&(C=="object"||C=="function")}function Ht(A){return A!=null&&typeof A=="object"}var Lo=ot?qt(ot):Sa;function cs(A){return as(A)?ka(A):Da(A)}function Qa(){return[]}function Ra(){return!1}i.exports=_a})(Dw,uo);const Lw=uo,Tw=(i,t)=>Lw(i,t),zw=i=>Object.keys(i||{}),jw=(i,t)=>{const e={};return i.forEach(n=>{e[n]=t[n]}),e},Vw=()=>{const i={},t=(e,n)=>{const{watcherName:s,fn:o}=e,{prop:r,value:a}=n;i[s]||(i[s]={deps:{},fn:o}),i[s].deps[r]=a};return{subscribers:i,subscribe(e,n){e&&t(e,n)},notify(e,n){Object.entries(i).forEach(([s,{deps:o,fn:r}])=>{const a=zw(o);if(a.includes(n)){const l=jw(a,e);Tw(o,l)||(i[s].deps=l,r())}})}}},Ow=()=>{let i=null;return{targetWatcher(t,e){i={watcherName:t,fn:e},i.fn(),i=null},getTarget(){return i}}};function Bw(i,t){const e=co(i,"data",{}),n=co(i,"watch",{}),s=co(i,"methods",{}),o=co(t,"onChange",()=>{}),{subscribe:r,notify:a,subscribers:l}=Vw(),{targetWatcher:c,getTarget:d}=Ow();let h;const u={},m=()=>({data:h,methods:u});let g=!1;const v=b=>(...w)=>{g=!0;const P=b(...w);return g=!1,P};Object.entries(s).forEach(([b,w])=>{u[b]=v((...P)=>w(m(),...P)),Object.defineProperty(u[b],"name",{value:b})}),h=new Proxy(Sw(e),{get(b,w){return d()&&!g&&r(d(),{prop:w,value:b[w]}),Reflect.get(...arguments)},set(b,w,P){return b[w]===P||(Reflect.set(...arguments),d()||(o&&o(w,P),a(h,w))),!0}}),Object.entries(n).forEach(([b,w])=>{c(b,()=>{w(m())})});const p=[h,u];return p._internal={_getSubscribers(){return l}},p}function _w({pageIndex:i,particlesToShow:t,particlesToScroll:e,particlesCount:n}){const s=i===0?0:t-e,o=i*t-i*s,r=o+Math.max(t,e)-1,a=[];for(let l=o;l<=Math.min(n-1,r);l++)a.push(l);return a}function Qw({infinite:i,pageIndex:t,pagesCount:e,particlesCount:n,particlesToShow:s,particlesToScroll:o}){const r=di(0,t,e-1);let a=r-1,l=r+1;a=i?a<0?e-1:a:Math.max(0,a),l=i?l>e-1?0:l:Math.min(e-1,l);const c=[...new Set([a,r,l,0,e-1])].sort((h,u)=>h-u),d=c.flatMap(h=>_w({pageIndex:h,particlesToShow:s,particlesToScroll:o,particlesCount:n}));return{pageIndexes:c,particleIndexes:[...new Set(d)].sort((h,u)=>h-u)}}const Rw=(i,t)=>(i(),setInterval(i,t)),Gw=35,Mh=1;class Fw{constructor({onProgressValueChange:t}){this._onProgressValueChange=t,this._autoplayDuration,this._onProgressValueChange,this._interval,this._paused=!1}setAutoplayDuration(t){this._autoplayDuration=t}start(t){return new Promise(e=>{this.reset();const n=Math.min(Gw,Math.max(this._autoplayDuration,1));let s=-n;this._interval=Rw(()=>Y(this,null,function*(){if(this._paused)return;s+=n;const o=s/this._autoplayDuration;this._onProgressValueChange(o),o>Mh&&(this.reset(),yield t(),e())}),n)})}pause(){this._paused=!0}resume(){this._paused=!1}reset(){clearInterval(this._interval),this._onProgressValueChange(Mh)}}function Hw(i){const t=new Fw({onProgressValueChange:r=>{i("progressValue",1-r)}}),e=Bw({data:{particlesCountWithoutClones:0,particlesToShow:1,particlesToShowInit:1,particlesToScroll:1,particlesToScrollInit:1,particlesCount:1,currentParticleIndex:1,infinite:!1,autoplayDuration:1e3,clonesCountHead:0,clonesCountTail:0,clonesCountTotal:0,partialPageSize:1,currentPageIndex:1,pagesCount:1,pauseOnFocus:!1,focused:!1,autoplay:!1,autoplayDirection:"next",disabled:!1,durationMsInit:1e3,durationMs:1e3,offset:0,particleWidth:0,loaded:[]},watch:{setLoaded({data:r}){r.loaded=Qw({infinite:r.infinite,pageIndex:r.currentPageIndex,pagesCount:r.pagesCount,particlesCount:r.particlesCountWithoutClones,particlesToShow:r.particlesToShow,particlesToScroll:r.particlesToScroll}).particleIndexes},setCurrentPageIndex({data:r}){r.currentPageIndex=Cy({currentParticleIndex:r.currentParticleIndex,particlesCount:r.particlesCount,clonesCountHead:r.clonesCountHead,clonesCountTotal:r.clonesCountTotal,infinite:r.infinite,particlesToScroll:r.particlesToScroll})},setPartialPageSize({data:r}){r.partialPageSize=ph({particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow,particlesCountWithoutClones:r.particlesCountWithoutClones})},setClonesCount({data:r}){const{head:a,tail:l}=Ly({infinite:r.infinite,particlesToShow:r.particlesToShow,partialPageSize:r.partialPageSize});r.clonesCountHead=a,r.clonesCountTail=l,r.clonesCountTotal=a+l},setProgressManagerAutoplayDuration({data:r}){t.setAutoplayDuration(r.autoplayDuration)},toggleProgressManager({data:{pauseOnFocus:r,focused:a}}){r&&(a?t.pause():t.resume())},initDuration({data:r}){r.durationMs=r.durationMsInit},applyAutoplay({data:r,methods:{_applyAutoplayIfNeeded:a}}){r.autoplay&&a(r.autoplay)},setPagesCount({data:r}){r.pagesCount=Iy({infinite:r.infinite,particlesCountWithoutClones:r.particlesCountWithoutClones,particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow})},setParticlesToShow({data:r}){r.particlesToShow=di(1,r.particlesToShowInit,r.particlesCountWithoutClones)},setParticlesToScroll({data:r}){r.particlesToScroll=di(1,r.particlesToScrollInit,r.particlesCountWithoutClones)}},methods:{_prev({data:r}){r.currentParticleIndex=_r({infinite:r.infinite,pageIndex:r.currentPageIndex-1,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},_next({data:r}){r.currentParticleIndex=_r({infinite:r.infinite,pageIndex:r.currentPageIndex+1,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},_moveToParticle({data:r},a){r.currentParticleIndex=di(0,a,r.particlesCount-1)},toggleFocused({data:r}){r.focused=!r.focused},_applyAutoplayIfNeeded(l){return Y(this,arguments,function*({data:r,methods:a}){if(!r.infinite&&(r.autoplayDirection===mn&&r.currentParticleIndex===r.particlesCount-1||r.autoplayDirection===ci&&r.currentParticleIndex===0)){t.reset();return}if(r.autoplay){const c=()=>Qr({[mn]:()=>Y(this,null,function*(){return a.showNextPage()}),[ci]:()=>Y(this,null,function*(){return a.showPrevPage()})})(r.autoplayDirection);yield t.start(c)}})},_jumpIfNeeded(l){return Y(this,arguments,function*({data:r,methods:a}){let c=!1;return r.infinite&&(r.currentParticleIndex===0?(yield a.showParticle(r.particlesCount-r.clonesCountTotal,{animated:!1}),c=!0):r.currentParticleIndex===r.particlesCount-r.clonesCountTail&&(yield a.showParticle(r.clonesCountHead,{animated:!1}),c=!0)),c})},changePage(d,h,u){return Y(this,arguments,function*({data:r,methods:a},l,c){if(t.reset(),r.disabled)return;r.disabled=!0,l(),yield a.offsetPage({animated:Ni(c,"animated",!0)}),r.disabled=!1,!(yield a._jumpIfNeeded())&&a._applyAutoplayIfNeeded()})},showNextPage(c,d){return Y(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._next,l))})},showPrevPage(c,d){return Y(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._prev,l))})},showParticle(c,d,h){return Y(this,arguments,function*({methods:r},a,l){yield r.changePage(()=>r._moveToParticle(a),l)})},_getParticleIndexByPageIndex({data:r},a){return _r({infinite:r.infinite,pageIndex:a,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},showPage(c,d,h){return Y(this,arguments,function*({methods:r},a,l){const u=r._getParticleIndexByPageIndex(a);yield r.showParticle(u,l)})},offsetPage({data:r},a){const l=Ni(a,"animated",!0);return new Promise(c=>{r.durationMs=l?r.durationMsInit:0,r.offset=-r.currentParticleIndex*r.particleWidth,setTimeout(()=>{c()},r.durationMs)})}}},{onChange:i}),[n,s]=e;return[{data:n,progressManager:t},s,e._internal]}function Ww(i){he(i,"svelte-sme1z4",":root{--sc-color-rgb-light-50p:rgba(93, 93, 93, 0.5);--sc-color-rgb-light:#5d5d5d;--sc-color-hex-dark-50p:rgba(30, 30, 30, 0.5);--sc-color-hex-dark:#1e1e1e}.sc-carousel__carousel-container.svelte-sme1z4{display:flex;width:100%;flex-direction:column;align-items:center}.sc-carousel__content-container.svelte-sme1z4{position:relative;display:flex;width:100%}.sc-carousel__pages-window.svelte-sme1z4{flex:1;display:flex;overflow:hidden;box-sizing:border-box;position:relative}.sc-carousel__pages-container.svelte-sme1z4{width:100%;display:flex;transition-property:transform}.sc-carousel__arrow-container.svelte-sme1z4{padding:5px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.sc-carousel-progress__container.svelte-sme1z4{width:100%;height:5px;background-color:var(--sc-color-rgb-light-50p);position:absolute;bottom:0}.sc-carousel-button{all:unset;cursor:pointer}.sc-carousel-button:focus{outline:5px auto}")}const Nw=i=>({currentPageIndex:i[0]&32,pagesCount:i[0]&1024,loaded:i[0]&64}),Sh=i=>({currentPageIndex:i[5],pagesCount:i[10],showPage:i[15],loaded:i[6]}),Yw=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Dh=i=>({showNextPage:i[14].showNextPage,loaded:i[6],currentPageIndex:i[5]}),Xw=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Lh=i=>({loaded:i[6],currentPageIndex:i[5]}),Uw=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Th=i=>({showPrevPage:i[14].showPrevPage,loaded:i[6],currentPageIndex:i[5]});function zh(i){let t;const e=i[37].prev,n=Hn(e,i,i[36],Th),s=n||qw(i);return{c(){s&&s.c()},m(o,r){s&&s.m(o,r),t=!0},p(o,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&Nn(n,e,o,o[36],t?Wn(e,o[36],r,Uw):Yn(o[36]),Th):s&&s.p&&(!t||r[0]&36)&&s.p(o,t?r:[-1,-1])},i(o){t||(x(s,o),t=!0)},o(o){z(s,o),t=!1},d(o){s&&s.d(o)}}}function qw(i){let t,e,n;return e=new lh({props:{direction:"prev",disabled:!i[2]&&i[5]===0}}),e.$on("click",i[23]),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o[0]&36&&(r.disabled=!s[2]&&s[5]===0),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function jh(i){let t,e,n;return e=new ty({props:{value:i[7]}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","sc-carousel-progress__container svelte-sme1z4")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o[0]&128&&(r.value=s[7]),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function Vh(i){let t;const e=i[37].next,n=Hn(e,i,i[36],Dh),s=n||Jw(i);return{c(){s&&s.c()},m(o,r){s&&s.m(o,r),t=!0},p(o,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&Nn(n,e,o,o[36],t?Wn(e,o[36],r,Yw):Yn(o[36]),Dh):s&&s.p&&(!t||r[0]&1060)&&s.p(o,t?r:[-1,-1])},i(o){t||(x(s,o),t=!0)},o(o){z(s,o),t=!1},d(o){s&&s.d(o)}}}function Jw(i){let t,e,n;return e=new lh({props:{direction:"next",disabled:!i[2]&&i[5]===i[10]-1}}),e.$on("click",i[14].showNextPage),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o[0]&1060&&(r.disabled=!s[2]&&s[5]===s[10]-1),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function Oh(i){let t;const e=i[37].dots,n=Hn(e,i,i[36],Sh),s=n||Zw(i);return{c(){s&&s.c()},m(o,r){s&&s.m(o,r),t=!0},p(o,r){n?n.p&&(!t||r[0]&1120|r[1]&32)&&Nn(n,e,o,o[36],t?Wn(e,o[36],r,Nw):Yn(o[36]),Sh):s&&s.p&&(!t||r[0]&1056)&&s.p(o,t?r:[-1,-1])},i(o){t||(x(s,o),t=!0)},o(o){z(s,o),t=!1},d(o){s&&s.d(o)}}}function Zw(i){let t,e;return t=new U1({props:{pagesCount:i[10],currentPageIndex:i[5]}}),t.$on("pageChange",i[41]),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s[0]&1024&&(o.pagesCount=n[10]),s[0]&32&&(o.currentPageIndex=n[5]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function Kw(i){let t,e,n,s,o,r,a,l,c,d,h,u,m=i[1]&&zh(i);const g=i[37].default,v=Hn(g,i,i[36],Lh);let p=i[3]&&jh(i),b=i[1]&&Vh(i),w=i[4]&&Oh(i);return{c(){t=S("div"),e=S("div"),m&&m.c(),n=ee(),s=S("div"),o=S("div"),v&&v.c(),a=ee(),p&&p.c(),l=ee(),b&&b.c(),c=ee(),w&&w.c(),y(o,"class","sc-carousel__pages-container svelte-sme1z4"),j(o,"transform","translateX("+i[8]+"px)"),j(o,"transition-duration",i[9]+"ms"),j(o,"transition-timing-function",i[0]),y(s,"class","sc-carousel__pages-window svelte-sme1z4"),y(e,"class","sc-carousel__content-container svelte-sme1z4"),y(t,"class","sc-carousel__carousel-container svelte-sme1z4")},m(P,k){O(P,t,k),D(t,e),m&&m.m(e,null),D(e,n),D(e,s),D(s,o),v&&v.m(o,null),i[39](o),D(s,a),p&&p.m(s,null),i[40](s),D(e,l),b&&b.m(e,null),D(t,c),w&&w.m(t,null),d=!0,h||(u=[Nt(r=dy.call(null,o,{thresholdProvider:i[38]})),ye(o,"swipeStart",i[16]),ye(o,"swipeMove",i[18]),ye(o,"swipeEnd",i[19]),ye(o,"swipeFailed",i[20]),ye(o,"swipeThresholdReached",i[17]),Nt(my.call(null,s)),ye(s,"hovered",i[21]),Nt(by.call(null,s)),ye(s,"tapped",i[22])],h=!0)},p(P,k){P[1]?m?(m.p(P,k),k[0]&2&&x(m,1)):(m=zh(P),m.c(),x(m,1),m.m(e,n)):m&&(ue(),z(m,1,1,()=>{m=null}),fe()),v&&v.p&&(!d||k[0]&96|k[1]&32)&&Nn(v,g,P,P[36],d?Wn(g,P[36],k,Xw):Yn(P[36]),Lh),(!d||k[0]&256)&&j(o,"transform","translateX("+P[8]+"px)"),(!d||k[0]&512)&&j(o,"transition-duration",P[9]+"ms"),(!d||k[0]&1)&&j(o,"transition-timing-function",P[0]),r&&rn(r.update)&&k[0]&2048&&r.update.call(null,{thresholdProvider:P[38]}),P[3]?p?(p.p(P,k),k[0]&8&&x(p,1)):(p=jh(P),p.c(),x(p,1),p.m(s,null)):p&&(ue(),z(p,1,1,()=>{p=null}),fe()),P[1]?b?(b.p(P,k),k[0]&2&&x(b,1)):(b=Vh(P),b.c(),x(b,1),b.m(e,null)):b&&(ue(),z(b,1,1,()=>{b=null}),fe()),P[4]?w?(w.p(P,k),k[0]&16&&x(w,1)):(w=Oh(P),w.c(),x(w,1),w.m(t,null)):w&&(ue(),z(w,1,1,()=>{w=null}),fe())},i(P){d||(x(m),x(v,P),x(p),x(b),x(w),d=!0)},o(P){z(m),z(v,P),z(p),z(b),z(w),d=!1},d(P){P&&V(t),m&&m.d(),v&&v.d(P),i[39](null),p&&p.d(),i[40](null),b&&b.d(),w&&w.d(),h=!1,Ze(u)}}}function $w(i,t,e){let{$$slots:n={},$$scope:s}=t,o=[],r,a,l=0,c=0,d=1;const[{data:h,progressManager:u},m,g]=Hw((re,xe)=>{Qr({currentPageIndex:()=>e(5,r=xe),progressValue:()=>e(7,a=xe),offset:()=>e(8,l=xe),durationMs:()=>e(9,c=xe),pagesCount:()=>e(10,d=xe),loaded:()=>e(6,o=xe)})(re)}),v=Ds();let{timingFunction:p="ease-in-out"}=t,{arrows:b=!0}=t,{infinite:w=!0}=t,{initialPageIndex:P=0}=t,{duration:k=500}=t,{autoplay:T=!1}=t,{autoplayDuration:I=3e3}=t,{autoplayDirection:B=mn}=t,{pauseOnFocus:L=!1}=t,{autoplayProgressVisible:X=!1}=t,{dots:Z=!0}=t,{swiping:G=!0}=t,{particlesToShow:R=1}=t,{particlesToScroll:H=1}=t;function Q(re,xe){return Y(this,null,function*(){const He=Ni(xe,"animated",!0);if(typeof re!="number")throw new Error("pageIndex should be a number");yield m.showPage(re,{animated:He})})}function W(re){return Y(this,null,function*(){const xe=Ni(re,"animated",!0);yield m.showPrevPage({animated:xe})})}function q(re){return Y(this,null,function*(){const xe=Ni(re,"animated",!0);yield m.showNextPage({animated:xe})})}let U=0,K,de;const oe=My(({width:re})=>{e(11,U=re),h.particleWidth=U/h.particlesToShow,xy({particlesContainerChildren:de.children,particleWidth:h.particleWidth}),m.offsetPage({animated:!1})});function Pe(){const{clonesToAppend:re,clonesToPrepend:xe}=Sy({clonesCountHead:h.clonesCountHead,clonesCountTail:h.clonesCountTail,particlesContainerChildren:de.children});Dy({particlesContainer:de,clonesToAppend:re,clonesToPrepend:xe})}At(()=>{Y(this,null,function*(){yield El(),de&&K&&(h.particlesCountWithoutClones=de.children.length,yield El(),h.infinite&&Pe(),h.particlesCount=de.children.length,m.showPage(P,{animated:!1}),oe.observe(K))})}),Vt(()=>{oe.disconnect(),u.reset()});function Ie(re){return Y(this,null,function*(){yield m.showPage(re,{animated:!0})})}function Ae(){G&&(h.durationMs=0)}function Be(re){return Y(this,null,function*(){G&&(yield Qr({[mn]:m.showNextPage,[ci]:m.showPrevPage})(re.detail.direction))})}function be(re){G&&(h.offset+=re.detail.dx)}function Ne(){G&&m.showParticle(h.currentParticleIndex)}function me(){return Y(this,null,function*(){G&&(yield m.offsetPage({animated:!0}))})}function Ce(re){h.focused=re.detail.value}function ze(){m.toggleFocused()}function pe(){m.showPrevPage()}const Ke=()=>U/3;function ht(re){Re[re?"unshift":"push"](()=>{de=re,e(13,de)})}function Me(re){Re[re?"unshift":"push"](()=>{K=re,e(12,K)})}const ot=re=>Ie(re.detail);return i.$$set=re=>{"timingFunction"in re&&e(0,p=re.timingFunction),"arrows"in re&&e(1,b=re.arrows),"infinite"in re&&e(2,w=re.infinite),"initialPageIndex"in re&&e(24,P=re.initialPageIndex),"duration"in re&&e(25,k=re.duration),"autoplay"in re&&e(26,T=re.autoplay),"autoplayDuration"in re&&e(27,I=re.autoplayDuration),"autoplayDirection"in re&&e(28,B=re.autoplayDirection),"pauseOnFocus"in re&&e(29,L=re.pauseOnFocus),"autoplayProgressVisible"in re&&e(3,X=re.autoplayProgressVisible),"dots"in re&&e(4,Z=re.dots),"swiping"in re&&e(30,G=re.swiping),"particlesToShow"in re&&e(31,R=re.particlesToShow),"particlesToScroll"in re&&e(32,H=re.particlesToScroll),"$$scope"in re&&e(36,s=re.$$scope)},i.$$.update=()=>{i.$$.dirty[0]&32&&v("pageChange",r),i.$$.dirty[0]&4&&(h.infinite=w),i.$$.dirty[0]&33554432&&(h.durationMsInit=k),i.$$.dirty[0]&67108864&&(h.autoplay=T),i.$$.dirty[0]&134217728&&(h.autoplayDuration=I),i.$$.dirty[0]&268435456&&(h.autoplayDirection=B),i.$$.dirty[0]&536870912&&(h.pauseOnFocus=L),i.$$.dirty[1]&1&&(h.particlesToShowInit=R),i.$$.dirty[1]&2&&(h.particlesToScrollInit=H)},[p,b,w,X,Z,r,o,a,l,c,d,U,K,de,m,Ie,Ae,Be,be,Ne,me,Ce,ze,pe,P,k,T,I,B,L,G,R,H,Q,W,q,s,n,Ke,ht,Me,ot]}class eC extends ce{constructor(t){super(),le(this,t,$w,Kw,ae,{timingFunction:0,arrows:1,infinite:2,initialPageIndex:24,duration:25,autoplay:26,autoplayDuration:27,autoplayDirection:28,pauseOnFocus:29,autoplayProgressVisible:3,dots:4,swiping:30,particlesToShow:31,particlesToScroll:32,goTo:33,goToPrev:34,goToNext:35},Ww,[-1,-1])}get goTo(){return this.$$.ctx[33]}get goToPrev(){return this.$$.ctx[34]}get goToNext(){return this.$$.ctx[35]}}function tC(i){he(i,"svelte-159ski6",".media-item.svelte-159ski6.svelte-159ski6{position:relative;height:100%}.media-content.svelte-159ski6.svelte-159ski6{position:relative;pointer-events:auto;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;-o-object-fit:inherit;object-fit:inherit}.media-content.showPlayButton.svelte-159ski6.svelte-159ski6{pointer-events:none}.video-icon.svelte-159ski6.svelte-159ski6{width:12.5rem;height:6.25rem;max-width:60%;max-height:60%;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.video-play-button-container.svelte-159ski6.svelte-159ski6{display:none;position:absolute;width:100%;height:100%;top:0;left:0;transform:translate3d(0, 0, 0)}.video-play-button-container.showPlayButton.svelte-159ski6.svelte-159ski6{pointer-events:none;display:block}.video-icon.svelte-159ski6.svelte-159ski6{pointer-events:auto}.video-icon.large.svelte-159ski6.svelte-159ski6{width:12.5rem;height:6.25rem}.video-icon.small.svelte-159ski6.svelte-159ski6{width:1.75rem;height:1.75rem}.video-icon.svelte-159ski6 .video-icon-img.svelte-159ski6{width:100%;height:100%;background-position:center center;background-size:contain;background-repeat:no-repeat}.video-icon.svelte-159ski6 .video-icon-img.canPlay.svelte-159ski6{cursor:pointer}")}function Bh(i){let t;function e(o,r){if(o[2].type==="Image")return iC;if(o[2].type==="Video")return nC}let n=e(i),s=n&&n(i);return{c(){t=S("div"),s&&s.c(),y(t,"class","media-item svelte-159ski6"),y(t,"draggable","false")},m(o,r){O(o,t,r),s&&s.m(t,null)},p(o,r){n===(n=e(o))&&s?s.p(o,r):(s&&s.d(1),s=n&&n(o),s&&(s.c(),s.m(t,null)))},d(o){o&&V(t),s&&s.d()}}}function nC(i){let t,e,n,s,o,r;function a(d,h){return d[7]&&d[2].videoCoverUrl?oC:sC}let l=a(i),c=l(i);return{c(){c.c(),t=ee(),e=S("div"),n=S("div"),s=S("div"),y(s,"class","video-icon-img svelte-159ski6"),j(s,"background-image","url("+i[20]()+")"),$(s,"canPlay",i[5]),y(n,"class","video-icon svelte-159ski6"),$(n,"large",i[4]==="large"),$(n,"small",i[4]==="small"),y(e,"class","video-play-button-container svelte-159ski6"),$(e,"showPlayButton",i[10])},m(d,h){c.m(d,h),O(d,t,h),O(d,e,h),D(e,n),D(n,s),o||(r=ye(s,"click",i[21]),o=!0)},p(d,h){l===(l=a(d))&&c?c.p(d,h):(c.d(1),c=l(d),c&&(c.c(),c.m(t.parentNode,t))),h&8&&j(s,"background-image","url("+d[20]()+")"),h&32&&$(s,"canPlay",d[5]),h&16&&$(n,"large",d[4]==="large"),h&16&&$(n,"small",d[4]==="small"),h&1024&&$(e,"showPlayButton",d[10])},d(d){c.d(d),d&&V(t),d&&V(e),o=!1,r()}}}function iC(i){let t,e,n,s;return{c(){t=S("img"),y(t,"class","media-content svelte-159ski6"),y(t,"style",e=`object-fit: ${i[6]};`),Ct(t.src,n=i[2].url)||y(t,"src",n),y(t,"alt",s=i[2].name),y(t,"draggable",!1)},m(o,r){O(o,t,r)},p(o,r){r&64&&e!==(e=`object-fit: ${o[6]};`)&&y(t,"style",e),r&4&&!Ct(t.src,n=o[2].url)&&y(t,"src",n),r&4&&s!==(s=o[2].name)&&y(t,"alt",s)},d(o){o&&V(t)}}}function sC(i){let t,e,n,s,o,r,a;return{c(){t=S("video"),y(t,"class","media-content svelte-159ski6"),y(t,"style",e=`object-fit: ${i[6]};`),Ct(t.src,n=i[2].videoCoverUrl?i[2].url:i[2].url+"#t=0.1")||y(t,"src",n),y(t,"poster",s=i[2].videoCoverUrl),y(t,"preload",o=i[2].videoCoverUrl?"none":"auto"),y(t,"disablepictureinpicture",""),t.playsInline=!0,y(t,"paused",""),t.muted=!0,y(t,"draggable",!1),t.loop=!1,y(t,"crossorigin",""),t.controls=!1,$(t,"showPlayButton",i[10])},m(l,c){O(l,t,c),i[19](t),r||(a=[ye(t,"play",i[14]),ye(t,"pause",i[15]),ye(t,"error",i[16]),ye(t,"ended",i[17]),ye(t,"click",i[18])],r=!0)},p(l,c){c&64&&e!==(e=`object-fit: ${l[6]};`)&&y(t,"style",e),c&4&&!Ct(t.src,n=l[2].videoCoverUrl?l[2].url:l[2].url+"#t=0.1")&&y(t,"src",n),c&4&&s!==(s=l[2].videoCoverUrl)&&y(t,"poster",s),c&4&&o!==(o=l[2].videoCoverUrl?"none":"auto")&&y(t,"preload",o),c&1024&&$(t,"showPlayButton",l[10])},d(l){l&&V(t),i[19](null),r=!1,Ze(a)}}}function oC(i){let t,e,n,s;return{c(){t=S("img"),y(t,"class","media-content svelte-159ski6"),y(t,"style",e=`object-fit: ${i[6]};`),Ct(t.src,n=i[2].videoCoverUrl)||y(t,"src",n),y(t,"alt",s=i[2].name),y(t,"draggable",!1)},m(o,r){O(o,t,r)},p(o,r){r&64&&e!==(e=`object-fit: ${o[6]};`)&&y(t,"style",e),r&4&&!Ct(t.src,n=o[2].videoCoverUrl)&&y(t,"src",n),r&4&&s!==(s=o[2].name)&&y(t,"alt",s)},d(o){o&&V(t)}}}function rC(i){let t,e=i[2]&&Bh(i);return{c(){e&&e.c(),t=ke()},m(n,s){e&&e.m(n,s),O(n,t,s)},p(n,[s]){n[2]?e?e.p(n,s):(e=Bh(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:J,o:J,d(n){e&&e.d(n),n&&V(t)}}}function aC(i,t,e){let n,s,{mediaInstance:o={videoInstance:void 0,paused:!0}}=t,{tag:r}=t,{media:a}=t,{playButtonIfNeed:l="withoutText"}=t,{playButtonSizeIfNeed:c="small"}=t,{canPlay:d=!0}=t,{objectFit:h="fill"}=t,{disableVideoIfHavePoster:u=!1}=t,m=!0,g=!1;function v(){e(8,g=(a==null?void 0:a.type)==="Video"&&!!a.videoCoverUrl)}const p=ln("mediaStore"),b=ln("hooks"),w=()=>{g||n&&(e(9,n.muted=!0,n),n.play(),n.pause(),e(9,n.muted=!1,n),e(8,g=!0))};b.on("loadVideoFirstFrame",w),At(()=>{p.subscribe(({currentMediaElement:G})=>{G!==n&&(n==null||n.pause())})});const P=G=>{e(10,m=!1),e(0,o.paused=!1,o),e(8,g=!0),n&&p.set({currentMediaElement:n}),b.emit("playStateChange",{event:G,state:"playing",tag:r,mediaInstance:n})},k=G=>{e(10,m=!0),e(0,o.paused=!0,o),b.emit("playStateChange",{event:G,state:"paused",tag:r,mediaInstance:n})},T=G=>{e(10,m=!0),e(0,o.paused=!0,o),b.emit("playStateChange",{event:G,state:"paused",tag:r,mediaInstance:n})},I=G=>{e(10,m=!0),e(0,o.paused=!0,o),b.emit("playStateChange",{event:G,state:"paused",tag:r,mediaInstance:n})},B=G=>{n&&n.pause()};function L(G){Re[G?"unshift":"push"](()=>{o.videoInstance=G,e(0,o)})}const X=()=>l==="withText"?Gd:l==="withoutText"?Lr:l,Z=G=>{d&&n&&(e(9,n.muted=!1,n),n.play())};return i.$$set=G=>{"mediaInstance"in G&&e(0,o=G.mediaInstance),"tag"in G&&e(1,r=G.tag),"media"in G&&e(2,a=G.media),"playButtonIfNeed"in G&&e(3,l=G.playButtonIfNeed),"playButtonSizeIfNeed"in G&&e(4,c=G.playButtonSizeIfNeed),"canPlay"in G&&e(5,d=G.canPlay),"objectFit"in G&&e(6,h=G.objectFit),"disableVideoIfHavePoster"in G&&e(7,u=G.disableVideoIfHavePoster)},i.$$.update=()=>{if(i.$$.dirty&1&&e(9,n=o.videoInstance),i.$$.dirty&4&&e(13,s=a==null?void 0:a.url),i.$$.dirty&8192&&s&&v(),i.$$.dirty&512&&n&&e(10,m=n.paused),i.$$.dirty&772&&(a==null?void 0:a.type)==="Video"&&!g){const G=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1,H=navigator.userAgent.toLowerCase().indexOf("iphone")!==-1&&G;n&&H&&n.paused&&(document.removeEventListener("WeixinJSBridgeReady",w),document.removeEventListener("touchstart",w),document.removeEventListener("click",w),document.addEventListener("WeixinJSBridgeReady",w),document.addEventListener("touchstart",w),document.addEventListener("click",w))}},[o,r,a,l,c,d,h,u,g,n,m,p,b,s,P,k,T,I,B,L,X,Z]}class _h extends ce{constructor(t){super(),le(this,t,aC,rC,ae,{mediaInstance:0,tag:1,media:2,playButtonIfNeed:3,playButtonSizeIfNeed:4,canPlay:5,objectFit:6,disableVideoIfHavePoster:7},tC)}}function lC(i){he(i,"svelte-1mrbqlg",".media-list-wrapper.svelte-1mrbqlg.svelte-1mrbqlg{width:100%;height:100%;position:relative;overflow:hidden;border-radius:0.125rem}.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg{position:relative;pointer-events:auto;height:100%;left:50%;top:50%;transform:translate(-50%, -50%)}.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg .sc-carousel__carousel-container,.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg .sc-carousel__content-container{height:100%}")}function Qh(i,t,e){const n=i.slice();return n[28]=t[e],n[29]=t,n[30]=e,n}function Rh(i){let t,e,n,s,o,r,a;const l=[dC,cC],c=[];function d(h,u){return h[13]&&h[10].length>1?0:1}return n=d(i),s=c[n]=l[n](i),{c(){t=S("div"),e=S("div"),s.c(),y(e,"class","media-list svelte-1mrbqlg"),$(e,"carouselEnabled",i[13]),y(t,"class","media-list-wrapper svelte-1mrbqlg"),$(t,"unfolded",i[5])},m(h,u){O(h,t,u),D(t,e),c[n].m(e,null),a=!0},p(h,u){i=h;let m=n;n=d(i),n===m?c[n].p(i,u):(ue(),z(c[m],1,1,()=>{c[m]=null}),fe(),s=c[n],s?s.p(i,u):(s=c[n]=l[n](i),s.c()),x(s,1),s.m(e,null)),(!a||u[0]&8192)&&$(e,"carouselEnabled",i[13]),(!a||u[0]&32)&&$(t,"unfolded",i[5])},i(h){a||(x(s),h&&nt(()=>{a&&(r&&r.end(1),o=yn(t,Ql,i[6]?{y:4,duration:i[4],delay:i[2],easing:on}:void 0),o.start())}),a=!0)},o(h){z(s),o&&o.invalidate(),h&&(r=Kn(t,Ql,i[6]?{y:4,duration:i[4],delay:i[3],easing:on}:void 0)),a=!1},d(h){h&&V(t),c[n].d(),h&&r&&r.end()}}}function cC(i){let t,e,n;const s=[{media:i[1][0]},i[7],{tag:i[0]}];function o(a){i[20](a)}let r={};for(let a=0;a<s.length;a+=1)r=Je(r,s[a]);return i[8][0]!==void 0&&(r.mediaInstance=i[8][0]),t=new _h({props:r}),Re.push(()=>nr(t,"mediaInstance",o)),{c(){se(t.$$.fragment)},m(a,l){ne(t,a,l),n=!0},p(a,l){const c=l[0]&131?it(s,[l[0]&2&&{media:a[1][0]},l[0]&128&&Sl(a[7]),l[0]&1&&{tag:a[0]}]):{};!e&&l[0]&256&&(e=!0,c.mediaInstance=a[8][0],Ko(()=>e=!1)),t.$set(c)},i(a){n||(x(t.$$.fragment,a),n=!0)},o(a){z(t.$$.fragment,a),n=!1},d(a){ie(t,a)}}}function dC(i){let t,e,n={dots:!1,arrows:!1,$$slots:{default:[hC]},$$scope:{ctx:i}};return t=new eC({props:n}),i[18](t),t.$on("pageChange",i[19]),{c(){se(t.$$.fragment)},m(s,o){ne(t,s,o),e=!0},p(s,o){const r={};o[0]&1409|o[1]&1&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){e||(x(t.$$.fragment,s),e=!0)},o(s){z(t.$$.fragment,s),e=!1},d(s){i[18](null),ie(t,s)}}}function Gh(i){let t,e,n;const s=[i[7],{media:i[28]},{tag:i[0]}];function o(a){i[17](a,i[30])}let r={};for(let a=0;a<s.length;a+=1)r=Je(r,s[a]);return i[8][i[30]]!==void 0&&(r.mediaInstance=i[8][i[30]]),t=new _h({props:r}),Re.push(()=>nr(t,"mediaInstance",o)),{c(){se(t.$$.fragment)},m(a,l){ne(t,a,l),n=!0},p(a,l){i=a;const c=l[0]&1153?it(s,[l[0]&128&&Sl(i[7]),l[0]&1024&&{media:i[28]},l[0]&1&&{tag:i[0]}]):{};!e&&l[0]&256&&(e=!0,c.mediaInstance=i[8][i[30]],Ko(()=>e=!1)),t.$set(c)},i(a){n||(x(t.$$.fragment,a),n=!0)},o(a){z(t.$$.fragment,a),n=!1},d(a){ie(t,a)}}}function hC(i){let t,e,n=i[10],s=[];for(let r=0;r<n.length;r+=1)s[r]=Gh(Qh(i,n,r));const o=r=>z(s[r],1,1,()=>{s[r]=null});return{c(){for(let r=0;r<s.length;r+=1)s[r].c();t=ke()},m(r,a){for(let l=0;l<s.length;l+=1)s[l]&&s[l].m(r,a);O(r,t,a),e=!0},p(r,a){if(a[0]&1409){n=r[10];let l;for(l=0;l<n.length;l+=1){const c=Qh(r,n,l);s[l]?(s[l].p(c,a),x(s[l],1)):(s[l]=Gh(c),s[l].c(),x(s[l],1),s[l].m(t.parentNode,t))}for(ue(),l=n.length;l<s.length;l+=1)o(l);fe()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)x(s[a]);e=!0}},o(r){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)z(s[a]);e=!1},d(r){Mt(s,r),r&&V(t)}}}function uC(i){let t,e,n=i[5]&&Rh(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,o){s[5]?n?(n.p(s,o),o[0]&32&&x(n,1)):(n=Rh(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function fC(i,t,e){let n,s,o,r,{tag:a}=t,{mediaData:l}=t,{inDelay:c=0}=t,{outDelay:d=0}=t,{duration:h=0}=t,{unfolded:u=!0}=t,{animation:m=!0}=t,{mediaItemConfig:g}=t,{enableCarousel:v=!0}=t,{autoplayConfig:p={}}=t;const{autoplayVideo:b=!1,autoplayCarousel:w=!0,autoplayVideoInCarousel:P=!1}=p;let k=[],T=0,I,B=null;const L=ln("hooks"),X=ln("mediaStore");function Z(){const W=k[T],q=W==null?void 0:W.videoInstance;q&&(q.paused?(q.muted=!1,q.play()):q.pause())}At(()=>{L.on("click",W=>{var q,U,K;(K=(U=(q=a.tag3DContentSvelte)==null?void 0:q.css3DInstance)==null?void 0:U.css3DObject)!=null&&K.opacityMesh&&W.tag.id===a.id&&Z()}),B=setInterval(()=>{r&&(I==null||I.goToNext())},3e3)}),Vt(()=>{clearInterval(B),L.off("click",Z)});function G(W,q){i.$$.not_equal(k[q],W)&&(k[q]=W,e(8,k))}function R(W){Re[W?"unshift":"push"](()=>{I=W,e(12,I)})}const H=W=>{n||X.set({currentMediaElement:null}),e(11,T=W.detail)};function Q(W){i.$$.not_equal(k[0],W)&&(k[0]=W,e(8,k))}return i.$$set=W=>{"tag"in W&&e(0,a=W.tag),"mediaData"in W&&e(1,l=W.mediaData),"inDelay"in W&&e(2,c=W.inDelay),"outDelay"in W&&e(3,d=W.outDelay),"duration"in W&&e(4,h=W.duration),"unfolded"in W&&e(5,u=W.unfolded),"animation"in W&&e(6,m=W.animation),"mediaItemConfig"in W&&e(7,g=W.mediaItemConfig),"enableCarousel"in W&&e(15,v=W.enableCarousel),"autoplayConfig"in W&&e(16,p=W.autoplayConfig)},i.$$.update=()=>{i.$$.dirty[0]&256&&e(9,n=k.every(W=>W.paused)),i.$$.dirty[0]&32770&&e(13,s=v&&(l==null?void 0:l.length)>1),i.$$.dirty[0]&2&&e(10,o=l),i.$$.dirty[0]&1536&&(r=o.length>1&&w&&n)},[a,l,c,d,h,u,m,g,k,n,o,T,I,s,X,v,p,G,R,H,Q]}class Fh extends ce{constructor(t){super(),le(this,t,fC,uC,ae,{tag:0,mediaData:1,inDelay:2,outDelay:3,duration:4,unfolded:5,animation:6,mediaItemConfig:7,enableCarousel:15,autoplayConfig:16},lC,[-1,-1])}}function mC(i){he(i,"svelte-1f7m1lj",".line.svelte-1f7m1lj{position:absolute;width:6.5625rem;height:1.3125rem;transform:translateY(-100%)}.text.svelte-1f7m1lj{position:absolute;width:6.25rem;left:1rem;bottom:0.0625rem;font-weight:600}.media-wrapper.svelte-1f7m1lj{position:absolute;left:0.875rem;top:-5.3125rem;width:5.625rem;height:3.75rem;font-weight:600}")}function Hh(i){let t,e,n,s,o,r,a,l;t=new _t({props:{visible:i[3],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),s=new R1({props:{unfolded:i[3],outDelay:400}});let c=i[2]&&Wh(i),d=i[1]&&Nh(i);return{c(){se(t.$$.fragment),e=ee(),n=S("div"),se(s.$$.fragment),o=ee(),c&&c.c(),r=ee(),d&&d.c(),a=ke(),y(n,"class","line svelte-1f7m1lj")},m(h,u){ne(t,h,u),O(h,e,u),O(h,n,u),ne(s,n,null),O(h,o,u),c&&c.m(h,u),O(h,r,u),d&&d.m(h,u),O(h,a,u),l=!0},p(h,u){const m={};u&8&&(m.visible=h[3]),t.$set(m);const g={};u&8&&(g.unfolded=h[3]),s.$set(g),h[2]?c?(c.p(h,u),u&4&&x(c,1)):(c=Wh(h),c.c(),x(c,1),c.m(r.parentNode,r)):c&&(ue(),z(c,1,1,()=>{c=null}),fe()),h[1]?d?(d.p(h,u),u&2&&x(d,1)):(d=Nh(h),d.c(),x(d,1),d.m(a.parentNode,a)):d&&(ue(),z(d,1,1,()=>{d=null}),fe())},i(h){l||(x(t.$$.fragment,h),x(s.$$.fragment,h),x(c),x(d),l=!0)},o(h){z(t.$$.fragment,h),z(s.$$.fragment,h),z(c),z(d),l=!1},d(h){ie(t,h),h&&V(e),h&&V(n),ie(s),h&&V(o),c&&c.d(h),h&&V(r),d&&d.d(h),h&&V(a)}}}function Wh(i){let t,e,n;return e=new qd({props:{unfolded:i[3],content:i[2],inDelay:500}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","text svelte-1f7m1lj")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o&8&&(r.unfolded=s[3]),o&4&&(r.content=s[2]),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function Nh(i){let t,e,n;return e=new Fh({props:{autoplayConfig:{autoplayCarousel:!1},unfolded:i[3],mediaData:i[1],tag:i[0],enableCarousel:!1,mediaItemConfig:{canPlay:!1,playButtonSizeIfNeed:"small",disableVideoIfHavePoster:!0},inDelay:500,duration:500}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","media-wrapper svelte-1f7m1lj")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o&8&&(r.unfolded=s[3]),o&2&&(r.mediaData=s[1]),o&1&&(r.tag=s[0]),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function pC(i){let t,e,n=i[0].state&&Hh(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[0].state?n?(n.p(s,o),o&1&&x(n,1)):(n=Hh(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function gC(i,t,e){let n,s,o,r,{tag:a}=t;return i.$$set=l=>{"tag"in l&&e(0,a=l.tag)},i.$$.update=()=>{var l,c,d;i.$$.dirty&1&&e(3,n=a.state?a.state.unfolded:!1),i.$$.dirty&1&&e(4,s=(c=(l=a.data.title)!=null?l:a.data.text)!=null?c:""),i.$$.dirty&16&&e(2,o=((d=s.length)!=null?d:0)>7?s.substring(0,6)+"...":s),i.$$.dirty&1&&e(1,r=a.data.mediaData)},[a,r,o,n,s]}class vC extends ce{constructor(t){super(),le(this,t,gC,pC,ae,{tag:0},mC)}}function AC(i){he(i,"svelte-sezqcq",'@charset "UTF-8";.svelte-sezqcq.svelte-sezqcq{box-sizing:border-box}.marketing.svelte-sezqcq.svelte-sezqcq{transform:translateY(-100%)}.marketing.svelte-sezqcq .line.svelte-sezqcq{position:absolute;height:1.875rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.marketing.svelte-sezqcq .content.svelte-sezqcq{position:relative;min-width:7.5rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition-property:opacity, transform;transition-duration:500ms}.marketing.svelte-sezqcq .content .headerImage.svelte-sezqcq{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.title-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;width:100%;height:1.125rem}.title-wrapper.svelte-sezqcq .title.svelte-sezqcq{border-radius:0.25rem;width:100%;padding-left:0.625rem;padding-right:0.625rem}.title-wrapper.svelte-sezqcq .title .text.svelte-sezqcq{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem}.footer.svelte-sezqcq.svelte-sezqcq{position:relative;padding:0.5rem 0.625rem 0 0;width:100%;display:flex;align-items:center}.footer.svelte-sezqcq .goto-button.svelte-sezqcq{display:flex;align-self:flex-end;flex-wrap:wrap;align-items:center;overflow:hidden;height:0.875rem}.footer.svelte-sezqcq .goto-button .gap.svelte-sezqcq{height:100%;width:0.625rem}.footer.svelte-sezqcq .goto-button .text.svelte-sezqcq{display:block;height:100%;font-size:0.625rem}.footer.svelte-sezqcq .arrow-wrapper.svelte-sezqcq{height:0.875rem;display:flex;align-self:flex-end;flex-grow:0;flex-shrink:0;align-items:center;margin-left:0.25rem}.footer.svelte-sezqcq .arrow-wrapper svg.arrow.svelte-sezqcq{width:0.375rem;height:0.625rem}.footer.svelte-sezqcq .price.svelte-sezqcq{flex-shrink:0;margin-right:auto;white-space:nowrap;display:flex;align-items:baseline;margin-left:0.625rem}.footer.svelte-sezqcq .price .value.svelte-sezqcq{position:relative;font-size:0.875rem;line-height:1rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.footer.svelte-sezqcq .price .unit.svelte-sezqcq{padding-left:0.125rem;font-size:0.625rem}.tags-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;overflow:hidden;height:1rem;margin-top:0.25rem}.tags-wrapper.svelte-sezqcq .tags.svelte-sezqcq{position:relative;display:inline-flex;max-width:100%;flex-wrap:wrap;padding-left:0.625rem;padding-right:0.375rem}.tags-wrapper.svelte-sezqcq .tags .tag.svelte-sezqcq{display:flex;align-items:center;justify-content:center;flex-shrink:0;flex-grow:0;font-size:0.625rem;height:1rem;margin-right:0.25rem;margin-bottom:0.625rem;padding:0 0.25rem;border-radius:0.125rem;max-width:100%;text-overflow:ellipsis;overflow:hidden}.marketing.light.svelte-sezqcq .content.svelte-sezqcq{background-color:white}.marketing.light.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:rgba(0, 0, 0, 0.8)}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:#946700}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.5)}.marketing.light.svelte-sezqcq .content .footer.svelte-sezqcq{color:#946700;fill:#946700}.marketing.dark.svelte-sezqcq .content.svelte-sezqcq{background-color:rgba(0, 0, 0, 0.5)}.marketing.dark.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(255, 255, 255, 0.15);color:rgba(255, 255, 255, 0.85)}.marketing.dark.svelte-sezqcq .content .footer.svelte-sezqcq{color:#ead09a;fill:#ead09a}.marketing.unfolded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 1)}.marketing.folded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.marketing.unfolded.svelte-sezqcq .content.svelte-sezqcq{opacity:1}.marketing.folded.svelte-sezqcq .content.svelte-sezqcq{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}')}function Yh(i,t,e){const n=i.slice();return n[0]=t[e],n}function Xh(i,t,e){const n=i.slice();return n[0]=t[e],n}function Uh(i){let t,e;return{c(){t=S("img"),y(t,"class","headerImage svelte-sezqcq"),Ct(t.src,e=i[3].headerPictureUrl)||y(t,"src",e),y(t,"alt","")},m(n,s){O(n,t,s)},p(n,s){s&8&&!Ct(t.src,e=n[3].headerPictureUrl)&&y(t,"src",e)},d(n){n&&V(t)}}}function qh(i){let t,e,n,s,o=i[2]||[],r=[];for(let c=0;c<o.length;c+=1)r[c]=Jh(Xh(i,o,c));let a=i[5]||[],l=[];for(let c=0;c<a.length;c+=1)l[c]=Zh(Yh(i,a,c));return{c(){t=S("div"),e=S("div");for(let c=0;c<r.length;c+=1)r[c].c();n=ee();for(let c=0;c<l.length;c+=1)l[c].c();y(e,"class","tags svelte-sezqcq"),nt(()=>i[11].call(e)),y(t,"class","tags-wrapper svelte-sezqcq")},m(c,d){O(c,t,d),D(t,e);for(let h=0;h<r.length;h+=1)r[h]&&r[h].m(e,null);D(e,n);for(let h=0;h<l.length;h+=1)l[h]&&l[h].m(e,null);s=ks(e,i[11].bind(e))},p(c,d){if(d&4){o=c[2]||[];let h;for(h=0;h<o.length;h+=1){const u=Xh(c,o,h);r[h]?r[h].p(u,d):(r[h]=Jh(u),r[h].c(),r[h].m(e,n))}for(;h<r.length;h+=1)r[h].d(1);r.length=o.length}if(d&32){a=c[5]||[];let h;for(h=0;h<a.length;h+=1){const u=Yh(c,a,h);l[h]?l[h].p(u,d):(l[h]=Zh(u),l[h].c(),l[h].m(e,null))}for(;h<l.length;h+=1)l[h].d(1);l.length=a.length}},d(c){c&&V(t),Mt(r,c),Mt(l,c),s()}}}function Jh(i){let t,e=i[0]+"",n;return{c(){t=S("div"),n=Te(e),y(t,"class","tag primary-tag svelte-sezqcq"),j(t,"min-width",Nr)},m(s,o){O(s,t,o),D(t,n)},p(s,o){o&4&&e!==(e=s[0]+"")&&Oe(n,e)},d(s){s&&V(t)}}}function Zh(i){let t,e=i[0]+"",n;return{c(){t=S("div"),n=Te(e),y(t,"class","tag secondary-tag svelte-sezqcq"),j(t,"min-width",Nr)},m(s,o){O(s,t,o),D(t,n)},p(s,o){o&32&&e!==(e=s[0]+"")&&Oe(n,e)},d(s){s&&V(t)}}}function Kh(i){let t,e,n=i[7]&&$h(i),s=i[3].highlightText&&tu(i);return{c(){t=S("div"),n&&n.c(),e=ee(),s&&s.c(),y(t,"class","footer svelte-sezqcq")},m(o,r){O(o,t,r),n&&n.m(t,null),D(t,e),s&&s.m(t,null)},p(o,r){o[7]?n?n.p(o,r):(n=$h(o),n.c(),n.m(t,e)):n&&(n.d(1),n=null),o[3].highlightText?s?s.p(o,r):(s=tu(o),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},d(o){o&&V(t),n&&n.d(),s&&s.d()}}}function $h(i){let t,e,n=i[3].price.value+"",s,o,r=i[3].price.unit&&eu(i);return{c(){t=S("div"),e=S("span"),s=Te(n),o=ee(),r&&r.c(),y(e,"class","value svelte-sezqcq"),y(t,"class","price svelte-sezqcq")},m(a,l){O(a,t,l),D(t,e),D(e,s),D(t,o),r&&r.m(t,null)},p(a,l){l&8&&n!==(n=a[3].price.value+"")&&Oe(s,n),a[3].price.unit?r?r.p(a,l):(r=eu(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&V(t),r&&r.d()}}}function eu(i){let t,e=i[3].price.unit+"",n;return{c(){t=S("span"),n=Te(e),y(t,"class","unit svelte-sezqcq")},m(s,o){O(s,t,o),D(t,n)},p(s,o){o&8&&e!==(e=s[3].price.unit+"")&&Oe(n,e)},d(s){s&&V(t)}}}function tu(i){let t,e,n,s,o=i[3].highlightText+"",r,a,l;return{c(){t=S("div"),e=S("div"),n=ee(),s=S("span"),r=Te(o),a=ee(),l=S("div"),l.innerHTML='<svg class="arrow svelte-sezqcq" viewBox="0 0 6 9"><g transform="translate(-3, -2)" fill-rule="nonzero" class="svelte-sezqcq"><path d="M4.43868724,2.12056563 C4.28121824,1.95989074 4.02582143,1.95979988 3.86824251,2.1203627 C3.72498894,2.26632889 3.71189225,2.49481723 3.82900374,2.65587166 L6.57092402,5.92894326 C6.72651763,6.11470411 6.72651763,6.38529589 6.57092402,6.57105674 L3.86804348,9.79798499 C3.72488984,9.94405307 3.71194952,10.1725507 3.8291712,10.3335217 L3.86824251,10.3796373 C4.01149607,10.5256035 4.23559087,10.5387981 4.39346025,10.4192733 L4.43868724,10.3794344 L8.1144599,6.5985342 C8.30312347,6.40447482 8.30312347,6.09552518 8.1144599,5.9014658 L4.43868724,2.12056563 Z" class="svelte-sezqcq"></path></g></svg>',y(e,"class","gap svelte-sezqcq"),y(s,"class","text svelte-sezqcq"),y(t,"class","goto-button goto-icon svelte-sezqcq"),y(l,"class","arrow-wrapper svelte-sezqcq")},m(c,d){O(c,t,d),D(t,e),D(t,n),D(t,s),D(s,r),O(c,a,d),O(c,l,d)},p(c,d){d&8&&o!==(o=c[3].highlightText+"")&&Oe(r,o)},d(c){c&&V(t),c&&V(a),c&&V(l)}}}function bC(i){var k,T;let t,e,n,s,o,r,a,l,c,d,h=i[3].title+"",u,m,g,v,p;e=new _t({props:{visible:i[4],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let b=i[3].headerPictureUrl&&Uh(i),w=((k=i[2].length)!=null?k:0)+((T=i[5].length)!=null?T:0)>0&&qh(i),P=(i[7]||i[3].highlightText)&&Kh(i);return{c(){t=S("div"),se(e.$$.fragment),n=ee(),s=S("div"),o=ee(),r=S("div"),b&&b.c(),a=ee(),l=S("div"),c=S("div"),d=S("div"),u=Te(h),m=ee(),w&&w.c(),g=ee(),P&&P.c(),y(s,"class","line svelte-sezqcq"),j(s,"transition-delay",i[4]?fo+"ms":mo+iu-nu-40+"ms"),y(d,"class","text svelte-sezqcq"),y(c,"class","title svelte-sezqcq"),y(l,"class","title-wrapper svelte-sezqcq"),y(r,"class","content svelte-sezqcq"),j(r,"max-width",Qt(i[9])),j(r,"transition-delay",i[4]?fo+mo+"ms":"0ms"),y(t,"class",v=Qe(`marketing ${i[6]}`)+" svelte-sezqcq"),$(t,"unfolded",i[4]),$(t,"folded",i[8])},m(I,B){O(I,t,B),ne(e,t,null),D(t,n),D(t,s),D(t,o),D(t,r),b&&b.m(r,null),D(r,a),D(r,l),D(l,c),D(c,d),D(d,u),D(r,m),w&&w.m(r,null),D(r,g),P&&P.m(r,null),p=!0},p(I,[B]){var X,Z;const L={};B&16&&(L.visible=I[4]),e.$set(L),B&16&&j(s,"transition-delay",I[4]?fo+"ms":mo+iu-nu-40+"ms"),I[3].headerPictureUrl?b?b.p(I,B):(b=Uh(I),b.c(),b.m(r,a)):b&&(b.d(1),b=null),(!p||B&8)&&h!==(h=I[3].title+"")&&Oe(u,h),((X=I[2].length)!=null?X:0)+((Z=I[5].length)!=null?Z:0)>0?w?w.p(I,B):(w=qh(I),w.c(),w.m(r,g)):w&&(w.d(1),w=null),I[7]||I[3].highlightText?P?P.p(I,B):(P=Kh(I),P.c(),P.m(r,null)):P&&(P.d(1),P=null),B&16&&j(r,"transition-delay",I[4]?fo+mo+"ms":"0ms"),(!p||B&64&&v!==(v=Qe(`marketing ${I[6]}`)+" svelte-sezqcq"))&&y(t,"class",v),(!p||B&80)&&$(t,"unfolded",I[4]),(!p||B&320)&&$(t,"folded",I[8])},i(I){p||(x(e.$$.fragment,I),p=!0)},o(I){z(e.$$.fragment,I),p=!1},d(I){I&&V(t),ie(e),b&&b.d(),w&&w.d(),P&&P.d()}}}const Nr=40,fo=400,nu=500,mo=180,iu=500;function yC(i,t,e){let n,s,o,r,a,l,c,d,{tag:h}=t,u,m=(()=>{var p;const v=(p=h.data.limitWidth)!=null?p:!0;if(typeof v=="number")return v;if(v===!0)return 172})();function g(){u=this.offsetHeight,e(1,u)}return i.$$set=v=>{"tag"in v&&e(0,h=v.tag)},i.$$.update=()=>{var v,p,b,w,P,k;i.$$.dirty&1&&e(4,n=(p=(v=h.state)==null?void 0:v.unfolded)!=null?p:!1),i.$$.dirty&16&&e(8,s=!n),i.$$.dirty&1&&e(3,o=h.data),i.$$.dirty&8&&e(7,r=Fn((b=o.price)==null?void 0:b.value)&&((w=o.price)==null?void 0:w.value)!==""),i.$$.dirty&1&&e(6,a=h.data.theme||"light"),i.$$.dirty&1026&&u>40&&e(10,l=l-1),i.$$.dirty&1032&&e(2,c=((P=o.brandTags)==null?void 0:P.slice(0,l).filter(Boolean))||[]),i.$$.dirty&1036&&e(5,d=((k=o.tags)==null?void 0:k.slice(0,l-c.length).filter(Boolean))||[])},e(10,l=(m-20)/Nr),[h,u,c,o,n,d,a,r,s,m,l,g]}class wC extends ce{constructor(t){super(),le(this,t,yC,bC,ae,{tag:0},AC)}}class CC extends Audio{constructor(e){super();f(this,"sharedAudioSrc");f(this,"sharedAudioPaused",!0);f(this,"sharedAudioCurrentTime",0);f(this,"tryplaying",!1);f(this,"audioInstance");f(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 n,s,o;if(this.tryplaying)return;this.tryplaying=!0,(!this.audioInstance||((n=this.audioInstance)==null?void 0:n.realSrc)!==this.sharedAudioSrc)&&(this.audioInstance=Bb(this.sharedAudioSrc,{namespace:Sr.PlayAudio})),(s=this.eventListenerDisposer)==null||s.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.currentTime=(o=this.currentTime)!=null?o:0;const e=this.audioInstance.currentTime!==this.currentTime;this.audioInstance.play().then(()=>{var r;this.audioInstance.muted=!1,e&&(this.audioInstance.currentTime=(r=this.currentTime)!=null?r:0),this.sharedAudioPaused=!1}).catch(r=>{var a;r.message==="The operation is not supported."?console.error("Error: 音频文件可能损坏或修改过文件后缀",r):console.error("Error: error playing media in Safari",r),this.endedHandler(),(a=this.onerror)==null||a.call(this,r)}).finally(()=>{this.tryplaying=!1})})}pause(e){var n;if(this.audioInstance&&!this.paused){if(this.sharedAudioPaused=!0,(n=this.eventListenerDisposer)==null||n.call(this),this.audioInstance.ended){this.endedHandler();return}this.audioInstance.paused||this.audioInstance.pause(),this.onpause(e!=null?e:new Event("pause")),this.clear()}}dispose(){var e;(e=this.eventListenerDisposer)==null||e.call(this),this.clear(),this.audioInstance=void 0}clear(){var e;(e=this.audioInstance)==null||e.clear()}endedHandler(e){var n,s;(n=this.onended)==null||n.call(this,e!=null?e:new Event("ended")),(s=this.eventListenerDisposer)==null||s.call(this),this.sharedAudioPaused=!0,this.sharedAudioCurrentTime=0,this.clear()}addEventListeners(){const e=this.audioInstance;if(!e)return;const n=u=>{var m;this.sharedAudioCurrentTime=e.currentTime,(m=this.ontimeupdate)==null||m.call(this,u)},s=u=>{var m;e.isBlankAudio||(this.sharedAudioPaused=!1,(m=this.onplay)==null||m.call(this,u))},o=u=>{this.pause(u)},r=u=>{this.endedHandler(u)},a=u=>{var m;this.sharedAudioPaused=!0,(m=this.onerror)==null||m.call(this,u)},l=u=>{var m;return(m=this.oncanplay)==null?void 0:m.call(this,u)},c=u=>{var m;return(m=this.oncanplaythrough)==null?void 0:m.call(this,u)},d=u=>{var m;return(m=this.onloadeddata)==null?void 0:m.call(this,u)},h=u=>{var m;return(m=this.onloadedmetadata)==null?void 0:m.call(this,u)};return e.addEventListener("timeupdate",n),e.addEventListener("play",s),e.addEventListener("pause",o),e.addEventListener("ended",r),e.addEventListener("error",a),e.addEventListener("canplay",l),e.addEventListener("canplaythrough",c),e.addEventListener("loadeddata",d),e.addEventListener("loadedmetadata",h),()=>{e.removeEventListener("timeupdate",n),e.removeEventListener("play",s),e.removeEventListener("pause",o),e.removeEventListener("ended",r),e.removeEventListener("error",a),e.removeEventListener("canplay",l),e.removeEventListener("canplaythrough",c),e.removeEventListener("loadeddata",d),e.removeEventListener("loadedmetadata",h)}}}function PC(i){he(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function IC(i){let t,e,n,s;const o=i[8].default,r=Hn(o,i,i[7],null);return{c(){t=S("div"),r&&r.c(),y(t,"class","audio svelte-13e7hxv"),y(t,"style",i[0])},m(a,l){O(a,t,l),r&&r.m(t,null),e=!0,n||(s=ye(t,"click",Al(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&Nn(r,o,a,a[7],e?Wn(o,a[7],l,null):Yn(a[7]),null),(!e||l&1)&&y(t,"style",a[0])},i(a){e||(x(r,a),e=!0)},o(a){z(r,a),e=!1},d(a){a&&V(t),r&&r.d(a),n=!1,s()}}}function EC(i,t,e){let{$$slots:n={},$$scope:s}=t,{url:o}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=Ds(),d=ln("hooks"),h=ln("mediaStore");let u,m=!0;function g(){e(5,u.onplay=p=>{d.emit("playStateChange",F({event:p,state:"playing",mediaInstance:u},l)),c("play"),e(6,m=!1)},u),e(5,u.onpause=p=>{d.emit("playStateChange",F({event:p,state:"paused",mediaInstance:u},l)),c("pause"),e(6,m=!0)},u),e(5,u.onended=p=>{d.emit("playStateChange",F({event:p,state:"paused",mediaInstance:u},l)),c("pause"),e(6,m=!0)},u),e(5,u.onloadedmetadata=p=>{typeof u.duration=="number"&&!Number.isNaN(u.duration)&&c("duration",u.duration)},u),e(5,u.onerror=p=>{c("pause"),e(6,m=!0)},u),e(5,u.ontimeupdate=p=>{c("timeupdate",u.currentTime)},u)}h.subscribe(({currentMediaElement:p})=>{p!==u&&(m||u==null||u.pause())});function v(p){u&&(d.emit("click",F({event:p,target:"AudioTagPlayIcon",audioInstance:u},l)),h.set({currentMediaElement:u}),d.emit("playStateChange",F({event:p,state:u.paused?"playing":"paused",mediaInstance:u},l)),u.paused?u.play():u.pause())}return i.$$set=p=>{"url"in p&&e(2,o=p.url),"enable"in p&&e(3,r=p.enable),"style"in p&&e(0,a=p.style),"hooksInfo"in p&&e(4,l=p.hooksInfo),"$$scope"in p&&e(7,s=p.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(o||c("duration",0)),i.$$.dirty&36&&(u==null||u.dispose(),e(5,u=new CC(o)),c("audioRef",u),setTimeout(()=>c("audioRef",u),200),g()),i.$$.dirty&40&&(r||u==null||u.pause()),i.$$.dirty&72&&c(r&&!m?"play":"pause")},[a,v,o,r,l,u,m,s,n]}let su=class extends ce{constructor(t){super(),le(this,t,EC,IC,ae,{url:2,enable:3,style:0,hooksInfo:4},PC)}};function kC(i){he(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 ou(i){let t,e;return t=new _t({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function xC(i){let t,e,n,s,o,r=i[1]&&ou();return{c(){t=S("div"),r&&r.c(),e=ee(),n=S("div"),s=S("div"),s.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>',y(s,"class","sound-wave__container svelte-srt2pi"),y(n,"class","audio-icon svelte-srt2pi"),$(n,"playing",i[0]),y(t,"class","audio-icon__wrapper svelte-srt2pi"),y(t,"style",i[2]),j(t,"width",i[5]),j(t,"height",i[5])},m(a,l){O(a,t,l),r&&r.m(t,null),D(t,e),D(t,n),D(n,s),i[7](s),i[8](t),o=!0},p(a,[l]){a[1]?r?l&2&&x(r,1):(r=ou(),r.c(),x(r,1),r.m(t,e)):r&&(ue(),z(r,1,1,()=>{r=null}),fe()),(!o||l&1)&&$(n,"playing",a[0]),(!o||l&4)&&y(t,"style",a[2]);const c=l&4;(c||l&36)&&j(t,"width",a[5]),(c||l&36)&&j(t,"height",a[5])},i(a){o||(x(r),o=!0)},o(a){z(r),o=!1},d(a){a&&V(t),r&&r.d(),i[7](null),i[8](null)}}}function MC(i,t,e){let n,{playing:s}=t,{shadow:o=!1}=t,{style:r=null}=t,{width:a="100%"}=t,l,c;function d(u){Re[u?"unshift":"push"](()=>{c=u,e(4,c)})}function h(u){Re[u?"unshift":"push"](()=>{l=u,e(3,l)})}return i.$$set=u=>{"playing"in u&&e(0,s=u.playing),"shadow"in u&&e(1,o=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"?Qt(a):a)},[s,o,r,l,c,n,a,d,h]}class ru extends ce{constructor(t){super(),le(this,t,MC,xC,ae,{playing:0,shadow:1,style:2,width:6},kC)}}function SC(i){he(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 au(i){var p,b;let t,e,n,s,o,r,a,l,c,d,h,u,m,g;e=new _t({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let v=i[6]&&lu(i);return c=new $d({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),h=new zr({props:{unfolded:i[6],length:i[3],outDelay:i[4]+20*Math.min((b=(p=i[5])==null?void 0:p.length)!=null?b:10,15),useLinearColor:!0}}),{c(){t=S("div"),se(e.$$.fragment),n=ee(),s=S("div"),o=S("div"),r=S("div"),v&&v.c(),a=ee(),l=S("div"),se(c.$$.fragment),d=ee(),se(h.$$.fragment),y(r,"class","audio-icon svelte-1s6gk4a"),j(l,"display","inline-block"),y(o,"class","wrapper svelte-1s6gk4a"),y(s,"class","content svelte-1s6gk4a"),y(t,"class","audio-tag svelte-1s6gk4a"),$(t,"unfolded",i[6])},m(w,P){O(w,t,P),ne(e,t,null),D(t,n),D(t,s),D(s,o),D(o,r),v&&v.m(r,null),D(o,a),D(o,l),ne(c,l,null),D(t,d),ne(h,t,null),u=!0,m||(g=[ye(l,"click",i[7]),Nt(ei.call(null,l)),ye(l,"clientWidth",i[12])],m=!0)},p(w,P){var B,L;const k={};P&64&&(k.visible=w[6]),P&8&&(k.left=w[3]/2+"px"),e.$set(k),w[6]?v?(v.p(w,P),P&64&&x(v,1)):(v=lu(w),v.c(),x(v,1),v.m(r,null)):v&&(ue(),z(v,1,1,()=>{v=null}),fe());const T={};P&64&&(T.visible=w[6]),P&2&&(T.textUnfolded=w[1]),P&32&&(T.content=w[5]),c.$set(T);const I={};P&64&&(I.unfolded=w[6]),P&8&&(I.length=w[3]),P&48&&(I.outDelay=w[4]+20*Math.min((L=(B=w[5])==null?void 0:B.length)!=null?L:10,15)),h.$set(I),(!u||P&64)&&$(t,"unfolded",w[6])},i(w){u||(x(e.$$.fragment,w),x(v),x(c.$$.fragment,w),x(h.$$.fragment,w),u=!0)},o(w){z(e.$$.fragment,w),z(v),z(c.$$.fragment,w),z(h.$$.fragment,w),u=!1},d(w){w&&V(t),ie(e),v&&v.d(),ie(c),ie(h),m=!1,Ze(g)}}}function lu(i){let t,e,n,s,o,r,a;return e=new _t({props:{center:!0,blurRadius:15,spreadRadius:6}}),s=new su({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[DC]},$$scope:{ctx:i}}}),s.$on("play",i[8]),s.$on("pause",i[9]),s.$on("error",i[10]),s.$on("audioRef",i[11]),{c(){t=S("div"),se(e.$$.fragment),n=ee(),se(s.$$.fragment),y(t,"class","audio svelte-1s6gk4a")},m(l,c){O(l,t,c),ne(e,t,null),D(t,n),ne(s,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&8196&&(d.$$scope={dirty:c,ctx:i}),s.$set(d)},i(l){a||(x(e.$$.fragment,l),x(s.$$.fragment,l),l&&nt(()=>{a&&(r&&r.end(1),o=yn(t,wn,{duration:1e3,delay:0,easing:ni}),o.start())}),a=!0)},o(l){var c,d;z(e.$$.fragment,l),z(s.$$.fragment,l),o&&o.invalidate(),l&&(r=Kn(t,wn,{duration:1e3,delay:20*Math.min((d=(c=i[5])==null?void 0:c.length)!=null?d:10,15),easing:ni})),a=!1},d(l){l&&V(t),ie(e),ie(s),l&&r&&r.end()}}}function DC(i){let t,e,n;return e=new ru({props:{playing:i[2]}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(s,o){O(s,t,o),ne(e,t,null),n=!0},p(s,o){const r={};o&4&&(r.playing=s[2]),e.$set(r)},i(s){n||(x(e.$$.fragment,s),n=!0)},o(s){z(e.$$.fragment,s),n=!1},d(s){s&&V(t),ie(e)}}}function LC(i){let t,e,n=i[0].state&&au(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[0].state?n?(n.p(s,o),o&1&&x(n,1)):(n=au(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function TC(i,t,e){let n,s,o,{tag:r}=t,a=!1,l=!1,c;function d(){e(1,a=!a)}const h=()=>{e(2,l=!0)},u=()=>{e(2,l=!1)},m=()=>{e(2,l=!1)};function g(p){Un.call(this,i,p)}const v=p=>{e(3,c=p.detail)};return i.$$set=p=>{"tag"in p&&e(0,r=p.tag)},i.$$.update=()=>{var p,b,w;i.$$.dirty&1&&e(6,n=!!((p=r.state)!=null&&p.unfolded)),i.$$.dirty&1&&e(5,s=(w=(b=r.data.title)!=null?b:r.data.text)!=null?w:""),i.$$.dirty&2&&e(4,o=a?450:0)},[r,a,l,c,o,s,n,d,h,u,m,g,v]}class zC extends ce{constructor(t){super(),le(this,t,TC,LC,ae,{tag:0},SC)}}function jC(i){he(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 cu(i){let t,e,n,s;return n=new su({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[OC]},$$scope:{ctx:i}}}),n.$on("play",i[6]),n.$on("pause",i[7]),n.$on("error",i[8]),n.$on("timeupdate",i[9]),n.$on("duration",i[10]),n.$on("audioRef",i[11]),{c(){t=S("div"),e=S("div"),se(n.$$.fragment),y(e,"class","audio-tag svelte-58hfjf"),j(e,"background-color",i[4].bgColor),j(e,"color",i[4].fontColor),y(t,"class","audio-tag__wrapper svelte-58hfjf")},m(o,r){O(o,t,r),D(t,e),ne(n,e,null),s=!0},p(o,r){const a={};r&1&&(a.enable=o[0].state.visible),r&1&&(a.url=o[0].data.audioUrl),r&1&&(a.hooksInfo={tag:o[0]}),r&8232&&(a.$$scope={dirty:r,ctx:o}),n.$set(a),r&16&&j(e,"background-color",o[4].bgColor),r&16&&j(e,"color",o[4].fontColor)},i(o){s||(x(n.$$.fragment,o),s=!0)},o(o){z(n.$$.fragment,o),s=!1},d(o){o&&V(t),ie(n)}}}function VC(i){let t;return{c(){t=Te(i[5])},m(e,n){O(e,t,n)},p(e,n){n&32&&Oe(t,e[5])},d(e){e&&V(t)}}}function OC(i){let t,e,n,s,o,r,a;return n=new ru({props:{playing:i[3]}}),r=new Vr({props:{maxWidth:72,$$slots:{default:[VC]},$$scope:{ctx:i}}}),{c(){t=S("div"),e=S("div"),se(n.$$.fragment),s=ee(),o=S("div"),se(r.$$.fragment),y(e,"class","audio-icon__wrapper svelte-58hfjf"),y(o,"class","text svelte-58hfjf"),y(t,"class","audio__inner svelte-58hfjf")},m(l,c){O(l,t,c),D(t,e),ne(n,e,null),D(t,s),D(t,o),ne(r,o,null),a=!0},p(l,c){const d={};c&8&&(d.playing=l[3]),n.$set(d);const h={};c&8224&&(h.$$scope={dirty:c,ctx:l}),r.$set(h)},i(l){a||(x(n.$$.fragment,l),x(r.$$.fragment,l),a=!0)},o(l){z(n.$$.fragment,l),z(r.$$.fragment,l),a=!1},d(l){l&&V(t),ie(n),ie(r)}}}function BC(i){let t,e,n=i[0].state&&cu(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[0].state?n?(n.p(s,o),o&1&&x(n,1)):(n=cu(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function _C(i,t,e){let n,s,{tag:o}=t;const r={light:{bgColor:"rgba(255, 255, 255, 0.3)",fontColor:"rgba(0, 0, 0, 0.6)"},dark:{bgColor:"rgba(0, 0, 0, 0.3)",fontColor:"white"}};let a=0,l=0,c=!1;const d=()=>{e(3,c=!0)},h=()=>{e(3,c=!1)},u=()=>{e(3,c=!1)},m=p=>{e(1,a=p.detail)},g=p=>{e(2,l=p.detail)};function v(p){Un.call(this,i,p)}return i.$$set=p=>{"tag"in p&&e(0,o=p.tag)},i.$$.update=()=>{var p,b,w;i.$$.dirty&1&&e(5,n=(b=(p=o.data.title)!=null?p:o.data.text)!=null?b:""),i.$$.dirty&1&&e(4,s=(w=r[o.data.theme||"light"])!=null?w:r.light)},[o,a,l,c,s,n,d,h,u,m,g,v]}class QC extends ce{constructor(t){super(),le(this,t,_C,BC,ae,{tag:0},jC)}}function RC(i){let t,e;return t=new QC({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.tag=n[0]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function GC(i){let t,e;return t=new zC({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.tag=n[0]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function FC(i){let t,e,n,s;const o=[GC,RC],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=o[t](i)),{c(){e&&e.c(),n=ke()},m(l,c){~t&&r[t].m(l,c),O(l,n,c),s=!0},p(l,[c]){let d=t;t=a(l),t===d?~t&&r[t].p(l,c):(e&&(ue(),z(r[d],1,1,()=>{r[d]=null}),fe()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=o[t](l),e.c()),x(e,1),e.m(n.parentNode,n)):e=null)},i(l){s||(x(e),s=!0)},o(l){z(e),s=!1},d(l){~t&&r[t].d(l),l&&V(n)}}}function HC(i,t,e){let n,{tag:s}=t,o;function r(a){o=a.detail}return s.play=()=>o.play(),s.pause=()=>o.pause(),i.$$set=a=>{"tag"in a&&e(0,s=a.tag)},i.$$.update=()=>{var a;i.$$.dirty&1&&e(1,n=(a=s.data.appearance)!=null?a:"line")},[s,n,r]}class WC extends ce{constructor(t){super(),le(this,t,HC,FC,ae,{tag:0})}}function NC(i){he(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function du(i){var s;let t,e,n;return e=new Fh({props:{mediaItemConfig:{canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(s=i[4])!=null?s:"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=S("div"),se(e.$$.fragment),y(t,"class","media-wrapper svelte-10cw0el")},m(o,r){O(o,t,r),ne(e,t,null),n=!0},p(o,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=o[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:o[2]}),r&64&&(a.unfolded=o[6]),r&32&&(a.mediaData=o[5]),r&2&&(a.enableCarousel=o[1]),r&8&&(a.autoplayConfig=o[3]),r&1&&(a.tag=o[0]),e.$set(a)},i(o){n||(x(e.$$.fragment,o),n=!0)},o(o){z(e.$$.fragment,o),n=!1},d(o){o&&V(t),ie(e)}}}function YC(i){let t,e,n=i[0].state&&i[5]&&du(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[0].state&&s[5]?n?(n.p(s,o),o&33&&x(n,1)):(n=du(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function XC(i,t,e){let n,s,o,r,a,l,{tag:c}=t;return i.$$set=d=>{"tag"in d&&e(0,c=d.tag)},i.$$.update=()=>{var d,h;i.$$.dirty&1&&e(6,n=c.state?c.state.unfolded:!1),i.$$.dirty&1&&e(5,s=c.data.mediaData),i.$$.dirty&1&&e(1,o=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:o!=null?o:!0,autoplayVideo:!0}),i.$$.dirty&1&&e(2,l=(h=c.data.objectFit)!=null?h:(()=>c.data.adaptationMode==="stretch"?"fill":c.data.adaptationMode==="proportional"?"contain":void 0)())},[c,o,l,a,r,s,n]}class UC extends ce{constructor(t){super(),le(this,t,XC,YC,ae,{tag:0},NC)}}function hu(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 qC(i){return Y(this,null,function*(){const{url:t,ratio:e=3}=i;i.ratio||console.warn("Tag icon ratio is not set, default is 3");const{width:n,height:s}=yield hu(t);return we(F({},i),{width:n/e,height:s/e})})}function JC(i){return Y(this,null,function*(){const{steps:t,url:e,ratio:n=3,fps:s=24}=i;if(!t)throw new Error("KeyframeIcon requires steps");const{width:o,height:r}=yield hu(e),a=o/n,l=r/n,c=a/t,d=l,h=1/s*t+"s";return we(F({},i),{width:c,height:d,duration:h})})}function ZC(i){he(i,"svelte-316sq3","@keyframes svelte-316sq3-sprites-animation{0%{background-position:0 0}100%{background-position:100% 0}}.icon-image.svelte-316sq3{display:block;width:auto}.icon-keyframe.svelte-316sq3{background-repeat:no-repeat;background-size:auto 100%;animation-direction:normal;animation-iteration-count:infinite;animation-name:svelte-316sq3-sprites-animation;animation-delay:0}")}function uu(i){i[1]=i[19].width}function fu(i){i[1]=i[19].width,i[16]=i[19].height,i[17]=i[19].steps,i[18]=i[19].duration}function mu(i){let t,e,n,s=i[0]&&pu();function o(l,c){return l[8]?$C:KC}let r=o(i),a=r(i);return{c(){t=S("div"),s&&s.c(),e=ee(),a.c(),y(t,"class","icon"),j(t,"width",i[1])},m(l,c){O(l,t,c),s&&s.m(t,null),D(t,e),a.m(t,null),n=!0},p(l,c){l[0]?s?c&1&&x(s,1):(s=pu(),s.c(),x(s,1),s.m(t,e)):s&&(ue(),z(s,1,1,()=>{s=null}),fe()),r===(r=o(l))&&a?a.p(l,c):(a.d(1),a=r(l),a&&(a.c(),a.m(t,null))),c&2&&j(t,"width",l[1])},i(l){n||(x(s),n=!0)},o(l){z(s),n=!1},d(l){l&&V(t),s&&s.d(),a.d()}}}function pu(i){let t,e;return t=new _t({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function KC(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:nP,then:tP,catch:eP,value:19};return zs(e=i[11](Fe({url:i[7],ratio:i[5]})),n),{c(){t=ke(),n.block.c()},m(s,o){O(s,t,o),n.block.m(s,n.anchor=o),n.mount=()=>t.parentNode,n.anchor=t},p(s,o){i=s,n.ctx=i,o&160&&e!==(e=i[11](Fe({url:i[7],ratio:i[5]})))&&zs(e,n)||Ml(n,i,o)},d(s){s&&V(t),n.block.d(s),n.token=null,n=null}}}function $C(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:oP,then:sP,catch:iP,value:19};return zs(e=i[10](Fe({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})),n),{c(){t=ke(),n.block.c()},m(s,o){O(s,t,o),n.block.m(s,n.anchor=o),n.mount=()=>t.parentNode,n.anchor=t},p(s,o){i=s,n.ctx=i,o&228&&e!==(e=i[10](Fe({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})))&&zs(e,n)||Ml(n,i,o)},d(s){s&&V(t),n.block.d(s),n.token=null,n=null}}}function eP(i){return{c:J,m:J,p:J,d:J}}function tP(i){uu(i);let t,e;return{c(){t=S("img"),y(t,"alt","tag-icon"),y(t,"class","icon-image svelte-316sq3"),Ct(t.src,e=i[7])||y(t,"src",e),j(t,"width",Qt(ui({originWidth:i[1],scale:i[4],wantedWidth:i[3]}).width))},m(n,s){O(n,t,s)},p(n,s){uu(n),s&128&&!Ct(t.src,e=n[7])&&y(t,"src",e),s&184&&j(t,"width",Qt(ui({originWidth:n[1],scale:n[4],wantedWidth:n[3]}).width))},d(n){n&&V(t)}}}function nP(i){return{c:J,m:J,p:J,d:J}}function iP(i){return{c:J,m:J,p:J,d:J}}function sP(i){fu(i);let t,e=`url(${i[7]})`,n=`steps(${i[17]}, jump-none)`;return{c(){t=S("div"),y(t,"class","icon-keyframe svelte-316sq3"),j(t,"width",Qt(ui({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).width)),j(t,"height",Qt(ui({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).height)),j(t,"background-image",e),j(t,"animation-duration",i[18]),j(t,"animation-timing-function",n)},m(s,o){O(s,t,o)},p(s,o){fu(s),o&252&&j(t,"width",Qt(ui({originWidth:s[1],originHeight:s[16],scale:s[4],wantedWidth:s[3]}).width)),o&252&&j(t,"height",Qt(ui({originWidth:s[1],originHeight:s[16],scale:s[4],wantedWidth:s[3]}).height)),o&128&&e!==(e=`url(${s[7]})`)&&j(t,"background-image",e),o&228&&j(t,"animation-duration",s[18]),o&228&&n!==(n=`steps(${s[17]}, jump-none)`)&&j(t,"animation-timing-function",n)},d(s){s&&V(t)}}}function oP(i){return{c:J,m:J,p:J,d:J}}function rP(i){let t,e,n=i[9]&&mu(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[9]?n?(n.p(s,o),o&512&&x(n,1)):(n=mu(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function ui(i){const{originWidth:t,originHeight:e,scale:n=1,wantedWidth:s}=i,o=(s!=null?s:t)*n,r=typeof e=="number"?o*(e/t):void 0;return we(F({},i),{width:o,height:r})}function aP(i,t,e){let n,s,o,r,a,l,c,d,h,{width:u=null}=t,{icon:m=null}=t,{shadow:g=!1}=t;const v=Ds();function p(P){return Y(this,null,function*(){const k=yield JC(P);return v("iconLoaded",k),k})}function b(P){return Y(this,null,function*(){if(typeof h=="number")return we(F({},P),{width:h});const k=yield qC(P);return v("iconLoaded",k),k})}function w(){d||v("iconLoaded")}return At(()=>{w()}),i.$$set=P=>{"width"in P&&e(1,u=P.width),"icon"in P&&e(12,m=P.icon),"shadow"in P&&e(0,g=P.shadow)},i.$$.update=()=>{var P,k;i.$$.dirty&4096&&e(7,n=m==null?void 0:m.url),i.$$.dirty&4096&&e(2,s=(P=m==null?void 0:m.steps)!=null?P:1),i.$$.dirty&4096&&e(6,o=m==null?void 0:m.fps),i.$$.dirty&4096&&e(5,r=m==null?void 0:m.ratio),i.$$.dirty&4096&&e(4,a=(k=m==null?void 0:m.scale)!=null?k:1),i.$$.dirty&4096&&e(3,l=m==null?void 0:m.width),i.$$.dirty&252&&e(9,c=Fe({url:n,steps:s,fps:o,ratio:r,scale:a,width:l})),i.$$.dirty&4&&e(8,d=s>1),i.$$.dirty&2&&(h=u)},w(),[g,u,s,l,a,r,o,n,d,c,p,b,m]}class gu extends ce{constructor(t){super(),le(this,t,aP,rP,ae,{width:1,icon:12,shadow:0},ZC)}}function lP(i){he(i,"svelte-e58ijk",".wrapper.svelte-e58ijk{font-weight:600;cursor:pointer;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:auto}.text-wrapper.svelte-e58ijk{position:relative;display:flex;align-items:center;justify-content:center}.text.svelte-e58ijk{position:absolute;top:0;font-size:0.875rem;color:#ffffff;letter-spacing:0;text-align:center;max-width:8.75rem;width:-moz-max-content;width:max-content;line-height:1.125rem;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function vu(i){let t,e,n,s,o,r;return e=new _t({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=S("div"),se(e.$$.fragment),n=ee(),s=S("div"),o=Te(i[1]),y(s,"class","text svelte-e58ijk"),y(t,"class","text-wrapper svelte-e58ijk")},m(a,l){O(a,t,l),ne(e,t,null),D(t,n),D(t,s),D(s,o),r=!0},p(a,l){(!r||l&2)&&Oe(o,a[1])},i(a){r||(x(e.$$.fragment,a),r=!0)},o(a){z(e.$$.fragment,a),r=!1},d(a){a&&V(t),ie(e)}}}function cP(i){let t,e,n,s;e=new gu({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[4]);let o=i[1]&&i[2]&&vu(i);return{c(){t=S("div"),se(e.$$.fragment),n=ee(),o&&o.c(),y(t,"class","wrapper svelte-e58ijk")},m(r,a){O(r,t,a),ne(e,t,null),D(t,n),o&&o.m(t,null),s=!0},p(r,[a]){const l={};a&1&&(l.icon=r[0]),e.$set(l),r[1]&&r[2]?o?(o.p(r,a),a&6&&x(o,1)):(o=vu(r),o.c(),x(o,1),o.m(t,null)):o&&(ue(),z(o,1,1,()=>{o=null}),fe())},i(r){s||(x(e.$$.fragment,r),x(o),s=!0)},o(r){z(e.$$.fragment,r),z(o),s=!1},d(r){r&&V(t),ie(e),o&&o.d()}}}function dP(i,t,e){let n,s,o,{tag:r}=t;const a=()=>{e(2,n=!0)};return i.$$set=l=>{"tag"in l&&e(3,r=l.tag)},i.$$.update=()=>{var l,c,d;i.$$.dirty&8&&e(1,s=(l=r.data.title)!=null?l:r.data.text),i.$$.dirty&8&&e(0,o=(d=r.data.icon)!=null?d:(c=r.style)==null?void 0:c.point)},e(2,n=!1),[o,s,n,r,a]}class hP extends ce{constructor(t){super(),le(this,t,dP,cP,ae,{tag:3},lP)}}function uP(i){he(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function fP(i){let t,e;return{c(){t=new xs(!1),e=ke(),t.a=e},m(n,s){t.m(i[2],n,s),O(n,e,s)},p:J,d(n){n&&V(e),n&&t.d()}}}function mP(i){let t,e=typeof i[2]=="string"&&fP(i);return{c(){t=S("div"),e&&e.c(),y(t,"class","customElement__container svelte-kzl2aj"),$(t,"unfolded",i[1])},m(n,s){O(n,t,s),e&&e.m(t,null),i[5](t)},p(n,[s]){typeof n[2]=="string"&&e.p(n,s),s&2&&$(t,"unfolded",n[1])},i:J,o:J,d(n){n&&V(t),e&&e.d(),i[5](null)}}}function pP(i,t,e){var d,h;let n,{tag:s}=t,{renderMap:o=new Map}=t,r,a=(h=s.element)!=null?h:(d=o.get(s.contentType))==null?void 0:d.renderer,l;At(()=>{r&&(a instanceof Element?(r.appendChild(a),l=()=>{a instanceof Element&&a.remove()}):typeof a=="function"&&(l=a(r,s)))}),Vt(()=>{l==null||l()});function c(u){Re[u?"unshift":"push"](()=>{r=u,e(0,r)})}return i.$$set=u=>{"tag"in u&&e(3,s=u.tag),"renderMap"in u&&e(4,o=u.renderMap)},i.$$.update=()=>{i.$$.dirty&8&&e(1,n=s.state.unfolded)},[r,n,a,s,o,c]}class gP extends ce{constructor(t){super(),le(this,t,pP,mP,ae,{tag:3,renderMap:4},uP)}}function vP(i){he(i,"svelte-1r4fqvg",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAAAhAAAAAkaG10eJ9gBO8AAADsAAABJG1heHAASVAAAAAArAAAAAZuYW1lqczkZQAAApQAAAJecG9zdP+4ADIAAAZwAAAAIAAAUAAASQAAAAEAAAABAADkeHeyXw889QADA+gAAAAA2NoRKwAAAADY2hErACn/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACCAA7AcwAdwIIADMCCAA0AhwAMwISADkCCAAuAfQANAH+ACsB/gApAggANAEeAFABHgBQAR4AUAIIADQCCAAuAR4AUAEeAFABfAAxAAEAAAPo/zgAAAIcACkAKQHgAAEAAAAAAAAAAAAAAAAAAABJAAMCLgGQAAUACAKKAlgAAABLAooCWAAAAV4AMgEsAAAAAAgAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFVLV04AIAAg/xsDIP84AMgD6ADIAAAAAQAAAAAB9AK8AAAAIAAAAAAAEADGAAEAAAAAAAEADAAAAAEAAAAAAAIABAAMAAEAAAAAAAMAGwAQAAEAAAAAAAQAEQArAAEAAAAAAAUAPAA8AAEAAAAAAAYAEAB4AAEAAAAAAAgADAAAAAEAAAAAAAkADAAAAAMAAQQJAAEAGACIAAMAAQQJAAIACACgAAMAAQQJAAMANgCoAAMAAQQJAAQAIgDeAAMAAQQJAAUAeAEAAAMAAQQJAAYAIAF4AAMAAQQJAAgAGACIAAMAAQQJAAkAGACIQUxJQkFCQSBGb250Qm9sZDEuMDAwO1VLV047QUxJQkFCQUZvbnQtQm9sZEFMSUJBQkEgRm9udCBCb2xkVmVyc2lvbiAxLjAwMDtQUyAwMDEuMDAwO2hvdGNvbnYgMS4wLjg4O21ha2VvdGYubGliMi41LjY0Nzc1QUxJQkFCQUZvbnQtQm9sZABBAEwASQBCAEEAQgBBACAARgBvAG4AdABCAG8AbABkADEALgAwADAAMAA7AFUASwBXAE4AOwBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAEEATABJAEIAQQBCAEEAIABGAG8AbgB0ACAAQgBvAGwAZABWAGUAcgBzAGkAbwBuACAAMQAuADAAMAAwADsAUABTACAAMAAwADEALgAwADAAMAA7AGgAbwB0AGMAbwBuAHYAIAAxAC4AMAAuADgAOAA7AG0AYQBrAGUAbwB0AGYALgBsAGkAYgAyAC4ANQAuADYANAA3ADcANQBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAAAAAAADAAAAAwAAASIAAQAAAAAAHAADAAEAAAEiAAABBgAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAABCSEMANjc4OTo7PD0+PwAAAAAAAAACAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGwAAAAAAABwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAFoAAAAQABAAAwAAACAALgA5AFoAegCl/xv//wAAACAALAAwAEEAYQCl/xr////hAAAABv/B/7v/nwAAAAEAAAAOAAAAAAAAAAAACgAAAEIASABDAEYARwADAAAAAAAA/7UAMgAAAAAAAAAAAAAAAAAAAAAAAAAAAQAEAgABAQERQUxJQkFCQUZvbnQtQm9sZAABAQEg+A8A+CAB+CEC+BgEtPtc+HT5tAX3KA/3UBGcHAZWEgAHAQENExoiKTpLbmluZS4wMDEuMDAxbW9uZXkudW5pRkYxQm5pbmUuMDAxdW5pRkYxQWNvcHlyaWdodCBtaXNzaW5nQUxJQkFCQSBGb250IEJvbGQAAAEAAQAAIhkAQhkAEQkBhwABigAADQAADwAAZAABiAABiwABiQAADgAASQIAAQCtAK4ArwCwALEAsgCzALQAtQC2ALcAuAC5ALoAuwC8AL0AvgC/AMAAwQDCAMMAxADFAMYAxwDIAMkAygDLAMwAzQDOAM8A0ADRANIA0wDUANUA1gDXANgA2QDaANsA3ADdAN4A3wDgAOEA4gFDAVoBqwIsAloCuAMcAzkDzwQ4BDoEPARRBFMEVQTNBOIE8QUEmPtc0Ky6rKKsuqzHrKPDoa2irLCspq2vraWssKzOAejVrKytrKzYA/gu+bQV+9H+fPfRBj76ORVqSWbNavs6rM2wSqwH7vsVFUXNafs68wfNaRVqZ6wG704VaklFJ6zNsEmsB/c6TxUn+zqt9xnNB6z7DhX7Bfs69wWsO++6anRpwwfv+0EV+wX7OvcFB/cZahUnXO8GrFMVamsHRVwF8Wr7OqwG0boFRawGDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OrIr5UQH3OPdUA/ebihVmaZSdbB9Mr2TL0xr3vgewlK2eqh7Kr86y1BuvrIJ5qh/HZrJIQhr7vgdngmp5bR5OZ0tkQxv46ARUX2FSH/u+B1a5YMDAs7TCHve+B8RjtVYeDnD4utkB93HzA/cL+QgVPfH8vPP5UgcOrIn5UgG++DYD+GmJFfw28wb3svfUBZ2glKSnGsNduFBWXF1UiB4ijgaMsJWsnqoIyLHMstYbsa6Ceawfy2ezSUAaVndXZ2Me+2/7jQX3pwYOrIvy92Tz90ryEr/zM/L3SvMu8hPy+B/3/xUT7LCwpMDDGq6CrHqoHsZnTK5DG2lrg3puH09pZk5EGobykAe4tba6vrViXFZiYlcedyOfBhPyxLpdUlJcW1JSXLvEH5ojfAdllGiebB5LsM5j1xuwrpSeqx/KsLPO1xrKcMNerx4OwPL1Affi8gP4dPdlFWD4fPshBvuJ/HkF+wH3ryPy87YH+8z1Ffc69+QF++QHDrb3ZNf3ZfAB9zX3YwP3nRZlaJSebB9LsGPO1xrzBlK6XMTEubrEHtcHxF26UlJcXFIeI/g0+BYh+677JAaorK2ZsBuwroJ4qx/LZrNHPxo/B2aCaHhrHktmR2NAGw6si/X3b/IBufX3b/ID95n4QBWAg4uKhh/3EfelBfsHBvtK/CMFfnCFbm0aZJVnnmoeSrLPYdobsq6Vnqwfy7K10dgasoGueKwey2RHtT4b+9YETlu7yMe8vcfHvVlPT1laTx8OmIr5UQG/+B8D93iKFfsIBvdo+OYF+6T2+B8oBg6iifL3bPX3QPEStvNB8vc/8jXxE/L4EvgHFRPss7Cnu78arYOreqgexWpNr0YbaWyDem4fUmlmTUcaXqBftGAeE/JWYmROSxpklWieax5Ksc9i2BuxrpWerB/LsbTP2BrHaMVath4T7PsN93QVu7FjXFtlZltcZbC7urGzuh8T8oX8ghVPW7zHx7q6yMa9W1BPWVpQHw6i96Tz92/0AbTz93DzA/hp+HkVsIGveKwezmNFtUAbZGeBeGofSmNiRT8aZJVnnmseSrHPYtoboAb7EvukBfcHBvdL+CEFmaySqaQa+9gWxry+yJ6dhoGcHq12oWZmGk5YW1BMXLnKHg4gCiEK+11L91IlCvdiyhWtb6hpJgoeJAoOIQogCqz3pe/3b/UBufX3bfQD+G74dxWyga94rB7NZEW0PhtlaIF4ah9KY2FFPxo7tkTPZh6MjIqKjB+TiJCIjYoIjgaCoKGHoRuanY6QoB+IgfsB+6QF9wcG9y/4IgWYppGnqhr7a/sCFVBbvMjHu7zGyLxbTk5aWk4fDvtd+AojCoz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-1r4fqvg{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.withAnimation.svelte-1r4fqvg{transition:opacity 0.3s linear}.content__container.unClickable.svelte-1r4fqvg{pointer-events:none !important}.content__container.unClickable.svelte-1r4fqvg *{pointer-events:none !important}.content__wrapper.svelte-1r4fqvg{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-1r4fqvg{opacity:0;pointer-events:none}.content__container.hide.svelte-1r4fqvg *{pointer-events:none !important}.content__container.disable.svelte-1r4fqvg{display:none}.content.svelte-1r4fqvg{position:relative;width:100%;height:100%;font-size:0.75rem;color:#fff}.content.svelte-1r4fqvg:not(.unfolded){pointer-events:none}.content.svelte-1r4fqvg:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-1r4fqvg{pointer-events:auto}')}function AP(i){let t,e;return{c(){t=S("div"),y(t,"data-info","tag content is keep folded"),y(t,"data-id",e=i[1].id)},m(n,s){O(n,t,s)},p(n,s){s&2&&e!==(e=n[1].id)&&y(t,"data-id",e)},i:J,o:J,d(n){n&&V(t)}}}function bP(i){let t,e,n,s,o,r,a,l,c,d;const h=[kP,EP,IP,PP,CP,wP],u=[];function m(g,v){return g[1].contentType==="Text"?0:g[1].contentType==="ImageText"||g[1].contentType==="Image"||g[1].contentType==="Video"?1:g[1].contentType==="Audio"?2:g[1].contentType==="Marketing"?3:g[1].contentType==="Link"||g[1].contentType==="VRLink"||g[1].contentType==="PanoLink"||g[1].contentType==="Sticker"?4:g[1].contentType==="MediaPlane"||g[1].contentType==="MediaModel"?5:-1}return~(s=m(i))&&(o=u[s]=h[s](i)),{c(){var g;t=S("div"),e=S("div"),n=S("div"),o&&o.c(),y(n,"class","content svelte-1r4fqvg"),$(n,"unfolded",(g=i[1].state)==null?void 0:g.unfolded),y(e,"class","content__wrapper svelte-1r4fqvg"),y(t,"class",r=Qe(st("content__container",i[1].className))+" svelte-1r4fqvg"),y(t,"data-id",a=i[1].id),$(t,"disable",i[1].enabled===!1),$(t,"hide",i[5]),$(t,"withAnimation",i[0]),$(t,"unClickable",i[1].config.clickable===!1),j(t,"width",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0),j(t,"height",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0)},m(g,v){O(g,t,v),D(t,e),D(e,n),~s&&u[s].m(n,null),l=!0,c||(d=ye(t,"click",Al(i[15])),c=!0)},p(g,v){var b;let p=s;s=m(g),s===p?~s&&u[s].p(g,v):(o&&(ue(),z(u[p],1,1,()=>{u[p]=null}),fe()),~s?(o=u[s],o?o.p(g,v):(o=u[s]=h[s](g),o.c()),x(o,1),o.m(n,null)):o=null),(!l||v&2)&&$(n,"unfolded",(b=g[1].state)==null?void 0:b.unfolded),(!l||v&2&&r!==(r=Qe(st("content__container",g[1].className))+" svelte-1r4fqvg"))&&y(t,"class",r),(!l||v&2&&a!==(a=g[1].id))&&y(t,"data-id",a),(!l||v&2)&&$(t,"disable",g[1].enabled===!1),(!l||v&34)&&$(t,"hide",g[5]),(!l||v&3)&&$(t,"withAnimation",g[0]),(!l||v&2)&&$(t,"unClickable",g[1].config.clickable===!1),v&2&&j(t,"width",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0),v&2&&j(t,"height",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0)},i(g){l||(x(o),l=!0)},o(g){z(o),l=!1},d(g){g&&V(t),~s&&u[s].d(),c=!1,d()}}}function yP(i){let t,e,n,s,o,r,a;return e=new gP({props:{tag:Fe(i[1]),renderMap:i[3]}}),{c(){t=S("div"),se(e.$$.fragment),y(t,"class",n=Qe(st("content__container",i[1].className))+" svelte-1r4fqvg"),y(t,"data-id",s=i[1].id),$(t,"custom-tag-disable",i[1].enabled===!1),$(t,"custom-tag-hide",i[5])},m(l,c){O(l,t,c),ne(e,t,null),o=!0,r||(a=ye(t,"click",i[14]),r=!0)},p(l,c){const d={};c&2&&(d.tag=Fe(l[1])),c&8&&(d.renderMap=l[3]),e.$set(d),(!o||c&2&&n!==(n=Qe(st("content__container",l[1].className))+" svelte-1r4fqvg"))&&y(t,"class",n),(!o||c&2&&s!==(s=l[1].id))&&y(t,"data-id",s),(!o||c&2)&&$(t,"custom-tag-disable",l[1].enabled===!1),(!o||c&34)&&$(t,"custom-tag-hide",l[5])},i(l){o||(x(e.$$.fragment,l),o=!0)},o(l){z(e.$$.fragment,l),o=!1},d(l){l&&V(t),ie(e),r=!1,a()}}}function wP(i){let t,e;return t=new UC({props:{tag:Fe(i[1])}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=Fe(n[1])),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function CP(i){let t,e;return t=new hP({props:{tag:Fe(i[1])}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=Fe(n[1])),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function PP(i){let t,e;return t=new wC({props:{tag:Fe(i[1])}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=Fe(n[1])),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function IP(i){let t,e;return t=new WC({props:{tag:Fe(i[1])}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=Fe(n[1])),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function EP(i){let t,e;return t=new vC({props:{tag:Fe(i[1])}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=Fe(n[1])),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function kP(i){let t,e;return t=new O1({props:{tag:Fe(i[1])}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=Fe(n[1])),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function xP(i){let t,e,n,s,o;const r=[yP,bP,AP],a=[];function l(c,d){return d&10&&(t=null),t==null&&(t=!!(c[1].element||c[3].has(c[1].contentType))),t?0:c[4]?1:2}return e=l(i,-1),n=a[e]=r[e](i),{c(){n.c(),s=ke()},m(c,d){a[e].m(c,d),O(c,s,d),o=!0},p(c,[d]){let h=e;e=l(c,d),e===h?a[e].p(c,d):(ue(),z(a[h],1,1,()=>{a[h]=null}),fe(),n=a[e],n?n.p(c,d):(n=a[e]=r[e](c),n.c()),x(n,1),n.m(s.parentNode,s))},i(c){o||(x(n),o=!0)},o(c){z(n),o=!1},d(c){a[e].d(c),c&&V(s)}}}function MP(i,t,e){let n,s,o,r,a,l,{withAnimation:c=!1}=t,{tag:d}=t,{hooks:h}=t,{renderMap:u=new Map}=t,{state:m}=t,{mediaStore:g}=t,{temporaryState:v}=t;qo("hooks",h),qo("mediaStore",g);let p,b;function w(I){I?h.emit("exposure",{id:r,type:"start"}):h.emit("exposure",{id:r,type:"end"})}function P(I,B,L){var X,Z;return!(!B.visible||!B.enabled||!L.visible||!((X=I.state)!=null&&X.visible)||((Z=I.temporaryState)==null?void 0:Z.visible)===!1||ft(I)&&!I.mediaVisible)}const k=I=>h.emit("click",{event:I,target:"TagContent",tag:d}),T=I=>h.emit("click",{event:I,target:"TagContent",tag:d});return i.$$set=I=>{"withAnimation"in I&&e(0,c=I.withAnimation),"tag"in I&&e(1,d=I.tag),"hooks"in I&&e(2,h=I.hooks),"renderMap"in I&&e(3,u=I.renderMap),"state"in I&&e(6,m=I.state),"mediaStore"in I&&e(7,g=I.mediaStore),"temporaryState"in I&&e(8,v=I.temporaryState)},i.$$.update=()=>{var I,B,L,X,Z,G,R,H,Q,W,q;i.$$.dirty&2&&e(12,n=(I=d.state)==null?void 0:I.unfolded),i.$$.dirty&2&&e(11,s=(B=d.state)==null?void 0:B.visible),i.$$.dirty&322&&e(13,o=m.visible&&v.visible&&((L=d.state)==null?void 0:L.visible)),i.$$.dirty&2&&(r=d.id),i.$$.dirty&322&&e(5,a=!P(d,m,v)),i.$$.dirty&8192&&w(o),i.$$.dirty&7682&&d.hooks&&(n!==void 0&&n!==b&&(e(10,b=n),n?(Z=(X=d.hooks).emit)==null||Z.call(X,"unfolded"):(R=d==null?void 0:(G=d.hooks).emit)==null||R.call(G,"folded")),s!==void 0&&s!==p&&(e(9,p=s),s?(Q=(H=d.hooks).emit)==null||Q.call(H,"show"):(q=(W=d.hooks).emit)==null||q.call(W,"hide"))),i.$$.dirty&2&&e(4,l=(()=>!(typeof d.config.unfoldedConfig=="object"&&d.config.unfoldedConfig.keep==="folded"))())},[c,d,h,u,l,a,m,g,v,p,b,s,n,o,k,T]}let Au=class extends ce{constructor(t){super(),le(this,t,MP,xP,ae,{withAnimation:0,tag:1,hooks:2,renderMap:3,state:6,mediaStore:7,temporaryState:8},vP)}};function SP(i){he(i,"svelte-7aiuwz",'@charset "UTF-8";.tag-point-click-helper.svelte-7aiuwz.svelte-7aiuwz{position:absolute;pointer-events:auto;cursor:pointer;width:calc(100% + 0.75rem);height:calc(100% + 0.75rem);left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-7aiuwz.svelte-7aiuwz{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.tag-folded-point.svelte-7aiuwz.svelte-7aiuwz,.tag-unfolded-point.svelte-7aiuwz.svelte-7aiuwz{transition:all 0.5s}.tag-point-wrapper.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz: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-7aiuwz .tag-unfolded-point.svelte-7aiuwz: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-7aiuwz .tag-folded-point.svelte-7aiuwz{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-7aiuwz .tag-folded-point.svelte-7aiuwz{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz{opacity:1;scale:1}')}function DP(i){let t,e,n,s,o,r,a,l,c,d,h,u;return s=new _t({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new gu({props:{icon:i[2],width:i[1]}}),c.$on("iconLoaded",i[7]),{c(){t=S("div"),e=S("div"),n=ee(),se(s.$$.fragment),o=ee(),r=S("div"),a=ee(),l=S("div"),se(c.$$.fragment),y(e,"class","tag-point-click-helper svelte-7aiuwz"),y(r,"class","tag-unfolded-point svelte-7aiuwz"),j(r,"transition-delay",(i[3]?i[5]:0)+"ms"),y(l,"class","tag-folded-point svelte-7aiuwz"),j(l,"transition-delay",(i[3]?i[5]:0)+"ms"),y(t,"class","tag-point-wrapper svelte-7aiuwz"),$(t,"unfolded",i[0]),$(t,"folded",i[3])},m(m,g){O(m,t,g),D(t,e),D(t,n),ne(s,t,null),D(t,o),D(t,r),D(t,a),D(t,l),ne(c,l,null),d=!0,h||(u=ye(e,"click",i[4]),h=!0)},p(m,[g]){g&8&&j(r,"transition-delay",(m[3]?m[5]:0)+"ms");const v={};g&4&&(v.icon=m[2]),g&2&&(v.width=m[1]),c.$set(v),g&8&&j(l,"transition-delay",(m[3]?m[5]:0)+"ms"),(!d||g&1)&&$(t,"unfolded",m[0]),(!d||g&8)&&$(t,"folded",m[3])},i(m){d||(x(s.$$.fragment,m),x(c.$$.fragment,m),d=!0)},o(m){z(s.$$.fragment,m),z(c.$$.fragment,m),d=!1},d(m){m&&V(t),ie(s),ie(c),h=!1,u()}}}function LP(i,t,e){let n,s,o,r;const a=ln("hooks");let{tag:l}=t,c,d=!1;const h=()=>{c!==void 0&&clearTimeout(c),d=!0,c=setTimeout(()=>{d=!1},800)},u=v=>{d||a.emit("click",{event:v,target:"TagPoint",tag:l})},m=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();function g(v){Un.call(this,i,v)}return i.$$set=v=>{"tag"in v&&e(6,l=v.tag)},i.$$.update=()=>{var v,p,b,w;i.$$.dirty&64&&e(0,n=(v=l.state)==null?void 0:v.unfolded),i.$$.dirty&1&&e(3,s=!n),i.$$.dirty&64&&e(2,o=(b=(p=l.style)==null?void 0:p.point)!=null&&b.url?(w=l.style)==null?void 0:w.point:{url:Yb}),i.$$.dirty&64&&e(1,r=(()=>{var T,I,B,L;const P=(I=(T=l.style)==null?void 0:T.point)==null?void 0:I.width;if(typeof P=="number")return P;const k=(L=(B=l.style)==null?void 0:B.point)==null?void 0:L.size;if(typeof k=="number")return k;if(k==="S")return 18;if(k==="M")return 20;if(k==="L")return 24;if(k==="XL")return 28})())},h(),[n,r,o,s,u,m,l,g]}class TP extends ce{constructor(t){super(),le(this,t,LP,DP,ae,{tag:6},SP)}}function zP(i){he(i,"svelte-pzwdws",".tag.withAnimation.svelte-pzwdws{transition:opacity 0.3s linear}.tag.hide.svelte-pzwdws{opacity:0;pointer-events:none}.tag.hide.svelte-pzwdws *{pointer-events:none !important}.tag.unClickable.svelte-pzwdws{pointer-events:none !important}.tag.unClickable.svelte-pzwdws *{pointer-events:none !important}.tag.disable.svelte-pzwdws{display:none}.wrapper.svelte-pzwdws{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto}")}function jP(i){let t;return{c(){t=S("div"),y(t,"data-info","tag point is disable")},m(e,n){O(e,t,n)},p:J,i:J,o:J,d(e){e&&V(t)}}}function VP(i){let t,e;return t=new TP({props:{tag:i[1]}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.tag=n[1]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function OP(i){let t;return{c(){t=S("div"),y(t,"data-info","tag content is disable")},m(e,n){O(e,t,n)},p:J,i:J,o:J,d(e){e&&V(t)}}}function BP(i){let t,e;return t=new Au({props:{mediaStore:i[2],withAnimation:i[0],tag:Fe(i[1]),hooks:i[15],state:i[4],temporaryState:i[5],renderMap:i[3]}}),{c(){se(t.$$.fragment)},m(n,s){ne(t,n,s),e=!0},p(n,s){const o={};s&4&&(o.mediaStore=n[2]),s&1&&(o.withAnimation=n[0]),s&2&&(o.tag=Fe(n[1])),s&16&&(o.state=n[4]),s&32&&(o.temporaryState=n[5]),s&8&&(o.renderMap=n[3]),t.$set(o)},i(n){e||(x(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function _P(i){let t,e,n,s,o,r,a,l,c,d;const h=[VP,jP],u=[];function m(b,w){return b[14]?0:1}n=m(i),s=u[n]=h[n](i);const g=[BP,OP],v=[];function p(b,w){return b[13]?0:1}return r=p(i),a=v[r]=g[r](i),{c(){t=S("div"),e=S("div"),s.c(),o=ee(),a.c(),y(e,"class",l=Qe(st("wrapper",i[1].className?`${i[1].className}__wrapper`:void 0))+" svelte-pzwdws"),y(e,"data-tag-unfolded",i[6]),y(e,"data-tag-id",i[12]),y(e,"data-content-type",c=i[1].contentType),j(e,"left",i[9]),j(e,"top",i[8]),y(t,"class","tag svelte-pzwdws"),y(t,"data-tag-id",i[12]),$(t,"unClickable",i[1].config.clickable===!1),$(t,"disable",i[11]),$(t,"hide",i[10]),$(t,"withAnimation",i[0]),j(t,"z-index",i[7])},m(b,w){O(b,t,w),D(t,e),u[n].m(e,null),D(e,o),v[r].m(e,null),d=!0},p(b,[w]){let P=n;n=m(b),n===P?u[n].p(b,w):(ue(),z(u[P],1,1,()=>{u[P]=null}),fe(),s=u[n],s?s.p(b,w):(s=u[n]=h[n](b),s.c()),x(s,1),s.m(e,o));let k=r;r=p(b),r===k?v[r].p(b,w):(ue(),z(v[k],1,1,()=>{v[k]=null}),fe(),a=v[r],a?a.p(b,w):(a=v[r]=g[r](b),a.c()),x(a,1),a.m(e,null)),(!d||w&2&&l!==(l=Qe(st("wrapper",b[1].className?`${b[1].className}__wrapper`:void 0))+" svelte-pzwdws"))&&y(e,"class",l),(!d||w&64)&&y(e,"data-tag-unfolded",b[6]),(!d||w&4096)&&y(e,"data-tag-id",b[12]),(!d||w&2&&c!==(c=b[1].contentType))&&y(e,"data-content-type",c),w&512&&j(e,"left",b[9]),w&256&&j(e,"top",b[8]),(!d||w&4096)&&y(t,"data-tag-id",b[12]),(!d||w&2)&&$(t,"unClickable",b[1].config.clickable===!1),(!d||w&2048)&&$(t,"disable",b[11]),(!d||w&1024)&&$(t,"hide",b[10]),(!d||w&1)&&$(t,"withAnimation",b[0]),w&128&&j(t,"z-index",b[7])},i(b){d||(x(s),x(a),d=!0)},o(b){z(s),z(a),d=!1},d(b){b&&V(t),u[n].d(),v[r].d()}}}function QP(i,t,e){let n,s,o,r,a,l,c,d,h,{withAnimation:u=!1}=t,{tag:m}=t,{mediaStore:g}=t,{renderMap:v=new Map}=t,{state:p}=t,{temporaryState:b}=t;const w=ln("hooks");return i.$$set=P=>{"withAnimation"in P&&e(0,u=P.withAnimation),"tag"in P&&e(1,m=P.tag),"mediaStore"in P&&e(2,g=P.mediaStore),"renderMap"in P&&e(3,v=P.renderMap),"state"in P&&e(4,p=P.state),"temporaryState"in P&&e(5,b=P.temporaryState)},i.$$.update=()=>{var P,k,T,I,B,L,X,Z;i.$$.dirty&2&&e(14,n=(()=>{var G,R;return!(((R=(G=m.style)==null?void 0:G.point)==null?void 0:R.enabled)===!1||m.contentType==="Sticker"||m.contentType==="Link"||m.contentType==="VRLink"||m.contentType==="PanoLink"||m.contentType==="Audio"&&m.data.appearance==="plane")})()),i.$$.dirty&2&&e(13,s=(()=>m.stickType==="2DPoint")()),i.$$.dirty&2&&e(12,o=m.id),i.$$.dirty&2&&e(11,r=!((P=m.screenPosition)!=null&&P.leftPercent)||!((k=m.screenPosition)!=null&&k.topPercent)||m.enabled===!1||!m.state),i.$$.dirty&2&&e(10,a=!((T=m.state)!=null&&T.visible)||((I=m.temporaryState)==null?void 0:I.visible)===!1),i.$$.dirty&2&&e(6,l=(B=m.state)==null?void 0:B.unfolded),i.$$.dirty&2&&e(9,c=((L=m.screenPosition)==null?void 0:L.leftPercent)+"%"),i.$$.dirty&2&&e(8,d=((X=m.screenPosition)==null?void 0:X.topPercent)+"%"),i.$$.dirty&66&&e(7,h=((Z=m.zIndex)!=null?Z:0)+(l?1e4:0))},[u,m,g,v,p,b,l,h,d,c,a,r,o,s,n,w]}class RP extends ce{constructor(t){super(),le(this,t,QP,_P,ae,{withAnimation:0,tag:1,mediaStore:2,renderMap:3,state:4,temporaryState:5},zP)}}function GP(i){he(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 bu(i,t,e){const n=i.slice();return n[7]=t[e],n}function yu(i){let t,e=[],n=new Map,s,o=i[1];const r=a=>a[7].id;for(let a=0;a<o.length;a+=1){let l=bu(i,o,a),c=r(l);n.set(c,e[a]=wu(c,l))}return{c(){t=S("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","tag--container svelte-uq11d5"),$(t,"hide",!i[4].visible||!i[5].visible),$(t,"withAnimation",i[0])},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(a,l){l&63&&(o=a[1],ue(),e=St(e,l,r,1,a,o,n,t,dn,wu,null,bu),fe()),(!s||l&48)&&$(t,"hide",!a[4].visible||!a[5].visible),(!s||l&1)&&$(t,"withAnimation",a[0])},i(a){if(!s){for(let l=0;l<o.length;l+=1)x(e[l]);s=!0}},o(a){for(let l=0;l<e.length;l+=1)z(e[l]);s=!1},d(a){a&&V(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function wu(i,t){let e,n,s;return n=new RP({props:{state:t[4],temporaryState:t[5],withAnimation:t[0],tag:t[7],mediaStore:t[2],renderMap:t[3]}}),{key:i,first:null,c(){e=ke(),se(n.$$.fragment),this.first=e},m(o,r){O(o,e,r),ne(n,o,r),s=!0},p(o,r){t=o;const a={};r&16&&(a.state=t[4]),r&32&&(a.temporaryState=t[5]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[7]),r&4&&(a.mediaStore=t[2]),r&8&&(a.renderMap=t[3]),n.$set(a)},i(o){s||(x(n.$$.fragment,o),s=!0)},o(o){z(n.$$.fragment,o),s=!1},d(o){o&&V(e),ie(n,o)}}}function FP(i){let t,e,n=i[4].enabled&&yu(i);return{c(){n&&n.c(),t=ke()},m(s,o){n&&n.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[4].enabled?n?(n.p(s,o),o&16&&x(n,1)):(n=yu(s),n.c(),x(n,1),n.m(t.parentNode,t)):n&&(ue(),z(n,1,1,()=>{n=null}),fe())},i(s){e||(x(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&V(t)}}}function HP(i,t,e){let{withAnimation:n=!1}=t,{tags:s=[]}=t,{hooks:o}=t,{mediaStore:r}=t,{renderMap:a}=t,{state:l}=t,{temporaryState:c}=t;return qo("hooks",o),i.$$set=d=>{"withAnimation"in d&&e(0,n=d.withAnimation),"tags"in d&&e(1,s=d.tags),"hooks"in d&&e(6,o=d.hooks),"mediaStore"in d&&e(2,r=d.mediaStore),"renderMap"in d&&e(3,a=d.renderMap),"state"in d&&e(4,l=d.state),"temporaryState"in d&&e(5,c=d.temporaryState)},[n,s,r,a,l,c,o]}class WP extends ce{constructor(t){super(),le(this,t,HP,FP,ae,{withAnimation:0,tags:1,hooks:6,mediaStore:2,renderMap:3,state:4,temporaryState:5},GP)}}const NP=new Ei.GLTFLoader;function YP(i){return new Promise((t,e)=>{function n(o){t(o)}function s(o){e(o)}NP.load(i,n,void 0,s)})}const XP=new Map,UP=new Map;class qP extends Zb{constructor(e){super(e);f(this,"group",new _.Group);f(this,"renderMap",new Map);f(this,"imagePlaneGroup",new _.Group);f(this,"gltfObjectGroup",new _.Group);f(this,"enabledModelTagSet",new Set);f(this,"temporaryState",{visible:!0});f(this,"TagContainerSvelte");f(this,"loadModel",e=>Y(this,null,function*(){var a;const n=e.data.modelUrl;if(!n)return;const s=YP(n).then(l=>{var h,u,m,g,v;const c=Object.assign(l.scene,{customID:e.id,isTagModel:!0,removeEventListener:this.addObjectClickHandler(e,l.scene,p=>{this.hooks.emit("click",{target:"TagModel",tag:e,event:p})})});return c.visible=this.getCurrentVisibleState(e),new _.Matrix4().fromArray(e.matrix).decompose(c.position,c.quaternion,c.scale),c.updateWorldMatrix(!0,!0),c.visible=this.getVisibleByFiveMode(e),(m=(u=(h=this.config)==null?void 0:h.globalConfig)==null?void 0:u.modelConfig)!=null&&m.autoLookAtEnabled&&((v=(g=e.config)==null?void 0:g.modelConfig)!=null&&v.autoLookAtEnabled)&&c.lookAt(this.five.camera.position.clone().setY(c.position.y)),c});e.model={promise:s};const o=yield s;if(((a=e.model)==null?void 0:a.promise)!==s||!this.tags.includes(e))return;e.model.object=o;const r=this.gltfObjectGroup.children.find(l=>l.customID===e.id);if(r&&(this.gltfObjectGroup.remove(r),r.removeEventListener()),this.updateRender3DDomTag(),ft(e)){if(this.getRenderType(e)==="Mesh"&&!e.mediaPlane){const l=e.data.mediaPosition.map(kt);e.mediaPlane=new Hd(e.data.mediaData[0].url,e.data.mediaPosition.map(kt),{objectFit:e.data.objectFit});const c=new _.Vector3().addVectors(l[0],l[2]).divideScalar(2);e.mediaPlane.position.copy(c),o.add(e.mediaPlane)}this.getRenderType(e)!=="Mesh"&&(o.updateTagCss3DObjectMatrix=()=>this.updateTagCss3DObjectMatrix(e,o),o.updateTagCss3DObjectMatrix())}return this.gltfObjectGroup.add(o),o}));this.group.name="PanoTagPluginModelGroup",this.gltfObjectGroup.name="PanoTagPluginGLTFObjectGroup",this.imagePlaneGroup.name="ImagePlaneGroup",this.group.add(this.gltfObjectGroup),this.group.add(this.imagePlaneGroup)}registerRenderer(e,n){this.renderMap.set(e,{renderer:n})}clearTags(){this.tags.forEach(e=>{var n,s;(s=(n=e.mediaPlane)==null?void 0:n.parent)==null||s.remove(e.mediaPlane)}),this.tags=[],this.enabledModelTagSet.clear(),this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}updateRenderAllTags(){this.enabledModelTagSet.clear(),this.tags.forEach(e=>e.stickType==="Model"&&this.enabledModelTagSet.add(e.id)),this.updateRenderPointTag(),this.updateRender3DDomTag(),this.updateRenderModelTag(),this.updateRenderImagePlane()}updateRenderImagePlane(){this.sort(this.filterImagePlane).forEach(n=>{var l,c,d,h,u;const s=n.data.mediaData[0];if(!s)return;const{url:o,type:r}=s;if(!o||(n.mediaPlane&&(n.mediaPlane.visible=(c=(l=n.state)==null?void 0:l.visible)!=null?c:!0,n.mediaPlane.visible||n.mediaPlane instanceof Tr&&((d=n.data.autoplayConfig)!=null&&d.autoplayVideo||n.mediaPlane.pause())),((h=n.mediaPlane)==null?void 0:h.src)===o))return;const a=n.position.map(kt);if(n.mediaPlane&&n.mediaPlane.removeFromParent(),r==="Image")n.mediaPlane=new Hd(o,a,{objectFit:n.data.objectFit}),n.config.clickable!==!1&&this.domEvents.addAutoBindEventListener(n.mediaPlane,"click",m=>{this.hooks.emit("click",{tag:n,target:"TagContent",event:m.origDomEvent})});else if(r==="Video"){const m=new Tr(o,a,{videoCoverSrc:s.videoCoverUrl,playButton:n.data.playIcon,paused:!((u=n.data.autoplayConfig)!=null&&u.autoplayVideo),objectFit:n.data.objectFit,videoTextureMap:XP,ImageTextureMap:UP});m.onVideoReady=v=>{v.addEventListener("play",()=>this.mediaStore.set({currentMediaElement:m.videoInstance}))},m.initialDomEvents(this.domEvents);const g=v=>(this.five.on("renderFrame",v),()=>this.five.off("renderFrame",v));m.initialRenderHooks(g),n.mediaPlane=m}this.imagePlaneGroup.add(n.mediaPlane)})}updateRender3DDomTag(){this.sort([...this.filterCSS3DTag]).forEach(n=>{var s,o,r,a;if(n.tag3DContentSvelte){const{svelteApp:l,css3DInstance:c,initialNormal:d,currentNormal:h}=n.tag3DContentSvelte;if(l.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!d.equals(h)){const u=new _.Quaternion().setFromUnitVectors(d,h);c.css3DObject.setRotationFromQuaternion(u)}return}else{if(ft(n)&&!((s=n.model)!=null&&s.object)||((o=n.state)==null?void 0:o.visible)===!1||!this.state.visible||!this.state.enabled)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=Wo(this.five)),n.stickType==="3DPoint"&&!n.normal)return console.error("updateRenderPlaneTag: 三维点标签缺少法向量!");const l=this.getPositions(n);if(!l)return;const c=this.getTagNormal(n);if(!c)return;const h=(r=this.getTagConfig(n).tag3DConfig)!=null?r:{};if(this.getRenderType(n)==="BehindDom"){h.mode="behind",h.container=document.createElement("div");const g="black";h.container.style.backgroundColor=g,h.container.style.border=`3px solid ${g}`,this.css3DRenderPlugin.hooks.on("render",()=>{var v;if(u.css3DObject.opacityMesh){const p=this.addObjectClickHandler(n,u.css3DObject.opacityMesh,b=>{this.hooks.emit("click",{event:b,target:"TagContent",tag:n})});(v=this.store.css3DRenderDisposer.get(n.id))==null||v.push(p)}})}const u=this.css3DRenderPlugin.create3DDomContainer(l,h);if(!u)return;this.store.css3DRenderDisposer.set(n.id,[u.dispose]);const m=new Au({target:u.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}});n.tag3DContentSvelte={svelteApp:m,domContainer:u,css3DInstance:u,initialNormal:c,currentNormal:c,dispose:()=>{m.$destroy(),u.dispose()}},ft(n)&&((a=n.model)!=null&&a.object)&&this.updateTagCss3DObjectMatrix(n,n.model.object)}}),this.clearUnusedPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID),n=this.gltfObjectGroup.children.filter(e);n.forEach(o=>o.removeEventListener()),this.gltfObjectGroup.remove(...n),this.tags.filter(o=>o.stickType==="Model").forEach(o=>{var r;(r=o.model)==null||r.promise.then(a=>{a.visible=this.getCurrentVisibleState(o)})}),this.five.needsRender=!0}updateTagModelVisible(){this.tags.forEach(e=>{var n;e.mediaPlane&&(e.mediaPlane.visible=this.getCurrentVisibleState(e)),(n=e.model)!=null&&n.object&&(e.model.object.visible=this.getCurrentVisibleState(e))})}updateTagCss3DObjectMatrix(e,n){var v,p,b;const s=(p=(v=e.config.tag3DConfig)==null?void 0:v.ratio)!=null?p:.00216,o=(b=e.tag3DContentSvelte)==null?void 0:b.css3DInstance.css3DObject;if(!o)return;const r=ft(e)?e.data.mediaPosition:e.position;if(!r||r.length!==4||!Array.isArray(r[0])||!Array.isArray(r[2]))return;n.updateWorldMatrix(!1,!1);const a=n.matrixWorld,l=new _.Vector3().fromArray(r[0]),c=new _.Vector3().fromArray(r[2]),d=sn(l,c).add(new _.Vector3(0,0,5e-4)),h=new _.Matrix4().setPosition(d),u=new _.Matrix4().makeScale(s,s,s),m=new _.Matrix4().multiply(a).multiply(h).multiply(u);m.decompose(o.position,o.quaternion,o.scale);const g=o.opacityMesh;g&&m.decompose(g.position,g.quaternion,g.scale)}addMediaModelTag(e){return Y(this,null,function*(){const n=e.filter(Db).map(s=>this.loadModel(s));yield Promise.all(n),this.setModelMedialVisible(),this.updateRenderAllTags()})}updateRenderPointTag(){var n;const e=this.filterPointTag;if(this.setTagZIndex(e),this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const s=(n=this.five.getElement())==null?void 0:n.parentElement;if(!s)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new WP({target:s,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore,renderMap:this.renderMap}})}}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filterCSS3DTag.forEach(n=>{var s,o,r,a,l;(a=(o=(s=n.tag3DContentSvelte)==null?void 0:s.css3DInstance)==null?void 0:o.css3DObject)==null||a.setVisible((this.state.visible&&((r=n.state)==null?void 0:r.visible))!==!1),(l=n.tag3DContentSvelte)==null||l.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}disposeAllCSS3DContainer(){for(const[,e]of this.store.css3DRenderDisposer)e==null||e.forEach(n=>n==null?void 0:n());this.store.css3DRenderDisposer=new Map}clearUnusedPanelTag(){this.filter2DPointTag.forEach(e=>{var n;(n=e.tag3DContentSvelte)==null||n.css3DInstance.dispose(),e.tag3DContentSvelte=void 0});for(const[e,n]of this.store.css3DRenderDisposer){const s=this.getTagById(e);(!s||s.stickType==="2DPoint")&&(n==null||n.forEach(o=>o==null?void 0:o()),this.store.css3DRenderDisposer.delete(e))}}}const Cu="Dnalogel-PanoTagPlugin",JP=i=>`${Cu}--${i}`;class po extends qP{constructor(e,n){super(e);f(this,"state",{enabled:!0,visible:!0});f(this,"params");f(this,"debug");f(this,"changeTagModel",(e,n)=>Y(this,null,function*(){e.data=Ue({},e.data,n),yield this.loadModel(e),this.updateRenderAllTags()}));f(this,"handleFiveInitAnimationEnded",()=>{const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{ft(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags()});f(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{var s,o;const n=this.getTagConfig(e).visibleConfig;typeof n=="object"&&((s=n.visibleFiveMode)!=null&&s.includes("Floorplan")||(o=n.visibleFiveMode)!=null&&o.includes("Mapview"))&&(e.state.visible=this.getVisibleByFiveMode(e))}),this.updateRenderAllTags()});this.params=Ue({},{debug:!1,config:this.config},F({},n)),this.debug=this.params.debug,this.config=this.params.config,_b(1,{namespace:Sr.PlayAudio});try{const s=window;Array.isArray(s.__PANOTAGPLUGIN_DEBUG_LIST__)||(s.__PANOTAGPLUGIN_DEBUG_LIST__=[]),s.__PANOTAGPLUGIN_DEBUG_LIST__.push(this),s.__PANOTAGPLUGIN_DEBUG__=this}catch(s){}}load(e,n){return Y(this,null,function*(){var o,r;this.clearTags(),console.debug(Cu," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=Ue({},this.config,{globalConfig:(o=e.globalConfig)!=null?o:{},contentTypeConfig:(r=e.contentTypeConfig)!=null?r:{}});const s=yield this.addTag(e.tagList,n);if(this.debug)try{Eb(this.five,this.tags)}catch(a){console.error(a)}return s})}addTag(e,n){return Y(this,null,function*(){const o=(Array.isArray(e)?e:[e]).map(r=>{var d,h;const a=this.getTagConfig(r),l=JSON.parse(JSON.stringify(r.data));return we(F({},r),{enabled:(d=r.enabled)!=null?d:!0,id:(h=r.id)!=null?h:tt(),data:Ue(r.data,a.initialData,l),state:F({visible:void 0,unfolded:!this.can("fold",r)},a.initialState),hooks:new ve.Subscribe,initialConfig:r.config,config:a,unfold:()=>this.changeUnfoldedById(r.id,!0),fold:()=>this.changeUnfoldedById(r.id,!1),enable:()=>this.changeEnabledById(r.id,!0),disable:()=>this.changeEnabledById(r.id,!1),destroy:()=>this.destroyTagById(r.id),changeData:u=>this.changeDataById(r.id,u)})}).filter(r=>r.position);return o.forEach(Ob),this.tags.push(...o),Tb(this.five).then(()=>Y(this,null,function*(){var r,a,l;this.store.eventListenerDisposer&&((a=(r=this.store).eventListenerDisposer)==null||a.call(r)),this.state.enabled&&this.handleEnable(),this.addResizeListener(),this.clearUnusedPanelTag(),this.setVisibleAndUnfolded({withAnimation:(l=n==null?void 0:n.withAnimation)!=null?l:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags(),yield this.addMediaModelTag(o)}))})}changeConfig(e,n=!0){n?this.config=Ue({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=Ue({},this.config.globalConfig,e):this.config.globalConfig=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeContentTypeConfig(e,n,s=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),s?this.config.contentTypeConfig[e]=Ue({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}show(e){return Y(this,null,function*(){if(this.checkDisposed())return;const{userAction:n=!0,withAnimation:s=!1}=e!=null?e:{};this.setState({visible:!0},{userAction:n,visibleWithAnimation:s}),this.hooks.emit("show",{userAction:n,withAnimation:s})})}hide(e){return Y(this,null,function*(){if(this.checkDisposed())return;const{userAction:n=!0,withAnimation:s=!1}=e!=null?e:{};this.setState({visible:!1},{userAction:n,visibleWithAnimation:s}),this.hooks.emit("hide",{userAction:n,withAnimation:s})})}enable(e){if(this.checkDisposed())return;const{userAction:n=!0}=e!=null?e:{};this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n})}disable(e){if(this.checkDisposed())return;const{userAction:n=!0}=e!=null?e:{};this.setState({enabled:!1},{userAction:n}),this.hooks.emit("disable",{userAction:n})}setState(e,n){if(this.checkDisposed())return;const{userAction:s=!0,visibleWithAnimation:o=!1}=n,r=F({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=o,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:s})}dispose(){var e,n,s,o,r,a;this.pauseCurrentMedia(),this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filterCSS3DTag.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=[],(o=(s=this.store).eventListenerDisposer)==null||o.call(s),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.gltfObjectGroup.remove(...this.gltfObjectGroup.children),this.imagePlaneGroup.remove(...this.imagePlaneGroup.children),this.clearCache(),this.five.needsRender=!0,this.store.disposed=!0,this.hooks.emit("dispose")}changeUnfoldedById(e,n){var a;const s=this.getTagById(e);if(!s)return;const o=this.can("fold",s),r=this.can("unfold",s);if(o&&r){s.state.unfolded=n;const l=this.filterPointTag;(a=this.TagContainerSvelte)==null||a.$set({tags:l})}else console.warn(`tag ${e} cannot be ${n?"unfolded":"folded"}`)}changeEnabledById(e,n){const s=this.getTagById(e);s&&(s.enabled=n,this.updateRenderAllTags())}changeTagNormalById(e,n){const s=this.getTagById(e);s&&s.tag3DContentSvelte&&(s.tag3DContentSvelte.currentNormal=kt(n))}changeDataById(e,n,s=!0){const o=this.getTagById(e);let r=!1;o&&(o.data&&(r=!0),s?o.data=Ue(o.data,n):o.data=F(F({},o.data),n),this.clearUnusedPanelTag(),this.updateRenderAllTags(),r&&o.hooks.emit("dataChanged",o.data))}changeStickTypeById(e,n,s=!0){this.changeTagById(e,n,s)}changeTagById(e,n,s=!0){const o=this.getTagById(e);let r=!1;n&&(n.data&&(r=!0),s?Ue(o,n):Object.assign(o,n),o!=null&&o.tag3DContentSvelte&&(n!=null&&n.normal)&&(o.tag3DContentSvelte.currentNormal=kt(n.normal)),this.updateRenderAllTags(),this.clearUnusedPanelTag(),r&&o.hooks.emit("dataChanged",o.data))}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(s=>{const o=this.tags.findIndex(r=>r.id===s);o!==-1&&this.tags.splice(o,1)}),this.updateRenderAllTags()}setVisibleAndUnfolded(){return Y(this,arguments,function*({withAnimation:e}={withAnimation:!1}){if(this.isPanorama)return this.setVisible(),e?new Promise(n=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.group.visible=!0,this.updateTagContainerVisible(),this.updateTagModelVisible(),this.five.needsRender=!0}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.group.visible=!1,this.updateTagContainerVisible(),this.updateTagModelVisible(),this.five.needsRender=!0}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.five.scene.children.includes(this.group)||this.five.scene.add(this.group),this.group.traverse(e=>{var n;(n=e==null?void 0:e.updateTagCss3DObjectMatrix)==null||n.call(e)}),this.updateRenderAllTags(),this.five.needsRender=!0}handleDisable(){var e,n,s;this.pauseCurrentMedia(),this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),this.five.scene.remove(this.group),(s=this.TagContainerSvelte)==null||s.$set({tags:[]}),this.filterCSS3DTag.forEach(o=>{var r;(r=o.tag3DContentSvelte)==null||r.dispose(),o.tag3DContentSvelte=void 0}),this.five.needsRender=!0}addEventListener(){const{five:e,hooks:n}=this,s=this.handleFiveWantsMoveToPano.bind(this),o=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),h=this.five.currentMode;return h&&this.handleFiveModeChange(h),this.handleFivePanoArrived(),e.on("wantsMoveToPano",s),e.on("modeChange",o),e.on("initAnimationEnded",this.handleFiveInitAnimationEnded),e.on("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),e.on("panoArrived",c),n.on("click",d),()=>{e.off("wantsMoveToPano",s),e.off("modeChange",o),e.off("initAnimationEnded",this.handleFiveInitAnimationEnded),e.off("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),e.off("panoArrived",c),n.off("click",d),this.store.eventListenerDisposer=void 0}}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())},s=()=>{this.state.enabled&&this.hide()},{observe:o,unobserve:r}=Bd(jb(()=>{this.store.resizeObserverDisposer&&s()},500),e),{observe:a,unobserve:l}=Bd(Od(()=>n(),400),e);return o(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.setModelMedialVisible(),this.tags.forEach(n=>{ft(n)&&e!=="Panorama"&&this.changeTagMode(n,"behind"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags()}handleFiveWantsMoveToPano(){this.tags.forEach(e=>{const n=this.getTagConfig(e);typeof n.visibleConfig=="object"&&(n.visibleConfig.keep?e.temporaryState=we(F({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=we(F({},e.temporaryState),{visible:!!n.visibleConfig.alwaysShowWhenMovePano}))}),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),s=this.can("unfold",e.tag);n&&s&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(o=>{o.id!==e.tag.id&&o.state&&this.can("fold",o)&&(o.state.unfolded=!1)}),this.updateRenderAllTags())}handleFiveCameraUpdateDebounce(){return Od(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return Y(this,null,function*(){var e,n,s;this.setModelMedialVisible(),yield this.setVisibleAndUnfolded(),this.tags.forEach(o=>{o.temporaryState=we(F({},o.temporaryState),{visible:!0})}),(s=(n=(e=this.config)==null?void 0:e.globalConfig)==null?void 0:n.modelConfig)!=null&&s.autoLookAtEnabled&&this.tags.filter(Sb).filter(o=>{var r,a;return(a=(r=o.config)==null?void 0:r.modelConfig)==null?void 0:a.autoLookAtEnabled}).forEach(o=>{var u;const r=new E.Mesh(new E.BoxGeometry,new E.MeshBasicMaterial),a=(u=o.model)==null?void 0:u.object;if(!a)return;r.position.copy(a.position),r.quaternion.copy(a.quaternion);const l=this.five.camera.position;r.lookAt(l.clone().setY(r.position.y));const c=a.quaternion.clone(),d=r.quaternion.clone(),h=ws();h.onUpdate(({progress:m})=>{a.quaternion.copy(c.clone().slerp(d,m))}),h.play()}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible(),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const s=this.getUnfoldedByCamera(n);n.state&&s!==void 0&&(s===!0&&(e=!0),n.state.unfolded=s)}),e&&this.tags.forEach(n=>{const s=this.getTagConfig(n).unfoldedConfig;typeof s=="object"&&(s.autoUnfold||s.keep)||n.state&&(n.state.unfolded=!1)})}changeTagMode(e,n){var s,o,r,a,l,c;((s=this.getTagConfig(e))==null?void 0:s.renderType)!=="Mesh"&&((a=(r=(o=e.tag3DContentSvelte)==null?void 0:o.css3DInstance)==null?void 0:r.css3DObject)==null?void 0:a.mode)!==n&&((l=e.config)!=null&&l.tag3DConfig?e.config.tag3DConfig.mode=n:e.config?e.config.tag3DConfig={mode:n}:e.config={tag3DConfig:{mode:n}},(c=this.store.css3DRenderDisposer.get(e.id))==null||c.forEach(d=>d==null?void 0:d()),e.tag3DContentSvelte=void 0)}}var Pu=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(Pu||{}),Iu=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.Sticker="Sticker",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.MediaModel="MediaModel",i.Model="Model",i.Custom="Custom",i.Unknown="Unknown",i))(Iu||{}),Eu=(i=>(i.Two="2D",i.Three="3D",i))(Eu||{});const ZP=(i,t)=>new po(i,t);function KP(i){he(i,"svelte-b9xhqz",".guide-line__tag.svelte-b9xhqz.svelte-b9xhqz{position:relative}.text-with-distance.svelte-b9xhqz.svelte-b9xhqz{display:flex;flex-direction:column;position:relative;padding:0.125rem 0.25rem;border-radius:0.125rem;background:linear-gradient(to top, rgba(147, 147, 147, 0.3), rgba(74, 74, 74, 0.3));box-shadow:0 0.125rem 0.5rem 0 rgba(0, 0, 0, 0.2)}.text-with-distance.svelte-b9xhqz .border.svelte-b9xhqz{position:absolute;top:-50%;right:-50%;bottom:-50%;left:-50%;padding:0.0625rem;border-radius:0.25rem;background:linear-gradient(to right, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.2));-webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);mask-composite:exclude;-webkit-mask-composite:xor;transform:scale(0.5)}.distance-and-name.svelte-b9xhqz.svelte-b9xhqz{display:flex;gap:0.1875rem}.distance.svelte-b9xhqz.svelte-b9xhqz{white-space:nowrap;font-size:0.625rem;line-height:0.875rem;color:#66afff}.name.svelte-b9xhqz.svelte-b9xhqz{opacity:0.6;font-size:0.625rem;line-height:0.875rem;white-space:nowrap;color:#ffffff}.line-name.svelte-b9xhqz.svelte-b9xhqz{color:#fff;white-space:nowrap;font-size:0.625rem;line-height:0.875rem}.guide-line__tag-point.svelte-b9xhqz.svelte-b9xhqz{position:absolute;left:50%;bottom:0.0625rem;width:0.4375rem;height:0.125rem;transform:translateX(-50%);background:#fff;border-radius:50%;opacity:0.5}.guide-line__tag-line.svelte-b9xhqz.svelte-b9xhqz{position:absolute;left:50%;bottom:0.0625rem;width:0.0625rem;height:1.875rem;transform:translateX(-50%);background:linear-gradient(to top, #fff, rgba(255, 255, 255, 0))}.guide-line__tag-content.svelte-b9xhqz.svelte-b9xhqz{position:absolute;left:-0.9375rem;bottom:1.9375rem;display:flex}.guide-line__tag-icon.svelte-b9xhqz.svelte-b9xhqz{width:1.875rem;height:1.875rem;background-size:100%}.guide-line__tag-text.svelte-b9xhqz.svelte-b9xhqz{box-sizing:content-box;height:0.875rem;width:-moz-max-content;width:max-content;margin-top:0.3125rem;transform:translateX(-0.1875rem);white-space:nowrap;font-size:0.625rem;line-height:0.875rem;border:solid transparent;border-width:0.125rem 0.5rem 0.125rem 0.375rem;border-image-source:url('https://vrlab-static.ljcdn.com/release/web/jsl/test2.2ea9ddee.png');border-image-slice:6 25 6 18 fill;color:#fff}")}function ku(i){let t,e;return{c(){t=S("div"),e=Te(i[0]),y(t,"class","guide-line__tag-text svelte-b9xhqz"),j(t,"border-image-source",`url(${i[6]})`)},m(n,s){O(n,t,s),D(t,e)},p(n,s){s&1&&Oe(e,n[0])},d(n){n&&V(t)}}}function xu(i){let t,e,n,s,o=i[5]("全程")+"",r,a,l=i[5]("米")+"",c,d,h,u,m,g,v=i[4]&&Mu(i);return{c(){t=S("div"),v&&v.c(),e=ee(),n=S("div"),s=S("span"),r=Te(o),a=Te(i[2]),c=Te(l),d=ee(),h=S("span"),u=Te(i[0]),m=ee(),g=S("div"),y(s,"class","distance svelte-b9xhqz"),y(h,"class","name svelte-b9xhqz"),y(n,"class","distance-and-name svelte-b9xhqz"),y(g,"class","border svelte-b9xhqz"),y(t,"class","text-with-distance svelte-b9xhqz")},m(p,b){O(p,t,b),v&&v.m(t,null),D(t,e),D(t,n),D(n,s),D(s,r),D(s,a),D(s,c),D(n,d),D(n,h),D(h,u),D(t,m),D(t,g)},p(p,b){p[4]?v?v.p(p,b):(v=Mu(p),v.c(),v.m(t,e)):v&&(v.d(1),v=null),b&32&&o!==(o=p[5]("全程")+"")&&Oe(r,o),b&4&&Oe(a,p[2]),b&32&&l!==(l=p[5]("米")+"")&&Oe(c,l),b&1&&Oe(u,p[0])},d(p){p&&V(t),v&&v.d()}}}function Mu(i){let t,e;return{c(){t=S("span"),e=Te(i[4]),y(t,"class","line-name svelte-b9xhqz")},m(n,s){O(n,t,s),D(t,e)},p(n,s){s&16&&Oe(e,n[4])},d(n){n&&V(t)}}}function $P(i){let t,e,n,s,o,r,a,l,c,d=i[0]&&!i[2]&&ku(i),h=i[2]&&xu(i);return{c(){t=S("div"),e=S("div"),n=ee(),s=S("div"),o=ee(),r=S("div"),a=S("div"),l=ee(),d&&d.c(),c=ee(),h&&h.c(),y(e,"class","guide-line__tag-point svelte-b9xhqz"),y(s,"class","guide-line__tag-line svelte-b9xhqz"),y(a,"class","guide-line__tag-icon svelte-b9xhqz"),j(a,"background-image",`url(${i[1]})`),y(r,"class","guide-line__tag-content svelte-b9xhqz"),y(t,"class","guide-line__tag svelte-b9xhqz"),j(t,"opacity",i[3])},m(u,m){O(u,t,m),D(t,e),D(t,n),D(t,s),D(t,o),D(t,r),D(r,a),D(r,l),d&&d.m(r,null),D(r,c),h&&h.m(r,null)},p(u,[m]){m&2&&j(a,"background-image",`url(${u[1]})`),u[0]&&!u[2]?d?d.p(u,m):(d=ku(u),d.c(),d.m(r,c)):d&&(d.d(1),d=null),u[2]?h?h.p(u,m):(h=xu(u),h.c(),h.m(r,null)):h&&(h.d(1),h=null),m&8&&j(t,"opacity",u[3])},i:J,o:J,d(u){u&&V(t),d&&d.d(),h&&h.d()}}}function e2(i,t,e){let{text:n=""}=t,{icon_url:s=""}=t,{distance:o=0}=t,{opacity:r=1}=t,{name:a=""}=t,{i18n:l=d=>d}=t;const c="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHUAAAA2CAMAAADOFiZMAAACEFBMVEUAAACIiIheXl5oaGh6enpsbGxiYmJ9fX1wcHBXV1eBgYFzc3NSUlKNjY2Dg4NOTk51dXVXV1dmZmZTU1N3d3dcXFyMjIyEhIRNTU2QkJC0tLS5ubnHx8fOzs6np6exsbHKysqoqKi9vb3U1NTPz8/Nzc2vr6/Dw8OysrK/v7/X19fS0tKurq62traqqqrJycmurq64uLifn5/Dw8O6urqQkJC6urro6Ojt7e3o6OjU1NS3t7fBwcGjo6Ozs7Orq6u1tbXAwMCurq6rq6vy8vLx8fHr6+vp6enZ2dnd3d3a2trX19fV1dW/v7/IyMihoaGampqVlZWLi4uCgoK+vr6urq7m5ubw8PDk5OTu7u7i4uLg4ODe3t7q6urS0tLi4uLOzs7e3t7Hx8fa2tqrq6vExMTAwMCnp6efn5+WlpaHh4ezs7OoqKiJiYm6urqZmZmurq59fX29vb23t7e4uLipqanp6enc3Nza2trW1tbT09Pm5ubj4+PQ0NDg4ODExMTCwsK7u7vBwcG8vLy5ubm8vLy+vr64uLiysrKdnZ3CwsJoaGisrKzHx8ekpKTExMTv7+/i4uLa2trm5ubk5OTLy8vKysrExMTQ0NDX19ecnJzT09N/f3+dnZ12dnaQkJCXl5etra3Pz8+4uLiXl5fGxsaqqqrr6+vQ0NDKysrNzc3W1takpKShoaGsrKysrKyduRZkAAAAsHRSTlMATE1NTExMTUxNTExMTExNTExMTU1MTU1MTICFc313fnl0iIWAe3h3aYqIgXx7eXZzcnFwaGggxLiog4J0dG9mZF82FMfEtK2pkYqKh3x4cm1rZmEmH8G/vry6trOxoZ2clpKOe3ptbWZjYmFgXFpaVlFPSDYlx7CspaSjoJ6akY6HfXt4bGpmY1xUU0g2LSzCuK6lopiWhoF3YmFaVlZUUU5KPyEJCcl/fXNdXFxZUIUrIQsAAAV6SURBVFjDvZj3VxNBEMePBBIOQgmEQGghISSASSBBUQFBVIpUEaR3aVJExN4F6fbee6//opPN2507E3P7fD4+b54z+935zt7lvPsBYbZ5lyXT7R5xms2ppaVpV615eVeuXL48PPzw4YPBwYsX+/vPnT1bW1t75u7p0729PT13urs7O9vbt2/ffurUp1OQ2ts7O7u77/T09PaevnvmTG3t2XPn+vsvDg4+GH5UVjl/SAjGe29La2vr5EFgm4+WlpYDgNfrbW7etQuuKDPTPTIy4nSa4bJ8lKYBV69arXmA1WpN81FamgqYzU6n0+12ZwI+qzPtyvDlR0dPCoGsecW4FEZcShwEyUDIGvtD+DcOZlrzFvcE3qylFXZ1cTqIgGk0K1xRSL84abaWtwl/8KM5kTiok04B2BpAPUWXAoGnQK3gn0xNW90ryDhpafXvJsYlJuoSdRCyTJHqBOxR9IvbUl1/PN5pL9tFR4gTJJmi7N+wl8qf7k33S+YQE0VRJwZz42RogDZcAxx+sTn1jSDho6VFBKAbp9K1XqfXi3oRgmSqQ2AGePziNpfs2GN2lV5Pp+IJkkwIrDFz+Y+Y90h/Yvtz+f0o1YGnc/lVXvshASk8IHUm6ZMIYhI6YAEyqyHkE/n8Kkuh5AX6ZVdBlypJpRJVIgTJ0IluEGCb1BDYCzWFx79h/yl5ZV3PVUSVAQIDFhCyLO/h9E9KfuOPriOqzUFjmRYYueOqTWLGfhPfHZcGrkOlgcAGskZdAV7/eIVA2eN6qZGA3Yhcxxozn3+mkD3ZQ64Z3EnQJEBouMB+Xr+68LpAuTZBOokDoPXfNIK85vZP5AqUreNqdYI6AUINkBrAtUatgaA67mEft38GvxRThWopOAFrBbj9kYXsa3z0mnrTsLAHe3yRzxGhjoBQ0BT848foqfONkT6FAAWrce3PeEpA5vZPsDf23aIhgpfIiEiIiH/mKftPfKJxTjaNv8bM6zlSzk5dmIsMDk7EGrMEbj+e+q5xLjoyOrQbGiCCaZh5/PgLzy8YiIrgNPmaZtQovP6J3ezNafTvxEfHQ2An8v/2K47hV4J0ExVBDbNCD4e/nH0lKj1+1RBvMEQboiEMUJI1BOmmGq0pVOP1z3nYF3G53EAIN4SHx4djNyxAkutQA1QnGeD2z3rY199RIZ+EtVxDPaDm9VdspYcWj65pteFaonIDBghpzeXyzNNTbyy8CpgCyCehjnvYx+uf9RTTU9cbo7SbRPmKQBnzaKMI2igthD8jVAvIuM/rXytjfyz4MFqBDgLWPGuA05/sqRQobaOzsBMbFQsRhaAWco/A6Z92FAuU446wWL+aHJWcHJtMOzEDwWrU+PyvHEcFRlkutELInT4NFiCRGqA6yQDWfH5jWdFegXLL8V3qDIsNIySHoRsWIGMN/wBY8/mXRosFxrrDCE20EwJzCGQ9XP7crBN46AdHbthmkPvluICccLzgchnDjBD/eqaxKOOtIKGyiEzDqSFOCt7D4X/dlHFDkNCWPu3fjTHGQBgpbI06TkeIpuQ37bbltAlSKstM/g6EdYcEr0jJv2rLfrZXkFKcPhVjMsWY0GGSrTn00H7TakbD11sChd7qa+gCSKdJVitpyvWLlab6uifsieKtLk1N7QZWtvpYXl4aGxsrAtIJBQVNWVlZOTkZGRm2z7bHW0q2lJRkZ2c3NOTn19fV19fn5zfAsmQL8Nhmg66cHOhvKigoSC/Iysk+vH9//jd2n8g6TG7yjbXZYCAMq6s7fBiah4aGLl0aGLhw4f758zuBmpq+vurq6h07dnR1dXTcrqqq2uejqup2R0dXF8jV1X19NTU1O3feu3f+/oWBgUtD++uePHtbLAThNzRClbi+VnseAAAAAElFTkSuQmCC";return i.$$set=d=>{"text"in d&&e(0,n=d.text),"icon_url"in d&&e(1,s=d.icon_url),"distance"in d&&e(2,o=d.distance),"opacity"in d&&e(3,r=d.opacity),"name"in d&&e(4,a=d.name),"i18n"in d&&e(5,l=d.i18n)},[n,s,o,r,a,l,c]}class t2 extends ce{constructor(t){super(),le(this,t,e2,$P,ae,{text:0,icon_url:1,distance:2,opacity:3,name:4,i18n:5},KP)}}function n2(i){return i.length===0?[]:i.filter((t,e)=>t!==i[e-1])}const i2=`
|
|
582
582
|
varying vec2 vUv;
|
|
583
583
|
|
|
584
584
|
void main() {
|
|
@@ -665,7 +665,7 @@ void main() {
|
|
|
665
665
|
gl_FragColor.a = gl_FragColor.a * linearGradientOpacity();
|
|
666
666
|
gl_FragColor.a = gl_FragColor.a * flicker;
|
|
667
667
|
}
|
|
668
|
-
`;class Yr{constructor(t,e){f(this,"name","");f(this,"startTagContainer");f(this,"endTagContainer");f(this,"mesh");f(this,"five");f(this,"mode");f(this,"path",[]);f(this,"_curvePath",null);f(this,"_curvePoints",null);f(this,"_panoGroup",[]);f(this,"skippedPositions",null);f(this,"textureUrl","");f(this,"scale",1);f(this,"width",.5);f(this,"unitLength",.5);f(this,"_visibleFloorIndexes",null);f(this,"visible",null);f(this,"modeVisible",!1);f(this,"floorVisible",!0);f(this,"defaultVisible",!1);f(this,"inWalkAnimation",!1);f(this,"customVisible",null);f(this,"parent");f(this,"plugin");f(this,"textureHasLoaded",!1);f(this,"disposed",!1);f(this,"flowAnime",new ys({progress:0}).to({progress:1}).duration(1500).repeat(1/0));f(this,"flickerAnime",ws(300).yoyo(!0).repeat(5));f(this,"cacheLengths",[]);f(this,"dispose",()=>{var t,e;this.disposed||(this.disposed=!0,this.parent.hooks.off("show",this.updateVisible),this.parent.hooks.off("hide",this.updateVisible),this.plugin.hooks.off("show",this.updateVisible),this.plugin.hooks.off("hide",this.updateVisible),this.plugin.hooks.off("enable",this.updateVisible),this.plugin.hooks.off("disable",this.updateVisible),this.five.off("modeChange",this.onFiveModeChange),this.five.off("modelShownFloorChange",this.onFiveModelShownFloorChange),this.doHide(),(t=this.startTagContainer)==null||t.plugin.dispose(),(e=this.endTagContainer)==null||e.plugin.dispose())});f(this,"onWalkAnimationStart",()=>{this.inWalkAnimation=!0,this.updateVisible()});f(this,"onWalkAnimationEnd",()=>{this.inWalkAnimation=!1,this.updateVisible()});f(this,"onFiveModeChange",t=>{this.modeVisible=this.mode==="panorama"?Ro(t):tl(t),this.updateVisible()});f(this,"onFiveModelShownFloorChange",t=>{this.floorVisible=t===null||this.visibleFloorIndexes===null||this.visibleFloorIndexes.includes(t),this.updateVisible()});f(this,"updateVisible",()=>{const t=(()=>!this.parent.visible||!this.plugin.state.enabled||!this.plugin.state.visible?!1:this.customVisible!==null?this.customVisible:this.inWalkAnimation?!0:this.modeVisible&&this.textureHasLoaded&&this.defaultVisible&&this.floorVisible)();this.visible!==t&&(this.visible=t,t?this.doShow():this.doHide())});f(this,"onFlowAnimeUpdate",t=>{const{progress:e}=t;this.mesh.material.uniforms.vOffset.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0});f(this,"onFlickerAnimeUpdate",t=>{var s,o;const{progress:e}=t,n=1-e;this.mesh.material.uniforms.flicker.value=n,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0,this.startTagContainer.tag&&Xr(this.startTagContainer.tag)&&((s=this.startTagContainer.app)==null||s.$set(we(F({},this.startTagContainer.tag.data),{opacity:n,name:this.name,distance:Math.floor(this.curvePath.getLength())}))),this.endTagContainer.tag&&Xr(this.endTagContainer.tag)&&((o=this.endTagContainer.app)==null||o.$set(we(F({},this.endTagContainer.tag.data),{opacity:n})))});f(this,"logWarning",t=>nb("GuideLineModeItem: ",t));f(this,"logError",t=>Dd("GuideLineModeItem: ",t));var o,r;this.five=t,this.mode=e.mode,this.plugin=e.plugin,this.parent=e.parent,this.startTagContainer={tag:null,plugin:new po(this.five)},this.endTagContainer={tag:null,plugin:new po(this.five)};const n=new E.BufferGeometry,s=new E.ShaderMaterial({vertexShader:i2,fragmentShader:s2,transparent:!0,uniforms:{map:{value:null},useMapColor:{value:0},mapColor:{value:new E.Color},mapOpacity:{value:1},backgroundColor:{value:new E.Color},backgroundOpacity:{value:0},borderColor:{value:new E.Color},borderOpacity:{value:0},opacity:{value:1},flicker:{value:1},maxU:{value:0},vOffset:{value:0}}});this.mesh=new E.Mesh(n,s),this.mesh.name="GuideLineModeItem",this.mode==="panorama"&&(this.parent.hooks.on("walkStart",this.onWalkAnimationStart),this.parent.hooks.on("walkEnded",this.onWalkAnimationEnd)),this.updateVisible(),this.onFiveModeChange(this.five.getCurrentState().mode),this.onFiveModelShownFloorChange((r=(o=this.five.model)==null?void 0:o.shownFloor)!=null?r:null),this.flowAnime.onUpdate(this.onFlowAnimeUpdate),this.flickerAnime.onUpdate(this.onFlickerAnimeUpdate),this.parent.hooks.on("show",this.updateVisible),this.parent.hooks.on("hide",this.updateVisible),this.plugin.hooks.on("show",this.updateVisible),this.plugin.hooks.on("hide",this.updateVisible),this.plugin.hooks.on("enable",this.updateVisible),this.plugin.hooks.on("disable",this.updateVisible),this.plugin.hooks.on("dispose",this.dispose),this.five.on("modeChange",this.onFiveModeChange),this.five.on("modelShownFloorChange",this.onFiveModelShownFloorChange)}get panoGroup(){return this._panoGroup}get visibleFloorIndexes(){return this._visibleFloorIndexes}get curvePath(){return this._curvePath}get curvePoints(){return this._curvePoints}setCustomVisible(t){if(this.disposed)return this.logError("disposed");this.customVisible!==t&&(this.customVisible=t,this.updateVisible())}setDefaultVisible(t){if(this.disposed)return this.logError("disposed");this.defaultVisible!==t&&(this.defaultVisible=t,this.updateVisible())}setUnitSize(t,e){if(this.disposed)return this.logError("disposed");this.width=t,this.unitLength=e,this.setGeometryByPath(this.path,{width:t,unit_length:e})}setScale(t){if(this.disposed)return this.logError("disposed");this.scale=t,this.setGeometryByPath(this.path,{scale:t})}setGeometryByPanoGroup(t,e){if(this.disposed)return this.logError("disposed");if(!this.five.work)return this.logError("setPathByPanoGroup: work is not ready");const n=n2(t);if(this._panoGroup=n,(e==null?void 0:e.skipPanoGroup)!==void 0){const o=e.skipPanoGroup?n.map(r=>this.five.work.observers[r]).map(r=>r.standingPosition.clone()):null;this.skippedPositions=o}const s=this.getPathFromPanoGroup(n,this.five.work,e);this.path=s,this.setGeometryByPath(s,e)}setGeometryByPath(t,e){var d,h,u;if(this.disposed)return this.logError("disposed");const n=(d=e==null?void 0:e.scale)!=null?d:this.scale,s=(h=e==null?void 0:e.width)!=null?h:this.width,o=(u=e==null?void 0:e.unit_length)!=null?u:this.unitLength;this.path=t,this.scale=n,this.width=s,this.unitLength=o;const{geometry:r,maxU:a,curvePath:l,curvePoints:c}=wb({path:t,width:s*n,unitLength:o*n,skipPositions:this.skippedPositions});this._curvePath=l,this._curvePoints=c,this.mesh.geometry=r,this.mesh.material.needsUpdate=!0,this.mesh.material.uniforms.maxU.value=a,this.five.needsRender=!0}setMartial(t){var e;if(this.disposed)return this.logError("disposed");(t==null?void 0:t.visible)!==void 0&&this.setDefaultVisible(t.visible),(t==null?void 0:t.color)!==void 0&&this.setColor(t.color),(t==null?void 0:t.opacity)!==void 0&&this.setOpacity(t.opacity),((e=t==null?void 0:t.texture)==null?void 0:e.url)!==void 0&&this.setTextureUrl(t.texture.url),(t==null?void 0:t.background_color)!==void 0&&this.setBackgroundColor(t.background_color),(t==null?void 0:t.background_opacity)!==void 0&&this.setBackgroundOpacity(t.background_opacity),(t==null?void 0:t.border_color)!==void 0&&this.setBorderColor(t.border_color),(t==null?void 0:t.border_opacity)!==void 0&&this.setBorderOpacity(t.border_opacity)}setColor(t){if(this.disposed)return this.logError("disposed");t&&(this.mesh.material.uniforms.mapColor.value=new E.Color().set(t)),this.mesh.material.uniforms.useMapColor.value=t?1:0,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.borderColor.value=new E.Color().set(t),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.borderOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundColor.value=new E.Color().set(t),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.opacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setMapOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.mapOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setTextureUrl(t){if(this.disposed)return this.logError("disposed");this.textureUrl=t,Vi(t).then(e=>{this.disposed||this.textureUrl===t&&(e.wrapT=E.RepeatWrapping,this.textureHasLoaded=!0,this.mesh.material.uniforms.map.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.mesh.material.needsUpdate=!0,this.five.needsRender=!0,this.updateVisible())})}setVisibleFloorIndexes(t){var e,n;if(this.disposed)return this.logError("disposed");this._visibleFloorIndexes=t,this.onFiveModelShownFloorChange((n=(e=this.five.model)==null?void 0:e.shownFloor)!=null?n:null)}setStartTag(t){this.setTag("start",t)}setEndTag(t){this.setTag("end",t)}flicker(){if(this.disposed)return this.logError("disposed");this.flickerAnime.play()}getLengthByPanoGroupIndex(t){return this.disposed?this.logError("disposed"):this.cacheLengths.length!==0?this.cacheLengths[t]:(this.cacheLengths=this.getPanoGroupLengths(),this.cacheLengths[t])}getPanoGroupLengths(){const t=this.panoGroup.map(c=>this.five.work.observers[c]),e=this.curvePoints.length,n=this.curvePath.getLength(),s=e-1,o=n/s,r=this.curvePath.getLengths(s),a=[];let l=0;for(let c=0;c<e;c++){const d=this.curvePoints[c],h=t[l];if(!h)break;h.standingPosition.clone().setY(0).distanceTo(d.clone().setY(0))<o&&(a.push(r[c]),l+=1)}return a}setTag(t,e){const n=t==="start"?this.startTagContainer:this.endTagContainer;e||n.plugin.clearTags();const o=Ue({},{contentType:"Custom",stickType:"2DPoint",config:{visibleConfig:{visibleFiveMode:["Floorplan","Mapview"],followModelVisibility:!1}},style:{point:{enabled:!1}},data:{}},e);n.tag=o,Xr(o)&&(n.tag.element=r=>{var c;(c=n.app)==null||c.$destroy();const a=t==="start"?we(F({},o.data),{name:this.name,distance:Math.floor(this.curvePath.getLength()),i18n:this.plugin.config.i18n}):o.data,l=new t2({target:r,intro:!0,props:a});return n.app=l,()=>l.$destroy()}),n.plugin.load({tagList:[n.tag]})}doShow(){this.mode==="model"&&this.flowAnime.play(),this.five.scene.add(this.mesh),this.startTagContainer.plugin.show(),this.endTagContainer.plugin.show(),this.five.needsRender=!0}doHide(){this.mode==="model"&&this.flowAnime.stop(),this.five.scene.remove(this.mesh),this.startTagContainer.plugin.hide(),this.endTagContainer.plugin.hide(),this.five.needsRender=!0}getPathFromPanoGroup(t,e,n){if(t.length<2)return[];const o=t.map(r=>e.observers[r]).map(r=>r.standingPosition.toArray());return[F({type:"CatmullRomCurve3",points:o},n)]}}function Xr(i){return i.contentType==="Custom"}const o2=Object.freeze(Object.defineProperty({__proto__:null,GuideLineModeItem:Yr},Symbol.toStringTag,{value:"Module"}));function Su(i){const t=Math.abs(Math.cos(i.latitude));return new E.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function r2(i,t){const e=Su(i),n=Su(t);return e.angleTo(n)}const a2=i=>Y(this,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),go=Math.PI*2;function l2(i){return i>=0&&i<go?i:(i%go+go)%go}function c2(i){return{longitude:l2(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function d2(i,t,e,n){const s=-i/e,o=i;return s*n+o}function h2(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Du="v1.0.6",Lu="CruisePlugin",vo=`${Lu}@${Du}`,Tu=()=>{console.error(`${vo} is disposed`)},u2=()=>{console.warn(`${vo} is disabled`)},f2=()=>{console.error(`${vo} is disabled`)},Ur=new Map;class Xi extends Cn{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Lu}_DEBUG__`]:this});const s=this.setFiveLinearUpdateCamera.bind(this),o=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",s),this.hooks.on("broke",o),this.hooks.on("end",o),this.hooks.on("pause",o),this.privateState.disposers.push(()=>{this.hooks.off("play",s),this.hooks.off("broke",o),this.hooks.off("end",o),this.hooks.off("pause",o)})}load(e,n,s){return Y(this,null,function*(){var d,h,u,m,g,v;if(this.state.disposed)return Tu();this.privateState.fiveOriginGetProgress||(h=(d=this.five.controller)==null?void 0:d.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(m=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:m.getProgress),this.clear();const o=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,o);let a=[],l;const c=this.data.keyframes.filter(p=>p.data.panoIndex!==void 0);c.filter((p,b)=>{var w;return p.data.panoIndex!==((w=c[b-1])==null?void 0:w.data.panoIndex)}).map(p=>p.data.panoIndex).forEach(p=>{var w,P;const b=(w=this.five.work.observers[p])==null?void 0:w.floorIndex;if(b!==void 0)if(l===b){const k=a.length-1;a[k]=[...(P=a[k])!=null?P:[],p]}else{l=b;const k=a.length;a[k]=[p]}}),!this.GuideLine&&((g=this.config)==null?void 0:g.useGuideLine)!==!1&&r.useGuildLine!==!1&&(this.GuideLine=Ou(this.five,this.config)),(v=this.GuideLine)==null||v.load({routes:a.map(p=>({panoIndexList:p})),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:s}),console.debug(`${vo} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:s,userAction:o}=e;this.state.playing&&this.setState({playing:!1},{userAction:o}),this.setState({playing:!0},{userAction:o,playFromIndex:n,playFromId:s})}playFromStart(e){return this.playFrom(we(F({},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 o;if(this.state.disposed)return Tu();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return f2();const s=F({},this.state);this.state=F(F({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==s.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==s.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),Ot(s,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}formatData(e){return Y(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,s=(()=>{const o=e;return typeof o=="object"&&o!==null&&o.version&&o.data?o.data:o})();if(s.keyframes)return{keyframesId:tt(),keyframes:s.keyframes.map((o,r)=>{var c;const a=s.keyframes[r+1],l=(()=>!a||a.start===void 0||o.end===void 0?0:a.start-o.end)();return we(F({id:(c=o.uuid)!=null?c:tt(),moveIndex:r,stay:l,index:r},o),{guildPluginOptions:s.guildPluginOptions})})};if(s.panoIndexList){let o=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=s;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,s.panoIndexList.forEach((c,d)=>{const h=(()=>{var p,b,w,P;const u=s.panoIndexList.slice(d).find(k=>k!==c);if(u===void 0)return;const m=(p=n[c])==null?void 0:p.position,g=(b=n[u])==null?void 0:b.position;if(!g||!m||((w=n[c])==null?void 0:w.floorIndex)!==((P=n[u])==null?void 0:P.floorIndex))return;const v=new E.Vector3().subVectors(g,m);return c2(v.normalize())})();s.moveType===void 0||s.moveType==="justMove"?o.push({moveIndex:d,stay:s.stay,data:F({effect:"Move",panoIndex:c,moveEffect:r},h!=null?h:{})}):s.moveType==="moveAndRotate"&&(o.push({moveIndex:d,stay:s.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),h&&o.push({moveIndex:d,stay:s.stay,data:F({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:tt(),keyframes:o.map((c,d)=>F({id:tt(),index:d},c)),guildPluginOptions:s.guildPluginOptions,useGuildLine:s.useGuildLine}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var s,o;e?((s=this.GuideLine)==null||s.enable(),this.hooks.emit("enable",{userAction:n})):((o=this.GuideLine)==null||o.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var s,o;e?((s=this.GuideLine)==null||s.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((o=this.GuideLine)==null||o.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var s;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return Y(this,null,function*(){var m;const{data:n,state:s,privateState:o,hooks:r}=this;if(o.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=tt();o.playId=a,o.playing=!0,o.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(m=e==null?void 0:e.userAction)!=null?m:!0});let d=!1;const u=yield(()=>Y(this,null,function*(){var g,v;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(g=this.data)==null?void 0:g.keyframes.findIndex(p=>p.id===e.playFromId);if(c!=null&&c.keyframeId){const p=(v=this.data)==null?void 0:v.keyframes.find(b=>b.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:o.moveToFirstPanoEffect,duration:o.moveToFirstPanoDuration})),p){if(p.data.effect==="Move")return p.index;if(p.data.effect==="Rotate"){const b=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(p,{duration:b}),d=!0,p.index+1}}}}))();this.clearPauseData();for(const g of l){if(o.broke||!s.playing||!o.playing||a!==o.playId)return;if(!(u!==void 0&&g.index<u))try{r.emit("playIndexChange",g.index,g),yield this.playKeyframe(g,{moveEffect:d===!1?o.moveToFirstPanoEffect:void 0,duration:d===!1&&typeof o.moveToFirstPanoDuration=="number"?o.moveToFirstPanoDuration:void 0}),g.stay&&(yield h2(g.stay)),d===!1&&(d=!0)}catch(v){return Promise.resolve("broke")}}s.playing&&a===o.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:s,hooks:o}=this;n.playing=!1,s.playing!==!1&&(s.playing=!1,this.setPauseData(),s.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&o.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return Y(this,null,function*(){var o;const{privateState:s}=this;return((o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),s.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},s=e;return this.five.once("gesture",s),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",s),this.five.once("wantsChangeMode",n)}}getPlayPromise(s){return Y(this,arguments,function*(e,n={}){var r;const o=e.data;if(n.duration=(r=n.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!o)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const d=()=>{a(),c=!0};switch(o.effect){case"Move":this.move(o,n).then(d);break;case"Rotate":this.rotate(o,n).then(d);break;default:this.rotate(o,n).then(d)}}catch(d){}})})}actionPromiseQueue(){return Y(this,null,function*(){const{privateState:e}=this;return new Promise((n,s)=>{if(e.currentPlayQueue.length===0){n();return}const o=e.currentPlayQueue.shift();if(!o){n();return}o.then(n,s)}).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(s){return Y(this,arguments,function*(e,n={}){const{five:o,privateState:r,state:a}=this,l=(()=>{var m,g;const h=(m=a.config)==null?void 0:m.speedConfig,u=(g=e.rotateSpeed)!=null?g:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return u;if(u!==void 0)return h.rotateSpeedUnit==="rad/ms"?u:u/1e3})(),c=(()=>{if(n.duration)return n.duration;if(l){const h=this.five.getCurrentState();return r2(h,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const d=this.getSpeededDuration(c);return new Promise(h=>{a2(()=>o.updateCamera(e,d)),setTimeout(()=>h(),d)})})}changePano(e,n){return Y(this,null,function*(){const{five:s,privateState:o,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===s.panoIndex)return;const a=s.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var u,m;const d=(u=r.config)==null?void 0:u.speedConfig,h=(m=e.moveSpeed)!=null?m:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return h;if(h!==void 0)return d.moveSpeedUnit==="m/ms"?h:h/1e3})(),c=(()=>{if(n!=null&&n.duration)return n.duration;if(l&&typeof s.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=s.work.observers[s.panoIndex].position,h=s.work.observers[e.panoIndex].position;return d.distanceTo(h)/l}return 800})();o.currentPlayKeyframe&&(o.currentPlayKeyframe.originDuration=c),yield new Promise(d=>{var h,u,m;s.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(m=(u=n==null?void 0:n.moveEffect)!=null?u:(h=this.state.config)==null?void 0:h.moveEffect)!=null?m:e.moveEffect,moveCancelCallback:()=>d(),moveEndCallback:()=>d()}),a&&s.once("panoArrived",()=>d())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:s,privateState:o,hooks:r}=this,{currentPlayKeyframe:a}=o;if(r.emit("speedChange",e,{userAction:n}),s.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});o.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 Ur.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,s,o;if((e=this.data)!=null&&e.keyframesId)return Ur.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id,fiveState:this.five.getCurrentState(),duration:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Ur.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(s=>s==null?void 0:s())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&u2()}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,s=e-n.startTime;return s<0?0:s>=n.duration?1:1-d2(1,n.startVelocity,n.duration,s)})}setFiveOriginUpdateCamera(){this.privateState.fiveOriginGetProgress&&(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(Xi,"PluginVersion",Du);const m2=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),p2=i=>new Xi(i);class zu{constructor(t){f(this,"id");f(this,"renderID");f(this,"isGuideLine",!0);f(this,"panoramaItem");f(this,"modelItem");f(this,"hooks",new ve.Subscribe);f(this,"_visible",!0);f(this,"plugin");f(this,"five");f(this,"logError",t=>Dd("GuideLineItem: ",t));this.id=t.id,this.five=t.five,this.plugin=t.plugin,this.panoramaItem=new Yr(this.five,{mode:"panorama",plugin:this.plugin,parent:this}),this.modelItem=new Yr(this.five,{mode:"model",plugin:this.plugin,parent:this})}get visible(){return this._visible}setData(t){this.setDataByMode("panorama",t),this.setDataByMode("model",t)}setHeightOffset(t){this.modelItem.mesh.position.y=t,this.panoramaItem.mesh.position.y=t}setDataByMode(t,e){var l;const n=t==="panorama"?this.panoramaItem:this.modelItem,s=t==="panorama"?e.panorama_style:e.model_style,o=e.path,r=s,a=s;if(e.pano_group){const c=t==="panorama";n.setGeometryByPanoGroup(e.pano_group,F({skipPanoGroup:c},r))}else e.path&&n.setGeometryByPath(o,r);n.name=e.name,n.setMartial(a),n.setVisibleFloorIndexes((l=e.visible_floor_indexes)!=null?l:null),n.setStartTag(s==null?void 0:s.start_tag),n.setEndTag(s==null?void 0:s.end_tag)}show(){this._visible=!0,this.hooks.emit("show",{userAction:!0})}hide(){this._visible=!1,this.hooks.emit("hide",{userAction:!0})}dispose(){this.panoramaItem.dispose(),this.modelItem.dispose()}walk(t){return Y(this,null,function*(){if(!this.panoramaItem.panoGroup)return;const e=F({panoIndexList:this.panoramaItem.panoGroup},t);this.hooks.emit("walkStart",{userAction:!0});const[n]=yield ti(g2(this.five,e));if(this.hooks.emit("walkEnded",{userAction:!0}),n)return this.logError(n.message)})}}function g2(i,t){return Y(this,null,function*(){if(t.panoIndexList.length===0)return;const e=i.getCurrentState();e.mode!=="Panorama"&&(yield hr(i,["Panorama",{longitude:e.longitude,latitude:0,panoIndex:t.panoIndexList[0]}]));const n=new Xi(i,{useGuideLine:!1});yield n.load(t),yield new Promise((s,o)=>{const r=i.getCurrentState();let a=t.panoIndexList.slice();r.panoIndex===a[0]&&c(r.panoIndex),n.playFromStart();function l(m){if(m!=="Panorama")return h(new Error("mode not match"))}function c(m){const g=a[0];if(a=a.slice(1),m!==g)return h(new Error("panoIndex not match, wanted: "+g+", got: "+m));if(a.length===0)return u()}function d(){i.off("modeChange",l),i.off("panoArrived",c)}function h(m){d(),o(m)}function u(){d(),s()}i.on("modeChange",l),i.on("panoArrived",c)})})}const v2=Object.freeze(Object.defineProperty({__proto__:null,GuideLineItem:zu},Symbol.toStringTag,{value:"Module"})),ju="v1.1.0",qr="GuideLinePlugin",Vu=`${qr}@${ju}`;class A2 extends Cn{constructor(e,n){super(e,n);f(this,"version",ju);f(this,"name",qr);f(this,"cruisePlugin");f(this,"itemMap",new Map);f(this,"state",{visible:!1,enabled:!0});f(this,"data");f(this,"heightOffset",0);f(this,"_config");f(this,"_disposed",!1);f(this,"disposedErrorLog",()=>{console.error(`${Vu} is disposed`)});this._config=n!=null?n:{},this.cruisePlugin=new Xi(e,{useGuideLine:!1}),Object.assign(window,{[`__${qr}_DEBUG__`]:this})}get config(){return this._config}get disposed(){return this._disposed}load(e,n,s=!0){return Y(this,null,function*(){var m,g,v,p,b,w,P;if(this.disposed)return;const o=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,o),this.data=r;const a=r.config,c={panorama_style:{visible:!!(!r.lines&&r.routes),unit_length:(m=a==null?void 0:a.unitHeight)!=null?m:.4,width:(g=a==null?void 0:a.unitWidth)!=null?g:.6,texture:{url:(v=a==null?void 0:a.arrowTextureUrl)!=null?v:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"}}},d=(b=(p=r.routes)==null?void 0:p.map(k=>{var T;return Ue({},c,{id:(T=k.id)!=null?T:Date.now(),pano_group:k.panoIndexList})}))!=null?b:[],h=(P=(w=r.lines)==null?void 0:w.map(k=>Ue({},c,k)))!=null?P:[],u=[...d,...h];yield this.waitFiveLoaded(),this.clear(),u.forEach(k=>{this.addGuideLineItem(k)}),this.updateTagsEnable(),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n,{userAction:s}),this.hooks.emit("dataLoaded",r),console.debug(`${Vu} loaded`,r)})}formatData(e){return Y(this,null,function*(){return this.getDataWithoutVersion(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.disposed||(this.clear(),this.hooks.emit("dispose"))}setState(e,n){var o;if(this.disposed)return this.disposedErrorLog();const s=F({},this.state);this.state=F(F({},this.state),e),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),Ot(s,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(o=n==null?void 0:n.userAction)!=null?o:!0}),this.five.needsRender=!0)}addGuideLineItem(e){const n=e.render_id||e.id,s=this.itemMap.get(n);s&&this.removeGuideLineItem(s);const o=new zu({five:this.five,id:n,plugin:this});return this.itemMap.set(n,o),e&&o.setData(e),this.heightOffset+=1e-4,o.setHeightOffset(this.heightOffset),o}getGuideLineItemByID(e){return this.itemMap.get(e)}removeGuideLineItem(e){this.itemMap.delete(e.id),e.panoramaItem.dispose(),e.modelItem.dispose()}updateTagsEnable(){const e=[];function n(r){return Array.isArray(r)&&r.every(a=>typeof a=="number")}function s(r,a){return new E.Vector3().fromArray(r).distanceTo(new E.Vector3().fromArray(a))<.01}function o(r){var l;const a=(l=r.tag)==null?void 0:l.position;return n(a)?e.every(c=>{var d;return n((d=c.tag)==null?void 0:d.position)?!s(a,c.tag.position):!0}):!1}this.itemMap.forEach(r=>{const a=r.modelItem.startTagContainer,l=r.modelItem.endTagContainer,c=o(a);c&&e.push(a),a.plugin.setState({enabled:c},{});const d=o(l);d&&e.push(l),l.plugin.setState({enabled:d},{})})}clear(){this.itemMap.forEach(e=>{this.removeGuideLineItem(e)})}handleEnable(e,n=!0){this.hooks.emit(e?"enable":"disable",{userAction:n})}handleVisible(e,n=!0){this.state.enabled&&this.hooks.emit(e?"show":"hide",{userAction:n})}waitFiveLoaded(){return Y(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}getDataWithoutVersion(e){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e}}const Ou=(i,t)=>new A2(i,t);function Bu(i,t,e){if(e){const s=new E.Vector3().subVectors(i.position,e).applyQuaternion(i.quaternion.clone().inverse()).applyQuaternion(t).add(e);i.position.copy(s)}i.quaternion.copy(t)}class Ao extends Qc{constructor(e,n){var s;super();f(this,"originObject3D");f(this,"onRender");this.originObject3D=e,this.onRender=(s=n==null?void 0:n.onRender)!=null?s:()=>{}}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,n=[]){return e.intersectObject(this,!0,n)}initialPosition(){this.position.add(this.originObject3D.position)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}setHelperQuaternion(e,n){Bu(this,e,n)}applyHelperQuaternion(e,n){if(n){const s=new _.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(s)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class b2 extends Ao{}class y2 extends Ao{}class w2 extends Ao{}class _u extends Ao{}class C2 extends _u{}class P2 extends E.Group{constructor(e){super();f(this,"direction");this.direction=e||"x"}}class Qu extends E.Mesh{constructor(e,n,s){super(e,n);f(this,"direction");this.direction=s||"x"}}function I2(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:s,left:o}=t.getBoundingClientRect();return Object.assign(new E.Vector2,{x:(i.x-o)/e*2-1,y:-(i.y-s)/n*2+1})}function Jr(i,t,e){if(!t||!e||!i)return;const n=I2(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const s=new E.Raycaster;return s.setFromCamera(n,i),s}function E2(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 Zr extends P2{constructor(e){var d;super(e.direction);f(this,"line");f(this,"arrow");f(this,"lineHeight",.4);f(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new E.Color((d=e.color)!=null?d:16214315),s=new E.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:E.DoubleSide}),o=new E.ConeGeometry(.04,.1,32),r=new Qu(o,s.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new E.CylinderGeometry(a,a,.4,32),c=new Qu(l,s.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const Kr={X:15618642,Y:4765519,Z:4227839};class fi{static get X(){return new E.Color(Kr.X).convertSRGBToLinear().clone()}static get Y(){return new E.Color(Kr.Y).convertSRGBToLinear().clone()}static get Z(){return new E.Color(Kr.Z).convertSRGBToLinear().clone()}}class k2 extends b2{constructor(e){super(e);f(this,"xArrow",new Zr({direction:"x",color:fi.X}));f(this,"yArrow",new Zr({direction:"y",color:fi.Y}));f(this,"zArrow",new Zr({direction:"z",color:fi.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 Sn(i,t){return x2(document.createElement(t!=null?t:"div"),i)}function x2(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function M2(i){const t=Sn(F({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"99999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},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:(o,r)=>{t.style.left=o,t.style.top=r,e()}}}class S2 extends w2{constructor(e,n){super(e);f(this,"xCircle");f(this,"yCircle");f(this,"zCircle");f(this,"children",[]);f(this,"angleTips");f(this,"container");(n==null?void 0:n.yzCircleEnable)!==!1&&(this.xCircle=new $r({direction:"x",color:fi.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.yCircle=new $r({direction:"y",color:fi.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.zCircle=new $r({direction:"z",color:fi.Z})),n!=null&&n.container&&(n==null?void 0:n.angleTipsEnable)!==!1&&(this.container=n==null?void 0:n.container,this.angleTips=M2({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(n=>n.showCircle()),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.children.filter(s=>e.includes(s.direction)).forEach(s=>s.showRing()),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.removeFromParent(),(n=(e=this.angleTips)==null?void 0:e.element)==null||n.remove()}}class $r extends E.Group{constructor(e){super();f(this,"direction");f(this,"circle");f(this,"ring");f(this,"angleSector");this.direction=e.direction,this.circle=new D2(e),this.ring=new L2(e),this.angleSector=new T2(e),this.add(this.circle,this.ring,this.angleSector),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}showCircle(){this.add(this.circle),this.remove(this.ring,this.angleSector)}showRing(){this.add(this.ring,this.angleSector),this.remove(this.circle)}hide(){this.remove(this.ring,this.angleSector,this.circle)}}class D2 extends E.Mesh{constructor(e){var n;super();f(this,"direction");f(this,"gapAngle",.02);f(this,"geometry",new E.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new E.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:E.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`}}class L2 extends E.Group{constructor(e){super();f(this,"direction");this.direction=e.direction;const n=.015,s=new Array(8).fill(null).map((o,r)=>{const a=new E.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new E.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),c=new E.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...s)}}class T2 extends E.Mesh{constructor(e){var s;super();f(this,"direction");f(this,"baseAxes");f(this,"angleDirection");switch(e.direction){case"x":this.baseAxes=new E.Vector3(0,0,1);break;case"y":this.baseAxes=new E.Vector3(1,0,0);break;case"z":this.baseAxes=new E.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new E.CircleGeometry(n,48,0,1e-4),this.material=new E.MeshBasicMaterial({opacity:.4,color:(s=e.color)!=null?s:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function z2(){const i=Sn({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Sn({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Sn({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",s={direction:"nesw",element:pn({cursor:"nesw-resize",left:n,bottom:n})},o={direction:"ns",element:pn({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:pn({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:pn({cursor:"ew-resize",right:n})},l={direction:"nesw",element:pn({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:pn({cursor:"ns-resize",top:n})},d={direction:"nwse",element:pn({cursor:"nwse-resize",left:n,top:n})},h={direction:"ew",element:pn({cursor:"ew-resize",left:n})};return new Array(o,a,c,h,s,r,l,d).forEach(m=>t.appendChild(m.element)),{container:i,squares:[s,o,r,a,l,c,d,h]}}function pn(i){const t=Sn(F({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Sn({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Sn({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 j2 extends C2{constructor(e,n,s,o){super(e);f(this,"points",[]);f(this,"cornerPositions",[]);f(this,"css3DInstance");f(this,"plane");f(this,"css3DRenderer",new Gn);f(this,"camera");f(this,"scene");f(this,"container");f(this,"enabled",!1);this.camera=s,this.scene=o,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(s=>s.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var s;(s=this.plane)==null||s.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,s)=>{n.position.copy(e[s])})}applyHelperQuaternion(e,n){var o;const s=(o=this.css3DInstance)==null?void 0:o.css3DObject;if(s){const r=new E.Vector3().subVectors(s.position,n).applyQuaternion(e).add(n);s.position.copy(r),s.applyQuaternion(e)}if(this.plane){const r=new E.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 E.Vector3().subVectors(r,n).applyQuaternion(e).add(n);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;this.enabled&&(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a,l;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const n=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!n)return;this.css3DInstance=n,n.appendToElement(this.container);const s=n.css3DObject.container,{container:o,squares:r}=z2();this.points=r.map((c,d)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[d]})),s.insertBefore(o,(a=s.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("当前物体暂时不支持 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}function Ru(i){const t=new E.Box3,e=new E.Vector3;if(i.traverse(n=>{var o;if(n.name==="shadow")return;const s=n.geometry;if(s!==void 0)if((o=s==null?void 0:s.attributes)!=null&&o.position){const r=s.attributes.position;for(let a=0,l=r.count;a<l;a++)e.fromBufferAttribute(r,a).applyMatrix4(n.matrix),t.expandByPoint(e)}else s.vertices.forEach(r=>{const a=r.clone().applyMatrix4(n.matrix);t.expandByPoint(a)})}),!t.isEmpty())return t}class V2 extends y2{constructor(e){super(e);f(this,"box");f(this,"outline");f(this,"originObject");f(this,"positionAttribute");this.originObject=e,this.positionAttribute=new E.BufferAttribute(new Float32Array(8*3),3),this.box=this.createBox(),this.outline=this.createOutline(),this.add(this.box,this.outline),this.update()}raycasterIntersectObject(e,n){return e.intersectObject(this,!1,n)}raycast(e,n){this.box.raycast(e,n)}update(){const e=Ru(this.originObject);if(!e)return;const{min:n,max:s}=e;this.positionAttribute.setXYZ(0,s.x,s.y,s.z),this.positionAttribute.setXYZ(1,n.x,s.y,s.z),this.positionAttribute.setXYZ(2,n.x,n.y,s.z),this.positionAttribute.setXYZ(3,s.x,n.y,s.z),this.positionAttribute.setXYZ(4,s.x,s.y,n.z),this.positionAttribute.setXYZ(5,n.x,s.y,n.z),this.positionAttribute.setXYZ(6,n.x,n.y,n.z),this.positionAttribute.setXYZ(7,s.x,n.y,n.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const s=new E.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),o=new E.LineSegments(n,s);return o.matrixAutoUpdate=!1,o}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const s=new E.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new E.Mesh(n,s)}}class Ui{constructor(t,e){f(this,"originObject3D");f(this,"hooks");f(this,"disposers",[]);f(this,"helperObject3D");f(this,"camera");f(this,"model");f(this,"scene");f(this,"container");f(this,"domEvents");f(this,"isDragging",!1);f(this,"enabled",!1);f(this,"name","BaseController");f(this,"boundingBox");f(this,"offset");f(this,"onRender");f(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});var c,d;this.hooks=(c=t.sharedHooks)!=null?c:new Qn,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new De(t.camera,t.container),this.onRender=(d=t.onRender)!=null?d:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const n=(...h)=>this.onSetOriginObjectScale(...h),s=(...h)=>this.onSetOriginObjectRotate(...h),o=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",n),this.hooks.on("setObjectRotate",s),this.hooks.on("setObjectPosition",o),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",n),this.hooks.off("setObjectRotate",s),this.hooks.off("setObjectPosition",o),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){this.enabled&&(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,n=new E.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),s=new E.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),o=this.calculateOffset(this.offset,{min:s,max:n});this.helperObject3D.position.copy(o),this.helperObject3D.initialPosition()}}hoverListener(t,e=16777215,n=1){const s=(Array.isArray(t)?t:[t]).filter(Fn),o=[];for(const r of s)if(r instanceof E.Mesh||r instanceof E.Group){const a=r instanceof E.Group?r.children.filter(u=>u instanceof E.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()},h=()=>{this.isDragging||c()};for(const u of a)this.domEvents.addEventListener(u,"mouseover",d),this.domEvents.addEventListener(u,"mouseout",h),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),o.push(()=>{this.domEvents.removeEventListener(u,"mouseover",d),this.domEvents.removeEventListener(u,"mouseout",h),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>o.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;const s=this.helperObject3D.raycasterIntersectObject(t)[0];if(!s)return;const o=s;if(o.object=n,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<o.point.distanceTo(e))return}return o.object}calculateOffset(t,e){const n=this.originObject3D,s=new E.Vector3(0,0,0);if(!t)return s;const o=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=Ru(n),this.boundingBox));if(typeof t.x=="number")s.setX(t.x);else if(typeof t.x=="object"){const r=o();s.setX((r.max.x-r.min.x)*t.x.percents)}if(typeof t.y=="number")s.setY(t.y);else if(typeof t.y=="object"){const r=o();s.setY((r.max.y-r.min.y)*t.y.percents)}if(typeof t.z=="number")s.setZ(t.z);else if(typeof t.z=="object"){const r=o();s.setZ((r.max.z-r.min.z)*t.z.percents)}return s}}class O2 extends Ui{constructor(...e){super(...e);f(this,"name","MoveController");f(this,"startInfo");f(this,"_moveByMouseEnable",!1);f(this,"mouseInfo");f(this,"mousedownEventListenerDisposer");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const s=this.dragStart.bind(this),o=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),this.hooks.on("rotateStart",l),this.hooks.on("rotateEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",s),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),this.hooks.off("rotateStart",l),this.hooks.off("rotateEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouseEnable}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(n=>n==null?void 0:n())}moveByMouse(){this._moveByMouseEnable=!0;const e=this.handleMouseDown.bind(this),n=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",n)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",n)}}disableMoveByMouse(){var e;this._moveByMouseEnable=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){!this.moveByMouseEnable||this.hooks.emit("wantToMove",e.point)||(this.originObject3D.position.copy(e.point),this.hooks.emit("setObjectPosition",e.point),this.hooks.emit("move",e.point))}onApplyOriginObjectScale(e){}handleMouseDown(e){const{x:n,y:s}=e;this.mouseInfo={x:n,y:s,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:n,y:s}=e;this.mouseInfo.x===n&&this.mouseInfo.y===s&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}dragStart(e){if(this._moveByMouseEnable||this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const s=(n==null?void 0:n.object).direction;if(!s)return this.dragEnd();const o=new E.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new E.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new E.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(s){case"x":return o;case"y":return r;case"z":return a}})(),c=(()=>{switch(s){case"x":case"y":return a;case"z":return o}})(),d=n.point.clone(),h=new E.Plane;h.setFromNormalAndCoplanarPoint(c,d),this.startInfo={startVectorProject:d.clone().projectOnVector(l),directionVector:l,plane:h},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("moveStart"),this.isDragging=!0}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=Jr(this.camera,e,this.container);return n?(this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:s,startVectorProject:o}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new E.Vector3);if(!a)return;const l=a.clone().projectOnVector(s),c=l.clone().sub(o),d=new E.Matrix4;d.setPosition(c);const h=r.position.clone().applyMatrix4(d);this.hooks.emit("wantToMove",h)||(r.applyMatrix4(d),o.copy(l),this.hooks.emit("applyObjectPosition",{matrix:d}),this.hooks.emit("move",h))}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class qi{constructor(t,e,n,s,o,r){f(this,"helperController");f(this,"five");f(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});f(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});f(this,"onFiveIntersectionOnModelUpdate",(...t)=>{this.helperController&&this.helperController.onIntersectionOnModelUpdate(...t)});const{camera:a,model:l,scene:c}=t,d=t.getElement();if(this.five=t,!a||!l||!d||!c)return;const h=()=>{t.needsRender=!0};this.helperController=new e({camera:a,model:l,originObject3D:n,helperObject3D:s,container:d,scene:c,onRender:h,sharedHooks:r},o),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const ea="Object3DHelper@v1.0.1",B2=()=>{console.error(`${ea} is disposed`)},_2=()=>{console.warn(`${ea} is disabled`)},Q2=()=>{console.error(`${ea} is disabled`)};class R2{constructor(t){f(this,"controllers",{});f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"hooks",new Qn);f(this,"eventListener",{});t&&this.addControllers(t),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 B2();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return Q2();const n=F({},this.state);this.state=F(F({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=F(F({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose()});for(const n in this.controllers){if(!n)continue;const s=n;(e=(t=this.eventListener)[s])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&_2()}}function ta(i){return i*Math.PI/180}class G2 extends Ui{constructor(...e){var c,d,h;super(...e);f(this,"name","RotateController");f(this,"startInfo");f(this,"removeListener");const n=this.helperObject3D;this.hoverListener([(c=n.xCircle)==null?void 0:c.circle,(d=n.yCircle)==null?void 0:d.circle,(h=n.zCircle)==null?void 0:h.circle].filter(Boolean));const s=this.dragStart.bind(this),o=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.removeListener=()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",s),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}}get rotateCenter(){return this.helperObject3D.position.clone()}initialHelperQuaternion(){this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:n=0,y:s=0,z:o=0}=e,r=new E.Euler(ta(n),ta(s),ta(o)),a=new E.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:d}=this;Bu(c,a,d),this.hooks.emit("setObjectRotate",a,d),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const s=(n==null?void 0:n.object).direction;if(!s)return this.dragEnd();const o=n.point,r=this.getAngleHelper(s);this.setTipsAngle(0);const a=o.clone();a.y+=.2,this.setTipsPosition(a);const l=(()=>{if(s==="x")return new E.Vector3(1,0,0).applyQuaternion(this.originObject3D.quaternion);if(s==="y")return new E.Vector3(0,1,0).applyQuaternion(this.originObject3D.quaternion);if(s==="z")return new E.Vector3(0,0,1).applyQuaternion(this.originObject3D.quaternion)})(),c=new E.Plane().setFromNormalAndCoplanarPoint(l,o),h=c.projectPoint(o.clone(),new E.Vector3).clone().sub(this.rotateCenter),u=h.angleTo(r.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));this.setAngleHelperStart(s,u),this.setAngleHelperLength(s,0),this.startInfo={direction:s,startVector:h,plane:c,angleHelper:r,angle:0,objectQuaternion:this.originObject3D.quaternion.clone()},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=Jr(this.camera,e,this.container);return n?(this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:s,angleHelper:o,direction:r,objectQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(s,new E.Vector3);if(!c)return;const d=this.rotateCenter.clone(),u=s.projectPoint(c.clone(),new E.Vector3).clone().sub(d);if(n.angleTo(u)===0)return;const m=new E.Quaternion().setFromUnitVectors(n.clone().normalize(),u.clone().normalize()),g=l.quaternion.clone().premultiply(m);if(this.hooks.emit("wantToRotate",g))return;const b=new E.Euler().setFromQuaternion(new E.Quaternion().setFromUnitVectors(n.clone().normalize().applyQuaternion(a.clone().inverse()),u.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*o.angleDirection;if(this.startInfo.angle+=b,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle(Rl(this.startInfo.angle)),d){const w=new E.Vector3().subVectors(l.position,d).applyQuaternion(m).add(d);l.position.copy(w)}l.applyQuaternion(m),this.hooks.emit("applyObjectRotate",{quaternion:m,origin:d}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=u}dragEnd(){this.isDragging&&(this.hooks.emit("setObjectRotate",this.originObject3D.quaternion,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var n,s,o;switch(e){case"x":return(n=this.helperObject3D.xCircle)==null?void 0:n.angleSector;case"y":return(s=this.helperObject3D.yCircle)==null?void 0:s.angleSector;case"z":return(o=this.helperObject3D.zCircle)==null?void 0:o.angleSector}}setAngleHelperStart(e,n){const s=this.getAngleHelper(e);if(!s){console.warn("angleHelper is undefined");return}if(s instanceof E.Mesh&&s.geometry instanceof E.CircleGeometry){const{radius:o,segments:r,thetaLength:a}=s.geometry.parameters;s.geometry=new E.CircleGeometry(o,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const o=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof E.Mesh&&r.geometry instanceof E.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(o)*(40/(2*Math.PI)));r.geometry=new E.CircleGeometry(a,c,l,o)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var s;const n=(s=this.helperObject3D.angleTips)==null?void 0:s.element;n&&(n.innerText=`${e.toFixed(0)}°`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const s=e.project(this.camera),{x:o,y:r,z:a}=s;if(a>1)return;const l=(o+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class F2 extends Ui{constructor(...e){super(...e);f(this,"startInfo");f(this,"name","RectangleScaleController")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}onApplyOriginObjectPosition(e){this.isDragging||super.onApplyOriginObjectPosition(e)}onApplyOriginObjectScale(e){this.helperObject3D.applyHelperScaleMatrix4(e.matrix,e.origin)}getDragPlane(){const e=new E.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new _.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var o,r;(r=(o=this.helperObject3D).updatePoints)==null||r.call(o);const s=this.getDragPlane();if(!s)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:s},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=Jr(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n)}scale(e){var X,Z;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:s,plane:o}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(o,new _.Vector3);if(!a||E2(a,this.camera.position))return;const l=new _.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:d}=s,h=new _.Vector3().subVectors(r[1],r[0]),u=new _.Vector3().subVectors(r[3],r[0]),m=G=>{const R=new _.Vector3(0,0,0);if(!this.startInfo)return R;const H=(G==="ew"?h:u).clone(),Q=c.clone().projectOnVector(H),W=a.clone().projectOnVector(H),q=l.clone().projectOnVector(H);if(W.equals(Q))return R;if(G==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const de=new _.Vector3().subVectors(W,q),oe=de.x<0&&H.x>=0,Pe=de.y<0&&H.y>=0,Ie=de.z<0&&H.z>=0;this.startInfo.dragPointInCenterBottom=oe||Pe||Ie}if(G==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const de=new _.Vector3().subVectors(W,q),oe=de.x<0&&H.x>=0,Pe=de.y<0&&H.y>=0,Ie=de.z<0&&H.z>=0;this.startInfo.dragPointInCenterLeft=oe||Pe||Ie}const U=new _.Vector3().subVectors(W,Q),K=U.length();return K>.3?(console.warn("offset.length() > 0.3, skipped",K),R):U},g=m("ew"),v=m("ns"),p=()=>{const G=g;this.helperObject3D.cornerPositions.forEach((R,H)=>{var Q;(Q=this.startInfo)!=null&&Q.dragPointInCenterLeft?(H===0||H===3)&&R.add(G):(H===1||H===2)&&R.add(G)})},b=()=>{const G=v;this.helperObject3D.cornerPositions.forEach((R,H)=>{var Q;(Q=this.startInfo)!=null&&Q.dragPointInCenterBottom?(H===0||H===1)&&R.add(G):(H===2||H===3)&&R.add(G)})};switch(d){case"ew":p();break;case"ns":b();break;case"nesw":case"nwse":p(),b()}const w=new _.Vector3().subVectors(r[1],r[0]).length()/h.length(),P=new _.Vector3().subVectors(r[3],r[0]).length()/u.length(),k=new _.Vector3(w,P,1),T=new E.Matrix4().scale(k);n.isCSS3DObjectPlus?n.applyScaleMatrix4(T):n.scale.applyMatrix4(T),s.position.copy(a);const I=new _.Vector3().addVectors(r[0],r[2]).divideScalar(2),B=new _.Vector3().subVectors(I,l),L=new E.Matrix4().setPosition(B);n.applyMatrix4(L),(X=this.helperObject3D.css3DInstance)==null||X.css3DObject.applyMatrix4(L),(Z=this.helperObject3D.plane)==null||Z.applyMatrix4(L),this.hooks.emit("applyObjectScale",{matrix:T}),this.hooks.emit("applyObjectPosition",{matrix:L}),this.render()}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class H2 extends F2{constructor(...e){super(...e);f(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const n=e.point,s=a=>this.dragStart(a,e),o=this.dragging.bind(this),r=this.dragEnd.bind(this);n.addEventListener("dragstart",s),n.addEventListener("drag",o),n.addEventListener("dragend",r)})}}class W2 extends Ui{constructor(...e){super(...e);f(this,"name","BoundingBoxController")}}class N2 extends _u{constructor(t){super(t)}}class Y2 extends Ui{constructor(...e){super(...e);f(this,"name","ScaleController")}setScale(e){var l,c,d;let n=1,s=1,o=1;typeof e=="number"?(n=e,s=e,o=e):typeof e=="object"&&(n=(l=e.x)!=null?l:1,s=(c=e.y)!=null?c:1,o=(d=e.z)!=null?d:1);const r=new E.Vector3(n,s,o);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.hooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}const na="Object3DHelperPlugin",bo=na,X2=()=>{console.error(`${bo} is disposed`)},U2=()=>{console.warn(`${bo} is disabled`)},q2=()=>{console.error(`${bo} is disabled`)};class Gu extends ji{constructor(e){super(e);f(this,"name",na);f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"objectHelperMap",new Map);f(this,"css3DObjectParentMap",new Map);f(this,"css3DRender");this.five=e,this.css3DRender=new Gn(this.five.scene),console.warn("Object3DHelper: 使用此插件,需要在初始化five时,设置five参数: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${na.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 X2();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return q2();const s=F({},this.state);this.state=F(F({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:s})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var m;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 s=new R2,o=[],r=(m=this.five.getElement())==null?void 0:m.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:d=!0,boundingBoxHelper:h=!1}=n,u=new ve.Subscribe;if(l){const g=new k2(e),v=this.getConfig(n.moveHelper),p=new qi(this.five,O2,e,g,v,u);s.addControllers({moveController:p.helperController}),o.push(()=>p.dispose())}if(c){const g=this.getConfig(n.rotateHelper),v=new S2(e,F({container:r},g)),p=new qi(this.five,G2,e,v,g,u);s.addControllers({rotateController:p.helperController}),o.push(()=>p.dispose())}if(h){const g=new V2(e),v=new qi(this.five,W2,e,g,void 0,u);s.addControllers({boundingBoxController:v.helperController})}if(d)if(e.isCSS3DObjectPlus&&r){const g=new j2(e,r,a,this.five.scene),v=new qi(this.five,H2,e,g,void 0,u);s.addControllers({scaleController:v.helperController}),o.push(()=>v.dispose()),$a(this.five).then(()=>{var p,b;if(e.isCSS3DObjectPlus){const w=e;if(!w||w.mode!=="front")return;const P=(p=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?p:el(this.five);P&&(this.css3DObjectParentMap.set(w,w.parent),w.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(P),(b=this.css3DRender.getBehindCSS3DObjectGroup())==null||b.add(w),this.css3DRender.render(this.five.camera))}})}else{const g=new N2(e),v=new qi(this.five,Y2,e,g,void 0,u);s.addControllers({scaleController:v.helperController}),o.push(()=>v.dispose())}return this.objectHelperMap.set(e,{helper:s,disposers:o}),s.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:n,disposers:s}=this.objectHelperMap.get(e);if(n){if(e.isCSS3DObjectPlus){const o=e,r=this.css3DObjectParentMap.get(o);r&&r.add(o),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose(),s==null||s.forEach(o=>o==null?void 0:o())}}handleEnable(e,n=!0){e?(this.everyHelperDo(s=>s.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(s=>s.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(s=>s.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(s=>s.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.objectHelperMap.forEach(({helper:e,disposers:n})=>{e.dispose(),n==null||n.forEach(s=>s==null?void 0:s())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:n,disposers:s})=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&U2()}getConfig(e){if(e&&typeof e!="boolean"&&e.enable)return e}}const J2=i=>new Gu(i),Z2=`
|
|
668
|
+
`;class Yr{constructor(t,e){f(this,"name","");f(this,"startTagContainer");f(this,"endTagContainer");f(this,"mesh");f(this,"five");f(this,"mode");f(this,"path",[]);f(this,"_curvePath",null);f(this,"_curvePoints",null);f(this,"_panoGroup",[]);f(this,"skippedPositions",null);f(this,"textureUrl","");f(this,"scale",1);f(this,"width",.5);f(this,"unitLength",.5);f(this,"_visibleFloorIndexes",null);f(this,"visible",null);f(this,"modeVisible",!1);f(this,"floorVisible",!0);f(this,"defaultVisible",!1);f(this,"inWalkAnimation",!1);f(this,"customVisible",null);f(this,"parent");f(this,"plugin");f(this,"textureHasLoaded",!1);f(this,"disposed",!1);f(this,"flowAnime",new ys({progress:0}).to({progress:1}).duration(1500).repeat(1/0));f(this,"flickerAnime",ws(300).yoyo(!0).repeat(5));f(this,"cacheLengths",[]);f(this,"dispose",()=>{var t,e;this.disposed||(this.disposed=!0,this.parent.hooks.off("show",this.updateVisible),this.parent.hooks.off("hide",this.updateVisible),this.plugin.hooks.off("show",this.updateVisible),this.plugin.hooks.off("hide",this.updateVisible),this.plugin.hooks.off("enable",this.updateVisible),this.plugin.hooks.off("disable",this.updateVisible),this.five.off("modeChange",this.onFiveModeChange),this.five.off("modelShownFloorChange",this.onFiveModelShownFloorChange),this.doHide(),(t=this.startTagContainer)==null||t.plugin.dispose(),(e=this.endTagContainer)==null||e.plugin.dispose())});f(this,"onWalkAnimationStart",()=>{this.inWalkAnimation=!0,this.updateVisible()});f(this,"onWalkAnimationEnd",()=>{this.inWalkAnimation=!1,this.updateVisible()});f(this,"onFiveModeChange",t=>{this.modeVisible=this.mode==="panorama"?Ro(t):tl(t),this.updateVisible()});f(this,"onFiveModelShownFloorChange",t=>{this.floorVisible=t===null||this.visibleFloorIndexes===null||this.visibleFloorIndexes.includes(t),this.updateVisible()});f(this,"updateVisible",()=>{const t=(()=>!this.parent.visible||!this.plugin.state.enabled||!this.plugin.state.visible?!1:this.customVisible!==null?this.customVisible:this.inWalkAnimation?!0:this.modeVisible&&this.textureHasLoaded&&this.defaultVisible&&this.floorVisible)();this.visible!==t&&(this.visible=t,t?this.doShow():this.doHide())});f(this,"onFlowAnimeUpdate",t=>{const{progress:e}=t;this.mesh.material.uniforms.vOffset.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0});f(this,"onFlickerAnimeUpdate",t=>{var s,o;const{progress:e}=t,n=1-e;this.mesh.material.uniforms.flicker.value=n,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0,this.startTagContainer.tag&&Xr(this.startTagContainer.tag)&&((s=this.startTagContainer.app)==null||s.$set(we(F({},this.startTagContainer.tag.data),{opacity:n,name:this.name,distance:Math.round(this.curvePath.getLength())}))),this.endTagContainer.tag&&Xr(this.endTagContainer.tag)&&((o=this.endTagContainer.app)==null||o.$set(we(F({},this.endTagContainer.tag.data),{opacity:n})))});f(this,"logWarning",t=>nb("GuideLineModeItem: ",t));f(this,"logError",t=>Dd("GuideLineModeItem: ",t));var o,r;this.five=t,this.mode=e.mode,this.plugin=e.plugin,this.parent=e.parent,this.startTagContainer={tag:null,plugin:new po(this.five)},this.endTagContainer={tag:null,plugin:new po(this.five)};const n=new E.BufferGeometry,s=new E.ShaderMaterial({vertexShader:i2,fragmentShader:s2,transparent:!0,uniforms:{map:{value:null},useMapColor:{value:0},mapColor:{value:new E.Color},mapOpacity:{value:1},backgroundColor:{value:new E.Color},backgroundOpacity:{value:0},borderColor:{value:new E.Color},borderOpacity:{value:0},opacity:{value:1},flicker:{value:1},maxU:{value:0},vOffset:{value:0}}});this.mesh=new E.Mesh(n,s),this.mesh.name="GuideLineModeItem",this.mode==="panorama"&&(this.parent.hooks.on("walkStart",this.onWalkAnimationStart),this.parent.hooks.on("walkEnded",this.onWalkAnimationEnd)),this.updateVisible(),this.onFiveModeChange(this.five.getCurrentState().mode),this.onFiveModelShownFloorChange((r=(o=this.five.model)==null?void 0:o.shownFloor)!=null?r:null),this.flowAnime.onUpdate(this.onFlowAnimeUpdate),this.flickerAnime.onUpdate(this.onFlickerAnimeUpdate),this.parent.hooks.on("show",this.updateVisible),this.parent.hooks.on("hide",this.updateVisible),this.plugin.hooks.on("show",this.updateVisible),this.plugin.hooks.on("hide",this.updateVisible),this.plugin.hooks.on("enable",this.updateVisible),this.plugin.hooks.on("disable",this.updateVisible),this.plugin.hooks.on("dispose",this.dispose),this.five.on("modeChange",this.onFiveModeChange),this.five.on("modelShownFloorChange",this.onFiveModelShownFloorChange)}get panoGroup(){return this._panoGroup}get visibleFloorIndexes(){return this._visibleFloorIndexes}get curvePath(){return this._curvePath}get curvePoints(){return this._curvePoints}setCustomVisible(t){if(this.disposed)return this.logError("disposed");this.customVisible!==t&&(this.customVisible=t,this.updateVisible())}setDefaultVisible(t){if(this.disposed)return this.logError("disposed");this.defaultVisible!==t&&(this.defaultVisible=t,this.updateVisible())}setUnitSize(t,e){if(this.disposed)return this.logError("disposed");this.width=t,this.unitLength=e,this.setGeometryByPath(this.path,{width:t,unit_length:e})}setScale(t){if(this.disposed)return this.logError("disposed");this.scale=t,this.setGeometryByPath(this.path,{scale:t})}setGeometryByPanoGroup(t,e){if(this.disposed)return this.logError("disposed");if(!this.five.work)return this.logError("setPathByPanoGroup: work is not ready");const n=n2(t);if(this._panoGroup=n,(e==null?void 0:e.skipPanoGroup)!==void 0){const o=e.skipPanoGroup?n.map(r=>this.five.work.observers[r]).map(r=>r.standingPosition.clone()):null;this.skippedPositions=o}const s=this.getPathFromPanoGroup(n,this.five.work,e);this.path=s,this.setGeometryByPath(s,e)}setGeometryByPath(t,e){var d,h,u;if(this.disposed)return this.logError("disposed");const n=(d=e==null?void 0:e.scale)!=null?d:this.scale,s=(h=e==null?void 0:e.width)!=null?h:this.width,o=(u=e==null?void 0:e.unit_length)!=null?u:this.unitLength;this.path=t,this.scale=n,this.width=s,this.unitLength=o;const{geometry:r,maxU:a,curvePath:l,curvePoints:c}=wb({path:t,width:s*n,unitLength:o*n,skipPositions:this.skippedPositions});this._curvePath=l,this._curvePoints=c,this.mesh.geometry=r,this.mesh.material.needsUpdate=!0,this.mesh.material.uniforms.maxU.value=a,this.five.needsRender=!0}setMartial(t){var e;if(this.disposed)return this.logError("disposed");(t==null?void 0:t.visible)!==void 0&&this.setDefaultVisible(t.visible),(t==null?void 0:t.color)!==void 0&&this.setColor(t.color),(t==null?void 0:t.opacity)!==void 0&&this.setOpacity(t.opacity),((e=t==null?void 0:t.texture)==null?void 0:e.url)!==void 0&&this.setTextureUrl(t.texture.url),(t==null?void 0:t.background_color)!==void 0&&this.setBackgroundColor(t.background_color),(t==null?void 0:t.background_opacity)!==void 0&&this.setBackgroundOpacity(t.background_opacity),(t==null?void 0:t.border_color)!==void 0&&this.setBorderColor(t.border_color),(t==null?void 0:t.border_opacity)!==void 0&&this.setBorderOpacity(t.border_opacity)}setColor(t){if(this.disposed)return this.logError("disposed");t&&(this.mesh.material.uniforms.mapColor.value=new E.Color().set(t)),this.mesh.material.uniforms.useMapColor.value=t?1:0,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.borderColor.value=new E.Color().set(t),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.borderOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundColor.value=new E.Color().set(t),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.opacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setMapOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.mapOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setTextureUrl(t){if(this.disposed)return this.logError("disposed");this.textureUrl=t,Vi(t).then(e=>{this.disposed||this.textureUrl===t&&(e.wrapT=E.RepeatWrapping,this.textureHasLoaded=!0,this.mesh.material.uniforms.map.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.mesh.material.needsUpdate=!0,this.five.needsRender=!0,this.updateVisible())})}setVisibleFloorIndexes(t){var e,n;if(this.disposed)return this.logError("disposed");this._visibleFloorIndexes=t,this.onFiveModelShownFloorChange((n=(e=this.five.model)==null?void 0:e.shownFloor)!=null?n:null)}setStartTag(t){this.setTag("start",t)}setEndTag(t){this.setTag("end",t)}flicker(){if(this.disposed)return this.logError("disposed");this.flickerAnime.play()}getLengthByPanoGroupIndex(t){return this.disposed?this.logError("disposed"):this.cacheLengths.length!==0?this.cacheLengths[t]:(this.cacheLengths=this.getPanoGroupLengths(),this.cacheLengths[t])}getPanoGroupLengths(){const t=this.panoGroup.map(c=>this.five.work.observers[c]),e=this.curvePoints.length,n=this.curvePath.getLength(),s=e-1,o=n/s,r=this.curvePath.getLengths(s),a=[];let l=0;for(let c=0;c<e;c++){const d=this.curvePoints[c],h=t[l];if(!h)break;h.standingPosition.clone().setY(0).distanceTo(d.clone().setY(0))<o&&(a.push(r[c]),l+=1)}return a}setTag(t,e){const n=t==="start"?this.startTagContainer:this.endTagContainer;e||n.plugin.clearTags();const o=Ue({},{contentType:"Custom",stickType:"2DPoint",config:{visibleConfig:{visibleFiveMode:["Floorplan","Mapview"],followModelVisibility:!1}},style:{point:{enabled:!1}},data:{}},e);n.tag=o,Xr(o)&&(n.tag.element=r=>{var c;(c=n.app)==null||c.$destroy();const a=t==="start"?we(F({},o.data),{name:this.name,distance:Math.round(this.curvePath.getLength()),i18n:this.plugin.config.i18n}):o.data,l=new t2({target:r,intro:!0,props:a});return n.app=l,()=>l.$destroy()}),n.plugin.load({tagList:[n.tag]})}doShow(){this.mode==="model"&&this.flowAnime.play(),this.five.scene.add(this.mesh),this.startTagContainer.plugin.show(),this.endTagContainer.plugin.show(),this.five.needsRender=!0}doHide(){this.mode==="model"&&this.flowAnime.stop(),this.five.scene.remove(this.mesh),this.startTagContainer.plugin.hide(),this.endTagContainer.plugin.hide(),this.five.needsRender=!0}getPathFromPanoGroup(t,e,n){if(t.length<2)return[];const o=t.map(r=>e.observers[r]).map(r=>r.standingPosition.toArray());return[F({type:"CatmullRomCurve3",points:o},n)]}}function Xr(i){return i.contentType==="Custom"}const o2=Object.freeze(Object.defineProperty({__proto__:null,GuideLineModeItem:Yr},Symbol.toStringTag,{value:"Module"}));function Su(i){const t=Math.abs(Math.cos(i.latitude));return new E.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function r2(i,t){const e=Su(i),n=Su(t);return e.angleTo(n)}const a2=i=>Y(this,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),go=Math.PI*2;function l2(i){return i>=0&&i<go?i:(i%go+go)%go}function c2(i){return{longitude:l2(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function d2(i,t,e,n){const s=-i/e,o=i;return s*n+o}function h2(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Du="v1.0.6",Lu="CruisePlugin",vo=`${Lu}@${Du}`,Tu=()=>{console.error(`${vo} is disposed`)},u2=()=>{console.warn(`${vo} is disabled`)},f2=()=>{console.error(`${vo} is disabled`)},Ur=new Map;class Xi extends Cn{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Lu}_DEBUG__`]:this});const s=this.setFiveLinearUpdateCamera.bind(this),o=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",s),this.hooks.on("broke",o),this.hooks.on("end",o),this.hooks.on("pause",o),this.privateState.disposers.push(()=>{this.hooks.off("play",s),this.hooks.off("broke",o),this.hooks.off("end",o),this.hooks.off("pause",o)})}load(e,n,s){return Y(this,null,function*(){var d,h,u,m,g,v;if(this.state.disposed)return Tu();this.privateState.fiveOriginGetProgress||(h=(d=this.five.controller)==null?void 0:d.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(m=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:m.getProgress),this.clear();const o=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,o);let a=[],l;const c=this.data.keyframes.filter(p=>p.data.panoIndex!==void 0);c.filter((p,b)=>{var w;return p.data.panoIndex!==((w=c[b-1])==null?void 0:w.data.panoIndex)}).map(p=>p.data.panoIndex).forEach(p=>{var w,P;const b=(w=this.five.work.observers[p])==null?void 0:w.floorIndex;if(b!==void 0)if(l===b){const k=a.length-1;a[k]=[...(P=a[k])!=null?P:[],p]}else{l=b;const k=a.length;a[k]=[p]}}),!this.GuideLine&&((g=this.config)==null?void 0:g.useGuideLine)!==!1&&r.useGuildLine!==!1&&(this.GuideLine=Ou(this.five,this.config)),(v=this.GuideLine)==null||v.load({routes:a.map(p=>({panoIndexList:p})),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:s}),console.debug(`${vo} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:s,userAction:o}=e;this.state.playing&&this.setState({playing:!1},{userAction:o}),this.setState({playing:!0},{userAction:o,playFromIndex:n,playFromId:s})}playFromStart(e){return this.playFrom(we(F({},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 o;if(this.state.disposed)return Tu();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return f2();const s=F({},this.state);this.state=F(F({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==s.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==s.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),Ot(s,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}formatData(e){return Y(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,s=(()=>{const o=e;return typeof o=="object"&&o!==null&&o.version&&o.data?o.data:o})();if(s.keyframes)return{keyframesId:tt(),keyframes:s.keyframes.map((o,r)=>{var c;const a=s.keyframes[r+1],l=(()=>!a||a.start===void 0||o.end===void 0?0:a.start-o.end)();return we(F({id:(c=o.uuid)!=null?c:tt(),moveIndex:r,stay:l,index:r},o),{guildPluginOptions:s.guildPluginOptions})})};if(s.panoIndexList){let o=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=s;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,s.panoIndexList.forEach((c,d)=>{const h=(()=>{var p,b,w,P;const u=s.panoIndexList.slice(d).find(k=>k!==c);if(u===void 0)return;const m=(p=n[c])==null?void 0:p.position,g=(b=n[u])==null?void 0:b.position;if(!g||!m||((w=n[c])==null?void 0:w.floorIndex)!==((P=n[u])==null?void 0:P.floorIndex))return;const v=new E.Vector3().subVectors(g,m);return c2(v.normalize())})();s.moveType===void 0||s.moveType==="justMove"?o.push({moveIndex:d,stay:s.stay,data:F({effect:"Move",panoIndex:c,moveEffect:r},h!=null?h:{})}):s.moveType==="moveAndRotate"&&(o.push({moveIndex:d,stay:s.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),h&&o.push({moveIndex:d,stay:s.stay,data:F({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:tt(),keyframes:o.map((c,d)=>F({id:tt(),index:d},c)),guildPluginOptions:s.guildPluginOptions,useGuildLine:s.useGuildLine}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var s,o;e?((s=this.GuideLine)==null||s.enable(),this.hooks.emit("enable",{userAction:n})):((o=this.GuideLine)==null||o.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var s,o;e?((s=this.GuideLine)==null||s.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((o=this.GuideLine)==null||o.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var s;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return Y(this,null,function*(){var m;const{data:n,state:s,privateState:o,hooks:r}=this;if(o.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=tt();o.playId=a,o.playing=!0,o.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(m=e==null?void 0:e.userAction)!=null?m:!0});let d=!1;const u=yield(()=>Y(this,null,function*(){var g,v;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(g=this.data)==null?void 0:g.keyframes.findIndex(p=>p.id===e.playFromId);if(c!=null&&c.keyframeId){const p=(v=this.data)==null?void 0:v.keyframes.find(b=>b.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:o.moveToFirstPanoEffect,duration:o.moveToFirstPanoDuration})),p){if(p.data.effect==="Move")return p.index;if(p.data.effect==="Rotate"){const b=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(p,{duration:b}),d=!0,p.index+1}}}}))();this.clearPauseData();for(const g of l){if(o.broke||!s.playing||!o.playing||a!==o.playId)return;if(!(u!==void 0&&g.index<u))try{r.emit("playIndexChange",g.index,g),yield this.playKeyframe(g,{moveEffect:d===!1?o.moveToFirstPanoEffect:void 0,duration:d===!1&&typeof o.moveToFirstPanoDuration=="number"?o.moveToFirstPanoDuration:void 0}),g.stay&&(yield h2(g.stay)),d===!1&&(d=!0)}catch(v){return Promise.resolve("broke")}}s.playing&&a===o.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:s,hooks:o}=this;n.playing=!1,s.playing!==!1&&(s.playing=!1,this.setPauseData(),s.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&o.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return Y(this,null,function*(){var o;const{privateState:s}=this;return((o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),s.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},s=e;return this.five.once("gesture",s),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",s),this.five.once("wantsChangeMode",n)}}getPlayPromise(s){return Y(this,arguments,function*(e,n={}){var r;const o=e.data;if(n.duration=(r=n.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!o)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const d=()=>{a(),c=!0};switch(o.effect){case"Move":this.move(o,n).then(d);break;case"Rotate":this.rotate(o,n).then(d);break;default:this.rotate(o,n).then(d)}}catch(d){}})})}actionPromiseQueue(){return Y(this,null,function*(){const{privateState:e}=this;return new Promise((n,s)=>{if(e.currentPlayQueue.length===0){n();return}const o=e.currentPlayQueue.shift();if(!o){n();return}o.then(n,s)}).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(s){return Y(this,arguments,function*(e,n={}){const{five:o,privateState:r,state:a}=this,l=(()=>{var m,g;const h=(m=a.config)==null?void 0:m.speedConfig,u=(g=e.rotateSpeed)!=null?g:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return u;if(u!==void 0)return h.rotateSpeedUnit==="rad/ms"?u:u/1e3})(),c=(()=>{if(n.duration)return n.duration;if(l){const h=this.five.getCurrentState();return r2(h,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const d=this.getSpeededDuration(c);return new Promise(h=>{a2(()=>o.updateCamera(e,d)),setTimeout(()=>h(),d)})})}changePano(e,n){return Y(this,null,function*(){const{five:s,privateState:o,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===s.panoIndex)return;const a=s.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var u,m;const d=(u=r.config)==null?void 0:u.speedConfig,h=(m=e.moveSpeed)!=null?m:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return h;if(h!==void 0)return d.moveSpeedUnit==="m/ms"?h:h/1e3})(),c=(()=>{if(n!=null&&n.duration)return n.duration;if(l&&typeof s.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=s.work.observers[s.panoIndex].position,h=s.work.observers[e.panoIndex].position;return d.distanceTo(h)/l}return 800})();o.currentPlayKeyframe&&(o.currentPlayKeyframe.originDuration=c),yield new Promise(d=>{var h,u,m;s.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(m=(u=n==null?void 0:n.moveEffect)!=null?u:(h=this.state.config)==null?void 0:h.moveEffect)!=null?m:e.moveEffect,moveCancelCallback:()=>d(),moveEndCallback:()=>d()}),a&&s.once("panoArrived",()=>d())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:s,privateState:o,hooks:r}=this,{currentPlayKeyframe:a}=o;if(r.emit("speedChange",e,{userAction:n}),s.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});o.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 Ur.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,s,o;if((e=this.data)!=null&&e.keyframesId)return Ur.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id,fiveState:this.five.getCurrentState(),duration:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Ur.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(s=>s==null?void 0:s())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&u2()}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,s=e-n.startTime;return s<0?0:s>=n.duration?1:1-d2(1,n.startVelocity,n.duration,s)})}setFiveOriginUpdateCamera(){this.privateState.fiveOriginGetProgress&&(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(Xi,"PluginVersion",Du);const m2=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),p2=i=>new Xi(i);class zu{constructor(t){f(this,"id");f(this,"renderID");f(this,"isGuideLine",!0);f(this,"panoramaItem");f(this,"modelItem");f(this,"hooks",new ve.Subscribe);f(this,"_visible",!0);f(this,"plugin");f(this,"five");f(this,"logError",t=>Dd("GuideLineItem: ",t));this.id=t.id,this.five=t.five,this.plugin=t.plugin,this.panoramaItem=new Yr(this.five,{mode:"panorama",plugin:this.plugin,parent:this}),this.modelItem=new Yr(this.five,{mode:"model",plugin:this.plugin,parent:this})}get visible(){return this._visible}setData(t){this.setDataByMode("panorama",t),this.setDataByMode("model",t)}setHeightOffset(t){this.modelItem.mesh.position.y=t,this.panoramaItem.mesh.position.y=t}setDataByMode(t,e){var l;const n=t==="panorama"?this.panoramaItem:this.modelItem,s=t==="panorama"?e.panorama_style:e.model_style,o=e.path,r=s,a=s;if(e.pano_group){const c=t==="panorama";n.setGeometryByPanoGroup(e.pano_group,F({skipPanoGroup:c},r))}else e.path&&n.setGeometryByPath(o,r);n.name=e.name,n.setMartial(a),n.setVisibleFloorIndexes((l=e.visible_floor_indexes)!=null?l:null),n.setStartTag(s==null?void 0:s.start_tag),n.setEndTag(s==null?void 0:s.end_tag)}show(){this._visible=!0,this.hooks.emit("show",{userAction:!0})}hide(){this._visible=!1,this.hooks.emit("hide",{userAction:!0})}dispose(){this.panoramaItem.dispose(),this.modelItem.dispose()}walk(t){return Y(this,null,function*(){if(!this.panoramaItem.panoGroup)return;const e=F({panoIndexList:this.panoramaItem.panoGroup},t);this.hooks.emit("walkStart",{userAction:!0});const[n]=yield ti(g2(this.five,e));if(this.hooks.emit("walkEnded",{userAction:!0}),n)return this.logError(n.message)})}}function g2(i,t){return Y(this,null,function*(){if(t.panoIndexList.length===0)return;const e=i.getCurrentState();e.mode!=="Panorama"&&(yield hr(i,["Panorama",{longitude:e.longitude,latitude:0,panoIndex:t.panoIndexList[0]}]));const n=new Xi(i,{useGuideLine:!1});yield n.load(t),yield new Promise((s,o)=>{const r=i.getCurrentState();let a=t.panoIndexList.slice();r.panoIndex===a[0]&&c(r.panoIndex),n.playFromStart();function l(m){if(m!=="Panorama")return h(new Error("mode not match"))}function c(m){const g=a[0];if(a=a.slice(1),m!==g)return h(new Error("panoIndex not match, wanted: "+g+", got: "+m));if(a.length===0)return u()}function d(){i.off("modeChange",l),i.off("panoArrived",c)}function h(m){d(),o(m)}function u(){d(),s()}i.on("modeChange",l),i.on("panoArrived",c)})})}const v2=Object.freeze(Object.defineProperty({__proto__:null,GuideLineItem:zu},Symbol.toStringTag,{value:"Module"})),ju="v1.1.0",qr="GuideLinePlugin",Vu=`${qr}@${ju}`;class A2 extends Cn{constructor(e,n){super(e,n);f(this,"version",ju);f(this,"name",qr);f(this,"cruisePlugin");f(this,"itemMap",new Map);f(this,"state",{visible:!1,enabled:!0});f(this,"data");f(this,"heightOffset",0);f(this,"_config");f(this,"_disposed",!1);f(this,"disposedErrorLog",()=>{console.error(`${Vu} is disposed`)});this._config=n!=null?n:{},this.cruisePlugin=new Xi(e,{useGuideLine:!1}),Object.assign(window,{[`__${qr}_DEBUG__`]:this})}get config(){return this._config}get disposed(){return this._disposed}load(e,n,s=!0){return Y(this,null,function*(){var m,g,v,p,b,w,P;if(this.disposed)return;const o=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,o),this.data=r;const a=r.config,c={panorama_style:{visible:!!(!r.lines&&r.routes),unit_length:(m=a==null?void 0:a.unitHeight)!=null?m:.4,width:(g=a==null?void 0:a.unitWidth)!=null?g:.6,texture:{url:(v=a==null?void 0:a.arrowTextureUrl)!=null?v:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"}}},d=(b=(p=r.routes)==null?void 0:p.map(k=>{var T;return Ue({},c,{id:(T=k.id)!=null?T:Date.now(),pano_group:k.panoIndexList})}))!=null?b:[],h=(P=(w=r.lines)==null?void 0:w.map(k=>Ue({},c,k)))!=null?P:[],u=[...d,...h];yield this.waitFiveLoaded(),this.clear(),u.forEach(k=>{this.addGuideLineItem(k)}),this.updateTagsEnable(),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n,{userAction:s}),this.hooks.emit("dataLoaded",r),console.debug(`${Vu} loaded`,r)})}formatData(e){return Y(this,null,function*(){return this.getDataWithoutVersion(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.disposed||(this.clear(),this.hooks.emit("dispose"))}setState(e,n){var o;if(this.disposed)return this.disposedErrorLog();const s=F({},this.state);this.state=F(F({},this.state),e),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),Ot(s,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(o=n==null?void 0:n.userAction)!=null?o:!0}),this.five.needsRender=!0)}addGuideLineItem(e){const n=e.render_id||e.id,s=this.itemMap.get(n);s&&this.removeGuideLineItem(s);const o=new zu({five:this.five,id:n,plugin:this});return this.itemMap.set(n,o),e&&o.setData(e),this.heightOffset+=1e-4,o.setHeightOffset(this.heightOffset),o}getGuideLineItemByID(e){return this.itemMap.get(e)}removeGuideLineItem(e){this.itemMap.delete(e.id),e.panoramaItem.dispose(),e.modelItem.dispose()}updateTagsEnable(){const e=[];function n(r){return Array.isArray(r)&&r.every(a=>typeof a=="number")}function s(r,a){return new E.Vector3().fromArray(r).distanceTo(new E.Vector3().fromArray(a))<.01}function o(r){var l;const a=(l=r.tag)==null?void 0:l.position;return n(a)?e.every(c=>{var d;return n((d=c.tag)==null?void 0:d.position)?!s(a,c.tag.position):!0}):!1}this.itemMap.forEach(r=>{const a=r.modelItem.startTagContainer,l=r.modelItem.endTagContainer,c=o(a);c&&e.push(a),a.plugin.setState({enabled:c},{});const d=o(l);d&&e.push(l),l.plugin.setState({enabled:d},{})})}clear(){this.itemMap.forEach(e=>{this.removeGuideLineItem(e)})}handleEnable(e,n=!0){this.hooks.emit(e?"enable":"disable",{userAction:n})}handleVisible(e,n=!0){this.state.enabled&&this.hooks.emit(e?"show":"hide",{userAction:n})}waitFiveLoaded(){return Y(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}getDataWithoutVersion(e){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e}}const Ou=(i,t)=>new A2(i,t);function Bu(i,t,e){if(e){const s=new E.Vector3().subVectors(i.position,e).applyQuaternion(i.quaternion.clone().inverse()).applyQuaternion(t).add(e);i.position.copy(s)}i.quaternion.copy(t)}class Ao extends Qc{constructor(e,n){var s;super();f(this,"originObject3D");f(this,"onRender");this.originObject3D=e,this.onRender=(s=n==null?void 0:n.onRender)!=null?s:()=>{}}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,n=[]){return e.intersectObject(this,!0,n)}initialPosition(){this.position.add(this.originObject3D.position)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}setHelperQuaternion(e,n){Bu(this,e,n)}applyHelperQuaternion(e,n){if(n){const s=new _.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(s)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class b2 extends Ao{}class y2 extends Ao{}class w2 extends Ao{}class _u extends Ao{}class C2 extends _u{}class P2 extends E.Group{constructor(e){super();f(this,"direction");this.direction=e||"x"}}class Qu extends E.Mesh{constructor(e,n,s){super(e,n);f(this,"direction");this.direction=s||"x"}}function I2(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:s,left:o}=t.getBoundingClientRect();return Object.assign(new E.Vector2,{x:(i.x-o)/e*2-1,y:-(i.y-s)/n*2+1})}function Jr(i,t,e){if(!t||!e||!i)return;const n=I2(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const s=new E.Raycaster;return s.setFromCamera(n,i),s}function E2(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 Zr extends P2{constructor(e){var d;super(e.direction);f(this,"line");f(this,"arrow");f(this,"lineHeight",.4);f(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new E.Color((d=e.color)!=null?d:16214315),s=new E.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:E.DoubleSide}),o=new E.ConeGeometry(.04,.1,32),r=new Qu(o,s.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new E.CylinderGeometry(a,a,.4,32),c=new Qu(l,s.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const Kr={X:15618642,Y:4765519,Z:4227839};class fi{static get X(){return new E.Color(Kr.X).convertSRGBToLinear().clone()}static get Y(){return new E.Color(Kr.Y).convertSRGBToLinear().clone()}static get Z(){return new E.Color(Kr.Z).convertSRGBToLinear().clone()}}class k2 extends b2{constructor(e){super(e);f(this,"xArrow",new Zr({direction:"x",color:fi.X}));f(this,"yArrow",new Zr({direction:"y",color:fi.Y}));f(this,"zArrow",new Zr({direction:"z",color:fi.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 Sn(i,t){return x2(document.createElement(t!=null?t:"div"),i)}function x2(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function M2(i){const t=Sn(F({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"99999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},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:(o,r)=>{t.style.left=o,t.style.top=r,e()}}}class S2 extends w2{constructor(e,n){super(e);f(this,"xCircle");f(this,"yCircle");f(this,"zCircle");f(this,"children",[]);f(this,"angleTips");f(this,"container");(n==null?void 0:n.yzCircleEnable)!==!1&&(this.xCircle=new $r({direction:"x",color:fi.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.yCircle=new $r({direction:"y",color:fi.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.zCircle=new $r({direction:"z",color:fi.Z})),n!=null&&n.container&&(n==null?void 0:n.angleTipsEnable)!==!1&&(this.container=n==null?void 0:n.container,this.angleTips=M2({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(n=>n.showCircle()),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.children.filter(s=>e.includes(s.direction)).forEach(s=>s.showRing()),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.removeFromParent(),(n=(e=this.angleTips)==null?void 0:e.element)==null||n.remove()}}class $r extends E.Group{constructor(e){super();f(this,"direction");f(this,"circle");f(this,"ring");f(this,"angleSector");this.direction=e.direction,this.circle=new D2(e),this.ring=new L2(e),this.angleSector=new T2(e),this.add(this.circle,this.ring,this.angleSector),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}showCircle(){this.add(this.circle),this.remove(this.ring,this.angleSector)}showRing(){this.add(this.ring,this.angleSector),this.remove(this.circle)}hide(){this.remove(this.ring,this.angleSector,this.circle)}}class D2 extends E.Mesh{constructor(e){var n;super();f(this,"direction");f(this,"gapAngle",.02);f(this,"geometry",new E.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new E.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:E.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`}}class L2 extends E.Group{constructor(e){super();f(this,"direction");this.direction=e.direction;const n=.015,s=new Array(8).fill(null).map((o,r)=>{const a=new E.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new E.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),c=new E.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...s)}}class T2 extends E.Mesh{constructor(e){var s;super();f(this,"direction");f(this,"baseAxes");f(this,"angleDirection");switch(e.direction){case"x":this.baseAxes=new E.Vector3(0,0,1);break;case"y":this.baseAxes=new E.Vector3(1,0,0);break;case"z":this.baseAxes=new E.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new E.CircleGeometry(n,48,0,1e-4),this.material=new E.MeshBasicMaterial({opacity:.4,color:(s=e.color)!=null?s:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function z2(){const i=Sn({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Sn({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Sn({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",s={direction:"nesw",element:pn({cursor:"nesw-resize",left:n,bottom:n})},o={direction:"ns",element:pn({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:pn({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:pn({cursor:"ew-resize",right:n})},l={direction:"nesw",element:pn({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:pn({cursor:"ns-resize",top:n})},d={direction:"nwse",element:pn({cursor:"nwse-resize",left:n,top:n})},h={direction:"ew",element:pn({cursor:"ew-resize",left:n})};return new Array(o,a,c,h,s,r,l,d).forEach(m=>t.appendChild(m.element)),{container:i,squares:[s,o,r,a,l,c,d,h]}}function pn(i){const t=Sn(F({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Sn({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Sn({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 j2 extends C2{constructor(e,n,s,o){super(e);f(this,"points",[]);f(this,"cornerPositions",[]);f(this,"css3DInstance");f(this,"plane");f(this,"css3DRenderer",new Gn);f(this,"camera");f(this,"scene");f(this,"container");f(this,"enabled",!1);this.camera=s,this.scene=o,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(s=>s.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var s;(s=this.plane)==null||s.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,s)=>{n.position.copy(e[s])})}applyHelperQuaternion(e,n){var o;const s=(o=this.css3DInstance)==null?void 0:o.css3DObject;if(s){const r=new E.Vector3().subVectors(s.position,n).applyQuaternion(e).add(n);s.position.copy(r),s.applyQuaternion(e)}if(this.plane){const r=new E.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 E.Vector3().subVectors(r,n).applyQuaternion(e).add(n);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;this.enabled&&(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a,l;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const n=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!n)return;this.css3DInstance=n,n.appendToElement(this.container);const s=n.css3DObject.container,{container:o,squares:r}=z2();this.points=r.map((c,d)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[d]})),s.insertBefore(o,(a=s.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("当前物体暂时不支持 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}function Ru(i){const t=new E.Box3,e=new E.Vector3;if(i.traverse(n=>{var o;if(n.name==="shadow")return;const s=n.geometry;if(s!==void 0)if((o=s==null?void 0:s.attributes)!=null&&o.position){const r=s.attributes.position;for(let a=0,l=r.count;a<l;a++)e.fromBufferAttribute(r,a).applyMatrix4(n.matrix),t.expandByPoint(e)}else s.vertices.forEach(r=>{const a=r.clone().applyMatrix4(n.matrix);t.expandByPoint(a)})}),!t.isEmpty())return t}class V2 extends y2{constructor(e){super(e);f(this,"box");f(this,"outline");f(this,"originObject");f(this,"positionAttribute");this.originObject=e,this.positionAttribute=new E.BufferAttribute(new Float32Array(8*3),3),this.box=this.createBox(),this.outline=this.createOutline(),this.add(this.box,this.outline),this.update()}raycasterIntersectObject(e,n){return e.intersectObject(this,!1,n)}raycast(e,n){this.box.raycast(e,n)}update(){const e=Ru(this.originObject);if(!e)return;const{min:n,max:s}=e;this.positionAttribute.setXYZ(0,s.x,s.y,s.z),this.positionAttribute.setXYZ(1,n.x,s.y,s.z),this.positionAttribute.setXYZ(2,n.x,n.y,s.z),this.positionAttribute.setXYZ(3,s.x,n.y,s.z),this.positionAttribute.setXYZ(4,s.x,s.y,n.z),this.positionAttribute.setXYZ(5,n.x,s.y,n.z),this.positionAttribute.setXYZ(6,n.x,n.y,n.z),this.positionAttribute.setXYZ(7,s.x,n.y,n.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const s=new E.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),o=new E.LineSegments(n,s);return o.matrixAutoUpdate=!1,o}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const s=new E.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new E.Mesh(n,s)}}class Ui{constructor(t,e){f(this,"originObject3D");f(this,"hooks");f(this,"disposers",[]);f(this,"helperObject3D");f(this,"camera");f(this,"model");f(this,"scene");f(this,"container");f(this,"domEvents");f(this,"isDragging",!1);f(this,"enabled",!1);f(this,"name","BaseController");f(this,"boundingBox");f(this,"offset");f(this,"onRender");f(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});var c,d;this.hooks=(c=t.sharedHooks)!=null?c:new Qn,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new De(t.camera,t.container),this.onRender=(d=t.onRender)!=null?d:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const n=(...h)=>this.onSetOriginObjectScale(...h),s=(...h)=>this.onSetOriginObjectRotate(...h),o=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",n),this.hooks.on("setObjectRotate",s),this.hooks.on("setObjectPosition",o),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",n),this.hooks.off("setObjectRotate",s),this.hooks.off("setObjectPosition",o),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){this.enabled&&(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,n=new E.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),s=new E.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),o=this.calculateOffset(this.offset,{min:s,max:n});this.helperObject3D.position.copy(o),this.helperObject3D.initialPosition()}}hoverListener(t,e=16777215,n=1){const s=(Array.isArray(t)?t:[t]).filter(Fn),o=[];for(const r of s)if(r instanceof E.Mesh||r instanceof E.Group){const a=r instanceof E.Group?r.children.filter(u=>u instanceof E.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()},h=()=>{this.isDragging||c()};for(const u of a)this.domEvents.addEventListener(u,"mouseover",d),this.domEvents.addEventListener(u,"mouseout",h),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),o.push(()=>{this.domEvents.removeEventListener(u,"mouseover",d),this.domEvents.removeEventListener(u,"mouseout",h),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>o.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;const s=this.helperObject3D.raycasterIntersectObject(t)[0];if(!s)return;const o=s;if(o.object=n,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<o.point.distanceTo(e))return}return o.object}calculateOffset(t,e){const n=this.originObject3D,s=new E.Vector3(0,0,0);if(!t)return s;const o=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=Ru(n),this.boundingBox));if(typeof t.x=="number")s.setX(t.x);else if(typeof t.x=="object"){const r=o();s.setX((r.max.x-r.min.x)*t.x.percents)}if(typeof t.y=="number")s.setY(t.y);else if(typeof t.y=="object"){const r=o();s.setY((r.max.y-r.min.y)*t.y.percents)}if(typeof t.z=="number")s.setZ(t.z);else if(typeof t.z=="object"){const r=o();s.setZ((r.max.z-r.min.z)*t.z.percents)}return s}}class O2 extends Ui{constructor(...e){super(...e);f(this,"name","MoveController");f(this,"startInfo");f(this,"_moveByMouseEnable",!1);f(this,"mouseInfo");f(this,"mousedownEventListenerDisposer");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const s=this.dragStart.bind(this),o=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),this.hooks.on("rotateStart",l),this.hooks.on("rotateEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",s),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),this.hooks.off("rotateStart",l),this.hooks.off("rotateEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouseEnable}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(n=>n==null?void 0:n())}moveByMouse(){this._moveByMouseEnable=!0;const e=this.handleMouseDown.bind(this),n=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",n)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",n)}}disableMoveByMouse(){var e;this._moveByMouseEnable=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){!this.moveByMouseEnable||this.hooks.emit("wantToMove",e.point)||(this.originObject3D.position.copy(e.point),this.hooks.emit("setObjectPosition",e.point),this.hooks.emit("move",e.point))}onApplyOriginObjectScale(e){}handleMouseDown(e){const{x:n,y:s}=e;this.mouseInfo={x:n,y:s,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:n,y:s}=e;this.mouseInfo.x===n&&this.mouseInfo.y===s&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}dragStart(e){if(this._moveByMouseEnable||this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const s=(n==null?void 0:n.object).direction;if(!s)return this.dragEnd();const o=new E.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new E.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new E.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(s){case"x":return o;case"y":return r;case"z":return a}})(),c=(()=>{switch(s){case"x":case"y":return a;case"z":return o}})(),d=n.point.clone(),h=new E.Plane;h.setFromNormalAndCoplanarPoint(c,d),this.startInfo={startVectorProject:d.clone().projectOnVector(l),directionVector:l,plane:h},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("moveStart"),this.isDragging=!0}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=Jr(this.camera,e,this.container);return n?(this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:s,startVectorProject:o}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new E.Vector3);if(!a)return;const l=a.clone().projectOnVector(s),c=l.clone().sub(o),d=new E.Matrix4;d.setPosition(c);const h=r.position.clone().applyMatrix4(d);this.hooks.emit("wantToMove",h)||(r.applyMatrix4(d),o.copy(l),this.hooks.emit("applyObjectPosition",{matrix:d}),this.hooks.emit("move",h))}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class qi{constructor(t,e,n,s,o,r){f(this,"helperController");f(this,"five");f(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});f(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});f(this,"onFiveIntersectionOnModelUpdate",(...t)=>{this.helperController&&this.helperController.onIntersectionOnModelUpdate(...t)});const{camera:a,model:l,scene:c}=t,d=t.getElement();if(this.five=t,!a||!l||!d||!c)return;const h=()=>{t.needsRender=!0};this.helperController=new e({camera:a,model:l,originObject3D:n,helperObject3D:s,container:d,scene:c,onRender:h,sharedHooks:r},o),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const ea="Object3DHelper@v1.0.1",B2=()=>{console.error(`${ea} is disposed`)},_2=()=>{console.warn(`${ea} is disabled`)},Q2=()=>{console.error(`${ea} is disabled`)};class R2{constructor(t){f(this,"controllers",{});f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"hooks",new Qn);f(this,"eventListener",{});t&&this.addControllers(t),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 B2();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return Q2();const n=F({},this.state);this.state=F(F({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=F(F({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose()});for(const n in this.controllers){if(!n)continue;const s=n;(e=(t=this.eventListener)[s])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&_2()}}function ta(i){return i*Math.PI/180}class G2 extends Ui{constructor(...e){var c,d,h;super(...e);f(this,"name","RotateController");f(this,"startInfo");f(this,"removeListener");const n=this.helperObject3D;this.hoverListener([(c=n.xCircle)==null?void 0:c.circle,(d=n.yCircle)==null?void 0:d.circle,(h=n.zCircle)==null?void 0:h.circle].filter(Boolean));const s=this.dragStart.bind(this),o=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.removeListener=()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",s),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}}get rotateCenter(){return this.helperObject3D.position.clone()}initialHelperQuaternion(){this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:n=0,y:s=0,z:o=0}=e,r=new E.Euler(ta(n),ta(s),ta(o)),a=new E.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:d}=this;Bu(c,a,d),this.hooks.emit("setObjectRotate",a,d),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const s=(n==null?void 0:n.object).direction;if(!s)return this.dragEnd();const o=n.point,r=this.getAngleHelper(s);this.setTipsAngle(0);const a=o.clone();a.y+=.2,this.setTipsPosition(a);const l=(()=>{if(s==="x")return new E.Vector3(1,0,0).applyQuaternion(this.originObject3D.quaternion);if(s==="y")return new E.Vector3(0,1,0).applyQuaternion(this.originObject3D.quaternion);if(s==="z")return new E.Vector3(0,0,1).applyQuaternion(this.originObject3D.quaternion)})(),c=new E.Plane().setFromNormalAndCoplanarPoint(l,o),h=c.projectPoint(o.clone(),new E.Vector3).clone().sub(this.rotateCenter),u=h.angleTo(r.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));this.setAngleHelperStart(s,u),this.setAngleHelperLength(s,0),this.startInfo={direction:s,startVector:h,plane:c,angleHelper:r,angle:0,objectQuaternion:this.originObject3D.quaternion.clone()},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=Jr(this.camera,e,this.container);return n?(this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:s,angleHelper:o,direction:r,objectQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(s,new E.Vector3);if(!c)return;const d=this.rotateCenter.clone(),u=s.projectPoint(c.clone(),new E.Vector3).clone().sub(d);if(n.angleTo(u)===0)return;const m=new E.Quaternion().setFromUnitVectors(n.clone().normalize(),u.clone().normalize()),g=l.quaternion.clone().premultiply(m);if(this.hooks.emit("wantToRotate",g))return;const b=new E.Euler().setFromQuaternion(new E.Quaternion().setFromUnitVectors(n.clone().normalize().applyQuaternion(a.clone().inverse()),u.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*o.angleDirection;if(this.startInfo.angle+=b,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle(Rl(this.startInfo.angle)),d){const w=new E.Vector3().subVectors(l.position,d).applyQuaternion(m).add(d);l.position.copy(w)}l.applyQuaternion(m),this.hooks.emit("applyObjectRotate",{quaternion:m,origin:d}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=u}dragEnd(){this.isDragging&&(this.hooks.emit("setObjectRotate",this.originObject3D.quaternion,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var n,s,o;switch(e){case"x":return(n=this.helperObject3D.xCircle)==null?void 0:n.angleSector;case"y":return(s=this.helperObject3D.yCircle)==null?void 0:s.angleSector;case"z":return(o=this.helperObject3D.zCircle)==null?void 0:o.angleSector}}setAngleHelperStart(e,n){const s=this.getAngleHelper(e);if(!s){console.warn("angleHelper is undefined");return}if(s instanceof E.Mesh&&s.geometry instanceof E.CircleGeometry){const{radius:o,segments:r,thetaLength:a}=s.geometry.parameters;s.geometry=new E.CircleGeometry(o,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const o=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof E.Mesh&&r.geometry instanceof E.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(o)*(40/(2*Math.PI)));r.geometry=new E.CircleGeometry(a,c,l,o)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var s;const n=(s=this.helperObject3D.angleTips)==null?void 0:s.element;n&&(n.innerText=`${e.toFixed(0)}°`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const s=e.project(this.camera),{x:o,y:r,z:a}=s;if(a>1)return;const l=(o+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class F2 extends Ui{constructor(...e){super(...e);f(this,"startInfo");f(this,"name","RectangleScaleController")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}onApplyOriginObjectPosition(e){this.isDragging||super.onApplyOriginObjectPosition(e)}onApplyOriginObjectScale(e){this.helperObject3D.applyHelperScaleMatrix4(e.matrix,e.origin)}getDragPlane(){const e=new E.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new _.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var o,r;(r=(o=this.helperObject3D).updatePoints)==null||r.call(o);const s=this.getDragPlane();if(!s)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:s},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=Jr(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n)}scale(e){var X,Z;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:s,plane:o}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(o,new _.Vector3);if(!a||E2(a,this.camera.position))return;const l=new _.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:d}=s,h=new _.Vector3().subVectors(r[1],r[0]),u=new _.Vector3().subVectors(r[3],r[0]),m=G=>{const R=new _.Vector3(0,0,0);if(!this.startInfo)return R;const H=(G==="ew"?h:u).clone(),Q=c.clone().projectOnVector(H),W=a.clone().projectOnVector(H),q=l.clone().projectOnVector(H);if(W.equals(Q))return R;if(G==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const de=new _.Vector3().subVectors(W,q),oe=de.x<0&&H.x>=0,Pe=de.y<0&&H.y>=0,Ie=de.z<0&&H.z>=0;this.startInfo.dragPointInCenterBottom=oe||Pe||Ie}if(G==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const de=new _.Vector3().subVectors(W,q),oe=de.x<0&&H.x>=0,Pe=de.y<0&&H.y>=0,Ie=de.z<0&&H.z>=0;this.startInfo.dragPointInCenterLeft=oe||Pe||Ie}const U=new _.Vector3().subVectors(W,Q),K=U.length();return K>.3?(console.warn("offset.length() > 0.3, skipped",K),R):U},g=m("ew"),v=m("ns"),p=()=>{const G=g;this.helperObject3D.cornerPositions.forEach((R,H)=>{var Q;(Q=this.startInfo)!=null&&Q.dragPointInCenterLeft?(H===0||H===3)&&R.add(G):(H===1||H===2)&&R.add(G)})},b=()=>{const G=v;this.helperObject3D.cornerPositions.forEach((R,H)=>{var Q;(Q=this.startInfo)!=null&&Q.dragPointInCenterBottom?(H===0||H===1)&&R.add(G):(H===2||H===3)&&R.add(G)})};switch(d){case"ew":p();break;case"ns":b();break;case"nesw":case"nwse":p(),b()}const w=new _.Vector3().subVectors(r[1],r[0]).length()/h.length(),P=new _.Vector3().subVectors(r[3],r[0]).length()/u.length(),k=new _.Vector3(w,P,1),T=new E.Matrix4().scale(k);n.isCSS3DObjectPlus?n.applyScaleMatrix4(T):n.scale.applyMatrix4(T),s.position.copy(a);const I=new _.Vector3().addVectors(r[0],r[2]).divideScalar(2),B=new _.Vector3().subVectors(I,l),L=new E.Matrix4().setPosition(B);n.applyMatrix4(L),(X=this.helperObject3D.css3DInstance)==null||X.css3DObject.applyMatrix4(L),(Z=this.helperObject3D.plane)==null||Z.applyMatrix4(L),this.hooks.emit("applyObjectScale",{matrix:T}),this.hooks.emit("applyObjectPosition",{matrix:L}),this.render()}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class H2 extends F2{constructor(...e){super(...e);f(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const n=e.point,s=a=>this.dragStart(a,e),o=this.dragging.bind(this),r=this.dragEnd.bind(this);n.addEventListener("dragstart",s),n.addEventListener("drag",o),n.addEventListener("dragend",r)})}}class W2 extends Ui{constructor(...e){super(...e);f(this,"name","BoundingBoxController")}}class N2 extends _u{constructor(t){super(t)}}class Y2 extends Ui{constructor(...e){super(...e);f(this,"name","ScaleController")}setScale(e){var l,c,d;let n=1,s=1,o=1;typeof e=="number"?(n=e,s=e,o=e):typeof e=="object"&&(n=(l=e.x)!=null?l:1,s=(c=e.y)!=null?c:1,o=(d=e.z)!=null?d:1);const r=new E.Vector3(n,s,o);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.hooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}const na="Object3DHelperPlugin",bo=na,X2=()=>{console.error(`${bo} is disposed`)},U2=()=>{console.warn(`${bo} is disabled`)},q2=()=>{console.error(`${bo} is disabled`)};class Gu extends ji{constructor(e){super(e);f(this,"name",na);f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"objectHelperMap",new Map);f(this,"css3DObjectParentMap",new Map);f(this,"css3DRender");this.five=e,this.css3DRender=new Gn(this.five.scene),console.warn("Object3DHelper: 使用此插件,需要在初始化five时,设置five参数: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${na.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 X2();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return q2();const s=F({},this.state);this.state=F(F({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:s})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var m;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 s=new R2,o=[],r=(m=this.five.getElement())==null?void 0:m.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:d=!0,boundingBoxHelper:h=!1}=n,u=new ve.Subscribe;if(l){const g=new k2(e),v=this.getConfig(n.moveHelper),p=new qi(this.five,O2,e,g,v,u);s.addControllers({moveController:p.helperController}),o.push(()=>p.dispose())}if(c){const g=this.getConfig(n.rotateHelper),v=new S2(e,F({container:r},g)),p=new qi(this.five,G2,e,v,g,u);s.addControllers({rotateController:p.helperController}),o.push(()=>p.dispose())}if(h){const g=new V2(e),v=new qi(this.five,W2,e,g,void 0,u);s.addControllers({boundingBoxController:v.helperController})}if(d)if(e.isCSS3DObjectPlus&&r){const g=new j2(e,r,a,this.five.scene),v=new qi(this.five,H2,e,g,void 0,u);s.addControllers({scaleController:v.helperController}),o.push(()=>v.dispose()),$a(this.five).then(()=>{var p,b;if(e.isCSS3DObjectPlus){const w=e;if(!w||w.mode!=="front")return;const P=(p=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?p:el(this.five);P&&(this.css3DObjectParentMap.set(w,w.parent),w.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(P),(b=this.css3DRender.getBehindCSS3DObjectGroup())==null||b.add(w),this.css3DRender.render(this.five.camera))}})}else{const g=new N2(e),v=new qi(this.five,Y2,e,g,void 0,u);s.addControllers({scaleController:v.helperController}),o.push(()=>v.dispose())}return this.objectHelperMap.set(e,{helper:s,disposers:o}),s.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:n,disposers:s}=this.objectHelperMap.get(e);if(n){if(e.isCSS3DObjectPlus){const o=e,r=this.css3DObjectParentMap.get(o);r&&r.add(o),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose(),s==null||s.forEach(o=>o==null?void 0:o())}}handleEnable(e,n=!0){e?(this.everyHelperDo(s=>s.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(s=>s.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(s=>s.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(s=>s.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.objectHelperMap.forEach(({helper:e,disposers:n})=>{e.dispose(),n==null||n.forEach(s=>s==null?void 0:s())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:n,disposers:s})=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&U2()}getConfig(e){if(e&&typeof e!="boolean"&&e.enable)return e}}const J2=i=>new Gu(i),Z2=`
|
|
669
669
|
varying vec2 vUv;
|
|
670
670
|
void main() {
|
|
671
671
|
vUv = uv;
|